mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat: Add crowd.dev node and trigger node (#6082)
This commit is contained in:
72
packages/nodes-base/credentials/CrowdDevApi.credentials.ts
Normal file
72
packages/nodes-base/credentials/CrowdDevApi.credentials.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class CrowdDevApi implements ICredentialType {
|
||||
name = 'crowdDevApi';
|
||||
|
||||
displayName = 'crowd.dev API';
|
||||
|
||||
documentationUrl = 'crowdDev';
|
||||
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'URL',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
default: 'https://app.crowd.dev',
|
||||
},
|
||||
{
|
||||
displayName: 'Tenant ID',
|
||||
name: 'tenantId',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Token',
|
||||
name: 'token',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
password: true,
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Ignore SSL Issues',
|
||||
name: 'allowUnauthorizedCerts',
|
||||
type: 'boolean',
|
||||
description: 'Whether to connect even if SSL certificate validation is not possible',
|
||||
default: false,
|
||||
},
|
||||
];
|
||||
|
||||
// This allows the credential to be used by other parts of n8n
|
||||
// stating how this credential is injected as part of the request
|
||||
// An example is the Http Request node that can make generic calls
|
||||
// reusing this credential
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
Authorization: '={{"Bearer " + $credentials.token}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// The block below tells how this credential can be tested
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
method: 'POST',
|
||||
baseURL: '={{$credentials.url.replace(/\\/$/, "") + "/api/tenant/" + $credentials.tenantId}}',
|
||||
url: '/member/query',
|
||||
skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
|
||||
body: {
|
||||
limit: 1,
|
||||
offset: 0,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user