mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Mindee Node): Add support for new version (#3596)
* Added versioning, with new credentials * Fix lint issue * 🔥 Remove old import name * Change function name * 🎨 Simplify name of versions within the node mindee * 🎨 Change version type from string to number * 🔥 Removed Mindee from getting ignored by prettier * 🎨 Ran prettier on Mindee folder * 🔥 Removed unused import * 🎨 Moved exceptions that were not working anymore Co-authored-by: Omar Ajoue <krynble@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialType,
|
||||
IHttpRequestOptions,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -15,4 +17,14 @@ export class MindeeReceiptApi implements ICredentialType {
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
async authenticate(credentials: ICredentialDataDecryptedObject, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions> {
|
||||
// @ts-ignore
|
||||
const url = requestOptions.url ? requestOptions.url : requestOptions.uri;
|
||||
if(url.includes('https://api.mindee.net/v1/')) {
|
||||
requestOptions.headers!['Authorization'] = `Token ${credentials.apiKey}`;
|
||||
} else {
|
||||
requestOptions.headers!['X-Inferuser-Token'] = `${credentials.apiKey}`;
|
||||
}
|
||||
return requestOptions;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user