n8n-nodes-base-wework 1.0.4 → 1.0.6

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.
@@ -107,10 +107,22 @@ class BaseWework {
107
107
  action: 'Create a task',
108
108
  },
109
109
  {
110
- name: 'Edit',
110
+ name: 'Create Subtask',
111
+ value: 'createSubtask',
112
+ description: 'Create a new subtask under a parent task',
113
+ action: 'Create a subtask',
114
+ },
115
+ {
116
+ name: 'Edit Basic Info',
111
117
  value: 'edit',
112
- description: 'Edit a task',
113
- action: 'Edit a task',
118
+ description: 'Edit task basic information (name, description, etc.)',
119
+ action: 'Edit task basic info',
120
+ },
121
+ {
122
+ name: 'Edit Extra',
123
+ value: 'editExtra',
124
+ description: 'Edit task deadline, start time and status',
125
+ action: 'Edit task extra info',
114
126
  },
115
127
  {
116
128
  name: 'Get',
@@ -185,11 +197,105 @@ class BaseWework {
185
197
  displayOptions: {
186
198
  show: {
187
199
  resource: ['project'],
188
- operation: ['create', 'edit', 'getFull'],
200
+ operation: ['create', 'edit'],
189
201
  },
190
202
  },
191
203
  default: '',
192
- description: 'Username of the editor (e.g., @admin)',
204
+ description: 'Username of the creator (e.g., @admin)',
205
+ },
206
+ {
207
+ displayName: 'Metatype',
208
+ name: 'metatype',
209
+ type: 'options',
210
+ required: true,
211
+ options: [
212
+ {
213
+ name: 'Project',
214
+ value: 'project',
215
+ },
216
+ {
217
+ name: 'Team',
218
+ value: 'team',
219
+ },
220
+ ],
221
+ displayOptions: {
222
+ show: {
223
+ resource: ['project'],
224
+ operation: ['create'],
225
+ },
226
+ },
227
+ default: 'project',
228
+ description: 'Type: "project" or "team"',
229
+ },
230
+ {
231
+ displayName: 'Name',
232
+ name: 'name',
233
+ type: 'string',
234
+ required: true,
235
+ displayOptions: {
236
+ show: {
237
+ resource: ['project'],
238
+ operation: ['create'],
239
+ },
240
+ },
241
+ default: '',
242
+ description: 'Project name',
243
+ },
244
+ {
245
+ displayName: 'External',
246
+ name: 'external',
247
+ type: 'options',
248
+ required: true,
249
+ options: [
250
+ {
251
+ name: 'Inhouse',
252
+ value: '0',
253
+ },
254
+ {
255
+ name: 'Work with Guest',
256
+ value: '1',
257
+ },
258
+ ],
259
+ displayOptions: {
260
+ show: {
261
+ resource: ['project'],
262
+ operation: ['create'],
263
+ },
264
+ },
265
+ default: '0',
266
+ description: '0: Inhouse, 1: Work with guest',
267
+ },
268
+ {
269
+ displayName: 'Owners',
270
+ name: 'owners',
271
+ type: 'string',
272
+ required: true,
273
+ displayOptions: {
274
+ show: {
275
+ resource: ['project'],
276
+ operation: ['create'],
277
+ },
278
+ },
279
+ default: '',
280
+ placeholder: '@admin',
281
+ description: 'List of usernames to add as managers (comma separated if multiple)',
282
+ },
283
+ {
284
+ displayName: 'Content',
285
+ name: 'content',
286
+ type: 'string',
287
+ required: true,
288
+ displayOptions: {
289
+ show: {
290
+ resource: ['project'],
291
+ operation: ['create'],
292
+ },
293
+ },
294
+ default: '',
295
+ typeOptions: {
296
+ rows: 4,
297
+ },
298
+ description: 'Content/description of the project',
193
299
  },
194
300
  {
195
301
  displayName: 'Project ID',
@@ -218,12 +324,51 @@ class BaseWework {
218
324
  },
219
325
  },
220
326
  options: [
327
+ {
328
+ displayName: 'Teams',
329
+ name: 'teams',
330
+ type: 'string',
331
+ default: '',
332
+ placeholder: '@product',
333
+ description: 'List of teams to add as members (comma separated if multiple)',
334
+ },
335
+ {
336
+ displayName: 'Followers',
337
+ name: 'followers',
338
+ type: 'string',
339
+ default: '',
340
+ placeholder: '@user1, @user2',
341
+ description: 'List of usernames to add as followers (comma separated if multiple)',
342
+ },
343
+ {
344
+ displayName: 'Start Time',
345
+ name: 'stime',
346
+ type: 'string',
347
+ default: '',
348
+ placeholder: '01/01/2021',
349
+ description: 'Start date in format dd/mm/YYYY',
350
+ },
351
+ {
352
+ displayName: 'End Time',
353
+ name: 'etime',
354
+ type: 'string',
355
+ default: '',
356
+ placeholder: '31/12/2021',
357
+ description: 'End date in format dd/mm/YYYY',
358
+ },
359
+ {
360
+ displayName: 'Department ID',
361
+ name: 'dept_id',
362
+ type: 'string',
363
+ default: '',
364
+ description: 'ID of the department',
365
+ },
221
366
  {
222
367
  displayName: 'Name',
223
368
  name: 'name',
224
369
  type: 'string',
225
370
  default: '',
226
- description: 'Project name',
371
+ description: 'Project name (for Edit operation)',
227
372
  },
228
373
  {
229
374
  displayName: 'Description',
@@ -237,6 +382,20 @@ class BaseWework {
237
382
  },
238
383
  ],
239
384
  },
385
+ {
386
+ displayName: 'Task ID',
387
+ name: 'id',
388
+ type: 'string',
389
+ required: true,
390
+ displayOptions: {
391
+ show: {
392
+ resource: ['task'],
393
+ operation: ['edit', 'editExtra', 'get', 'markDone'],
394
+ },
395
+ },
396
+ default: '',
397
+ description: 'ID of the task',
398
+ },
240
399
  {
241
400
  displayName: 'Username',
242
401
  name: 'username',
@@ -245,40 +404,100 @@ class BaseWework {
245
404
  displayOptions: {
246
405
  show: {
247
406
  resource: ['task'],
248
- operation: ['create', 'edit', 'markDone'],
407
+ operation: ['create', 'createSubtask', 'edit', 'editExtra', 'markDone'],
249
408
  },
250
409
  },
251
410
  default: '',
252
- description: 'Username of the editor',
411
+ description: 'Username of the creator',
253
412
  },
254
413
  {
255
- displayName: 'Task ID',
256
- name: 'id',
414
+ displayName: 'Parent Task ID',
415
+ name: 'parent_id',
257
416
  type: 'string',
258
417
  required: true,
259
418
  displayOptions: {
260
419
  show: {
261
420
  resource: ['task'],
262
- operation: ['edit', 'get', 'markDone'],
421
+ operation: ['createSubtask'],
263
422
  },
264
423
  },
265
424
  default: '',
266
- description: 'ID of the task',
425
+ description: 'ID of the parent task',
267
426
  },
268
427
  {
269
428
  displayName: 'Project ID',
270
- name: 'project_id',
429
+ name: 'id',
271
430
  type: 'string',
272
431
  required: true,
273
432
  displayOptions: {
274
433
  show: {
275
434
  resource: ['task'],
276
- operation: ['create', 'project'],
435
+ operation: ['create', 'createSubtask', 'project'],
277
436
  },
278
437
  },
279
438
  default: '',
280
439
  description: 'ID of the project',
281
440
  },
441
+ {
442
+ displayName: 'Tasklist ID',
443
+ name: 'tasklist_id',
444
+ type: 'string',
445
+ required: true,
446
+ displayOptions: {
447
+ show: {
448
+ resource: ['task'],
449
+ operation: ['create', 'createSubtask'],
450
+ },
451
+ },
452
+ default: '',
453
+ description: 'ID of the tasklist',
454
+ },
455
+ {
456
+ displayName: 'Name',
457
+ name: 'name',
458
+ type: 'string',
459
+ required: true,
460
+ displayOptions: {
461
+ show: {
462
+ resource: ['task'],
463
+ operation: ['create', 'createSubtask'],
464
+ },
465
+ },
466
+ default: '',
467
+ description: 'Task name',
468
+ },
469
+ {
470
+ displayName: 'Content',
471
+ name: 'content',
472
+ type: 'string',
473
+ required: true,
474
+ displayOptions: {
475
+ show: {
476
+ resource: ['task'],
477
+ operation: ['create', 'createSubtask'],
478
+ },
479
+ },
480
+ default: '',
481
+ typeOptions: {
482
+ rows: 4,
483
+ },
484
+ description: 'Task description/content',
485
+ },
486
+ {
487
+ displayName: 'Assign',
488
+ name: 'assign',
489
+ type: 'string',
490
+ required: true,
491
+ displayOptions: {
492
+ show: {
493
+ resource: ['task'],
494
+ operation: ['create', 'createSubtask'],
495
+ },
496
+ },
497
+ default: '',
498
+ placeholder: '@hungkien',
499
+ description: 'Username of assignee',
500
+ },
282
501
  {
283
502
  displayName: 'Username',
284
503
  name: 'username',
@@ -293,6 +512,232 @@ class BaseWework {
293
512
  default: '',
294
513
  description: 'Username of the editor',
295
514
  },
515
+ {
516
+ displayName: 'Return All',
517
+ name: 'returnAll',
518
+ type: 'boolean',
519
+ displayOptions: {
520
+ show: {
521
+ resource: ['task'],
522
+ operation: ['project'],
523
+ },
524
+ },
525
+ default: false,
526
+ description: 'Whether to return all results or only up to a given limit',
527
+ },
528
+ {
529
+ displayName: 'Limit',
530
+ name: 'limit',
531
+ type: 'number',
532
+ displayOptions: {
533
+ show: {
534
+ resource: ['task'],
535
+ operation: ['project'],
536
+ returnAll: [false],
537
+ },
538
+ },
539
+ typeOptions: {
540
+ minValue: 1,
541
+ maxValue: 500,
542
+ },
543
+ default: 100,
544
+ description: 'Max number of results to return',
545
+ },
546
+ {
547
+ displayName: 'Name',
548
+ name: 'name',
549
+ type: 'string',
550
+ displayOptions: {
551
+ show: {
552
+ resource: ['task'],
553
+ operation: ['edit'],
554
+ },
555
+ },
556
+ default: '',
557
+ description: 'Task name',
558
+ },
559
+ {
560
+ displayName: 'Description',
561
+ name: 'description',
562
+ type: 'string',
563
+ typeOptions: {
564
+ rows: 4,
565
+ },
566
+ displayOptions: {
567
+ show: {
568
+ resource: ['task'],
569
+ operation: ['edit'],
570
+ },
571
+ },
572
+ default: '',
573
+ description: 'Task description',
574
+ },
575
+ {
576
+ displayName: 'Followers',
577
+ name: 'followers',
578
+ type: 'string',
579
+ displayOptions: {
580
+ show: {
581
+ resource: ['task'],
582
+ operation: ['edit'],
583
+ },
584
+ },
585
+ default: '',
586
+ placeholder: '@giangchu',
587
+ description: 'List of followers (comma separated)',
588
+ },
589
+ {
590
+ displayName: 'Has Deadline',
591
+ name: 'has_deadline',
592
+ type: 'options',
593
+ options: [
594
+ { name: 'No', value: '0' },
595
+ { name: 'Yes', value: '1' },
596
+ ],
597
+ displayOptions: {
598
+ show: {
599
+ resource: ['task'],
600
+ operation: ['edit'],
601
+ },
602
+ },
603
+ default: '',
604
+ description: 'Whether task has deadline',
605
+ },
606
+ {
607
+ displayName: 'Deadline',
608
+ name: 'deadline',
609
+ type: 'string',
610
+ displayOptions: {
611
+ show: {
612
+ resource: ['task'],
613
+ operation: ['editExtra'],
614
+ },
615
+ },
616
+ default: '',
617
+ placeholder: '20/05/2020',
618
+ description: 'Deadline date (format dd/mm/YYYY)',
619
+ },
620
+ {
621
+ displayName: 'Deadline Time',
622
+ name: 'deadline-time',
623
+ type: 'string',
624
+ displayOptions: {
625
+ show: {
626
+ resource: ['task'],
627
+ operation: ['edit'],
628
+ },
629
+ },
630
+ default: '',
631
+ placeholder: '15:45',
632
+ description: 'Deadline time (format HH:MM)',
633
+ },
634
+ {
635
+ displayName: 'Status',
636
+ name: 'status',
637
+ type: 'options',
638
+ options: [
639
+ { name: 'Not Started', value: '0' },
640
+ { name: 'Started', value: '1' },
641
+ ],
642
+ displayOptions: {
643
+ show: {
644
+ resource: ['task'],
645
+ operation: ['editExtra'],
646
+ },
647
+ },
648
+ default: '',
649
+ description: 'Task status',
650
+ },
651
+ {
652
+ displayName: 'Start Time',
653
+ name: 'start_time',
654
+ type: 'string',
655
+ displayOptions: {
656
+ show: {
657
+ resource: ['task'],
658
+ operation: ['editExtra'],
659
+ },
660
+ },
661
+ default: '',
662
+ placeholder: '22/05/2020',
663
+ description: 'Start date (format dd/mm/YYYY)',
664
+ },
665
+ {
666
+ displayName: 'Tags',
667
+ name: 'tags',
668
+ type: 'string',
669
+ displayOptions: {
670
+ show: {
671
+ resource: ['task'],
672
+ operation: ['edit'],
673
+ },
674
+ },
675
+ default: '',
676
+ placeholder: 'base,wework,workflow',
677
+ description: 'Tags (comma separated)',
678
+ },
679
+ {
680
+ displayName: 'Urgent',
681
+ name: 'urgent',
682
+ type: 'options',
683
+ options: [
684
+ { name: 'Normal', value: '0' },
685
+ { name: 'Urgent', value: '1' },
686
+ ],
687
+ displayOptions: {
688
+ show: {
689
+ resource: ['task'],
690
+ operation: ['edit'],
691
+ },
692
+ },
693
+ default: '',
694
+ description: 'Task priority',
695
+ },
696
+ {
697
+ displayName: 'Deadline',
698
+ name: 'deadline',
699
+ type: 'string',
700
+ displayOptions: {
701
+ show: {
702
+ resource: ['task'],
703
+ operation: ['editExtra'],
704
+ },
705
+ },
706
+ default: '',
707
+ placeholder: '20/05/2020',
708
+ description: 'Deadline date (format dd/mm/YYYY)',
709
+ },
710
+ {
711
+ displayName: 'Status',
712
+ name: 'status',
713
+ type: 'options',
714
+ options: [
715
+ { name: 'Not Started', value: '0' },
716
+ { name: 'Started', value: '1' },
717
+ ],
718
+ displayOptions: {
719
+ show: {
720
+ resource: ['task'],
721
+ operation: ['editExtra'],
722
+ },
723
+ },
724
+ default: '',
725
+ description: 'Task status',
726
+ },
727
+ {
728
+ displayName: 'Start Time',
729
+ name: 'start_time',
730
+ type: 'string',
731
+ displayOptions: {
732
+ show: {
733
+ resource: ['task'],
734
+ operation: ['editExtra'],
735
+ },
736
+ },
737
+ default: '',
738
+ placeholder: '22/05/2020',
739
+ description: 'Start date (format dd/mm/YYYY)',
740
+ },
296
741
  {
297
742
  displayName: 'Additional Fields',
298
743
  name: 'additionalFields',
@@ -302,33 +747,82 @@ class BaseWework {
302
747
  displayOptions: {
303
748
  show: {
304
749
  resource: ['task'],
305
- operation: ['create', 'edit'],
750
+ operation: ['create', 'createSubtask'],
306
751
  },
307
752
  },
308
753
  options: [
309
754
  {
310
- displayName: 'Name',
311
- name: 'name',
755
+ displayName: 'Followers',
756
+ name: 'followers',
312
757
  type: 'string',
313
758
  default: '',
314
- description: 'Task name',
759
+ placeholder: '@giangchu',
760
+ description: 'List of followers (comma separated)',
315
761
  },
316
762
  {
317
- displayName: 'Description',
318
- name: 'description',
763
+ displayName: 'Has Deadline',
764
+ name: 'has_deadline',
765
+ type: 'options',
766
+ options: [
767
+ { name: 'No', value: '0' },
768
+ { name: 'Yes', value: '1' },
769
+ ],
770
+ default: '0',
771
+ description: 'Whether task has deadline',
772
+ },
773
+ {
774
+ displayName: 'Deadline',
775
+ name: 'deadline',
776
+ type: 'string',
777
+ default: '',
778
+ placeholder: '20/05/2020',
779
+ description: 'Deadline date (format dd/mm/YYYY)',
780
+ },
781
+ {
782
+ displayName: 'Deadline Time',
783
+ name: 'deadline-time',
784
+ type: 'string',
785
+ default: '',
786
+ placeholder: '15:45',
787
+ description: 'Deadline time (format HH:MM)',
788
+ },
789
+ {
790
+ displayName: 'Status',
791
+ name: 'status',
792
+ type: 'options',
793
+ options: [
794
+ { name: 'Not Started', value: '0' },
795
+ { name: 'Started', value: '1' },
796
+ ],
797
+ default: '0',
798
+ description: 'Task status',
799
+ },
800
+ {
801
+ displayName: 'Start Time',
802
+ name: 'start_time',
319
803
  type: 'string',
320
- typeOptions: {
321
- rows: 4,
322
- },
323
804
  default: '',
324
- description: 'Task description',
805
+ placeholder: '22/05/2020',
806
+ description: 'Start date (format dd/mm/YYYY)',
325
807
  },
326
808
  {
327
- displayName: 'Assignee',
328
- name: 'assignee',
809
+ displayName: 'Tags',
810
+ name: 'tags',
329
811
  type: 'string',
330
812
  default: '',
331
- description: 'Username of assignee',
813
+ placeholder: 'base,wework,workflow',
814
+ description: 'Tags (comma separated)',
815
+ },
816
+ {
817
+ displayName: 'Urgent',
818
+ name: 'urgent',
819
+ type: 'options',
820
+ options: [
821
+ { name: 'Normal', value: '0' },
822
+ { name: 'Urgent', value: '1' },
823
+ ],
824
+ default: '0',
825
+ description: 'Task priority',
332
826
  },
333
827
  ],
334
828
  },
@@ -489,6 +983,11 @@ class BaseWework {
489
983
  if (operation === 'create') {
490
984
  endpoint = '/extapi/v3/project/create';
491
985
  body.username = this.getNodeParameter('username', i);
986
+ body.metatype = this.getNodeParameter('metatype', i);
987
+ body.name = this.getNodeParameter('name', i);
988
+ body.external = this.getNodeParameter('external', i);
989
+ body.owners = this.getNodeParameter('owners', i);
990
+ body.content = this.getNodeParameter('content', i);
492
991
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
493
992
  Object.assign(body, additionalFields);
494
993
  }
@@ -501,7 +1000,6 @@ class BaseWework {
501
1000
  }
502
1001
  else if (operation === 'getFull') {
503
1002
  endpoint = '/extapi/v3/project/get.full';
504
- body.username = this.getNodeParameter('username', i);
505
1003
  body.id = this.getNodeParameter('id', i);
506
1004
  }
507
1005
  else if (operation === 'list') {
@@ -512,17 +1010,60 @@ class BaseWework {
512
1010
  if (operation === 'create') {
513
1011
  endpoint = '/extapi/v3/task/create';
514
1012
  body.username = this.getNodeParameter('username', i);
515
- body.project_id = this.getNodeParameter('project_id', i);
1013
+ body.id = this.getNodeParameter('id', i);
1014
+ body.tasklist_id = this.getNodeParameter('tasklist_id', i);
1015
+ body.name = this.getNodeParameter('name', i);
1016
+ body.content = this.getNodeParameter('content', i);
1017
+ body.assign = this.getNodeParameter('assign', i);
516
1018
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
517
1019
  Object.assign(body, additionalFields);
518
1020
  }
519
- else if (operation === 'edit') {
520
- endpoint = '/extapi/v3/task/edit';
1021
+ else if (operation === 'createSubtask') {
1022
+ endpoint = '/extapi/v3/subtask/create';
521
1023
  body.username = this.getNodeParameter('username', i);
1024
+ body.parent_id = this.getNodeParameter('parent_id', i);
522
1025
  body.id = this.getNodeParameter('id', i);
1026
+ body.tasklist_id = this.getNodeParameter('tasklist_id', i);
1027
+ body.name = this.getNodeParameter('name', i);
1028
+ body.content = this.getNodeParameter('content', i);
1029
+ body.assign = this.getNodeParameter('assign', i);
523
1030
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
524
1031
  Object.assign(body, additionalFields);
525
1032
  }
1033
+ else if (operation === 'edit') {
1034
+ endpoint = '/extapi/v3/task/edit';
1035
+ body.username = this.getNodeParameter('username', i);
1036
+ body.id = this.getNodeParameter('id', i);
1037
+ const name = this.getNodeParameter('name', i, '');
1038
+ const description = this.getNodeParameter('description', i, '');
1039
+ const followers = this.getNodeParameter('followers', i, '');
1040
+ const tags = this.getNodeParameter('tags', i, '');
1041
+ const urgent = this.getNodeParameter('urgent', i, '');
1042
+ if (name)
1043
+ body.name = name;
1044
+ if (description)
1045
+ body.description = description;
1046
+ if (followers)
1047
+ body.followers = followers;
1048
+ if (tags)
1049
+ body.tags = tags;
1050
+ if (urgent)
1051
+ body.urgent = urgent;
1052
+ }
1053
+ else if (operation === 'editExtra') {
1054
+ endpoint = '/extapi/v3/task/edit.extra';
1055
+ body.username = this.getNodeParameter('username', i);
1056
+ body.id = this.getNodeParameter('id', i);
1057
+ const deadline = this.getNodeParameter('deadline', i, '');
1058
+ const status = this.getNodeParameter('status', i, '');
1059
+ const startTime = this.getNodeParameter('start_time', i, '');
1060
+ if (deadline)
1061
+ body.deadline = deadline;
1062
+ if (status)
1063
+ body.status = status;
1064
+ if (startTime)
1065
+ body.start_time = startTime;
1066
+ }
526
1067
  else if (operation === 'get') {
527
1068
  endpoint = '/extapi/v3/task/get';
528
1069
  body.id = this.getNodeParameter('id', i);
@@ -530,9 +1071,50 @@ class BaseWework {
530
1071
  else if (operation === 'project') {
531
1072
  endpoint = '/extapi/v3/task/project';
532
1073
  body.username = this.getNodeParameter('username', i);
533
- body.id = this.getNodeParameter('project_id', i);
1074
+ body.id = this.getNodeParameter('id', i);
1075
+ const limit = this.getNodeParameter('limit', i);
1076
+ const returnAll = this.getNodeParameter('returnAll', i);
534
1077
  const additionalFields = this.getNodeParameter('additionalFields', i, {});
1078
+ body.limit = limit;
535
1079
  Object.assign(body, additionalFields);
1080
+ if (returnAll) {
1081
+ let allTasks = [];
1082
+ let currentPage = 0;
1083
+ let hasMore = true;
1084
+ while (hasMore) {
1085
+ body.page = currentPage;
1086
+ const formBody = [];
1087
+ for (const key in body) {
1088
+ if (body[key] !== undefined && body[key] !== null && body[key] !== '') {
1089
+ const encodedKey = encodeURIComponent(key);
1090
+ const encodedValue = encodeURIComponent(String(body[key]));
1091
+ formBody.push(`${encodedKey}=${encodedValue}`);
1092
+ }
1093
+ }
1094
+ const baseURL = `https://${credentials.domain}`;
1095
+ const fullURL = `${baseURL}${endpoint}`;
1096
+ const options = {
1097
+ method,
1098
+ url: fullURL,
1099
+ body: formBody.join('&'),
1100
+ headers: {
1101
+ 'Content-Type': 'application/x-www-form-urlencoded',
1102
+ },
1103
+ };
1104
+ const pageData = await this.helpers.httpRequest(options);
1105
+ const tasks = pageData.tasks || [];
1106
+ if (tasks.length === 0) {
1107
+ hasMore = false;
1108
+ }
1109
+ else {
1110
+ allTasks = allTasks.concat(tasks);
1111
+ currentPage++;
1112
+ }
1113
+ }
1114
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(allTasks), { itemData: { item: i } });
1115
+ returnData.push(...executionData);
1116
+ continue;
1117
+ }
536
1118
  }
537
1119
  else if (operation === 'markDone') {
538
1120
  endpoint = '/extapi/v3/task/status/mark.done';
@@ -586,7 +1168,11 @@ class BaseWework {
586
1168
  },
587
1169
  };
588
1170
  const responseData = await this.helpers.httpRequest(options);
589
- const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
1171
+ let dataToReturn = responseData;
1172
+ if (resource === 'task' && operation === 'project') {
1173
+ dataToReturn = responseData.tasks || [];
1174
+ }
1175
+ const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(dataToReturn), { itemData: { item: i } });
590
1176
  returnData.push(...executionData);
591
1177
  }
592
1178
  catch (error) {