n8n-nodes-keloola-workspace 0.2.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/README.md +56 -0
- package/dist/credentials/KeloolaWorkspaceApi.credentials.d.ts +10 -0
- package/dist/credentials/KeloolaWorkspaceApi.credentials.js +51 -0
- package/dist/credentials/KeloolaWorkspaceApi.credentials.js.map +1 -0
- package/dist/icons/keloola.svg +9 -0
- package/dist/icons/workspace.svg +9 -0
- package/dist/nodes/Workspace/KeloolaWorkspace.node.d.ts +5 -0
- package/dist/nodes/Workspace/KeloolaWorkspace.node.js +923 -0
- package/dist/nodes/Workspace/KeloolaWorkspace.node.js.map +1 -0
- package/dist/nodes/Workspace/KeloolaWorkspace.node.json +18 -0
- package/dist/package.json +62 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,923 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeloolaWorkspace = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const credentialName = 'keloolaWorkspaceApi';
|
|
6
|
+
function buildConnectorFields(connectorFields) {
|
|
7
|
+
const connectorFieldsBody = {};
|
|
8
|
+
for (const key of ['daily_task_category_id', 'daily_task_type_id', 'objective_id']) {
|
|
9
|
+
const value = connectorFields[key];
|
|
10
|
+
if (value) {
|
|
11
|
+
connectorFieldsBody[key] = value;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const keyResults = connectorFields.key_results;
|
|
15
|
+
if (keyResults) {
|
|
16
|
+
connectorFieldsBody.key_results = keyResults
|
|
17
|
+
.split(',')
|
|
18
|
+
.map((keyResult) => keyResult.trim())
|
|
19
|
+
.filter(Boolean);
|
|
20
|
+
}
|
|
21
|
+
return connectorFieldsBody;
|
|
22
|
+
}
|
|
23
|
+
class KeloolaWorkspace {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.description = {
|
|
26
|
+
displayName: 'Keloola Workspace',
|
|
27
|
+
name: 'keloolaWorkspace',
|
|
28
|
+
icon: 'file:../../icons/workspace.svg',
|
|
29
|
+
group: ['transform'],
|
|
30
|
+
version: 1,
|
|
31
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
32
|
+
description: 'Interact with the Keloola Workspace API',
|
|
33
|
+
defaults: {
|
|
34
|
+
name: 'Keloola Workspace',
|
|
35
|
+
},
|
|
36
|
+
usableAsTool: true,
|
|
37
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
38
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
39
|
+
credentials: [{ name: credentialName, required: true }],
|
|
40
|
+
requestDefaults: {
|
|
41
|
+
headers: {
|
|
42
|
+
Accept: 'application/json',
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
'Accept-Language': 'en',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
properties: [
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Resource',
|
|
50
|
+
name: 'resource',
|
|
51
|
+
type: 'options',
|
|
52
|
+
noDataExpression: true,
|
|
53
|
+
options: [
|
|
54
|
+
{
|
|
55
|
+
name: 'Note',
|
|
56
|
+
value: 'note',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Task',
|
|
60
|
+
value: 'task',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Workspace',
|
|
64
|
+
value: 'workspace',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
default: 'workspace',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
displayName: 'Operation',
|
|
71
|
+
name: 'operation',
|
|
72
|
+
type: 'options',
|
|
73
|
+
noDataExpression: true,
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: {
|
|
76
|
+
resource: ['workspace'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
options: [
|
|
80
|
+
{
|
|
81
|
+
name: 'Get',
|
|
82
|
+
value: 'get',
|
|
83
|
+
description: 'Get a workspace by ID',
|
|
84
|
+
action: 'Get a workspace',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Get Many',
|
|
88
|
+
value: 'getAll',
|
|
89
|
+
description: 'Get many workspaces',
|
|
90
|
+
action: 'Get many workspaces',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
default: 'getAll',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
displayName: 'Operation',
|
|
97
|
+
name: 'operation',
|
|
98
|
+
type: 'options',
|
|
99
|
+
noDataExpression: true,
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
resource: ['note'],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
options: [
|
|
106
|
+
{
|
|
107
|
+
name: 'Create Note',
|
|
108
|
+
value: 'createNote',
|
|
109
|
+
description: 'Create a new note',
|
|
110
|
+
action: 'Create a note',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
default: 'createNote',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Operation',
|
|
117
|
+
name: 'operation',
|
|
118
|
+
type: 'options',
|
|
119
|
+
noDataExpression: true,
|
|
120
|
+
displayOptions: {
|
|
121
|
+
show: {
|
|
122
|
+
resource: ['task'],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
options: [
|
|
126
|
+
{
|
|
127
|
+
name: 'Create Task',
|
|
128
|
+
value: 'createTask',
|
|
129
|
+
description: 'Create a new task',
|
|
130
|
+
action: 'Create a task',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'Delete Task',
|
|
134
|
+
value: 'deleteTask',
|
|
135
|
+
description: 'Delete a task permanently',
|
|
136
|
+
action: 'Delete a task',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'Get Task Detail',
|
|
140
|
+
value: 'getTaskDetail',
|
|
141
|
+
description: 'Get task detail by ID',
|
|
142
|
+
action: 'Get task detail',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'List Tasks',
|
|
146
|
+
value: 'listTasks',
|
|
147
|
+
description: 'List tasks with pagination',
|
|
148
|
+
action: 'List tasks',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'Update Task',
|
|
152
|
+
value: 'updateTask',
|
|
153
|
+
description: 'Update an existing task',
|
|
154
|
+
action: 'Update a task',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
default: 'listTasks',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
displayName: 'Workspace ID',
|
|
161
|
+
name: 'workspaceId',
|
|
162
|
+
type: 'string',
|
|
163
|
+
required: true,
|
|
164
|
+
default: '',
|
|
165
|
+
displayOptions: {
|
|
166
|
+
show: {
|
|
167
|
+
resource: ['workspace'],
|
|
168
|
+
operation: ['get'],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
description: 'The ID of the workspace',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
displayName: 'Page',
|
|
175
|
+
name: 'page',
|
|
176
|
+
type: 'number',
|
|
177
|
+
default: 1,
|
|
178
|
+
typeOptions: {
|
|
179
|
+
minValue: 1,
|
|
180
|
+
},
|
|
181
|
+
displayOptions: {
|
|
182
|
+
show: {
|
|
183
|
+
resource: ['workspace'],
|
|
184
|
+
operation: ['getAll'],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
description: 'Page number for pagination',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
displayName: 'Per Page',
|
|
191
|
+
name: 'perPage',
|
|
192
|
+
type: 'number',
|
|
193
|
+
default: 10,
|
|
194
|
+
typeOptions: {
|
|
195
|
+
minValue: 1,
|
|
196
|
+
maxValue: 100,
|
|
197
|
+
},
|
|
198
|
+
displayOptions: {
|
|
199
|
+
show: {
|
|
200
|
+
resource: ['workspace'],
|
|
201
|
+
operation: ['getAll'],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
description: 'Number of workspaces to return per page',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
displayName: 'Search',
|
|
208
|
+
name: 'search',
|
|
209
|
+
type: 'string',
|
|
210
|
+
default: '',
|
|
211
|
+
displayOptions: {
|
|
212
|
+
show: {
|
|
213
|
+
resource: ['workspace'],
|
|
214
|
+
operation: ['getAll'],
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
description: 'Search term for filtering workspaces',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
displayName: 'Project ID',
|
|
221
|
+
name: 'project_id',
|
|
222
|
+
type: 'string',
|
|
223
|
+
required: true,
|
|
224
|
+
default: '',
|
|
225
|
+
displayOptions: {
|
|
226
|
+
show: {
|
|
227
|
+
resource: ['task'],
|
|
228
|
+
operation: ['createTask', 'listTasks'],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
description: 'Project UUID to list tasks from',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Task ID',
|
|
235
|
+
name: 'task_id',
|
|
236
|
+
type: 'string',
|
|
237
|
+
required: true,
|
|
238
|
+
default: '',
|
|
239
|
+
displayOptions: {
|
|
240
|
+
show: {
|
|
241
|
+
resource: ['task'],
|
|
242
|
+
operation: ['deleteTask', 'getTaskDetail', 'updateTask'],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
description: 'Task UUID',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
displayName: 'Project ID',
|
|
249
|
+
name: 'project_id',
|
|
250
|
+
type: 'string',
|
|
251
|
+
default: '',
|
|
252
|
+
displayOptions: {
|
|
253
|
+
show: {
|
|
254
|
+
resource: ['note'],
|
|
255
|
+
operation: ['createNote'],
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
description: 'Optional project UUID for the note',
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
displayName: 'Title',
|
|
262
|
+
name: 'title',
|
|
263
|
+
type: 'string',
|
|
264
|
+
required: true,
|
|
265
|
+
default: '',
|
|
266
|
+
displayOptions: {
|
|
267
|
+
show: {
|
|
268
|
+
resource: ['note'],
|
|
269
|
+
operation: ['createNote'],
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
description: 'Title of the note',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Content',
|
|
276
|
+
name: 'content',
|
|
277
|
+
type: 'string',
|
|
278
|
+
required: true,
|
|
279
|
+
default: '',
|
|
280
|
+
typeOptions: {
|
|
281
|
+
rows: 4,
|
|
282
|
+
},
|
|
283
|
+
displayOptions: {
|
|
284
|
+
show: {
|
|
285
|
+
resource: ['note'],
|
|
286
|
+
operation: ['createNote'],
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
description: 'Content of the note',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: 'Title',
|
|
293
|
+
name: 'title',
|
|
294
|
+
type: 'string',
|
|
295
|
+
required: true,
|
|
296
|
+
default: '',
|
|
297
|
+
displayOptions: {
|
|
298
|
+
show: {
|
|
299
|
+
resource: ['task'],
|
|
300
|
+
operation: ['createTask'],
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
description: 'Title of the task',
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
displayName: 'Title',
|
|
307
|
+
name: 'title',
|
|
308
|
+
type: 'string',
|
|
309
|
+
default: '',
|
|
310
|
+
displayOptions: {
|
|
311
|
+
show: {
|
|
312
|
+
resource: ['task'],
|
|
313
|
+
operation: ['updateTask'],
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
description: 'New title for the task',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
displayName: 'Description',
|
|
320
|
+
name: 'description',
|
|
321
|
+
type: 'string',
|
|
322
|
+
default: '',
|
|
323
|
+
typeOptions: {
|
|
324
|
+
rows: 4,
|
|
325
|
+
},
|
|
326
|
+
displayOptions: {
|
|
327
|
+
show: {
|
|
328
|
+
resource: ['task'],
|
|
329
|
+
operation: ['createTask', 'updateTask'],
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
description: 'Description of the task',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
displayName: 'Search',
|
|
336
|
+
name: 'search',
|
|
337
|
+
type: 'string',
|
|
338
|
+
default: '',
|
|
339
|
+
displayOptions: {
|
|
340
|
+
show: {
|
|
341
|
+
resource: ['task'],
|
|
342
|
+
operation: ['listTasks'],
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
description: 'Search tasks by title',
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
displayName: 'Priority',
|
|
349
|
+
name: 'priority',
|
|
350
|
+
type: 'options',
|
|
351
|
+
default: 'medium',
|
|
352
|
+
displayOptions: {
|
|
353
|
+
show: {
|
|
354
|
+
resource: ['task'],
|
|
355
|
+
operation: ['createTask'],
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
options: [
|
|
359
|
+
{
|
|
360
|
+
name: 'High',
|
|
361
|
+
value: 'high',
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: 'Low',
|
|
365
|
+
value: 'low',
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: 'Medium',
|
|
369
|
+
value: 'medium',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: 'Urgent',
|
|
373
|
+
value: 'urgent',
|
|
374
|
+
},
|
|
375
|
+
],
|
|
376
|
+
description: 'Priority of the task',
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: 'Priority',
|
|
380
|
+
name: 'priority',
|
|
381
|
+
type: 'options',
|
|
382
|
+
default: '',
|
|
383
|
+
displayOptions: {
|
|
384
|
+
show: {
|
|
385
|
+
resource: ['task'],
|
|
386
|
+
operation: ['listTasks'],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
options: [
|
|
390
|
+
{
|
|
391
|
+
name: 'Any',
|
|
392
|
+
value: '',
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'High',
|
|
396
|
+
value: 'high',
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'Low',
|
|
400
|
+
value: 'low',
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: 'Medium',
|
|
404
|
+
value: 'medium',
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
name: 'Urgent',
|
|
408
|
+
value: 'urgent',
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
description: 'Filter by priority',
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
displayName: 'Priority',
|
|
415
|
+
name: 'priority',
|
|
416
|
+
type: 'options',
|
|
417
|
+
default: '',
|
|
418
|
+
displayOptions: {
|
|
419
|
+
show: {
|
|
420
|
+
resource: ['task'],
|
|
421
|
+
operation: ['updateTask'],
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
options: [
|
|
425
|
+
{
|
|
426
|
+
name: 'Any',
|
|
427
|
+
value: '',
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
name: 'High',
|
|
431
|
+
value: 'high',
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
name: 'Low',
|
|
435
|
+
value: 'low',
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: 'Medium',
|
|
439
|
+
value: 'medium',
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
name: 'Urgent',
|
|
443
|
+
value: 'urgent',
|
|
444
|
+
},
|
|
445
|
+
],
|
|
446
|
+
description: 'New priority for the task',
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
displayName: 'Type',
|
|
450
|
+
name: 'type',
|
|
451
|
+
type: 'options',
|
|
452
|
+
default: 'task',
|
|
453
|
+
displayOptions: {
|
|
454
|
+
show: {
|
|
455
|
+
resource: ['task'],
|
|
456
|
+
operation: ['createTask'],
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
options: [
|
|
460
|
+
{
|
|
461
|
+
name: 'Bug',
|
|
462
|
+
value: 'bug',
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: 'Epic',
|
|
466
|
+
value: 'epic',
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
name: 'Story',
|
|
470
|
+
value: 'story',
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: 'Task',
|
|
474
|
+
value: 'task',
|
|
475
|
+
},
|
|
476
|
+
],
|
|
477
|
+
description: 'Type of the task',
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
displayName: 'Type',
|
|
481
|
+
name: 'type',
|
|
482
|
+
type: 'options',
|
|
483
|
+
default: '',
|
|
484
|
+
displayOptions: {
|
|
485
|
+
show: {
|
|
486
|
+
resource: ['task'],
|
|
487
|
+
operation: ['listTasks'],
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
options: [
|
|
491
|
+
{
|
|
492
|
+
name: 'Any',
|
|
493
|
+
value: '',
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: 'Bug',
|
|
497
|
+
value: 'bug',
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: 'Epic',
|
|
501
|
+
value: 'epic',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: 'Story',
|
|
505
|
+
value: 'story',
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: 'Task',
|
|
509
|
+
value: 'task',
|
|
510
|
+
},
|
|
511
|
+
],
|
|
512
|
+
description: 'Filter by task type',
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
displayName: 'Type',
|
|
516
|
+
name: 'type',
|
|
517
|
+
type: 'options',
|
|
518
|
+
default: '',
|
|
519
|
+
displayOptions: {
|
|
520
|
+
show: {
|
|
521
|
+
resource: ['task'],
|
|
522
|
+
operation: ['updateTask'],
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
options: [
|
|
526
|
+
{
|
|
527
|
+
name: 'Any',
|
|
528
|
+
value: '',
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: 'Bug',
|
|
532
|
+
value: 'bug',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
name: 'Epic',
|
|
536
|
+
value: 'epic',
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: 'Story',
|
|
540
|
+
value: 'story',
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
name: 'Task',
|
|
544
|
+
value: 'task',
|
|
545
|
+
},
|
|
546
|
+
],
|
|
547
|
+
description: 'New type for the task',
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
displayName: 'Assignee ID',
|
|
551
|
+
name: 'assignee_id',
|
|
552
|
+
type: 'string',
|
|
553
|
+
default: '',
|
|
554
|
+
displayOptions: {
|
|
555
|
+
show: {
|
|
556
|
+
resource: ['task'],
|
|
557
|
+
operation: ['createTask', 'listTasks', 'updateTask'],
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
description: 'Assignee UUID used for filtering or assignment',
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
displayName: 'Column ID',
|
|
564
|
+
name: 'column_id',
|
|
565
|
+
type: 'string',
|
|
566
|
+
default: '',
|
|
567
|
+
displayOptions: {
|
|
568
|
+
show: {
|
|
569
|
+
resource: ['task'],
|
|
570
|
+
operation: ['createTask', 'updateTask'],
|
|
571
|
+
},
|
|
572
|
+
},
|
|
573
|
+
description: 'Column UUID for the task',
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
displayName: 'Sprint ID',
|
|
577
|
+
name: 'sprint_id',
|
|
578
|
+
type: 'string',
|
|
579
|
+
default: '',
|
|
580
|
+
displayOptions: {
|
|
581
|
+
show: {
|
|
582
|
+
resource: ['task'],
|
|
583
|
+
operation: ['createTask', 'updateTask'],
|
|
584
|
+
},
|
|
585
|
+
},
|
|
586
|
+
description: 'Sprint UUID for the task',
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
displayName: 'Due Date',
|
|
590
|
+
name: 'due_date',
|
|
591
|
+
type: 'string',
|
|
592
|
+
default: '',
|
|
593
|
+
placeholder: '2026-07-01',
|
|
594
|
+
displayOptions: {
|
|
595
|
+
show: {
|
|
596
|
+
resource: ['task'],
|
|
597
|
+
operation: ['createTask', 'updateTask'],
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
description: 'Due date in YYYY-MM-DD format',
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
displayName: 'Points',
|
|
604
|
+
name: 'points',
|
|
605
|
+
type: 'string',
|
|
606
|
+
default: '',
|
|
607
|
+
displayOptions: {
|
|
608
|
+
show: {
|
|
609
|
+
resource: ['task'],
|
|
610
|
+
operation: ['createTask', 'updateTask'],
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
description: 'Numeric story points for the task',
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
displayName: 'Is Completed',
|
|
617
|
+
name: 'is_completed',
|
|
618
|
+
type: 'options',
|
|
619
|
+
default: '',
|
|
620
|
+
displayOptions: {
|
|
621
|
+
show: {
|
|
622
|
+
resource: ['task'],
|
|
623
|
+
operation: ['updateTask'],
|
|
624
|
+
},
|
|
625
|
+
},
|
|
626
|
+
options: [
|
|
627
|
+
{
|
|
628
|
+
name: 'Any',
|
|
629
|
+
value: '',
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: 'False',
|
|
633
|
+
value: false,
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
name: 'True',
|
|
637
|
+
value: true,
|
|
638
|
+
},
|
|
639
|
+
],
|
|
640
|
+
description: 'Whether the task is completed',
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
displayName: 'Connector Fields',
|
|
644
|
+
name: 'connector_fields',
|
|
645
|
+
type: 'collection',
|
|
646
|
+
placeholder: 'Add Connector Field',
|
|
647
|
+
default: {},
|
|
648
|
+
displayOptions: {
|
|
649
|
+
show: {
|
|
650
|
+
resource: ['task'],
|
|
651
|
+
operation: ['createTask', 'updateTask'],
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
options: [
|
|
655
|
+
{
|
|
656
|
+
displayName: 'BOS Category ID',
|
|
657
|
+
name: 'daily_task_category_id',
|
|
658
|
+
type: 'string',
|
|
659
|
+
default: '',
|
|
660
|
+
description: 'BOS daily task category remote ID',
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
displayName: 'BOS Type ID',
|
|
664
|
+
name: 'daily_task_type_id',
|
|
665
|
+
type: 'string',
|
|
666
|
+
default: '',
|
|
667
|
+
description: 'BOS daily task type remote ID',
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
displayName: 'Objective ID',
|
|
671
|
+
name: 'objective_id',
|
|
672
|
+
type: 'string',
|
|
673
|
+
default: '',
|
|
674
|
+
description: 'BOS objective remote ID',
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
displayName: 'Key Results',
|
|
678
|
+
name: 'key_results',
|
|
679
|
+
type: 'string',
|
|
680
|
+
default: '',
|
|
681
|
+
description: 'Comma-separated BOS key result remote IDs',
|
|
682
|
+
},
|
|
683
|
+
],
|
|
684
|
+
description: 'BOS connector fields required when BOS is enabled',
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
displayName: 'Per Page',
|
|
688
|
+
name: 'per_page',
|
|
689
|
+
type: 'number',
|
|
690
|
+
default: 20,
|
|
691
|
+
typeOptions: {
|
|
692
|
+
minValue: 1,
|
|
693
|
+
maxValue: 100,
|
|
694
|
+
},
|
|
695
|
+
displayOptions: {
|
|
696
|
+
show: {
|
|
697
|
+
resource: ['task'],
|
|
698
|
+
operation: ['listTasks'],
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
description: 'Items per page',
|
|
702
|
+
},
|
|
703
|
+
],
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
async execute() {
|
|
707
|
+
const credentials = (await this.getCredentials(credentialName));
|
|
708
|
+
const baseUrl = String(credentials.baseUrl || '').replace(/\/+$/, '');
|
|
709
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
710
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
711
|
+
if (!baseUrl) {
|
|
712
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Keloola Workspace API Base URL is required');
|
|
713
|
+
}
|
|
714
|
+
let url = '';
|
|
715
|
+
let method = 'GET';
|
|
716
|
+
const query = {};
|
|
717
|
+
const body = {};
|
|
718
|
+
if (resource === 'workspace') {
|
|
719
|
+
if (operation === 'getAll') {
|
|
720
|
+
query.page = this.getNodeParameter('page', 0);
|
|
721
|
+
query.per_page = this.getNodeParameter('perPage', 0);
|
|
722
|
+
const search = this.getNodeParameter('search', 0);
|
|
723
|
+
if (search) {
|
|
724
|
+
query.search = search;
|
|
725
|
+
}
|
|
726
|
+
url = `${baseUrl}/workspaces`;
|
|
727
|
+
}
|
|
728
|
+
if (operation === 'get') {
|
|
729
|
+
const workspaceId = this.getNodeParameter('workspaceId', 0);
|
|
730
|
+
url = `${baseUrl}/workspaces/${encodeURIComponent(workspaceId)}`;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (resource === 'note') {
|
|
734
|
+
if (operation === 'createNote') {
|
|
735
|
+
const title = this.getNodeParameter('title', 0);
|
|
736
|
+
const content = this.getNodeParameter('content', 0);
|
|
737
|
+
if (!title) {
|
|
738
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Title is required');
|
|
739
|
+
}
|
|
740
|
+
if (!content) {
|
|
741
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Content is required');
|
|
742
|
+
}
|
|
743
|
+
body.title = title;
|
|
744
|
+
body.content = content;
|
|
745
|
+
const projectId = this.getNodeParameter('project_id', 0);
|
|
746
|
+
if (projectId) {
|
|
747
|
+
body.project_id = projectId;
|
|
748
|
+
}
|
|
749
|
+
method = 'POST';
|
|
750
|
+
url = `${baseUrl}/notes`;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (resource === 'task') {
|
|
754
|
+
if (operation === 'createTask') {
|
|
755
|
+
const projectId = this.getNodeParameter('project_id', 0);
|
|
756
|
+
const title = this.getNodeParameter('title', 0);
|
|
757
|
+
if (!projectId) {
|
|
758
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Project ID is required');
|
|
759
|
+
}
|
|
760
|
+
if (!title) {
|
|
761
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Title is required');
|
|
762
|
+
}
|
|
763
|
+
body.project_id = projectId;
|
|
764
|
+
body.title = title;
|
|
765
|
+
body.priority = this.getNodeParameter('priority', 0);
|
|
766
|
+
body.type = this.getNodeParameter('type', 0);
|
|
767
|
+
const description = this.getNodeParameter('description', 0);
|
|
768
|
+
if (description) {
|
|
769
|
+
body.description = description;
|
|
770
|
+
}
|
|
771
|
+
const assigneeId = this.getNodeParameter('assignee_id', 0);
|
|
772
|
+
if (assigneeId) {
|
|
773
|
+
body.assignee_id = assigneeId;
|
|
774
|
+
}
|
|
775
|
+
const columnId = this.getNodeParameter('column_id', 0);
|
|
776
|
+
if (columnId) {
|
|
777
|
+
body.column_id = columnId;
|
|
778
|
+
}
|
|
779
|
+
const sprintId = this.getNodeParameter('sprint_id', 0);
|
|
780
|
+
if (sprintId) {
|
|
781
|
+
body.sprint_id = sprintId;
|
|
782
|
+
}
|
|
783
|
+
const dueDate = this.getNodeParameter('due_date', 0);
|
|
784
|
+
if (dueDate) {
|
|
785
|
+
body.due_date = dueDate;
|
|
786
|
+
}
|
|
787
|
+
const points = this.getNodeParameter('points', 0);
|
|
788
|
+
if (points) {
|
|
789
|
+
body.points = Number(points);
|
|
790
|
+
}
|
|
791
|
+
const connectorFields = this.getNodeParameter('connector_fields', 0, {});
|
|
792
|
+
const connectorFieldsBody = buildConnectorFields(connectorFields);
|
|
793
|
+
if (Object.keys(connectorFieldsBody).length) {
|
|
794
|
+
body.connector_fields = connectorFieldsBody;
|
|
795
|
+
}
|
|
796
|
+
method = 'POST';
|
|
797
|
+
url = `${baseUrl}/tasks`;
|
|
798
|
+
}
|
|
799
|
+
if (operation === 'deleteTask') {
|
|
800
|
+
const taskId = this.getNodeParameter('task_id', 0);
|
|
801
|
+
if (!taskId) {
|
|
802
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Task ID is required');
|
|
803
|
+
}
|
|
804
|
+
method = 'DELETE';
|
|
805
|
+
url = `${baseUrl}/tasks/${encodeURIComponent(taskId)}`;
|
|
806
|
+
}
|
|
807
|
+
if (operation === 'getTaskDetail') {
|
|
808
|
+
const taskId = this.getNodeParameter('task_id', 0);
|
|
809
|
+
if (!taskId) {
|
|
810
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Task ID is required');
|
|
811
|
+
}
|
|
812
|
+
url = `${baseUrl}/tasks/${encodeURIComponent(taskId)}`;
|
|
813
|
+
}
|
|
814
|
+
if (operation === 'updateTask') {
|
|
815
|
+
const taskId = this.getNodeParameter('task_id', 0);
|
|
816
|
+
if (!taskId) {
|
|
817
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Task ID is required');
|
|
818
|
+
}
|
|
819
|
+
const title = this.getNodeParameter('title', 0, '');
|
|
820
|
+
if (title) {
|
|
821
|
+
body.title = title;
|
|
822
|
+
}
|
|
823
|
+
const description = this.getNodeParameter('description', 0, '');
|
|
824
|
+
if (description) {
|
|
825
|
+
body.description = description;
|
|
826
|
+
}
|
|
827
|
+
const priority = this.getNodeParameter('priority', 0, '');
|
|
828
|
+
if (priority) {
|
|
829
|
+
body.priority = priority;
|
|
830
|
+
}
|
|
831
|
+
const type = this.getNodeParameter('type', 0, '');
|
|
832
|
+
if (type) {
|
|
833
|
+
body.type = type;
|
|
834
|
+
}
|
|
835
|
+
const assigneeId = this.getNodeParameter('assignee_id', 0, '');
|
|
836
|
+
if (assigneeId) {
|
|
837
|
+
body.assignee_id = assigneeId;
|
|
838
|
+
}
|
|
839
|
+
const columnId = this.getNodeParameter('column_id', 0, '');
|
|
840
|
+
if (columnId) {
|
|
841
|
+
body.column_id = columnId;
|
|
842
|
+
}
|
|
843
|
+
const sprintId = this.getNodeParameter('sprint_id', 0, '');
|
|
844
|
+
if (sprintId) {
|
|
845
|
+
body.sprint_id = sprintId;
|
|
846
|
+
}
|
|
847
|
+
const dueDate = this.getNodeParameter('due_date', 0, '');
|
|
848
|
+
if (dueDate) {
|
|
849
|
+
body.due_date = dueDate;
|
|
850
|
+
}
|
|
851
|
+
const points = this.getNodeParameter('points', 0, '');
|
|
852
|
+
if (points) {
|
|
853
|
+
body.points = Number(points);
|
|
854
|
+
}
|
|
855
|
+
const isCompleted = this.getNodeParameter('is_completed', 0, '');
|
|
856
|
+
if (isCompleted !== '') {
|
|
857
|
+
body.is_completed = isCompleted === true || isCompleted === 'true';
|
|
858
|
+
}
|
|
859
|
+
const connectorFields = this.getNodeParameter('connector_fields', 0, {});
|
|
860
|
+
const connectorFieldsBody = buildConnectorFields(connectorFields);
|
|
861
|
+
if (Object.keys(connectorFieldsBody).length) {
|
|
862
|
+
body.connector_fields = connectorFieldsBody;
|
|
863
|
+
}
|
|
864
|
+
if (!Object.keys(body).length) {
|
|
865
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one field is required to update a task');
|
|
866
|
+
}
|
|
867
|
+
method = 'PUT';
|
|
868
|
+
url = `${baseUrl}/tasks/${encodeURIComponent(taskId)}`;
|
|
869
|
+
}
|
|
870
|
+
if (operation === 'listTasks') {
|
|
871
|
+
const projectId = this.getNodeParameter('project_id', 0);
|
|
872
|
+
if (!projectId) {
|
|
873
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Project ID is required');
|
|
874
|
+
}
|
|
875
|
+
query.project_id = projectId;
|
|
876
|
+
query.per_page = this.getNodeParameter('per_page', 0);
|
|
877
|
+
const search = this.getNodeParameter('search', 0);
|
|
878
|
+
if (search) {
|
|
879
|
+
query.search = search;
|
|
880
|
+
}
|
|
881
|
+
const priority = this.getNodeParameter('priority', 0);
|
|
882
|
+
if (priority) {
|
|
883
|
+
query.priority = priority;
|
|
884
|
+
}
|
|
885
|
+
const type = this.getNodeParameter('type', 0);
|
|
886
|
+
if (type) {
|
|
887
|
+
query.type = type;
|
|
888
|
+
}
|
|
889
|
+
const assigneeId = this.getNodeParameter('assignee_id', 0);
|
|
890
|
+
if (assigneeId) {
|
|
891
|
+
query.assignee_id = assigneeId;
|
|
892
|
+
}
|
|
893
|
+
url = `${baseUrl}/tasks`;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
if (!url) {
|
|
897
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No operation found for ${resource}`);
|
|
898
|
+
}
|
|
899
|
+
try {
|
|
900
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, credentialName, {
|
|
901
|
+
method,
|
|
902
|
+
url,
|
|
903
|
+
qs: query,
|
|
904
|
+
body: Object.keys(body).length ? body : undefined,
|
|
905
|
+
headers: {
|
|
906
|
+
'Accept-Language': 'en',
|
|
907
|
+
},
|
|
908
|
+
json: true,
|
|
909
|
+
});
|
|
910
|
+
return [this.helpers.returnJsonArray(response)];
|
|
911
|
+
}
|
|
912
|
+
catch (error) {
|
|
913
|
+
if (error.response) {
|
|
914
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${JSON.stringify(error.response.data || error.message)}`, {
|
|
915
|
+
description: `Status: ${error.response.status}\nMethod: ${method}\nURL: ${url}\nQuery: ${JSON.stringify(query, null, 2)}\nBody: ${JSON.stringify(body, null, 2)}`,
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
throw error;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
exports.KeloolaWorkspace = KeloolaWorkspace;
|
|
923
|
+
//# sourceMappingURL=KeloolaWorkspace.node.js.map
|