@worktables/n8n-nodes-worktables 12.1.2 → 12.1.4

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.
@@ -244,6 +244,12 @@ class Worktables {
244
244
  description: 'Search items in a board using a filter',
245
245
  action: 'Search items by filter',
246
246
  },
247
+ {
248
+ name: 'Advanced Search Items',
249
+ value: 'searchItemsAdvanced',
250
+ description: 'Advanced search with date ranges, numeric comparisons, and complex filters',
251
+ action: 'Advanced search items',
252
+ },
247
253
  {
248
254
  name: 'List Item Subscribers',
249
255
  value: 'listItemSubscribers',
@@ -1022,7 +1028,7 @@ class Worktables {
1022
1028
  description: 'Select a Monday board. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
1023
1029
  displayOptions: {
1024
1030
  show: {
1025
- operation: ['duplicateItem', 'searchItems', 'uploadItemFile', 'getGroup'],
1031
+ operation: ['duplicateItem', 'searchItems', 'searchItemsAdvanced', 'uploadItemFile', 'getGroup'],
1026
1032
  },
1027
1033
  },
1028
1034
  },
@@ -1528,19 +1534,6 @@ class Worktables {
1528
1534
  },
1529
1535
  ],
1530
1536
  },
1531
- {
1532
- displayName: 'Search Term',
1533
- name: 'searchTerm',
1534
- type: 'string',
1535
- default: '',
1536
- description: 'Search term to find items by name or content',
1537
- displayOptions: {
1538
- show: {
1539
- resource: ['item'],
1540
- operation: ['searchItems'],
1541
- },
1542
- },
1543
- },
1544
1537
  {
1545
1538
  displayName: 'Logical Operator',
1546
1539
  name: 'logicalOperator',
@@ -1580,28 +1573,53 @@ class Worktables {
1580
1573
  displayName: 'Limit',
1581
1574
  name: 'limit',
1582
1575
  type: 'number',
1583
- typeOptions: {
1584
- minValue: 1,
1585
- },
1586
1576
  default: 50,
1587
1577
  description: 'Max number of results to return',
1588
1578
  displayOptions: {
1589
1579
  show: {
1590
1580
  resource: ['item'],
1591
- operation: ['searchItems'],
1581
+ operation: ['searchItemsAdvanced'],
1592
1582
  },
1593
1583
  },
1584
+ typeOptions: {
1585
+ minValue: 1,
1586
+ },
1594
1587
  },
1595
1588
  {
1596
1589
  displayName: 'Cursor',
1597
1590
  name: 'cursor',
1598
1591
  type: 'string',
1599
1592
  default: '',
1600
- description: 'Cursor for pagination (from previous response)',
1593
+ description: 'Cursor for pagination (get from previous response)',
1601
1594
  displayOptions: {
1602
1595
  show: {
1603
1596
  resource: ['item'],
1604
- operation: ['searchItems'],
1597
+ operation: ['searchItemsAdvanced'],
1598
+ },
1599
+ },
1600
+ },
1601
+ {
1602
+ displayName: 'Search Term',
1603
+ name: 'searchTerm',
1604
+ type: 'string',
1605
+ default: '',
1606
+ description: 'Search term for text-based search across items',
1607
+ displayOptions: {
1608
+ show: {
1609
+ resource: ['item'],
1610
+ operation: ['searchItemsAdvanced'],
1611
+ },
1612
+ },
1613
+ },
1614
+ {
1615
+ displayName: 'Fetch Column Values',
1616
+ name: 'fetchColumnValuesAdvanced',
1617
+ type: 'boolean',
1618
+ default: true,
1619
+ description: 'Whether to fetch column values',
1620
+ displayOptions: {
1621
+ show: {
1622
+ operation: ['searchItemsAdvanced'],
1605
1623
  },
1606
1624
  },
1607
1625
  },
@@ -1676,6 +1694,100 @@ class Worktables {
1676
1694
  },
1677
1695
  ],
1678
1696
  },
1697
+ {
1698
+ displayName: 'Advanced Filter Rules',
1699
+ name: 'advancedFilterRules',
1700
+ type: 'fixedCollection',
1701
+ typeOptions: { multipleValues: true },
1702
+ default: {},
1703
+ displayOptions: {
1704
+ show: {
1705
+ resource: ['item'],
1706
+ operation: ['searchItemsAdvanced'],
1707
+ },
1708
+ },
1709
+ options: [
1710
+ {
1711
+ displayName: 'Rule',
1712
+ name: 'rule',
1713
+ values: [
1714
+ {
1715
+ displayName: 'Column',
1716
+ name: 'columnId',
1717
+ type: 'options',
1718
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
1719
+ typeOptions: {
1720
+ loadOptionsDependsOn: ['boardId'],
1721
+ loadOptionsMethod: 'getColumnsItems',
1722
+ },
1723
+ default: '',
1724
+ },
1725
+ {
1726
+ displayName: 'Compare Attribute',
1727
+ name: 'compareAttribute',
1728
+ type: 'string',
1729
+ default: '',
1730
+ description: 'Optional attribute for comparison (dependent on column type)',
1731
+ },
1732
+ {
1733
+ displayName: 'Operator',
1734
+ name: 'operator',
1735
+ type: 'options',
1736
+ options: [
1737
+ { name: 'Any Of', value: 'any_of' },
1738
+ { name: 'Not Any Of', value: 'not_any_of' },
1739
+ { name: 'Is Empty', value: 'is_empty' },
1740
+ { name: 'Is Not Empty', value: 'is_not_empty' },
1741
+ { name: 'Greater Than', value: 'greater_than' },
1742
+ { name: 'Greater Than or Equal', value: 'greater_than_or_equals' },
1743
+ { name: 'Less Than', value: 'lower_than' },
1744
+ { name: 'Less Than or Equal', value: 'lower_than_or_equal' },
1745
+ { name: 'Between', value: 'between' },
1746
+ { name: 'Contains Text', value: 'contains_text' },
1747
+ { name: 'Does Not Contain Text', value: 'not_contains_text' },
1748
+ { name: 'Contains Terms', value: 'contains_terms' },
1749
+ { name: 'Starts With', value: 'starts_with' },
1750
+ { name: 'Ends With', value: 'ends_with' },
1751
+ { name: 'Within the Next', value: 'within_the_next' },
1752
+ { name: 'Within the Last', value: 'within_the_last' },
1753
+ ],
1754
+ default: 'any_of',
1755
+ description: 'The condition for value comparison',
1756
+ },
1757
+ {
1758
+ displayName: 'Compare Value',
1759
+ name: 'compareValue',
1760
+ type: 'string',
1761
+ default: '',
1762
+ description: 'The value to filter by (format depends on column type)',
1763
+ },
1764
+ ],
1765
+ },
1766
+ ],
1767
+ },
1768
+ {
1769
+ displayName: 'Logical Operator',
1770
+ name: 'logicalOperatorAdvanced',
1771
+ type: 'options',
1772
+ options: [
1773
+ {
1774
+ name: 'AND',
1775
+ value: 'and',
1776
+ },
1777
+ {
1778
+ name: 'OR',
1779
+ value: 'or',
1780
+ },
1781
+ ],
1782
+ default: 'and',
1783
+ description: 'Logical operator to use between filter rules',
1784
+ displayOptions: {
1785
+ show: {
1786
+ resource: ['item'],
1787
+ operation: ['searchItemsAdvanced'],
1788
+ },
1789
+ },
1790
+ },
1679
1791
  {
1680
1792
  displayName: 'Sort Options',
1681
1793
  name: 'sortOptions',
@@ -1719,6 +1831,49 @@ class Worktables {
1719
1831
  },
1720
1832
  ],
1721
1833
  },
1834
+ {
1835
+ displayName: 'Advanced Sort Options',
1836
+ name: 'advancedSortOptions',
1837
+ type: 'fixedCollection',
1838
+ typeOptions: { multipleValues: true },
1839
+ default: {},
1840
+ displayOptions: {
1841
+ show: {
1842
+ resource: ['item'],
1843
+ operation: ['searchItemsAdvanced'],
1844
+ },
1845
+ },
1846
+ options: [
1847
+ {
1848
+ displayName: 'Sort By',
1849
+ name: 'sortBy',
1850
+ values: [
1851
+ {
1852
+ displayName: 'Column',
1853
+ name: 'columnId',
1854
+ type: 'options',
1855
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
1856
+ typeOptions: {
1857
+ loadOptionsDependsOn: ['boardId'],
1858
+ loadOptionsMethod: 'getColumnsItems',
1859
+ },
1860
+ default: '',
1861
+ },
1862
+ {
1863
+ displayName: 'Direction',
1864
+ name: 'direction',
1865
+ type: 'options',
1866
+ options: [
1867
+ { name: 'Ascending', value: 'asc' },
1868
+ { name: 'Descending', value: 'desc' },
1869
+ ],
1870
+ default: 'asc',
1871
+ description: 'The sort direction',
1872
+ },
1873
+ ],
1874
+ },
1875
+ ],
1876
+ },
1722
1877
  {
1723
1878
  displayName: 'File Column',
1724
1879
  name: 'fileColumnId',
@@ -2577,7 +2732,7 @@ class Worktables {
2577
2732
  };
2578
2733
  }
2579
2734
  async execute() {
2580
- 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;
2735
+ 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;
2581
2736
  const resource = this.getNodeParameter('resource', 0);
2582
2737
  const operation = this.getNodeParameter('operation', 0);
2583
2738
  const credentials = await this.getCredentials('WorktablesApi');
@@ -4286,9 +4441,6 @@ class Worktables {
4286
4441
  case 'searchItems': {
4287
4442
  const boardId = this.getNodeParameter('boardId', 0);
4288
4443
  const fetchColumnValues = this.getNodeParameter('fetchColumnValues', 0, false);
4289
- const searchTerm = this.getNodeParameter('searchTerm', 0, '');
4290
- const limit = this.getNodeParameter('limit', 0, 50);
4291
- const cursor = this.getNodeParameter('cursor', 0, '');
4292
4444
  const filterRules = this.getNodeParameter('filterRules', 0);
4293
4445
  const sortOptions = this.getNodeParameter('sortOptions', 0, { sortBy: [] });
4294
4446
  const logicalOperator = this.getNodeParameter('logicalOperator', 0);
@@ -4297,7 +4449,12 @@ class Worktables {
4297
4449
  rulesArray = filterRules.rule.map((rule) => {
4298
4450
  let formattedValue;
4299
4451
  if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
4300
- formattedValue = 'null';
4452
+ if (formattedValue === 'null') {
4453
+ formattedValue = null;
4454
+ }
4455
+ else {
4456
+ formattedValue = '""';
4457
+ }
4301
4458
  }
4302
4459
  else if (rule.operator === 'between') {
4303
4460
  try {
@@ -4321,30 +4478,14 @@ class Worktables {
4321
4478
  formattedValue = JSON.stringify(values);
4322
4479
  }
4323
4480
  }
4324
- else if (['within_the_next', 'within_the_last'].includes(rule.operator)) {
4325
- const days = parseInt(rule.compareValue);
4326
- if (isNaN(days)) {
4327
- throw new n8n_workflow_1.NodeApiError(this.getNode(), {
4328
- message: `Invalid value for ${rule.operator}: expected number of days`,
4329
- httpCode: '400',
4330
- });
4331
- }
4332
- formattedValue = days.toString();
4333
- }
4334
4481
  else {
4335
4482
  formattedValue = JSON.stringify(rule.compareValue);
4336
4483
  }
4337
- const ruleObj = {
4338
- column_id: rule.columnId,
4339
- operator: rule.operator
4340
- };
4341
- if (formattedValue !== 'null') {
4342
- ruleObj.compare_value = formattedValue;
4343
- }
4344
- if (rule.compareAttribute) {
4345
- ruleObj.compare_attribute = rule.compareAttribute;
4346
- }
4347
- return JSON.stringify(ruleObj);
4484
+ return `{
4485
+ column_id: "${rule.columnId}",
4486
+ compare_value: ${formattedValue},
4487
+ operator: ${rule.operator}
4488
+ }`;
4348
4489
  });
4349
4490
  }
4350
4491
  const orderByArray = [];
@@ -4356,28 +4497,13 @@ class Worktables {
4356
4497
  }`);
4357
4498
  });
4358
4499
  }
4359
- const queryParams = [];
4360
- if (limit && limit > 0) {
4361
- queryParams.push(`limit: ${Math.min(limit, 500)}`);
4362
- }
4363
- if (cursor) {
4364
- queryParams.push(`cursor: "${cursor}"`);
4365
- }
4366
- if (searchTerm) {
4367
- queryParams.push(`search_term: "${searchTerm}"`);
4368
- }
4369
- if (logicalOperator) {
4370
- queryParams.push(`operator: ${logicalOperator}`);
4371
- }
4372
- if (rulesArray.length > 0) {
4373
- queryParams.push(`rules: [${rulesArray.join(', ')}]`);
4374
- }
4375
- if (orderByArray.length > 0) {
4376
- queryParams.push(`order_by: [${orderByArray.join(', ')}]`);
4377
- }
4378
4500
  const query = `query {
4379
4501
  boards(ids: [${boardId}]) {
4380
- items_page(${queryParams.length > 0 ? `query_params: { ${queryParams.join(', ')} }` : ''}) {
4502
+ items_page(limit: 100, query_params: {
4503
+ ${logicalOperator ? `operator: ${logicalOperator},` : ''}
4504
+ ${rulesArray.length > 0 ? `rules: [${rulesArray.join(', ')}],` : ''}
4505
+ ${orderByArray.length > 0 ? `order_by: [${orderByArray.join(', ')}]` : ''}
4506
+ }) {
4381
4507
  items {
4382
4508
  id
4383
4509
  name
@@ -4409,9 +4535,7 @@ class Worktables {
4409
4535
  body: { query },
4410
4536
  });
4411
4537
  const parsed = JSON.parse(rawResponse);
4412
- const itemsPage = (_0 = (_z = (_y = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _y === void 0 ? void 0 : _y.boards) === null || _z === void 0 ? void 0 : _z[0]) === null || _0 === void 0 ? void 0 : _0.items_page;
4413
- const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
4414
- const nextCursor = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor;
4538
+ const items = ((_1 = (_0 = (_z = (_y = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _y === void 0 ? void 0 : _y.boards) === null || _z === void 0 ? void 0 : _z[0]) === null || _0 === void 0 ? void 0 : _0.items_page) === null || _1 === void 0 ? void 0 : _1.items) || [];
4415
4539
  const formattedItems = await Promise.all(items.map(async (item) => {
4416
4540
  const formatted = {
4417
4541
  id: item.id,
@@ -4445,13 +4569,186 @@ class Worktables {
4445
4569
  }
4446
4570
  return formatted;
4447
4571
  }));
4572
+ response = JSON.stringify(formattedItems);
4573
+ break;
4574
+ }
4575
+ case 'searchItemsAdvanced': {
4576
+ const boardId = this.getNodeParameter('boardId', 0);
4577
+ const limit = this.getNodeParameter('limit', 0, 25);
4578
+ const cursor = this.getNodeParameter('cursor', 0, '');
4579
+ const searchTerm = this.getNodeParameter('searchTerm', 0, '');
4580
+ const fetchColumnValues = this.getNodeParameter('fetchColumnValuesAdvanced', 0, true);
4581
+ const advancedFilterRules = this.getNodeParameter('advancedFilterRules', 0);
4582
+ const advancedSortOptions = this.getNodeParameter('advancedSortOptions', 0, { sortBy: [] });
4583
+ const logicalOperator = this.getNodeParameter('logicalOperatorAdvanced', 0);
4584
+ let rulesArray = [];
4585
+ if (((_2 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _2 === void 0 ? void 0 : _2.length) > 0) {
4586
+ rulesArray = advancedFilterRules.rule.map((rule) => {
4587
+ let formattedValue;
4588
+ if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
4589
+ formattedValue = '""';
4590
+ }
4591
+ else if (rule.operator === 'between') {
4592
+ try {
4593
+ const rangeValues = JSON.parse(rule.compareValue);
4594
+ formattedValue = JSON.stringify(rangeValues);
4595
+ }
4596
+ catch (e) {
4597
+ const values = rule.compareValue.split(',').map((v) => v.trim());
4598
+ formattedValue = JSON.stringify(values);
4599
+ }
4600
+ }
4601
+ else if (['within_the_next', 'within_the_last'].includes(rule.operator)) {
4602
+ try {
4603
+ const dateRange = JSON.parse(rule.compareValue);
4604
+ formattedValue = JSON.stringify(dateRange);
4605
+ }
4606
+ catch (e) {
4607
+ formattedValue = JSON.stringify({ days: parseInt(rule.compareValue) || 7 });
4608
+ }
4609
+ }
4610
+ else if (['greater_than', 'greater_than_or_equals', 'lower_than', 'lower_than_or_equal'].includes(rule.operator)) {
4611
+ if (rule.compareAttribute === 'date') {
4612
+ const dateValue = new Date(rule.compareValue).toISOString();
4613
+ formattedValue = JSON.stringify(dateValue);
4614
+ }
4615
+ else {
4616
+ formattedValue = JSON.stringify(rule.compareValue);
4617
+ }
4618
+ }
4619
+ else if (rule.operator === 'any_of' || rule.operator === 'not_any_of') {
4620
+ const dateRegex = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
4621
+ const isoDateRegex = /^\d{4}-\d{2}-\d{2}$/;
4622
+ if (dateRegex.test(rule.compareValue)) {
4623
+ const [month, day, year] = rule.compareValue.split('/');
4624
+ const formattedDate = `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`;
4625
+ formattedValue = JSON.stringify([formattedDate]);
4626
+ }
4627
+ else if (isoDateRegex.test(rule.compareValue)) {
4628
+ formattedValue = JSON.stringify([rule.compareValue]);
4629
+ }
4630
+ else {
4631
+ try {
4632
+ const multiValues = JSON.parse(rule.compareValue);
4633
+ formattedValue = Array.isArray(multiValues)
4634
+ ? JSON.stringify(multiValues)
4635
+ : JSON.stringify([rule.compareValue]);
4636
+ }
4637
+ catch (e) {
4638
+ const values = rule.compareValue.split(',').map((v) => v.trim());
4639
+ formattedValue = JSON.stringify(values);
4640
+ }
4641
+ }
4642
+ }
4643
+ else {
4644
+ formattedValue = JSON.stringify(rule.compareValue);
4645
+ }
4646
+ return `{
4647
+ column_id: "${rule.columnId}",
4648
+ ${rule.compareAttribute ? `compare_attribute: "${rule.compareAttribute}",` : ''}
4649
+ compare_value: ${formattedValue},
4650
+ operator: ${rule.operator}
4651
+ }`;
4652
+ });
4653
+ }
4654
+ const orderByArray = [];
4655
+ if (((_3 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _3 === void 0 ? void 0 : _3.length) > 0) {
4656
+ advancedSortOptions.sortBy.forEach((sort) => {
4657
+ orderByArray.push(`{
4658
+ column_id: "${sort.columnId}",
4659
+ direction: ${sort.direction}
4660
+ }`);
4661
+ });
4662
+ }
4663
+ const query = `query {
4664
+ boards(ids: [${boardId}]) {
4665
+ items_page(limit: ${limit}, ${cursor ? `cursor: "${cursor}",` : ''} query_params: {
4666
+ ${logicalOperator ? `operator: ${logicalOperator},` : ''}
4667
+ ${rulesArray.length > 0 ? `rules: [${rulesArray.join(', ')}],` : ''}
4668
+ ${orderByArray.length > 0 ? `order_by: [${orderByArray.join(', ')}]` : ''}
4669
+ }${searchTerm ? `, search_term: "${searchTerm}"` : ''}) {
4670
+ items {
4671
+ id
4672
+ name
4673
+ column_values {
4674
+ id
4675
+ text
4676
+ value
4677
+ type
4678
+ display_value
4679
+ }
4680
+ group {
4681
+ id
4682
+ title
4683
+ color
4684
+ position
4685
+ }
4686
+ state
4687
+ created_at
4688
+ updated_at
4689
+ subscribers {
4690
+ id
4691
+ name
4692
+ email
4693
+ }
4694
+ }
4695
+ cursor
4696
+ has_more
4697
+ }
4698
+ }
4699
+ }`;
4700
+ console.log('Advanced Search Query: ', query);
4701
+ console.log('Filter Rules: ', rulesArray);
4702
+ const rawResponse = await this.helpers.request({
4703
+ method: 'POST',
4704
+ url: 'https://api.monday.com/v2',
4705
+ headers,
4706
+ body: { query },
4707
+ });
4708
+ const parsed = JSON.parse(rawResponse);
4709
+ const itemsPage = (_6 = (_5 = (_4 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _4 === void 0 ? void 0 : _4.boards) === null || _5 === void 0 ? void 0 : _5[0]) === null || _6 === void 0 ? void 0 : _6.items_page;
4710
+ const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
4711
+ const nextCursor = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor;
4712
+ const hasMore = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.has_more;
4713
+ const formattedItems = await Promise.all(items.map(async (item) => {
4714
+ const formatted = {
4715
+ id: item.id,
4716
+ name: item.name,
4717
+ group: item.group,
4718
+ state: item.state,
4719
+ created_at: item.created_at,
4720
+ updated_at: item.updated_at,
4721
+ subscribers: item.subscribers,
4722
+ column_values: !fetchColumnValues ? undefined : {},
4723
+ _pagination: {
4724
+ nextCursor,
4725
+ hasMore,
4726
+ },
4727
+ };
4728
+ if (!fetchColumnValues)
4729
+ return formatted;
4730
+ for (const col of item.column_values || []) {
4731
+ if (col.type === 'subtasks')
4732
+ continue;
4733
+ const formattedCol = {
4734
+ type: col.type,
4735
+ value: await (0, parseValue_1.parseValue)(col.value),
4736
+ text: col.text,
4737
+ };
4738
+ if ('display_value' in col) {
4739
+ formattedCol.display_value = col.display_value;
4740
+ }
4741
+ formatted.column_values[col.id] = formattedCol;
4742
+ }
4743
+ return formatted;
4744
+ }));
4448
4745
  const result = {
4449
4746
  items: formattedItems,
4450
4747
  pagination: {
4451
- cursor: nextCursor,
4452
- has_more: !!nextCursor,
4453
- count: formattedItems.length
4454
- }
4748
+ nextCursor,
4749
+ hasMore,
4750
+ totalReturned: formattedItems.length,
4751
+ },
4455
4752
  };
4456
4753
  response = JSON.stringify(result);
4457
4754
  break;
@@ -4557,7 +4854,7 @@ class Worktables {
4557
4854
  body: { query },
4558
4855
  });
4559
4856
  const parsed = JSON.parse(rawResponse);
4560
- const items = ((_6 = (_5 = (_4 = (_3 = (_2 = (_1 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _1 === void 0 ? void 0 : _1.boards) === null || _2 === void 0 ? void 0 : _2[0]) === null || _3 === void 0 ? void 0 : _3.groups) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.items_page) === null || _6 === void 0 ? void 0 : _6.items) || [];
4857
+ const items = ((_12 = (_11 = (_10 = (_9 = (_8 = (_7 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _7 === void 0 ? void 0 : _7.boards) === null || _8 === void 0 ? void 0 : _8[0]) === null || _9 === void 0 ? void 0 : _9.groups) === null || _10 === void 0 ? void 0 : _10[0]) === null || _11 === void 0 ? void 0 : _11.items_page) === null || _12 === void 0 ? void 0 : _12.items) || [];
4561
4858
  const formattedItems = await Promise.all(items.map(async (item) => {
4562
4859
  const formatted = {
4563
4860
  id: item.id,
@@ -4681,7 +4978,7 @@ class Worktables {
4681
4978
  body: { query: mutation },
4682
4979
  });
4683
4980
  console.log('Create Update Result:', JSON.stringify(response, null, 2));
4684
- const updateId = (_8 = (_7 = JSON.parse(response).data) === null || _7 === void 0 ? void 0 : _7.create_update) === null || _8 === void 0 ? void 0 : _8.id;
4981
+ const updateId = (_14 = (_13 = JSON.parse(response).data) === null || _13 === void 0 ? void 0 : _13.create_update) === null || _14 === void 0 ? void 0 : _14.id;
4685
4982
  if (!updateId) {
4686
4983
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
4687
4984
  message: 'Error creating update: Update not created, no ID returned',
@@ -5001,7 +5298,7 @@ class Worktables {
5001
5298
  body: { query },
5002
5299
  json: true,
5003
5300
  });
5004
- const asset = (_10 = (_9 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _9 === void 0 ? void 0 : _9.assets) === null || _10 === void 0 ? void 0 : _10[0];
5301
+ const asset = (_16 = (_15 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _15 === void 0 ? void 0 : _15.assets) === null || _16 === void 0 ? void 0 : _16[0];
5005
5302
  if (!(asset === null || asset === void 0 ? void 0 : asset.public_url)) {
5006
5303
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
5007
5304
  message: 'Public URL not found for the given file ID.',