2021-05-20 14:31:23 -07:00
|
|
|
import {
|
2022-07-10 03:32:19 -07:00
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
2021-05-20 14:31:23 -07:00
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2021-05-20 14:31:23 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class NotionApi implements ICredentialType {
|
|
|
|
name = 'notionApi';
|
|
|
|
displayName = 'Notion API';
|
|
|
|
documentationUrl = 'notion';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2021-05-20 14:31:23 -07:00
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-05-20 14:31:23 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-07-10 03:32:19 -07:00
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.notion.com/v1',
|
|
|
|
url: '/users',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'Authorization': '=Bearer {{$credentials.apiKey}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2021-05-20 14:31:23 -07:00
|
|
|
}
|