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

79 lines
1.6 KiB
TypeScript
Raw Normal View History

import type { ICredentialType, INodeProperties } from 'n8n-workflow';
: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
export class HaloPSAApi implements ICredentialType {
name = 'haloPSAApi';
: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
displayName = 'HaloPSA API';
: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
documentationUrl = 'halopsa';
properties: INodeProperties[] = [
: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
{
displayName: 'Hosting Type',
name: 'hostingType',
type: 'options',
options: [
{
name: 'On-Premise Solution',
value: 'onPremise',
},
{
name: 'Hosted Solution Of Halo',
value: 'hostedHalo',
},
],
default: 'onPremise',
: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
},
{
displayName: 'HaloPSA Authorisation Server URL',
name: 'authUrl',
type: 'string',
default: '',
required: true,
},
{
displayName: 'Resource Server',
name: 'resourceApiUrl',
type: 'string',
default: '',
required: true,
refactor: Apply more `eslint-plugin-n8n-nodes-base` rules (#3534) * :zap: Update `lintfix` script * :zap: Run baseline `lintfix` * :fire: Remove unneeded exceptions (#3538) * :fire: Remove exceptions for `node-param-default-wrong-for-simplify` * :fire: Remove exceptions for `node-param-placeholder-miscased-id` * :zap: Update version * :shirt: Apply `node-param-placeholder-missing` (#3542) * :shirt: Apply `filesystem-wrong-cred-filename` (#3543) * :shirt: Apply `node-param-description-missing-from-dynamic-options` (#3545) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-class-description-empty-string` (#3546) * :shirt: Apply `node-class-description-icon-not-svg` (#3548) * :shirt: Apply `filesystem-wrong-node-filename` (#3549) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Expand lintings to credentials (#3550) * :shirt: Apply `node-param-multi-options-type-unsorted-items` (#3552) * :zap: fix * :zap: Minor fixes Co-authored-by: Michael Kret <michael.k@radency.com> * :shirt: Apply `node-param-description-wrong-for-dynamic-multi-options` (#3541) * :zap: Add new lint rule, node-param-description-wrong-for-dynamic-multi-options * :zap: Fix with updated linting rules * :zap: Minor fixes Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply `node-param-description-boolean-without-whether` (#3553) * :zap: fix * Update packages/nodes-base/nodes/Clockify/ProjectDescription.ts Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * :shirt: Apply node-param-display-name-wrong-for-dynamic-multi-options (#3537) * :shirt: Add exceptions * :shirt: Add exception * :pencil2: Alphabetize rules * :zap: 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
description: 'The Resource server is available at your "Halo Web Application URL/api"',
: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
},
{
displayName: 'Client ID',
name: 'client_id',
type: 'string',
default: '',
required: true,
description: 'Must be your application client ID',
: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
},
{
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'],
: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
},
},
default: '',
description: 'An additional tenant parameter for HaloPSA hosted solution',
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: 'admin edit:tickets edit:customers',
required: true,
},
];
}