mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 22:54:05 -08:00
36 lines
859 B
TypeScript
36 lines
859 B
TypeScript
import {
|
|
IAuthenticateBasicAuth,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class ServiceNowBasicApi implements ICredentialType {
|
|
name = 'serviceNowBasicApi';
|
|
extends = [
|
|
'httpBasicAuth',
|
|
];
|
|
displayName = 'ServiceNow Basic Auth API';
|
|
documentationUrl = 'serviceNow';
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Subdomain',
|
|
name: 'subdomain',
|
|
type: 'string',
|
|
default: '',
|
|
hint: 'The subdomain can be extracted from the URL. If the URL is: https://dev99890.service-now.com the subdomain is dev99890',
|
|
required: true,
|
|
},
|
|
];
|
|
authenticate: IAuthenticateBasicAuth = {
|
|
type: 'basicAuth',
|
|
properties: {},
|
|
};
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: '=https://{{$credentials?.subdomain}}.service-now.com',
|
|
url: '/api/now/table/sys_user_role',
|
|
},
|
|
};
|
|
}
|