2023-07-31 01:26:38 -07:00
|
|
|
import type { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class RecordedFutureApi implements ICredentialType {
|
|
|
|
name = 'recordedFutureApi';
|
|
|
|
|
|
|
|
displayName = 'Recorded Future API';
|
|
|
|
|
|
|
|
documentationUrl = 'recordedfuture';
|
|
|
|
|
2024-06-06 04:34:30 -07:00
|
|
|
icon = {
|
|
|
|
light: 'file:icons/RecordedFuture.svg',
|
|
|
|
dark: 'file:icons/RecordedFuture.dark.svg',
|
|
|
|
} as const;
|
2023-07-31 01:26:38 -07:00
|
|
|
|
2023-11-13 03:11:16 -08:00
|
|
|
httpRequestNode = {
|
|
|
|
name: 'Recorded Future',
|
|
|
|
docsUrl: 'https://api.recordedfuture.com',
|
|
|
|
apiBaseUrl: 'https://api.recordedfuture.com/v2/',
|
|
|
|
};
|
|
|
|
|
2023-07-31 01:26:38 -07:00
|
|
|
properties: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Access Token',
|
|
|
|
name: 'apiKey',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: { password: true },
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'X-RFToken': '={{$credentials.accessToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
// test: ICredentialTestRequest = {
|
|
|
|
// request: {
|
|
|
|
// baseURL: 'https://api.recordedfuture.com/v2',
|
|
|
|
// url: '/alert/search?limit=1',
|
|
|
|
// },
|
|
|
|
// };
|
|
|
|
}
|