2024-01-10 01:17:00 -08:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-03-26 12:39:31 -07:00
|
|
|
|
2020-03-27 16:34:39 -07:00
|
|
|
export class MondayComApi implements ICredentialType {
|
|
|
|
name = 'mondayComApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-03-26 12:39:31 -07:00
|
|
|
displayName = 'Monday.com API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'mondayCom';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-03-26 12:39:31 -07:00
|
|
|
{
|
|
|
|
displayName: 'Token V2',
|
|
|
|
name: 'apiToken',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2023-08-01 04:08:25 -07:00
|
|
|
typeOptions: { password: true },
|
2020-03-26 12:39:31 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2024-01-10 01:17:00 -08:00
|
|
|
|
|
|
|
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 }}',
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
};
|
2020-03-26 12:39:31 -07:00
|
|
|
}
|