mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
48 lines
876 B
TypeScript
48 lines
876 B
TypeScript
import type {
|
|
IAuthenticateGeneric,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class MondayComApi implements ICredentialType {
|
|
name = 'mondayComApi';
|
|
|
|
displayName = 'Monday.com API';
|
|
|
|
documentationUrl = 'mondayCom';
|
|
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Token V2',
|
|
name: 'apiToken',
|
|
type: 'string',
|
|
typeOptions: { password: true },
|
|
default: '',
|
|
},
|
|
];
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
type: 'generic',
|
|
properties: {
|
|
headers: {
|
|
Authorization: '=Bearer {{$credentials.apiToken}}',
|
|
},
|
|
},
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
headers: {
|
|
'API-Version': '2023-10',
|
|
'Content-Type': 'application/json',
|
|
},
|
|
baseURL: 'https://api.monday.com/v2',
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
query: 'query { me { name }}',
|
|
}),
|
|
},
|
|
};
|
|
}
|