@worktables/n8n-nodes-worktables 12.30.4 → 12.40.1
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.
- package/dist/nodes/Worktables/MondayWebhook.node.js +2 -0
- package/dist/nodes/Worktables/MondayWebhook.node.js.map +1 -1
- package/dist/nodes/Worktables/Worktables.node.js +120 -38
- package/dist/nodes/Worktables/Worktables.node.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/isErrorResponse.js +12 -1
- package/dist/utils/isErrorResponse.js.map +1 -1
- package/dist/utils/worktablesHelpers.js +13 -2
- package/dist/utils/worktablesHelpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MondayWebhook = void 0;
|
|
4
4
|
const worktablesHelpers_1 = require("../../utils/worktablesHelpers");
|
|
5
|
+
const API_VERSION = '2026-01';
|
|
5
6
|
class MondayWebhook {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.description = {
|
|
@@ -232,6 +233,7 @@ class MondayWebhook {
|
|
|
232
233
|
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
233
234
|
const headers = {
|
|
234
235
|
'Content-Type': 'application/json',
|
|
236
|
+
'API-Version': API_VERSION,
|
|
235
237
|
};
|
|
236
238
|
if (apiKey) {
|
|
237
239
|
headers['Authorization'] = `Bearer ${apiKey}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MondayWebhook.node.js","sourceRoot":"","sources":["../../../nodes/Worktables/MondayWebhook.node.ts"],"names":[],"mappings":";;;AAUA,qEAAkE;
|
|
1
|
+
{"version":3,"file":"MondayWebhook.node.js","sourceRoot":"","sources":["../../../nodes/Worktables/MondayWebhook.node.ts"],"names":[],"mappings":";;;AAUA,qEAAkE;AAGlE,MAAM,WAAW,GAAG,SAAS,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BACP,IAAI,EAAE,WAAW;qBACjB;iBACD,CAAC;aACF;SACD,CAAC;IACH,CAAC;CACD;AAzXD,sCAyXC"}
|
|
@@ -11,6 +11,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
11
11
|
const parseValue_1 = require("../../utils/parseValue");
|
|
12
12
|
const worktablesHelpers_1 = require("../../utils/worktablesHelpers");
|
|
13
13
|
const country_codes_json_1 = __importDefault(require("../../utils/country_codes.json"));
|
|
14
|
+
const API_VERSION = '2026-01';
|
|
14
15
|
class Worktables {
|
|
15
16
|
constructor() {
|
|
16
17
|
this.description = {
|
|
@@ -37,7 +38,7 @@ class Worktables {
|
|
|
37
38
|
baseURL: 'https://api.monday.com/v2',
|
|
38
39
|
headers: {
|
|
39
40
|
'Content-Type': 'application/json',
|
|
40
|
-
'API-Version':
|
|
41
|
+
'API-Version': API_VERSION,
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
44
|
codex: {
|
|
@@ -430,7 +431,7 @@ class Worktables {
|
|
|
430
431
|
displayName: 'API Version',
|
|
431
432
|
name: 'apiVersion',
|
|
432
433
|
type: 'string',
|
|
433
|
-
default:
|
|
434
|
+
default: API_VERSION,
|
|
434
435
|
description: 'Monday.com API version (e.g., 2025-01, 2024-10)',
|
|
435
436
|
displayOptions: { show: { resource: ['query'] } },
|
|
436
437
|
},
|
|
@@ -2292,7 +2293,7 @@ class Worktables {
|
|
|
2292
2293
|
headers: {
|
|
2293
2294
|
Authorization: `Bearer ${apiKey}`,
|
|
2294
2295
|
'Content-Type': 'application/json',
|
|
2295
|
-
'API-Version':
|
|
2296
|
+
'API-Version': API_VERSION,
|
|
2296
2297
|
},
|
|
2297
2298
|
body: JSON.stringify({
|
|
2298
2299
|
query: `{ workspaces (limit: ${limit}, page: ${page}) { id name } }`,
|
|
@@ -2355,7 +2356,7 @@ class Worktables {
|
|
|
2355
2356
|
headers: {
|
|
2356
2357
|
Authorization: `Bearer ${apiKey}`,
|
|
2357
2358
|
'Content-Type': 'application/json',
|
|
2358
|
-
'API-Version':
|
|
2359
|
+
'API-Version': API_VERSION,
|
|
2359
2360
|
},
|
|
2360
2361
|
body: currentQuery,
|
|
2361
2362
|
});
|
|
@@ -2390,6 +2391,7 @@ class Worktables {
|
|
|
2390
2391
|
headers: {
|
|
2391
2392
|
Authorization: `Bearer ${apiKey}`,
|
|
2392
2393
|
'Content-Type': 'application/json',
|
|
2394
|
+
'API-Version': API_VERSION,
|
|
2393
2395
|
},
|
|
2394
2396
|
body: {
|
|
2395
2397
|
query: `query { boards(ids: ${boardId} ) { groups { id title color position archived deleted} } }`,
|
|
@@ -2418,6 +2420,7 @@ class Worktables {
|
|
|
2418
2420
|
headers: {
|
|
2419
2421
|
Authorization: `Bearer ${apiKey}`,
|
|
2420
2422
|
'Content-Type': 'application/json',
|
|
2423
|
+
'API-Version': API_VERSION,
|
|
2421
2424
|
},
|
|
2422
2425
|
body: {
|
|
2423
2426
|
query: `query {
|
|
@@ -2449,6 +2452,7 @@ class Worktables {
|
|
|
2449
2452
|
headers: {
|
|
2450
2453
|
Authorization: `Bearer ${apiKey}`,
|
|
2451
2454
|
'Content-Type': 'application/json',
|
|
2455
|
+
'API-Version': API_VERSION,
|
|
2452
2456
|
},
|
|
2453
2457
|
body: {
|
|
2454
2458
|
query: `query { boards(ids: ${parentBoardId ? parentBoardId : boardId}) { items_page (limit: 500) { items { id name } } } }`,
|
|
@@ -2481,6 +2485,7 @@ class Worktables {
|
|
|
2481
2485
|
headers: {
|
|
2482
2486
|
Authorization: `Bearer ${apiKey}`,
|
|
2483
2487
|
'Content-Type': 'application/json',
|
|
2488
|
+
'API-Version': API_VERSION,
|
|
2484
2489
|
},
|
|
2485
2490
|
body: {
|
|
2486
2491
|
query: `query { boards(ids: ${boardId}) { items_page (limit: 500) { items { id name } } } }`,
|
|
@@ -2496,6 +2501,7 @@ class Worktables {
|
|
|
2496
2501
|
return items;
|
|
2497
2502
|
},
|
|
2498
2503
|
async getSubitemFromItem() {
|
|
2504
|
+
var _a, _b;
|
|
2499
2505
|
console.log('Getting Subitems');
|
|
2500
2506
|
const itemId = this.getNodeParameter('itemId', 0);
|
|
2501
2507
|
const parentId = this.getNodeParameter('parentId', 0);
|
|
@@ -2513,6 +2519,7 @@ class Worktables {
|
|
|
2513
2519
|
headers: {
|
|
2514
2520
|
Authorization: `Bearer ${apiKey}`,
|
|
2515
2521
|
'Content-Type': 'application/json',
|
|
2522
|
+
'API-Version': API_VERSION,
|
|
2516
2523
|
},
|
|
2517
2524
|
body: {
|
|
2518
2525
|
query: `{
|
|
@@ -2527,9 +2534,13 @@ class Worktables {
|
|
|
2527
2534
|
});
|
|
2528
2535
|
const parsedResponse = JSON.parse(response);
|
|
2529
2536
|
console.log(JSON.stringify(parsedResponse, null, 2));
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2537
|
+
const item = (_b = (_a = parsedResponse.data) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b[0];
|
|
2538
|
+
if (!item || item.subitems === null || !Array.isArray(item.subitems) || item.subitems.length === 0) {
|
|
2539
|
+
return [];
|
|
2540
|
+
}
|
|
2541
|
+
return item.subitems.map((subitem) => ({
|
|
2542
|
+
name: subitem.name,
|
|
2543
|
+
value: subitem.id,
|
|
2533
2544
|
}));
|
|
2534
2545
|
},
|
|
2535
2546
|
async getColumnsFromBoard() {
|
|
@@ -2550,6 +2561,7 @@ class Worktables {
|
|
|
2550
2561
|
headers: {
|
|
2551
2562
|
Authorization: `Bearer ${apiKey}`,
|
|
2552
2563
|
'Content-Type': 'application/json',
|
|
2564
|
+
'API-Version': API_VERSION,
|
|
2553
2565
|
},
|
|
2554
2566
|
body: JSON.stringify({
|
|
2555
2567
|
query: `query { boards(ids: ${boardId}) { columns { id title type } } }`,
|
|
@@ -2588,6 +2600,7 @@ class Worktables {
|
|
|
2588
2600
|
headers: {
|
|
2589
2601
|
Authorization: `Bearer ${apiKey}`,
|
|
2590
2602
|
'Content-Type': 'application/json',
|
|
2603
|
+
'API-Version': API_VERSION,
|
|
2591
2604
|
},
|
|
2592
2605
|
body: JSON.stringify({
|
|
2593
2606
|
query: `query { boards(ids: ${boardId}) { subscribers { id name } } }`,
|
|
@@ -2600,6 +2613,7 @@ class Worktables {
|
|
|
2600
2613
|
}));
|
|
2601
2614
|
},
|
|
2602
2615
|
async getSubitems() {
|
|
2616
|
+
var _a, _b;
|
|
2603
2617
|
const itemId = this.getNodeParameter('parentId');
|
|
2604
2618
|
const credentials = await this.getCredentials('WorktablesApi');
|
|
2605
2619
|
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
@@ -2612,6 +2626,7 @@ class Worktables {
|
|
|
2612
2626
|
headers: {
|
|
2613
2627
|
Authorization: `Bearer ${apiKey}`,
|
|
2614
2628
|
'Content-Type': 'application/json',
|
|
2629
|
+
'API-Version': API_VERSION,
|
|
2615
2630
|
},
|
|
2616
2631
|
body: JSON.stringify({
|
|
2617
2632
|
query: `query {
|
|
@@ -2625,7 +2640,11 @@ class Worktables {
|
|
|
2625
2640
|
}),
|
|
2626
2641
|
});
|
|
2627
2642
|
const parsedResponse = JSON.parse(response);
|
|
2628
|
-
|
|
2643
|
+
const item = (_b = (_a = parsedResponse.data) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b[0];
|
|
2644
|
+
if (!item || item.subitems === null || !Array.isArray(item.subitems) || item.subitems.length === 0) {
|
|
2645
|
+
return [];
|
|
2646
|
+
}
|
|
2647
|
+
return item.subitems.map((subitem) => ({
|
|
2629
2648
|
name: subitem.name,
|
|
2630
2649
|
value: subitem.id,
|
|
2631
2650
|
}));
|
|
@@ -2640,6 +2659,7 @@ class Worktables {
|
|
|
2640
2659
|
headers: {
|
|
2641
2660
|
Authorization: `Bearer ${apiKey}`,
|
|
2642
2661
|
'Content-Type': 'application/json',
|
|
2662
|
+
'API-Version': API_VERSION,
|
|
2643
2663
|
},
|
|
2644
2664
|
body: JSON.stringify({
|
|
2645
2665
|
query: `query {
|
|
@@ -2705,7 +2725,7 @@ class Worktables {
|
|
|
2705
2725
|
headers: {
|
|
2706
2726
|
Authorization: `Bearer ${apiKey}`,
|
|
2707
2727
|
'Content-Type': 'application/json',
|
|
2708
|
-
'API-Version':
|
|
2728
|
+
'API-Version': API_VERSION,
|
|
2709
2729
|
},
|
|
2710
2730
|
body: JSON.stringify({
|
|
2711
2731
|
query: `query {
|
|
@@ -2740,7 +2760,7 @@ class Worktables {
|
|
|
2740
2760
|
headers: {
|
|
2741
2761
|
Authorization: `Bearer ${apiKey}`,
|
|
2742
2762
|
'Content-Type': 'application/json',
|
|
2743
|
-
'API-Version':
|
|
2763
|
+
'API-Version': API_VERSION,
|
|
2744
2764
|
},
|
|
2745
2765
|
body: JSON.stringify({
|
|
2746
2766
|
query: `query {
|
|
@@ -2764,9 +2784,20 @@ class Worktables {
|
|
|
2764
2784
|
}),
|
|
2765
2785
|
});
|
|
2766
2786
|
const parsedResponse = JSON.parse(response);
|
|
2787
|
+
if (parsedResponse.errors) {
|
|
2788
|
+
const fieldLimitError = parsedResponse.errors.find((err) => { var _a; return ((_a = err.extensions) === null || _a === void 0 ? void 0 : _a.code) === 'FIELD_LIMIT_EXCEEDED'; });
|
|
2789
|
+
if (fieldLimitError) {
|
|
2790
|
+
console.log('Subitems field concurrency limit exceeded. Consider paginating results.');
|
|
2791
|
+
return [];
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2767
2794
|
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) || [];
|
|
2768
2795
|
for (const item of items) {
|
|
2769
|
-
if (item.subitems
|
|
2796
|
+
if (item.subitems === null) {
|
|
2797
|
+
console.log('Subitems returned null - board may be deleted');
|
|
2798
|
+
continue;
|
|
2799
|
+
}
|
|
2800
|
+
if (item.subitems && Array.isArray(item.subitems) && item.subitems.length > 0) {
|
|
2770
2801
|
const subitem = item.subitems[0];
|
|
2771
2802
|
if (subitem.board && subitem.board.columns) {
|
|
2772
2803
|
subitemBoardColumns = subitem.board.columns;
|
|
@@ -2805,7 +2836,7 @@ class Worktables {
|
|
|
2805
2836
|
headers: {
|
|
2806
2837
|
Authorization: `Bearer ${apiKey}`,
|
|
2807
2838
|
'Content-Type': 'application/json',
|
|
2808
|
-
'API-Version':
|
|
2839
|
+
'API-Version': API_VERSION,
|
|
2809
2840
|
},
|
|
2810
2841
|
body: JSON.stringify({
|
|
2811
2842
|
query: `query {
|
|
@@ -2861,7 +2892,7 @@ class Worktables {
|
|
|
2861
2892
|
headers: {
|
|
2862
2893
|
Authorization: `Bearer ${apiKey}`,
|
|
2863
2894
|
'Content-Type': 'application/json',
|
|
2864
|
-
'API-Version':
|
|
2895
|
+
'API-Version': API_VERSION,
|
|
2865
2896
|
},
|
|
2866
2897
|
body: JSON.stringify({
|
|
2867
2898
|
query: `query {
|
|
@@ -2896,7 +2927,7 @@ class Worktables {
|
|
|
2896
2927
|
headers: {
|
|
2897
2928
|
Authorization: `Bearer ${apiKey}`,
|
|
2898
2929
|
'Content-Type': 'application/json',
|
|
2899
|
-
'API-Version':
|
|
2930
|
+
'API-Version': API_VERSION,
|
|
2900
2931
|
},
|
|
2901
2932
|
body: JSON.stringify({
|
|
2902
2933
|
query: `query {
|
|
@@ -2961,7 +2992,7 @@ class Worktables {
|
|
|
2961
2992
|
headers: {
|
|
2962
2993
|
Authorization: `Bearer ${apiKey}`,
|
|
2963
2994
|
'Content-Type': 'application/json',
|
|
2964
|
-
'API-Version':
|
|
2995
|
+
'API-Version': API_VERSION,
|
|
2965
2996
|
},
|
|
2966
2997
|
body: JSON.stringify({
|
|
2967
2998
|
query: `query {
|
|
@@ -3016,7 +3047,7 @@ class Worktables {
|
|
|
3016
3047
|
headers: {
|
|
3017
3048
|
Authorization: `Bearer ${apiKey}`,
|
|
3018
3049
|
'Content-Type': 'application/json',
|
|
3019
|
-
'API-Version':
|
|
3050
|
+
'API-Version': API_VERSION,
|
|
3020
3051
|
},
|
|
3021
3052
|
body: {
|
|
3022
3053
|
query: `{ folders (limit: ${limit}, page: ${page}, workspace_ids: ${workspaceId}) { id name } }`,
|
|
@@ -3053,7 +3084,7 @@ class Worktables {
|
|
|
3053
3084
|
headers: {
|
|
3054
3085
|
Authorization: `Bearer ${apiKey}`,
|
|
3055
3086
|
'Content-Type': 'application/json',
|
|
3056
|
-
'API-Version':
|
|
3087
|
+
'API-Version': API_VERSION,
|
|
3057
3088
|
},
|
|
3058
3089
|
body: {
|
|
3059
3090
|
query: `{ users (limit: ${limit}, page: ${page}) { id name } }`,
|
|
@@ -3085,6 +3116,7 @@ class Worktables {
|
|
|
3085
3116
|
headers: {
|
|
3086
3117
|
Authorization: `Bearer ${apiKey}`,
|
|
3087
3118
|
'Content-Type': 'application/json',
|
|
3119
|
+
'API-Version': API_VERSION,
|
|
3088
3120
|
},
|
|
3089
3121
|
body: {
|
|
3090
3122
|
query: `{ teams { id name } }`,
|
|
@@ -3108,6 +3140,7 @@ class Worktables {
|
|
|
3108
3140
|
headers: {
|
|
3109
3141
|
Authorization: `Bearer ${apiKey}`,
|
|
3110
3142
|
'Content-Type': 'application/json',
|
|
3143
|
+
'API-Version': API_VERSION,
|
|
3111
3144
|
},
|
|
3112
3145
|
body: JSON.stringify({
|
|
3113
3146
|
query: `query { boards(ids: ${boardId}) { columns { id title type } } }`,
|
|
@@ -3134,6 +3167,7 @@ class Worktables {
|
|
|
3134
3167
|
headers: {
|
|
3135
3168
|
Authorization: `Bearer ${apiKey}`,
|
|
3136
3169
|
'Content-Type': 'application/json',
|
|
3170
|
+
'API-Version': API_VERSION,
|
|
3137
3171
|
},
|
|
3138
3172
|
body: JSON.stringify({
|
|
3139
3173
|
query: `query { boards(ids: ${boardId}) { updates { id body } } }`,
|
|
@@ -3171,6 +3205,7 @@ class Worktables {
|
|
|
3171
3205
|
headers: {
|
|
3172
3206
|
Authorization: `Bearer ${apiKey}`,
|
|
3173
3207
|
'Content-Type': 'application/json',
|
|
3208
|
+
'API-Version': API_VERSION,
|
|
3174
3209
|
},
|
|
3175
3210
|
body: JSON.stringify({
|
|
3176
3211
|
query: `query {
|
|
@@ -3215,7 +3250,7 @@ class Worktables {
|
|
|
3215
3250
|
const headers = {
|
|
3216
3251
|
Authorization: `Bearer ${apiKey}`,
|
|
3217
3252
|
'Content-Type': 'application/json',
|
|
3218
|
-
'API-Version':
|
|
3253
|
+
'API-Version': API_VERSION,
|
|
3219
3254
|
};
|
|
3220
3255
|
switch (resource) {
|
|
3221
3256
|
case 'board': {
|
|
@@ -4075,7 +4110,10 @@ class Worktables {
|
|
|
4075
4110
|
const itemConnectionResponse = await this.helpers.request({
|
|
4076
4111
|
method: 'POST',
|
|
4077
4112
|
url: 'https://api.monday.com/v2',
|
|
4078
|
-
headers
|
|
4113
|
+
headers: {
|
|
4114
|
+
...headers,
|
|
4115
|
+
'API-Version': API_VERSION,
|
|
4116
|
+
},
|
|
4079
4117
|
body: { query: mutation },
|
|
4080
4118
|
});
|
|
4081
4119
|
const existingIds = ((_g = (_f = (_e = (_d = (_c = (_b = JSON.parse(itemConnectionResponse)) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.items) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.column_values) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.linked_item_ids) || [];
|
|
@@ -4280,6 +4318,7 @@ class Worktables {
|
|
|
4280
4318
|
headers: {
|
|
4281
4319
|
Authorization: `Bearer ${apiKey}`,
|
|
4282
4320
|
'Content-Type': 'application/json',
|
|
4321
|
+
'API-Version': API_VERSION,
|
|
4283
4322
|
},
|
|
4284
4323
|
body: {
|
|
4285
4324
|
query: `query {
|
|
@@ -4493,6 +4532,7 @@ class Worktables {
|
|
|
4493
4532
|
headers: {
|
|
4494
4533
|
Authorization: `Bearer ${apiKey}`,
|
|
4495
4534
|
'Content-Type': 'application/json',
|
|
4535
|
+
'API-Version': API_VERSION,
|
|
4496
4536
|
},
|
|
4497
4537
|
body: {
|
|
4498
4538
|
query: `query {
|
|
@@ -4554,6 +4594,7 @@ class Worktables {
|
|
|
4554
4594
|
headers: {
|
|
4555
4595
|
Authorization: `Bearer ${apiKey}`,
|
|
4556
4596
|
'Content-Type': 'application/json',
|
|
4597
|
+
'API-Version': API_VERSION,
|
|
4557
4598
|
},
|
|
4558
4599
|
body: { query: mutation },
|
|
4559
4600
|
});
|
|
@@ -4563,11 +4604,24 @@ class Worktables {
|
|
|
4563
4604
|
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
4564
4605
|
const errorData = Array.isArray(firstError) ? firstError[0] : firstError;
|
|
4565
4606
|
console.log('Error:', errorData);
|
|
4566
|
-
const
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4607
|
+
const continueOnFail = this.continueOnFail();
|
|
4608
|
+
if (continueOnFail) {
|
|
4609
|
+
return [[{
|
|
4610
|
+
json: {
|
|
4611
|
+
error: {
|
|
4612
|
+
message: errorData.message || 'Unknown error',
|
|
4613
|
+
details: errorData,
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
}]];
|
|
4617
|
+
}
|
|
4618
|
+
else {
|
|
4619
|
+
const error = new n8n_workflow_1.NodeApiError(this.getNode(), errorData, {
|
|
4620
|
+
message: errorData.message || 'Unknown error',
|
|
4621
|
+
description: JSON.stringify(errorData, null, 2),
|
|
4622
|
+
});
|
|
4623
|
+
throw error;
|
|
4624
|
+
}
|
|
4571
4625
|
}
|
|
4572
4626
|
const parsedResponse = JSON.parse(responseRaw);
|
|
4573
4627
|
const itemData = ((_u = parsedResponse.data) === null || _u === void 0 ? void 0 : _u.create_item) || ((_v = parsedResponse.data) === null || _v === void 0 ? void 0 : _v.create_subitem);
|
|
@@ -5851,7 +5905,7 @@ class Worktables {
|
|
|
5851
5905
|
const uploadFile = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
5852
5906
|
headers: {
|
|
5853
5907
|
Authorization: headers.Authorization,
|
|
5854
|
-
'API-Version':
|
|
5908
|
+
'API-Version': API_VERSION,
|
|
5855
5909
|
...form.getHeaders(),
|
|
5856
5910
|
},
|
|
5857
5911
|
maxContentLength: Infinity,
|
|
@@ -6049,11 +6103,24 @@ class Worktables {
|
|
|
6049
6103
|
const parsed = JSON.parse(response.data);
|
|
6050
6104
|
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
6051
6105
|
const errorData = Array.isArray(firstError) ? firstError[0] : firstError;
|
|
6052
|
-
const
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6106
|
+
const continueOnFail = this.continueOnFail();
|
|
6107
|
+
if (continueOnFail) {
|
|
6108
|
+
return [[{
|
|
6109
|
+
json: {
|
|
6110
|
+
error: {
|
|
6111
|
+
message: errorData.message || 'Unknown error',
|
|
6112
|
+
details: errorData,
|
|
6113
|
+
}
|
|
6114
|
+
}
|
|
6115
|
+
}]];
|
|
6116
|
+
}
|
|
6117
|
+
else {
|
|
6118
|
+
const error = new n8n_workflow_1.NodeApiError(this.getNode(), errorData, {
|
|
6119
|
+
message: errorData.message || 'Unknown error',
|
|
6120
|
+
description: JSON.stringify(errorData, null, 2),
|
|
6121
|
+
});
|
|
6122
|
+
throw error;
|
|
6123
|
+
}
|
|
6057
6124
|
}
|
|
6058
6125
|
}
|
|
6059
6126
|
case 'createUpdate': {
|
|
@@ -6150,7 +6217,7 @@ class Worktables {
|
|
|
6150
6217
|
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
6151
6218
|
headers: {
|
|
6152
6219
|
Authorization: headers.Authorization,
|
|
6153
|
-
'API-Version':
|
|
6220
|
+
'API-Version': API_VERSION,
|
|
6154
6221
|
...form.getHeaders(),
|
|
6155
6222
|
},
|
|
6156
6223
|
maxContentLength: Infinity,
|
|
@@ -6212,7 +6279,7 @@ class Worktables {
|
|
|
6212
6279
|
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
6213
6280
|
headers: {
|
|
6214
6281
|
Authorization: headers.Authorization,
|
|
6215
|
-
'API-Version':
|
|
6282
|
+
'API-Version': API_VERSION,
|
|
6216
6283
|
...form.getHeaders(),
|
|
6217
6284
|
},
|
|
6218
6285
|
maxContentLength: Infinity,
|
|
@@ -6264,11 +6331,24 @@ class Worktables {
|
|
|
6264
6331
|
const parsed = JSON.parse(parsedResponse.data);
|
|
6265
6332
|
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
6266
6333
|
const errorData = Array.isArray(firstError) ? firstError[0] : firstError;
|
|
6267
|
-
const
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6334
|
+
const continueOnFail = this.continueOnFail();
|
|
6335
|
+
if (continueOnFail) {
|
|
6336
|
+
return [[{
|
|
6337
|
+
json: {
|
|
6338
|
+
error: {
|
|
6339
|
+
message: errorData.message || 'Unknown error',
|
|
6340
|
+
details: errorData,
|
|
6341
|
+
}
|
|
6342
|
+
}
|
|
6343
|
+
}]];
|
|
6344
|
+
}
|
|
6345
|
+
else {
|
|
6346
|
+
const error = new n8n_workflow_1.NodeApiError(this.getNode(), errorData, {
|
|
6347
|
+
message: errorData.message || 'Unknown error',
|
|
6348
|
+
description: JSON.stringify(errorData, null, 2),
|
|
6349
|
+
});
|
|
6350
|
+
throw error;
|
|
6351
|
+
}
|
|
6272
6352
|
}
|
|
6273
6353
|
return [[{ json: JSON.parse(response) }]];
|
|
6274
6354
|
}
|
|
@@ -6308,7 +6388,7 @@ class Worktables {
|
|
|
6308
6388
|
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
6309
6389
|
headers: {
|
|
6310
6390
|
Authorization: headers.Authorization,
|
|
6311
|
-
'API-Version':
|
|
6391
|
+
'API-Version': API_VERSION,
|
|
6312
6392
|
...form.getHeaders(),
|
|
6313
6393
|
},
|
|
6314
6394
|
maxContentLength: Infinity,
|
|
@@ -6521,6 +6601,7 @@ class Worktables {
|
|
|
6521
6601
|
headers: {
|
|
6522
6602
|
Authorization: `Bearer ${apiKey}`,
|
|
6523
6603
|
'Content-Type': 'application/json',
|
|
6604
|
+
'API-Version': API_VERSION,
|
|
6524
6605
|
},
|
|
6525
6606
|
body: {
|
|
6526
6607
|
query: `{
|
|
@@ -6552,6 +6633,7 @@ class Worktables {
|
|
|
6552
6633
|
headers: {
|
|
6553
6634
|
Authorization: `Bearer ${apiKey}`,
|
|
6554
6635
|
'Content-Type': 'application/json',
|
|
6636
|
+
'API-Version': API_VERSION,
|
|
6555
6637
|
},
|
|
6556
6638
|
body: {
|
|
6557
6639
|
query: `{
|