@worktables/n8n-nodes-worktables 12.2.29 → 12.2.31
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.
|
@@ -1013,7 +1013,7 @@ class Worktables {
|
|
|
1013
1013
|
name: 'identifierColumn',
|
|
1014
1014
|
type: 'options',
|
|
1015
1015
|
typeOptions: {
|
|
1016
|
-
loadOptionsDependsOn: ['boardId'],
|
|
1016
|
+
loadOptionsDependsOn: ['boardId', 'isSubitem'],
|
|
1017
1017
|
loadOptionsMethod: 'getColumnsItemsForIdentifier',
|
|
1018
1018
|
},
|
|
1019
1019
|
default: '',
|
|
@@ -2608,28 +2608,71 @@ class Worktables {
|
|
|
2608
2608
|
});
|
|
2609
2609
|
},
|
|
2610
2610
|
async getColumnsItemsForIdentifier() {
|
|
2611
|
+
var _a, _b, _c, _d, _e;
|
|
2611
2612
|
const boardId = this.getCurrentNodeParameter('boardId');
|
|
2613
|
+
const isSubitem = this.getCurrentNodeParameter('isSubitem') || false;
|
|
2612
2614
|
const credentials = await this.getCredentials('WorktablesApi');
|
|
2613
2615
|
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
}
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2616
|
+
if (isSubitem) {
|
|
2617
|
+
let parentId = null;
|
|
2618
|
+
try {
|
|
2619
|
+
parentId = this.getCurrentNodeParameter('parentId');
|
|
2620
|
+
}
|
|
2621
|
+
catch (e) {
|
|
2622
|
+
}
|
|
2623
|
+
let subitemBoardColumns = [];
|
|
2624
|
+
if (parentId) {
|
|
2625
|
+
const response = await this.helpers.request({
|
|
2626
|
+
method: 'POST',
|
|
2627
|
+
url: 'https://api.monday.com/v2',
|
|
2628
|
+
headers: {
|
|
2629
|
+
Authorization: `Bearer ${apiKey}`,
|
|
2630
|
+
'Content-Type': 'application/json',
|
|
2631
|
+
'API-Version': '2025-01',
|
|
2632
|
+
},
|
|
2633
|
+
body: JSON.stringify({
|
|
2634
|
+
query: `query {
|
|
2635
|
+
items(ids: [${parentId}]) {
|
|
2636
|
+
subitems {
|
|
2637
|
+
board {
|
|
2638
|
+
id
|
|
2639
|
+
columns {
|
|
2640
|
+
id
|
|
2641
|
+
title
|
|
2642
|
+
type
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2628
2645
|
}
|
|
2629
|
-
|
|
2646
|
+
}
|
|
2647
|
+
}`,
|
|
2648
|
+
}),
|
|
2649
|
+
});
|
|
2650
|
+
const parsedResponse = JSON.parse(response);
|
|
2651
|
+
const items = ((_a = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.data) === null || _a === void 0 ? void 0 : _a.items) || [];
|
|
2652
|
+
if (items.length > 0 && items[0].subitems && items[0].subitems.length > 0) {
|
|
2653
|
+
const subitem = items[0].subitems[0];
|
|
2654
|
+
if (subitem.board && subitem.board.columns) {
|
|
2655
|
+
subitemBoardColumns = subitem.board.columns;
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
if (subitemBoardColumns.length === 0) {
|
|
2660
|
+
const response = await this.helpers.request({
|
|
2661
|
+
method: 'POST',
|
|
2662
|
+
url: 'https://api.monday.com/v2',
|
|
2663
|
+
headers: {
|
|
2664
|
+
Authorization: `Bearer ${apiKey}`,
|
|
2665
|
+
'Content-Type': 'application/json',
|
|
2666
|
+
'API-Version': '2025-01',
|
|
2667
|
+
},
|
|
2668
|
+
body: JSON.stringify({
|
|
2669
|
+
query: `query {
|
|
2670
|
+
boards(ids: ${boardId}) {
|
|
2671
|
+
items_page(limit: 25) {
|
|
2630
2672
|
items {
|
|
2631
2673
|
subitems {
|
|
2632
2674
|
board {
|
|
2675
|
+
id
|
|
2633
2676
|
columns {
|
|
2634
2677
|
id
|
|
2635
2678
|
title
|
|
@@ -2641,27 +2684,84 @@ class Worktables {
|
|
|
2641
2684
|
}
|
|
2642
2685
|
}
|
|
2643
2686
|
}`,
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2687
|
+
}),
|
|
2688
|
+
});
|
|
2689
|
+
const parsedResponse = JSON.parse(response);
|
|
2690
|
+
const items = ((_e = (_d = (_c = (_b = parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.data) === null || _b === void 0 ? void 0 : _b.boards) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.items_page) === null || _e === void 0 ? void 0 : _e.items) || [];
|
|
2691
|
+
for (const item of items) {
|
|
2692
|
+
if (item.subitems && item.subitems.length > 0) {
|
|
2693
|
+
const subitem = item.subitems[0];
|
|
2694
|
+
if (subitem.board && subitem.board.columns) {
|
|
2695
|
+
subitemBoardColumns = subitem.board.columns;
|
|
2696
|
+
break;
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
if (subitemBoardColumns.length === 0) {
|
|
2702
|
+
console.log('No subitems found in board, cannot load subitem columns for identifier');
|
|
2703
|
+
return [];
|
|
2704
|
+
}
|
|
2705
|
+
return subitemBoardColumns
|
|
2706
|
+
.filter((column) => column.type !== 'subitem' &&
|
|
2707
|
+
column.type !== 'auto_number' &&
|
|
2708
|
+
column.type !== 'creation_log' &&
|
|
2709
|
+
column.type !== 'formula' &&
|
|
2710
|
+
column.type !== 'item_id' &&
|
|
2711
|
+
column.type !== 'last_updated' &&
|
|
2712
|
+
column.type !== 'progress' &&
|
|
2713
|
+
column.type !== 'mirror' &&
|
|
2714
|
+
column.type !== 'subtasks' &&
|
|
2715
|
+
column.type !== 'file' &&
|
|
2716
|
+
column.type !== 'button')
|
|
2717
|
+
.map((column) => {
|
|
2718
|
+
return {
|
|
2719
|
+
name: column.title,
|
|
2720
|
+
value: column.id,
|
|
2721
|
+
};
|
|
2722
|
+
});
|
|
2723
|
+
}
|
|
2724
|
+
else {
|
|
2725
|
+
const response = await this.helpers.request({
|
|
2726
|
+
method: 'POST',
|
|
2727
|
+
url: 'https://api.monday.com/v2',
|
|
2728
|
+
headers: {
|
|
2729
|
+
Authorization: `Bearer ${apiKey}`,
|
|
2730
|
+
'Content-Type': 'application/json',
|
|
2731
|
+
'API-Version': '2025-01',
|
|
2732
|
+
},
|
|
2733
|
+
body: JSON.stringify({
|
|
2734
|
+
query: `query {
|
|
2735
|
+
boards(ids: ${boardId}) {
|
|
2736
|
+
columns {
|
|
2737
|
+
id
|
|
2738
|
+
title
|
|
2739
|
+
type
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
}`,
|
|
2743
|
+
}),
|
|
2744
|
+
});
|
|
2745
|
+
const parsedResponse = JSON.parse(response);
|
|
2746
|
+
return parsedResponse.data.boards[0].columns
|
|
2747
|
+
.filter((column) => column.type !== 'subitem' &&
|
|
2748
|
+
column.type !== 'auto_number' &&
|
|
2749
|
+
column.type !== 'creation_log' &&
|
|
2750
|
+
column.type !== 'formula' &&
|
|
2751
|
+
column.type !== 'item_id' &&
|
|
2752
|
+
column.type !== 'last_updated' &&
|
|
2753
|
+
column.type !== 'progress' &&
|
|
2754
|
+
column.type !== 'mirror' &&
|
|
2755
|
+
column.type !== 'subtasks' &&
|
|
2756
|
+
column.type !== 'file' &&
|
|
2757
|
+
column.type !== 'button')
|
|
2758
|
+
.map((column) => {
|
|
2759
|
+
return {
|
|
2760
|
+
name: column.title,
|
|
2761
|
+
value: column.id,
|
|
2762
|
+
};
|
|
2763
|
+
});
|
|
2764
|
+
}
|
|
2665
2765
|
},
|
|
2666
2766
|
async getColumnsItemsForCreateOrUpdate() {
|
|
2667
2767
|
var _a, _b, _c, _d, _e;
|
|
@@ -3026,7 +3126,7 @@ class Worktables {
|
|
|
3026
3126
|
};
|
|
3027
3127
|
}
|
|
3028
3128
|
async execute() {
|
|
3029
|
-
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, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37;
|
|
3129
|
+
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, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38;
|
|
3030
3130
|
const resource = this.getNodeParameter('resource', 0);
|
|
3031
3131
|
const operation = this.getNodeParameter('operation', 0);
|
|
3032
3132
|
const credentials = await this.getCredentials('WorktablesApi');
|
|
@@ -4541,6 +4641,7 @@ class Worktables {
|
|
|
4541
4641
|
let formatted;
|
|
4542
4642
|
let itemUpdated = false;
|
|
4543
4643
|
let foundItemId = null;
|
|
4644
|
+
let foundItemBoardId = null;
|
|
4544
4645
|
if (identifierValue && identifierValue.trim() !== '' && identifierColumn && identifierColumn.trim() !== '') {
|
|
4545
4646
|
console.log('Searching for item/subitem with identifier column:', identifierColumn, 'value:', identifierValue, 'isSubitem:', isSubitem);
|
|
4546
4647
|
const parentId = this.getNodeParameter('parentId', 0, false);
|
|
@@ -4556,6 +4657,9 @@ class Worktables {
|
|
|
4556
4657
|
subitems {
|
|
4557
4658
|
id
|
|
4558
4659
|
name
|
|
4660
|
+
board {
|
|
4661
|
+
id
|
|
4662
|
+
}
|
|
4559
4663
|
column_values(ids: ["${identifierColumn}"]) {
|
|
4560
4664
|
id
|
|
4561
4665
|
text
|
|
@@ -4581,6 +4685,9 @@ class Worktables {
|
|
|
4581
4685
|
subitems {
|
|
4582
4686
|
id
|
|
4583
4687
|
name
|
|
4688
|
+
board {
|
|
4689
|
+
id
|
|
4690
|
+
}
|
|
4584
4691
|
column_values(ids: ["${identifierColumn}"]) {
|
|
4585
4692
|
id
|
|
4586
4693
|
text
|
|
@@ -4681,7 +4788,8 @@ class Worktables {
|
|
|
4681
4788
|
}
|
|
4682
4789
|
if (matches) {
|
|
4683
4790
|
foundItemId = subitem.id;
|
|
4684
|
-
|
|
4791
|
+
foundItemBoardId = ((_2 = subitem.board) === null || _2 === void 0 ? void 0 : _2.id) || null;
|
|
4792
|
+
console.log(`Found subitem with ID: ${foundItemId}, board_id: ${foundItemBoardId}`);
|
|
4685
4793
|
break;
|
|
4686
4794
|
}
|
|
4687
4795
|
}
|
|
@@ -4699,7 +4807,7 @@ class Worktables {
|
|
|
4699
4807
|
matches = itemName === searchValue;
|
|
4700
4808
|
}
|
|
4701
4809
|
else {
|
|
4702
|
-
const colValue = (
|
|
4810
|
+
const colValue = (_3 = item.column_values) === null || _3 === void 0 ? void 0 : _3.find((cv) => cv.id === identifierColumn);
|
|
4703
4811
|
if (colValue) {
|
|
4704
4812
|
const isBoardRelation = colValue.type === 'board_relation';
|
|
4705
4813
|
const compareValue = isBoardRelation
|
|
@@ -4735,10 +4843,14 @@ class Worktables {
|
|
|
4735
4843
|
if (foundItemId) {
|
|
4736
4844
|
console.log(`Found existing ${isSubitem ? 'subitem' : 'item'}, updating:`, foundItemId);
|
|
4737
4845
|
const escapedColumnValues = (0, worktablesHelpers_1.escapeGraphQLJSONString)(column_values_object);
|
|
4846
|
+
const updateBoardId = (isSubitem && foundItemBoardId) ? foundItemBoardId : boardId;
|
|
4847
|
+
if (isSubitem && !foundItemBoardId) {
|
|
4848
|
+
console.log(`⚠ Warning: Subitem board_id not found, using main board_id ${boardId}. This may cause errors.`);
|
|
4849
|
+
}
|
|
4738
4850
|
mutation = `mutation {
|
|
4739
4851
|
change_multiple_column_values(
|
|
4740
4852
|
create_labels_if_missing: true,
|
|
4741
|
-
board_id: ${
|
|
4853
|
+
board_id: ${updateBoardId},
|
|
4742
4854
|
item_id: "${foundItemId}",
|
|
4743
4855
|
column_values: "${escapedColumnValues}"
|
|
4744
4856
|
) {
|
|
@@ -4764,7 +4876,7 @@ class Worktables {
|
|
|
4764
4876
|
id: itemData.id,
|
|
4765
4877
|
url: itemData.url || '',
|
|
4766
4878
|
operation: 'update',
|
|
4767
|
-
board_id: ((
|
|
4879
|
+
board_id: ((_4 = itemData.board) === null || _4 === void 0 ? void 0 : _4.id) || boardId,
|
|
4768
4880
|
column_values: column_values_object,
|
|
4769
4881
|
};
|
|
4770
4882
|
itemUpdated = true;
|
|
@@ -4855,8 +4967,8 @@ class Worktables {
|
|
|
4855
4967
|
});
|
|
4856
4968
|
}
|
|
4857
4969
|
const itemData = isSubitem && parentId
|
|
4858
|
-
? (
|
|
4859
|
-
: (
|
|
4970
|
+
? (_5 = responseData.data) === null || _5 === void 0 ? void 0 : _5.create_subitem
|
|
4971
|
+
: (_6 = responseData.data) === null || _6 === void 0 ? void 0 : _6.create_item;
|
|
4860
4972
|
if (!itemData || !itemData.id) {
|
|
4861
4973
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4862
4974
|
message: `Error creating ${isSubitem ? 'subitem' : 'item'}: No item data returned`,
|
|
@@ -4867,7 +4979,7 @@ class Worktables {
|
|
|
4867
4979
|
name: itemData.name || itemName,
|
|
4868
4980
|
url: itemData.url || '',
|
|
4869
4981
|
operation: 'create',
|
|
4870
|
-
board_id: ((
|
|
4982
|
+
board_id: ((_7 = itemData.board) === null || _7 === void 0 ? void 0 : _7.id) || boardId,
|
|
4871
4983
|
column_values: column_values_object,
|
|
4872
4984
|
};
|
|
4873
4985
|
if (isSubitem && parentId) {
|
|
@@ -5006,7 +5118,7 @@ class Worktables {
|
|
|
5006
5118
|
body: { query },
|
|
5007
5119
|
});
|
|
5008
5120
|
const parsed = typeof rawResponse === 'string' ? JSON.parse(rawResponse) : rawResponse;
|
|
5009
|
-
const itemsPage = (
|
|
5121
|
+
const itemsPage = (_10 = (_9 = (_8 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _8 === void 0 ? void 0 : _8.boards) === null || _9 === void 0 ? void 0 : _9[0]) === null || _10 === void 0 ? void 0 : _10.items_page;
|
|
5010
5122
|
const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
|
|
5011
5123
|
cursor = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor) || null;
|
|
5012
5124
|
allItems = allItems.concat(items);
|
|
@@ -5085,7 +5197,7 @@ class Worktables {
|
|
|
5085
5197
|
const sortOptions = this.getNodeParameter('sortOptions', 0, { sortBy: [] });
|
|
5086
5198
|
const logicalOperator = this.getNodeParameter('logicalOperator', 0);
|
|
5087
5199
|
let rulesArray = [];
|
|
5088
|
-
if (((
|
|
5200
|
+
if (((_11 = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _11 === void 0 ? void 0 : _11.length) > 0) {
|
|
5089
5201
|
rulesArray = filterRules.rule.map((rule) => {
|
|
5090
5202
|
let formattedValue;
|
|
5091
5203
|
if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
|
|
@@ -5129,7 +5241,7 @@ class Worktables {
|
|
|
5129
5241
|
});
|
|
5130
5242
|
}
|
|
5131
5243
|
const orderByArray = [];
|
|
5132
|
-
if (((
|
|
5244
|
+
if (((_12 = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _12 === void 0 ? void 0 : _12.length) > 0) {
|
|
5133
5245
|
sortOptions.sortBy.forEach((sort) => {
|
|
5134
5246
|
orderByArray.push(`{
|
|
5135
5247
|
column_id: "${sort.columnId}",
|
|
@@ -5185,7 +5297,7 @@ class Worktables {
|
|
|
5185
5297
|
body: { query },
|
|
5186
5298
|
});
|
|
5187
5299
|
const parsed = JSON.parse(rawResponse);
|
|
5188
|
-
const items = ((
|
|
5300
|
+
const items = ((_16 = (_15 = (_14 = (_13 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _13 === void 0 ? void 0 : _13.boards) === null || _14 === void 0 ? void 0 : _14[0]) === null || _15 === void 0 ? void 0 : _15.items_page) === null || _16 === void 0 ? void 0 : _16.items) || [];
|
|
5189
5301
|
const formattedItems = await Promise.all(items.map(async (item) => {
|
|
5190
5302
|
const formatted = {
|
|
5191
5303
|
id: item.id,
|
|
@@ -5219,7 +5331,7 @@ class Worktables {
|
|
|
5219
5331
|
const advancedSortOptions = this.getNodeParameter('advancedSortOptions', 0, { sortBy: [] });
|
|
5220
5332
|
const logicalOperator = this.getNodeParameter('logicalOperatorAdvanced', 0);
|
|
5221
5333
|
let rulesArray = [];
|
|
5222
|
-
if (((
|
|
5334
|
+
if (((_17 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _17 === void 0 ? void 0 : _17.length) > 0) {
|
|
5223
5335
|
console.log('Processing filter rules:', advancedFilterRules.rule);
|
|
5224
5336
|
rulesArray = advancedFilterRules.rule.map((rule) => {
|
|
5225
5337
|
let formattedValue;
|
|
@@ -5435,7 +5547,7 @@ class Worktables {
|
|
|
5435
5547
|
});
|
|
5436
5548
|
}
|
|
5437
5549
|
const orderByArray = [];
|
|
5438
|
-
if (((
|
|
5550
|
+
if (((_18 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _18 === void 0 ? void 0 : _18.length) > 0) {
|
|
5439
5551
|
advancedSortOptions.sortBy.forEach((sort) => {
|
|
5440
5552
|
orderByArray.push(`{
|
|
5441
5553
|
column_id: "${sort.columnId}",
|
|
@@ -5517,7 +5629,7 @@ class Worktables {
|
|
|
5517
5629
|
body: { query: testQuery },
|
|
5518
5630
|
});
|
|
5519
5631
|
const testParsed = JSON.parse(testResponse);
|
|
5520
|
-
const testItems = ((
|
|
5632
|
+
const testItems = ((_22 = (_21 = (_20 = (_19 = testParsed === null || testParsed === void 0 ? void 0 : testParsed.data) === null || _19 === void 0 ? void 0 : _19.boards) === null || _20 === void 0 ? void 0 : _20[0]) === null || _21 === void 0 ? void 0 : _21.items_page) === null || _22 === void 0 ? void 0 : _22.items) || [];
|
|
5521
5633
|
console.log('Test - Items in board (no filters):', testItems.length);
|
|
5522
5634
|
if (testItems.length > 0) {
|
|
5523
5635
|
console.log('Sample item column values:', testItems[0].column_values);
|
|
@@ -5529,7 +5641,7 @@ class Worktables {
|
|
|
5529
5641
|
body: { query },
|
|
5530
5642
|
});
|
|
5531
5643
|
const parsed = JSON.parse(rawResponse);
|
|
5532
|
-
const itemsPage = (
|
|
5644
|
+
const itemsPage = (_25 = (_24 = (_23 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _23 === void 0 ? void 0 : _23.boards) === null || _24 === void 0 ? void 0 : _24[0]) === null || _25 === void 0 ? void 0 : _25.items_page;
|
|
5533
5645
|
const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
|
|
5534
5646
|
const nextCursor = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor;
|
|
5535
5647
|
const hasMore = nextCursor ? true : false;
|
|
@@ -5693,7 +5805,7 @@ class Worktables {
|
|
|
5693
5805
|
body: { query },
|
|
5694
5806
|
});
|
|
5695
5807
|
const parsed = JSON.parse(rawResponse);
|
|
5696
|
-
const items = ((_30 = (_29 = (_28 = (_27 = (_26 =
|
|
5808
|
+
const items = ((_31 = (_30 = (_29 = (_28 = (_27 = (_26 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _26 === void 0 ? void 0 : _26.boards) === null || _27 === void 0 ? void 0 : _27[0]) === null || _28 === void 0 ? void 0 : _28.groups) === null || _29 === void 0 ? void 0 : _29[0]) === null || _30 === void 0 ? void 0 : _30.items_page) === null || _31 === void 0 ? void 0 : _31.items) || [];
|
|
5697
5809
|
const formattedItems = await Promise.all(items.map(async (item) => {
|
|
5698
5810
|
const columnValues = item.column_values || [];
|
|
5699
5811
|
const formatted = {
|
|
@@ -5782,7 +5894,7 @@ class Worktables {
|
|
|
5782
5894
|
response = await (0, isErrorResponse_1.parseApiResponse)(response);
|
|
5783
5895
|
if (response.success) {
|
|
5784
5896
|
const parsed = JSON.parse(response.data);
|
|
5785
|
-
const updates = ((
|
|
5897
|
+
const updates = ((_34 = (_33 = (_32 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _32 === void 0 ? void 0 : _32.items) === null || _33 === void 0 ? void 0 : _33[0]) === null || _34 === void 0 ? void 0 : _34.updates) || [];
|
|
5786
5898
|
const formattedUpdates = updates.map((update) => {
|
|
5787
5899
|
const pinnedToTop = update.pinned_to_top || [];
|
|
5788
5900
|
const isPinnedToTop = Array.isArray(pinnedToTop) && pinnedToTop.length > 0;
|
|
@@ -5847,7 +5959,7 @@ class Worktables {
|
|
|
5847
5959
|
console.log('variables:', variables);
|
|
5848
5960
|
response = await (0, worktablesHelpers_1.makeGraphQLRequest)(this, mutation, headers, variables);
|
|
5849
5961
|
console.log('Create Update Result:', JSON.stringify(response, null, 2));
|
|
5850
|
-
const updateId = (
|
|
5962
|
+
const updateId = (_36 = (_35 = JSON.parse(response).data) === null || _35 === void 0 ? void 0 : _35.create_update) === null || _36 === void 0 ? void 0 : _36.id;
|
|
5851
5963
|
if (!updateId) {
|
|
5852
5964
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
5853
5965
|
message: 'Error creating update: Update not created, no ID returned',
|
|
@@ -6156,7 +6268,7 @@ class Worktables {
|
|
|
6156
6268
|
body: { query },
|
|
6157
6269
|
json: true,
|
|
6158
6270
|
});
|
|
6159
|
-
const asset = (
|
|
6271
|
+
const asset = (_38 = (_37 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _37 === void 0 ? void 0 : _37.assets) === null || _38 === void 0 ? void 0 : _38[0];
|
|
6160
6272
|
if (!(asset === null || asset === void 0 ? void 0 : asset.public_url)) {
|
|
6161
6273
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
6162
6274
|
message: 'Public URL not found for the given file ID.',
|