feat(TheHive Node): Overhaul (#6457)
This commit is contained in:
@@ -0,0 +1,542 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { TLP } from '../helpers/interfaces';
|
||||
|
||||
export const returnAllAndLimit: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
},
|
||||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
displayOptions: {
|
||||
show: {
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const responderOptions: INodeProperties = {
|
||||
displayName: 'Responder Name or ID',
|
||||
name: 'responder',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
required: true,
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id', 'id.value'],
|
||||
loadOptionsMethod: 'loadResponders',
|
||||
},
|
||||
displayOptions: {
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const tlpOptions: INodeProperties = {
|
||||
displayName: 'Traffict Light Protocol (TLP)',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLP.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLP.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLP.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLP.red,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const severityOptions: INodeProperties = {
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
name: 'Critical',
|
||||
value: 4,
|
||||
},
|
||||
],
|
||||
default: 2,
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
};
|
||||
|
||||
export const observableTypeOptions: INodeProperties = {
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||
displayName: 'Data Type',
|
||||
name: 'dataType',
|
||||
type: 'options',
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadObservableTypes',
|
||||
},
|
||||
description:
|
||||
'Type of the observable. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
||||
};
|
||||
|
||||
export const alertStatusOptions: INodeProperties = {
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'New',
|
||||
value: 'New',
|
||||
},
|
||||
{
|
||||
name: 'Updated',
|
||||
value: 'Updated',
|
||||
},
|
||||
{
|
||||
name: 'Ignored',
|
||||
value: 'Ignored',
|
||||
},
|
||||
{
|
||||
name: 'Imported',
|
||||
value: 'Imported',
|
||||
},
|
||||
],
|
||||
default: 'New',
|
||||
description: 'Status of the alert',
|
||||
};
|
||||
|
||||
export const caseStatusOptions: INodeProperties = {
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Open',
|
||||
value: 'Open',
|
||||
},
|
||||
{
|
||||
name: 'Resolved',
|
||||
value: 'Resolved',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
default: 'Open',
|
||||
};
|
||||
|
||||
export const observableStatusOptions: INodeProperties = {
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
default: 'Ok',
|
||||
options: [
|
||||
{
|
||||
name: 'Ok',
|
||||
value: 'Ok',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
description: 'Status of the observable. Default=Ok.',
|
||||
};
|
||||
|
||||
export const taskStatusOptions: INodeProperties = {
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
default: 'Waiting',
|
||||
options: [
|
||||
{
|
||||
name: 'Cancel',
|
||||
value: 'Cancel',
|
||||
},
|
||||
{
|
||||
name: 'Completed',
|
||||
value: 'Completed',
|
||||
},
|
||||
{
|
||||
name: 'InProgress',
|
||||
value: 'InProgress',
|
||||
},
|
||||
{
|
||||
name: 'Waiting',
|
||||
value: 'Waiting',
|
||||
},
|
||||
],
|
||||
description: 'Status of the task. Default=Waiting.',
|
||||
};
|
||||
|
||||
export const searchOptions: INodeProperties = {
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Return Count',
|
||||
name: 'returnCount',
|
||||
type: 'boolean',
|
||||
description: 'Whether to return only the count of results',
|
||||
default: false,
|
||||
displayOptions: {
|
||||
hide: {
|
||||
'/returnAll': [false],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'multiOptions',
|
||||
description: 'Additional data to include in the response',
|
||||
options: [
|
||||
{
|
||||
name: 'isOwner',
|
||||
value: 'isOwner',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'links',
|
||||
value: 'links',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'permissions',
|
||||
value: 'permissions',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'seen',
|
||||
value: 'seen',
|
||||
},
|
||||
{
|
||||
name: 'shareCount',
|
||||
value: 'shareCount',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'shares',
|
||||
value: 'shares',
|
||||
},
|
||||
],
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['observable'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'multiOptions',
|
||||
description: 'Additional data to include in the response',
|
||||
options: [
|
||||
{
|
||||
name: 'actionRequired',
|
||||
value: 'actionRequired',
|
||||
},
|
||||
{
|
||||
name: 'actionRequiredMap',
|
||||
value: 'actionRequiredMap',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'case',
|
||||
value: 'case',
|
||||
},
|
||||
{
|
||||
name: 'caseId',
|
||||
value: 'caseId',
|
||||
},
|
||||
{
|
||||
name: 'caseTemplate',
|
||||
value: 'caseTemplate',
|
||||
},
|
||||
{
|
||||
name: 'caseTemplateId',
|
||||
value: 'caseTemplateId',
|
||||
},
|
||||
{
|
||||
name: 'shareCount',
|
||||
value: 'shareCount',
|
||||
},
|
||||
],
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['task'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'multiOptions',
|
||||
description: 'Additional data to include in the response',
|
||||
options: [
|
||||
{
|
||||
name: 'caseNumber',
|
||||
value: 'caseNumber',
|
||||
},
|
||||
{
|
||||
name: 'importDate',
|
||||
value: 'importDate',
|
||||
},
|
||||
{
|
||||
name: 'procedureCount',
|
||||
value: 'procedureCount',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'status',
|
||||
value: 'status',
|
||||
},
|
||||
],
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['alert'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'multiOptions',
|
||||
description: 'Additional data to include in the response',
|
||||
options: [
|
||||
{
|
||||
name: 'actionRequired',
|
||||
value: 'actionRequired',
|
||||
},
|
||||
{
|
||||
name: 'alertCount',
|
||||
value: 'alertCount',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'alerts',
|
||||
value: 'alerts',
|
||||
},
|
||||
{
|
||||
name: 'attachmentCount',
|
||||
value: 'attachmentCount',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'contributors',
|
||||
value: 'contributors',
|
||||
},
|
||||
{
|
||||
name: 'handlingDuration',
|
||||
value: 'computed.handlingDuration',
|
||||
},
|
||||
{
|
||||
name: 'handlingDurationInDays',
|
||||
value: 'computed.handlingDurationInDays',
|
||||
},
|
||||
{
|
||||
name: 'handlingDurationInHours',
|
||||
value: 'computed.handlingDurationInHours',
|
||||
},
|
||||
{
|
||||
name: 'handlingDurationInMinutes',
|
||||
value: 'computed.handlingDurationInMinutes',
|
||||
},
|
||||
{
|
||||
name: 'handlingDurationInSeconds',
|
||||
value: 'computed.handlingDurationInSeconds',
|
||||
},
|
||||
{
|
||||
name: 'isOwner',
|
||||
value: 'isOwner',
|
||||
},
|
||||
{
|
||||
name: 'observableStats',
|
||||
value: 'observableStats',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'permissions',
|
||||
value: 'permissions',
|
||||
},
|
||||
{
|
||||
name: 'procedureCount',
|
||||
value: 'procedureCount',
|
||||
},
|
||||
{
|
||||
name: 'shareCount',
|
||||
value: 'shareCount',
|
||||
},
|
||||
{
|
||||
name: 'similarAlerts',
|
||||
value: 'similarAlerts',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'status',
|
||||
value: 'status',
|
||||
},
|
||||
{
|
||||
name: 'taskStats',
|
||||
value: 'taskStats',
|
||||
},
|
||||
],
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['case'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'multiOptions',
|
||||
description: 'Additional data to include in the response',
|
||||
options: [
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'links',
|
||||
value: 'links',
|
||||
},
|
||||
],
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['comment'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'multiOptions',
|
||||
description: 'Additional data to include in the response',
|
||||
options: [
|
||||
{
|
||||
name: 'actionCount',
|
||||
value: 'actionCount',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'case',
|
||||
value: 'case',
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
|
||||
name: 'task',
|
||||
value: 'task',
|
||||
},
|
||||
{
|
||||
name: 'taskId',
|
||||
value: 'taskId',
|
||||
},
|
||||
],
|
||||
default: [],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['log'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Extra Data',
|
||||
name: 'extraData',
|
||||
type: 'string',
|
||||
description: 'Additional data to include in the response',
|
||||
default: '',
|
||||
requiresDataPath: 'multiple',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['query'],
|
||||
},
|
||||
hide: {
|
||||
returnCount: [true],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const attachmentsUi: INodeProperties = {
|
||||
displayName: 'Attachments',
|
||||
name: 'attachmentsUi',
|
||||
placeholder: 'Add Attachment',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'values',
|
||||
displayName: 'Values',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Attachment Field Name',
|
||||
name: 'field',
|
||||
type: 'string',
|
||||
default: 'data',
|
||||
description: 'Add the field name from the input node',
|
||||
hint: 'The name of the field with the attachment in the node input',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
default: {},
|
||||
description: 'Array of supported attachments to add to the message',
|
||||
};
|
||||
@@ -0,0 +1,318 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
const field: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'string',
|
||||
default: '',
|
||||
requiresDataPath: 'single',
|
||||
description: 'Dot notation is also supported, e.g. customFields.field1',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
'/resource': ['alert', 'case', 'comment', 'task', 'observable', 'log', 'page'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadAlertFields',
|
||||
},
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['alert'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCaseFields',
|
||||
},
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['case'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadTaskFields',
|
||||
},
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['task'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadObservableFields',
|
||||
},
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['observable'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'Message',
|
||||
value: 'message',
|
||||
},
|
||||
{
|
||||
name: 'Date',
|
||||
value: 'date',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['log'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'Message',
|
||||
value: 'message',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['comment'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Field',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'Category',
|
||||
value: 'category',
|
||||
},
|
||||
{
|
||||
name: 'Content',
|
||||
value: 'content',
|
||||
},
|
||||
{
|
||||
name: 'Title',
|
||||
value: 'title',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/resource': ['page'],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const genericFiltersCollection: INodeProperties = {
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Filter',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Values',
|
||||
name: 'values',
|
||||
values: [
|
||||
...field,
|
||||
{
|
||||
displayName: 'Operator',
|
||||
name: 'operator',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Between',
|
||||
value: '_between',
|
||||
description: "Field is between two values ('From' is inclusive, 'To' is exclusive)",
|
||||
},
|
||||
{
|
||||
name: 'Contains',
|
||||
value: '_like',
|
||||
description: 'Field contains the substring from value',
|
||||
},
|
||||
{
|
||||
name: 'Ends With',
|
||||
value: '_endsWith',
|
||||
description: 'Field ends with value',
|
||||
},
|
||||
{
|
||||
name: 'Equal',
|
||||
value: '_eq',
|
||||
description: 'Field is equal to value',
|
||||
},
|
||||
{
|
||||
name: 'Greater Than',
|
||||
value: '_gt',
|
||||
description: 'Field is greater than value',
|
||||
},
|
||||
{
|
||||
name: 'Greater Than Or Equal',
|
||||
value: '_gte',
|
||||
description: 'Field is greater than or equal to value',
|
||||
},
|
||||
{
|
||||
name: 'In',
|
||||
value: '_in',
|
||||
description: 'Field is one of the values',
|
||||
},
|
||||
{
|
||||
name: 'Less Than',
|
||||
value: '_lt',
|
||||
description: 'Field is less than value',
|
||||
},
|
||||
{
|
||||
name: 'Less Than Or Equal',
|
||||
value: '_lte',
|
||||
description: 'Field is less than or equal to value',
|
||||
},
|
||||
{
|
||||
name: 'Match Word',
|
||||
value: '_match',
|
||||
description: 'Field contains the value as a word',
|
||||
},
|
||||
{
|
||||
name: 'Not Equal',
|
||||
value: '_ne',
|
||||
description: 'Field is not equal to value',
|
||||
},
|
||||
{
|
||||
name: 'Starts With',
|
||||
value: '_startsWith',
|
||||
description: 'Field starts with value',
|
||||
},
|
||||
],
|
||||
default: '_eq',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
operator: ['_between', '_in'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Values',
|
||||
name: 'values',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Comma-separated list of values',
|
||||
placeholder: 'e.g. value1,value2',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operator: ['_in'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'From',
|
||||
name: 'from',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operator: ['_between'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'To',
|
||||
name: 'to',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operator: ['_between'],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const sortCollection: INodeProperties = {
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Sort Rule',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Fields',
|
||||
name: 'fields',
|
||||
values: [
|
||||
...field,
|
||||
{
|
||||
displayName: 'Direction',
|
||||
name: 'direction',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Ascending',
|
||||
value: 'asc',
|
||||
},
|
||||
{
|
||||
name: 'Descending',
|
||||
value: 'desc',
|
||||
},
|
||||
],
|
||||
default: 'asc',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './rlc.description';
|
||||
export * from './common.description';
|
||||
export * from './filter.description';
|
||||
@@ -0,0 +1,285 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const caseRLC: INodeProperties = {
|
||||
displayName: 'Case',
|
||||
name: 'caseId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select a case...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'caseSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Link',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
extractValue: {
|
||||
type: 'regex',
|
||||
regex: 'https:\\/\\/.+\\/cases\\/(~[0-9]{1,})\\/details',
|
||||
},
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: 'https:\\/\\/.+\\/cases\\/(~[0-9]{1,})\\/details',
|
||||
errorMessage: 'Not a valid Case URL',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid Case ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const alertRLC: INodeProperties = {
|
||||
displayName: 'Alert',
|
||||
name: 'alertId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select a alert...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'alertSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Link',
|
||||
name: 'url',
|
||||
type: 'string',
|
||||
extractValue: {
|
||||
type: 'regex',
|
||||
regex: 'https:\\/\\/.+\\/alerts\\/(~[0-9]{1,})\\/details',
|
||||
},
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: 'https:\\/\\/.+\\/alerts\\/(~[0-9]{1,})\\/details',
|
||||
errorMessage: 'Not a valid Alert URL',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid Alert ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const taskRLC: INodeProperties = {
|
||||
displayName: 'Task',
|
||||
name: 'taskId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select a task...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'taskSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid Task ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const pageRLC: INodeProperties = {
|
||||
displayName: 'Page',
|
||||
name: 'pageId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['caseId'],
|
||||
},
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select a page...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'pageSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid Page ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const logRLC: INodeProperties = {
|
||||
displayName: 'Task Log',
|
||||
name: 'logId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select a task log...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'logSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid task Log ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const commentRLC: INodeProperties = {
|
||||
displayName: 'Comment',
|
||||
name: 'commentId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select a comment...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'commentSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid comment ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const observableRLC: INodeProperties = {
|
||||
displayName: 'Observable',
|
||||
name: 'observableId',
|
||||
type: 'resourceLocator',
|
||||
default: { mode: 'list', value: '' },
|
||||
required: true,
|
||||
modes: [
|
||||
{
|
||||
displayName: 'From List',
|
||||
name: 'list',
|
||||
type: 'list',
|
||||
placeholder: 'Select an observable...',
|
||||
typeOptions: {
|
||||
searchListMethod: 'observableSearch',
|
||||
searchable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
placeholder: 'e.g. ~123456789',
|
||||
validation: [
|
||||
{
|
||||
type: 'regex',
|
||||
properties: {
|
||||
regex: '(~[0-9]{1,})',
|
||||
errorMessage: 'Not a valid Log ID',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user