mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-31 08:46:58 +02:00
47 lines
846 B
TypeScript
47 lines
846 B
TypeScript
import type {
|
|
IAuthenticateGeneric,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class WorkableApi implements ICredentialType {
|
|
name = 'workableApi';
|
|
|
|
displayName = 'Workable API';
|
|
|
|
documentationUrl = 'workable';
|
|
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Subdomain',
|
|
name: 'subdomain',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Access Token',
|
|
name: 'accessToken',
|
|
type: 'string',
|
|
typeOptions: { password: true },
|
|
default: '',
|
|
},
|
|
];
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
type: 'generic',
|
|
properties: {
|
|
headers: {
|
|
Authorization: '=Bearer {{$credentials.accessToken}}',
|
|
},
|
|
},
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: '=https://{{$credentials.subdomain}}.workable.com/spi/v3',
|
|
url: '/jobs',
|
|
},
|
|
};
|
|
}
|