n8n/packages/nodes-base/credentials/HaloPSAApi.credentials.ts

82 lines
1.6 KiB
TypeScript
Raw Normal View History

:sparkles: Add HaloPSA node (#2620) * added node ui * wip problems with auth * updated authentication * fixed linter error * added haloPSA request function * removed any return type * fixed linter errors * added CRUD functionalities * updating branch from master * updated create case for clients resource, added limit to getAll operation * added required fields when creating clients and sites, added methods for fetching data to dynamicly populate options when creating site or client * added required fields for users and invoices when operation is create * :hammer: Removed some commented code * :bug: Fix bug in url formating * :hammer: fixed plural resources, fixed main for loop * :hammer: fix trailing coma * :hammer: fix for wrong resource endpoints * :hammer: fixed linter complain in Jenkings node * :hammer: replace custom fields with predefined * :hammer: updating resources optional fields * :zap: Small improvement * :hammer: replaced fixedCollection to collection in resources description * :hammer: updated site and ticket descriptions, code clean up * :hammer: fixed accordingly to PR review * :zap: Improvements * :zap: Improvements * :zap: Fix capitalization * :shirt: Fix trailing comma * :construction: node changes accordingly to review * :zap: lint errors fix * :zap: Activate simplify option by default * :zap: Fix some more issues Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-11 10:00:30 -08:00
import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class HaloPSAApi implements ICredentialType {
name = 'haloPSAApi';
displayName = 'HaloPSA API';
documentationUrl = 'halopsa';
properties: INodeProperties[] = [
{
displayName: 'Hosting Type',
name: 'hostingType',
type: 'options',
options: [
{
name: 'On-Premise Solution',
value: 'onPremise',
},
{
name: 'Hosted Solution Of Halo',
value: 'hostedHalo',
},
],
default: '',
description: 'Hosting Type',
},
{
displayName: 'HaloPSA Authorisation Server URL',
name: 'authUrl',
type: 'string',
default: '',
required: true,
},
{
displayName: 'Resource Server',
name: 'resourceApiUrl',
type: 'string',
default: '',
required: true,
description: `The Resource server is available at your "Halo Web Application url/api"`,
},
{
displayName: 'Client ID',
name: 'client_id',
type: 'string',
default: '',
required: true,
description: 'Must be your application client id',
},
{
displayName: 'Client Secret',
name: 'client_secret',
type: 'string',
default: '',
required: true,
description: 'Must be your application client secret',
},
{
displayName: 'Tenant',
name: 'tenant',
type: 'string',
displayOptions: {
show: {
hostingType: [
'hostedHalo',
],
},
},
default: '',
description: 'An additional tenant parameter for HaloPSA hosted solution',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: 'admin edit:tickets edit:customers',
required: true,
},
];
}