@worktables/n8n-nodes-worktables 12.2.21 → 12.2.22

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
- const identifierOperator = this.getNodeParameter('identifierOperator', 0, 'equals');
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,29 +4384,32 @@ class Worktables {
4447
4384
  for (const subitem of item.subitems) {
4448
4385
  let matches = false;
4449
4386
  if (isNameColumn) {
4450
- const subitemName = (subitem.name || '').trim().toLowerCase();
4451
- const searchValue = identifierValue.trim().toLowerCase();
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 = (_0 = subitem.column_values) === null || _0 === void 0 ? void 0 : _0.find((cv) => cv.id === identifierColumn);
4391
+ const colValue = (_1 = subitem.column_values) === null || _1 === void 0 ? void 0 : _1.find((cv) => cv.id === identifierColumn);
4471
4392
  if (colValue) {
4472
- matches = compareValues(colValue, identifierValue, identifierOperator);
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;
4473
4413
  }
4474
4414
  }
4475
4415
  if (matches) {
@@ -4486,29 +4426,32 @@ class Worktables {
4486
4426
  for (const item of items) {
4487
4427
  let matches = false;
4488
4428
  if (isNameColumn) {
4489
- const itemName = (item.name || '').trim().toLowerCase();
4490
- const searchValue = identifierValue.trim().toLowerCase();
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
- }
4429
+ matches = item.name === identifierValue ||
4430
+ ((_2 = item.name) === null || _2 === void 0 ? void 0 : _2.trim()) === identifierValue.trim();
4507
4431
  }
4508
4432
  else {
4509
- const colValue = (_1 = item.column_values) === null || _1 === void 0 ? void 0 : _1.find((cv) => cv.id === identifierColumn);
4433
+ const colValue = (_3 = item.column_values) === null || _3 === void 0 ? void 0 : _3.find((cv) => cv.id === identifierColumn);
4510
4434
  if (colValue) {
4511
- matches = compareValues(colValue, identifierValue, identifierOperator);
4435
+ let colText = colValue.text || '';
4436
+ let colValueStr = '';
4437
+ try {
4438
+ if (colValue.value) {
4439
+ const parsedValue = JSON.parse(colValue.value);
4440
+ if (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.label) {
4441
+ colValueStr = parsedValue.label;
4442
+ }
4443
+ else {
4444
+ colValueStr = (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.text) || (parsedValue === null || parsedValue === void 0 ? void 0 : parsedValue.value) || String(parsedValue);
4445
+ }
4446
+ }
4447
+ }
4448
+ catch {
4449
+ colValueStr = colValue.value || '';
4450
+ }
4451
+ const searchValue = identifierValue.trim().toLowerCase();
4452
+ const colTextLower = colText.trim().toLowerCase();
4453
+ const colValueStrLower = colValueStr.trim().toLowerCase();
4454
+ matches = colTextLower === searchValue || colValueStrLower === searchValue;
4512
4455
  }
4513
4456
  }
4514
4457
  if (matches) {
@@ -4551,7 +4494,7 @@ class Worktables {
4551
4494
  id: itemData.id,
4552
4495
  url: itemData.url || '',
4553
4496
  operation: 'update',
4554
- board_id: ((_2 = itemData.board) === null || _2 === void 0 ? void 0 : _2.id) || boardId,
4497
+ board_id: ((_4 = itemData.board) === null || _4 === void 0 ? void 0 : _4.id) || boardId,
4555
4498
  column_values: column_values_object,
4556
4499
  };
4557
4500
  itemUpdated = true;
@@ -4634,8 +4577,8 @@ class Worktables {
4634
4577
  });
4635
4578
  }
4636
4579
  const itemData = isSubitem && parentId
4637
- ? (_3 = responseData.data) === null || _3 === void 0 ? void 0 : _3.create_subitem
4638
- : (_4 = responseData.data) === null || _4 === void 0 ? void 0 : _4.create_item;
4580
+ ? (_5 = responseData.data) === null || _5 === void 0 ? void 0 : _5.create_subitem
4581
+ : (_6 = responseData.data) === null || _6 === void 0 ? void 0 : _6.create_item;
4639
4582
  if (!itemData || !itemData.id) {
4640
4583
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
4641
4584
  message: `Error creating ${isSubitem ? 'subitem' : 'item'}: No item data returned`,
@@ -4646,7 +4589,7 @@ class Worktables {
4646
4589
  name: itemData.name || itemName,
4647
4590
  url: itemData.url || '',
4648
4591
  operation: 'create',
4649
- board_id: ((_5 = itemData.board) === null || _5 === void 0 ? void 0 : _5.id) || boardId,
4592
+ board_id: ((_7 = itemData.board) === null || _7 === void 0 ? void 0 : _7.id) || boardId,
4650
4593
  column_values: column_values_object,
4651
4594
  };
4652
4595
  if (isSubitem && parentId) {
@@ -4785,7 +4728,7 @@ class Worktables {
4785
4728
  body: { query },
4786
4729
  });
4787
4730
  const parsed = typeof rawResponse === 'string' ? JSON.parse(rawResponse) : rawResponse;
4788
- const itemsPage = (_8 = (_7 = (_6 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _6 === void 0 ? void 0 : _6.boards) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.items_page;
4731
+ 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
4732
  const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
4790
4733
  cursor = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor) || null;
4791
4734
  allItems = allItems.concat(items);
@@ -4865,7 +4808,7 @@ class Worktables {
4865
4808
  const sortOptions = this.getNodeParameter('sortOptions', 0, { sortBy: [] });
4866
4809
  const logicalOperator = this.getNodeParameter('logicalOperator', 0);
4867
4810
  let rulesArray = [];
4868
- if (((_9 = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _9 === void 0 ? void 0 : _9.length) > 0) {
4811
+ if (((_11 = filterRules === null || filterRules === void 0 ? void 0 : filterRules.rule) === null || _11 === void 0 ? void 0 : _11.length) > 0) {
4869
4812
  rulesArray = filterRules.rule.map((rule) => {
4870
4813
  let formattedValue;
4871
4814
  if (['is_empty', 'is_not_empty'].includes(rule.operator)) {
@@ -4909,7 +4852,7 @@ class Worktables {
4909
4852
  });
4910
4853
  }
4911
4854
  const orderByArray = [];
4912
- if (((_10 = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _10 === void 0 ? void 0 : _10.length) > 0) {
4855
+ if (((_12 = sortOptions === null || sortOptions === void 0 ? void 0 : sortOptions.sortBy) === null || _12 === void 0 ? void 0 : _12.length) > 0) {
4913
4856
  sortOptions.sortBy.forEach((sort) => {
4914
4857
  orderByArray.push(`{
4915
4858
  column_id: "${sort.columnId}",
@@ -4955,7 +4898,7 @@ class Worktables {
4955
4898
  body: { query },
4956
4899
  });
4957
4900
  const parsed = JSON.parse(rawResponse);
4958
- const items = ((_14 = (_13 = (_12 = (_11 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _11 === void 0 ? void 0 : _11.boards) === null || _12 === void 0 ? void 0 : _12[0]) === null || _13 === void 0 ? void 0 : _13.items_page) === null || _14 === void 0 ? void 0 : _14.items) || [];
4901
+ 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
4902
  const formattedItems = await Promise.all(items.map(async (item) => {
4960
4903
  const formatted = {
4961
4904
  id: item.id,
@@ -4989,7 +4932,7 @@ class Worktables {
4989
4932
  const advancedSortOptions = this.getNodeParameter('advancedSortOptions', 0, { sortBy: [] });
4990
4933
  const logicalOperator = this.getNodeParameter('logicalOperatorAdvanced', 0);
4991
4934
  let rulesArray = [];
4992
- if (((_15 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _15 === void 0 ? void 0 : _15.length) > 0) {
4935
+ if (((_17 = advancedFilterRules === null || advancedFilterRules === void 0 ? void 0 : advancedFilterRules.rule) === null || _17 === void 0 ? void 0 : _17.length) > 0) {
4993
4936
  console.log('Processing filter rules:', advancedFilterRules.rule);
4994
4937
  rulesArray = advancedFilterRules.rule.map((rule) => {
4995
4938
  let formattedValue;
@@ -5205,7 +5148,7 @@ class Worktables {
5205
5148
  });
5206
5149
  }
5207
5150
  const orderByArray = [];
5208
- if (((_16 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _16 === void 0 ? void 0 : _16.length) > 0) {
5151
+ if (((_18 = advancedSortOptions === null || advancedSortOptions === void 0 ? void 0 : advancedSortOptions.sortBy) === null || _18 === void 0 ? void 0 : _18.length) > 0) {
5209
5152
  advancedSortOptions.sortBy.forEach((sort) => {
5210
5153
  orderByArray.push(`{
5211
5154
  column_id: "${sort.columnId}",
@@ -5277,7 +5220,7 @@ class Worktables {
5277
5220
  body: { query: testQuery },
5278
5221
  });
5279
5222
  const testParsed = JSON.parse(testResponse);
5280
- const testItems = ((_20 = (_19 = (_18 = (_17 = testParsed === null || testParsed === void 0 ? void 0 : testParsed.data) === null || _17 === void 0 ? void 0 : _17.boards) === null || _18 === void 0 ? void 0 : _18[0]) === null || _19 === void 0 ? void 0 : _19.items_page) === null || _20 === void 0 ? void 0 : _20.items) || [];
5223
+ 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
5224
  console.log('Test - Items in board (no filters):', testItems.length);
5282
5225
  if (testItems.length > 0) {
5283
5226
  console.log('Sample item column values:', testItems[0].column_values);
@@ -5289,7 +5232,7 @@ class Worktables {
5289
5232
  body: { query },
5290
5233
  });
5291
5234
  const parsed = JSON.parse(rawResponse);
5292
- const itemsPage = (_23 = (_22 = (_21 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _21 === void 0 ? void 0 : _21.boards) === null || _22 === void 0 ? void 0 : _22[0]) === null || _23 === void 0 ? void 0 : _23.items_page;
5235
+ 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
5236
  const items = (itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.items) || [];
5294
5237
  const nextCursor = itemsPage === null || itemsPage === void 0 ? void 0 : itemsPage.cursor;
5295
5238
  const hasMore = nextCursor ? true : false;
@@ -5447,7 +5390,7 @@ class Worktables {
5447
5390
  body: { query },
5448
5391
  });
5449
5392
  const parsed = JSON.parse(rawResponse);
5450
- const items = ((_29 = (_28 = (_27 = (_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.groups) === null || _27 === void 0 ? void 0 : _27[0]) === null || _28 === void 0 ? void 0 : _28.items_page) === null || _29 === void 0 ? void 0 : _29.items) || [];
5393
+ 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
5394
  const formattedItems = await Promise.all(items.map(async (item) => {
5452
5395
  const columnValues = item.column_values || [];
5453
5396
  const formatted = {
@@ -5537,7 +5480,7 @@ class Worktables {
5537
5480
  response = await (0, isErrorResponse_1.parseApiResponse)(response);
5538
5481
  if (response.success) {
5539
5482
  const parsed = JSON.parse(response.data);
5540
- const updates = ((_32 = (_31 = (_30 = parsed === null || parsed === void 0 ? void 0 : parsed.data) === null || _30 === void 0 ? void 0 : _30.items) === null || _31 === void 0 ? void 0 : _31[0]) === null || _32 === void 0 ? void 0 : _32.updates) || [];
5483
+ 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
5484
  const formattedUpdates = updates.map((update) => {
5542
5485
  const pinnedToTop = update.pinned_to_top || [];
5543
5486
  const isPinnedToTop = Array.isArray(pinnedToTop) && pinnedToTop.length > 0;
@@ -5602,7 +5545,7 @@ class Worktables {
5602
5545
  console.log('variables:', variables);
5603
5546
  response = await (0, worktablesHelpers_1.makeGraphQLRequest)(this, mutation, headers, variables);
5604
5547
  console.log('Create Update Result:', JSON.stringify(response, null, 2));
5605
- const updateId = (_34 = (_33 = JSON.parse(response).data) === null || _33 === void 0 ? void 0 : _33.create_update) === null || _34 === void 0 ? void 0 : _34.id;
5548
+ 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
5549
  if (!updateId) {
5607
5550
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
5608
5551
  message: 'Error creating update: Update not created, no ID returned',
@@ -5908,7 +5851,7 @@ class Worktables {
5908
5851
  body: { query },
5909
5852
  json: true,
5910
5853
  });
5911
- const asset = (_36 = (_35 = responseFile === null || responseFile === void 0 ? void 0 : responseFile.data) === null || _35 === void 0 ? void 0 : _35.assets) === null || _36 === void 0 ? void 0 : _36[0];
5854
+ 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
5855
  if (!(asset === null || asset === void 0 ? void 0 : asset.public_url)) {
5913
5856
  throw new n8n_workflow_1.NodeApiError(this.getNode(), {
5914
5857
  message: 'Public URL not found for the given file ID.',