mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-13 22:07:35 -08:00
63b6c9f128
* ✏️ Alphabetize rules * 🔖 Update version * ⚡ Update lintfix command * ⚡ Run baseline lintfix * 📦 Update package-lock.json * 👕 Apply `node-param-description-untrimmed` (#3200) * Removing unneeded backticks (#3249) * 👕 Apply node-param-description-wrong-for-return-all (#3253) * 👕 Apply node-param-description-missing-limit (#3252) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-excess-final-period (#3250) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-unencoded-angle-brackets (#3256) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-url-missing-protocol (#3258) * 👕 Apply `node-param-description-miscased-id` (#3254) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-wrong-for-limit (#3257) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply node-param-description-wrong-for-ignore-ssl-issues (#3261) * 👕 Apply rule * ⚡ Restore lintfix script * ⚡ Restore lintfix script Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
315 lines
6.2 KiB
TypeScript
315 lines
6.2 KiB
TypeScript
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const siteOperations: INodeProperties[] = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a site',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a site',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Get a site',
|
|
},
|
|
{
|
|
name: 'Get All',
|
|
value: 'getAll',
|
|
description: 'Get all sites',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a site',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
];
|
|
|
|
export const siteFields: INodeProperties[] = [
|
|
/* -------------------------------------------------------------------------- */
|
|
/* site:create */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Name',
|
|
name: 'siteName',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['create'],
|
|
},
|
|
},
|
|
description: 'Enter site name',
|
|
},
|
|
{
|
|
displayName: 'Select Client by ID',
|
|
name: 'selectOption',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether client can be selected by ID',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['create'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Client ID',
|
|
name: 'clientId',
|
|
type: 'string',
|
|
default: '',
|
|
required: true,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['create'],
|
|
selectOption: [true],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Client Name',
|
|
name: 'clientId',
|
|
type: 'options',
|
|
default: '',
|
|
required: true,
|
|
typeOptions: {
|
|
loadOptionsMethod: 'getHaloPSAClients',
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['create'],
|
|
selectOption: [false],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
default: {},
|
|
placeholder: 'Add Field',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['create'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Main Contact',
|
|
name: 'maincontact_name',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Notes',
|
|
name: 'notes',
|
|
type: 'string',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Phone Number',
|
|
name: 'phonenumber',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* site:get */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Site ID',
|
|
name: 'siteId',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['delete', 'get'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Simplify Output',
|
|
name: 'simplify',
|
|
type: 'boolean',
|
|
default: true,
|
|
description: 'Whether output should be simplified',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['get', 'getAll'],
|
|
},
|
|
},
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* site:getAll */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['getAll'],
|
|
},
|
|
},
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
default: 50,
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['getAll'],
|
|
returnAll: [false],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
maxValue: 1000,
|
|
},
|
|
description: 'Max number of results to return',
|
|
},
|
|
{
|
|
displayName: 'Filters',
|
|
name: 'filters',
|
|
type: 'collection',
|
|
default: {},
|
|
placeholder: 'Add Field',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['getAll'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Active Status',
|
|
name: 'activeStatus',
|
|
type: 'options',
|
|
default: 'all',
|
|
options: [
|
|
{
|
|
name: 'Active only',
|
|
value: 'active',
|
|
description: 'Whether to include active sites in the response',
|
|
},
|
|
{
|
|
name: 'All',
|
|
value: 'all',
|
|
description: 'Whether to include active and inactive sites in the response',
|
|
},
|
|
{
|
|
name: 'Inactive only',
|
|
value: 'inactive',
|
|
description: 'Whether to include inactive sites in the response',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
displayName: 'Text To Filter By',
|
|
name: 'search',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Filter sites by your search string',
|
|
},
|
|
],
|
|
},
|
|
/* -------------------------------------------------------------------------- */
|
|
/* site:update */
|
|
/* -------------------------------------------------------------------------- */
|
|
{
|
|
displayName: 'Site ID',
|
|
name: 'siteId',
|
|
type: 'string',
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Update Fields',
|
|
name: 'updateFields',
|
|
type: 'collection',
|
|
default: {},
|
|
placeholder: 'Add Field',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['site'],
|
|
operation: ['update'],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Client ID',
|
|
name: 'client_id',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Main Contact',
|
|
name: 'maincontact_name',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
description: 'Enter site name',
|
|
},
|
|
{
|
|
displayName: 'Notes',
|
|
name: 'notes',
|
|
type: 'string',
|
|
typeOptions: {
|
|
alwaysOpenEditWindow: true,
|
|
},
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Phone Number',
|
|
name: 'phonenumber',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
];
|