n8n/packages/nodes-base/credentials/ServiceNowOAuth2Api.credentials.ts
MedAliMarz de2119564c
Add ServiceNow node (#1932)
*  ServiceNow node

* Add Table Record resource & operations

* Add Incident resource & operations

* Add User resource & operations

* Add Business Service getAll operation

* Add Business Service, Department, Dictionary and Configuration Items resources

* Improvements

* Add continueOnFail

* Fix node display name

* Fix node credentials name

* Minor improvements

* Improvements

* Add load function for fields parameter

* Add load function for incident, user and table record fields

* Fix sending input function

* Enhance ServiceNow credentials

* Apply review changes & improvements

* Minor improvements

* Minor code enhancement

* Apply review changes

*  Small improvement

* Fix TableRecord update operation & add BusinessServices loading

*  Small improvement

*  Improve ServiceNow node

*  Fix one more description

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-07-15 19:30:59 +02:00

63 lines
1.5 KiB
TypeScript

import {
ICredentialType,
NodePropertyTypes,
} from 'n8n-workflow';
export class ServiceNowOAuth2Api implements ICredentialType {
name = 'serviceNowOAuth2Api';
extends = [
'oAuth2Api',
];
displayName = 'ServiceNow OAuth2 API';
documentationUrl = 'serviceNow';
properties = [
{
displayName: 'Subdomain',
name: 'subdomain',
type: 'string' as NodePropertyTypes,
default: '',
placeholder: 'n8n',
description: 'The subdomain of your ServiceNow environment',
required: true,
},
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'hidden' as NodePropertyTypes,
default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_auth.do',
required: true,
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden' as NodePropertyTypes,
default: '=https://{{$self["subdomain"]}}.service-now.com/oauth_token.do',
required: true,
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden' as NodePropertyTypes,
default: 'useraccount',
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden' as NodePropertyTypes,
default: 'response_type=code',
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden' as NodePropertyTypes,
default: 'grant_type=authorization_code',
},
{
displayName: 'Authentication',
name: 'authentication',
type: 'hidden' as NodePropertyTypes,
default: 'header',
},
];
}