UNPKG

@tuanltntu/n8n-nodes-bitrix24

Version:

Comprehensive n8n community node for Bitrix24 API integration with CRM, Tasks, Chat, Telephony, and more

108 lines 3.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bitrix24OAuth = void 0; class Bitrix24OAuth { constructor() { this.name = "bitrix24OAuth"; this.extends = ["oAuth2Api"]; this.displayName = "Bitrix24 OAuth2"; this.documentationUrl = "bitrix24"; this.icon = { light: "file:../nodes/Bitrix24/bitrix24.svg", dark: "file:../nodes/Bitrix24/bitrix24.svg", }; this.properties = [ { displayName: "Portal URL", name: "portalUrl", type: "string", default: "", placeholder: "https://your-portal.bitrix24.com", description: "The URL of your Bitrix24 portal. Format should be: https://your-portal.bitrix24.com", required: true, }, { displayName: "OAuth Scope", name: "scope", type: "string", default: "crm", description: "Comma-separated list of scopes to request. Example: crm,task,calendar,bizproc", required: true, }, { displayName: "Client ID", name: "clientId", type: "string", default: "", required: true, }, { displayName: "Client Secret", name: "clientSecret", type: "string", typeOptions: { password: true, }, default: "", required: true, }, { displayName: "Authorization URL", name: "authUrl", type: "hidden", default: "=={{$parameter.portalUrl}}/oauth/authorize", required: true, }, { displayName: "Access Token URL", name: "accessTokenUrl", type: "hidden", default: "https://oauth.bitrix.info/oauth/token/", required: true, }, { displayName: "Auth URI Query Parameters", name: "authQueryParameters", type: "hidden", default: "response_type=code", required: true, }, { displayName: "Authentication", name: "authentication", type: "hidden", default: "body", required: true, }, { displayName: "Ignore SSL Issues", name: "ignoreSSLIssues", type: "boolean", default: false, description: "Whether to connect even if SSL certificate validation is not possible", }, ]; // This allows the credential to be used by other parts of n8n this.authenticate = { type: "generic", properties: { qs: { auth: "={{$credentials.accessToken}}", }, }, }; // Test the credentials this.test = { request: { baseURL: "={{$credentials.portalUrl}}", url: "/rest/user.current", method: "POST", qs: { auth: "={{$credentials.accessToken}}", }, }, }; } } exports.Bitrix24OAuth = Bitrix24OAuth; //# sourceMappingURL=Bitrix24OAuth.credentials.js.map