mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -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',
|
|
},
|
|
};
|
|
}
|