@worktables/n8n-nodes-worktables 12.2.21 → 12.2.23
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.
|
@@ -1023,27 +1023,6 @@ class Worktables {
|
|
|
1023
1023
|
},
|
|
1024
1024
|
},
|
|
1025
1025
|
},
|
|
1026
|
-
{
|
|
1027
|
-
displayName: 'Operator',
|
|
1028
|
-
name: 'identifierOperator',
|
|
1029
|
-
type: 'options',
|
|
1030
|
-
options: [
|
|
1031
|
-
{ name: 'Equals', value: 'equals' },
|
|
1032
|
-
{ name: 'Any Of', value: 'any_of' },
|
|
1033
|
-
{ name: 'Not Any Of', value: 'not_any_of' },
|
|
1034
|
-
{ name: 'Contains Text', value: 'contains_text' },
|
|
1035
|
-
{ name: 'Does Not Contain Text', value: 'not_contains_text' },
|
|
1036
|
-
{ name: 'Starts With', value: 'starts_with' },
|
|
1037
|
-
{ name: 'Ends With', value: 'ends_with' },
|
|
1038
|
-
],
|
|
1039
|
-
default: 'equals',
|
|
1040
|
-
description: 'The condition for value comparison',
|
|
1041
|
-
displayOptions: {
|
|
1042
|
-
show: {
|
|
1043
|
-
operation: ['createOrUpdateItem'],
|
|
1044
|
-
},
|
|
1045
|
-
},
|
|
1046
|
-
},
|
|
1047
1026
|
{
|
|
1048
1027
|
displayName: 'Identifier Value',
|
|
1049
1028
|
name: 'itemIdOptional',
|
|
@@ -2830,7 +2809,7 @@ class Worktables {
|
|
|
2830
2809
|
};
|
|
2831
2810
|
}
|
|
2832
2811
|
async execute() {
|
|
2833
|
-
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;
|
|
2812
|
+
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;
|
|
2834
2813
|
const resource = this.getNodeParameter('resource', 0);
|
|
2835
2814
|
const operation = this.getNodeParameter('operation', 0);
|
|
2836
2815
|
const credentials = await this.getCredentials('WorktablesApi');
|
|
@@ -4346,8 +4325,7 @@ class Worktables {
|
|
|
4346
4325
|
let itemUpdated = false;
|
|
4347
4326
|
let foundItemId = null;
|
|
4348
4327
|
if (identifierValue && identifierValue.trim() !== '' && identifierColumn && identifierColumn.trim() !== '') {
|
|
4349
|
-
|
|
4350
|
-
console.log('Searching for item/subitem with identifier column:', identifierColumn, 'value:', identifierValue, 'operator:', identifierOperator, 'isSubitem:', isSubitem);
|
|
4328
|
+
console.log('Searching for item/subitem with identifier column:', identifierColumn, 'value:', identifierValue, 'isSubitem:', isSubitem);
|
|
4351
4329
|
let cursor = null;
|
|
4352
4330
|
let hasMore = true;
|
|
4353
4331
|
while (hasMore && !foundItemId) {
|
|
@@ -4399,47 +4377,6 @@ class Worktables {
|
|
|
4399
4377
|
const itemsPage = (_z = (_y = (_x = searchData === null || searchData === void 0 ? void 0 : searchData.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;
|
|
4400
4378
|
const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
|
|
4401
4379
|
cursor = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor) || null;
|
|
4402
|
-
const compareValues = (colValue, identifierValue, operator) => {
|
|
4403
|
-
let colText = colValue.text || '';
|
|
4404
|
-
let colValueStr = '';
|
|
4405
|
-
try {
|
|
4406
|
-
if (colValue.value) {
|
|
4407
|
-
const parsedValue = JSON.parse(colValue.value);
|
|
4408
|
-
if (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.label) {
|
|
4409
|
-
colValueStr = parsedValue.label;
|
|
4410
|
-
}
|
|
4411
|
-
else {
|
|
4412
|
-
colValueStr = (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.text) || (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.value) || String(parsedValue);
|
|
4413
|
-
}
|
|
4414
|
-
}
|
|
4415
|
-
}
|
|
4416
|
-
catch {
|
|
4417
|
-
colValueStr = colValue.value || '';
|
|
4418
|
-
}
|
|
4419
|
-
const searchValue = identifierValue.trim().toLowerCase();
|
|
4420
|
-
const colTextLower = colText.trim().toLowerCase();
|
|
4421
|
-
const colValueStrLower = colValueStr.trim().toLowerCase();
|
|
4422
|
-
switch (operator) {
|
|
4423
|
-
case 'equals':
|
|
4424
|
-
return colTextLower === searchValue || colValueStrLower === searchValue;
|
|
4425
|
-
case 'any_of':
|
|
4426
|
-
const values = identifierValue.split(',').map(v => v.trim().toLowerCase());
|
|
4427
|
-
return values.includes(colTextLower) || values.includes(colValueStrLower);
|
|
4428
|
-
case 'not_any_of':
|
|
4429
|
-
const notValues = identifierValue.split(',').map(v => v.trim().toLowerCase());
|
|
4430
|
-
return !notValues.includes(colTextLower) && !notValues.includes(colValueStrLower);
|
|
4431
|
-
case 'contains_text':
|
|
4432
|
-
return colTextLower.includes(searchValue) || colValueStrLower.includes(searchValue);
|
|
4433
|
-
case 'not_contains_text':
|
|
4434
|
-
return !colTextLower.includes(searchValue) && !colValueStrLower.includes(searchValue);
|
|
4435
|
-
case 'starts_with':
|
|
4436
|
-
return colTextLower.startsWith(searchValue) || colValueStrLower.startsWith(searchValue);
|
|
4437
|
-
case 'ends_with':
|
|
4438
|
-
return colTextLower.endsWith(searchValue) || colValueStrLower.endsWith(searchValue);
|
|
4439
|
-
default:
|
|
4440
|
-
return colTextLower === searchValue || colValueStrLower === searchValue;
|
|
4441
|
-
}
|
|
4442
|
-
};
|
|
4443
4380
|
const isNameColumn = identifierColumn === 'name' || identifierColumn.toLowerCase() === 'name';
|
|
4444
4381
|
if (isSubitem) {
|
|
4445
4382
|
for (const item of items) {
|
|
@@ -4447,33 +4384,46 @@ class Worktables {
|
|
|
4447
4384
|
for (const subitem of item.subitems) {
|
|
4448
4385
|
let matches = false;
|
|
4449
4386
|
if (isNameColumn) {
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
switch (identifierOperator) {
|
|
4453
|
-
case 'equals':
|
|
4454
|
-
matches = subitemName === searchValue;
|
|
4455
|
-
break;
|
|
4456
|
-
case 'contains_text':
|
|
4457
|
-
matches = subitemName.includes(searchValue);
|
|
4458
|
-
break;
|
|
4459
|
-
case 'starts_with':
|
|
4460
|
-
matches = subitemName.startsWith(searchValue);
|
|
4461
|
-
break;
|
|
4462
|
-
case 'ends_with':
|
|
4463
|
-
matches = subitemName.endsWith(searchValue);
|
|
4464
|
-
break;
|
|
4465
|
-
default:
|
|
4466
|
-
matches = subitemName === searchValue;
|
|
4467
|
-
}
|
|
4387
|
+
matches = subitem.name === identifierValue ||
|
|
4388
|
+
((_0 = subitem.name) === null || _0 === void 0 ? void 0 : _0.trim()) === identifierValue.trim();
|
|
4468
4389
|
}
|
|
4469
4390
|
else {
|
|
4470
|
-
const colValue = (
|
|
4391
|
+
const colValue = (_1 = subitem.column_values) === null || _1 === void 0 ? void 0 : _1.find((cv) => cv.id === identifierColumn);
|
|
4471
4392
|
if (colValue) {
|
|
4472
|
-
|
|
4393
|
+
let colText = colValue.text || '';
|
|
4394
|
+
let colValueStr = '';
|
|
4395
|
+
try {
|
|
4396
|
+
if (colValue.value) {
|
|
4397
|
+
const parsedValue = JSON.parse(colValue.value);
|
|
4398
|
+
if (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.label) {
|
|
4399
|
+
colValueStr = parsedValue.label;
|
|
4400
|
+
}
|
|
4401
|
+
else {
|
|
4402
|
+
colValueStr = (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.text) || (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.value) || String(parsedValue);
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4406
|
+
catch {
|
|
4407
|
+
colValueStr = colValue.value || '';
|
|
4408
|
+
}
|
|
4409
|
+
const searchValue = identifierValue.trim().toLowerCase();
|
|
4410
|
+
const colTextLower = (colText || '').trim().toLowerCase();
|
|
4411
|
+
const colValueStrLower = (colValueStr || '').trim().toLowerCase();
|
|
4412
|
+
matches = colTextLower === searchValue || colValueStrLower === searchValue;
|
|
4413
|
+
if (matches) {
|
|
4414
|
+
console.log(`✓ Match found! Subitem ${subitem.id} - Column ${identifierColumn}: text="${colText}", value="${colValueStr}", search="${identifierValue}"`);
|
|
4415
|
+
}
|
|
4416
|
+
else if (colText || colValueStr) {
|
|
4417
|
+
console.log(`✗ No match - Subitem ${subitem.id} - Column ${identifierColumn}: text="${colText}", value="${colValueStr}", search="${identifierValue}"`);
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
else {
|
|
4421
|
+
console.log(`⚠ Subitem ${subitem.id} - Column ${identifierColumn} not found in column_values`);
|
|
4473
4422
|
}
|
|
4474
4423
|
}
|
|
4475
4424
|
if (matches) {
|
|
4476
4425
|
foundItemId = subitem.id;
|
|
4426
|
+
console.log(`Found subitem with ID: ${foundItemId}`);
|
|
4477
4427
|
break;
|
|
4478
4428
|
}
|
|
4479
4429
|
}
|
|
@@ -4486,33 +4436,46 @@ class Worktables {
|
|
|
4486
4436
|
for (const item of items) {
|
|
4487
4437
|
let matches = false;
|
|
4488
4438
|
if (isNameColumn) {
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
switch (identifierOperator) {
|
|
4492
|
-
case 'equals':
|
|
4493
|
-
matches = itemName === searchValue;
|
|
4494
|
-
break;
|
|
4495
|
-
case 'contains_text':
|
|
4496
|
-
matches = itemName.includes(searchValue);
|
|
4497
|
-
break;
|
|
4498
|
-
case 'starts_with':
|
|
4499
|
-
matches = itemName.startsWith(searchValue);
|
|
4500
|
-
break;
|
|
4501
|
-
case 'ends_with':
|
|
4502
|
-
matches = itemName.endsWith(searchValue);
|
|
4503
|
-
break;
|
|
4504
|
-
default:
|
|
4505
|
-
matches = itemName === searchValue;
|
|
4506
|
-
}
|
|
4439
|
+
matches = item.name === identifierValue ||
|
|
4440
|
+
((_2 = item.name) === null || _2 === void 0 ? void 0 : _2.trim()) === identifierValue.trim();
|
|
4507
4441
|
}
|
|
4508
4442
|
else {
|
|
4509
|
-
const colValue = (
|
|
4443
|
+
const colValue = (_3 = item.column_values) === null || _3 === void 0 ? void 0 : _3.find((cv) => cv.id === identifierColumn);
|
|
4510
4444
|
if (colValue) {
|
|
4511
|
-
|
|
4445
|
+
let colText = colValue.text || '';
|
|
4446
|
+
let colValueStr = '';
|
|
4447
|
+
try {
|
|
4448
|
+
if (colValue.value) {
|
|
4449
|
+
const parsedValue = JSON.parse(colValue.value);
|
|
4450
|
+
if (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.label) {
|
|
4451
|
+
colValueStr = parsedValue.label;
|
|
4452
|
+
}
|
|
4453
|
+
else {
|
|
4454
|
+
colValueStr = (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.text) || (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.value) || String(parsedValue);
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
catch {
|
|
4459
|
+
colValueStr = colValue.value || '';
|
|
4460
|
+
}
|
|
4461
|
+
const searchValue = identifierValue.trim().toLowerCase();
|
|
4462
|
+
const colTextLower = (colText || '').trim().toLowerCase();
|
|
4463
|
+
const colValueStrLower = (colValueStr || '').trim().toLowerCase();
|
|
4464
|
+
matches = colTextLower === searchValue || colValueStrLower === searchValue;
|
|
4465
|
+
if (matches) {
|
|
4466
|
+
console.log(`✓ Match found! Item ${item.id} - Column ${identifierColumn}: text="${colText}", value="${colValueStr}", search="${identifierValue}"`);
|
|
4467
|
+
}
|
|
4468
|
+
else if (colText || colValueStr) {
|
|
4469
|
+
console.log(`✗ No match - Item ${item.id} - Column ${identifierColumn}: text="${colText}", value="${colValueStr}", search="${identifierValue}"`);
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
else {
|
|
4473
|
+
console.log(`⚠ Item ${item.id} - Column ${identifierColumn} not found in column_values`);
|
|
4512
4474
|
}
|
|
4513
4475
|
}
|
|
4514
4476
|
if (matches) {
|
|
4515
4477
|
foundItemId = item.id;
|
|
4478
|
+
console.log(`Found item with ID: ${foundItemId}`);
|
|
4516
4479
|
break;
|
|
4517
4480
|
}
|
|
4518
4481
|
}
|
|
@@ -4551,7 +4514,7 @@ class Worktables {
|
|
|
4551
4514
|
id: itemData.id,
|
|
4552
4515
|
url: itemData.url || '',
|
|
4553
4516
|
operation: 'update',
|
|
4554
|
-
board_id: ((
|
|
4517
|
+
board_id: ((_4 = itemData.board) === null || _4 === void 0 ? void 0 : _4.id) || boardId,
|
|
4555
4518
|
column_values: column_values_object,
|
|
4556
4519
|
};
|
|
4557
4520
|
itemUpdated = true;
|
|
@@ -4634,8 +4597,8 @@ class Worktables {
|
|
|
4634
4597
|
});
|
|
4635
4598
|
}
|
|
4636
4599
|
const itemData = isSubitem && parentId
|
|
4637
|
-
? (
|
|
4638
|
-
: (
|
|
4600
|
+
? (_5 = responseData.data) === null || _5 === void 0 ? void 0 : _5.create_subitem
|
|
4601
|
+
: (_6 = responseData.data) === null || _6 === void 0 ? void 0 : _6.create_item;
|
|
4639
4602
|
if (!itemData || !itemData.id) {
|
|
4640
4603
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
4641
4604
|
message: `Error creating ${isSubitem ? 'subitem' : 'item'}: No item data returned`,
|
|
@@ -4646,7 +4609,7 @@ class Worktables {
|
|
|
4646
4609
|
name: itemData.name || itemName,
|
|
4647
4610
|
url: itemData.url || '',
|
|
4648
4611
|
operation: 'create',
|
|
4649
|
-
board_id: ((
|
|
4612
|
+
board_id: ((_7 = itemData.board) === null || _7 === void 0 ? void 0 : _7.id) || boardId,
|
|
4650
4613
|
column_values: column_values_object,
|
|
4651
4614
|
};
|
|
4652
4615
|
if (isSubitem && parentId) {
|
|
@@ -4785,7 +4748,7 @@ class Worktables {
|
|
|
4785
4748
|
body: { query },
|
|
4786
4749
|
});
|
|
4787
4750
|
const parsed = typeof rawResponse === 'string' ? JSON.parse(rawResponse) : rawResponse;
|
|
4788
|
-
const itemsPage = (
|
|
4751
|
+
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;
|
|
4789
4752
|
const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
|
|
4790
4753
|
cursor = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor) || null;
|
|
4791
4754
|
allItems = allItems.concat(items);
|
|
@@ -4865,7 +4828,7 @@ class Worktables {
|
|
|
4865
4828
|
const sortOptions = this.getNodeParameter('sortOptions', 0, { sortBy: [] });
|
|
4866
4829
|
const logicalOperator = this.getNodeParameter('logicalOperator', 0);
|
|
4867
4830
|
let rulesArray = [];
|
|
4868
|
-
if (((
|
|
4831
|
+
if (((_11 = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _11 === void 0 ? void 0 : _11.length) > 0) {
|
|
4869
4832
|
rulesArray = filterRules.rule.map((rule) => {
|
|
4870
4833
|
let formattedValue;
|
|
4871
4834
|
if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
|
|
@@ -4909,7 +4872,7 @@ class Worktables {
|
|
|
4909
4872
|
});
|
|
4910
4873
|
}
|
|
4911
4874
|
const orderByArray = [];
|
|
4912
|
-
if (((
|
|
4875
|
+
if (((_12 = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _12 === void 0 ? void 0 : _12.length) > 0) {
|
|
4913
4876
|
sortOptions.sortBy.forEach((sort) => {
|
|
4914
4877
|
orderByArray.push(`{
|
|
4915
4878
|
column_id: "${sort.columnId}",
|
|
@@ -4955,7 +4918,7 @@ class Worktables {
|
|
|
4955
4918
|
body: { query },
|
|
4956
4919
|
});
|
|
4957
4920
|
const parsed = JSON.parse(rawResponse);
|
|
4958
|
-
const items = ((
|
|
4921
|
+
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) || [];
|
|
4959
4922
|
const formattedItems = await Promise.all(items.map(async (item) => {
|
|
4960
4923
|
const formatted = {
|
|
4961
4924
|
id: item.id,
|
|
@@ -4989,7 +4952,7 @@ class Worktables {
|
|
|
4989
4952
|
const advancedSortOptions = this.getNodeParameter('advancedSortOptions', 0, { sortBy: [] });
|
|
4990
4953
|
const logicalOperator = this.getNodeParameter('logicalOperatorAdvanced', 0);
|
|
4991
4954
|
let rulesArray = [];
|
|
4992
|
-
if (((
|
|
4955
|
+
if (((_17 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _17 === void 0 ? void 0 : _17.length) > 0) {
|
|
4993
4956
|
console.log('Processing filter rules:', advancedFilterRules.rule);
|
|
4994
4957
|
rulesArray = advancedFilterRules.rule.map((rule) => {
|
|
4995
4958
|
let formattedValue;
|
|
@@ -5205,7 +5168,7 @@ class Worktables {
|
|
|
5205
5168
|
});
|
|
5206
5169
|
}
|
|
5207
5170
|
const orderByArray = [];
|
|
5208
|
-
if (((
|
|
5171
|
+
if (((_18 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _18 === void 0 ? void 0 : _18.length) > 0) {
|
|
5209
5172
|
advancedSortOptions.sortBy.forEach((sort) => {
|
|
5210
5173
|
orderByArray.push(`{
|
|
5211
5174
|
column_id: "${sort.columnId}",
|
|
@@ -5277,7 +5240,7 @@ class Worktables {
|
|
|
5277
5240
|
body: { query: testQuery },
|
|
5278
5241
|
});
|
|
5279
5242
|
const testParsed = JSON.parse(testResponse);
|
|
5280
|
-
const testItems = ((
|
|
5243
|
+
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) || [];
|
|
5281
5244
|
console.log('Test - Items in board (no filters):', testItems.length);
|
|
5282
5245
|
if (testItems.length > 0) {
|
|
5283
5246
|
console.log('Sample item column values:', testItems[0].column_values);
|
|
@@ -5289,7 +5252,7 @@ class Worktables {
|
|
|
5289
5252
|
body: { query },
|
|
5290
5253
|
});
|
|
5291
5254
|
const parsed = JSON.parse(rawResponse);
|
|
5292
|
-
const itemsPage = (
|
|
5255
|
+
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;
|
|
5293
5256
|
const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
|
|
5294
5257
|
const nextCursor = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor;
|
|
5295
5258
|
const hasMore = nextCursor ? true : false;
|
|
@@ -5447,7 +5410,7 @@ class Worktables {
|
|
|
5447
5410
|
body: { query },
|
|
5448
5411
|
});
|
|
5449
5412
|
const parsed = JSON.parse(rawResponse);
|
|
5450
|
-
const items = ((
|
|
5413
|
+
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) || [];
|
|
5451
5414
|
const formattedItems = await Promise.all(items.map(async (item) => {
|
|
5452
5415
|
const columnValues = item.column_values || [];
|
|
5453
5416
|
const formatted = {
|
|
@@ -5537,7 +5500,7 @@ class Worktables {
|
|
|
5537
5500
|
response = await (0, isErrorResponse_1.parseApiResponse)(response);
|
|
5538
5501
|
if (response.success) {
|
|
5539
5502
|
const parsed = JSON.parse(response.data);
|
|
5540
|
-
const updates = ((
|
|
5503
|
+
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) || [];
|
|
5541
5504
|
const formattedUpdates = updates.map((update) => {
|
|
5542
5505
|
const pinnedToTop = update.pinned_to_top || [];
|
|
5543
5506
|
const isPinnedToTop = Array.isArray(pinnedToTop) && pinnedToTop.length > 0;
|
|
@@ -5602,7 +5565,7 @@ class Worktables {
|
|
|
5602
5565
|
console.log('variables:', variables);
|
|
5603
5566
|
response = await (0, worktablesHelpers_1.makeGraphQLRequest)(this, mutation, headers, variables);
|
|
5604
5567
|
console.log('Create Update Result:', JSON.stringify(response, null, 2));
|
|
5605
|
-
const updateId = (
|
|
5568
|
+
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;
|
|
5606
5569
|
if (!updateId) {
|
|
5607
5570
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
5608
5571
|
message: 'Error creating update: Update not created, no ID returned',
|
|
@@ -5908,7 +5871,7 @@ class Worktables {
|
|
|
5908
5871
|
body: { query },
|
|
5909
5872
|
json: true,
|
|
5910
5873
|
});
|
|
5911
|
-
const asset = (
|
|
5874
|
+
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];
|
|
5912
5875
|
if (!(asset === null || asset === void 0 ? void 0 : asset.public_url)) {
|
|
5913
5876
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), {
|
|
5914
5877
|
message: 'Public URL not found for the given file ID.',
|