n8n/packages/nodes-base/credentials/MicrosoftDynamicsOAuth2Api.credentials.ts
Iván Ovejero 88dea330b9
refactor: Apply more eslint-plugin-n8n-nodes-base rules (#3534)
*  Update `lintfix` script

*  Run baseline `lintfix`

* 🔥 Remove unneeded exceptions (#3538)

* 🔥 Remove exceptions for `node-param-default-wrong-for-simplify`

* 🔥 Remove exceptions for `node-param-placeholder-miscased-id`

*  Update version

* 👕 Apply `node-param-placeholder-missing` (#3542)

* 👕 Apply `filesystem-wrong-cred-filename` (#3543)

* 👕 Apply `node-param-description-missing-from-dynamic-options` (#3545)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-class-description-empty-string` (#3546)

* 👕 Apply `node-class-description-icon-not-svg` (#3548)

* 👕 Apply `filesystem-wrong-node-filename` (#3549)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Expand lintings to credentials (#3550)

* 👕 Apply `node-param-multi-options-type-unsorted-items` (#3552)

*  fix

*  Minor fixes

Co-authored-by: Michael Kret <michael.k@radency.com>

* 👕 Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541)

*  Add new lint rule, node-param-description-wrong-for-dynamic-multi-options

*  Fix with updated linting rules

*  Minor fixes

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply `node-param-description-boolean-without-whether` (#3553)

*  fix

* Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

* 👕 Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537)

* 👕 Add exceptions

* 👕 Add exception

* ✏️ Alphabetize rules

*  Restore `lintfix` command

Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com>
Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
2022-06-20 07:54:01 -07:00

113 lines
2.5 KiB
TypeScript

import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class MicrosoftDynamicsOAuth2Api implements ICredentialType {
name = 'microsoftDynamicsOAuth2Api';
extends = [
'microsoftOAuth2Api',
];
displayName = 'Microsoft Dynamics OAuth2 API';
documentationUrl = 'microsoft';
properties: INodeProperties[] = [
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent
{
displayName: 'Subdomain',
name: 'subdomain',
type: 'string',
required: true,
placeholder: 'organization',
default: '',
},
// https://docs.microsoft.com/en-us/power-platform/admin/new-datacenter-regions
// https://arunpotti.com/2021/03/15/dynamics-365-crm-online-regions-list/
{
displayName: 'Region',
name: 'region',
type: 'options',
default: 'crm.dynamics.com',
options: [
{
name: 'Asia Pacific (APAC/ APJ)',
value: 'crm5.dynamics.com',
},
{
name: 'Australia (OCE)',
value: 'crm6.dynamics.com',
},
{
name: 'Canada (CAN)',
value: 'crm3.dynamics.com',
},
{
name: 'China (CHN)',
value: 'crm.dynamics.cn',
},
{
name: 'Europe, Middle East, Africa (EMEA/ EUR)',
value: 'crm4.dynamics.com',
},
{
name: 'France (FRA)',
value: 'crm12.dynamics.com',
},
{
name: 'Germany (GER)',
value: 'crm16.dynamics.com',
},
{
name: 'India (IND)',
value: 'crm8.dynamics.com',
},
{
name: 'Japan (JPN)',
value: 'crm7.dynamics.com',
},
{
name: 'Microsoft Cloud Germany (DEU)',
value: 'crm.microsoftdynamics.de',
},
{
name: 'North America (NAM)',
value: 'crm.dynamics.com',
},
{
name: 'North America 2 (US Gov GCC)',
value: 'crm9.dynamics.com',
},
{
name: 'South Africa (ZAF)',
value: 'crm14.dynamics.com',
},
{
name: 'South America (LATAM/ SAM)',
value: 'crm2.dynamics.com',
},
{
name: 'Switzerland (CHE)',
value: 'crm17.dynamics.com',
},
{
name: 'United Arab Emirates (UAE)',
value: 'crm15.dynamics.com',
},
{
name: 'United Kingdom (UK/ GBR)',
value: 'crm11.dynamics.com',
},
{
name: 'United States Government Community Cloud (GCC High)',
value: 'crm.microsoftdynamics.us',
},
],
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: '=openid offline_access https://{{$self.subdomain}}.{{$self.region}}/.default',
},
];
}