mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Improvements to Drift-Node
This commit is contained in:
@@ -15,7 +15,7 @@ export class DriftOAuth2Api implements ICredentialType {
|
|||||||
displayName: 'Authorization URL',
|
displayName: 'Authorization URL',
|
||||||
name: 'authUrl',
|
name: 'authUrl',
|
||||||
type: 'hidden' as NodePropertyTypes,
|
type: 'hidden' as NodePropertyTypes,
|
||||||
default: 'ttps://dev.drift.com/authorize',
|
default: 'https://dev.drift.com/authorize',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -31,6 +31,12 @@ export class DriftOAuth2Api implements ICredentialType {
|
|||||||
type: 'hidden' as NodePropertyTypes,
|
type: 'hidden' as NodePropertyTypes,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Scope',
|
||||||
|
name: 'scope',
|
||||||
|
type: 'hidden' as NodePropertyTypes,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Authentication',
|
displayName: 'Authentication',
|
||||||
name: 'authentication',
|
name: 'authentication',
|
||||||
|
|||||||
@@ -46,8 +46,9 @@ export async function driftApiRequest(this: IExecuteFunctions | IWebhookFunction
|
|||||||
return await this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options);
|
return await this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response) {
|
|
||||||
const errorMessage = error.message || (error.response.body && error.response.body.message );
|
if (error.response && error.response.body && error.response.body.error) {
|
||||||
|
const errorMessage = error.response.body.error.message;
|
||||||
throw new Error(`Drift error response [${error.statusCode}]: ${errorMessage}`);
|
throw new Error(`Drift error response [${error.statusCode}]: ${errorMessage}`);
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user