mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(ZendeskTrigger Node): Fix deprecated targets, replaced with webhooks (#3025)
* 🔨 fix for deprecated targets * ⚡ Move crendentials injection to the credential file Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
This commit is contained in:
@@ -76,7 +76,6 @@ export class Zendesk implements INodeType {
|
||||
],
|
||||
},
|
||||
},
|
||||
testedBy: 'zendeskSoftwareApiTest',
|
||||
},
|
||||
{
|
||||
name: 'zendeskOAuth2Api',
|
||||
@@ -153,42 +152,6 @@ export class Zendesk implements INodeType {
|
||||
};
|
||||
|
||||
methods = {
|
||||
credentialTest: {
|
||||
async zendeskSoftwareApiTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise<INodeCredentialTestResult> {
|
||||
const credentials = credential.data;
|
||||
const subdomain = credentials!.subdomain;
|
||||
const email = credentials!.email;
|
||||
const apiToken = credentials!.apiToken;
|
||||
|
||||
const base64Key = Buffer.from(`${email}/token:${apiToken}`).toString('base64');
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Basic ${base64Key}`,
|
||||
},
|
||||
method: 'GET',
|
||||
uri: `https://${subdomain}.zendesk.com/api/v2/ticket_fields.json`,
|
||||
qs: {
|
||||
recent: 0,
|
||||
},
|
||||
json: true,
|
||||
timeout: 5000,
|
||||
};
|
||||
|
||||
try {
|
||||
await this.helpers.request!(options);
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
message: `Connection details not valid: ${error.message}`,
|
||||
};
|
||||
}
|
||||
return {
|
||||
status: 'OK',
|
||||
message: 'Authentication successful!',
|
||||
};
|
||||
},
|
||||
},
|
||||
loadOptions: {
|
||||
// Get all the custom fields to display them to user so that he can
|
||||
// select them easily
|
||||
|
||||
Reference in New Issue
Block a user