@worktables/n8n-nodes-worktables 12.15.0 → 12.16.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.
@@ -3178,7 +3178,7 @@ class Worktables {
3178
3178
  };
3179
3179
  }
3180
3180
  async execute() {
3181
- 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, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53;
3181
+ 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, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54;
3182
3182
  const resource = this.getNodeParameter('resource', 0);
3183
3183
  const operation = this.getNodeParameter('operation', 0);
3184
3184
  const credentials = await this.getCredentials('WorktablesApi');
@@ -4699,8 +4699,10 @@ class Worktables {
4699
4699
  console.log('🔍 STARTING SEARCH FOR ITEM/SUBITEM');
4700
4700
  console.log('═══════════════════════════════════════════════════════════');
4701
4701
  console.log('📋 Search Parameters:');
4702
- console.log(' - identifierColumn:', identifierColumn);
4703
- console.log(' - identifierValue:', identifierValue);
4702
+ console.log(' - identifierColumn (raw):', JSON.stringify(identifierColumn));
4703
+ console.log(' - identifierColumn (trimmed):', JSON.stringify(identifierColumn.trim()));
4704
+ console.log(' - identifierValue (raw):', JSON.stringify(identifierValue));
4705
+ console.log(' - identifierValue (trimmed):', JSON.stringify(identifierValue.trim()));
4704
4706
  console.log(' - isSubitem:', isSubitem);
4705
4707
  console.log(' - boardId:', boardId);
4706
4708
  console.log('═══════════════════════════════════════════════════════════');
@@ -4854,15 +4856,21 @@ class Worktables {
4854
4856
  : (colValue.text || '').trim();
4855
4857
  const searchValue = identifierValue.trim().toLowerCase();
4856
4858
  console.log(` - Column type: ${colValue.type}`);
4857
- console.log(` - Column value found: "${compareValue}"`);
4858
- console.log(` - Search value: "${identifierValue}"`);
4859
- matches = compareValue.toLowerCase() === searchValue;
4860
- console.log(` - Initial match: ${matches}`);
4859
+ console.log(` - Column value found: "${compareValue}" (length: ${compareValue.length}, raw: ${JSON.stringify(compareValue)})`);
4860
+ console.log(` - Search value: "${identifierValue}" (length: ${identifierValue.trim().length}, trimmed: "${identifierValue.trim()}", raw: ${JSON.stringify(identifierValue)})`);
4861
+ const trimmedCompare = compareValue.trim().toLowerCase();
4862
+ const trimmedSearch = searchValue.trim();
4863
+ matches = trimmedCompare === trimmedSearch;
4864
+ console.log(` - Trimmed compare: "${trimmedCompare}" === "${trimmedSearch}" = ${matches}`);
4861
4865
  if (isStatusColumn && !matches) {
4862
- const normalizedCompare = compareValue.toLowerCase().replace(/\s+/g, ' ').trim();
4863
- const normalizedSearch = searchValue.replace(/\s+/g, ' ').trim();
4866
+ const normalizedCompare = trimmedCompare.replace(/\s+/g, ' ').trim();
4867
+ const normalizedSearch = trimmedSearch.replace(/\s+/g, ' ').trim();
4864
4868
  matches = normalizedCompare === normalizedSearch;
4865
4869
  console.log(` - Normalized compare: "${normalizedCompare}" === "${normalizedSearch}" = ${matches}`);
4870
+ if (!matches) {
4871
+ matches = normalizedCompare.includes(normalizedSearch) || normalizedSearch.includes(normalizedCompare);
4872
+ console.log(` - Contains check: "${normalizedCompare}".includes("${normalizedSearch}") OR "${normalizedSearch}".includes("${normalizedCompare}") = ${matches}`);
4873
+ }
4866
4874
  if (!matches) {
4867
4875
  console.log(` ❌ Status column comparison failed for subitem ${subitem.id}`);
4868
4876
  }
@@ -5006,7 +5014,9 @@ class Worktables {
5006
5014
  console.log(` - Name comparison: "${itemName}" === "${searchValue}" = ${matches}`);
5007
5015
  }
5008
5016
  else {
5009
- const colValue = (_15 = item.column_values) === null || _15 === void 0 ? void 0 : _15.find((cv) => cv.id === identifierColumn);
5017
+ console.log(` - Looking for column with ID: "${identifierColumn}"`);
5018
+ console.log(` - Available column_values IDs:`, ((_15 = item.column_values) === null || _15 === void 0 ? void 0 : _15.map((cv) => `${cv.id} (type: ${cv.type})`).join(', ')) || 'none');
5019
+ const colValue = (_16 = item.column_values) === null || _16 === void 0 ? void 0 : _16.find((cv) => cv.id === identifierColumn);
5010
5020
  if (colValue) {
5011
5021
  const isBoardRelation = colValue.type === 'board_relation' || colValue.type === 'mirror';
5012
5022
  const isStatusColumn = colValue.type === 'status';
@@ -5014,16 +5024,22 @@ class Worktables {
5014
5024
  ? (colValue.display_value || '').trim()
5015
5025
  : (colValue.text || '').trim();
5016
5026
  const searchValue = identifierValue.trim().toLowerCase();
5017
- console.log(` - Column type: ${colValue.type}`);
5018
- console.log(` - Column value found: "${compareValue}"`);
5019
- console.log(` - Search value: "${identifierValue}"`);
5020
- matches = compareValue.toLowerCase() === searchValue;
5021
- console.log(` - Initial match: ${matches}`);
5027
+ console.log(` - Found column: ID="${colValue.id}", type="${colValue.type}"`);
5028
+ console.log(` - Column value found: "${compareValue}" (length: ${compareValue.length}, raw: ${JSON.stringify(compareValue)})`);
5029
+ console.log(` - Search value: "${identifierValue}" (length: ${identifierValue.trim().length}, trimmed: "${identifierValue.trim()}", raw: ${JSON.stringify(identifierValue)})`);
5030
+ const trimmedCompare = compareValue.trim().toLowerCase();
5031
+ const trimmedSearch = searchValue.trim();
5032
+ matches = trimmedCompare === trimmedSearch;
5033
+ console.log(` - Trimmed compare: "${trimmedCompare}" === "${trimmedSearch}" = ${matches}`);
5022
5034
  if (!matches && isStatusColumn) {
5023
- const normalizedCompare = compareValue.toLowerCase().replace(/\s+/g, ' ').trim();
5024
- const normalizedSearch = searchValue.replace(/\s+/g, ' ').trim();
5035
+ const normalizedCompare = trimmedCompare.replace(/\s+/g, ' ').trim();
5036
+ const normalizedSearch = trimmedSearch.replace(/\s+/g, ' ').trim();
5025
5037
  matches = normalizedCompare === normalizedSearch;
5026
5038
  console.log(` - Normalized compare: "${normalizedCompare}" === "${normalizedSearch}" = ${matches}`);
5039
+ if (!matches) {
5040
+ matches = normalizedCompare.includes(normalizedSearch) || normalizedSearch.includes(normalizedCompare);
5041
+ console.log(` - Contains check: "${normalizedCompare}".includes("${normalizedSearch}") OR "${normalizedSearch}".includes("${normalizedCompare}") = ${matches}`);
5042
+ }
5027
5043
  }
5028
5044
  if (matches) {
5029
5045
  console.log(` ✓✓✓ MATCH FOUND! Item ${item.id}, column type: ${colValue.type}, value: "${compareValue}"`);
@@ -5033,8 +5049,10 @@ class Worktables {
5033
5049
  }
5034
5050
  }
5035
5051
  else {
5036
- console.log(` Column value not found for item ${item.id}, identifierColumn: ${identifierColumn}`);
5037
- console.log(` - Available column_values:`, ((_16 = item.column_values) === null || _16 === void 0 ? void 0 : _16.map((cv) => cv.id).join(', ')) || 'none');
5052
+ console.log(` ⚠⚠⚠ Column value not found for item ${item.id}`);
5053
+ console.log(` - Looking for column ID: "${identifierColumn}"`);
5054
+ console.log(` - Available column_values:`, ((_17 = item.column_values) === null || _17 === void 0 ? void 0 : _17.map((cv) => `ID:${cv.id} (type:${cv.type}, text:"${cv.text || 'N/A'}")`).join(' | ')) || 'none');
5055
+ console.log(` - This means the identifierColumn "${identifierColumn}" does not match any column ID in this item!`);
5038
5056
  }
5039
5057
  }
5040
5058
  if (matches) {
@@ -5054,6 +5072,29 @@ class Worktables {
5054
5072
  }
5055
5073
  if (!foundItemId) {
5056
5074
  console.log(` ❌❌❌ No exact match found for identifier column "${identifierColumn}" with value "${identifierValue}"`);
5075
+ const uniqueValues = new Set();
5076
+ items.forEach((item) => {
5077
+ var _a;
5078
+ if (!isNameColumn) {
5079
+ const colValue = (_a = item.column_values) === null || _a === void 0 ? void 0 : _a.find((cv) => cv.id === identifierColumn);
5080
+ if (colValue) {
5081
+ const isBoardRelation = colValue.type === 'board_relation' || colValue.type === 'mirror';
5082
+ const value = isBoardRelation
5083
+ ? (colValue.display_value || '').trim()
5084
+ : (colValue.text || '').trim();
5085
+ if (value) {
5086
+ uniqueValues.add(value);
5087
+ }
5088
+ }
5089
+ }
5090
+ });
5091
+ if (uniqueValues.size > 0) {
5092
+ console.log(` 📊 Debug: Found ${uniqueValues.size} unique value(s) in column "${identifierColumn}":`);
5093
+ Array.from(uniqueValues).sort().forEach((val, idx) => {
5094
+ console.log(` ${idx + 1}. "${val}" (length: ${val.length}, raw: ${JSON.stringify(val)})`);
5095
+ });
5096
+ console.log(` 🔍 Searching for: "${identifierValue.trim()}" (length: ${identifierValue.trim().length}, raw: ${JSON.stringify(identifierValue)})`);
5097
+ }
5057
5098
  }
5058
5099
  }
5059
5100
  console.log('═══════════════════════════════════════════════════════════');
@@ -5104,7 +5145,7 @@ class Worktables {
5104
5145
  id: itemData.id,
5105
5146
  url: itemData.url || '',
5106
5147
  operation: 'update',
5107
- board_id: ((_17 = itemData.board) === null || _17 === void 0 ? void 0 : _17.id) || boardId,
5148
+ board_id: ((_18 = itemData.board) === null || _18 === void 0 ? void 0 : _18.id) || boardId,
5108
5149
  column_values: column_values_object,
5109
5150
  };
5110
5151
  itemUpdated = true;
@@ -5206,8 +5247,8 @@ class Worktables {
5206
5247
  });
5207
5248
  }
5208
5249
  const itemData = isSubitem && parentId
5209
- ? (_18 = responseData.data) === null || _18 === void 0 ? void 0 : _18.create_subitem
5210
- : (_19 = responseData.data) === null || _19 === void 0 ? void 0 : _19.create_item;
5250
+ ? (_19 = responseData.data) === null || _19 === void 0 ? void 0 : _19.create_subitem
5251
+ : (_20 = responseData.data) === null || _20 === void 0 ? void 0 : _20.create_item;
5211
5252
  if (!itemData || !itemData.id) {
5212
5253
  console.log(' ❌ No item data returned in response');
5213
5254
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
@@ -5221,7 +5262,7 @@ class Worktables {
5221
5262
  name: itemData.name || itemName,
5222
5263
  url: itemData.url || '',
5223
5264
  operation: 'create',
5224
- board_id: ((_20 = itemData.board) === null || _20 === void 0 ? void 0 : _20.id) || boardId,
5265
+ board_id: ((_21 = itemData.board) === null || _21 === void 0 ? void 0 : _21.id) || boardId,
5225
5266
  column_values: column_values_object,
5226
5267
  };
5227
5268
  if (isSubitem && parentId) {
@@ -5262,12 +5303,12 @@ class Worktables {
5262
5303
  if (itemParsed.errors) {
5263
5304
  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: JSON.stringify(itemParsed.errors) });
5264
5305
  }
5265
- const items = ((_21 = itemParsed === null || itemParsed === void 0 ? void 0 : itemParsed.data) === null || _21 === void 0 ? void 0 : _21.items) || [];
5306
+ const items = ((_22 = itemParsed === null || itemParsed === void 0 ? void 0 : itemParsed.data) === null || _22 === void 0 ? void 0 : _22.items) || [];
5266
5307
  if (items.length === 0) {
5267
5308
  return [[{ json: { item_id: itemId, activity_logs: [] } }]];
5268
5309
  }
5269
5310
  const item = items[0];
5270
- const boardId = (_22 = item.board) === null || _22 === void 0 ? void 0 : _22.id;
5311
+ const boardId = (_23 = item.board) === null || _23 === void 0 ? void 0 : _23.id;
5271
5312
  if (!boardId) {
5272
5313
  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'Could not retrieve board ID for the item.' });
5273
5314
  }
@@ -5305,7 +5346,7 @@ class Worktables {
5305
5346
  if (parsed.errors) {
5306
5347
  throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: JSON.stringify(parsed.errors) });
5307
5348
  }
5308
- const boards = ((_23 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _23 === void 0 ? void 0 : _23.boards) || [];
5349
+ const boards = ((_24 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _24 === void 0 ? void 0 : _24.boards) || [];
5309
5350
  const activityLogs = boards.length > 0 ? (boards[0].activity_logs || []) : [];
5310
5351
  const formatted = {
5311
5352
  item_id: item.id,
@@ -5464,7 +5505,7 @@ class Worktables {
5464
5505
  body: { query },
5465
5506
  });
5466
5507
  const parsed = typeof rawResponse === 'string' ? JSON.parse(rawResponse) : rawResponse;
5467
- const itemsPage = (_26 = (_25 = (_24 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _24 === void 0 ? void 0 : _24.boards) === null || _25 === void 0 ? void 0 : _25[0]) === null || _26 === void 0 ? void 0 : _26.items_page;
5508
+ const itemsPage = (_27 = (_26 = (_25 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _25 === void 0 ? void 0 : _25.boards) === null || _26 === void 0 ? void 0 : _26[0]) === null || _27 === void 0 ? void 0 : _27.items_page;
5468
5509
  const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
5469
5510
  cursor = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor) || null;
5470
5511
  allItems = allItems.concat(items);
@@ -5543,7 +5584,7 @@ class Worktables {
5543
5584
  const sortOptions = this.getNodeParameter('sortOptions', 0, { sortBy: [] });
5544
5585
  const logicalOperator = this.getNodeParameter('logicalOperator', 0);
5545
5586
  let rulesArray = [];
5546
- if (((_27 = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _27 === void 0 ? void 0 : _27.length) > 0) {
5587
+ if (((_28 = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _28 === void 0 ? void 0 : _28.length) > 0) {
5547
5588
  rulesArray = filterRules.rule.map((rule) => {
5548
5589
  let formattedValue;
5549
5590
  if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
@@ -5587,7 +5628,7 @@ class Worktables {
5587
5628
  });
5588
5629
  }
5589
5630
  const orderByArray = [];
5590
- if (((_28 = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _28 === void 0 ? void 0 : _28.length) > 0) {
5631
+ if (((_29 = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _29 === void 0 ? void 0 : _29.length) > 0) {
5591
5632
  sortOptions.sortBy.forEach((sort) => {
5592
5633
  orderByArray.push(`{
5593
5634
  column_id: "${sort.columnId}",
@@ -5643,7 +5684,7 @@ class Worktables {
5643
5684
  body: { query },
5644
5685
  });
5645
5686
  const parsed = JSON.parse(rawResponse);
5646
- const items = ((_32 = (_31 = (_30 = (_29 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _29 === void 0 ? void 0 : _29.boards) === null || _30 === void 0 ? void 0 : _30[0]) === null || _31 === void 0 ? void 0 : _31.items_page) === null || _32 === void 0 ? void 0 : _32.items) || [];
5687
+ const items = ((_33 = (_32 = (_31 = (_30 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _30 === void 0 ? void 0 : _30.boards) === null || _31 === void 0 ? void 0 : _31[0]) === null || _32 === void 0 ? void 0 : _32.items_page) === null || _33 === void 0 ? void 0 : _33.items) || [];
5647
5688
  const formattedItems = await Promise.all(items.map(async (item) => {
5648
5689
  const formatted = {
5649
5690
  id: item.id,
@@ -5677,7 +5718,7 @@ class Worktables {
5677
5718
  const advancedSortOptions = this.getNodeParameter('advancedSortOptions', 0, { sortBy: [] });
5678
5719
  const logicalOperator = this.getNodeParameter('logicalOperatorAdvanced', 0);
5679
5720
  let rulesArray = [];
5680
- if (((_33 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _33 === void 0 ? void 0 : _33.length) > 0) {
5721
+ if (((_34 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _34 === void 0 ? void 0 : _34.length) > 0) {
5681
5722
  console.log('Processing filter rules:', advancedFilterRules.rule);
5682
5723
  rulesArray = advancedFilterRules.rule.map((rule) => {
5683
5724
  let formattedValue;
@@ -5893,7 +5934,7 @@ class Worktables {
5893
5934
  });
5894
5935
  }
5895
5936
  const orderByArray = [];
5896
- if (((_34 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _34 === void 0 ? void 0 : _34.length) > 0) {
5937
+ if (((_35 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _35 === void 0 ? void 0 : _35.length) > 0) {
5897
5938
  advancedSortOptions.sortBy.forEach((sort) => {
5898
5939
  orderByArray.push(`{
5899
5940
  column_id: "${sort.columnId}",
@@ -5975,7 +6016,7 @@ class Worktables {
5975
6016
  body: { query: testQuery },
5976
6017
  });
5977
6018
  const testParsed = JSON.parse(testResponse);
5978
- const testItems = ((_38 = (_37 = (_36 = (_35 = testParsed === null || testParsed === void 0 ? void 0 : testParsed.data) === null || _35 === void 0 ? void 0 : _35.boards) === null || _36 === void 0 ? void 0 : _36[0]) === null || _37 === void 0 ? void 0 : _37.items_page) === null || _38 === void 0 ? void 0 : _38.items) || [];
6019
+ const testItems = ((_39 = (_38 = (_37 = (_36 = testParsed === null || testParsed === void 0 ? void 0 : testParsed.data) === null || _36 === void 0 ? void 0 : _36.boards) === null || _37 === void 0 ? void 0 : _37[0]) === null || _38 === void 0 ? void 0 : _38.items_page) === null || _39 === void 0 ? void 0 : _39.items) || [];
5979
6020
  console.log('Test - Items in board (no filters):', testItems.length);
5980
6021
  if (testItems.length > 0) {
5981
6022
  console.log('Sample item column values:', testItems[0].column_values);
@@ -5987,7 +6028,7 @@ class Worktables {
5987
6028
  body: { query },
5988
6029
  });
5989
6030
  const parsed = JSON.parse(rawResponse);
5990
- const itemsPage = (_41 = (_40 = (_39 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _39 === void 0 ? void 0 : _39.boards) === null || _40 === void 0 ? void 0 : _40[0]) === null || _41 === void 0 ? void 0 : _41.items_page;
6031
+ const itemsPage = (_42 = (_41 = (_40 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _40 === void 0 ? void 0 : _40.boards) === null || _41 === void 0 ? void 0 : _41[0]) === null || _42 === void 0 ? void 0 : _42.items_page;
5991
6032
  const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
5992
6033
  const nextCursor = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor;
5993
6034
  const hasMore = nextCursor ? true : false;
@@ -6169,7 +6210,7 @@ class Worktables {
6169
6210
  body: { query },
6170
6211
  });
6171
6212
  const parsed = JSON.parse(rawResponse);
6172
- const itemsPage = (_46 = (_45 = (_44 = (_43 = (_42 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _42 === void 0 ? void 0 : _42.boards) === null || _43 === void 0 ? void 0 : _43[0]) === null || _44 === void 0 ? void 0 : _44.groups) === null || _45 === void 0 ? void 0 : _45[0]) === null || _46 === void 0 ? void 0 : _46.items_page;
6213
+ const itemsPage = (_47 = (_46 = (_45 = (_44 = (_43 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _43 === void 0 ? void 0 : _43.boards) === null || _44 === void 0 ? void 0 : _44[0]) === null || _45 === void 0 ? void 0 : _45.groups) === null || _46 === void 0 ? void 0 : _46[0]) === null || _47 === void 0 ? void 0 : _47.items_page;
6173
6214
  const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
6174
6215
  cursor = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor) || null;
6175
6216
  allItems = allItems.concat(items);
@@ -6266,7 +6307,7 @@ class Worktables {
6266
6307
  response = await (0, isErrorResponse_1.parseApiResponse)(response);
6267
6308
  if (response.success) {
6268
6309
  const parsed = JSON.parse(response.data);
6269
- const updates = ((_49 = (_48 = (_47 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _47 === void 0 ? void 0 : _47.items) === null || _48 === void 0 ? void 0 : _48[0]) === null || _49 === void 0 ? void 0 : _49.updates) || [];
6310
+ const updates = ((_50 = (_49 = (_48 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _48 === void 0 ? void 0 : _48.items) === null || _49 === void 0 ? void 0 : _49[0]) === null || _50 === void 0 ? void 0 : _50.updates) || [];
6270
6311
  const formattedUpdates = updates.map((update) => {
6271
6312
  const pinnedToTop = update.pinned_to_top || [];
6272
6313
  const isPinnedToTop = Array.isArray(pinnedToTop) && pinnedToTop.length > 0;
@@ -6331,7 +6372,7 @@ class Worktables {
6331
6372
  console.log('variables:', variables);
6332
6373
  response = await (0, worktablesHelpers_1.makeGraphQLRequest)(this, mutation, headers, variables);
6333
6374
  console.log('Create Update Result:', JSON.stringify(response, null, 2));
6334
- const updateId = (_51 = (_50 = JSON.parse(response).data) === null || _50 === void 0 ? void 0 : _50.create_update) === null || _51 === void 0 ? void 0 : _51.id;
6375
+ const updateId = (_52 = (_51 = JSON.parse(response).data) === null || _51 === void 0 ? void 0 : _51.create_update) === null || _52 === void 0 ? void 0 : _52.id;
6335
6376
  if (!updateId) {
6336
6377
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
6337
6378
  message: 'Error creating update: Update not created, no ID returned',
@@ -6640,7 +6681,7 @@ class Worktables {
6640
6681
  body: { query },
6641
6682
  json: true,
6642
6683
  });
6643
- const asset = (_53 = (_52 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _52 === void 0 ? void 0 : _52.assets) === null || _53 === void 0 ? void 0 : _53[0];
6684
+ const asset = (_54 = (_53 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _53 === void 0 ? void 0 : _53.assets) === null || _54 === void 0 ? void 0 : _54[0];
6644
6685
  if (!(asset === null || asset === void 0 ? void 0 : asset.public_url)) {
6645
6686
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
6646
6687
  message: 'Public URL not found for the given file ID.',