@worktables/n8n-nodes-worktables 12.0.6 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Worktables/Worktables.node.d.ts +0 -1
- package/dist/nodes/Worktables/Worktables.node.js +293 -32
- package/dist/nodes/Worktables/Worktables.node.js.map +1 -1
- package/dist/nodes/Worktables/Worktables.node.json +1 -3
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/nodes/WorktablesV2/MondayWebhook.node.d.ts +0 -5
- package/dist/nodes/WorktablesV2/MondayWebhook.node.js +0 -45
- package/dist/nodes/WorktablesV2/MondayWebhook.node.js.map +0 -1
- package/dist/nodes/WorktablesV2/MondayWebhook.node.json +0 -27
- package/dist/nodes/WorktablesV2/Worktables.node.d.ts +0 -33
- package/dist/nodes/WorktablesV2/Worktables.node.js +0 -4793
- package/dist/nodes/WorktablesV2/Worktables.node.js.map +0 -1
- package/dist/nodes/WorktablesV2/Worktables.node.json +0 -20
- package/dist/nodes/WorktablesV2/worktables_icon.svg +0 -1
|
@@ -1,4793 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Worktables = void 0;
|
|
7
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
-
const isErrorResponse_1 = require("../../utils/isErrorResponse");
|
|
9
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
10
|
-
const axios_1 = __importDefault(require("axios"));
|
|
11
|
-
const parseValue_1 = require("../../utils/parseValue");
|
|
12
|
-
const country_codes_json_1 = __importDefault(require("../../utils/country_codes.json"));
|
|
13
|
-
class Worktables {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.description = {
|
|
16
|
-
displayName: 'Worktables',
|
|
17
|
-
name: 'worktables',
|
|
18
|
-
icon: 'file:worktables_icon.svg',
|
|
19
|
-
group: ['transform'],
|
|
20
|
-
version: 1,
|
|
21
|
-
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
|
22
|
-
description: 'Interact with Monday.com boards and items',
|
|
23
|
-
defaults: {
|
|
24
|
-
name: 'Worktables',
|
|
25
|
-
},
|
|
26
|
-
usableAsTool: true,
|
|
27
|
-
inputs: ["main"],
|
|
28
|
-
outputs: ["main"],
|
|
29
|
-
credentials: [
|
|
30
|
-
{
|
|
31
|
-
name: 'WorktablesApi',
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
requestDefaults: {
|
|
36
|
-
baseURL: 'https://api.monday.com/v2',
|
|
37
|
-
headers: {
|
|
38
|
-
'Content-Type': 'application/json',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
properties: [
|
|
42
|
-
{
|
|
43
|
-
displayName: 'Resource',
|
|
44
|
-
name: 'resource',
|
|
45
|
-
type: 'options',
|
|
46
|
-
noDataExpression: true,
|
|
47
|
-
typeOptions: {
|
|
48
|
-
loadOptionsMethod: 'getResources',
|
|
49
|
-
},
|
|
50
|
-
default: 'board',
|
|
51
|
-
required: true,
|
|
52
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
displayName: 'Operation',
|
|
56
|
-
name: 'operation',
|
|
57
|
-
type: 'options',
|
|
58
|
-
noDataExpression: true,
|
|
59
|
-
options: [
|
|
60
|
-
{
|
|
61
|
-
name: 'List Boards',
|
|
62
|
-
value: 'listBoards',
|
|
63
|
-
description: 'List all boards',
|
|
64
|
-
action: 'List boards',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: "List Board's Groups",
|
|
68
|
-
value: 'listBoardGroups',
|
|
69
|
-
description: 'List all groups in a board',
|
|
70
|
-
action: 'List group',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'Create a Board',
|
|
74
|
-
value: 'createBoard',
|
|
75
|
-
description: 'Create a new board',
|
|
76
|
-
action: 'Create a board',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'Create a Group',
|
|
80
|
-
value: 'createGroup',
|
|
81
|
-
description: 'Create a new group in a board',
|
|
82
|
-
action: 'Create a group',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'Get a Board',
|
|
86
|
-
value: 'getBoard',
|
|
87
|
-
description: 'Retrieve details of a specific board',
|
|
88
|
-
action: 'Get a board',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'Get a Group',
|
|
92
|
-
value: 'getGroup',
|
|
93
|
-
description: 'Retrieve details of a specific group in a board',
|
|
94
|
-
action: 'Get a group',
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: 'Duplicate a Group',
|
|
98
|
-
value: 'duplicateGroup',
|
|
99
|
-
description: 'Duplicate an existing group in a board',
|
|
100
|
-
action: 'Duplicate a group',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'Duplicate a Board',
|
|
104
|
-
value: 'duplicateBoard',
|
|
105
|
-
description: 'Duplicate an existing board',
|
|
106
|
-
action: 'Duplicate a board',
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'List Board Activity Logs',
|
|
110
|
-
value: 'listBoardActivityLogs',
|
|
111
|
-
description: 'Retrieve activity logs of a board',
|
|
112
|
-
action: 'List board activity logs',
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'List Board Subscribers',
|
|
116
|
-
value: 'listBoardSubscribers',
|
|
117
|
-
description: 'List all subscribers of a board',
|
|
118
|
-
action: 'List board subscribers',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'Add Board Subscribers',
|
|
122
|
-
value: 'addBoardSubscribers',
|
|
123
|
-
description: 'Add subscribers to a board',
|
|
124
|
-
action: 'Add board subscribers',
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: 'Remove Board Subscribers',
|
|
128
|
-
value: 'removeBoardSubscribers',
|
|
129
|
-
description: 'Remove subscribers from a board',
|
|
130
|
-
action: 'Remove board subscribers',
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
default: 'listBoards',
|
|
134
|
-
required: true,
|
|
135
|
-
displayOptions: {
|
|
136
|
-
show: { resource: ['board'] },
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
displayName: 'Operation',
|
|
141
|
-
name: 'operation',
|
|
142
|
-
type: 'options',
|
|
143
|
-
noDataExpression: true,
|
|
144
|
-
options: [
|
|
145
|
-
{
|
|
146
|
-
name: 'Run API',
|
|
147
|
-
value: 'query',
|
|
148
|
-
description: 'Run a custom query',
|
|
149
|
-
action: 'Run api a query',
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
default: 'query',
|
|
153
|
-
required: true,
|
|
154
|
-
displayOptions: {
|
|
155
|
-
show: { resource: ['query'] },
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
displayName: 'Operation',
|
|
160
|
-
name: 'operation',
|
|
161
|
-
type: 'options',
|
|
162
|
-
noDataExpression: true,
|
|
163
|
-
options: [
|
|
164
|
-
{
|
|
165
|
-
name: 'Get an Item',
|
|
166
|
-
value: 'getItem',
|
|
167
|
-
description: 'Retrieve details of a specific item',
|
|
168
|
-
action: 'Get an item',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: 'Create an Item',
|
|
172
|
-
value: 'createItem',
|
|
173
|
-
description: 'Create an item in a board',
|
|
174
|
-
action: 'Create an item',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: 'Update Column Values of an Item',
|
|
178
|
-
value: 'updateItem',
|
|
179
|
-
action: 'Update column values of an item',
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
name: 'Delete an Item',
|
|
183
|
-
value: 'deleteItem',
|
|
184
|
-
description: 'Delete an item from a board',
|
|
185
|
-
action: 'Delete an item',
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
name: 'Duplicate an Item',
|
|
189
|
-
value: 'duplicateItem',
|
|
190
|
-
description: 'Duplicate an existing item',
|
|
191
|
-
action: 'Duplicate an item',
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: 'List Items in a Board',
|
|
195
|
-
value: 'listBoardItems',
|
|
196
|
-
description: 'List all items in a board',
|
|
197
|
-
action: 'List items in a board',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'List Items in a Group',
|
|
201
|
-
value: 'listGroupItems',
|
|
202
|
-
description: 'List all items in a group',
|
|
203
|
-
action: 'List items in a group',
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
name: 'Search Items by Filter',
|
|
207
|
-
value: 'searchItems',
|
|
208
|
-
description: 'Search items in a board using a filter',
|
|
209
|
-
action: 'Search items by filter',
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: 'List Item Subscribers',
|
|
213
|
-
value: 'listItemSubscribers',
|
|
214
|
-
description: 'List all subscribers of an item',
|
|
215
|
-
action: 'List item subscribers',
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: 'Upload files to column',
|
|
219
|
-
value: 'uploadItemFile',
|
|
220
|
-
action: 'Upload files to column',
|
|
221
|
-
},
|
|
222
|
-
],
|
|
223
|
-
default: 'createItem',
|
|
224
|
-
required: true,
|
|
225
|
-
displayOptions: {
|
|
226
|
-
show: { resource: ['item'] },
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
displayName: 'Operation',
|
|
231
|
-
name: 'operation',
|
|
232
|
-
type: 'options',
|
|
233
|
-
noDataExpression: true,
|
|
234
|
-
options: [
|
|
235
|
-
{
|
|
236
|
-
name: 'List',
|
|
237
|
-
value: 'listUpdates',
|
|
238
|
-
description: 'List updates',
|
|
239
|
-
action: 'List an update',
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
name: 'Create',
|
|
243
|
-
value: 'createUpdate',
|
|
244
|
-
description: 'Create an update',
|
|
245
|
-
action: 'Create an update',
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
name: 'Update',
|
|
249
|
-
value: 'updateUpdate',
|
|
250
|
-
description: 'Update an update',
|
|
251
|
-
action: 'Update an update',
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
name: 'Delete',
|
|
255
|
-
value: 'deleteUpdate',
|
|
256
|
-
description: 'Delete an update',
|
|
257
|
-
action: 'Delete an update',
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
name: 'Pin',
|
|
261
|
-
value: 'pinUpdate',
|
|
262
|
-
description: 'Pin an update',
|
|
263
|
-
action: 'Pin an update',
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: 'Duplicate',
|
|
267
|
-
value: 'duplicateUpdate',
|
|
268
|
-
description: 'Duplicate an update',
|
|
269
|
-
action: 'Duplicate an update',
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
name: 'Upload files to update',
|
|
273
|
-
value: 'uploadFile',
|
|
274
|
-
description: 'Upload a file to an update',
|
|
275
|
-
action: 'Upload files to update',
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
default: 'listUpdates',
|
|
279
|
-
required: true,
|
|
280
|
-
displayOptions: {
|
|
281
|
-
show: { resource: ['update'] },
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
displayName: 'Operation',
|
|
286
|
-
name: 'operation',
|
|
287
|
-
type: 'options',
|
|
288
|
-
noDataExpression: true,
|
|
289
|
-
options: [
|
|
290
|
-
{
|
|
291
|
-
name: 'Get Info',
|
|
292
|
-
value: 'getInfoAccount',
|
|
293
|
-
description: 'Get a info account',
|
|
294
|
-
action: 'Get info an account',
|
|
295
|
-
},
|
|
296
|
-
],
|
|
297
|
-
default: 'getInfoAccount',
|
|
298
|
-
required: true,
|
|
299
|
-
displayOptions: {
|
|
300
|
-
show: { resource: ['account'] },
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
displayName: 'Operation',
|
|
305
|
-
name: 'operation',
|
|
306
|
-
type: 'options',
|
|
307
|
-
noDataExpression: true,
|
|
308
|
-
options: [
|
|
309
|
-
{
|
|
310
|
-
name: 'List Teams',
|
|
311
|
-
value: 'listTeams',
|
|
312
|
-
description: 'List all teams',
|
|
313
|
-
action: 'List teams',
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
name: 'Get a Team',
|
|
317
|
-
value: 'getTeam',
|
|
318
|
-
description: 'Retrieve details of a specific team',
|
|
319
|
-
action: 'Get a team',
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: 'Create a Team',
|
|
323
|
-
value: 'createTeam',
|
|
324
|
-
description: 'Create a new team',
|
|
325
|
-
action: 'Create a team',
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
name: 'Delete a Team',
|
|
329
|
-
value: 'deleteTeam',
|
|
330
|
-
description: 'Delete a specific team',
|
|
331
|
-
action: 'Delete a team',
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
name: 'Add Users to Team',
|
|
335
|
-
value: 'addUsersToTeam',
|
|
336
|
-
description: 'Add users to a specific team',
|
|
337
|
-
action: 'Add users to team',
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
name: 'Remove Users From Team',
|
|
341
|
-
value: 'removeUsersFromTeam',
|
|
342
|
-
description: 'Remove users from a specific team',
|
|
343
|
-
action: 'Remove users from team',
|
|
344
|
-
},
|
|
345
|
-
],
|
|
346
|
-
default: 'listTeams',
|
|
347
|
-
required: true,
|
|
348
|
-
displayOptions: {
|
|
349
|
-
show: { resource: ['team'] },
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
displayName: 'Operation',
|
|
354
|
-
name: 'operation',
|
|
355
|
-
type: 'options',
|
|
356
|
-
noDataExpression: true,
|
|
357
|
-
options: [
|
|
358
|
-
{
|
|
359
|
-
name: 'List Users',
|
|
360
|
-
value: 'listUsers',
|
|
361
|
-
description: 'List all users',
|
|
362
|
-
action: 'List users',
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
name: 'Get a User',
|
|
366
|
-
value: 'getUser',
|
|
367
|
-
description: 'Retrieve details of a specific user',
|
|
368
|
-
action: 'Get a user',
|
|
369
|
-
},
|
|
370
|
-
],
|
|
371
|
-
default: 'listUsers',
|
|
372
|
-
required: true,
|
|
373
|
-
displayOptions: {
|
|
374
|
-
show: { resource: ['user'] },
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
displayName: 'Query',
|
|
379
|
-
name: 'runQuery',
|
|
380
|
-
type: 'string',
|
|
381
|
-
default: '',
|
|
382
|
-
description: 'Enter the query to run',
|
|
383
|
-
displayOptions: { show: { resource: ['query'] } },
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
displayName: 'Operation',
|
|
387
|
-
name: 'operation',
|
|
388
|
-
type: 'options',
|
|
389
|
-
noDataExpression: true,
|
|
390
|
-
options: [
|
|
391
|
-
{
|
|
392
|
-
name: 'Download File',
|
|
393
|
-
value: 'downloadFile',
|
|
394
|
-
description: 'Download a file from Monday.com',
|
|
395
|
-
action: 'Download a file',
|
|
396
|
-
},
|
|
397
|
-
],
|
|
398
|
-
displayOptions: {
|
|
399
|
-
show: { resource: ['downloadFile'] },
|
|
400
|
-
},
|
|
401
|
-
default: 'downloadFile',
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
displayName: 'Item ID',
|
|
405
|
-
name: 'itemId',
|
|
406
|
-
type: 'string',
|
|
407
|
-
default: '',
|
|
408
|
-
required: true,
|
|
409
|
-
displayOptions: {
|
|
410
|
-
show: {
|
|
411
|
-
operation: ['listItemSubscribers'],
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
displayName: 'Asset ID',
|
|
417
|
-
name: 'fileId',
|
|
418
|
-
type: 'string',
|
|
419
|
-
default: '',
|
|
420
|
-
required: true,
|
|
421
|
-
description: 'Enter the asset ID to download',
|
|
422
|
-
displayOptions: {
|
|
423
|
-
show: { operation: ['downloadFile'] },
|
|
424
|
-
},
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
displayName: 'Workspace',
|
|
428
|
-
name: 'workspace',
|
|
429
|
-
type: 'options',
|
|
430
|
-
typeOptions: { loadOptionsMethod: 'getWorkspaces' },
|
|
431
|
-
default: '',
|
|
432
|
-
required: true,
|
|
433
|
-
description: 'Select a workspace. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
434
|
-
displayOptions: {
|
|
435
|
-
show: {
|
|
436
|
-
operation: ['createBoard', 'listBoardGroups'],
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
displayName: 'New Board Name',
|
|
442
|
-
name: 'boardName',
|
|
443
|
-
type: 'string',
|
|
444
|
-
default: '',
|
|
445
|
-
description: 'Enter the board name',
|
|
446
|
-
displayOptions: { show: { operation: ['createBoard', 'duplicateBoard'] } },
|
|
447
|
-
},
|
|
448
|
-
{
|
|
449
|
-
displayName: 'Board Kind',
|
|
450
|
-
name: 'boardKind',
|
|
451
|
-
type: 'options',
|
|
452
|
-
options: [
|
|
453
|
-
{ name: 'Public', value: 'public' },
|
|
454
|
-
{ name: 'Private', value: 'private' },
|
|
455
|
-
{ name: 'Shareable', value: 'share' },
|
|
456
|
-
],
|
|
457
|
-
default: 'public',
|
|
458
|
-
description: 'Select the board kind',
|
|
459
|
-
displayOptions: { show: { operation: ['createBoard'] } },
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
displayName: 'Board Kind',
|
|
463
|
-
name: 'boardKind',
|
|
464
|
-
type: 'options',
|
|
465
|
-
options: [
|
|
466
|
-
{ name: 'All', value: 'all' },
|
|
467
|
-
{ name: 'Public', value: 'public' },
|
|
468
|
-
{ name: 'Private', value: 'private' },
|
|
469
|
-
{ name: 'Shareable', value: 'share' },
|
|
470
|
-
],
|
|
471
|
-
default: 'all',
|
|
472
|
-
description: 'Select the board kind',
|
|
473
|
-
displayOptions: { show: { operation: ['listBoards'] } },
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
displayName: 'Description',
|
|
477
|
-
name: 'description',
|
|
478
|
-
type: 'string',
|
|
479
|
-
default: '',
|
|
480
|
-
description: 'Enter the board description',
|
|
481
|
-
displayOptions: { show: { operation: ['createBoard'] } },
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
displayName: 'Template ID',
|
|
485
|
-
name: 'templateId',
|
|
486
|
-
type: 'string',
|
|
487
|
-
default: '',
|
|
488
|
-
description: 'Enter the template ID',
|
|
489
|
-
displayOptions: { show: { operation: ['createBoard'] } },
|
|
490
|
-
},
|
|
491
|
-
{
|
|
492
|
-
displayName: 'Order By',
|
|
493
|
-
name: 'orderBy',
|
|
494
|
-
type: 'options',
|
|
495
|
-
options: [
|
|
496
|
-
{ name: 'None', value: 'none' },
|
|
497
|
-
{ name: 'Name', value: 'created_at' },
|
|
498
|
-
{ name: 'Newest', value: 'used_at' },
|
|
499
|
-
],
|
|
500
|
-
default: 'none',
|
|
501
|
-
hint: 'The order in which to retrieve your boards. (desc)',
|
|
502
|
-
description: 'Select the order of the boards',
|
|
503
|
-
displayOptions: { show: { operation: ['listBoards'] } },
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
displayName: 'State',
|
|
507
|
-
name: 'state',
|
|
508
|
-
type: 'options',
|
|
509
|
-
options: [
|
|
510
|
-
{ name: 'All', value: 'all' },
|
|
511
|
-
{ name: 'Active', value: 'active' },
|
|
512
|
-
{ name: 'Archived', value: 'archived' },
|
|
513
|
-
{ name: 'Deleted', value: 'deleted' },
|
|
514
|
-
],
|
|
515
|
-
default: 'active',
|
|
516
|
-
description: 'Select the state of the boards',
|
|
517
|
-
displayOptions: { show: { operation: ['listBoards'] } },
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
displayName: 'Limit',
|
|
521
|
-
name: 'limit',
|
|
522
|
-
type: 'number',
|
|
523
|
-
typeOptions: {
|
|
524
|
-
minValue: 1,
|
|
525
|
-
},
|
|
526
|
-
default: 50,
|
|
527
|
-
description: 'Max number of results to return',
|
|
528
|
-
hint: 'If 0 is provided, all boards will be returned',
|
|
529
|
-
displayOptions: { show: { operation: ['listBoards'] } },
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
displayName: 'Filter by Workspace',
|
|
533
|
-
name: 'filterByWorkspace',
|
|
534
|
-
type: 'boolean',
|
|
535
|
-
default: false,
|
|
536
|
-
description: 'Whether to filter the boards by workspace. If enabled, you must select a workspace.',
|
|
537
|
-
displayOptions: {
|
|
538
|
-
show: { operation: ['listBoards'] },
|
|
539
|
-
},
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
displayName: 'Workspace',
|
|
543
|
-
name: 'workspace',
|
|
544
|
-
type: 'options',
|
|
545
|
-
typeOptions: { loadOptionsMethod: 'getWorkspaces' },
|
|
546
|
-
default: '',
|
|
547
|
-
description: 'Select a workspace. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
548
|
-
displayOptions: {
|
|
549
|
-
show: {
|
|
550
|
-
operation: ['listBoards'],
|
|
551
|
-
filterByWorkspace: [true],
|
|
552
|
-
},
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
displayName: 'Board',
|
|
557
|
-
name: 'boardId',
|
|
558
|
-
type: 'options',
|
|
559
|
-
typeOptions: {
|
|
560
|
-
loadOptionsMethod: 'getBoards',
|
|
561
|
-
},
|
|
562
|
-
default: '',
|
|
563
|
-
required: true,
|
|
564
|
-
description: 'Select a Monday board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
565
|
-
displayOptions: {
|
|
566
|
-
show: {
|
|
567
|
-
operation: [
|
|
568
|
-
'getBoard',
|
|
569
|
-
'createSubitem',
|
|
570
|
-
'createItem',
|
|
571
|
-
'updateItem',
|
|
572
|
-
'listBoardGroups',
|
|
573
|
-
'createGroup',
|
|
574
|
-
'duplicateGroup',
|
|
575
|
-
'listBoardSubscribers',
|
|
576
|
-
'addBoardSubscribers',
|
|
577
|
-
'listBoardActivityLogs',
|
|
578
|
-
'removeBoardSubscribers',
|
|
579
|
-
'listGroupItems',
|
|
580
|
-
],
|
|
581
|
-
},
|
|
582
|
-
},
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
displayName: 'Board to Duplicate',
|
|
586
|
-
name: 'boardId',
|
|
587
|
-
type: 'options',
|
|
588
|
-
typeOptions: {
|
|
589
|
-
loadOptionsMethod: 'getBoards',
|
|
590
|
-
},
|
|
591
|
-
default: '',
|
|
592
|
-
required: true,
|
|
593
|
-
description: 'Select a Monday board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
594
|
-
displayOptions: {
|
|
595
|
-
show: {
|
|
596
|
-
operation: ['duplicateBoard'],
|
|
597
|
-
},
|
|
598
|
-
},
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
displayName: 'Destination Workspace',
|
|
602
|
-
name: 'workspace',
|
|
603
|
-
type: 'options',
|
|
604
|
-
typeOptions: { loadOptionsMethod: 'getWorkspaces' },
|
|
605
|
-
default: '',
|
|
606
|
-
required: true,
|
|
607
|
-
description: 'Select a workspace. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
608
|
-
displayOptions: {
|
|
609
|
-
show: {
|
|
610
|
-
operation: ['duplicateBoard'],
|
|
611
|
-
},
|
|
612
|
-
},
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
displayName: 'Destination Folder',
|
|
616
|
-
name: 'folder',
|
|
617
|
-
type: 'options',
|
|
618
|
-
typeOptions: { loadOptionsDependsOn: ['workspace'], loadOptionsMethod: 'getFolders' },
|
|
619
|
-
required: true,
|
|
620
|
-
default: '',
|
|
621
|
-
description: 'Select a folder. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
622
|
-
displayOptions: { show: { operation: ['duplicateBoard'] } },
|
|
623
|
-
},
|
|
624
|
-
{
|
|
625
|
-
displayName: 'Folder ID',
|
|
626
|
-
name: 'folder',
|
|
627
|
-
type: 'options',
|
|
628
|
-
typeOptions: { loadOptionsDependsOn: ['workspace'], loadOptionsMethod: 'getFolders' },
|
|
629
|
-
required: true,
|
|
630
|
-
default: '',
|
|
631
|
-
description: 'Select a folder. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
632
|
-
displayOptions: { show: { operation: ['createBoard'] } },
|
|
633
|
-
},
|
|
634
|
-
{
|
|
635
|
-
displayName: 'Keep Subscribers',
|
|
636
|
-
name: 'keepSubscribers',
|
|
637
|
-
type: 'boolean',
|
|
638
|
-
default: false,
|
|
639
|
-
description: 'Whether to keep subscribers when duplicating a board',
|
|
640
|
-
displayOptions: { show: { operation: ['duplicateBoard'] } },
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
displayName: 'Duplicate Type',
|
|
644
|
-
name: 'duplicateType',
|
|
645
|
-
type: 'options',
|
|
646
|
-
options: [
|
|
647
|
-
{ name: 'Duplicate Board with Pulses', value: 'duplicate_board_with_pulses' },
|
|
648
|
-
{
|
|
649
|
-
name: 'Duplicate Board with Pulses and Updates',
|
|
650
|
-
value: 'duplicate_board_with_pulses_and_updates',
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
name: 'Duplicate Board with Structure',
|
|
654
|
-
value: 'duplicate_board_with_structure',
|
|
655
|
-
},
|
|
656
|
-
],
|
|
657
|
-
default: 'duplicate_board_with_structure',
|
|
658
|
-
displayOptions: { show: { operation: ['duplicateBoard'] } },
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
displayName: 'Group',
|
|
662
|
-
name: 'groupId',
|
|
663
|
-
type: 'options',
|
|
664
|
-
typeOptions: {
|
|
665
|
-
loadOptionsDependsOn: ['boardId'],
|
|
666
|
-
loadOptionsMethod: 'getGroupsFromBoard',
|
|
667
|
-
},
|
|
668
|
-
default: 'topics',
|
|
669
|
-
required: true,
|
|
670
|
-
description: 'Select an item from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
671
|
-
displayOptions: {
|
|
672
|
-
show: { operation: ['createItem'], isSubitem: [false] },
|
|
673
|
-
},
|
|
674
|
-
},
|
|
675
|
-
{
|
|
676
|
-
displayName: 'Group',
|
|
677
|
-
name: 'groupId',
|
|
678
|
-
type: 'options',
|
|
679
|
-
typeOptions: {
|
|
680
|
-
loadOptionsDependsOn: ['boardId'],
|
|
681
|
-
loadOptionsMethod: 'getGroupsFromBoard',
|
|
682
|
-
},
|
|
683
|
-
default: 'topics',
|
|
684
|
-
required: true,
|
|
685
|
-
description: 'Select an item from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
686
|
-
displayOptions: {
|
|
687
|
-
show: { operation: ['duplicateGroup'] },
|
|
688
|
-
},
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
displayName: 'Group Name',
|
|
692
|
-
name: 'groupName',
|
|
693
|
-
type: 'string',
|
|
694
|
-
default: '',
|
|
695
|
-
description: 'Enter the group name',
|
|
696
|
-
displayOptions: {
|
|
697
|
-
show: { operation: ['createGroup', 'duplicateGroup'] },
|
|
698
|
-
},
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
displayName: 'Add to top',
|
|
702
|
-
name: 'addToTop',
|
|
703
|
-
type: 'boolean',
|
|
704
|
-
default: false,
|
|
705
|
-
description: 'Whether to add the group to the top of the board',
|
|
706
|
-
displayOptions: {
|
|
707
|
-
show: { operation: ['duplicateGroup'] },
|
|
708
|
-
},
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
displayName: 'Group color',
|
|
712
|
-
name: 'groupColor',
|
|
713
|
-
type: 'options',
|
|
714
|
-
options: [
|
|
715
|
-
{ name: 'Grey', value: '#c4c4c4' },
|
|
716
|
-
{ name: 'Working Orange', value: '#fdab3d' },
|
|
717
|
-
{ name: 'Done Green', value: '#00c875' },
|
|
718
|
-
{ name: 'Stuck Red', value: '#e2445c' },
|
|
719
|
-
{ name: 'Dark Blue', value: '#0086c0' },
|
|
720
|
-
{ name: 'Purple', value: '#a25ddc' },
|
|
721
|
-
{ name: 'Grass Green', value: '#037f4c' },
|
|
722
|
-
{ name: 'Bright Blue', value: '#579bfc' },
|
|
723
|
-
{ name: 'Saladish', value: '#cab641' },
|
|
724
|
-
{ name: 'Egg Yolk', value: '#ffcb00' },
|
|
725
|
-
{ name: 'Dark Red', value: '#bb3354' },
|
|
726
|
-
{ name: 'Sofia Pink', value: '#ff158a' },
|
|
727
|
-
{ name: 'Lipstick', value: '#ff5ac4' },
|
|
728
|
-
{ name: 'Dark Purple', value: '#784bd1' },
|
|
729
|
-
{ name: 'Bright Green', value: '#9cd326' },
|
|
730
|
-
{ name: 'Chili Blue', value: '#66ccff' },
|
|
731
|
-
{ name: 'American Grey', value: '#808080' },
|
|
732
|
-
{ name: 'Brown', value: '#7f5347' },
|
|
733
|
-
{ name: 'Dark Orange', value: '#ff642e' },
|
|
734
|
-
],
|
|
735
|
-
default: '#c4c4c4',
|
|
736
|
-
description: 'Select the group color',
|
|
737
|
-
displayOptions: {
|
|
738
|
-
show: { operation: ['createGroup'] },
|
|
739
|
-
},
|
|
740
|
-
},
|
|
741
|
-
{
|
|
742
|
-
displayName: 'Remove Subscribers',
|
|
743
|
-
name: 'removeSubscribers',
|
|
744
|
-
typeOptions: {
|
|
745
|
-
loadOptionsMethod: 'getSubscribersFromBoard',
|
|
746
|
-
loadOptionsDependsOn: ['boardId'],
|
|
747
|
-
},
|
|
748
|
-
type: 'multiOptions',
|
|
749
|
-
default: [],
|
|
750
|
-
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
751
|
-
displayOptions: {
|
|
752
|
-
show: { operation: ['removeBoardSubscribers'] },
|
|
753
|
-
},
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
displayName: 'User Subscribers',
|
|
757
|
-
name: 'usersBoardIds',
|
|
758
|
-
type: 'fixedCollection',
|
|
759
|
-
typeOptions: { multipleValues: true },
|
|
760
|
-
default: [],
|
|
761
|
-
displayOptions: {
|
|
762
|
-
show: {
|
|
763
|
-
operation: ['createBoard', 'addBoardSubscribers'],
|
|
764
|
-
},
|
|
765
|
-
},
|
|
766
|
-
options: [
|
|
767
|
-
{
|
|
768
|
-
displayName: 'User',
|
|
769
|
-
name: 'usersBoardIds',
|
|
770
|
-
values: [
|
|
771
|
-
{
|
|
772
|
-
displayName: 'User',
|
|
773
|
-
name: 'userId',
|
|
774
|
-
type: 'options',
|
|
775
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
776
|
-
typeOptions: {
|
|
777
|
-
loadOptionsMethod: 'getUsers',
|
|
778
|
-
},
|
|
779
|
-
default: '',
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
displayName: 'Is Owner',
|
|
783
|
-
name: 'isOwner',
|
|
784
|
-
type: 'boolean',
|
|
785
|
-
default: false,
|
|
786
|
-
},
|
|
787
|
-
],
|
|
788
|
-
},
|
|
789
|
-
],
|
|
790
|
-
},
|
|
791
|
-
{
|
|
792
|
-
displayName: 'Team Subscribers',
|
|
793
|
-
name: 'teamBoardIds',
|
|
794
|
-
type: 'fixedCollection',
|
|
795
|
-
typeOptions: { multipleValues: true },
|
|
796
|
-
default: [],
|
|
797
|
-
displayOptions: {
|
|
798
|
-
show: {
|
|
799
|
-
operation: ['createBoard', 'addBoardSubscribers'],
|
|
800
|
-
},
|
|
801
|
-
},
|
|
802
|
-
options: [
|
|
803
|
-
{
|
|
804
|
-
displayName: 'Team',
|
|
805
|
-
name: 'teamBoardIds',
|
|
806
|
-
values: [
|
|
807
|
-
{
|
|
808
|
-
displayName: 'Team',
|
|
809
|
-
name: 'teamId',
|
|
810
|
-
type: 'options',
|
|
811
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
812
|
-
typeOptions: {
|
|
813
|
-
loadOptionsMethod: 'getTeams',
|
|
814
|
-
},
|
|
815
|
-
default: '',
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
displayName: 'Is Owner',
|
|
819
|
-
name: 'isOwner',
|
|
820
|
-
type: 'boolean',
|
|
821
|
-
default: false,
|
|
822
|
-
},
|
|
823
|
-
],
|
|
824
|
-
},
|
|
825
|
-
],
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
displayName: 'Team Name',
|
|
829
|
-
name: 'teamIds',
|
|
830
|
-
type: 'options',
|
|
831
|
-
typeOptions: { loadOptionsMethod: 'getTeams' },
|
|
832
|
-
default: '',
|
|
833
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
834
|
-
displayOptions: {
|
|
835
|
-
show: {
|
|
836
|
-
operation: ['addUsersToTeam', 'removeUsersFromTeam'],
|
|
837
|
-
},
|
|
838
|
-
},
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
displayName: 'Team ID',
|
|
842
|
-
name: 'teamId',
|
|
843
|
-
type: 'string',
|
|
844
|
-
default: '',
|
|
845
|
-
displayOptions: {
|
|
846
|
-
show: {
|
|
847
|
-
operation: ['deleteTeam'],
|
|
848
|
-
},
|
|
849
|
-
},
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
displayName: 'From',
|
|
853
|
-
name: 'from',
|
|
854
|
-
type: 'dateTime',
|
|
855
|
-
default: '',
|
|
856
|
-
description: 'Enter the date from which to retrieve activity logs',
|
|
857
|
-
displayOptions: {
|
|
858
|
-
show: { operation: ['listBoardActivityLogs'] },
|
|
859
|
-
},
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
displayName: 'To',
|
|
863
|
-
name: 'to',
|
|
864
|
-
type: 'dateTime',
|
|
865
|
-
default: '',
|
|
866
|
-
description: 'Enter the date to which to retrieve activity logs',
|
|
867
|
-
displayOptions: {
|
|
868
|
-
show: { operation: ['listBoardActivityLogs'] },
|
|
869
|
-
},
|
|
870
|
-
},
|
|
871
|
-
{
|
|
872
|
-
displayName: 'Archived',
|
|
873
|
-
name: 'archiveGroup',
|
|
874
|
-
type: 'boolean',
|
|
875
|
-
default: false,
|
|
876
|
-
description: 'Whether to archive the group',
|
|
877
|
-
displayOptions: {
|
|
878
|
-
show: { operation: ['listBoardGroups'] },
|
|
879
|
-
},
|
|
880
|
-
},
|
|
881
|
-
{
|
|
882
|
-
displayName: 'Deleted',
|
|
883
|
-
name: 'deleteGroup',
|
|
884
|
-
type: 'boolean',
|
|
885
|
-
default: false,
|
|
886
|
-
description: 'Whether to delete the group',
|
|
887
|
-
displayOptions: {
|
|
888
|
-
show: { operation: ['listBoardGroups'] },
|
|
889
|
-
},
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
displayName: 'Relative To Group Name',
|
|
893
|
-
name: 'groupId',
|
|
894
|
-
type: 'options',
|
|
895
|
-
typeOptions: {
|
|
896
|
-
loadOptionsDependsOn: ['boardId'],
|
|
897
|
-
loadOptionsMethod: 'getGroupsFromBoard',
|
|
898
|
-
},
|
|
899
|
-
default: '',
|
|
900
|
-
required: true,
|
|
901
|
-
description: 'Select a group from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
902
|
-
hint: 'The group to which the new group will be relative to.',
|
|
903
|
-
displayOptions: {
|
|
904
|
-
show: { operation: ['createGroup'] },
|
|
905
|
-
},
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
displayName: 'Group ID',
|
|
909
|
-
name: 'groupId',
|
|
910
|
-
type: 'string',
|
|
911
|
-
default: '',
|
|
912
|
-
required: true,
|
|
913
|
-
description: 'Select a group from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
914
|
-
hint: 'The group to which the new group will be relative to.',
|
|
915
|
-
displayOptions: {
|
|
916
|
-
show: { operation: ['getGroup', 'listGroupItems'] },
|
|
917
|
-
},
|
|
918
|
-
},
|
|
919
|
-
{
|
|
920
|
-
displayName: 'Position Relative',
|
|
921
|
-
name: 'positionRelative',
|
|
922
|
-
type: 'options',
|
|
923
|
-
options: [
|
|
924
|
-
{ name: 'Before', value: 'before_at' },
|
|
925
|
-
{ name: 'After', value: 'after_at' },
|
|
926
|
-
],
|
|
927
|
-
default: 'before_at',
|
|
928
|
-
description: 'Select the position relative',
|
|
929
|
-
displayOptions: {
|
|
930
|
-
show: { operation: ['createGroup'] },
|
|
931
|
-
},
|
|
932
|
-
hint: 'Defines whether the new group will be created above (before_at) or below (after_at) the group specified in the Relative To field.',
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
displayName: 'Item',
|
|
936
|
-
name: 'itemId',
|
|
937
|
-
type: 'options',
|
|
938
|
-
typeOptions: {
|
|
939
|
-
loadOptionsDependsOn: ['boardId'],
|
|
940
|
-
loadOptionsMethod: 'getItemsOrSubitemsFromBoard',
|
|
941
|
-
},
|
|
942
|
-
default: '',
|
|
943
|
-
required: true,
|
|
944
|
-
description: 'Select an item from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
945
|
-
displayOptions: {
|
|
946
|
-
show: {
|
|
947
|
-
operation: ['updateItem', 'createSubitem'],
|
|
948
|
-
},
|
|
949
|
-
},
|
|
950
|
-
},
|
|
951
|
-
{
|
|
952
|
-
displayName: 'Item',
|
|
953
|
-
name: 'itemId',
|
|
954
|
-
type: 'string',
|
|
955
|
-
default: '',
|
|
956
|
-
required: true,
|
|
957
|
-
description: 'Select an item from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
958
|
-
displayOptions: {
|
|
959
|
-
show: {
|
|
960
|
-
operation: ['createUpdate', 'listUpdates'],
|
|
961
|
-
},
|
|
962
|
-
},
|
|
963
|
-
},
|
|
964
|
-
{
|
|
965
|
-
displayName: 'Board',
|
|
966
|
-
name: 'boardId',
|
|
967
|
-
type: 'options',
|
|
968
|
-
typeOptions: {
|
|
969
|
-
loadOptionsMethod: 'getBoards',
|
|
970
|
-
},
|
|
971
|
-
default: '',
|
|
972
|
-
required: true,
|
|
973
|
-
description: 'Select a Monday board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
974
|
-
displayOptions: {
|
|
975
|
-
show: {
|
|
976
|
-
operation: ['duplicateItem', 'searchItems', 'uploadItemFile', 'getGroup'],
|
|
977
|
-
},
|
|
978
|
-
},
|
|
979
|
-
},
|
|
980
|
-
{
|
|
981
|
-
displayName: 'Item',
|
|
982
|
-
name: 'itemId',
|
|
983
|
-
type: 'options',
|
|
984
|
-
typeOptions: {
|
|
985
|
-
loadOptionsDependsOn: ['boardId'],
|
|
986
|
-
loadOptionsMethod: 'getItemsFromBoard',
|
|
987
|
-
},
|
|
988
|
-
default: '',
|
|
989
|
-
required: true,
|
|
990
|
-
description: 'Select an item from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
991
|
-
displayOptions: {
|
|
992
|
-
show: {
|
|
993
|
-
operation: ['duplicateItem', 'uploadItemFile'],
|
|
994
|
-
},
|
|
995
|
-
},
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
displayName: 'Is Subitem',
|
|
999
|
-
name: 'isSubitem',
|
|
1000
|
-
type: 'boolean',
|
|
1001
|
-
default: false,
|
|
1002
|
-
description: 'Whether a subitem',
|
|
1003
|
-
displayOptions: {
|
|
1004
|
-
show: {
|
|
1005
|
-
operation: ['getItem'],
|
|
1006
|
-
},
|
|
1007
|
-
},
|
|
1008
|
-
},
|
|
1009
|
-
{
|
|
1010
|
-
displayName: 'Fetch Subitems',
|
|
1011
|
-
name: 'fetchSubitems',
|
|
1012
|
-
type: 'boolean',
|
|
1013
|
-
default: false,
|
|
1014
|
-
description: 'Whether to fetch subitems',
|
|
1015
|
-
displayOptions: {
|
|
1016
|
-
show: {
|
|
1017
|
-
operation: ['getItem'],
|
|
1018
|
-
isSubitem: [false],
|
|
1019
|
-
},
|
|
1020
|
-
},
|
|
1021
|
-
},
|
|
1022
|
-
{
|
|
1023
|
-
displayName: 'Fetch Parent Item',
|
|
1024
|
-
name: 'fetchParentItems',
|
|
1025
|
-
type: 'boolean',
|
|
1026
|
-
default: false,
|
|
1027
|
-
description: 'Whether to fetch parent item',
|
|
1028
|
-
displayOptions: {
|
|
1029
|
-
show: {
|
|
1030
|
-
operation: ['getItem'],
|
|
1031
|
-
isSubitem: [true],
|
|
1032
|
-
},
|
|
1033
|
-
},
|
|
1034
|
-
},
|
|
1035
|
-
{
|
|
1036
|
-
displayName: 'Item ID',
|
|
1037
|
-
name: 'itemId',
|
|
1038
|
-
type: 'string',
|
|
1039
|
-
default: '',
|
|
1040
|
-
required: true,
|
|
1041
|
-
description: 'Specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
1042
|
-
displayOptions: {
|
|
1043
|
-
show: {
|
|
1044
|
-
operation: ['getItem', 'deleteItem'],
|
|
1045
|
-
},
|
|
1046
|
-
},
|
|
1047
|
-
},
|
|
1048
|
-
{
|
|
1049
|
-
displayName: 'With Updates',
|
|
1050
|
-
name: 'withUpdates',
|
|
1051
|
-
type: 'boolean',
|
|
1052
|
-
default: false,
|
|
1053
|
-
description: 'Whether to with updates',
|
|
1054
|
-
displayOptions: {
|
|
1055
|
-
show: {
|
|
1056
|
-
operation: ['duplicateItem'],
|
|
1057
|
-
},
|
|
1058
|
-
},
|
|
1059
|
-
},
|
|
1060
|
-
{
|
|
1061
|
-
displayName: 'Item Name',
|
|
1062
|
-
name: 'itemName',
|
|
1063
|
-
type: 'string',
|
|
1064
|
-
default: '',
|
|
1065
|
-
description: 'Enter the item name',
|
|
1066
|
-
displayOptions: {
|
|
1067
|
-
show: {
|
|
1068
|
-
resource: ['item', 'subitem'],
|
|
1069
|
-
operation: ['createItem', 'createSubitem'],
|
|
1070
|
-
},
|
|
1071
|
-
},
|
|
1072
|
-
},
|
|
1073
|
-
{
|
|
1074
|
-
displayName: 'Is Subitem?',
|
|
1075
|
-
name: 'isSubitem',
|
|
1076
|
-
type: 'boolean',
|
|
1077
|
-
default: false,
|
|
1078
|
-
description: 'Whether the item is a subitem',
|
|
1079
|
-
displayOptions: {
|
|
1080
|
-
show: {
|
|
1081
|
-
resource: ['item'],
|
|
1082
|
-
operation: ['createItem'],
|
|
1083
|
-
},
|
|
1084
|
-
},
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
displayName: 'Parent Item',
|
|
1088
|
-
name: 'parentId',
|
|
1089
|
-
type: 'options',
|
|
1090
|
-
typeOptions: {
|
|
1091
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1092
|
-
loadOptionsMethod: 'getItemsFromBoard',
|
|
1093
|
-
},
|
|
1094
|
-
displayOptions: {
|
|
1095
|
-
show: {
|
|
1096
|
-
resource: ['item'],
|
|
1097
|
-
operation: ['createItem'],
|
|
1098
|
-
isSubitem: [true],
|
|
1099
|
-
},
|
|
1100
|
-
},
|
|
1101
|
-
hint: "If this is a subitem, specify the parent item's ID. If it's not a subitem, leave this field blank",
|
|
1102
|
-
default: '',
|
|
1103
|
-
description: 'If this is a subitem, specify the ID of the parent item. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
1104
|
-
},
|
|
1105
|
-
{
|
|
1106
|
-
displayName: 'Column Values',
|
|
1107
|
-
name: 'columnValues',
|
|
1108
|
-
type: 'fixedCollection',
|
|
1109
|
-
typeOptions: {
|
|
1110
|
-
multipleValues: true,
|
|
1111
|
-
},
|
|
1112
|
-
default: [],
|
|
1113
|
-
displayOptions: {
|
|
1114
|
-
show: {
|
|
1115
|
-
resource: ['item', 'subitem'],
|
|
1116
|
-
operation: ['createItem', 'updateItem', 'createSubitem'],
|
|
1117
|
-
},
|
|
1118
|
-
},
|
|
1119
|
-
options: [
|
|
1120
|
-
{
|
|
1121
|
-
displayName: 'Column',
|
|
1122
|
-
name: 'column',
|
|
1123
|
-
values: [
|
|
1124
|
-
{
|
|
1125
|
-
displayName: 'Column',
|
|
1126
|
-
name: 'columnId',
|
|
1127
|
-
type: 'options',
|
|
1128
|
-
typeOptions: {
|
|
1129
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1130
|
-
loadOptionsMethod: 'getColumnsItems',
|
|
1131
|
-
},
|
|
1132
|
-
default: '',
|
|
1133
|
-
},
|
|
1134
|
-
{
|
|
1135
|
-
displayName: 'Column Type',
|
|
1136
|
-
name: 'columnType',
|
|
1137
|
-
type: 'options',
|
|
1138
|
-
options: [
|
|
1139
|
-
{ name: 'Simple Column Value', value: 'simple' },
|
|
1140
|
-
{ name: 'Column Value', value: 'objectValue' },
|
|
1141
|
-
...[
|
|
1142
|
-
{ name: 'Button', value: 'button' },
|
|
1143
|
-
{ name: 'File Link', value: 'fileLink' },
|
|
1144
|
-
{ name: 'Checkbox', value: 'checkbox' },
|
|
1145
|
-
{ name: 'Connect Boards', value: 'board_relation' },
|
|
1146
|
-
{ name: 'People', value: 'people' },
|
|
1147
|
-
{ name: 'Date', value: 'date' },
|
|
1148
|
-
{ name: 'Location', value: 'location' },
|
|
1149
|
-
{ name: 'Link', value: 'link' },
|
|
1150
|
-
{ name: 'Email', value: 'email' },
|
|
1151
|
-
{ name: 'Phone', value: 'phone' },
|
|
1152
|
-
{ name: 'Timeline', value: 'timeline' },
|
|
1153
|
-
].sort((a, b) => a.name.localeCompare(b.name)),
|
|
1154
|
-
],
|
|
1155
|
-
default: 'simple',
|
|
1156
|
-
},
|
|
1157
|
-
{
|
|
1158
|
-
displayName: 'Value',
|
|
1159
|
-
name: 'columnValue',
|
|
1160
|
-
type: 'string',
|
|
1161
|
-
default: '',
|
|
1162
|
-
displayOptions: {
|
|
1163
|
-
show: {
|
|
1164
|
-
columnType: ['simple'],
|
|
1165
|
-
},
|
|
1166
|
-
},
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
displayName: 'Column Value',
|
|
1170
|
-
name: 'objectValue',
|
|
1171
|
-
type: 'json',
|
|
1172
|
-
default: '',
|
|
1173
|
-
description: 'Enter the column value as a JSON object. Use an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a> to specify a dynamic value.',
|
|
1174
|
-
displayOptions: {
|
|
1175
|
-
show: {
|
|
1176
|
-
columnType: ['objectValue'],
|
|
1177
|
-
},
|
|
1178
|
-
},
|
|
1179
|
-
},
|
|
1180
|
-
{
|
|
1181
|
-
displayName: 'Files',
|
|
1182
|
-
name: 'fileLinks',
|
|
1183
|
-
type: 'fixedCollection',
|
|
1184
|
-
typeOptions: {
|
|
1185
|
-
multipleValues: true,
|
|
1186
|
-
},
|
|
1187
|
-
default: [],
|
|
1188
|
-
displayOptions: {
|
|
1189
|
-
show: {
|
|
1190
|
-
columnType: ['fileLink'],
|
|
1191
|
-
},
|
|
1192
|
-
},
|
|
1193
|
-
options: [
|
|
1194
|
-
{
|
|
1195
|
-
displayName: 'File',
|
|
1196
|
-
name: 'file',
|
|
1197
|
-
values: [
|
|
1198
|
-
{
|
|
1199
|
-
displayName: 'Link',
|
|
1200
|
-
name: 'linkToFile',
|
|
1201
|
-
type: 'string',
|
|
1202
|
-
default: '',
|
|
1203
|
-
description: 'The direct link to the file',
|
|
1204
|
-
},
|
|
1205
|
-
{
|
|
1206
|
-
displayName: 'Name',
|
|
1207
|
-
name: 'name',
|
|
1208
|
-
type: 'string',
|
|
1209
|
-
default: '',
|
|
1210
|
-
description: 'The name of the file',
|
|
1211
|
-
},
|
|
1212
|
-
],
|
|
1213
|
-
},
|
|
1214
|
-
],
|
|
1215
|
-
},
|
|
1216
|
-
{
|
|
1217
|
-
displayName: 'Click',
|
|
1218
|
-
name: 'buttonValue',
|
|
1219
|
-
type: 'boolean',
|
|
1220
|
-
default: false,
|
|
1221
|
-
displayOptions: {
|
|
1222
|
-
show: {
|
|
1223
|
-
columnType: ['button'],
|
|
1224
|
-
},
|
|
1225
|
-
},
|
|
1226
|
-
},
|
|
1227
|
-
{
|
|
1228
|
-
displayName: 'Checked',
|
|
1229
|
-
name: 'checkboxValue',
|
|
1230
|
-
type: 'boolean',
|
|
1231
|
-
default: false,
|
|
1232
|
-
displayOptions: {
|
|
1233
|
-
show: {
|
|
1234
|
-
columnType: ['checkbox'],
|
|
1235
|
-
},
|
|
1236
|
-
},
|
|
1237
|
-
},
|
|
1238
|
-
{
|
|
1239
|
-
displayName: 'Date',
|
|
1240
|
-
name: 'dateValue',
|
|
1241
|
-
type: 'dateTime',
|
|
1242
|
-
default: '',
|
|
1243
|
-
displayOptions: {
|
|
1244
|
-
show: {
|
|
1245
|
-
columnType: ['date'],
|
|
1246
|
-
},
|
|
1247
|
-
},
|
|
1248
|
-
},
|
|
1249
|
-
{
|
|
1250
|
-
displayName: 'Latitude',
|
|
1251
|
-
name: 'latitude',
|
|
1252
|
-
type: 'string',
|
|
1253
|
-
default: '',
|
|
1254
|
-
displayOptions: {
|
|
1255
|
-
show: {
|
|
1256
|
-
columnType: ['location'],
|
|
1257
|
-
},
|
|
1258
|
-
},
|
|
1259
|
-
},
|
|
1260
|
-
{
|
|
1261
|
-
displayName: 'Longitude',
|
|
1262
|
-
name: 'longitude',
|
|
1263
|
-
type: 'string',
|
|
1264
|
-
default: '',
|
|
1265
|
-
displayOptions: {
|
|
1266
|
-
show: {
|
|
1267
|
-
columnType: ['location'],
|
|
1268
|
-
},
|
|
1269
|
-
},
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
displayName: 'Address',
|
|
1273
|
-
name: 'address',
|
|
1274
|
-
type: 'string',
|
|
1275
|
-
default: '',
|
|
1276
|
-
displayOptions: {
|
|
1277
|
-
show: {
|
|
1278
|
-
columnType: ['location'],
|
|
1279
|
-
},
|
|
1280
|
-
},
|
|
1281
|
-
},
|
|
1282
|
-
{
|
|
1283
|
-
displayName: 'URL',
|
|
1284
|
-
name: 'url',
|
|
1285
|
-
type: 'string',
|
|
1286
|
-
default: '',
|
|
1287
|
-
displayOptions: {
|
|
1288
|
-
show: {
|
|
1289
|
-
columnType: ['link'],
|
|
1290
|
-
},
|
|
1291
|
-
},
|
|
1292
|
-
},
|
|
1293
|
-
{
|
|
1294
|
-
displayName: 'Text',
|
|
1295
|
-
name: 'linkText',
|
|
1296
|
-
type: 'string',
|
|
1297
|
-
default: '',
|
|
1298
|
-
displayOptions: {
|
|
1299
|
-
show: {
|
|
1300
|
-
columnType: ['link'],
|
|
1301
|
-
},
|
|
1302
|
-
},
|
|
1303
|
-
},
|
|
1304
|
-
{
|
|
1305
|
-
displayName: 'Email',
|
|
1306
|
-
name: 'emailValue',
|
|
1307
|
-
type: 'string',
|
|
1308
|
-
default: '',
|
|
1309
|
-
displayOptions: {
|
|
1310
|
-
show: {
|
|
1311
|
-
columnType: ['email'],
|
|
1312
|
-
},
|
|
1313
|
-
},
|
|
1314
|
-
},
|
|
1315
|
-
{
|
|
1316
|
-
displayName: 'Text',
|
|
1317
|
-
name: 'emailText',
|
|
1318
|
-
type: 'string',
|
|
1319
|
-
default: '',
|
|
1320
|
-
description: 'The text to display for the email link. If not provided, the email address will be used as the link text.',
|
|
1321
|
-
displayOptions: {
|
|
1322
|
-
show: {
|
|
1323
|
-
columnType: ['email'],
|
|
1324
|
-
},
|
|
1325
|
-
},
|
|
1326
|
-
},
|
|
1327
|
-
{
|
|
1328
|
-
displayName: 'Country Code',
|
|
1329
|
-
name: 'countryCode',
|
|
1330
|
-
type: 'options',
|
|
1331
|
-
options: country_codes_json_1.default,
|
|
1332
|
-
default: '',
|
|
1333
|
-
description: 'Select the country code for the phone number',
|
|
1334
|
-
displayOptions: {
|
|
1335
|
-
show: {
|
|
1336
|
-
columnType: ['phone'],
|
|
1337
|
-
},
|
|
1338
|
-
},
|
|
1339
|
-
},
|
|
1340
|
-
{
|
|
1341
|
-
displayName: 'Phone',
|
|
1342
|
-
name: 'phoneValue',
|
|
1343
|
-
type: 'string',
|
|
1344
|
-
default: '',
|
|
1345
|
-
description: 'Enter the phone number. Do **not** include the country code — only the area code and the number. Use an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a> to specify a dynamic value.',
|
|
1346
|
-
displayOptions: {
|
|
1347
|
-
show: {
|
|
1348
|
-
columnType: ['phone'],
|
|
1349
|
-
},
|
|
1350
|
-
},
|
|
1351
|
-
},
|
|
1352
|
-
{
|
|
1353
|
-
displayName: 'People',
|
|
1354
|
-
name: 'peopleValue',
|
|
1355
|
-
type: 'multiOptions',
|
|
1356
|
-
typeOptions: {
|
|
1357
|
-
loadOptionsMethod: 'getUsers',
|
|
1358
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1359
|
-
},
|
|
1360
|
-
default: [],
|
|
1361
|
-
displayOptions: {
|
|
1362
|
-
show: {
|
|
1363
|
-
columnType: ['people'],
|
|
1364
|
-
},
|
|
1365
|
-
},
|
|
1366
|
-
},
|
|
1367
|
-
{
|
|
1368
|
-
displayName: 'Teams',
|
|
1369
|
-
name: 'teamsValue',
|
|
1370
|
-
type: 'multiOptions',
|
|
1371
|
-
typeOptions: {
|
|
1372
|
-
loadOptionsMethod: 'getTeams',
|
|
1373
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1374
|
-
},
|
|
1375
|
-
default: [],
|
|
1376
|
-
displayOptions: {
|
|
1377
|
-
show: {
|
|
1378
|
-
columnType: ['people'],
|
|
1379
|
-
},
|
|
1380
|
-
},
|
|
1381
|
-
},
|
|
1382
|
-
{
|
|
1383
|
-
displayName: 'Start Date',
|
|
1384
|
-
name: 'startDate',
|
|
1385
|
-
type: 'dateTime',
|
|
1386
|
-
default: '',
|
|
1387
|
-
displayOptions: {
|
|
1388
|
-
show: {
|
|
1389
|
-
columnType: ['timeline'],
|
|
1390
|
-
},
|
|
1391
|
-
},
|
|
1392
|
-
},
|
|
1393
|
-
{
|
|
1394
|
-
displayName: 'End Date',
|
|
1395
|
-
name: 'endDate',
|
|
1396
|
-
type: 'dateTime',
|
|
1397
|
-
default: '',
|
|
1398
|
-
displayOptions: {
|
|
1399
|
-
show: {
|
|
1400
|
-
columnType: ['timeline'],
|
|
1401
|
-
},
|
|
1402
|
-
},
|
|
1403
|
-
},
|
|
1404
|
-
{
|
|
1405
|
-
displayName: 'Connect Boards',
|
|
1406
|
-
name: 'columnValue',
|
|
1407
|
-
type: 'string',
|
|
1408
|
-
default: '',
|
|
1409
|
-
description: 'Enter the IDs of the items to connect, separated by commas',
|
|
1410
|
-
displayOptions: {
|
|
1411
|
-
show: {
|
|
1412
|
-
columnType: ['board_relation'],
|
|
1413
|
-
},
|
|
1414
|
-
},
|
|
1415
|
-
},
|
|
1416
|
-
{
|
|
1417
|
-
displayName: 'Add instead of replacing',
|
|
1418
|
-
name: 'addConnections',
|
|
1419
|
-
type: 'boolean',
|
|
1420
|
-
default: false,
|
|
1421
|
-
description: 'Replace existing connections with the new ones. If false, new connections will be added to existing ones.',
|
|
1422
|
-
displayOptions: {
|
|
1423
|
-
show: {
|
|
1424
|
-
columnType: ['board_relation'],
|
|
1425
|
-
},
|
|
1426
|
-
},
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
displayName: 'File',
|
|
1430
|
-
name: 'fileUpload',
|
|
1431
|
-
type: 'string',
|
|
1432
|
-
default: '',
|
|
1433
|
-
description: 'Enter the file path or URL to upload. Use an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a> to specify a dynamic value.',
|
|
1434
|
-
displayOptions: {
|
|
1435
|
-
show: {
|
|
1436
|
-
columnType: ['file'],
|
|
1437
|
-
},
|
|
1438
|
-
},
|
|
1439
|
-
},
|
|
1440
|
-
],
|
|
1441
|
-
},
|
|
1442
|
-
],
|
|
1443
|
-
},
|
|
1444
|
-
{
|
|
1445
|
-
displayName: 'Column Values',
|
|
1446
|
-
name: 'columnValuesUploadFile',
|
|
1447
|
-
type: 'fixedCollection',
|
|
1448
|
-
typeOptions: { multipleValues: true },
|
|
1449
|
-
default: [],
|
|
1450
|
-
displayOptions: {
|
|
1451
|
-
show: {
|
|
1452
|
-
resource: ['item', 'subitem'],
|
|
1453
|
-
operation: ['uploadFile'],
|
|
1454
|
-
},
|
|
1455
|
-
},
|
|
1456
|
-
options: [
|
|
1457
|
-
{
|
|
1458
|
-
displayName: 'Column Value',
|
|
1459
|
-
name: 'columnValuesUploadFile',
|
|
1460
|
-
values: [
|
|
1461
|
-
{
|
|
1462
|
-
displayName: 'Column',
|
|
1463
|
-
name: 'columnId',
|
|
1464
|
-
type: 'options',
|
|
1465
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
1466
|
-
typeOptions: {
|
|
1467
|
-
loadOptionsMethod: 'getColumnsFromBoard',
|
|
1468
|
-
},
|
|
1469
|
-
default: '',
|
|
1470
|
-
},
|
|
1471
|
-
{
|
|
1472
|
-
displayName: 'File Name',
|
|
1473
|
-
name: 'fileName',
|
|
1474
|
-
type: 'string',
|
|
1475
|
-
required: true,
|
|
1476
|
-
default: '',
|
|
1477
|
-
},
|
|
1478
|
-
],
|
|
1479
|
-
},
|
|
1480
|
-
],
|
|
1481
|
-
},
|
|
1482
|
-
{
|
|
1483
|
-
displayName: 'Logical Operator',
|
|
1484
|
-
name: 'logicalOperator',
|
|
1485
|
-
type: 'options',
|
|
1486
|
-
options: [
|
|
1487
|
-
{
|
|
1488
|
-
name: 'AND',
|
|
1489
|
-
value: 'and',
|
|
1490
|
-
},
|
|
1491
|
-
{
|
|
1492
|
-
name: 'OR',
|
|
1493
|
-
value: 'or',
|
|
1494
|
-
},
|
|
1495
|
-
],
|
|
1496
|
-
default: 'and',
|
|
1497
|
-
description: 'Logical operator to use between filter rules',
|
|
1498
|
-
displayOptions: {
|
|
1499
|
-
show: {
|
|
1500
|
-
resource: ['item'],
|
|
1501
|
-
operation: ['searchItems'],
|
|
1502
|
-
},
|
|
1503
|
-
},
|
|
1504
|
-
},
|
|
1505
|
-
{
|
|
1506
|
-
displayName: 'Fetch Column Values',
|
|
1507
|
-
name: 'fetchColumnValues',
|
|
1508
|
-
type: 'boolean',
|
|
1509
|
-
default: false,
|
|
1510
|
-
description: 'Whether to fetch column values',
|
|
1511
|
-
displayOptions: {
|
|
1512
|
-
show: {
|
|
1513
|
-
operation: ['searchItems'],
|
|
1514
|
-
},
|
|
1515
|
-
},
|
|
1516
|
-
},
|
|
1517
|
-
{
|
|
1518
|
-
displayName: 'Filter Rules',
|
|
1519
|
-
name: 'filterRules',
|
|
1520
|
-
type: 'fixedCollection',
|
|
1521
|
-
typeOptions: { multipleValues: true },
|
|
1522
|
-
default: {},
|
|
1523
|
-
displayOptions: {
|
|
1524
|
-
show: {
|
|
1525
|
-
resource: ['item'],
|
|
1526
|
-
operation: ['searchItems'],
|
|
1527
|
-
},
|
|
1528
|
-
},
|
|
1529
|
-
options: [
|
|
1530
|
-
{
|
|
1531
|
-
displayName: 'Rule',
|
|
1532
|
-
name: 'rule',
|
|
1533
|
-
values: [
|
|
1534
|
-
{
|
|
1535
|
-
displayName: 'Column',
|
|
1536
|
-
name: 'columnId',
|
|
1537
|
-
type: 'options',
|
|
1538
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
1539
|
-
typeOptions: {
|
|
1540
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1541
|
-
loadOptionsMethod: 'getColumnsItems',
|
|
1542
|
-
},
|
|
1543
|
-
default: '',
|
|
1544
|
-
},
|
|
1545
|
-
{
|
|
1546
|
-
displayName: 'Compare Attribute',
|
|
1547
|
-
name: 'compareAttribute',
|
|
1548
|
-
type: 'string',
|
|
1549
|
-
default: '',
|
|
1550
|
-
description: 'Optional attribute for comparison (dependent on column type)',
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
displayName: 'Operator',
|
|
1554
|
-
name: 'operator',
|
|
1555
|
-
type: 'options',
|
|
1556
|
-
options: [
|
|
1557
|
-
{ name: 'Any Of', value: 'any_of' },
|
|
1558
|
-
{ name: 'Not Any Of', value: 'not_any_of' },
|
|
1559
|
-
{ name: 'Is Empty', value: 'is_empty' },
|
|
1560
|
-
{ name: 'Is Not Empty', value: 'is_not_empty' },
|
|
1561
|
-
{ name: 'Greater Than', value: 'greater_than' },
|
|
1562
|
-
{ name: 'Greater Than or Equal', value: 'greater_than_or_equals' },
|
|
1563
|
-
{ name: 'Less Than', value: 'lower_than' },
|
|
1564
|
-
{ name: 'Less Than or Equal', value: 'lower_than_or_equal' },
|
|
1565
|
-
{ name: 'Between', value: 'between' },
|
|
1566
|
-
{ name: 'Contains Text', value: 'contains_text' },
|
|
1567
|
-
{ name: 'Does Not Contain Text', value: 'not_contains_text' },
|
|
1568
|
-
{ name: 'Contains Terms', value: 'contains_terms' },
|
|
1569
|
-
{ name: 'Starts With', value: 'starts_with' },
|
|
1570
|
-
{ name: 'Ends With', value: 'ends_with' },
|
|
1571
|
-
{ name: 'Within the Next', value: 'within_the_next' },
|
|
1572
|
-
{ name: 'Within the Last', value: 'within_the_last' },
|
|
1573
|
-
],
|
|
1574
|
-
default: 'any_of',
|
|
1575
|
-
description: 'The condition for value comparison',
|
|
1576
|
-
},
|
|
1577
|
-
{
|
|
1578
|
-
displayName: 'Compare Value',
|
|
1579
|
-
name: 'compareValue',
|
|
1580
|
-
type: 'string',
|
|
1581
|
-
default: '',
|
|
1582
|
-
description: 'The value to filter by (format depends on column type)',
|
|
1583
|
-
},
|
|
1584
|
-
],
|
|
1585
|
-
},
|
|
1586
|
-
],
|
|
1587
|
-
},
|
|
1588
|
-
{
|
|
1589
|
-
displayName: 'Sort Options',
|
|
1590
|
-
name: 'sortOptions',
|
|
1591
|
-
type: 'fixedCollection',
|
|
1592
|
-
typeOptions: { multipleValues: true },
|
|
1593
|
-
default: {},
|
|
1594
|
-
displayOptions: {
|
|
1595
|
-
show: {
|
|
1596
|
-
resource: ['item'],
|
|
1597
|
-
operation: ['searchItems'],
|
|
1598
|
-
},
|
|
1599
|
-
},
|
|
1600
|
-
options: [
|
|
1601
|
-
{
|
|
1602
|
-
displayName: 'Sort By',
|
|
1603
|
-
name: 'sortBy',
|
|
1604
|
-
values: [
|
|
1605
|
-
{
|
|
1606
|
-
displayName: 'Column',
|
|
1607
|
-
name: 'columnId',
|
|
1608
|
-
type: 'options',
|
|
1609
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
1610
|
-
typeOptions: {
|
|
1611
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1612
|
-
loadOptionsMethod: 'getColumnsItems',
|
|
1613
|
-
},
|
|
1614
|
-
default: '',
|
|
1615
|
-
},
|
|
1616
|
-
{
|
|
1617
|
-
displayName: 'Direction',
|
|
1618
|
-
name: 'direction',
|
|
1619
|
-
type: 'options',
|
|
1620
|
-
options: [
|
|
1621
|
-
{ name: 'Ascending', value: 'asc' },
|
|
1622
|
-
{ name: 'Descending', value: 'desc' },
|
|
1623
|
-
],
|
|
1624
|
-
default: 'asc',
|
|
1625
|
-
description: 'The sort direction',
|
|
1626
|
-
},
|
|
1627
|
-
],
|
|
1628
|
-
},
|
|
1629
|
-
],
|
|
1630
|
-
},
|
|
1631
|
-
{
|
|
1632
|
-
displayName: 'File Column',
|
|
1633
|
-
name: 'fileColumnId',
|
|
1634
|
-
type: 'options',
|
|
1635
|
-
typeOptions: {
|
|
1636
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1637
|
-
loadOptionsMethod: 'getFileColumns',
|
|
1638
|
-
},
|
|
1639
|
-
required: true,
|
|
1640
|
-
default: '',
|
|
1641
|
-
displayOptions: {
|
|
1642
|
-
show: {
|
|
1643
|
-
resource: ['item'],
|
|
1644
|
-
operation: ['uploadItemFile'],
|
|
1645
|
-
},
|
|
1646
|
-
},
|
|
1647
|
-
description: 'The ID of the file column to upload the file to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
1648
|
-
},
|
|
1649
|
-
{
|
|
1650
|
-
displayName: 'Binary Property',
|
|
1651
|
-
name: 'binaryPropertyName',
|
|
1652
|
-
type: 'string',
|
|
1653
|
-
default: 'data',
|
|
1654
|
-
required: true,
|
|
1655
|
-
displayOptions: {
|
|
1656
|
-
show: {
|
|
1657
|
-
resource: ['item'],
|
|
1658
|
-
operation: ['uploadItemFile'],
|
|
1659
|
-
},
|
|
1660
|
-
},
|
|
1661
|
-
description: 'The name of the binary property that contains the file to upload, more than one file can be uploaded by separating the names with a comma',
|
|
1662
|
-
},
|
|
1663
|
-
{
|
|
1664
|
-
displayName: 'Update ID',
|
|
1665
|
-
name: 'updateId',
|
|
1666
|
-
type: 'string',
|
|
1667
|
-
displayOptions: {
|
|
1668
|
-
show: {
|
|
1669
|
-
operation: ['updateUpdate', 'deleteUpdate', 'uploadFile'],
|
|
1670
|
-
},
|
|
1671
|
-
},
|
|
1672
|
-
default: '',
|
|
1673
|
-
description: 'Select an update from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
1674
|
-
},
|
|
1675
|
-
{
|
|
1676
|
-
displayName: 'Body Content',
|
|
1677
|
-
name: 'bodyContent',
|
|
1678
|
-
type: 'string',
|
|
1679
|
-
default: '',
|
|
1680
|
-
description: 'Enter the body content',
|
|
1681
|
-
displayOptions: {
|
|
1682
|
-
show: {
|
|
1683
|
-
resource: ['update'],
|
|
1684
|
-
operation: ['createUpdate', 'updateUpdate'],
|
|
1685
|
-
},
|
|
1686
|
-
},
|
|
1687
|
-
},
|
|
1688
|
-
{
|
|
1689
|
-
displayName: 'Is Reply',
|
|
1690
|
-
name: 'isReply',
|
|
1691
|
-
type: 'boolean',
|
|
1692
|
-
default: false,
|
|
1693
|
-
description: 'Whether to create a reply',
|
|
1694
|
-
displayOptions: {
|
|
1695
|
-
show: {
|
|
1696
|
-
resource: ['update'],
|
|
1697
|
-
operation: ['createUpdate'],
|
|
1698
|
-
},
|
|
1699
|
-
},
|
|
1700
|
-
},
|
|
1701
|
-
{
|
|
1702
|
-
displayName: 'Mention',
|
|
1703
|
-
name: 'mention',
|
|
1704
|
-
type: 'boolean',
|
|
1705
|
-
default: false,
|
|
1706
|
-
description: 'Whether to mention the users, teams or boards in the update',
|
|
1707
|
-
displayOptions: {
|
|
1708
|
-
show: {
|
|
1709
|
-
operation: ['__never_show__'],
|
|
1710
|
-
},
|
|
1711
|
-
},
|
|
1712
|
-
},
|
|
1713
|
-
{
|
|
1714
|
-
displayName: 'Mentions List (Users, Teams, Boards)',
|
|
1715
|
-
name: 'mentionsList',
|
|
1716
|
-
type: 'fixedCollection',
|
|
1717
|
-
typeOptions: {
|
|
1718
|
-
multipleValues: true,
|
|
1719
|
-
},
|
|
1720
|
-
default: [],
|
|
1721
|
-
displayOptions: {
|
|
1722
|
-
show: {
|
|
1723
|
-
operation: ['createUpdate', 'updateUpdate'],
|
|
1724
|
-
mention: [true],
|
|
1725
|
-
},
|
|
1726
|
-
},
|
|
1727
|
-
options: [
|
|
1728
|
-
{
|
|
1729
|
-
displayName: 'Mention',
|
|
1730
|
-
name: 'mention',
|
|
1731
|
-
values: [
|
|
1732
|
-
{
|
|
1733
|
-
displayName: 'Type',
|
|
1734
|
-
name: 'type',
|
|
1735
|
-
type: 'options',
|
|
1736
|
-
options: [
|
|
1737
|
-
{ name: 'User', value: 'User' },
|
|
1738
|
-
{ name: 'Team', value: 'Team' },
|
|
1739
|
-
{ name: 'Board', value: 'Board' },
|
|
1740
|
-
],
|
|
1741
|
-
default: 'User',
|
|
1742
|
-
},
|
|
1743
|
-
{
|
|
1744
|
-
displayName: 'ID',
|
|
1745
|
-
name: 'id',
|
|
1746
|
-
type: 'string',
|
|
1747
|
-
default: '',
|
|
1748
|
-
description: 'ID of the mentioned entity (User, Team, or Board). You can use an expression to insert it dynamically.',
|
|
1749
|
-
},
|
|
1750
|
-
],
|
|
1751
|
-
},
|
|
1752
|
-
],
|
|
1753
|
-
},
|
|
1754
|
-
{
|
|
1755
|
-
displayName: 'Attachments (Binary Properties)',
|
|
1756
|
-
name: 'attachmentsUpdate',
|
|
1757
|
-
type: 'string',
|
|
1758
|
-
default: '',
|
|
1759
|
-
description: 'Enter the names of the attachments to include, separated by commas',
|
|
1760
|
-
displayOptions: {
|
|
1761
|
-
show: {
|
|
1762
|
-
resource: ['update'],
|
|
1763
|
-
operation: ['createUpdate', 'updateUpdate', 'uploadFile'],
|
|
1764
|
-
},
|
|
1765
|
-
},
|
|
1766
|
-
},
|
|
1767
|
-
{
|
|
1768
|
-
displayName: 'Update ID To Reply',
|
|
1769
|
-
name: 'updateId',
|
|
1770
|
-
type: 'string',
|
|
1771
|
-
displayOptions: {
|
|
1772
|
-
show: {
|
|
1773
|
-
isReply: [true],
|
|
1774
|
-
operation: ['createUpdate'],
|
|
1775
|
-
},
|
|
1776
|
-
},
|
|
1777
|
-
default: '',
|
|
1778
|
-
description: 'Select an update from the selected board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
1779
|
-
},
|
|
1780
|
-
{
|
|
1781
|
-
displayName: 'Team',
|
|
1782
|
-
name: 'team',
|
|
1783
|
-
type: 'options',
|
|
1784
|
-
typeOptions: { loadOptionsMethod: 'getTeams' },
|
|
1785
|
-
default: '',
|
|
1786
|
-
required: true,
|
|
1787
|
-
description: 'Select a team. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
1788
|
-
displayOptions: {
|
|
1789
|
-
show: {
|
|
1790
|
-
operation: ['getTeam'],
|
|
1791
|
-
},
|
|
1792
|
-
},
|
|
1793
|
-
},
|
|
1794
|
-
{
|
|
1795
|
-
displayName: 'Team Name',
|
|
1796
|
-
name: 'teamName',
|
|
1797
|
-
type: 'string',
|
|
1798
|
-
default: '',
|
|
1799
|
-
required: true,
|
|
1800
|
-
description: 'Write a team',
|
|
1801
|
-
displayOptions: {
|
|
1802
|
-
show: {
|
|
1803
|
-
operation: ['createTeam'],
|
|
1804
|
-
},
|
|
1805
|
-
},
|
|
1806
|
-
},
|
|
1807
|
-
{
|
|
1808
|
-
displayName: 'Is Guest',
|
|
1809
|
-
name: 'isGuest',
|
|
1810
|
-
type: 'boolean',
|
|
1811
|
-
default: false,
|
|
1812
|
-
description: 'Whether the team is a guest',
|
|
1813
|
-
displayOptions: {
|
|
1814
|
-
show: {
|
|
1815
|
-
operation: ['createTeam'],
|
|
1816
|
-
},
|
|
1817
|
-
},
|
|
1818
|
-
},
|
|
1819
|
-
{
|
|
1820
|
-
displayName: 'Users',
|
|
1821
|
-
name: 'userIds',
|
|
1822
|
-
type: 'multiOptions',
|
|
1823
|
-
typeOptions: { loadOptionsMethod: 'getUsers' },
|
|
1824
|
-
default: [],
|
|
1825
|
-
description: 'Select a user. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
|
|
1826
|
-
displayOptions: {
|
|
1827
|
-
show: {
|
|
1828
|
-
operation: ['createTeam', 'addUsersToTeam', 'removeUsersFromTeam', 'getUser'],
|
|
1829
|
-
},
|
|
1830
|
-
},
|
|
1831
|
-
},
|
|
1832
|
-
{
|
|
1833
|
-
displayName: 'Allow Empty Team',
|
|
1834
|
-
name: 'allowEmptyTeam',
|
|
1835
|
-
type: 'boolean',
|
|
1836
|
-
default: false,
|
|
1837
|
-
description: 'Whether to allow an empty team',
|
|
1838
|
-
displayOptions: {
|
|
1839
|
-
show: {
|
|
1840
|
-
operation: ['createTeam'],
|
|
1841
|
-
},
|
|
1842
|
-
},
|
|
1843
|
-
},
|
|
1844
|
-
{
|
|
1845
|
-
displayName: 'Board',
|
|
1846
|
-
name: 'boardId',
|
|
1847
|
-
type: 'string',
|
|
1848
|
-
default: '',
|
|
1849
|
-
required: true,
|
|
1850
|
-
description: 'Enter the board ID',
|
|
1851
|
-
displayOptions: {
|
|
1852
|
-
show: {
|
|
1853
|
-
operation: ['listBoardItems'],
|
|
1854
|
-
},
|
|
1855
|
-
},
|
|
1856
|
-
},
|
|
1857
|
-
{
|
|
1858
|
-
displayName: 'Limit',
|
|
1859
|
-
name: 'limit',
|
|
1860
|
-
type: 'number',
|
|
1861
|
-
typeOptions: {
|
|
1862
|
-
minValue: 1,
|
|
1863
|
-
},
|
|
1864
|
-
default: 50,
|
|
1865
|
-
description: 'Max number of results to return',
|
|
1866
|
-
hint: 'If 0 is provided, all items will be returned',
|
|
1867
|
-
displayOptions: {
|
|
1868
|
-
show: {
|
|
1869
|
-
operation: ['listBoardItems'],
|
|
1870
|
-
},
|
|
1871
|
-
},
|
|
1872
|
-
},
|
|
1873
|
-
],
|
|
1874
|
-
};
|
|
1875
|
-
this.methods = {
|
|
1876
|
-
loadOptions: {
|
|
1877
|
-
async getResources() {
|
|
1878
|
-
return [
|
|
1879
|
-
{ name: 'Board', value: 'board', description: 'Operations related to boards' },
|
|
1880
|
-
{ name: 'Item', value: 'item', description: 'Operations related to items' },
|
|
1881
|
-
{ name: 'Subitem', value: 'subitem', description: 'Operations related to subitems' },
|
|
1882
|
-
{ name: 'Update', value: 'update', description: 'Operations related to updates' },
|
|
1883
|
-
{ name: 'Team', value: 'team', description: 'Operations related to teams' },
|
|
1884
|
-
{ name: 'User', value: 'user', description: 'Operations related to users' },
|
|
1885
|
-
{
|
|
1886
|
-
name: 'Download File',
|
|
1887
|
-
value: 'downloadFile',
|
|
1888
|
-
description: 'Download a file from Monday.com',
|
|
1889
|
-
},
|
|
1890
|
-
{ name: 'Query', value: 'query', description: 'Operations related to running queries' },
|
|
1891
|
-
];
|
|
1892
|
-
},
|
|
1893
|
-
async getWorkspaces() {
|
|
1894
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
1895
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
1896
|
-
if (!apiKey) {
|
|
1897
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
1898
|
-
}
|
|
1899
|
-
const allWorkspace = [];
|
|
1900
|
-
let page = 1;
|
|
1901
|
-
const limit = 100;
|
|
1902
|
-
let hasMore = true;
|
|
1903
|
-
while (hasMore) {
|
|
1904
|
-
const responseData = await this.helpers.request({
|
|
1905
|
-
method: 'POST',
|
|
1906
|
-
url: 'https://api.monday.com/v2',
|
|
1907
|
-
headers: {
|
|
1908
|
-
Authorization: `Bearer ${apiKey}`,
|
|
1909
|
-
'Content-Type': 'application/json',
|
|
1910
|
-
},
|
|
1911
|
-
body: JSON.stringify({
|
|
1912
|
-
query: `{ workspaces (limit: ${limit}, page: ${page}) { id name } }`,
|
|
1913
|
-
}),
|
|
1914
|
-
});
|
|
1915
|
-
const workspaces = JSON.parse(responseData).data.workspaces;
|
|
1916
|
-
if (workspaces.length > 0) {
|
|
1917
|
-
allWorkspace.push(...workspaces.map((workspace) => ({
|
|
1918
|
-
name: workspace.name,
|
|
1919
|
-
value: workspace.id,
|
|
1920
|
-
})));
|
|
1921
|
-
page++;
|
|
1922
|
-
}
|
|
1923
|
-
else {
|
|
1924
|
-
hasMore = false;
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
const sorted = allWorkspace
|
|
1928
|
-
.filter((w) => w.value !== '-1')
|
|
1929
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
1930
|
-
sorted.unshift({ name: 'Main Workspace', value: '-1' });
|
|
1931
|
-
return sorted;
|
|
1932
|
-
},
|
|
1933
|
-
async getBoards() {
|
|
1934
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
1935
|
-
const workspaceId = this.getCurrentNodeParameter('workspace');
|
|
1936
|
-
const boardKind = this.getCurrentNodeParameter('boardKind');
|
|
1937
|
-
const orderBy = this.getCurrentNodeParameter('orderBy');
|
|
1938
|
-
const state = this.getCurrentNodeParameter('state');
|
|
1939
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
1940
|
-
if (!apiKey) {
|
|
1941
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
1942
|
-
}
|
|
1943
|
-
console.log('Getting Board: ', workspaceId);
|
|
1944
|
-
const allBoards = [];
|
|
1945
|
-
let page = 1;
|
|
1946
|
-
let hasMore = true;
|
|
1947
|
-
const queryLimit = 100;
|
|
1948
|
-
const orderByFilter = orderBy === 'none' || !orderBy ? '' : `, order_by: ${orderBy}`;
|
|
1949
|
-
const boardKindFilter = boardKind === 'all' || !boardKind ? '' : `, board_kind: ${boardKind}`;
|
|
1950
|
-
while (hasMore) {
|
|
1951
|
-
const currentQuery = JSON.stringify({
|
|
1952
|
-
query: `{
|
|
1953
|
-
boards(
|
|
1954
|
-
limit: ${queryLimit},
|
|
1955
|
-
page: ${page},
|
|
1956
|
-
state: ${state ? state : 'active'}
|
|
1957
|
-
${orderByFilter}
|
|
1958
|
-
${boardKindFilter}
|
|
1959
|
-
) {
|
|
1960
|
-
id
|
|
1961
|
-
name
|
|
1962
|
-
type
|
|
1963
|
-
}
|
|
1964
|
-
}`,
|
|
1965
|
-
});
|
|
1966
|
-
const responseData = await this.helpers.request({
|
|
1967
|
-
method: 'POST',
|
|
1968
|
-
url: 'https://api.monday.com/v2',
|
|
1969
|
-
headers: {
|
|
1970
|
-
Authorization: `Bearer ${apiKey}`,
|
|
1971
|
-
'Content-Type': 'application/json',
|
|
1972
|
-
},
|
|
1973
|
-
body: currentQuery,
|
|
1974
|
-
});
|
|
1975
|
-
const boards = JSON.parse(responseData).data.boards;
|
|
1976
|
-
allBoards.push(...boards
|
|
1977
|
-
.filter((board) => board.type === 'board' || board.type === 'sub_items_board')
|
|
1978
|
-
.map((board) => ({ name: board.name, value: board.id })));
|
|
1979
|
-
if (boards.length < queryLimit) {
|
|
1980
|
-
console.log('No more boards');
|
|
1981
|
-
hasMore = false;
|
|
1982
|
-
}
|
|
1983
|
-
else {
|
|
1984
|
-
page++;
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
return allBoards.sort((a, b) => a.name.localeCompare(b.name));
|
|
1988
|
-
},
|
|
1989
|
-
async getGroupsFromBoard() {
|
|
1990
|
-
console.log('Getting Groups');
|
|
1991
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
1992
|
-
if (!boardId) {
|
|
1993
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
1994
|
-
}
|
|
1995
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
1996
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
1997
|
-
if (!apiKey) {
|
|
1998
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
1999
|
-
}
|
|
2000
|
-
const response = await this.helpers.request({
|
|
2001
|
-
method: 'POST',
|
|
2002
|
-
url: 'https://api.monday.com/v2',
|
|
2003
|
-
headers: {
|
|
2004
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2005
|
-
'Content-Type': 'application/json',
|
|
2006
|
-
},
|
|
2007
|
-
body: {
|
|
2008
|
-
query: `query { boards(ids: ${boardId} ) { groups { id title color position archived deleted} } }`,
|
|
2009
|
-
},
|
|
2010
|
-
});
|
|
2011
|
-
const parsedResponse = JSON.parse(response);
|
|
2012
|
-
return parsedResponse.data.boards[0].groups.map((item) => ({
|
|
2013
|
-
name: item.title,
|
|
2014
|
-
value: item.id,
|
|
2015
|
-
}));
|
|
2016
|
-
},
|
|
2017
|
-
async getItemsFromBoard() {
|
|
2018
|
-
console.log('Getting Items');
|
|
2019
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2020
|
-
if (!boardId) {
|
|
2021
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
2022
|
-
}
|
|
2023
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2024
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2025
|
-
if (!apiKey) {
|
|
2026
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2027
|
-
}
|
|
2028
|
-
const board = await this.helpers.request({
|
|
2029
|
-
method: 'POST',
|
|
2030
|
-
url: 'https://api.monday.com/v2',
|
|
2031
|
-
headers: {
|
|
2032
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2033
|
-
'Content-Type': 'application/json',
|
|
2034
|
-
},
|
|
2035
|
-
body: {
|
|
2036
|
-
query: `query {
|
|
2037
|
-
boards(ids: ${boardId}) {
|
|
2038
|
-
name
|
|
2039
|
-
items_page(limit: 1) {
|
|
2040
|
-
items {
|
|
2041
|
-
parent_item {
|
|
2042
|
-
board {
|
|
2043
|
-
id
|
|
2044
|
-
}
|
|
2045
|
-
}
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
}
|
|
2049
|
-
}`,
|
|
2050
|
-
},
|
|
2051
|
-
});
|
|
2052
|
-
const parsedBoard = JSON.parse(board);
|
|
2053
|
-
const parentBoardName = parsedBoard.data.boards[0].name;
|
|
2054
|
-
let parentBoardId = '';
|
|
2055
|
-
if (parentBoardName.startsWith('Subitems of')) {
|
|
2056
|
-
parentBoardId = parsedBoard.data.boards[0].items_page.items[0].parent_item.board
|
|
2057
|
-
.id;
|
|
2058
|
-
}
|
|
2059
|
-
const response = await this.helpers.request({
|
|
2060
|
-
method: 'POST',
|
|
2061
|
-
url: 'https://api.monday.com/v2',
|
|
2062
|
-
headers: {
|
|
2063
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2064
|
-
'Content-Type': 'application/json',
|
|
2065
|
-
},
|
|
2066
|
-
body: {
|
|
2067
|
-
query: `query { boards(ids: ${parentBoardId ? parentBoardId : boardId}) { items_page (limit: 500) { items { id name } } } }`,
|
|
2068
|
-
},
|
|
2069
|
-
});
|
|
2070
|
-
console.log('Query: ', `query { boards(ids: ${parentBoardId ? parentBoardId : boardId}) { items_page (limit: 500) { items { id name } } } }`);
|
|
2071
|
-
console.log('parentBoard: ', parentBoardId);
|
|
2072
|
-
const parsedResponse = JSON.parse(response);
|
|
2073
|
-
const items = parsedResponse.data.boards[0].items_page.items.map((item) => ({
|
|
2074
|
-
name: item.name,
|
|
2075
|
-
value: item.id,
|
|
2076
|
-
}));
|
|
2077
|
-
items.unshift({ name: 'None', value: 0 });
|
|
2078
|
-
return items;
|
|
2079
|
-
},
|
|
2080
|
-
async getItemsOrSubitemsFromBoard() {
|
|
2081
|
-
console.log('Getting Items');
|
|
2082
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2083
|
-
if (!boardId) {
|
|
2084
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
2085
|
-
}
|
|
2086
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2087
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2088
|
-
if (!apiKey) {
|
|
2089
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2090
|
-
}
|
|
2091
|
-
const response = await this.helpers.request({
|
|
2092
|
-
method: 'POST',
|
|
2093
|
-
url: 'https://api.monday.com/v2',
|
|
2094
|
-
headers: {
|
|
2095
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2096
|
-
'Content-Type': 'application/json',
|
|
2097
|
-
},
|
|
2098
|
-
body: {
|
|
2099
|
-
query: `query { boards(ids: ${boardId}) { items_page (limit: 500) { items { id name } } } }`,
|
|
2100
|
-
},
|
|
2101
|
-
});
|
|
2102
|
-
console.log('Query: ', `query { boards(ids: ${boardId}) { items_page (limit: 500) { items { id name } } } }`);
|
|
2103
|
-
const parsedResponse = JSON.parse(response);
|
|
2104
|
-
const items = parsedResponse.data.boards[0].items_page.items.map((item) => ({
|
|
2105
|
-
name: item.name,
|
|
2106
|
-
value: item.id,
|
|
2107
|
-
}));
|
|
2108
|
-
items.unshift({ name: 'None', value: 0 });
|
|
2109
|
-
return items;
|
|
2110
|
-
},
|
|
2111
|
-
async getSubitemFromItem() {
|
|
2112
|
-
console.log('Getting Subitems');
|
|
2113
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
2114
|
-
const parentId = this.getNodeParameter('parentId', 0);
|
|
2115
|
-
if (!itemId && !parentId) {
|
|
2116
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Item ID is required.' });
|
|
2117
|
-
}
|
|
2118
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2119
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2120
|
-
if (!apiKey) {
|
|
2121
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2122
|
-
}
|
|
2123
|
-
const response = await this.helpers.request({
|
|
2124
|
-
method: 'POST',
|
|
2125
|
-
url: 'https://api.monday.com/v2',
|
|
2126
|
-
headers: {
|
|
2127
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2128
|
-
'Content-Type': 'application/json',
|
|
2129
|
-
},
|
|
2130
|
-
body: {
|
|
2131
|
-
query: `{
|
|
2132
|
-
items(ids: "${itemId || parentId}") {
|
|
2133
|
-
subitems {
|
|
2134
|
-
id
|
|
2135
|
-
name
|
|
2136
|
-
}
|
|
2137
|
-
}
|
|
2138
|
-
}`,
|
|
2139
|
-
},
|
|
2140
|
-
});
|
|
2141
|
-
const parsedResponse = JSON.parse(response);
|
|
2142
|
-
console.log(JSON.stringify(parsedResponse, null, 2));
|
|
2143
|
-
return parsedResponse.data.items[0].subitems.map((item) => ({
|
|
2144
|
-
name: item.name,
|
|
2145
|
-
value: item.id,
|
|
2146
|
-
}));
|
|
2147
|
-
},
|
|
2148
|
-
async getColumnsFromBoard() {
|
|
2149
|
-
console.log('Getting Columns');
|
|
2150
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2151
|
-
const operation = this.getNodeParameter('operation', 0);
|
|
2152
|
-
if (!boardId) {
|
|
2153
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
2154
|
-
}
|
|
2155
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2156
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2157
|
-
if (!apiKey) {
|
|
2158
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2159
|
-
}
|
|
2160
|
-
const response = await this.helpers.request({
|
|
2161
|
-
method: 'POST',
|
|
2162
|
-
url: 'https://api.monday.com/v2',
|
|
2163
|
-
headers: {
|
|
2164
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2165
|
-
'Content-Type': 'application/json',
|
|
2166
|
-
},
|
|
2167
|
-
body: JSON.stringify({
|
|
2168
|
-
query: `query { boards(ids: ${boardId}) { columns { id title type } } }`,
|
|
2169
|
-
}),
|
|
2170
|
-
});
|
|
2171
|
-
const parsedResponse = JSON.parse(response);
|
|
2172
|
-
return parsedResponse.data.boards[0].columns.map((column) => {
|
|
2173
|
-
if (operation === 'uploadFile') {
|
|
2174
|
-
if (column.type === 'file') {
|
|
2175
|
-
return {
|
|
2176
|
-
name: column.title,
|
|
2177
|
-
value: column.id,
|
|
2178
|
-
};
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
return {
|
|
2182
|
-
name: column.title,
|
|
2183
|
-
value: column.id,
|
|
2184
|
-
};
|
|
2185
|
-
});
|
|
2186
|
-
},
|
|
2187
|
-
async getSubscribersFromBoard() {
|
|
2188
|
-
console.log('Getting Subscribers');
|
|
2189
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2190
|
-
if (!boardId) {
|
|
2191
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
2192
|
-
}
|
|
2193
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2194
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2195
|
-
if (!apiKey) {
|
|
2196
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2197
|
-
}
|
|
2198
|
-
const response = await this.helpers.request({
|
|
2199
|
-
method: 'POST',
|
|
2200
|
-
url: 'https://api.monday.com/v2',
|
|
2201
|
-
headers: {
|
|
2202
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2203
|
-
'Content-Type': 'application/json',
|
|
2204
|
-
},
|
|
2205
|
-
body: JSON.stringify({
|
|
2206
|
-
query: `query { boards(ids: ${boardId}) { subscribers { id name } } }`,
|
|
2207
|
-
}),
|
|
2208
|
-
});
|
|
2209
|
-
const parsedResponse = JSON.parse(response);
|
|
2210
|
-
return parsedResponse.data.boards[0].subscribers.map((subscriber) => ({
|
|
2211
|
-
name: subscriber.name,
|
|
2212
|
-
value: subscriber.id,
|
|
2213
|
-
}));
|
|
2214
|
-
},
|
|
2215
|
-
async getSubitems() {
|
|
2216
|
-
const itemId = this.getNodeParameter('parentId');
|
|
2217
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2218
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2219
|
-
if (!apiKey) {
|
|
2220
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2221
|
-
}
|
|
2222
|
-
const response = await this.helpers.request({
|
|
2223
|
-
method: 'POST',
|
|
2224
|
-
url: 'https://api.monday.com/v2',
|
|
2225
|
-
headers: {
|
|
2226
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2227
|
-
'Content-Type': 'application/json',
|
|
2228
|
-
},
|
|
2229
|
-
body: JSON.stringify({
|
|
2230
|
-
query: `query {
|
|
2231
|
-
items (ids: [${itemId}]) {
|
|
2232
|
-
subitems {
|
|
2233
|
-
id
|
|
2234
|
-
name
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
}`,
|
|
2238
|
-
}),
|
|
2239
|
-
});
|
|
2240
|
-
const parsedResponse = JSON.parse(response);
|
|
2241
|
-
return parsedResponse.data.items[0].subitems.map((subitem) => ({
|
|
2242
|
-
name: subitem.name,
|
|
2243
|
-
value: subitem.id,
|
|
2244
|
-
}));
|
|
2245
|
-
},
|
|
2246
|
-
async getColumnsItems() {
|
|
2247
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2248
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2249
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2250
|
-
const response = await this.helpers.request({
|
|
2251
|
-
method: 'POST',
|
|
2252
|
-
url: 'https://api.monday.com/v2',
|
|
2253
|
-
headers: {
|
|
2254
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2255
|
-
'Content-Type': 'application/json',
|
|
2256
|
-
},
|
|
2257
|
-
body: JSON.stringify({
|
|
2258
|
-
query: `query {
|
|
2259
|
-
boards(ids: ${boardId}) {
|
|
2260
|
-
columns {
|
|
2261
|
-
id
|
|
2262
|
-
title
|
|
2263
|
-
type
|
|
2264
|
-
}
|
|
2265
|
-
items_page {
|
|
2266
|
-
items {
|
|
2267
|
-
subitems {
|
|
2268
|
-
board {
|
|
2269
|
-
columns {
|
|
2270
|
-
id
|
|
2271
|
-
title
|
|
2272
|
-
type
|
|
2273
|
-
}
|
|
2274
|
-
}
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
}
|
|
2279
|
-
}`,
|
|
2280
|
-
}),
|
|
2281
|
-
});
|
|
2282
|
-
const parsedResponse = JSON.parse(response);
|
|
2283
|
-
return parsedResponse.data.boards[0].columns
|
|
2284
|
-
.filter((column) => column.type !== 'subitem' &&
|
|
2285
|
-
column.type !== 'auto_number' &&
|
|
2286
|
-
column.type !== 'creation_log' &&
|
|
2287
|
-
column.type !== 'formula' &&
|
|
2288
|
-
column.type !== 'item_id' &&
|
|
2289
|
-
column.type !== 'last_updated' &&
|
|
2290
|
-
column.type !== 'progress' &&
|
|
2291
|
-
column.type !== 'mirror' &&
|
|
2292
|
-
column.type !== 'subtasks')
|
|
2293
|
-
.map((column) => {
|
|
2294
|
-
return {
|
|
2295
|
-
name: column.title,
|
|
2296
|
-
value: column.id,
|
|
2297
|
-
};
|
|
2298
|
-
});
|
|
2299
|
-
},
|
|
2300
|
-
async getFolders() {
|
|
2301
|
-
const workspaceId = this.getNodeParameter('workspace');
|
|
2302
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2303
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2304
|
-
console.log('Getting Folders');
|
|
2305
|
-
if (!apiKey) {
|
|
2306
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2307
|
-
}
|
|
2308
|
-
const allFolders = [];
|
|
2309
|
-
let page = 1;
|
|
2310
|
-
const limit = 100;
|
|
2311
|
-
let hasMore = true;
|
|
2312
|
-
console.log(`{ folders (limit: ${limit}, page: ${page}, workspace_id: ${workspaceId}) { id name } }`);
|
|
2313
|
-
while (hasMore) {
|
|
2314
|
-
const responseData = await this.helpers.request({
|
|
2315
|
-
method: 'POST',
|
|
2316
|
-
url: 'https://api.monday.com/v2',
|
|
2317
|
-
headers: {
|
|
2318
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2319
|
-
'Content-Type': 'application/json',
|
|
2320
|
-
},
|
|
2321
|
-
body: {
|
|
2322
|
-
query: `{ folders (limit: ${limit}, page: ${page}, workspace_ids: ${workspaceId}) { id name } }`,
|
|
2323
|
-
},
|
|
2324
|
-
});
|
|
2325
|
-
const folders = JSON.parse(responseData).data.folders;
|
|
2326
|
-
if (folders.length > 0) {
|
|
2327
|
-
allFolders.push({ name: 'None', value: '-1' }, ...folders.map((folder) => ({
|
|
2328
|
-
name: folder.name,
|
|
2329
|
-
value: folder.id,
|
|
2330
|
-
})));
|
|
2331
|
-
page++;
|
|
2332
|
-
}
|
|
2333
|
-
else {
|
|
2334
|
-
hasMore = false;
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
return allFolders;
|
|
2338
|
-
},
|
|
2339
|
-
async getUsers() {
|
|
2340
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2341
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2342
|
-
if (!apiKey) {
|
|
2343
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2344
|
-
}
|
|
2345
|
-
const allUsers = [];
|
|
2346
|
-
let page = 1;
|
|
2347
|
-
const limit = 100;
|
|
2348
|
-
let hasMore = true;
|
|
2349
|
-
while (hasMore) {
|
|
2350
|
-
const responseData = await this.helpers.request({
|
|
2351
|
-
method: 'POST',
|
|
2352
|
-
url: 'https://api.monday.com/v2',
|
|
2353
|
-
headers: {
|
|
2354
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2355
|
-
'Content-Type': 'application/json',
|
|
2356
|
-
},
|
|
2357
|
-
body: {
|
|
2358
|
-
query: `{ users (limit: ${limit}, page: ${page}) { id name } }`,
|
|
2359
|
-
},
|
|
2360
|
-
});
|
|
2361
|
-
const users = JSON.parse(responseData).data.users;
|
|
2362
|
-
if (users.length > 0) {
|
|
2363
|
-
allUsers.push(...users.map((user) => ({
|
|
2364
|
-
name: user.name,
|
|
2365
|
-
value: user.id,
|
|
2366
|
-
})));
|
|
2367
|
-
page++;
|
|
2368
|
-
}
|
|
2369
|
-
else {
|
|
2370
|
-
hasMore = false;
|
|
2371
|
-
}
|
|
2372
|
-
}
|
|
2373
|
-
return allUsers;
|
|
2374
|
-
},
|
|
2375
|
-
async getTeams() {
|
|
2376
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2377
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2378
|
-
if (!apiKey) {
|
|
2379
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2380
|
-
}
|
|
2381
|
-
const responseData = await this.helpers.request({
|
|
2382
|
-
method: 'POST',
|
|
2383
|
-
url: 'https://api.monday.com/v2',
|
|
2384
|
-
headers: {
|
|
2385
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2386
|
-
'Content-Type': 'application/json',
|
|
2387
|
-
},
|
|
2388
|
-
body: {
|
|
2389
|
-
query: `{ teams { id name } }`,
|
|
2390
|
-
},
|
|
2391
|
-
});
|
|
2392
|
-
return JSON.parse(responseData).data.teams.map((team) => ({
|
|
2393
|
-
name: team.name,
|
|
2394
|
-
value: team.id,
|
|
2395
|
-
}));
|
|
2396
|
-
},
|
|
2397
|
-
async getFileColumns() {
|
|
2398
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2399
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2400
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2401
|
-
if (!apiKey) {
|
|
2402
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2403
|
-
}
|
|
2404
|
-
const response = await this.helpers.request({
|
|
2405
|
-
method: 'POST',
|
|
2406
|
-
url: 'https://api.monday.com/v2',
|
|
2407
|
-
headers: {
|
|
2408
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2409
|
-
'Content-Type': 'application/json',
|
|
2410
|
-
},
|
|
2411
|
-
body: JSON.stringify({
|
|
2412
|
-
query: `query { boards(ids: ${boardId}) { columns { id title type } } }`,
|
|
2413
|
-
}),
|
|
2414
|
-
});
|
|
2415
|
-
const parsedResponse = JSON.parse(response);
|
|
2416
|
-
return parsedResponse.data.boards[0].columns
|
|
2417
|
-
.filter((column) => column.type === 'file')
|
|
2418
|
-
.map((column) => ({
|
|
2419
|
-
name: column.title,
|
|
2420
|
-
value: column.id,
|
|
2421
|
-
}));
|
|
2422
|
-
},
|
|
2423
|
-
async getUpdates() {
|
|
2424
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2425
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2426
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2427
|
-
if (!apiKey) {
|
|
2428
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2429
|
-
}
|
|
2430
|
-
const response = await this.helpers.request({
|
|
2431
|
-
method: 'POST',
|
|
2432
|
-
url: 'https://api.monday.com/v2',
|
|
2433
|
-
headers: {
|
|
2434
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2435
|
-
'Content-Type': 'application/json',
|
|
2436
|
-
},
|
|
2437
|
-
body: JSON.stringify({
|
|
2438
|
-
query: `query { boards(ids: ${boardId}) { updates { id body } } }`,
|
|
2439
|
-
}),
|
|
2440
|
-
});
|
|
2441
|
-
const parsedResponse = JSON.parse(response);
|
|
2442
|
-
return parsedResponse.data.boards[0].updates.map((update) => ({
|
|
2443
|
-
name: update.body,
|
|
2444
|
-
value: update.id,
|
|
2445
|
-
}));
|
|
2446
|
-
},
|
|
2447
|
-
async getAllLabelStatus() {
|
|
2448
|
-
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2449
|
-
console.log('ALL NODE', JSON.stringify(this.getNode(), null, 2));
|
|
2450
|
-
const allEntries = this.getNodeParameter('columnValues');
|
|
2451
|
-
const entryQueQuerLabel = allEntries.column.find((e) => e.columnType === 'status' && (!e.statusLabel || e.statusLabel === ''));
|
|
2452
|
-
if (!entryQueQuerLabel) {
|
|
2453
|
-
return [];
|
|
2454
|
-
}
|
|
2455
|
-
const columnId = entryQueQuerLabel.columnId;
|
|
2456
|
-
console.log('getAllLabelStatus() → columnId encontrada:', columnId);
|
|
2457
|
-
if (!columnId) {
|
|
2458
|
-
return [];
|
|
2459
|
-
}
|
|
2460
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2461
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2462
|
-
if (!apiKey) {
|
|
2463
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2464
|
-
}
|
|
2465
|
-
console.log('getAllLabelStatus() — Board ID:', boardId);
|
|
2466
|
-
console.log('getAllLabelStatus() — Column ID:', columnId);
|
|
2467
|
-
const response = await this.helpers.request({
|
|
2468
|
-
method: 'POST',
|
|
2469
|
-
url: 'https://api.monday.com/v2',
|
|
2470
|
-
headers: {
|
|
2471
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2472
|
-
'Content-Type': 'application/json',
|
|
2473
|
-
},
|
|
2474
|
-
body: JSON.stringify({
|
|
2475
|
-
query: `query {
|
|
2476
|
-
boards(ids: ${boardId}) {
|
|
2477
|
-
columns(ids: ["${columnId}"]) {
|
|
2478
|
-
title
|
|
2479
|
-
settings_str
|
|
2480
|
-
}
|
|
2481
|
-
}
|
|
2482
|
-
}`,
|
|
2483
|
-
}),
|
|
2484
|
-
});
|
|
2485
|
-
console.log('getAllLabelStatus() — Raw API Response:', response);
|
|
2486
|
-
const settingsStrRaw = JSON.parse(response).data.boards[0].columns[0].settings_str;
|
|
2487
|
-
const name = JSON.parse(response).data.boards[0].columns[0].title;
|
|
2488
|
-
console.log('getAllLabelStatus() — settings_str:', settingsStrRaw);
|
|
2489
|
-
const settings = JSON.parse(settingsStrRaw);
|
|
2490
|
-
const columnLabels = settings.labels || {};
|
|
2491
|
-
console.log('getAllLabelStatus() — columnLabels:', columnLabels);
|
|
2492
|
-
const options = Object.entries(columnLabels)
|
|
2493
|
-
.filter(([_, labelName]) => typeof labelName === 'string' && labelName.trim() !== '')
|
|
2494
|
-
.map(([_, labelName]) => ({
|
|
2495
|
-
name: `${labelName} (${name})`,
|
|
2496
|
-
value: labelName,
|
|
2497
|
-
}));
|
|
2498
|
-
console.log('getAllLabelStatus() — Options retornadas:', options);
|
|
2499
|
-
return options;
|
|
2500
|
-
},
|
|
2501
|
-
},
|
|
2502
|
-
};
|
|
2503
|
-
}
|
|
2504
|
-
async execute() {
|
|
2505
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
2506
|
-
const resource = this.getNodeParameter('resource', 0);
|
|
2507
|
-
const operation = this.getNodeParameter('operation', 0);
|
|
2508
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2509
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2510
|
-
if (!apiKey) {
|
|
2511
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2512
|
-
}
|
|
2513
|
-
let response;
|
|
2514
|
-
const headers = {
|
|
2515
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2516
|
-
'Content-Type': 'application/json',
|
|
2517
|
-
};
|
|
2518
|
-
switch (resource) {
|
|
2519
|
-
case 'board': {
|
|
2520
|
-
switch (operation) {
|
|
2521
|
-
case 'createBoard': {
|
|
2522
|
-
const boardName = this.getNodeParameter('boardName', 0);
|
|
2523
|
-
const boardKind = this.getNodeParameter('boardKind', 0);
|
|
2524
|
-
const workspace = this.getNodeParameter('workspace', 0);
|
|
2525
|
-
const folder = this.getNodeParameter('folder', 0);
|
|
2526
|
-
const teamBoardIds = this.getNodeParameter('teamBoardIds', 0);
|
|
2527
|
-
const usersBoardIds = this.getNodeParameter('usersBoardIds', 0);
|
|
2528
|
-
const description = this.getNodeParameter('description', 0);
|
|
2529
|
-
const templateId = this.getNodeParameter('templateId', 0);
|
|
2530
|
-
let arg = '';
|
|
2531
|
-
if (usersBoardIds &&
|
|
2532
|
-
usersBoardIds.usersBoardIds &&
|
|
2533
|
-
usersBoardIds.usersBoardIds.length > 0) {
|
|
2534
|
-
const ownerUsers = usersBoardIds.usersBoardIds
|
|
2535
|
-
.filter((user) => user.isOwner)
|
|
2536
|
-
.map((user) => `"${user.userId}"`)
|
|
2537
|
-
.join(',');
|
|
2538
|
-
const subscriberUsers = usersBoardIds.usersBoardIds
|
|
2539
|
-
.filter((user) => !user.isOwner)
|
|
2540
|
-
.map((user) => `"${user.userId}"`)
|
|
2541
|
-
.join(',');
|
|
2542
|
-
if (ownerUsers) {
|
|
2543
|
-
arg += ` board_owner_ids: [${ownerUsers}]`;
|
|
2544
|
-
}
|
|
2545
|
-
if (subscriberUsers) {
|
|
2546
|
-
arg += ` board_subscriber_ids: [${subscriberUsers}]`;
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
if (teamBoardIds && teamBoardIds.teamBoardIds && teamBoardIds.teamBoardIds.length > 0) {
|
|
2550
|
-
const ownerTeams = teamBoardIds.teamBoardIds
|
|
2551
|
-
.filter((team) => team.isOwner)
|
|
2552
|
-
.map((team) => `"${team.teamId}"`)
|
|
2553
|
-
.join(',');
|
|
2554
|
-
const subscriberTeams = teamBoardIds.teamBoardIds
|
|
2555
|
-
.filter((team) => !team.isOwner)
|
|
2556
|
-
.map((team) => `"${team.teamId}"`)
|
|
2557
|
-
.join(',');
|
|
2558
|
-
if (ownerTeams) {
|
|
2559
|
-
arg += ` board_owner_team_ids: [${ownerTeams}]`;
|
|
2560
|
-
}
|
|
2561
|
-
if (subscriberTeams) {
|
|
2562
|
-
arg += ` board_subscriber_teams_ids: [${subscriberTeams}]`;
|
|
2563
|
-
}
|
|
2564
|
-
}
|
|
2565
|
-
if (description !== '') {
|
|
2566
|
-
arg += ` description: "${description}"`;
|
|
2567
|
-
}
|
|
2568
|
-
if (templateId !== '') {
|
|
2569
|
-
arg += ` template_id: ${templateId}`;
|
|
2570
|
-
}
|
|
2571
|
-
if (folder !== '-1') {
|
|
2572
|
-
arg += ` folder_id: ${folder}`;
|
|
2573
|
-
}
|
|
2574
|
-
const mutation = `
|
|
2575
|
-
mutation {
|
|
2576
|
-
create_board(
|
|
2577
|
-
board_name: "${boardName}",
|
|
2578
|
-
board_kind: ${boardKind},
|
|
2579
|
-
workspace_id: ${workspace}
|
|
2580
|
-
${arg}
|
|
2581
|
-
) { id url }
|
|
2582
|
-
}
|
|
2583
|
-
`;
|
|
2584
|
-
console.log(mutation);
|
|
2585
|
-
response = await this.helpers.request({
|
|
2586
|
-
method: 'POST',
|
|
2587
|
-
url: 'https://api.monday.com/v2',
|
|
2588
|
-
headers,
|
|
2589
|
-
body: { query: mutation },
|
|
2590
|
-
});
|
|
2591
|
-
break;
|
|
2592
|
-
}
|
|
2593
|
-
case 'duplicateBoard': {
|
|
2594
|
-
console.log('Duplicating Board');
|
|
2595
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2596
|
-
const duplicateType = this.getNodeParameter('duplicateType', 0);
|
|
2597
|
-
const boardName = this.getNodeParameter('boardName', 0);
|
|
2598
|
-
const keepSubscribers = this.getNodeParameter('keepSubscribers', 0);
|
|
2599
|
-
const folder = this.getNodeParameter('folder', 0);
|
|
2600
|
-
const workspaceId = this.getNodeParameter('workspace', 0);
|
|
2601
|
-
if (!boardId) {
|
|
2602
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
2603
|
-
}
|
|
2604
|
-
if (!apiKey) {
|
|
2605
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2606
|
-
}
|
|
2607
|
-
response = await this.helpers.request({
|
|
2608
|
-
method: 'POST',
|
|
2609
|
-
url: 'https://api.monday.com/v2',
|
|
2610
|
-
headers: {
|
|
2611
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2612
|
-
'Content-Type': 'application/json',
|
|
2613
|
-
},
|
|
2614
|
-
body: {
|
|
2615
|
-
query: `mutation {
|
|
2616
|
-
duplicate_board(board_id: ${boardId}, workspace_id: ${workspaceId}, duplicate_type: ${duplicateType}, board_name: "${boardName}", keep_subscribers: ${keepSubscribers}
|
|
2617
|
-
${folder === '-1' ? '' : `, folder_id: ${folder}`}) {
|
|
2618
|
-
board {
|
|
2619
|
-
id
|
|
2620
|
-
name
|
|
2621
|
-
}
|
|
2622
|
-
}
|
|
2623
|
-
}`,
|
|
2624
|
-
},
|
|
2625
|
-
});
|
|
2626
|
-
break;
|
|
2627
|
-
}
|
|
2628
|
-
case 'duplicateGroup': {
|
|
2629
|
-
console.log('Duplicating Group');
|
|
2630
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2631
|
-
const groupId = this.getNodeParameter('groupId', 0);
|
|
2632
|
-
const groupName = this.getNodeParameter('groupName', 0);
|
|
2633
|
-
const addToTop = this.getNodeParameter('addToTop', 0);
|
|
2634
|
-
if (!boardId || !groupId) {
|
|
2635
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
2636
|
-
message: 'Board ID and Group ID are required.',
|
|
2637
|
-
});
|
|
2638
|
-
}
|
|
2639
|
-
if (!apiKey) {
|
|
2640
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2641
|
-
}
|
|
2642
|
-
console.log(`mutation {
|
|
2643
|
-
duplicate_group(board_id: ${boardId}, group_id: "${groupId}", group_title: ${groupName}) {
|
|
2644
|
-
id
|
|
2645
|
-
title
|
|
2646
|
-
}
|
|
2647
|
-
}`);
|
|
2648
|
-
response = await this.helpers.request({
|
|
2649
|
-
method: 'POST',
|
|
2650
|
-
url: 'https://api.monday.com/v2',
|
|
2651
|
-
headers: {
|
|
2652
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2653
|
-
'Content-Type': 'application/json',
|
|
2654
|
-
},
|
|
2655
|
-
body: {
|
|
2656
|
-
query: `mutation {
|
|
2657
|
-
duplicate_group(board_id: ${boardId}, group_id: "${groupId}", group_title: "${groupName}" ${addToTop ? ', add_to_top: true' : ''}) {
|
|
2658
|
-
id
|
|
2659
|
-
title
|
|
2660
|
-
}
|
|
2661
|
-
}`,
|
|
2662
|
-
},
|
|
2663
|
-
});
|
|
2664
|
-
break;
|
|
2665
|
-
}
|
|
2666
|
-
case 'addBoardSubscribers': {
|
|
2667
|
-
console.log('Adding Subscribers');
|
|
2668
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2669
|
-
const usersBoardIds = this.getNodeParameter('usersBoardIds', 0);
|
|
2670
|
-
const teamBoardIds = this.getNodeParameter('teamBoardIds', 0);
|
|
2671
|
-
if (!boardId) {
|
|
2672
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
2673
|
-
}
|
|
2674
|
-
if (!apiKey) {
|
|
2675
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2676
|
-
}
|
|
2677
|
-
const result = {
|
|
2678
|
-
ownerUsers: [],
|
|
2679
|
-
subscriberUsers: [],
|
|
2680
|
-
ownerTeams: [],
|
|
2681
|
-
subscriberTeams: [],
|
|
2682
|
-
boardId,
|
|
2683
|
-
};
|
|
2684
|
-
const ownerUsers = usersBoardIds === null || usersBoardIds === void 0 ? void 0 : usersBoardIds.usersBoardIds.filter((user) => user.isOwner).map((user) => user.userId);
|
|
2685
|
-
if (ownerUsers && ownerUsers.length > 0) {
|
|
2686
|
-
response = await this.helpers.request({
|
|
2687
|
-
method: 'POST',
|
|
2688
|
-
url: 'https://api.monday.com/v2',
|
|
2689
|
-
headers: {
|
|
2690
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2691
|
-
'Content-Type': 'application/json',
|
|
2692
|
-
},
|
|
2693
|
-
body: {
|
|
2694
|
-
query: `mutation {
|
|
2695
|
-
add_subscribers_to_board(
|
|
2696
|
-
board_id: ${boardId},
|
|
2697
|
-
user_ids: [${ownerUsers.join(',')}],
|
|
2698
|
-
kind: owner
|
|
2699
|
-
) {
|
|
2700
|
-
id
|
|
2701
|
-
name
|
|
2702
|
-
}
|
|
2703
|
-
}`,
|
|
2704
|
-
},
|
|
2705
|
-
});
|
|
2706
|
-
console.log(response);
|
|
2707
|
-
result.ownerUsers = response;
|
|
2708
|
-
}
|
|
2709
|
-
const subscriberUsers = usersBoardIds === null || usersBoardIds === void 0 ? void 0 : usersBoardIds.usersBoardIds.filter((user) => !user.isOwner).map((user) => user.userId);
|
|
2710
|
-
if (subscriberUsers && subscriberUsers.length > 0) {
|
|
2711
|
-
response = await this.helpers.request({
|
|
2712
|
-
method: 'POST',
|
|
2713
|
-
url: 'https://api.monday.com/v2',
|
|
2714
|
-
headers: {
|
|
2715
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2716
|
-
'Content-Type': 'application/json',
|
|
2717
|
-
},
|
|
2718
|
-
body: {
|
|
2719
|
-
query: `mutation {
|
|
2720
|
-
add_subscribers_to_board(
|
|
2721
|
-
board_id: ${boardId},
|
|
2722
|
-
user_ids: [${subscriberUsers.join(',')}],
|
|
2723
|
-
kind: subscriber
|
|
2724
|
-
) {
|
|
2725
|
-
id
|
|
2726
|
-
name
|
|
2727
|
-
}
|
|
2728
|
-
}`,
|
|
2729
|
-
},
|
|
2730
|
-
});
|
|
2731
|
-
console.log(response);
|
|
2732
|
-
result.subscriberUsers = response;
|
|
2733
|
-
}
|
|
2734
|
-
const ownerTeams = teamBoardIds === null || teamBoardIds === void 0 ? void 0 : teamBoardIds.teamBoardIds.filter((team) => team.isOwner).map((team) => team.teamId);
|
|
2735
|
-
if (ownerTeams && ownerTeams.length > 0) {
|
|
2736
|
-
response = await this.helpers.request({
|
|
2737
|
-
method: 'POST',
|
|
2738
|
-
url: 'https://api.monday.com/v2',
|
|
2739
|
-
headers: {
|
|
2740
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2741
|
-
'Content-Type': 'application/json',
|
|
2742
|
-
},
|
|
2743
|
-
body: {
|
|
2744
|
-
query: `mutation {
|
|
2745
|
-
add_teams_to_board(
|
|
2746
|
-
board_id: ${boardId},
|
|
2747
|
-
team_ids: [${ownerTeams.join(',')}],
|
|
2748
|
-
kind: owner
|
|
2749
|
-
) {
|
|
2750
|
-
id
|
|
2751
|
-
name
|
|
2752
|
-
}
|
|
2753
|
-
}`,
|
|
2754
|
-
},
|
|
2755
|
-
});
|
|
2756
|
-
console.log(response);
|
|
2757
|
-
result.ownerTeams = response;
|
|
2758
|
-
}
|
|
2759
|
-
const subscriberTeams = teamBoardIds === null || teamBoardIds === void 0 ? void 0 : teamBoardIds.teamBoardIds.filter((team) => !team.isOwner).map((team) => team.teamId);
|
|
2760
|
-
if (subscriberTeams && subscriberTeams.length > 0) {
|
|
2761
|
-
response = await this.helpers.request({
|
|
2762
|
-
method: 'POST',
|
|
2763
|
-
url: 'https://api.monday.com/v2',
|
|
2764
|
-
headers: {
|
|
2765
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2766
|
-
'Content-Type': 'application/json',
|
|
2767
|
-
},
|
|
2768
|
-
body: {
|
|
2769
|
-
query: `mutation {
|
|
2770
|
-
add_teams_to_board(
|
|
2771
|
-
board_id: ${boardId},
|
|
2772
|
-
team_ids: [${subscriberTeams.join(',')}],
|
|
2773
|
-
kind: subscriber
|
|
2774
|
-
) {
|
|
2775
|
-
id
|
|
2776
|
-
name
|
|
2777
|
-
}
|
|
2778
|
-
}`,
|
|
2779
|
-
},
|
|
2780
|
-
});
|
|
2781
|
-
console.log(response);
|
|
2782
|
-
result.subscriberTeams = response;
|
|
2783
|
-
}
|
|
2784
|
-
return [[{ json: result }]];
|
|
2785
|
-
break;
|
|
2786
|
-
}
|
|
2787
|
-
case 'listBoards': {
|
|
2788
|
-
console.log('List boards: ');
|
|
2789
|
-
const credentials = await this.getCredentials('WorktablesApi');
|
|
2790
|
-
const filterByWorkspace = this.getNodeParameter('filterByWorkspace', 0);
|
|
2791
|
-
const workspaceId = this.getNodeParameter('workspace', 0, '');
|
|
2792
|
-
const limit = this.getNodeParameter('limit', 0);
|
|
2793
|
-
const boardKind = this.getNodeParameter('boardKind', 0);
|
|
2794
|
-
const orderBy = this.getNodeParameter('orderBy', 0);
|
|
2795
|
-
const state = this.getNodeParameter('state', 0);
|
|
2796
|
-
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2797
|
-
if (!apiKey) {
|
|
2798
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
2799
|
-
}
|
|
2800
|
-
const workspaceFilter = filterByWorkspace && workspaceId
|
|
2801
|
-
? `workspace_ids: ${JSON.stringify(workspaceId)},`
|
|
2802
|
-
: '';
|
|
2803
|
-
const allBoards = [];
|
|
2804
|
-
let page = 1;
|
|
2805
|
-
let hasMore = true;
|
|
2806
|
-
const queryLimit = limit === 0 ? 100 : limit;
|
|
2807
|
-
while (hasMore) {
|
|
2808
|
-
const responseData = await this.helpers.request({
|
|
2809
|
-
method: 'POST',
|
|
2810
|
-
url: 'https://api.monday.com/v2',
|
|
2811
|
-
headers: {
|
|
2812
|
-
Authorization: `Bearer ${apiKey}`,
|
|
2813
|
-
'Content-Type': 'application/json',
|
|
2814
|
-
},
|
|
2815
|
-
body: JSON.stringify({
|
|
2816
|
-
query: `{
|
|
2817
|
-
boards(
|
|
2818
|
-
limit: ${queryLimit},
|
|
2819
|
-
page: ${page},
|
|
2820
|
-
${workspaceFilter}
|
|
2821
|
-
state: ${state}
|
|
2822
|
-
${orderBy === 'none' ? `` : `, order_by: ${orderBy}`}
|
|
2823
|
-
${boardKind === 'all' ? `` : `, board_kind: ${boardKind}`}
|
|
2824
|
-
) {
|
|
2825
|
-
id
|
|
2826
|
-
name
|
|
2827
|
-
board_kind
|
|
2828
|
-
state
|
|
2829
|
-
description
|
|
2830
|
-
items_count
|
|
2831
|
-
creator { id name }
|
|
2832
|
-
owners { id name }
|
|
2833
|
-
subscribers { id name }
|
|
2834
|
-
tags { id name }
|
|
2835
|
-
workspace_id
|
|
2836
|
-
updated_at
|
|
2837
|
-
url
|
|
2838
|
-
}
|
|
2839
|
-
}`,
|
|
2840
|
-
}),
|
|
2841
|
-
});
|
|
2842
|
-
const boards = JSON.parse(responseData).data.boards;
|
|
2843
|
-
allBoards.push(...boards.map((board) => ({
|
|
2844
|
-
name: board.name,
|
|
2845
|
-
value: board.id,
|
|
2846
|
-
boardKind: board.board_kind,
|
|
2847
|
-
state: board.state,
|
|
2848
|
-
description: board.description,
|
|
2849
|
-
itemsCount: board.items_count,
|
|
2850
|
-
creator: board.creator,
|
|
2851
|
-
owners: board.owners,
|
|
2852
|
-
subscribers: board.subscribers,
|
|
2853
|
-
tags: board.tags,
|
|
2854
|
-
workspaceId: board.workspace_id,
|
|
2855
|
-
updatedAt: board.updated_at,
|
|
2856
|
-
url: board.url,
|
|
2857
|
-
})));
|
|
2858
|
-
if (limit > 0 || boards.length < queryLimit) {
|
|
2859
|
-
hasMore = false;
|
|
2860
|
-
}
|
|
2861
|
-
else {
|
|
2862
|
-
page++;
|
|
2863
|
-
}
|
|
2864
|
-
}
|
|
2865
|
-
response = allBoards.sort((a, b) => a.name.localeCompare(b.name));
|
|
2866
|
-
return [response.map((board) => ({ json: board }))];
|
|
2867
|
-
break;
|
|
2868
|
-
}
|
|
2869
|
-
case 'listBoardGroups': {
|
|
2870
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2871
|
-
const archiveGroup = this.getNodeParameter('archiveGroup', 0);
|
|
2872
|
-
const deleteGroup = this.getNodeParameter('deleteGroup', 0);
|
|
2873
|
-
let filter = '';
|
|
2874
|
-
if (archiveGroup) {
|
|
2875
|
-
filter += ' archived';
|
|
2876
|
-
}
|
|
2877
|
-
if (deleteGroup) {
|
|
2878
|
-
filter += ' deleted';
|
|
2879
|
-
}
|
|
2880
|
-
const query = `
|
|
2881
|
-
query {
|
|
2882
|
-
boards(ids: [${boardId}]) {
|
|
2883
|
-
groups {
|
|
2884
|
-
id
|
|
2885
|
-
title
|
|
2886
|
-
color
|
|
2887
|
-
position
|
|
2888
|
-
${filter}
|
|
2889
|
-
}
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2892
|
-
`;
|
|
2893
|
-
response = await this.helpers.request({
|
|
2894
|
-
method: 'POST',
|
|
2895
|
-
url: 'https://api.monday.com/v2',
|
|
2896
|
-
headers,
|
|
2897
|
-
body: { query },
|
|
2898
|
-
});
|
|
2899
|
-
break;
|
|
2900
|
-
}
|
|
2901
|
-
case 'getBoard': {
|
|
2902
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2903
|
-
const query = `
|
|
2904
|
-
query {
|
|
2905
|
-
boards(ids: [${boardId}]) {
|
|
2906
|
-
id
|
|
2907
|
-
name
|
|
2908
|
-
description
|
|
2909
|
-
board_kind
|
|
2910
|
-
columns {
|
|
2911
|
-
id
|
|
2912
|
-
title
|
|
2913
|
-
type
|
|
2914
|
-
}
|
|
2915
|
-
groups {
|
|
2916
|
-
id
|
|
2917
|
-
title
|
|
2918
|
-
}
|
|
2919
|
-
items_count
|
|
2920
|
-
subscribers {
|
|
2921
|
-
id
|
|
2922
|
-
name
|
|
2923
|
-
}
|
|
2924
|
-
url
|
|
2925
|
-
updated_at
|
|
2926
|
-
workspace {
|
|
2927
|
-
id
|
|
2928
|
-
name
|
|
2929
|
-
}
|
|
2930
|
-
}
|
|
2931
|
-
}
|
|
2932
|
-
`;
|
|
2933
|
-
response = await this.helpers.request({
|
|
2934
|
-
method: 'POST',
|
|
2935
|
-
url: 'https://api.monday.com/v2',
|
|
2936
|
-
headers,
|
|
2937
|
-
body: { query },
|
|
2938
|
-
});
|
|
2939
|
-
break;
|
|
2940
|
-
}
|
|
2941
|
-
case 'getGroup': {
|
|
2942
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2943
|
-
const groupId = this.getNodeParameter('groupId', 0);
|
|
2944
|
-
const query = `
|
|
2945
|
-
query {
|
|
2946
|
-
boards(ids: [${boardId}]) {
|
|
2947
|
-
groups(ids: ["${groupId}"]) {
|
|
2948
|
-
id
|
|
2949
|
-
title
|
|
2950
|
-
}
|
|
2951
|
-
}
|
|
2952
|
-
}
|
|
2953
|
-
`;
|
|
2954
|
-
response = await this.helpers.request({
|
|
2955
|
-
method: 'POST',
|
|
2956
|
-
url: 'https://api.monday.com/v2',
|
|
2957
|
-
headers,
|
|
2958
|
-
body: { query },
|
|
2959
|
-
});
|
|
2960
|
-
break;
|
|
2961
|
-
}
|
|
2962
|
-
case 'listBoardActivityLogs': {
|
|
2963
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2964
|
-
const from = this.getNodeParameter('from', 0);
|
|
2965
|
-
const to = this.getNodeParameter('to', 0);
|
|
2966
|
-
console.log('From: ', from);
|
|
2967
|
-
console.log('To: ', to);
|
|
2968
|
-
const query = `
|
|
2969
|
-
query {
|
|
2970
|
-
boards(ids: [${boardId}]) {
|
|
2971
|
-
activity_logs (from: "${from}Z", to: "${to}Z") {
|
|
2972
|
-
id
|
|
2973
|
-
user_id
|
|
2974
|
-
entity
|
|
2975
|
-
event
|
|
2976
|
-
data
|
|
2977
|
-
created_at
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
}
|
|
2981
|
-
`;
|
|
2982
|
-
console.log('Query: ', query);
|
|
2983
|
-
response = await this.helpers.request({
|
|
2984
|
-
method: 'POST',
|
|
2985
|
-
url: 'https://api.monday.com/v2',
|
|
2986
|
-
headers,
|
|
2987
|
-
body: { query },
|
|
2988
|
-
});
|
|
2989
|
-
break;
|
|
2990
|
-
}
|
|
2991
|
-
case 'listBoardSubscribers': {
|
|
2992
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
2993
|
-
const query = `
|
|
2994
|
-
query {
|
|
2995
|
-
boards(ids: [${boardId}]) {
|
|
2996
|
-
subscribers {
|
|
2997
|
-
id
|
|
2998
|
-
is_guest
|
|
2999
|
-
is_pending
|
|
3000
|
-
is_verified
|
|
3001
|
-
account {
|
|
3002
|
-
id
|
|
3003
|
-
logo
|
|
3004
|
-
country_code
|
|
3005
|
-
}
|
|
3006
|
-
name
|
|
3007
|
-
email
|
|
3008
|
-
is_admin
|
|
3009
|
-
enabled
|
|
3010
|
-
created_at
|
|
3011
|
-
}
|
|
3012
|
-
team_subscribers {
|
|
3013
|
-
id
|
|
3014
|
-
name
|
|
3015
|
-
users {
|
|
3016
|
-
id
|
|
3017
|
-
name
|
|
3018
|
-
email
|
|
3019
|
-
}
|
|
3020
|
-
}
|
|
3021
|
-
}
|
|
3022
|
-
}
|
|
3023
|
-
`;
|
|
3024
|
-
response = await this.helpers.request({
|
|
3025
|
-
method: 'POST',
|
|
3026
|
-
url: 'https://api.monday.com/v2',
|
|
3027
|
-
headers,
|
|
3028
|
-
body: { query },
|
|
3029
|
-
});
|
|
3030
|
-
break;
|
|
3031
|
-
}
|
|
3032
|
-
case 'removeBoardSubscribers': {
|
|
3033
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3034
|
-
const userIds = this.getNodeParameter('removeSubscribers', 0);
|
|
3035
|
-
const mutation = `
|
|
3036
|
-
mutation {
|
|
3037
|
-
delete_subscribers_from_board(
|
|
3038
|
-
board_id: ${boardId},
|
|
3039
|
-
user_ids: [${userIds}]
|
|
3040
|
-
) {
|
|
3041
|
-
id
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
`;
|
|
3045
|
-
console.log('Remove subscribers: ', mutation);
|
|
3046
|
-
response = await this.helpers.request({
|
|
3047
|
-
method: 'POST',
|
|
3048
|
-
url: 'https://api.monday.com/v2',
|
|
3049
|
-
headers,
|
|
3050
|
-
body: { query: mutation },
|
|
3051
|
-
});
|
|
3052
|
-
break;
|
|
3053
|
-
}
|
|
3054
|
-
case 'createGroup': {
|
|
3055
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3056
|
-
const groupName = this.getNodeParameter('groupName', 0);
|
|
3057
|
-
const groupColor = this.getNodeParameter('groupColor', 0);
|
|
3058
|
-
const relativeTo = this.getNodeParameter('groupId', 0);
|
|
3059
|
-
const position_relative_method = this.getNodeParameter('positionRelative', 0);
|
|
3060
|
-
let query = '';
|
|
3061
|
-
if (relativeTo) {
|
|
3062
|
-
query = `relative_to: "${relativeTo}", position_relative_method: ${position_relative_method}`;
|
|
3063
|
-
}
|
|
3064
|
-
const mutation = `
|
|
3065
|
-
mutation {
|
|
3066
|
-
create_group(
|
|
3067
|
-
board_id: ${boardId},
|
|
3068
|
-
group_name: "${groupName}",
|
|
3069
|
-
group_color: "${groupColor}"
|
|
3070
|
-
${query}
|
|
3071
|
-
) {
|
|
3072
|
-
id
|
|
3073
|
-
title
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
`;
|
|
3077
|
-
console.log('Create group: ', mutation);
|
|
3078
|
-
response = await this.helpers.request({
|
|
3079
|
-
method: 'POST',
|
|
3080
|
-
url: 'https://api.monday.com/v2',
|
|
3081
|
-
headers,
|
|
3082
|
-
body: { query: mutation },
|
|
3083
|
-
});
|
|
3084
|
-
break;
|
|
3085
|
-
}
|
|
3086
|
-
}
|
|
3087
|
-
break;
|
|
3088
|
-
}
|
|
3089
|
-
case 'item': {
|
|
3090
|
-
switch (operation) {
|
|
3091
|
-
case 'listItemSubscribers': {
|
|
3092
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
3093
|
-
const query = `
|
|
3094
|
-
{
|
|
3095
|
-
items (ids: ["${itemId}"]) {
|
|
3096
|
-
subscribers {
|
|
3097
|
-
email
|
|
3098
|
-
account {
|
|
3099
|
-
id
|
|
3100
|
-
name
|
|
3101
|
-
}
|
|
3102
|
-
}
|
|
3103
|
-
}
|
|
3104
|
-
}
|
|
3105
|
-
`;
|
|
3106
|
-
response = await this.helpers.request({
|
|
3107
|
-
method: 'POST',
|
|
3108
|
-
url: 'https://api.monday.com/v2',
|
|
3109
|
-
headers,
|
|
3110
|
-
body: { query: query },
|
|
3111
|
-
});
|
|
3112
|
-
break;
|
|
3113
|
-
}
|
|
3114
|
-
case 'getItem': {
|
|
3115
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
3116
|
-
const isSubitem = this.getNodeParameter('isSubitem', 0);
|
|
3117
|
-
const fetchSubitems = !isSubitem && this.getNodeParameter('fetchSubitems', 0);
|
|
3118
|
-
const fetchParentItem = isSubitem && this.getNodeParameter('fetchParentItems', 0);
|
|
3119
|
-
const queryColumnValues = `
|
|
3120
|
-
column_values {
|
|
3121
|
-
id
|
|
3122
|
-
text
|
|
3123
|
-
value
|
|
3124
|
-
type
|
|
3125
|
-
... on BoardRelationValue {
|
|
3126
|
-
display_value
|
|
3127
|
-
linked_item_ids
|
|
3128
|
-
}
|
|
3129
|
-
... on MirrorValue {
|
|
3130
|
-
display_value
|
|
3131
|
-
mirrored_items {
|
|
3132
|
-
linked_board_id
|
|
3133
|
-
}
|
|
3134
|
-
}
|
|
3135
|
-
}
|
|
3136
|
-
`;
|
|
3137
|
-
const querySubitems = `
|
|
3138
|
-
subitems {
|
|
3139
|
-
id
|
|
3140
|
-
name
|
|
3141
|
-
url
|
|
3142
|
-
board {
|
|
3143
|
-
id
|
|
3144
|
-
}
|
|
3145
|
-
created_at
|
|
3146
|
-
updated_at
|
|
3147
|
-
${queryColumnValues}
|
|
3148
|
-
}
|
|
3149
|
-
`;
|
|
3150
|
-
const queryParentItem = `
|
|
3151
|
-
parent_item {
|
|
3152
|
-
id
|
|
3153
|
-
name
|
|
3154
|
-
url
|
|
3155
|
-
board {
|
|
3156
|
-
id
|
|
3157
|
-
}
|
|
3158
|
-
created_at
|
|
3159
|
-
updated_at
|
|
3160
|
-
${queryColumnValues}
|
|
3161
|
-
}
|
|
3162
|
-
`;
|
|
3163
|
-
const query = `
|
|
3164
|
-
{
|
|
3165
|
-
items(ids: ["${itemId}"]) {
|
|
3166
|
-
id
|
|
3167
|
-
name
|
|
3168
|
-
url
|
|
3169
|
-
board {
|
|
3170
|
-
id
|
|
3171
|
-
}
|
|
3172
|
-
group {
|
|
3173
|
-
id
|
|
3174
|
-
title
|
|
3175
|
-
color
|
|
3176
|
-
position
|
|
3177
|
-
}
|
|
3178
|
-
created_at
|
|
3179
|
-
updated_at
|
|
3180
|
-
${queryColumnValues}
|
|
3181
|
-
${fetchSubitems ? querySubitems : ''}
|
|
3182
|
-
${fetchParentItem ? queryParentItem : ''}
|
|
3183
|
-
}
|
|
3184
|
-
}
|
|
3185
|
-
`;
|
|
3186
|
-
console.log('Query: ', query);
|
|
3187
|
-
const rawResponse = await this.helpers.request({
|
|
3188
|
-
method: 'POST',
|
|
3189
|
-
url: 'https://api.monday.com/v2',
|
|
3190
|
-
headers,
|
|
3191
|
-
body: { query },
|
|
3192
|
-
});
|
|
3193
|
-
const parsed = JSON.parse(rawResponse);
|
|
3194
|
-
const item = parsed.data.items[0];
|
|
3195
|
-
const columnValues = item.column_values || [];
|
|
3196
|
-
const formatted = {
|
|
3197
|
-
id: item.id,
|
|
3198
|
-
name: item.name,
|
|
3199
|
-
created_at: item.created_at,
|
|
3200
|
-
updated_at: item.updated_at,
|
|
3201
|
-
group: {
|
|
3202
|
-
id: item.group.id,
|
|
3203
|
-
title: item.group.title,
|
|
3204
|
-
color: item.group.color,
|
|
3205
|
-
position: item.group.position,
|
|
3206
|
-
},
|
|
3207
|
-
column_values: {},
|
|
3208
|
-
};
|
|
3209
|
-
for (const col of columnValues) {
|
|
3210
|
-
if (col.type === 'subtasks')
|
|
3211
|
-
continue;
|
|
3212
|
-
const formattedCol = {
|
|
3213
|
-
type: col.type,
|
|
3214
|
-
value: await (0, parseValue_1.parseValue)(col.value),
|
|
3215
|
-
text: col.text,
|
|
3216
|
-
};
|
|
3217
|
-
if ('display_value' in col) {
|
|
3218
|
-
formattedCol.display_value = col.display_value;
|
|
3219
|
-
}
|
|
3220
|
-
if ('linked_item_ids' in col) {
|
|
3221
|
-
formattedCol.linked_item_ids = col.linked_item_ids;
|
|
3222
|
-
}
|
|
3223
|
-
if ('mirrored_items' in col) {
|
|
3224
|
-
formattedCol.mirrored_items = col.mirrored_items;
|
|
3225
|
-
}
|
|
3226
|
-
formatted.column_values[col.id] = formattedCol;
|
|
3227
|
-
}
|
|
3228
|
-
if (item.subitems && Array.isArray(item.subitems)) {
|
|
3229
|
-
formatted.subitems = await Promise.all(item.subitems.map(async (subitem) => {
|
|
3230
|
-
const subFormatted = {
|
|
3231
|
-
id: subitem.id,
|
|
3232
|
-
column_values: {},
|
|
3233
|
-
};
|
|
3234
|
-
for (const col of subitem.column_values || []) {
|
|
3235
|
-
const subCol = {
|
|
3236
|
-
type: col.type,
|
|
3237
|
-
value: await (0, parseValue_1.parseValue)(col.value),
|
|
3238
|
-
text: col.text,
|
|
3239
|
-
};
|
|
3240
|
-
if ('display_value' in col) {
|
|
3241
|
-
subCol.display_value = col.display_value;
|
|
3242
|
-
}
|
|
3243
|
-
if ('linked_item_ids' in col) {
|
|
3244
|
-
subCol.linked_item_ids = col.linked_item_ids;
|
|
3245
|
-
}
|
|
3246
|
-
if ('mirrored_items' in col) {
|
|
3247
|
-
subCol.mirrored_items = col.mirrored_items;
|
|
3248
|
-
}
|
|
3249
|
-
subFormatted.column_values[col.id] = subCol;
|
|
3250
|
-
}
|
|
3251
|
-
return subFormatted;
|
|
3252
|
-
}));
|
|
3253
|
-
}
|
|
3254
|
-
if (item.parent_item && typeof item.parent_item === 'object') {
|
|
3255
|
-
const parentItem = item.parent_item;
|
|
3256
|
-
const parentFormatted = {
|
|
3257
|
-
id: parentItem.id,
|
|
3258
|
-
name: parentItem.name,
|
|
3259
|
-
created_at: parentItem.created_at,
|
|
3260
|
-
updated_at: parentItem.updated_at,
|
|
3261
|
-
column_values: {},
|
|
3262
|
-
};
|
|
3263
|
-
for (const col of parentItem.column_values || []) {
|
|
3264
|
-
const subCol = {
|
|
3265
|
-
type: col.type,
|
|
3266
|
-
value: await (0, parseValue_1.parseValue)(col.value),
|
|
3267
|
-
text: col.text,
|
|
3268
|
-
};
|
|
3269
|
-
if ('display_value' in col) {
|
|
3270
|
-
subCol.display_value = col.display_value;
|
|
3271
|
-
}
|
|
3272
|
-
if ('linked_item_ids' in col) {
|
|
3273
|
-
subCol.linked_item_ids = col.linked_item_ids;
|
|
3274
|
-
}
|
|
3275
|
-
if ('mirrored_items' in col) {
|
|
3276
|
-
subCol.mirrored_items = col.mirrored_items;
|
|
3277
|
-
}
|
|
3278
|
-
parentFormatted.column_values[col.id] = subCol;
|
|
3279
|
-
}
|
|
3280
|
-
formatted.parent_item = parentFormatted;
|
|
3281
|
-
}
|
|
3282
|
-
return [[{ json: formatted }]];
|
|
3283
|
-
}
|
|
3284
|
-
case 'updateItem': {
|
|
3285
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
3286
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3287
|
-
const raw = this.getNodeParameter('columnValues', 0);
|
|
3288
|
-
console.log('columnValues RAW:', raw);
|
|
3289
|
-
const columnValues = raw.column;
|
|
3290
|
-
let column_values_object = {};
|
|
3291
|
-
console.log('Column Values:', columnValues);
|
|
3292
|
-
if ((columnValues === null || columnValues === void 0 ? void 0 : columnValues.length) > 0) {
|
|
3293
|
-
for (const col of columnValues) {
|
|
3294
|
-
const { columnId, columnType, columnValue } = col;
|
|
3295
|
-
console.log('Column ID:', columnId);
|
|
3296
|
-
console.log('Detected Type:', columnType);
|
|
3297
|
-
if (columnType === 'objectValue') {
|
|
3298
|
-
console.log('Processing objectValue for column:', columnId);
|
|
3299
|
-
console.log('Object Value:', col.objectValue);
|
|
3300
|
-
try {
|
|
3301
|
-
const parsedValue = JSON.parse(col.objectValue || '{}');
|
|
3302
|
-
column_values_object[columnId] = parsedValue;
|
|
3303
|
-
console.log('Parsed Object Value:', column_values_object[columnId]);
|
|
3304
|
-
}
|
|
3305
|
-
catch (error) {
|
|
3306
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
3307
|
-
message: `Invalid JSON format for column ${columnId}: ${error.message}`,
|
|
3308
|
-
});
|
|
3309
|
-
}
|
|
3310
|
-
continue;
|
|
3311
|
-
}
|
|
3312
|
-
if (!columnType ||
|
|
3313
|
-
columnType === 'text' ||
|
|
3314
|
-
columnType === 'simple' ||
|
|
3315
|
-
col.columnType === 'simple' ||
|
|
3316
|
-
columnType === 'file') {
|
|
3317
|
-
if (col.columnValue !== undefined) {
|
|
3318
|
-
const value = col.columnValue;
|
|
3319
|
-
if (typeof value === 'string' && columnType === 'file') {
|
|
3320
|
-
const links = value.split(',').map((item) => {
|
|
3321
|
-
const [link, ...nameParts] = item.trim().split(/\s+/);
|
|
3322
|
-
return {
|
|
3323
|
-
fileType: 'LINK',
|
|
3324
|
-
linkToFile: link,
|
|
3325
|
-
name: nameParts.join(' '),
|
|
3326
|
-
};
|
|
3327
|
-
});
|
|
3328
|
-
column_values_object[columnId] = { files: links };
|
|
3329
|
-
}
|
|
3330
|
-
else if (typeof value === 'string') {
|
|
3331
|
-
column_values_object[columnId] = value.replace(/\n/g, '\\n');
|
|
3332
|
-
}
|
|
3333
|
-
else {
|
|
3334
|
-
column_values_object[columnId] = value;
|
|
3335
|
-
}
|
|
3336
|
-
}
|
|
3337
|
-
continue;
|
|
3338
|
-
}
|
|
3339
|
-
switch (columnType) {
|
|
3340
|
-
case 'board_relation':
|
|
3341
|
-
case 'connect_boards':
|
|
3342
|
-
if (col.addConnections) {
|
|
3343
|
-
const mutation = `query {
|
|
3344
|
-
items(ids: [${itemId}]) {
|
|
3345
|
-
column_values(ids: ["${col.columnId}"]) {
|
|
3346
|
-
... on BoardRelationValue {
|
|
3347
|
-
linked_item_ids
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
}
|
|
3351
|
-
}`;
|
|
3352
|
-
const itemConnectionResponse = await this.helpers.request({
|
|
3353
|
-
method: 'POST',
|
|
3354
|
-
url: 'https://api.monday.com/v2',
|
|
3355
|
-
headers,
|
|
3356
|
-
body: { query: mutation },
|
|
3357
|
-
});
|
|
3358
|
-
const existingIds = ((_f = (_e = (_d = (_c = (_b = (_a = JSON.parse(itemConnectionResponse)) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.column_values) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.linked_item_ids) || [];
|
|
3359
|
-
console.log('Existing IDs:', existingIds);
|
|
3360
|
-
const newIds = columnValue.split(',').map((id) => id.trim());
|
|
3361
|
-
const mergedIds = Array.from(new Set([...existingIds, ...newIds]));
|
|
3362
|
-
column_values_object[columnId] = {
|
|
3363
|
-
item_ids: mergedIds,
|
|
3364
|
-
};
|
|
3365
|
-
}
|
|
3366
|
-
else {
|
|
3367
|
-
column_values_object[columnId] = {
|
|
3368
|
-
item_ids: columnValue.split(',').map((id) => id.trim()),
|
|
3369
|
-
};
|
|
3370
|
-
}
|
|
3371
|
-
break;
|
|
3372
|
-
case 'dependency':
|
|
3373
|
-
column_values_object[columnId] = {
|
|
3374
|
-
item_ids: columnValue.split(',').map((id) => id.trim()),
|
|
3375
|
-
};
|
|
3376
|
-
break;
|
|
3377
|
-
case 'people':
|
|
3378
|
-
console.log('Processing people column:', col);
|
|
3379
|
-
const personsAndTeams = [];
|
|
3380
|
-
if (Array.isArray(col.peopleValue)) {
|
|
3381
|
-
personsAndTeams.push(...col.peopleValue.map((id) => ({
|
|
3382
|
-
id: parseInt(id),
|
|
3383
|
-
kind: 'person',
|
|
3384
|
-
})));
|
|
3385
|
-
}
|
|
3386
|
-
if (Array.isArray(col.teamsValue)) {
|
|
3387
|
-
personsAndTeams.push(...col.teamsValue.map((id) => ({
|
|
3388
|
-
id: parseInt(id),
|
|
3389
|
-
kind: 'team',
|
|
3390
|
-
})));
|
|
3391
|
-
}
|
|
3392
|
-
if (personsAndTeams.length > 0) {
|
|
3393
|
-
column_values_object[columnId] = { personsAndTeams };
|
|
3394
|
-
}
|
|
3395
|
-
break;
|
|
3396
|
-
case 'timeline':
|
|
3397
|
-
column_values_object[columnId] = {
|
|
3398
|
-
from: (_g = col.startDate) === null || _g === void 0 ? void 0 : _g.split('T')[0],
|
|
3399
|
-
to: (_h = col.endDate) === null || _h === void 0 ? void 0 : _h.split('T')[0],
|
|
3400
|
-
};
|
|
3401
|
-
break;
|
|
3402
|
-
case 'checkbox':
|
|
3403
|
-
column_values_object[columnId] = { checked: columnValue };
|
|
3404
|
-
break;
|
|
3405
|
-
case 'hour':
|
|
3406
|
-
const [hour, minute = '00'] = columnValue.split(':');
|
|
3407
|
-
column_values_object[columnId] = { hour: Number(hour), minute: Number(minute) };
|
|
3408
|
-
break;
|
|
3409
|
-
case 'status':
|
|
3410
|
-
column_values_object[columnId] = { label: col.statusLabel || columnValue };
|
|
3411
|
-
break;
|
|
3412
|
-
case 'location':
|
|
3413
|
-
column_values_object[columnId] = {
|
|
3414
|
-
lat: col.latitude,
|
|
3415
|
-
lng: col.longitude,
|
|
3416
|
-
address: col.address || '',
|
|
3417
|
-
};
|
|
3418
|
-
break;
|
|
3419
|
-
case 'dropdown':
|
|
3420
|
-
const dropdownLabels = (_j = col.dropdownValue) === null || _j === void 0 ? void 0 : _j.split(',').map((label) => label.trim()).filter(Boolean);
|
|
3421
|
-
if (dropdownLabels === null || dropdownLabels === void 0 ? void 0 : dropdownLabels.length) {
|
|
3422
|
-
column_values_object[columnId] = { labels: dropdownLabels };
|
|
3423
|
-
}
|
|
3424
|
-
break;
|
|
3425
|
-
case 'date':
|
|
3426
|
-
const dateValue = col.dateValue;
|
|
3427
|
-
const date = new Date(dateValue);
|
|
3428
|
-
if (!isNaN(date.getTime())) {
|
|
3429
|
-
column_values_object[columnId] = {
|
|
3430
|
-
date: date.toISOString().split('T')[0],
|
|
3431
|
-
};
|
|
3432
|
-
}
|
|
3433
|
-
else {
|
|
3434
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
3435
|
-
message: `Invalid date format for column ${columnId}`,
|
|
3436
|
-
});
|
|
3437
|
-
}
|
|
3438
|
-
break;
|
|
3439
|
-
case 'email':
|
|
3440
|
-
column_values_object[columnId] = {
|
|
3441
|
-
text: col.emailText || '',
|
|
3442
|
-
email: col.emailValue || '',
|
|
3443
|
-
};
|
|
3444
|
-
break;
|
|
3445
|
-
case 'link':
|
|
3446
|
-
column_values_object[columnId] = {
|
|
3447
|
-
text: col.linkText || '',
|
|
3448
|
-
url: col.url || '',
|
|
3449
|
-
};
|
|
3450
|
-
break;
|
|
3451
|
-
case 'phone':
|
|
3452
|
-
column_values_object[columnId] = {
|
|
3453
|
-
phone: `${(_k = col.countryCode) === null || _k === void 0 ? void 0 : _k.split(' ')[0]}${col.phoneValue || ''}`.replace(/[^\d+]/g, ''),
|
|
3454
|
-
countryShortName: ((_l = col.countryCode) === null || _l === void 0 ? void 0 : _l.split(' ')[1]) || '',
|
|
3455
|
-
};
|
|
3456
|
-
break;
|
|
3457
|
-
case 'fileLink':
|
|
3458
|
-
if (col.fileLinks && col.fileLinks.file) {
|
|
3459
|
-
const links = col.fileLinks.file.map((file) => ({
|
|
3460
|
-
fileType: 'LINK',
|
|
3461
|
-
linkToFile: file.linkToFile,
|
|
3462
|
-
name: file.name,
|
|
3463
|
-
}));
|
|
3464
|
-
column_values_object[columnId] = { files: links };
|
|
3465
|
-
}
|
|
3466
|
-
break;
|
|
3467
|
-
case 'button':
|
|
3468
|
-
const query = `query {
|
|
3469
|
-
items (ids: ${itemId}) {
|
|
3470
|
-
column_values (ids: "${columnId}") {
|
|
3471
|
-
... on ButtonValue {
|
|
3472
|
-
color
|
|
3473
|
-
label
|
|
3474
|
-
value
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
}
|
|
3478
|
-
}`;
|
|
3479
|
-
const buttonResponse = await this.helpers.request({
|
|
3480
|
-
method: 'POST',
|
|
3481
|
-
url: 'https://api.monday.com/v2',
|
|
3482
|
-
headers,
|
|
3483
|
-
body: { query },
|
|
3484
|
-
});
|
|
3485
|
-
try {
|
|
3486
|
-
const buttonValue = JSON.parse(buttonResponse).data.items[0].column_values[0].value;
|
|
3487
|
-
const clicks = ((_m = JSON.parse(buttonValue)) === null || _m === void 0 ? void 0 : _m.clicks) || 0;
|
|
3488
|
-
column_values_object[columnId] = {
|
|
3489
|
-
clicks: clicks + 1,
|
|
3490
|
-
changed_at: new Date().toISOString(),
|
|
3491
|
-
};
|
|
3492
|
-
}
|
|
3493
|
-
catch (error) {
|
|
3494
|
-
continue;
|
|
3495
|
-
}
|
|
3496
|
-
break;
|
|
3497
|
-
case 'fileLink':
|
|
3498
|
-
if (col.fileLinks && col.fileLinks.file) {
|
|
3499
|
-
const links = col.fileLinks.file.map((file) => ({
|
|
3500
|
-
fileType: 'LINK',
|
|
3501
|
-
linkToFile: file.linkToFile,
|
|
3502
|
-
name: file.name,
|
|
3503
|
-
}));
|
|
3504
|
-
column_values_object[columnId] = { files: links };
|
|
3505
|
-
}
|
|
3506
|
-
break;
|
|
3507
|
-
default:
|
|
3508
|
-
column_values_object[columnId] = columnValue;
|
|
3509
|
-
break;
|
|
3510
|
-
}
|
|
3511
|
-
}
|
|
3512
|
-
}
|
|
3513
|
-
console.log('column_values_object FINAL:', JSON.stringify(column_values_object, null, 2));
|
|
3514
|
-
const mutation = `mutation {
|
|
3515
|
-
change_multiple_column_values(
|
|
3516
|
-
create_labels_if_missing: true,
|
|
3517
|
-
board_id: ${boardId},
|
|
3518
|
-
item_id: "${itemId}",
|
|
3519
|
-
column_values: "${JSON.stringify(column_values_object)
|
|
3520
|
-
.replace(/"/g, '\\"')
|
|
3521
|
-
.replace(/(^|[^\\])\\n/g, '$1\\\\n')}"
|
|
3522
|
-
) {
|
|
3523
|
-
id
|
|
3524
|
-
url
|
|
3525
|
-
board {
|
|
3526
|
-
id
|
|
3527
|
-
}
|
|
3528
|
-
}
|
|
3529
|
-
}`;
|
|
3530
|
-
console.log('Generated Mutation:', mutation);
|
|
3531
|
-
response = await this.helpers.request({
|
|
3532
|
-
method: 'POST',
|
|
3533
|
-
url: 'https://api.monday.com/v2',
|
|
3534
|
-
headers,
|
|
3535
|
-
body: { query: mutation },
|
|
3536
|
-
});
|
|
3537
|
-
break;
|
|
3538
|
-
}
|
|
3539
|
-
case 'createItem': {
|
|
3540
|
-
const itemName = this.getNodeParameter('itemName', 0);
|
|
3541
|
-
const groupId = this.getNodeParameter('groupId', 0, false);
|
|
3542
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3543
|
-
const isSubitem = this.getNodeParameter('isSubitem', 0);
|
|
3544
|
-
const raw = this.getNodeParameter('columnValues', 0);
|
|
3545
|
-
const columnValues = raw.column;
|
|
3546
|
-
let column_values_object = {};
|
|
3547
|
-
console.log('Column Values:', JSON.stringify(raw, null, 2));
|
|
3548
|
-
if ((columnValues === null || columnValues === void 0 ? void 0 : columnValues.length) > 0) {
|
|
3549
|
-
const columnTypeResponse = await this.helpers.request({
|
|
3550
|
-
method: 'POST',
|
|
3551
|
-
url: 'https://api.monday.com/v2',
|
|
3552
|
-
headers: {
|
|
3553
|
-
Authorization: `Bearer ${apiKey}`,
|
|
3554
|
-
'Content-Type': 'application/json',
|
|
3555
|
-
},
|
|
3556
|
-
body: {
|
|
3557
|
-
query: `query {
|
|
3558
|
-
boards(ids: ${boardId}) {
|
|
3559
|
-
columns {
|
|
3560
|
-
id
|
|
3561
|
-
type
|
|
3562
|
-
}
|
|
3563
|
-
}
|
|
3564
|
-
}`,
|
|
3565
|
-
},
|
|
3566
|
-
});
|
|
3567
|
-
const columnsType = JSON.parse(columnTypeResponse).data.boards[0].columns;
|
|
3568
|
-
for (const col of columnValues) {
|
|
3569
|
-
const columnId = col.columnId;
|
|
3570
|
-
const columnDef = columnsType.find((c) => c.id === columnId);
|
|
3571
|
-
const type = columnDef === null || columnDef === void 0 ? void 0 : columnDef.type;
|
|
3572
|
-
if (!type || type === 'text' || type === 'simple' || col.columnType === 'simple') {
|
|
3573
|
-
console.log('Processing text/simple column:', col);
|
|
3574
|
-
if (col.columnValue !== undefined) {
|
|
3575
|
-
const value = col.columnValue;
|
|
3576
|
-
if (typeof value === 'string' && type === 'file') {
|
|
3577
|
-
const links = value.split(',').map((item) => {
|
|
3578
|
-
const [link, ...nameParts] = item.trim().split(/\s+/);
|
|
3579
|
-
return {
|
|
3580
|
-
fileType: 'LINK',
|
|
3581
|
-
linkToFile: link,
|
|
3582
|
-
name: nameParts.join(' '),
|
|
3583
|
-
};
|
|
3584
|
-
});
|
|
3585
|
-
column_values_object[columnId] = { files: links };
|
|
3586
|
-
}
|
|
3587
|
-
else if (typeof value === 'string') {
|
|
3588
|
-
column_values_object[columnId] = value.replace(/\n/g, '\\n');
|
|
3589
|
-
}
|
|
3590
|
-
else {
|
|
3591
|
-
column_values_object[columnId] = value;
|
|
3592
|
-
}
|
|
3593
|
-
}
|
|
3594
|
-
continue;
|
|
3595
|
-
}
|
|
3596
|
-
else if (col.columnType === 'objectValue') {
|
|
3597
|
-
console.log('Processing objectValue for column:', columnId);
|
|
3598
|
-
try {
|
|
3599
|
-
const parsedValue = JSON.parse(col.objectValue || '{}');
|
|
3600
|
-
column_values_object[columnId] = parsedValue;
|
|
3601
|
-
}
|
|
3602
|
-
catch (error) {
|
|
3603
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
3604
|
-
message: `Invalid JSON format for column ${columnId}: ${error.message}`,
|
|
3605
|
-
});
|
|
3606
|
-
}
|
|
3607
|
-
continue;
|
|
3608
|
-
}
|
|
3609
|
-
console.log('Processing column:', type);
|
|
3610
|
-
switch (type) {
|
|
3611
|
-
case 'board_relation':
|
|
3612
|
-
case 'connect_boards':
|
|
3613
|
-
{
|
|
3614
|
-
const rawValue = col.columnValue || '';
|
|
3615
|
-
const incomingIds = Array.isArray(rawValue)
|
|
3616
|
-
? rawValue
|
|
3617
|
-
: rawValue.split(',').map((id) => id.trim());
|
|
3618
|
-
column_values_object[columnId] = { item_ids: incomingIds };
|
|
3619
|
-
}
|
|
3620
|
-
break;
|
|
3621
|
-
case 'dependency':
|
|
3622
|
-
{
|
|
3623
|
-
const rawValue = col.columnValue || '';
|
|
3624
|
-
const depIds = Array.isArray(rawValue)
|
|
3625
|
-
? rawValue
|
|
3626
|
-
: rawValue.split(',').map((id) => id.trim());
|
|
3627
|
-
column_values_object[columnId] = { item_ids: depIds };
|
|
3628
|
-
}
|
|
3629
|
-
break;
|
|
3630
|
-
case 'people':
|
|
3631
|
-
{
|
|
3632
|
-
const personsAndTeams = [];
|
|
3633
|
-
const peopleList = Array.isArray(col.peopleValue)
|
|
3634
|
-
? col.peopleValue
|
|
3635
|
-
: typeof col.peopleValue === 'string'
|
|
3636
|
-
? col.peopleValue.split(',').map((id) => id.trim())
|
|
3637
|
-
: [];
|
|
3638
|
-
const teamsList = Array.isArray(col.teamsValue)
|
|
3639
|
-
? col.teamsValue
|
|
3640
|
-
: typeof col.teamsValue === 'string'
|
|
3641
|
-
? col.teamsValue.split(',').map((id) => id.trim())
|
|
3642
|
-
: [];
|
|
3643
|
-
for (const id of peopleList) {
|
|
3644
|
-
if (id)
|
|
3645
|
-
personsAndTeams.push({ id: parseInt(id, 10), kind: 'person' });
|
|
3646
|
-
}
|
|
3647
|
-
for (const id of teamsList) {
|
|
3648
|
-
if (id)
|
|
3649
|
-
personsAndTeams.push({ id: parseInt(id, 10), kind: 'team' });
|
|
3650
|
-
}
|
|
3651
|
-
if (personsAndTeams.length > 0) {
|
|
3652
|
-
column_values_object[columnId] = { personsAndTeams };
|
|
3653
|
-
}
|
|
3654
|
-
}
|
|
3655
|
-
break;
|
|
3656
|
-
case 'timeline':
|
|
3657
|
-
{
|
|
3658
|
-
const from = ((_o = col.startDate) === null || _o === void 0 ? void 0 : _o.split('T')[0]) || '';
|
|
3659
|
-
const to = ((_p = col.endDate) === null || _p === void 0 ? void 0 : _p.split('T')[0]) || '';
|
|
3660
|
-
column_values_object[columnId] = { from, to };
|
|
3661
|
-
}
|
|
3662
|
-
break;
|
|
3663
|
-
case 'checkbox':
|
|
3664
|
-
{
|
|
3665
|
-
const checked = col.checkboxValue;
|
|
3666
|
-
column_values_object[columnId] = { checked };
|
|
3667
|
-
}
|
|
3668
|
-
break;
|
|
3669
|
-
case 'hour':
|
|
3670
|
-
{
|
|
3671
|
-
const rawValue = col.columnValue;
|
|
3672
|
-
const [hourStr, minuteStr = '00'] = (rawValue === null || rawValue === void 0 ? void 0 : rawValue.split(':')) || [];
|
|
3673
|
-
column_values_object[columnId] = {
|
|
3674
|
-
hour: Number(hourStr),
|
|
3675
|
-
minute: Number(minuteStr),
|
|
3676
|
-
};
|
|
3677
|
-
}
|
|
3678
|
-
break;
|
|
3679
|
-
case 'status':
|
|
3680
|
-
{
|
|
3681
|
-
if (col.statusLabel !== undefined) {
|
|
3682
|
-
column_values_object[columnId] = { label: col.statusLabel };
|
|
3683
|
-
}
|
|
3684
|
-
}
|
|
3685
|
-
break;
|
|
3686
|
-
case 'location':
|
|
3687
|
-
{
|
|
3688
|
-
column_values_object[columnId] = {
|
|
3689
|
-
lat: col.latitude || '',
|
|
3690
|
-
lng: col.longitude || '',
|
|
3691
|
-
address: col.address || '',
|
|
3692
|
-
};
|
|
3693
|
-
}
|
|
3694
|
-
break;
|
|
3695
|
-
case 'phone':
|
|
3696
|
-
column_values_object[columnId] = {
|
|
3697
|
-
phone: `${(_q = col.countryCode) === null || _q === void 0 ? void 0 : _q.split(' ')[0]}${col.phoneValue || ''}`.replace(/[^\d+]/g, ''),
|
|
3698
|
-
countryShortName: ((_r = col.countryCode) === null || _r === void 0 ? void 0 : _r.split(' ')[1]) || '',
|
|
3699
|
-
};
|
|
3700
|
-
break;
|
|
3701
|
-
case 'file':
|
|
3702
|
-
console.log('Processing fileLink column:', col);
|
|
3703
|
-
if (col.fileLinks && col.fileLinks.file) {
|
|
3704
|
-
const links = col.fileLinks.file.map((file) => ({
|
|
3705
|
-
fileType: 'LINK',
|
|
3706
|
-
linkToFile: file.linkToFile,
|
|
3707
|
-
name: file.name,
|
|
3708
|
-
}));
|
|
3709
|
-
column_values_object[columnId] = { files: links };
|
|
3710
|
-
}
|
|
3711
|
-
break;
|
|
3712
|
-
case 'dropdown':
|
|
3713
|
-
{
|
|
3714
|
-
const labels = (_s = col.dropdownValue) === null || _s === void 0 ? void 0 : _s.split(',').map((t) => t.trim()).filter((t) => t);
|
|
3715
|
-
if (labels && labels.length) {
|
|
3716
|
-
column_values_object[columnId] = { labels };
|
|
3717
|
-
}
|
|
3718
|
-
}
|
|
3719
|
-
break;
|
|
3720
|
-
case 'date':
|
|
3721
|
-
const dateValue = col.dateValue;
|
|
3722
|
-
const date = new Date(dateValue);
|
|
3723
|
-
if (!isNaN(date.getTime())) {
|
|
3724
|
-
column_values_object[columnId] = {
|
|
3725
|
-
date: date.toISOString().split('T')[0],
|
|
3726
|
-
};
|
|
3727
|
-
}
|
|
3728
|
-
else {
|
|
3729
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
3730
|
-
message: `Invalid date format for column ${columnId}`,
|
|
3731
|
-
});
|
|
3732
|
-
}
|
|
3733
|
-
break;
|
|
3734
|
-
case 'email':
|
|
3735
|
-
column_values_object[columnId] = {
|
|
3736
|
-
text: col.emailText || '',
|
|
3737
|
-
email: col.emailValue || '',
|
|
3738
|
-
};
|
|
3739
|
-
break;
|
|
3740
|
-
case 'link':
|
|
3741
|
-
column_values_object[columnId] = {
|
|
3742
|
-
text: col.linkText || '',
|
|
3743
|
-
url: col.url || '',
|
|
3744
|
-
};
|
|
3745
|
-
break;
|
|
3746
|
-
default:
|
|
3747
|
-
{
|
|
3748
|
-
if (col.columnValue !== undefined) {
|
|
3749
|
-
column_values_object[columnId] = col.columnValue;
|
|
3750
|
-
}
|
|
3751
|
-
}
|
|
3752
|
-
break;
|
|
3753
|
-
}
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
const boardInfo = await this.helpers.request({
|
|
3757
|
-
method: 'POST',
|
|
3758
|
-
url: 'https://api.monday.com/v2',
|
|
3759
|
-
headers: {
|
|
3760
|
-
Authorization: `Bearer ${apiKey}`,
|
|
3761
|
-
'Content-Type': 'application/json',
|
|
3762
|
-
},
|
|
3763
|
-
body: {
|
|
3764
|
-
query: `query {
|
|
3765
|
-
boards(ids: ${boardId}) {
|
|
3766
|
-
name
|
|
3767
|
-
}
|
|
3768
|
-
}`,
|
|
3769
|
-
},
|
|
3770
|
-
});
|
|
3771
|
-
const parsedBoard = JSON.parse(boardInfo);
|
|
3772
|
-
const parentBoardName = parsedBoard.data.boards[0].name;
|
|
3773
|
-
let parentId = '';
|
|
3774
|
-
if (parentBoardName.startsWith('Subitems of') || (parentBoardName && isSubitem)) {
|
|
3775
|
-
parentId = this.getNodeParameter('parentId', 0);
|
|
3776
|
-
}
|
|
3777
|
-
const columnValuesString = JSON.stringify(column_values_object)
|
|
3778
|
-
.replace(/"/g, '\\"')
|
|
3779
|
-
.replace(/(^|[^\\])\\n/g, '$1\\\\n');
|
|
3780
|
-
let groupLine = groupId ? `group_id: "${groupId}",` : '';
|
|
3781
|
-
const mutation = parentId
|
|
3782
|
-
? `mutation {
|
|
3783
|
-
create_subitem(
|
|
3784
|
-
create_labels_if_missing: true,
|
|
3785
|
-
parent_item_id: ${parentId},
|
|
3786
|
-
item_name: "${itemName}",
|
|
3787
|
-
column_values: "${columnValuesString}"
|
|
3788
|
-
) { id name url
|
|
3789
|
-
board {
|
|
3790
|
-
id
|
|
3791
|
-
} column_values {
|
|
3792
|
-
id
|
|
3793
|
-
text
|
|
3794
|
-
type
|
|
3795
|
-
|
|
3796
|
-
value
|
|
3797
|
-
}}
|
|
3798
|
-
}`
|
|
3799
|
-
: `mutation {
|
|
3800
|
-
create_item(
|
|
3801
|
-
create_labels_if_missing: true,
|
|
3802
|
-
board_id: ${boardId},
|
|
3803
|
-
item_name: "${itemName}",
|
|
3804
|
-
${groupLine}
|
|
3805
|
-
column_values: "${columnValuesString}"
|
|
3806
|
-
) { id name url
|
|
3807
|
-
board {
|
|
3808
|
-
id
|
|
3809
|
-
} column_values {
|
|
3810
|
-
id
|
|
3811
|
-
text
|
|
3812
|
-
type
|
|
3813
|
-
value
|
|
3814
|
-
|
|
3815
|
-
}}
|
|
3816
|
-
}`;
|
|
3817
|
-
console.log('Mutation:', mutation);
|
|
3818
|
-
const responseRaw = await this.helpers.request({
|
|
3819
|
-
method: 'POST',
|
|
3820
|
-
url: 'https://api.monday.com/v2',
|
|
3821
|
-
headers: {
|
|
3822
|
-
Authorization: `Bearer ${apiKey}`,
|
|
3823
|
-
'Content-Type': 'application/json',
|
|
3824
|
-
},
|
|
3825
|
-
body: { query: mutation },
|
|
3826
|
-
});
|
|
3827
|
-
response = await (0, isErrorResponse_1.parseApiResponse)(responseRaw);
|
|
3828
|
-
if (!response.success) {
|
|
3829
|
-
const parsed = JSON.parse(response.data);
|
|
3830
|
-
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
3831
|
-
console.log(firstError[0]);
|
|
3832
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), firstError, {
|
|
3833
|
-
message: firstError.message,
|
|
3834
|
-
description: JSON.stringify(firstError, null, 2),
|
|
3835
|
-
});
|
|
3836
|
-
}
|
|
3837
|
-
const parsedResponse = JSON.parse(responseRaw);
|
|
3838
|
-
const itemData = ((_t = parsedResponse.data) === null || _t === void 0 ? void 0 : _t.create_item) || ((_u = parsedResponse.data) === null || _u === void 0 ? void 0 : _u.create_subitem);
|
|
3839
|
-
const formattedResponse = {
|
|
3840
|
-
id: itemData.id,
|
|
3841
|
-
name: itemName,
|
|
3842
|
-
url: itemData.url,
|
|
3843
|
-
board: itemData.board.id,
|
|
3844
|
-
column_values: {},
|
|
3845
|
-
};
|
|
3846
|
-
for (const col of itemData.column_values || []) {
|
|
3847
|
-
if (col.type === 'subtasks')
|
|
3848
|
-
continue;
|
|
3849
|
-
const formattedCol = {
|
|
3850
|
-
type: col.type,
|
|
3851
|
-
value: col.value,
|
|
3852
|
-
text: col.text,
|
|
3853
|
-
};
|
|
3854
|
-
if ('display_value' in col) {
|
|
3855
|
-
formattedCol.display_value = col.display_value;
|
|
3856
|
-
}
|
|
3857
|
-
if ('linked_item_ids' in col) {
|
|
3858
|
-
formattedCol.linked_item_ids = col.linked_item_ids;
|
|
3859
|
-
}
|
|
3860
|
-
if ('mirrored_items' in col) {
|
|
3861
|
-
formattedCol.mirrored_items = col.mirrored_items;
|
|
3862
|
-
}
|
|
3863
|
-
formattedResponse.column_values[col.id] = formattedCol;
|
|
3864
|
-
}
|
|
3865
|
-
response = JSON.stringify(formattedResponse);
|
|
3866
|
-
break;
|
|
3867
|
-
}
|
|
3868
|
-
case 'updateColumnValues': {
|
|
3869
|
-
break;
|
|
3870
|
-
}
|
|
3871
|
-
case 'deleteItem': {
|
|
3872
|
-
console.log('Delete an item');
|
|
3873
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
3874
|
-
if (!itemId) {
|
|
3875
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Item ID is required.' });
|
|
3876
|
-
}
|
|
3877
|
-
const mutation = `
|
|
3878
|
-
mutation {
|
|
3879
|
-
delete_item(item_id: ${itemId}) { id }
|
|
3880
|
-
}`;
|
|
3881
|
-
response = await this.helpers.request({
|
|
3882
|
-
method: 'POST',
|
|
3883
|
-
url: 'https://api.monday.com/v2',
|
|
3884
|
-
headers,
|
|
3885
|
-
body: { query: mutation },
|
|
3886
|
-
});
|
|
3887
|
-
break;
|
|
3888
|
-
}
|
|
3889
|
-
case 'duplicateItem': {
|
|
3890
|
-
console.log('Duplicate an item');
|
|
3891
|
-
const isSubitem = this.getNodeParameter('showSubitems', 0);
|
|
3892
|
-
let itemId = '';
|
|
3893
|
-
let subitemId = '';
|
|
3894
|
-
if (isSubitem) {
|
|
3895
|
-
subitemId = this.getNodeParameter('subitemId', 0);
|
|
3896
|
-
}
|
|
3897
|
-
else {
|
|
3898
|
-
itemId = this.getNodeParameter('itemId', 0);
|
|
3899
|
-
}
|
|
3900
|
-
const withUpdates = this.getNodeParameter('withUpdates', 0);
|
|
3901
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3902
|
-
if (!itemId || !boardId) {
|
|
3903
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
3904
|
-
message: 'Item ID and Board ID are required.',
|
|
3905
|
-
});
|
|
3906
|
-
}
|
|
3907
|
-
const mutation = `
|
|
3908
|
-
mutation {
|
|
3909
|
-
duplicate_item(
|
|
3910
|
-
item_id: ${itemId || subitemId},
|
|
3911
|
-
board_id: ${boardId},
|
|
3912
|
-
with_updates: ${withUpdates}
|
|
3913
|
-
) { id }
|
|
3914
|
-
}`;
|
|
3915
|
-
console.log('Mutation: ', mutation);
|
|
3916
|
-
response = await this.helpers.request({
|
|
3917
|
-
method: 'POST',
|
|
3918
|
-
url: 'https://api.monday.com/v2',
|
|
3919
|
-
headers,
|
|
3920
|
-
body: { query: mutation },
|
|
3921
|
-
});
|
|
3922
|
-
break;
|
|
3923
|
-
}
|
|
3924
|
-
case 'listBoardItems': {
|
|
3925
|
-
console.log('List items in a board');
|
|
3926
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3927
|
-
const limit = this.getNodeParameter('limit', 0);
|
|
3928
|
-
if (!boardId) {
|
|
3929
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Board ID is required.' });
|
|
3930
|
-
}
|
|
3931
|
-
const query = `
|
|
3932
|
-
query {
|
|
3933
|
-
boards (ids: ${boardId}) {
|
|
3934
|
-
items_page(limit: ${limit}) {
|
|
3935
|
-
items {
|
|
3936
|
-
id
|
|
3937
|
-
updates {
|
|
3938
|
-
id
|
|
3939
|
-
body
|
|
3940
|
-
}
|
|
3941
|
-
assets {
|
|
3942
|
-
id
|
|
3943
|
-
name
|
|
3944
|
-
public_url
|
|
3945
|
-
url
|
|
3946
|
-
}
|
|
3947
|
-
column_values {
|
|
3948
|
-
id
|
|
3949
|
-
text
|
|
3950
|
-
value
|
|
3951
|
-
}
|
|
3952
|
-
group {
|
|
3953
|
-
id
|
|
3954
|
-
title
|
|
3955
|
-
}
|
|
3956
|
-
subitems {
|
|
3957
|
-
id
|
|
3958
|
-
column_values {
|
|
3959
|
-
id
|
|
3960
|
-
text
|
|
3961
|
-
value
|
|
3962
|
-
}
|
|
3963
|
-
}
|
|
3964
|
-
url
|
|
3965
|
-
}
|
|
3966
|
-
}
|
|
3967
|
-
}
|
|
3968
|
-
}`;
|
|
3969
|
-
response = await this.helpers.request({
|
|
3970
|
-
method: 'POST',
|
|
3971
|
-
url: 'https://api.monday.com/v2',
|
|
3972
|
-
headers,
|
|
3973
|
-
body: { query },
|
|
3974
|
-
});
|
|
3975
|
-
break;
|
|
3976
|
-
}
|
|
3977
|
-
case 'searchItems': {
|
|
3978
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
3979
|
-
const fetchColumnValues = this.getNodeParameter('fetchColumnValues', 0, false);
|
|
3980
|
-
const filterRules = this.getNodeParameter('filterRules', 0);
|
|
3981
|
-
const sortOptions = this.getNodeParameter('sortOptions', 0, { sortBy: [] });
|
|
3982
|
-
const logicalOperator = this.getNodeParameter('logicalOperator', 0);
|
|
3983
|
-
let rulesArray = [];
|
|
3984
|
-
if (((_v = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _v === void 0 ? void 0 : _v.length) > 0) {
|
|
3985
|
-
rulesArray = filterRules.rule.map((rule) => {
|
|
3986
|
-
let formattedValue;
|
|
3987
|
-
if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
|
|
3988
|
-
if (formattedValue === 'null') {
|
|
3989
|
-
formattedValue = null;
|
|
3990
|
-
}
|
|
3991
|
-
else {
|
|
3992
|
-
formattedValue = '""';
|
|
3993
|
-
}
|
|
3994
|
-
}
|
|
3995
|
-
else if (rule.operator === 'between') {
|
|
3996
|
-
try {
|
|
3997
|
-
const rangeValues = JSON.parse(rule.compareValue);
|
|
3998
|
-
formattedValue = JSON.stringify(rangeValues);
|
|
3999
|
-
}
|
|
4000
|
-
catch (e) {
|
|
4001
|
-
const values = rule.compareValue.split(',').map((v) => v.trim());
|
|
4002
|
-
formattedValue = JSON.stringify(values);
|
|
4003
|
-
}
|
|
4004
|
-
}
|
|
4005
|
-
else if (['any_of', 'not_any_of'].includes(rule.operator)) {
|
|
4006
|
-
try {
|
|
4007
|
-
const multiValues = JSON.parse(rule.compareValue);
|
|
4008
|
-
formattedValue = Array.isArray(multiValues)
|
|
4009
|
-
? JSON.stringify(multiValues)
|
|
4010
|
-
: JSON.stringify([rule.compareValue]);
|
|
4011
|
-
}
|
|
4012
|
-
catch (e) {
|
|
4013
|
-
const values = rule.compareValue.split(',').map((v) => v.trim());
|
|
4014
|
-
formattedValue = JSON.stringify(values);
|
|
4015
|
-
}
|
|
4016
|
-
}
|
|
4017
|
-
else {
|
|
4018
|
-
formattedValue = JSON.stringify(rule.compareValue);
|
|
4019
|
-
}
|
|
4020
|
-
return `{
|
|
4021
|
-
column_id: "${rule.columnId}",
|
|
4022
|
-
compare_value: ${formattedValue},
|
|
4023
|
-
operator: ${rule.operator}
|
|
4024
|
-
}`;
|
|
4025
|
-
});
|
|
4026
|
-
}
|
|
4027
|
-
const orderByArray = [];
|
|
4028
|
-
if (((_w = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _w === void 0 ? void 0 : _w.length) > 0) {
|
|
4029
|
-
sortOptions.sortBy.forEach((sort) => {
|
|
4030
|
-
orderByArray.push(`{
|
|
4031
|
-
column_id: "${sort.columnId}",
|
|
4032
|
-
direction: ${sort.direction}
|
|
4033
|
-
}`);
|
|
4034
|
-
});
|
|
4035
|
-
}
|
|
4036
|
-
const query = `query {
|
|
4037
|
-
boards(ids: [${boardId}]) {
|
|
4038
|
-
items_page(limit: 100, query_params: {
|
|
4039
|
-
${logicalOperator ? `operator: ${logicalOperator},` : ''}
|
|
4040
|
-
${rulesArray.length > 0 ? `rules: [${rulesArray.join(', ')}],` : ''}
|
|
4041
|
-
${orderByArray.length > 0 ? `order_by: [${orderByArray.join(', ')}]` : ''}
|
|
4042
|
-
}) {
|
|
4043
|
-
items {
|
|
4044
|
-
id
|
|
4045
|
-
name
|
|
4046
|
-
column_values {
|
|
4047
|
-
id
|
|
4048
|
-
text
|
|
4049
|
-
value
|
|
4050
|
-
type
|
|
4051
|
-
}
|
|
4052
|
-
group {
|
|
4053
|
-
id
|
|
4054
|
-
title
|
|
4055
|
-
color
|
|
4056
|
-
position
|
|
4057
|
-
}
|
|
4058
|
-
state
|
|
4059
|
-
created_at
|
|
4060
|
-
updated_at
|
|
4061
|
-
}
|
|
4062
|
-
cursor
|
|
4063
|
-
}
|
|
4064
|
-
}
|
|
4065
|
-
}`;
|
|
4066
|
-
console.log('Query: ', query);
|
|
4067
|
-
const rawResponse = await this.helpers.request({
|
|
4068
|
-
method: 'POST',
|
|
4069
|
-
url: 'https://api.monday.com/v2',
|
|
4070
|
-
headers,
|
|
4071
|
-
body: { query },
|
|
4072
|
-
});
|
|
4073
|
-
const parsed = JSON.parse(rawResponse);
|
|
4074
|
-
const items = ((_0 = (_z = (_y = (_x = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _x === void 0 ? void 0 : _x.boards) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.items_page) === null || _0 === void 0 ? void 0 : _0.items) || [];
|
|
4075
|
-
const formattedItems = await Promise.all(items.map(async (item) => {
|
|
4076
|
-
const formatted = {
|
|
4077
|
-
id: item.id,
|
|
4078
|
-
name: item.name,
|
|
4079
|
-
group: item.group,
|
|
4080
|
-
state: item.state,
|
|
4081
|
-
created_at: item.created_at,
|
|
4082
|
-
updated_at: item.updated_at,
|
|
4083
|
-
column_values: !fetchColumnValues ? undefined : {},
|
|
4084
|
-
};
|
|
4085
|
-
if (!fetchColumnValues)
|
|
4086
|
-
return formatted;
|
|
4087
|
-
for (const col of item.column_values || []) {
|
|
4088
|
-
if (col.type === 'subtasks')
|
|
4089
|
-
continue;
|
|
4090
|
-
const formattedCol = {
|
|
4091
|
-
type: col.type,
|
|
4092
|
-
value: await (0, parseValue_1.parseValue)(col.value),
|
|
4093
|
-
text: col.text,
|
|
4094
|
-
};
|
|
4095
|
-
if ('display_value' in col) {
|
|
4096
|
-
formattedCol.display_value = col.display_value;
|
|
4097
|
-
}
|
|
4098
|
-
if ('linked_item_ids' in col) {
|
|
4099
|
-
formattedCol.linked_item_ids = col.linked_item_ids;
|
|
4100
|
-
}
|
|
4101
|
-
if ('mirrored_items' in col) {
|
|
4102
|
-
formattedCol.mirrored_items = col.mirrored_items;
|
|
4103
|
-
}
|
|
4104
|
-
formatted.column_values[col.id] = formattedCol;
|
|
4105
|
-
}
|
|
4106
|
-
return formatted;
|
|
4107
|
-
}));
|
|
4108
|
-
response = JSON.stringify(formattedItems);
|
|
4109
|
-
break;
|
|
4110
|
-
}
|
|
4111
|
-
case 'uploadItemFile': {
|
|
4112
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
4113
|
-
const columnId = this.getNodeParameter('fileColumnId', 0);
|
|
4114
|
-
const binaryNamesRaw = this.getNodeParameter('binaryPropertyName', 0);
|
|
4115
|
-
if (!itemId || !columnId || !binaryNamesRaw) {
|
|
4116
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4117
|
-
message: 'Item ID, Column ID, and Binary Property Name(s) are required.',
|
|
4118
|
-
});
|
|
4119
|
-
}
|
|
4120
|
-
const binaryNames = binaryNamesRaw
|
|
4121
|
-
.split(',')
|
|
4122
|
-
.map((name) => name.trim())
|
|
4123
|
-
.filter(Boolean);
|
|
4124
|
-
for (const binaryName of binaryNames) {
|
|
4125
|
-
let binaryData;
|
|
4126
|
-
try {
|
|
4127
|
-
binaryData = this.helpers.assertBinaryData(0, binaryName);
|
|
4128
|
-
}
|
|
4129
|
-
catch (error) {
|
|
4130
|
-
console.warn(`Binary field '${binaryName}' not found. Skipping.`);
|
|
4131
|
-
continue;
|
|
4132
|
-
}
|
|
4133
|
-
const fileBuffer = Buffer.from(binaryData.data, 'base64');
|
|
4134
|
-
const fileName = `${binaryData.fileName || 'upload'}.${binaryData.fileExtension || 'dat'}`;
|
|
4135
|
-
console.log('Binary Data:', binaryData);
|
|
4136
|
-
console.log('fileName:', fileName);
|
|
4137
|
-
const form = new form_data_1.default();
|
|
4138
|
-
form.append('query', `mutation ($file: File!) {
|
|
4139
|
-
add_file_to_column (file: $file, item_id: ${itemId}, column_id: "${columnId}") {
|
|
4140
|
-
id
|
|
4141
|
-
}
|
|
4142
|
-
}`);
|
|
4143
|
-
form.append('variables[file]', fileBuffer, {
|
|
4144
|
-
filename: fileName,
|
|
4145
|
-
contentType: binaryData.mimeType || 'application/octet-stream',
|
|
4146
|
-
});
|
|
4147
|
-
const uploadFile = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
4148
|
-
headers: {
|
|
4149
|
-
Authorization: headers.Authorization,
|
|
4150
|
-
...form.getHeaders(),
|
|
4151
|
-
},
|
|
4152
|
-
maxContentLength: Infinity,
|
|
4153
|
-
maxBodyLength: Infinity,
|
|
4154
|
-
});
|
|
4155
|
-
console.log(`Upload response for '${binaryName}':`, uploadFile.data);
|
|
4156
|
-
response = JSON.stringify(uploadFile.data);
|
|
4157
|
-
}
|
|
4158
|
-
break;
|
|
4159
|
-
}
|
|
4160
|
-
case 'listGroupItems': {
|
|
4161
|
-
const boardId = this.getNodeParameter('boardId', 0);
|
|
4162
|
-
const groupId = this.getNodeParameter('groupId', 0);
|
|
4163
|
-
if (!boardId || !groupId) {
|
|
4164
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4165
|
-
message: 'Board ID and Group ID are required.',
|
|
4166
|
-
});
|
|
4167
|
-
}
|
|
4168
|
-
const query = `
|
|
4169
|
-
query {
|
|
4170
|
-
boards (ids: [${boardId}]) {
|
|
4171
|
-
groups (ids: "${groupId}") {
|
|
4172
|
-
items_page {
|
|
4173
|
-
items {
|
|
4174
|
-
id
|
|
4175
|
-
name
|
|
4176
|
-
column_values {
|
|
4177
|
-
id
|
|
4178
|
-
text
|
|
4179
|
-
value
|
|
4180
|
-
type
|
|
4181
|
-
... on BoardRelationValue {
|
|
4182
|
-
display_value
|
|
4183
|
-
linked_item_ids
|
|
4184
|
-
}
|
|
4185
|
-
... on MirrorValue {
|
|
4186
|
-
display_value
|
|
4187
|
-
mirrored_items {
|
|
4188
|
-
linked_board_id
|
|
4189
|
-
}
|
|
4190
|
-
}
|
|
4191
|
-
}
|
|
4192
|
-
group {
|
|
4193
|
-
id
|
|
4194
|
-
title
|
|
4195
|
-
}
|
|
4196
|
-
state
|
|
4197
|
-
created_at
|
|
4198
|
-
updated_at
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
}
|
|
4202
|
-
}
|
|
4203
|
-
}
|
|
4204
|
-
`;
|
|
4205
|
-
const rawResponse = await this.helpers.request({
|
|
4206
|
-
method: 'POST',
|
|
4207
|
-
url: 'https://api.monday.com/v2',
|
|
4208
|
-
headers,
|
|
4209
|
-
body: { query },
|
|
4210
|
-
});
|
|
4211
|
-
const parsed = JSON.parse(rawResponse);
|
|
4212
|
-
const items = ((_6 = (_5 = (_4 = (_3 = (_2 = (_1 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _1 === void 0 ? void 0 : _1.boards) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.groups) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.items_page) === null || _6 === void 0 ? void 0 : _6.items) || [];
|
|
4213
|
-
const formattedItems = await Promise.all(items.map(async (item) => {
|
|
4214
|
-
const formatted = {
|
|
4215
|
-
id: item.id,
|
|
4216
|
-
name: item.name,
|
|
4217
|
-
group: item.group,
|
|
4218
|
-
state: item.state,
|
|
4219
|
-
created_at: item.created_at,
|
|
4220
|
-
updated_at: item.updated_at,
|
|
4221
|
-
column_values: {},
|
|
4222
|
-
};
|
|
4223
|
-
for (const col of item.column_values || []) {
|
|
4224
|
-
if (col.type === 'subtasks')
|
|
4225
|
-
continue;
|
|
4226
|
-
const formattedCol = {
|
|
4227
|
-
type: col.type,
|
|
4228
|
-
value: await (0, parseValue_1.parseValue)(col.value),
|
|
4229
|
-
text: col.text,
|
|
4230
|
-
};
|
|
4231
|
-
if ('display_value' in col) {
|
|
4232
|
-
formattedCol.display_value = col.display_value;
|
|
4233
|
-
}
|
|
4234
|
-
if ('linked_item_ids' in col) {
|
|
4235
|
-
formattedCol.linked_item_ids = col.linked_item_ids;
|
|
4236
|
-
}
|
|
4237
|
-
if ('mirrored_items' in col) {
|
|
4238
|
-
formattedCol.mirrored_items = col.mirrored_items;
|
|
4239
|
-
}
|
|
4240
|
-
formatted.column_values[col.id] = formattedCol;
|
|
4241
|
-
}
|
|
4242
|
-
return formatted;
|
|
4243
|
-
}));
|
|
4244
|
-
response = JSON.stringify(formattedItems);
|
|
4245
|
-
break;
|
|
4246
|
-
}
|
|
4247
|
-
default:
|
|
4248
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4249
|
-
message: `Unsupported operation: ${operation}`,
|
|
4250
|
-
});
|
|
4251
|
-
}
|
|
4252
|
-
break;
|
|
4253
|
-
}
|
|
4254
|
-
case 'update': {
|
|
4255
|
-
switch (operation) {
|
|
4256
|
-
case 'listUpdates': {
|
|
4257
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
4258
|
-
const query = `
|
|
4259
|
-
query {
|
|
4260
|
-
items (ids: [${itemId}]) {
|
|
4261
|
-
updates {
|
|
4262
|
-
id
|
|
4263
|
-
text_body
|
|
4264
|
-
created_at
|
|
4265
|
-
updated_at
|
|
4266
|
-
creator {
|
|
4267
|
-
id
|
|
4268
|
-
name
|
|
4269
|
-
}
|
|
4270
|
-
assets {
|
|
4271
|
-
name
|
|
4272
|
-
public_url
|
|
4273
|
-
file_size
|
|
4274
|
-
}
|
|
4275
|
-
replies {
|
|
4276
|
-
text_body
|
|
4277
|
-
created_at
|
|
4278
|
-
creator {
|
|
4279
|
-
name
|
|
4280
|
-
}
|
|
4281
|
-
}
|
|
4282
|
-
pinned_to_top {
|
|
4283
|
-
item_id
|
|
4284
|
-
}
|
|
4285
|
-
}
|
|
4286
|
-
}
|
|
4287
|
-
}
|
|
4288
|
-
|
|
4289
|
-
`;
|
|
4290
|
-
response = await this.helpers.request({
|
|
4291
|
-
method: 'POST',
|
|
4292
|
-
url: 'https://api.monday.com/v2',
|
|
4293
|
-
headers,
|
|
4294
|
-
body: { query },
|
|
4295
|
-
});
|
|
4296
|
-
break;
|
|
4297
|
-
}
|
|
4298
|
-
case 'createUpdate': {
|
|
4299
|
-
const items = this.getInputData();
|
|
4300
|
-
const itemId = this.getNodeParameter('itemId', 0);
|
|
4301
|
-
const body = this.getNodeParameter('bodyContent', 0);
|
|
4302
|
-
const isReply = this.getNodeParameter('isReply', 0);
|
|
4303
|
-
const shouldMention = this.getNodeParameter('mention', 0, false);
|
|
4304
|
-
const mentionsCollection = this.getNodeParameter('mentionsList', 0, []);
|
|
4305
|
-
let parentUpdateId = '';
|
|
4306
|
-
if (isReply) {
|
|
4307
|
-
parentUpdateId = this.getNodeParameter('updateId', 0);
|
|
4308
|
-
}
|
|
4309
|
-
console.log('Mentions Collection:', JSON.stringify(mentionsCollection, null, 2));
|
|
4310
|
-
console.log('Should Mention:', shouldMention);
|
|
4311
|
-
let mentionsGraphQL = '';
|
|
4312
|
-
if (shouldMention && mentionsCollection.mention.length > 0) {
|
|
4313
|
-
const mentions = mentionsCollection.mention
|
|
4314
|
-
.map((m) => `{id: ${m.id}, type: ${m.type}}`)
|
|
4315
|
-
.join(', ');
|
|
4316
|
-
mentionsGraphQL = `, mentions_list: [${mentions}]`;
|
|
4317
|
-
}
|
|
4318
|
-
const mutation = `
|
|
4319
|
-
mutation {
|
|
4320
|
-
create_update (
|
|
4321
|
-
item_id: ${itemId},
|
|
4322
|
-
body: "${body}" ${isReply ? `, parent_id: ${parentUpdateId}` : ''}${mentionsGraphQL}
|
|
4323
|
-
) {
|
|
4324
|
-
id
|
|
4325
|
-
}
|
|
4326
|
-
}
|
|
4327
|
-
`;
|
|
4328
|
-
console.log('mutation:', mutation);
|
|
4329
|
-
response = await this.helpers.request({
|
|
4330
|
-
method: 'POST',
|
|
4331
|
-
url: 'https://api.monday.com/v2',
|
|
4332
|
-
headers,
|
|
4333
|
-
body: { query: mutation },
|
|
4334
|
-
});
|
|
4335
|
-
console.log('Create Update Result:', JSON.stringify(response, null, 2));
|
|
4336
|
-
const updateId = (_8 = (_7 = JSON.parse(response).data) === null || _7 === void 0 ? void 0 : _7.create_update) === null || _8 === void 0 ? void 0 : _8.id;
|
|
4337
|
-
if (!updateId) {
|
|
4338
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4339
|
-
message: 'Error creating update: Update not created, no ID returned',
|
|
4340
|
-
});
|
|
4341
|
-
}
|
|
4342
|
-
for (let i = 0; i < items.length; i++) {
|
|
4343
|
-
const attachmentsString = this.getNodeParameter('attachmentsUpdate', i);
|
|
4344
|
-
const binaryNames = attachmentsString
|
|
4345
|
-
.split(',')
|
|
4346
|
-
.map((name) => name.trim())
|
|
4347
|
-
.filter(Boolean);
|
|
4348
|
-
console.log(`Item ${i} - Binary names to process:`, binaryNames);
|
|
4349
|
-
for (const binaryName of binaryNames) {
|
|
4350
|
-
let binaryData;
|
|
4351
|
-
try {
|
|
4352
|
-
binaryData = this.helpers.assertBinaryData(i, binaryName);
|
|
4353
|
-
}
|
|
4354
|
-
catch (error) {
|
|
4355
|
-
console.warn(`Item ${i}: Binary field '${binaryName}' not found. Skipping.`);
|
|
4356
|
-
continue;
|
|
4357
|
-
}
|
|
4358
|
-
const fileBuffer = Buffer.from(binaryData.data, 'base64');
|
|
4359
|
-
const fileName = binaryData.fileName || 'upload.dat';
|
|
4360
|
-
const form = new form_data_1.default();
|
|
4361
|
-
form.append('query', `mutation ($file: File!) {
|
|
4362
|
-
add_file_to_update (update_id: ${updateId}, file: $file) {
|
|
4363
|
-
id
|
|
4364
|
-
}
|
|
4365
|
-
}`);
|
|
4366
|
-
form.append('variables[file]', fileBuffer, {
|
|
4367
|
-
filename: `${fileName}.${binaryData.fileExtension || 'txt'}`,
|
|
4368
|
-
contentType: binaryData.mimeType || 'application/octet-stream',
|
|
4369
|
-
});
|
|
4370
|
-
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
4371
|
-
headers: {
|
|
4372
|
-
Authorization: headers.Authorization,
|
|
4373
|
-
...form.getHeaders(),
|
|
4374
|
-
},
|
|
4375
|
-
maxContentLength: Infinity,
|
|
4376
|
-
maxBodyLength: Infinity,
|
|
4377
|
-
});
|
|
4378
|
-
console.log(`Item ${i} - Upload response for '${binaryName}':`, uploadResponse.data);
|
|
4379
|
-
}
|
|
4380
|
-
}
|
|
4381
|
-
break;
|
|
4382
|
-
}
|
|
4383
|
-
case 'updateUpdate': {
|
|
4384
|
-
const items = this.getInputData();
|
|
4385
|
-
const updateId = this.getNodeParameter('updateId', 0);
|
|
4386
|
-
const body = this.getNodeParameter('bodyContent', 0);
|
|
4387
|
-
const shouldMention = this.getNodeParameter('mention', 0, false);
|
|
4388
|
-
const mentionsCollection = this.getNodeParameter('mentionsList', 0, []);
|
|
4389
|
-
console.log('Mentions Collection:', JSON.stringify(mentionsCollection, null, 2));
|
|
4390
|
-
console.log('Should Mention:', shouldMention);
|
|
4391
|
-
let mentionsGraphQL = '';
|
|
4392
|
-
if (shouldMention && mentionsCollection.mention.length > 0) {
|
|
4393
|
-
const mentions = mentionsCollection.mention
|
|
4394
|
-
.map((m) => `{id: ${m.id}, type: ${m.type}}`)
|
|
4395
|
-
.join(', ');
|
|
4396
|
-
mentionsGraphQL = `, mentions_list: [${mentions}]`;
|
|
4397
|
-
}
|
|
4398
|
-
const mutation = `
|
|
4399
|
-
mutation {
|
|
4400
|
-
edit_update (id: ${updateId}, body: "${body}" ${mentionsGraphQL}) {
|
|
4401
|
-
id
|
|
4402
|
-
}
|
|
4403
|
-
}
|
|
4404
|
-
`;
|
|
4405
|
-
response = await this.helpers.request({
|
|
4406
|
-
method: 'POST',
|
|
4407
|
-
url: 'https://api.monday.com/v2',
|
|
4408
|
-
headers,
|
|
4409
|
-
body: { query: mutation },
|
|
4410
|
-
});
|
|
4411
|
-
for (let i = 0; i < items.length; i++) {
|
|
4412
|
-
const attachmentsString = this.getNodeParameter('attachmentsUpdate', i);
|
|
4413
|
-
const binaryNames = attachmentsString
|
|
4414
|
-
.split(',')
|
|
4415
|
-
.map((name) => name.trim())
|
|
4416
|
-
.filter(Boolean);
|
|
4417
|
-
console.log(`Item ${i} - Binary names to process:`, binaryNames);
|
|
4418
|
-
for (const binaryName of binaryNames) {
|
|
4419
|
-
let binaryData;
|
|
4420
|
-
try {
|
|
4421
|
-
binaryData = this.helpers.assertBinaryData(i, binaryName);
|
|
4422
|
-
}
|
|
4423
|
-
catch (error) {
|
|
4424
|
-
console.warn(`Item ${i}: Binary field '${binaryName}' not found. Skipping.`);
|
|
4425
|
-
continue;
|
|
4426
|
-
}
|
|
4427
|
-
const fileBuffer = Buffer.from(binaryData.data, 'base64');
|
|
4428
|
-
const fileName = binaryData.fileName || 'upload.dat';
|
|
4429
|
-
const form = new form_data_1.default();
|
|
4430
|
-
form.append('query', `mutation ($file: File!) {
|
|
4431
|
-
add_file_to_update (update_id: ${updateId}, file: $file) {
|
|
4432
|
-
id
|
|
4433
|
-
}
|
|
4434
|
-
}`);
|
|
4435
|
-
form.append('variables[file]', fileBuffer, {
|
|
4436
|
-
filename: `${fileName}.${binaryData.fileExtension || 'txt'}`,
|
|
4437
|
-
contentType: binaryData.mimeType || 'application/octet-stream',
|
|
4438
|
-
});
|
|
4439
|
-
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
4440
|
-
headers: {
|
|
4441
|
-
Authorization: headers.Authorization,
|
|
4442
|
-
...form.getHeaders(),
|
|
4443
|
-
},
|
|
4444
|
-
maxContentLength: Infinity,
|
|
4445
|
-
maxBodyLength: Infinity,
|
|
4446
|
-
});
|
|
4447
|
-
console.log(`Item ${i} - Upload response for '${binaryName}':`, uploadResponse.data);
|
|
4448
|
-
}
|
|
4449
|
-
}
|
|
4450
|
-
break;
|
|
4451
|
-
}
|
|
4452
|
-
case 'deleteUpdate': {
|
|
4453
|
-
const updateId = this.getNodeParameter('updateId', 0);
|
|
4454
|
-
const mutation = `
|
|
4455
|
-
mutation {
|
|
4456
|
-
delete_update (id: ${updateId}) {
|
|
4457
|
-
id
|
|
4458
|
-
}
|
|
4459
|
-
}
|
|
4460
|
-
`;
|
|
4461
|
-
response = await this.helpers.request({
|
|
4462
|
-
method: 'POST',
|
|
4463
|
-
url: 'https://api.monday.com/v2',
|
|
4464
|
-
headers,
|
|
4465
|
-
body: { query: mutation },
|
|
4466
|
-
});
|
|
4467
|
-
break;
|
|
4468
|
-
}
|
|
4469
|
-
case 'uploadFile': {
|
|
4470
|
-
const items = this.getInputData();
|
|
4471
|
-
const updateId = this.getNodeParameter('updateId', 0);
|
|
4472
|
-
const attachmentsRaw = this.getNodeParameter('attachmentsUpdate', 0);
|
|
4473
|
-
if (!updateId || !attachmentsRaw) {
|
|
4474
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4475
|
-
message: 'Update ID and attachmentsUpdate (binary names) are required.',
|
|
4476
|
-
});
|
|
4477
|
-
}
|
|
4478
|
-
const binaryNames = attachmentsRaw
|
|
4479
|
-
.split(',')
|
|
4480
|
-
.map((name) => name.trim())
|
|
4481
|
-
.filter(Boolean);
|
|
4482
|
-
for (let i = 0; i < items.length; i++) {
|
|
4483
|
-
for (const binaryName of binaryNames) {
|
|
4484
|
-
let binaryData;
|
|
4485
|
-
try {
|
|
4486
|
-
binaryData = this.helpers.assertBinaryData(i, binaryName);
|
|
4487
|
-
}
|
|
4488
|
-
catch (error) {
|
|
4489
|
-
console.warn(`Item ${i}: Binary field '${binaryName}' not found. Skipping.`);
|
|
4490
|
-
continue;
|
|
4491
|
-
}
|
|
4492
|
-
const fileBuffer = Buffer.from(binaryData.data, 'base64');
|
|
4493
|
-
const fileName = `${binaryData.fileName || 'upload'}.${binaryData.fileExtension || 'dat'}`;
|
|
4494
|
-
console.log(`Item ${i} - Uploading file '${fileName}' from '${binaryName}'`);
|
|
4495
|
-
const form = new form_data_1.default();
|
|
4496
|
-
form.append('query', `mutation ($file: File!) {
|
|
4497
|
-
add_file_to_update (update_id: ${updateId}, file: $file) {
|
|
4498
|
-
id
|
|
4499
|
-
}
|
|
4500
|
-
}`);
|
|
4501
|
-
form.append('variables[file]', fileBuffer, {
|
|
4502
|
-
filename: fileName,
|
|
4503
|
-
contentType: binaryData.mimeType || 'application/octet-stream',
|
|
4504
|
-
});
|
|
4505
|
-
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
4506
|
-
headers: {
|
|
4507
|
-
Authorization: headers.Authorization,
|
|
4508
|
-
...form.getHeaders(),
|
|
4509
|
-
},
|
|
4510
|
-
maxContentLength: Infinity,
|
|
4511
|
-
maxBodyLength: Infinity,
|
|
4512
|
-
});
|
|
4513
|
-
console.log(`Item ${i} - Upload response for '${binaryName}':`, uploadResponse.data);
|
|
4514
|
-
response = JSON.stringify(uploadResponse.data);
|
|
4515
|
-
}
|
|
4516
|
-
}
|
|
4517
|
-
break;
|
|
4518
|
-
}
|
|
4519
|
-
default:
|
|
4520
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4521
|
-
message: `Unsupported operation: ${operation}`,
|
|
4522
|
-
});
|
|
4523
|
-
}
|
|
4524
|
-
break;
|
|
4525
|
-
}
|
|
4526
|
-
case 'team': {
|
|
4527
|
-
switch (operation) {
|
|
4528
|
-
case 'listTeams': {
|
|
4529
|
-
const query = `query { teams { id name users { id name email } } }`;
|
|
4530
|
-
response = await this.helpers.request({
|
|
4531
|
-
method: 'POST',
|
|
4532
|
-
url: 'https://api.monday.com/v2',
|
|
4533
|
-
headers,
|
|
4534
|
-
body: { query },
|
|
4535
|
-
});
|
|
4536
|
-
break;
|
|
4537
|
-
}
|
|
4538
|
-
case 'getTeam': {
|
|
4539
|
-
const teamId = this.getNodeParameter('team', 0);
|
|
4540
|
-
const query = `query { teams(ids: [${teamId}]) { id name users { id name email } } }`;
|
|
4541
|
-
response = await this.helpers.request({
|
|
4542
|
-
method: 'POST',
|
|
4543
|
-
url: 'https://api.monday.com/v2',
|
|
4544
|
-
headers,
|
|
4545
|
-
body: { query },
|
|
4546
|
-
});
|
|
4547
|
-
break;
|
|
4548
|
-
}
|
|
4549
|
-
case 'createTeam': {
|
|
4550
|
-
const teamName = this.getNodeParameter('teamName', 0);
|
|
4551
|
-
const isGuest = this.getNodeParameter('isGuest', 0);
|
|
4552
|
-
const subscriberIds = this.getNodeParameter('userIds', 0);
|
|
4553
|
-
const allowEmptyTeam = this.getNodeParameter('allowEmptyTeam', 0);
|
|
4554
|
-
const mutation = `mutation { create_team(
|
|
4555
|
-
input: {name: "${teamName}", is_guest_team: ${isGuest}, subscriber_ids: [${subscriberIds}] }
|
|
4556
|
-
options: {allow_empty_team: ${allowEmptyTeam} }
|
|
4557
|
-
) { id name } }`;
|
|
4558
|
-
response = await this.helpers.request({
|
|
4559
|
-
method: 'POST',
|
|
4560
|
-
url: 'https://api.monday.com/v2',
|
|
4561
|
-
headers,
|
|
4562
|
-
body: { query: mutation },
|
|
4563
|
-
});
|
|
4564
|
-
break;
|
|
4565
|
-
}
|
|
4566
|
-
case 'deleteTeam': {
|
|
4567
|
-
const teamId = this.getNodeParameter('teamId', 0);
|
|
4568
|
-
const mutation = `mutation { delete_team(team_id: ${teamId}) { id } }`;
|
|
4569
|
-
response = await this.helpers.request({
|
|
4570
|
-
method: 'POST',
|
|
4571
|
-
url: 'https://api.monday.com/v2',
|
|
4572
|
-
headers,
|
|
4573
|
-
body: { query: mutation },
|
|
4574
|
-
});
|
|
4575
|
-
break;
|
|
4576
|
-
}
|
|
4577
|
-
case 'updateTeam': {
|
|
4578
|
-
const teamId = this.getNodeParameter('teamId', 0);
|
|
4579
|
-
const newName = this.getNodeParameter('newName', 0);
|
|
4580
|
-
const mutation = `mutation { update_team(id: ${teamId}, name: "${newName}") { id name } }`;
|
|
4581
|
-
response = await this.helpers.request({
|
|
4582
|
-
method: 'POST',
|
|
4583
|
-
url: 'https://api.monday.com/v2',
|
|
4584
|
-
headers,
|
|
4585
|
-
body: { query: mutation },
|
|
4586
|
-
});
|
|
4587
|
-
break;
|
|
4588
|
-
}
|
|
4589
|
-
case 'addUsersToTeam': {
|
|
4590
|
-
const teamId = this.getNodeParameter('teamIds', 0);
|
|
4591
|
-
const userIds = this.getNodeParameter('userIds', 0);
|
|
4592
|
-
const mutation = `mutation {
|
|
4593
|
-
add_users_to_team (team_id: ${teamId}, user_ids: [${userIds}]) {
|
|
4594
|
-
successful_users {
|
|
4595
|
-
name
|
|
4596
|
-
email
|
|
4597
|
-
}
|
|
4598
|
-
failed_users {
|
|
4599
|
-
name
|
|
4600
|
-
email
|
|
4601
|
-
}
|
|
4602
|
-
}
|
|
4603
|
-
} `;
|
|
4604
|
-
response = await this.helpers.request({
|
|
4605
|
-
method: 'POST',
|
|
4606
|
-
url: 'https://api.monday.com/v2',
|
|
4607
|
-
headers,
|
|
4608
|
-
body: { query: mutation },
|
|
4609
|
-
});
|
|
4610
|
-
break;
|
|
4611
|
-
}
|
|
4612
|
-
case 'removeUsersFromTeam': {
|
|
4613
|
-
const teamId = this.getNodeParameter('teamIds', 0);
|
|
4614
|
-
const userIds = this.getNodeParameter('userIds', 0);
|
|
4615
|
-
const mutation = `mutation {
|
|
4616
|
-
remove_users_from_team (team_id: ${teamId}, user_ids: [${userIds}]) {
|
|
4617
|
-
successful_users {
|
|
4618
|
-
name
|
|
4619
|
-
email
|
|
4620
|
-
}
|
|
4621
|
-
failed_users {
|
|
4622
|
-
name
|
|
4623
|
-
email
|
|
4624
|
-
}
|
|
4625
|
-
}
|
|
4626
|
-
} `;
|
|
4627
|
-
response = await this.helpers.request({
|
|
4628
|
-
method: 'POST',
|
|
4629
|
-
url: 'https://api.monday.com/v2',
|
|
4630
|
-
headers,
|
|
4631
|
-
body: { query: mutation },
|
|
4632
|
-
});
|
|
4633
|
-
break;
|
|
4634
|
-
}
|
|
4635
|
-
}
|
|
4636
|
-
break;
|
|
4637
|
-
}
|
|
4638
|
-
case 'downloadFile': {
|
|
4639
|
-
const fileId = this.getNodeParameter('fileId', 0);
|
|
4640
|
-
const query = `
|
|
4641
|
-
query {
|
|
4642
|
-
assets (ids: [${fileId}]) {
|
|
4643
|
-
public_url
|
|
4644
|
-
name
|
|
4645
|
-
file_extension
|
|
4646
|
-
}
|
|
4647
|
-
}
|
|
4648
|
-
`;
|
|
4649
|
-
const responseFile = await this.helpers.request({
|
|
4650
|
-
method: 'POST',
|
|
4651
|
-
url: 'https://api.monday.com/v2',
|
|
4652
|
-
headers,
|
|
4653
|
-
body: { query },
|
|
4654
|
-
json: true,
|
|
4655
|
-
});
|
|
4656
|
-
const asset = (_10 = (_9 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _9 === void 0 ? void 0 : _9.assets) === null || _10 === void 0 ? void 0 : _10[0];
|
|
4657
|
-
if (!(asset === null || asset === void 0 ? void 0 : asset.public_url)) {
|
|
4658
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4659
|
-
message: 'Public URL not found for the given file ID.',
|
|
4660
|
-
});
|
|
4661
|
-
}
|
|
4662
|
-
const fileResponse = await this.helpers.request({
|
|
4663
|
-
method: 'GET',
|
|
4664
|
-
url: asset.public_url,
|
|
4665
|
-
encoding: null,
|
|
4666
|
-
resolveWithFullResponse: true,
|
|
4667
|
-
});
|
|
4668
|
-
const fileBuffer = fileResponse.body;
|
|
4669
|
-
const mimeType = fileResponse.headers['content-type'] || 'application/octet-stream';
|
|
4670
|
-
const fileName = `${asset.name || 'file'}`;
|
|
4671
|
-
const binaryData = await this.helpers.prepareBinaryData(fileBuffer, fileName, mimeType);
|
|
4672
|
-
const result = [
|
|
4673
|
-
{
|
|
4674
|
-
json: {},
|
|
4675
|
-
binary: {
|
|
4676
|
-
data: binaryData,
|
|
4677
|
-
},
|
|
4678
|
-
},
|
|
4679
|
-
];
|
|
4680
|
-
return [result];
|
|
4681
|
-
}
|
|
4682
|
-
case 'query': {
|
|
4683
|
-
const runQuery = this.getNodeParameter('runQuery', 0);
|
|
4684
|
-
if (!runQuery) {
|
|
4685
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Invalid item data.' });
|
|
4686
|
-
}
|
|
4687
|
-
switch (operation) {
|
|
4688
|
-
case 'query': {
|
|
4689
|
-
console.log('Run Query:', runQuery);
|
|
4690
|
-
response = await this.helpers.request({
|
|
4691
|
-
method: 'POST',
|
|
4692
|
-
url: 'https://api.monday.com/v2',
|
|
4693
|
-
headers,
|
|
4694
|
-
body: { query: runQuery },
|
|
4695
|
-
});
|
|
4696
|
-
break;
|
|
4697
|
-
}
|
|
4698
|
-
default:
|
|
4699
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4700
|
-
message: `Unsupported operation: ${operation}`,
|
|
4701
|
-
});
|
|
4702
|
-
}
|
|
4703
|
-
break;
|
|
4704
|
-
}
|
|
4705
|
-
case 'user': {
|
|
4706
|
-
switch (operation) {
|
|
4707
|
-
case 'listUsers': {
|
|
4708
|
-
response = await this.helpers.request({
|
|
4709
|
-
method: 'POST',
|
|
4710
|
-
url: 'https://api.monday.com/v2',
|
|
4711
|
-
headers: {
|
|
4712
|
-
Authorization: `Bearer ${apiKey}`,
|
|
4713
|
-
'Content-Type': 'application/json',
|
|
4714
|
-
},
|
|
4715
|
-
body: {
|
|
4716
|
-
query: `{
|
|
4717
|
-
users {
|
|
4718
|
-
id
|
|
4719
|
-
name
|
|
4720
|
-
email
|
|
4721
|
-
photo_small
|
|
4722
|
-
title
|
|
4723
|
-
is_admin
|
|
4724
|
-
is_guest
|
|
4725
|
-
is_view_only
|
|
4726
|
-
enabled
|
|
4727
|
-
teams {
|
|
4728
|
-
id
|
|
4729
|
-
name
|
|
4730
|
-
}
|
|
4731
|
-
}
|
|
4732
|
-
}`,
|
|
4733
|
-
},
|
|
4734
|
-
});
|
|
4735
|
-
break;
|
|
4736
|
-
}
|
|
4737
|
-
case 'getUser': {
|
|
4738
|
-
const userIds = this.getNodeParameter('userIds', 0);
|
|
4739
|
-
response = await this.helpers.request({
|
|
4740
|
-
method: 'POST',
|
|
4741
|
-
url: 'https://api.monday.com/v2',
|
|
4742
|
-
headers: {
|
|
4743
|
-
Authorization: `Bearer ${apiKey}`,
|
|
4744
|
-
'Content-Type': 'application/json',
|
|
4745
|
-
},
|
|
4746
|
-
body: {
|
|
4747
|
-
query: `{
|
|
4748
|
-
users (ids: [${userIds}]) {
|
|
4749
|
-
id
|
|
4750
|
-
name
|
|
4751
|
-
email
|
|
4752
|
-
photo_small
|
|
4753
|
-
title
|
|
4754
|
-
is_admin
|
|
4755
|
-
is_guest
|
|
4756
|
-
is_view_only
|
|
4757
|
-
enabled
|
|
4758
|
-
teams {
|
|
4759
|
-
id
|
|
4760
|
-
name
|
|
4761
|
-
}
|
|
4762
|
-
}
|
|
4763
|
-
}`,
|
|
4764
|
-
},
|
|
4765
|
-
});
|
|
4766
|
-
break;
|
|
4767
|
-
}
|
|
4768
|
-
}
|
|
4769
|
-
break;
|
|
4770
|
-
}
|
|
4771
|
-
default:
|
|
4772
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: `Unsupported resource: ${resource}` });
|
|
4773
|
-
}
|
|
4774
|
-
response = await (0, isErrorResponse_1.parseApiResponse)(response);
|
|
4775
|
-
console.log('Response res: ', JSON.stringify(response, null, 2));
|
|
4776
|
-
if (response.success) {
|
|
4777
|
-
const parsed = JSON.parse(response.data);
|
|
4778
|
-
console.log('Parsed res: ', parsed);
|
|
4779
|
-
return [[{ json: parsed }]];
|
|
4780
|
-
}
|
|
4781
|
-
else {
|
|
4782
|
-
const parsed = JSON.parse(response.data);
|
|
4783
|
-
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
4784
|
-
console.log(firstError[0]);
|
|
4785
|
-
throw new n8n_workflow_1.NodeApiError(this.getNode(), firstError, {
|
|
4786
|
-
message: firstError.message,
|
|
4787
|
-
description: JSON.stringify(firstError, null, 2),
|
|
4788
|
-
});
|
|
4789
|
-
}
|
|
4790
|
-
}
|
|
4791
|
-
}
|
|
4792
|
-
exports.Worktables = Worktables;
|
|
4793
|
-
//# sourceMappingURL=Worktables.node.js.map
|