first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,913 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { TLPs } from '../interfaces/AlertInterface';
|
||||
|
||||
export const alertOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation Name or ID',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadAlertOptions',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
default: 'create',
|
||||
},
|
||||
];
|
||||
|
||||
export const alertFields: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['alert'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
// required attributs
|
||||
{
|
||||
displayName: 'Alert ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: [
|
||||
'promote',
|
||||
'markAsRead',
|
||||
'markAsUnread',
|
||||
'merge',
|
||||
'update',
|
||||
'executeResponder',
|
||||
'get',
|
||||
],
|
||||
},
|
||||
},
|
||||
description: 'Title of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Case ID',
|
||||
name: 'caseId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['merge'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Title of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Description of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
default: 2,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
},
|
||||
{
|
||||
displayName: 'Date',
|
||||
name: 'date',
|
||||
type: 'dateTime',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Date and time when the alert was raised default=now',
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
placeholder: 'tag,tag2,tag3...',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Case Tags',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
required: true,
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
required: true,
|
||||
options: [
|
||||
{
|
||||
name: 'New',
|
||||
value: 'New',
|
||||
},
|
||||
{
|
||||
name: 'Updated',
|
||||
value: 'Updated',
|
||||
},
|
||||
{
|
||||
name: 'Ignored',
|
||||
value: 'Ignored',
|
||||
},
|
||||
{
|
||||
name: 'Imported',
|
||||
value: 'Imported',
|
||||
},
|
||||
],
|
||||
default: 'New',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Status of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Type',
|
||||
name: 'type',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Type of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Source',
|
||||
name: 'source',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Source of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'SourceRef',
|
||||
name: 'sourceRef',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Source reference of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Follow',
|
||||
name: 'follow',
|
||||
type: 'boolean',
|
||||
required: true,
|
||||
default: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Whether the alert becomes active when updated default=true',
|
||||
},
|
||||
{
|
||||
displayName: 'Artifacts',
|
||||
name: 'artifactUi',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Artifact',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Artifact',
|
||||
name: 'artifactValues',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Data Type Name or ID',
|
||||
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/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Data',
|
||||
name: 'data',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
dataType: ['file'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Input Binary Field',
|
||||
name: 'binaryProperty',
|
||||
type: 'string',
|
||||
hint: 'The name of the input binary field containing the file to be written',
|
||||
displayOptions: {
|
||||
show: {
|
||||
dataType: ['file'],
|
||||
},
|
||||
},
|
||||
default: 'data',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Case Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
description: 'Artifact attributes',
|
||||
},
|
||||
// required for responder execution
|
||||
{
|
||||
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/expressions/">expression</a>',
|
||||
required: true,
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id'],
|
||||
loadOptionsMethod: 'loadResponders',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['executeResponder'],
|
||||
},
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'JSON Parameters',
|
||||
name: 'jsonParameters',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create', 'update'],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// optional attributs (Create, Promote operations)
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
placeholder: 'Add Field',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Case Template',
|
||||
name: 'caseTemplate',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Case template to use when a case is created from this alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Fields',
|
||||
name: 'customFieldsUi',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
placeholder: 'Add Custom Field',
|
||||
options: [
|
||||
{
|
||||
name: 'customFields',
|
||||
displayName: 'Custom Field',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field Name or ID',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCustomFields',
|
||||
},
|
||||
default: 'Custom Field',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Custom Field value. Use an expression if the type is not a string.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Fields (JSON)',
|
||||
name: 'customFieldsJson',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [true],
|
||||
},
|
||||
},
|
||||
description: 'Custom fields in JSON format. Overrides Custom Fields UI if set.',
|
||||
},
|
||||
],
|
||||
},
|
||||
// optional attributs (Promote operation)
|
||||
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
name: 'additionalFields',
|
||||
placeholder: 'Add Field',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['promote'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Case Template',
|
||||
name: 'caseTemplate',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Case template to use when a case is created from this alert',
|
||||
},
|
||||
],
|
||||
},
|
||||
// optional attributs (Update operation)
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Artifacts',
|
||||
name: 'artifactUi',
|
||||
type: 'fixedCollection',
|
||||
placeholder: 'Add Artifact',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Artifact',
|
||||
name: 'artifactValues',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Data Type Name or ID',
|
||||
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/expressions/">expression</a>.',
|
||||
},
|
||||
{
|
||||
displayName: 'Data',
|
||||
name: 'data',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
hide: {
|
||||
dataType: ['file'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Input Binary Field',
|
||||
name: 'binaryProperty',
|
||||
type: 'string',
|
||||
hint: 'The name of the input binary field containing the file to be written',
|
||||
displayOptions: {
|
||||
show: {
|
||||
dataType: ['file'],
|
||||
},
|
||||
},
|
||||
default: 'data',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Case Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Fields',
|
||||
name: 'customFieldsUi',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [false],
|
||||
},
|
||||
},
|
||||
placeholder: 'Add Custom Field',
|
||||
options: [
|
||||
{
|
||||
name: 'customFields',
|
||||
displayName: 'Custom Field',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field Name or ID',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCustomFields',
|
||||
},
|
||||
default: 'Custom Field',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Custom Field value. Use an expression if the type is not a string.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Fields (JSON)',
|
||||
name: 'customFieldsJson',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [true],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Custom fields in JSON format. Overrides Custom Fields UI if set.',
|
||||
},
|
||||
{
|
||||
displayName: 'Case Template',
|
||||
name: 'caseTemplate',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Case template to use when a case is created from this alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Description of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Follow',
|
||||
name: 'follow',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
description: 'Whether the alert becomes active when updated default=true',
|
||||
},
|
||||
{
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
default: 2,
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
},
|
||||
{
|
||||
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',
|
||||
},
|
||||
{
|
||||
displayName: 'Case Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'tag,tag2,tag3...',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Title of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
],
|
||||
},
|
||||
//Query attributs (Search operation)
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
type: 'collection',
|
||||
placeholder: 'Add option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'string',
|
||||
placeholder: '±Attribut, exp +status',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['get'],
|
||||
resource: ['alert'],
|
||||
},
|
||||
},
|
||||
type: 'collection',
|
||||
placeholder: 'Add option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Include Similar Cases',
|
||||
name: 'includeSimilar',
|
||||
type: 'boolean',
|
||||
description: 'Whether to include similar cases',
|
||||
default: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
placeholder: 'Add Filter',
|
||||
default: {},
|
||||
type: 'collection',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['alert'],
|
||||
operation: ['getAll', 'count'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Custom Fields',
|
||||
name: 'customFieldsUi',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
placeholder: 'Add Custom Field',
|
||||
options: [
|
||||
{
|
||||
name: 'customFields',
|
||||
displayName: 'Custom Field',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field Name or ID',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCustomFields',
|
||||
},
|
||||
default: 'Custom Field',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Custom Field value. Use an expression if the type is not a string.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Description of the alert',
|
||||
},
|
||||
{
|
||||
displayName: 'Follow',
|
||||
name: 'follow',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether the alert becomes active when updated default=true',
|
||||
},
|
||||
{
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
default: 2,
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'tag,tag2,tag3...',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,845 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { TLPs } from '../interfaces/AlertInterface';
|
||||
|
||||
export const caseOperations: INodeProperties[] = [
|
||||
{
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
default: 'getAll',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['resource'],
|
||||
loadOptionsMethod: 'loadCaseOptions',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const caseFields: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['case'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['case'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
// Required fields
|
||||
{
|
||||
displayName: 'Case ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['update', 'executeResponder', 'get'],
|
||||
},
|
||||
},
|
||||
description: 'ID of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Title of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Description of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
default: 2,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Date and time of the begin of the case default=now',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'string',
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Flag',
|
||||
name: 'flag',
|
||||
type: 'boolean',
|
||||
required: true,
|
||||
default: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
|
||||
description: 'Flag of the case default=false',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
required: true,
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
},
|
||||
// required for responder execution
|
||||
{
|
||||
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/expressions/">expression</a>',
|
||||
default: '',
|
||||
required: true,
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id'],
|
||||
loadOptionsMethod: 'loadResponders',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['executeResponder'],
|
||||
},
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'JSON Parameters',
|
||||
name: 'jsonParameters',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create', 'update'],
|
||||
},
|
||||
},
|
||||
},
|
||||
// Optional fields (Create operation)
|
||||
{
|
||||
displayName: 'Options',
|
||||
type: 'collection',
|
||||
name: 'options',
|
||||
placeholder: 'Add option',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Custom Fields',
|
||||
name: 'customFieldsUi',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [false],
|
||||
},
|
||||
},
|
||||
placeholder: 'Add Custom Field',
|
||||
options: [
|
||||
{
|
||||
name: 'customFields',
|
||||
displayName: 'Custom Field',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field Name or ID',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCustomFields',
|
||||
},
|
||||
default: 'Custom Field',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Custom Field value. Use an expression if the type is not a string.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Fields (JSON)',
|
||||
name: 'customFieldsJson',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [true],
|
||||
},
|
||||
},
|
||||
description: 'Custom fields in JSON format. Overrides Custom Fields UI if set.',
|
||||
},
|
||||
{
|
||||
displayName: 'End Date',
|
||||
name: 'endDate',
|
||||
default: '',
|
||||
type: 'dateTime',
|
||||
description: 'Resolution date',
|
||||
},
|
||||
{
|
||||
displayName: 'Summary',
|
||||
name: 'summary',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Summary of the case, to be provided when closing a case',
|
||||
},
|
||||
{
|
||||
displayName: 'Metrics (JSON)',
|
||||
name: 'metrics',
|
||||
default: '[]',
|
||||
type: 'json',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [true],
|
||||
},
|
||||
},
|
||||
description: 'List of metrics',
|
||||
},
|
||||
],
|
||||
},
|
||||
// Optional fields (Update operations)
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
type: 'collection',
|
||||
name: 'updateFields',
|
||||
placeholder: 'Add Field',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Custom Fields',
|
||||
name: 'customFieldsUi',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [false],
|
||||
},
|
||||
},
|
||||
placeholder: 'Add Custom Field',
|
||||
options: [
|
||||
{
|
||||
name: 'customFields',
|
||||
displayName: 'Custom Field',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field Name or ID',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCustomFields',
|
||||
},
|
||||
default: 'Custom Field',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Custom Field value. Use an expression if the type is not a string.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Custom Fields (JSON)',
|
||||
name: 'customFieldsJson',
|
||||
type: 'string',
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [true],
|
||||
},
|
||||
},
|
||||
description: 'Custom fields in JSON format. Overrides Custom Fields UI if set.',
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Description of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'End Date',
|
||||
name: 'endDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Resolution date',
|
||||
},
|
||||
{
|
||||
displayName: 'Flag',
|
||||
name: 'flag',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
|
||||
description: 'Flag of the case default=false',
|
||||
},
|
||||
{
|
||||
displayName: 'Impact Status',
|
||||
name: 'impactStatus',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'No Impact',
|
||||
value: 'NoImpact',
|
||||
},
|
||||
{
|
||||
name: 'With Impact',
|
||||
value: 'WithImpact',
|
||||
},
|
||||
{
|
||||
name: 'Not Applicable',
|
||||
value: 'NotApplicable',
|
||||
},
|
||||
],
|
||||
description: 'Impact status of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Metrics (JSON)',
|
||||
name: 'metrics',
|
||||
type: 'json',
|
||||
default: '[]',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'/jsonParameters': [true],
|
||||
},
|
||||
},
|
||||
description: 'List of metrics',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Resolution Status',
|
||||
name: 'resolutionStatus',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
value: 'Duplicated',
|
||||
name: 'Duplicated',
|
||||
},
|
||||
{
|
||||
value: 'FalsePositive',
|
||||
name: 'False Positive',
|
||||
},
|
||||
{
|
||||
value: 'Indeterminate',
|
||||
name: 'Indeterminate',
|
||||
},
|
||||
{
|
||||
value: 'Other',
|
||||
name: 'Other',
|
||||
},
|
||||
{
|
||||
value: 'TruePositive',
|
||||
name: 'True Positive',
|
||||
},
|
||||
],
|
||||
description: 'Resolution status of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
default: 2,
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Date and time of the begin of the case default=now',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Open',
|
||||
value: 'Open',
|
||||
},
|
||||
{
|
||||
name: 'Resolved',
|
||||
value: 'Resolved',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
default: 'Open',
|
||||
},
|
||||
{
|
||||
displayName: 'Summary',
|
||||
name: 'summary',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Summary of the case, to be provided when closing a case',
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Title of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
],
|
||||
},
|
||||
// query options
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['case'],
|
||||
},
|
||||
},
|
||||
type: 'collection',
|
||||
placeholder: 'Add option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'string',
|
||||
placeholder: '±Attribut, exp +status',
|
||||
description: 'Specify the sorting attribut, + for asc, - for desc',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
// Query filters
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
placeholder: 'Add a Filter',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['case'],
|
||||
operation: ['getAll', 'count'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Custom Fields',
|
||||
name: 'customFieldsUi',
|
||||
type: 'fixedCollection',
|
||||
default: {},
|
||||
typeOptions: {
|
||||
multipleValues: true,
|
||||
},
|
||||
placeholder: 'Add Custom Field',
|
||||
options: [
|
||||
{
|
||||
name: 'customFields',
|
||||
displayName: 'Custom Field',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Field Name or ID',
|
||||
name: 'field',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadCustomFields',
|
||||
},
|
||||
default: 'Custom Field',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'value',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Custom Field value. Use an expression if the type is not a string.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Description of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'End Date',
|
||||
name: 'endDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Resolution date',
|
||||
},
|
||||
{
|
||||
displayName: 'Flag',
|
||||
name: 'flag',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
|
||||
description: 'Flag of the case default=false',
|
||||
},
|
||||
{
|
||||
displayName: 'Impact Status',
|
||||
name: 'impactStatus',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'No Impact',
|
||||
value: 'NoImpact',
|
||||
},
|
||||
{
|
||||
name: 'With Impact',
|
||||
value: 'WithImpact',
|
||||
},
|
||||
{
|
||||
name: 'Not Applicable',
|
||||
value: 'NotApplicable',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Resolution Status',
|
||||
name: 'resolutionStatus',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
value: 'Duplicated',
|
||||
name: 'Duplicated',
|
||||
},
|
||||
{
|
||||
value: 'False Positive',
|
||||
name: 'FalsePositive',
|
||||
},
|
||||
{
|
||||
value: 'Indeterminate',
|
||||
name: 'Indeterminate',
|
||||
},
|
||||
{
|
||||
value: 'Other',
|
||||
name: 'Other',
|
||||
},
|
||||
{
|
||||
value: 'True Positive',
|
||||
name: 'TruePositive',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Severity',
|
||||
name: 'severity',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Low',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
name: 'Medium',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
name: 'High',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
default: 2,
|
||||
description: 'Severity of the alert. Default=Medium.',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Date and time of the begin of the case default=now',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Open',
|
||||
value: 'Open',
|
||||
},
|
||||
{
|
||||
name: 'Resolved',
|
||||
value: 'Resolved',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
default: 'Open',
|
||||
},
|
||||
{
|
||||
displayName: 'Summary',
|
||||
name: 'summary',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Summary of the case, to be provided when closing a case',
|
||||
},
|
||||
{
|
||||
displayName: 'Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Title of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,189 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const eventsDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Events',
|
||||
name: 'events',
|
||||
type: 'multiOptions',
|
||||
default: [],
|
||||
required: true,
|
||||
description: 'Events types',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [1],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: '*',
|
||||
value: '*',
|
||||
description: 'Any time any event is triggered (Wildcard Event)',
|
||||
},
|
||||
{
|
||||
name: 'Alert Created',
|
||||
value: 'alert_create',
|
||||
description: 'Triggered when an alert is created',
|
||||
},
|
||||
{
|
||||
name: 'Alert Deleted',
|
||||
value: 'alert_delete',
|
||||
description: 'Triggered when an alert is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Alert Updated',
|
||||
value: 'alert_update',
|
||||
description: 'Triggered when an alert is updated',
|
||||
},
|
||||
{
|
||||
name: 'Case Created',
|
||||
value: 'case_create',
|
||||
description: 'Triggered when a case is created',
|
||||
},
|
||||
{
|
||||
name: 'Case Deleted',
|
||||
value: 'case_delete',
|
||||
description: 'Triggered when a case is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Case Updated',
|
||||
value: 'case_update',
|
||||
description: 'Triggered when a case is updated',
|
||||
},
|
||||
{
|
||||
name: 'Log Created',
|
||||
value: 'case_task_log_create',
|
||||
description: 'Triggered when a task log is created',
|
||||
},
|
||||
{
|
||||
name: 'Log Deleted',
|
||||
value: 'case_task_log_delete',
|
||||
description: 'Triggered when a task log is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Log Updated',
|
||||
value: 'case_task_log_update',
|
||||
description: 'Triggered when a task log is updated',
|
||||
},
|
||||
{
|
||||
name: 'Observable Created',
|
||||
value: 'case_artifact_create',
|
||||
description: 'Triggered when an observable is created',
|
||||
},
|
||||
{
|
||||
name: 'Observable Deleted',
|
||||
value: 'case_artifact_delete',
|
||||
description: 'Triggered when an observable is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Observable Updated',
|
||||
value: 'case_artifact_update',
|
||||
description: 'Triggered when an observable is updated',
|
||||
},
|
||||
{
|
||||
name: 'Task Created',
|
||||
value: 'case_task_create',
|
||||
description: 'Triggered when a task is created',
|
||||
},
|
||||
{
|
||||
name: 'Task Deleted',
|
||||
value: 'case_task_delete',
|
||||
description: 'Triggered when a task is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Task Updated',
|
||||
value: 'case_task_update',
|
||||
description: 'Triggered when a task is updated',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Events',
|
||||
name: 'events',
|
||||
type: 'multiOptions',
|
||||
default: [],
|
||||
required: true,
|
||||
description: 'Events types',
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: '*',
|
||||
value: '*',
|
||||
description: 'Any time any event is triggered (Wildcard Event)',
|
||||
},
|
||||
{
|
||||
name: 'Alert Created',
|
||||
value: 'alert_create',
|
||||
description: 'Triggered when an alert is created',
|
||||
},
|
||||
{
|
||||
name: 'Alert Deleted',
|
||||
value: 'alert_delete',
|
||||
description: 'Triggered when an alert is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Alert Updated',
|
||||
value: 'alert_update',
|
||||
description: 'Triggered when an alert is updated',
|
||||
},
|
||||
{
|
||||
name: 'Case Created',
|
||||
value: 'case_create',
|
||||
description: 'Triggered when a case is created',
|
||||
},
|
||||
{
|
||||
name: 'Case Deleted',
|
||||
value: 'case_delete',
|
||||
description: 'Triggered when a case is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Case Updated',
|
||||
value: 'case_update',
|
||||
description: 'Triggered when a case is updated',
|
||||
},
|
||||
{
|
||||
name: 'Log Created',
|
||||
value: 'case_task_log_create',
|
||||
description: 'Triggered when a task log is created',
|
||||
},
|
||||
{
|
||||
name: 'Log Deleted',
|
||||
value: 'case_task_log_delete',
|
||||
description: 'Triggered when a task log is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Log Updated',
|
||||
value: 'case_task_log_update',
|
||||
description: 'Triggered when a task log is updated',
|
||||
},
|
||||
{
|
||||
name: 'Observable Created',
|
||||
value: 'case_artifact_create',
|
||||
description: 'Triggered when an observable is created',
|
||||
},
|
||||
{
|
||||
name: 'Observable Deleted',
|
||||
value: 'case_artifact_delete',
|
||||
description: 'Triggered when an observable is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Observable Updated',
|
||||
value: 'case_artifact_update',
|
||||
description: 'Triggered when an observable is updated',
|
||||
},
|
||||
{
|
||||
name: 'Task Created',
|
||||
value: 'case_task_create',
|
||||
description: 'Triggered when a task is created',
|
||||
},
|
||||
{
|
||||
name: 'Task Updated',
|
||||
value: 'case_task_update',
|
||||
description: 'Triggered when a task is updated',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,222 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const logOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
noDataExpression: true,
|
||||
type: 'options',
|
||||
required: true,
|
||||
default: 'getAll',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Create',
|
||||
value: 'create',
|
||||
description: 'Create task log',
|
||||
action: 'Create a log',
|
||||
},
|
||||
{
|
||||
name: 'Execute Responder',
|
||||
value: 'executeResponder',
|
||||
description: 'Execute a responder on a selected log',
|
||||
action: 'Execute a responder',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many task logs',
|
||||
action: 'Get many logs',
|
||||
},
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get a single log',
|
||||
action: 'Get a log',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export const logFields: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Task ID',
|
||||
name: 'taskId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['create', 'getAll'],
|
||||
},
|
||||
},
|
||||
description: 'ID of the task',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['log'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll'],
|
||||
resource: ['log'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
// required attributs
|
||||
{
|
||||
displayName: 'Log ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['executeResponder', 'get'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Content of the Log',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Date of the log submission default=now',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
name: 'Ok',
|
||||
value: 'Ok',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
default: '',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Status of the log (Ok or Deleted) default=Ok',
|
||||
},
|
||||
// required for responder execution
|
||||
{
|
||||
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/expressions/">expression</a>',
|
||||
required: true,
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id'],
|
||||
loadOptionsMethod: 'loadResponders',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['executeResponder'],
|
||||
},
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
},
|
||||
// Optional attributs
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['log'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
placeholder: 'Add option',
|
||||
options: [
|
||||
{
|
||||
displayName: 'Attachment',
|
||||
name: 'attachmentValues',
|
||||
placeholder: 'Add Attachment',
|
||||
type: 'fixedCollection',
|
||||
typeOptions: {
|
||||
multipleValues: false,
|
||||
},
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Attachment',
|
||||
name: 'attachmentValues',
|
||||
values: [
|
||||
{
|
||||
displayName: 'Input Binary Field',
|
||||
name: 'binaryProperty',
|
||||
type: 'string',
|
||||
default: 'data',
|
||||
description: 'The name of the input binary field which holds binary data',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
description: 'File attached to the log',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,571 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
import { TLPs } from '../interfaces/AlertInterface';
|
||||
|
||||
export const observableOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation Name or ID',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
default: 'getAll',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['resource'],
|
||||
loadOptionsMethod: 'loadObservableOptions',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const observableFields: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Case ID',
|
||||
name: 'caseId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create', 'getAll'],
|
||||
},
|
||||
},
|
||||
description: 'ID of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll', 'search'],
|
||||
resource: ['observable'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll', 'search'],
|
||||
resource: ['observable'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
// required attributs
|
||||
{
|
||||
displayName: 'Observable ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['update', 'executeResponder', 'executeAnalyzer', 'get'],
|
||||
},
|
||||
},
|
||||
description: 'ID of the observable',
|
||||
},
|
||||
{
|
||||
displayName: 'Data Type Name or ID',
|
||||
name: 'dataType',
|
||||
type: 'options',
|
||||
required: true,
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadObservableTypes',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create', 'executeAnalyzer'],
|
||||
},
|
||||
},
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
},
|
||||
{
|
||||
displayName: 'Data',
|
||||
name: 'data',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
hide: {
|
||||
dataType: ['file'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Input Binary Field',
|
||||
name: 'binaryProperty',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: 'data',
|
||||
description: 'The name of the input binary field that represent the attachment file',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
dataType: ['file'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Description of the observable in the context of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Date and time of the begin of the case default=now',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
required: true,
|
||||
default: 2,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
{
|
||||
displayName: 'IOC',
|
||||
name: 'ioc',
|
||||
type: 'boolean',
|
||||
required: true,
|
||||
default: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Whether the observable is an IOC (Indicator of compromise)',
|
||||
},
|
||||
{
|
||||
displayName: 'Sighted',
|
||||
name: 'sighted',
|
||||
type: 'boolean',
|
||||
required: true,
|
||||
default: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Whether sighted previously',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
required: true,
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'Ok',
|
||||
value: 'Ok',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Status of the observable. Default=Ok.',
|
||||
},
|
||||
// required for analyzer execution
|
||||
{
|
||||
displayName: 'Analyzer Names or IDs',
|
||||
name: 'analyzers',
|
||||
type: 'multiOptions',
|
||||
description:
|
||||
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
required: true,
|
||||
default: [],
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id', 'dataType'],
|
||||
loadOptionsMethod: 'loadAnalyzers',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['executeAnalyzer'],
|
||||
},
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// required for responder execution
|
||||
{
|
||||
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/expressions/">expression</a>',
|
||||
required: true,
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id'],
|
||||
loadOptionsMethod: 'loadResponders',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['executeResponder'],
|
||||
},
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
},
|
||||
// Optional attributes (Create operation)
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
type: 'collection',
|
||||
placeholder: 'Add option',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Observable Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'tag1,tag2',
|
||||
},
|
||||
],
|
||||
},
|
||||
// Optional attributes (Update operation)
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
name: 'updateFields',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Description of the observable in the context of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Observable Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'tag1,tag2',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
{
|
||||
displayName: 'IOC',
|
||||
name: 'ioc',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether the observable is an IOC (Indicator of compromise)',
|
||||
},
|
||||
{
|
||||
displayName: 'Sighted',
|
||||
name: 'sighted',
|
||||
description: 'Whether sighted previously',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'Ok',
|
||||
value: 'Ok',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
description: 'Status of the observable. Default=Ok.',
|
||||
},
|
||||
],
|
||||
},
|
||||
// query options
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll', 'search'],
|
||||
resource: ['observable'],
|
||||
},
|
||||
},
|
||||
type: 'collection',
|
||||
placeholder: 'Add option',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'string',
|
||||
placeholder: '±Attribut, exp +status',
|
||||
description: 'Specify the sorting attribut, + for asc, - for desc',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
// query attributes
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
placeholder: 'Add Filter',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['observable'],
|
||||
operation: ['search', 'count'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Data Type Names or IDs',
|
||||
name: 'dataType',
|
||||
type: 'multiOptions',
|
||||
default: [],
|
||||
typeOptions: {
|
||||
loadOptionsMethod: 'loadObservableTypes',
|
||||
},
|
||||
description:
|
||||
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
},
|
||||
{
|
||||
displayName: 'Date Range',
|
||||
type: 'fixedCollection',
|
||||
name: 'range',
|
||||
default: {},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Add Date Range Inputs',
|
||||
name: 'dateRange',
|
||||
values: [
|
||||
{
|
||||
displayName: 'From Date',
|
||||
name: 'fromDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'To Date',
|
||||
name: 'toDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'exp,freetext',
|
||||
},
|
||||
{
|
||||
displayName: 'IOC',
|
||||
name: 'ioc',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether the observable is an IOC (Indicator of compromise)',
|
||||
},
|
||||
{
|
||||
displayName: 'Keyword',
|
||||
name: 'keyword',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'exp,freetext',
|
||||
},
|
||||
{
|
||||
displayName: 'Message',
|
||||
name: 'message',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Description of the observable in the context of the case',
|
||||
},
|
||||
{
|
||||
displayName: 'Observable Tags',
|
||||
name: 'tags',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'tag1,tag2',
|
||||
},
|
||||
{
|
||||
displayName: 'Sighted',
|
||||
name: 'sighted',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'Status',
|
||||
type: 'options',
|
||||
default: '',
|
||||
options: [
|
||||
{
|
||||
name: 'Ok',
|
||||
value: 'Ok',
|
||||
},
|
||||
{
|
||||
name: 'Deleted',
|
||||
value: 'Deleted',
|
||||
},
|
||||
],
|
||||
description: 'Status of the observable. Default=Ok.',
|
||||
},
|
||||
{
|
||||
displayName: 'TLP',
|
||||
name: 'tlp',
|
||||
type: 'options',
|
||||
default: 2,
|
||||
options: [
|
||||
{
|
||||
name: 'White',
|
||||
value: TLPs.white,
|
||||
},
|
||||
{
|
||||
name: 'Green',
|
||||
value: TLPs.green,
|
||||
},
|
||||
{
|
||||
name: 'Amber',
|
||||
value: TLPs.amber,
|
||||
},
|
||||
{
|
||||
name: 'Red',
|
||||
value: TLPs.red,
|
||||
},
|
||||
],
|
||||
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
||||
},
|
||||
{
|
||||
displayName: 'Value',
|
||||
name: 'data',
|
||||
type: 'string',
|
||||
default: '',
|
||||
placeholder: 'example.com; 8.8.8.8',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,412 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
export const taskOperations: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation Name or ID',
|
||||
name: 'operation',
|
||||
default: 'getAll',
|
||||
type: 'options',
|
||||
description:
|
||||
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
||||
noDataExpression: true,
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['operation'],
|
||||
loadOptionsMethod: 'loadTaskOptions',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const taskFields: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Task ID',
|
||||
name: 'id',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['update', 'executeResponder', 'get'],
|
||||
},
|
||||
},
|
||||
description: 'ID of the taks',
|
||||
},
|
||||
{
|
||||
displayName: 'Case ID',
|
||||
name: 'caseId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['create', 'getAll'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['search', 'getAll'],
|
||||
resource: ['task'],
|
||||
},
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['search', 'getAll'],
|
||||
resource: ['task'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 500,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Task details',
|
||||
},
|
||||
{
|
||||
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',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Status of the task. Default=Waiting.',
|
||||
},
|
||||
{
|
||||
displayName: 'Flag',
|
||||
name: 'flag',
|
||||
type: 'boolean',
|
||||
required: true,
|
||||
default: false,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
description: 'Whether to flag the task. Default=false.',
|
||||
},
|
||||
// required for responder execution
|
||||
{
|
||||
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/expressions/">expression</a>',
|
||||
required: true,
|
||||
default: '',
|
||||
typeOptions: {
|
||||
loadOptionsDependsOn: ['id'],
|
||||
loadOptionsMethod: 'loadResponders',
|
||||
},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['executeResponder'],
|
||||
},
|
||||
hide: {
|
||||
id: [''],
|
||||
},
|
||||
},
|
||||
},
|
||||
// optional attributes (Create operations)
|
||||
{
|
||||
displayName: 'Options',
|
||||
type: 'collection',
|
||||
name: 'options',
|
||||
placeholder: 'Add option',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Task details',
|
||||
},
|
||||
{
|
||||
displayName: 'End Date',
|
||||
name: 'endDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'Date of the end of the task. This is automatically set when status is set to Completed.',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'User who owns the task. This is automatically set to current user when status is set to InProgress.',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'Date of the beginning of the task. This is automatically set when status is set to Open.',
|
||||
},
|
||||
],
|
||||
},
|
||||
// optional attributes (Update operation)
|
||||
|
||||
{
|
||||
displayName: 'Update Fields',
|
||||
type: 'collection',
|
||||
name: 'updateFields',
|
||||
placeholder: 'Add Field',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['update'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Task details',
|
||||
},
|
||||
{
|
||||
displayName: 'End Date',
|
||||
name: 'endDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'Date of the end of the task. This is automatically set when status is set to Completed.',
|
||||
},
|
||||
{
|
||||
displayName: 'Flag',
|
||||
name: 'flag',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to flag the task. Default=false.',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'User who owns the task. This is automatically set to current user when status is set to InProgress.',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'Date of the beginning of the task. This is automatically set when status is set to Open.',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
default: 'Waiting',
|
||||
options: [
|
||||
{
|
||||
name: 'Cancel',
|
||||
value: 'Cancel',
|
||||
},
|
||||
{
|
||||
name: 'Completed',
|
||||
value: 'Completed',
|
||||
},
|
||||
{
|
||||
name: 'In Progress',
|
||||
value: 'InProgress',
|
||||
},
|
||||
{
|
||||
name: 'Waiting',
|
||||
value: 'Waiting',
|
||||
},
|
||||
],
|
||||
description: 'Status of the task. Default=Waiting.',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Task details',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
// query options
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
placeholder: 'Add option',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: ['getAll', 'search'],
|
||||
resource: ['task'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Sort',
|
||||
name: 'sort',
|
||||
type: 'string',
|
||||
placeholder: '±Attribut, exp +status',
|
||||
description: 'Specify the sorting attribut, + for asc, - for desc',
|
||||
default: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
// query attributes
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'collection',
|
||||
default: {},
|
||||
placeholder: 'Add Filter',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['task'],
|
||||
operation: ['search', 'count'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Description',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Task details',
|
||||
},
|
||||
{
|
||||
displayName: 'End Date',
|
||||
name: 'endDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'Date of the end of the task. This is automatically set when status is set to Completed.',
|
||||
},
|
||||
{
|
||||
displayName: 'Flag',
|
||||
name: 'flag',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to flag the task. Default=false.',
|
||||
},
|
||||
{
|
||||
displayName: 'Owner',
|
||||
name: 'owner',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description:
|
||||
'User who owns the task. This is automatically set to current user when status is set to InProgress.',
|
||||
},
|
||||
{
|
||||
displayName: 'Start Date',
|
||||
name: 'startDate',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description:
|
||||
'Date of the beginning of the task. This is automatically set when status is set to Open.',
|
||||
},
|
||||
{
|
||||
displayName: 'Status',
|
||||
name: 'status',
|
||||
type: 'options',
|
||||
default: 'Waiting',
|
||||
options: [
|
||||
{
|
||||
name: 'Cancel',
|
||||
value: 'Cancel',
|
||||
},
|
||||
{
|
||||
name: 'Completed',
|
||||
value: 'Completed',
|
||||
},
|
||||
{
|
||||
name: 'In Progress',
|
||||
value: 'InProgress',
|
||||
},
|
||||
{
|
||||
name: 'Waiting',
|
||||
value: 'Waiting',
|
||||
},
|
||||
],
|
||||
description: 'Status of the task. Default=Waiting.',
|
||||
},
|
||||
{
|
||||
displayName: 'Title',
|
||||
name: 'title',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'Task details',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user