2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2021-06-04 20:39:39 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const linkedResourceOperations: INodeProperties[] = [
|
2021-06-04 20:39:39 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-06-04 20:39:39 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['linkedResource'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a linked resource',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a linked resource',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a linked resource',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2021-06-04 20:39:39 -07:00
|
|
|
value: 'getAll',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get all linked resources',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a linked resource',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'get',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-06-04 20:39:39 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const linkedResourceFields: INodeProperties[] = [
|
2021-06-04 20:39:39 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* linkedResource:ALL */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Task List Name or ID',
|
2021-06-04 20:39:39 -07:00
|
|
|
name: 'taskListId',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2021-06-04 20:39:39 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTaskLists',
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create', 'delete', 'get', 'getAll', 'update'],
|
|
|
|
resource: ['linkedResource'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Task ID',
|
|
|
|
name: 'taskId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create', 'delete', 'get', 'getAll', 'update'],
|
|
|
|
resource: ['linkedResource'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* linkedResource:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'displayName',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['linkedResource'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Field indicating title of the linked entity',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Application Name',
|
|
|
|
name: 'applicationName',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['create'],
|
|
|
|
resource: ['linkedResource'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'App name of the source that is sending the linked entity',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['linkedResource'],
|
|
|
|
operation: ['create'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'External ID',
|
|
|
|
name: 'externalId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'ID of the object that is associated with this task on the third-party/partner system',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Web URL',
|
|
|
|
name: 'webUrl',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Deeplink to the linked entity',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* linkedResource:get/delete/update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Linked Resource ID',
|
|
|
|
name: 'linkedResourceId',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['linkedResource'],
|
|
|
|
operation: ['delete', 'get', 'update'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* linkedResource:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['linkedResource'],
|
|
|
|
operation: ['getAll'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['linkedResource'],
|
|
|
|
operation: ['getAll'],
|
2021-06-04 20:39:39 -07:00
|
|
|
returnAll: [false],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
default: 50,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* linkedResource:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['linkedResource'],
|
|
|
|
operation: ['update'],
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Application Name',
|
|
|
|
name: 'applicationName',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'App name of the source that is sending the linked entity',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'displayName',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Field indicating title of the linked entity',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'External ID',
|
|
|
|
name: 'externalId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
|
|
|
'ID of the object that is associated with this task on the third-party/partner system',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Web URL',
|
|
|
|
name: 'webUrl',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Deeplink to the linked entity',
|
2021-06-04 20:39:39 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|