n8n/packages/nodes-base/nodes/UptimeRobot/MaintenanceWindowDescription.ts
Iván Ovejero 70ae90fa3c
refactor: Apply more eslint-plugin-n8n-nodes-base autofixable rules (#3432)
*  Update `lintfix` script

* 👕 Remove unneeded lint exceptions

* 👕 Run baseline `lintfix`

* 👕 Apply `node-param-description-miscased-url` (#3441)

* 👕 Apply `rule node-param-placeholder-miscased-id` (#3443)

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

* 👕 Apply `node-param-option-name-wrong-for-upsert` (#3446)

* 👕 Apply `node-param-min-value-wrong-for-limit` (#3442)

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

* Apply `node-param-display-name-wrong-for-dynamic-options` (#3454)

* 🔨 fix

*  Fix `Assigned To` fields

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

* 👕 Apply `rule node-param-default-wrong-for-number` (#3453)

* 👕 Apply `node-param-default-wrong-for-string` (#3452)

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

* Apply `node-param-display-name-miscased` (#3449)

* 🔨 fix

* 🔨 exceptions

*  review fixes

* 👕 Apply `node-param-description-lowercase-first-char` (#3451)

*  fix

*  review fixes

*  fix

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

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

* Rule working as intended

* Add rule

* 🔥 Remove repetitions

* 👕 Add exceptions

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

* 👕 Small fix for `node-param-description-wrong-for-dynamic-options`

* 👕 Apply `node-param-default-wrong-for-fixed-collection` (#3460)

* 👕 Apply `node-param-description-line-break-html-tag` (#3462)

* 👕 Run baseline `lintfix`

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

*  fix

* 🔨 exceptions

* Add exception for Salesmate and Zoom

Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>

*  Restore `lintfix` command

Co-authored-by: Omar Ajoue <krynble@gmail.com>
Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com>
2022-06-03 19:23:49 +02:00

471 lines
8 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const maintenanceWindowOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a maintenance window',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a maintenance window',
},
{
name: 'Get',
value: 'get',
description: 'Get a maintenance window',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all a maintenance windows',
},
{
name: 'Update',
value: 'update',
description: 'Update a maintenance window',
},
],
default: 'getAll',
},
];
export const maintenanceWindowFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* maintenanceWindow:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Duration (Minutes)',
name: 'duration',
type: 'number',
required: true,
default: 1,
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'create',
],
},
},
description: 'The maintenance window activation period (minutes)',
},
{
displayName: 'Friendly Name',
name: 'friendlyName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'create',
],
},
},
description: 'The friendly name of the maintenance window',
},
{
displayName: 'Type',
name: 'type',
type: 'options',
required: true,
default: '',
options: [
{
name: 'Once',
value: 1,
},
{
name: 'Daily',
value: 2,
},
{
name: 'Weekly',
value: 3,
},
{
name: 'Monthly',
value: 4,
},
],
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'create',
],
},
},
description: 'The type of the maintenance window',
},
{
displayName: 'Week Day',
name: 'weekDay',
type: 'options',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'create',
],
type: [
3,
],
},
},
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
options: [
{
name: 'Monday',
value: 1,
},
{
name: 'Tuesday',
value: 2,
},
{
name: 'Wednesday',
value: 3,
},
{
name: 'Thursday',
value: 4,
},
{
name: 'Friday',
value: 5,
},
{
name: 'Saturday',
value: 6,
},
{
name: 'Sunday',
value: 7,
},
],
default: '',
},
{
displayName: 'Month Day',
name: 'monthDay',
type: 'number',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'create',
],
type: [
4,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 30,
},
default: 1,
},
{
displayName: 'Start Time',
name: 'start_time',
type: 'dateTime',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'create',
],
},
},
description: 'The maintenance window start datetime',
},
/* -------------------------------------------------------------------------- */
/* maintenanceWindow:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'ID',
name: 'id',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'delete',
'get',
],
},
},
description: 'The ID of the maintenance window',
},
/* -------------------------------------------------------------------------- */
/* maintenanceWindow:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'getAll',
],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 50,
description: 'Max number of results to return',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Maintenance Window IDs',
name: 'mwindow',
type: 'string',
default: '',
description: 'Maintenance windows IDs separated with dash, e.g. 236-1782-4790',
},
],
},
/* -------------------------------------------------------------------------- */
/* maintenanceWindow:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'ID',
name: 'id',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'update',
],
},
},
description: 'The ID of the maintenance window',
},
{
displayName: 'Duration (Minutes)',
name: 'duration',
type: 'number',
required: true,
default: '',
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'update',
],
},
},
description: 'The maintenance window activation period (minutes)',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'maintenanceWindow',
],
operation: [
'update',
],
},
},
options: [
{
displayName: 'Friendly Name',
name: 'friendly_name',
type: 'string',
default: '',
description: 'The friendly name of the maintenance window',
},
{
displayName: 'Start Time',
name: 'start_time',
type: 'dateTime',
default: '',
description: 'The maintenance window start datetime',
},
{
displayName: 'Type',
name: 'type',
type: 'options',
default: '',
options: [
{
name: 'Once',
value: 1,
},
{
name: 'Daily',
value: 2,
},
{
name: 'Weekly',
value: 3,
},
{
name: 'Monthly',
value: 4,
},
],
description: 'The type of the maintenance window',
},
{
displayName: 'Week Day',
name: 'weekDay',
type: 'options',
displayOptions: {
show: {
type: [
3,
],
},
},
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
options: [
{
name: 'Monday',
value: 1,
},
{
name: 'Tuesday',
value: 2,
},
{
name: 'Wednesday',
value: 3,
},
{
name: 'Thursday',
value: 4,
},
{
name: 'Friday',
value: 5,
},
{
name: 'Saturday',
value: 6,
},
{
name: 'Sunday',
value: 7,
},
],
default: '',
},
{
displayName: 'Month Day',
name: 'monthDay',
type: 'number',
displayOptions: {
show: {
type: [
4,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 30,
},
default: 1,
},
],
},
];