@worktables/n8n-nodes-worktables 12.40.1 → 12.41.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.
- package/dist/nodes/Worktables/MondayWebhook.node.js +0 -2
- package/dist/nodes/Worktables/MondayWebhook.node.js.map +1 -1
- package/dist/nodes/Worktables/Worktables.node.js +23 -66
- 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 +1 -12
- package/dist/utils/isErrorResponse.js.map +1 -1
- package/dist/utils/worktablesHelpers.js +2 -13
- package/dist/utils/worktablesHelpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@
|
|
|
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';
|
|
6
5
|
class MondayWebhook {
|
|
7
6
|
constructor() {
|
|
8
7
|
this.description = {
|
|
@@ -233,7 +232,6 @@ class MondayWebhook {
|
|
|
233
232
|
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
234
233
|
const headers = {
|
|
235
234
|
'Content-Type': 'application/json',
|
|
236
|
-
'API-Version': API_VERSION,
|
|
237
235
|
};
|
|
238
236
|
if (apiKey) {
|
|
239
237
|
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;AAElE,MAAa,aAAa;IAA1B;QACC,g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AC;CACD;AAxXD,sCAwXC"}
|
|
@@ -11,7 +11,6 @@ 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';
|
|
15
14
|
class Worktables {
|
|
16
15
|
constructor() {
|
|
17
16
|
this.description = {
|
|
@@ -38,7 +37,7 @@ class Worktables {
|
|
|
38
37
|
baseURL: 'https://api.monday.com/v2',
|
|
39
38
|
headers: {
|
|
40
39
|
'Content-Type': 'application/json',
|
|
41
|
-
'API-Version':
|
|
40
|
+
'API-Version': '2025-01',
|
|
42
41
|
},
|
|
43
42
|
},
|
|
44
43
|
codex: {
|
|
@@ -431,7 +430,7 @@ class Worktables {
|
|
|
431
430
|
displayName: 'API Version',
|
|
432
431
|
name: 'apiVersion',
|
|
433
432
|
type: 'string',
|
|
434
|
-
default:
|
|
433
|
+
default: '2025-01',
|
|
435
434
|
description: 'Monday.com API version (e.g., 2025-01, 2024-10)',
|
|
436
435
|
displayOptions: { show: { resource: ['query'] } },
|
|
437
436
|
},
|
|
@@ -2293,7 +2292,7 @@ class Worktables {
|
|
|
2293
2292
|
headers: {
|
|
2294
2293
|
Authorization: `Bearer ${apiKey}`,
|
|
2295
2294
|
'Content-Type': 'application/json',
|
|
2296
|
-
'API-Version':
|
|
2295
|
+
'API-Version': '2025-01',
|
|
2297
2296
|
},
|
|
2298
2297
|
body: JSON.stringify({
|
|
2299
2298
|
query: `{ workspaces (limit: ${limit}, page: ${page}) { id name } }`,
|
|
@@ -2356,7 +2355,7 @@ class Worktables {
|
|
|
2356
2355
|
headers: {
|
|
2357
2356
|
Authorization: `Bearer ${apiKey}`,
|
|
2358
2357
|
'Content-Type': 'application/json',
|
|
2359
|
-
'API-Version':
|
|
2358
|
+
'API-Version': '2025-01',
|
|
2360
2359
|
},
|
|
2361
2360
|
body: currentQuery,
|
|
2362
2361
|
});
|
|
@@ -2391,7 +2390,6 @@ class Worktables {
|
|
|
2391
2390
|
headers: {
|
|
2392
2391
|
Authorization: `Bearer ${apiKey}`,
|
|
2393
2392
|
'Content-Type': 'application/json',
|
|
2394
|
-
'API-Version': API_VERSION,
|
|
2395
2393
|
},
|
|
2396
2394
|
body: {
|
|
2397
2395
|
query: `query { boards(ids: ${boardId} ) { groups { id title color position archived deleted} } }`,
|
|
@@ -2420,7 +2418,6 @@ class Worktables {
|
|
|
2420
2418
|
headers: {
|
|
2421
2419
|
Authorization: `Bearer ${apiKey}`,
|
|
2422
2420
|
'Content-Type': 'application/json',
|
|
2423
|
-
'API-Version': API_VERSION,
|
|
2424
2421
|
},
|
|
2425
2422
|
body: {
|
|
2426
2423
|
query: `query {
|
|
@@ -2452,7 +2449,6 @@ class Worktables {
|
|
|
2452
2449
|
headers: {
|
|
2453
2450
|
Authorization: `Bearer ${apiKey}`,
|
|
2454
2451
|
'Content-Type': 'application/json',
|
|
2455
|
-
'API-Version': API_VERSION,
|
|
2456
2452
|
},
|
|
2457
2453
|
body: {
|
|
2458
2454
|
query: `query { boards(ids: ${parentBoardId ? parentBoardId : boardId}) { items_page (limit: 500) { items { id name } } } }`,
|
|
@@ -2485,7 +2481,6 @@ class Worktables {
|
|
|
2485
2481
|
headers: {
|
|
2486
2482
|
Authorization: `Bearer ${apiKey}`,
|
|
2487
2483
|
'Content-Type': 'application/json',
|
|
2488
|
-
'API-Version': API_VERSION,
|
|
2489
2484
|
},
|
|
2490
2485
|
body: {
|
|
2491
2486
|
query: `query { boards(ids: ${boardId}) { items_page (limit: 500) { items { id name } } } }`,
|
|
@@ -2501,7 +2496,6 @@ class Worktables {
|
|
|
2501
2496
|
return items;
|
|
2502
2497
|
},
|
|
2503
2498
|
async getSubitemFromItem() {
|
|
2504
|
-
var _a, _b;
|
|
2505
2499
|
console.log('Getting Subitems');
|
|
2506
2500
|
const itemId = this.getNodeParameter('itemId', 0);
|
|
2507
2501
|
const parentId = this.getNodeParameter('parentId', 0);
|
|
@@ -2519,7 +2513,6 @@ class Worktables {
|
|
|
2519
2513
|
headers: {
|
|
2520
2514
|
Authorization: `Bearer ${apiKey}`,
|
|
2521
2515
|
'Content-Type': 'application/json',
|
|
2522
|
-
'API-Version': API_VERSION,
|
|
2523
2516
|
},
|
|
2524
2517
|
body: {
|
|
2525
2518
|
query: `{
|
|
@@ -2534,13 +2527,9 @@ class Worktables {
|
|
|
2534
2527
|
});
|
|
2535
2528
|
const parsedResponse = JSON.parse(response);
|
|
2536
2529
|
console.log(JSON.stringify(parsedResponse, null, 2));
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
}
|
|
2541
|
-
return item.subitems.map((subitem) => ({
|
|
2542
|
-
name: subitem.name,
|
|
2543
|
-
value: subitem.id,
|
|
2530
|
+
return parsedResponse.data.items[0].subitems.map((item) => ({
|
|
2531
|
+
name: item.name,
|
|
2532
|
+
value: item.id,
|
|
2544
2533
|
}));
|
|
2545
2534
|
},
|
|
2546
2535
|
async getColumnsFromBoard() {
|
|
@@ -2561,7 +2550,6 @@ class Worktables {
|
|
|
2561
2550
|
headers: {
|
|
2562
2551
|
Authorization: `Bearer ${apiKey}`,
|
|
2563
2552
|
'Content-Type': 'application/json',
|
|
2564
|
-
'API-Version': API_VERSION,
|
|
2565
2553
|
},
|
|
2566
2554
|
body: JSON.stringify({
|
|
2567
2555
|
query: `query { boards(ids: ${boardId}) { columns { id title type } } }`,
|
|
@@ -2600,7 +2588,6 @@ class Worktables {
|
|
|
2600
2588
|
headers: {
|
|
2601
2589
|
Authorization: `Bearer ${apiKey}`,
|
|
2602
2590
|
'Content-Type': 'application/json',
|
|
2603
|
-
'API-Version': API_VERSION,
|
|
2604
2591
|
},
|
|
2605
2592
|
body: JSON.stringify({
|
|
2606
2593
|
query: `query { boards(ids: ${boardId}) { subscribers { id name } } }`,
|
|
@@ -2613,7 +2600,6 @@ class Worktables {
|
|
|
2613
2600
|
}));
|
|
2614
2601
|
},
|
|
2615
2602
|
async getSubitems() {
|
|
2616
|
-
var _a, _b;
|
|
2617
2603
|
const itemId = this.getNodeParameter('parentId');
|
|
2618
2604
|
const credentials = await this.getCredentials('WorktablesApi');
|
|
2619
2605
|
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
@@ -2626,7 +2612,6 @@ class Worktables {
|
|
|
2626
2612
|
headers: {
|
|
2627
2613
|
Authorization: `Bearer ${apiKey}`,
|
|
2628
2614
|
'Content-Type': 'application/json',
|
|
2629
|
-
'API-Version': API_VERSION,
|
|
2630
2615
|
},
|
|
2631
2616
|
body: JSON.stringify({
|
|
2632
2617
|
query: `query {
|
|
@@ -2640,11 +2625,7 @@ class Worktables {
|
|
|
2640
2625
|
}),
|
|
2641
2626
|
});
|
|
2642
2627
|
const parsedResponse = JSON.parse(response);
|
|
2643
|
-
|
|
2644
|
-
if (!item || item.subitems === null || !Array.isArray(item.subitems) || item.subitems.length === 0) {
|
|
2645
|
-
return [];
|
|
2646
|
-
}
|
|
2647
|
-
return item.subitems.map((subitem) => ({
|
|
2628
|
+
return parsedResponse.data.items[0].subitems.map((subitem) => ({
|
|
2648
2629
|
name: subitem.name,
|
|
2649
2630
|
value: subitem.id,
|
|
2650
2631
|
}));
|
|
@@ -2659,7 +2640,6 @@ class Worktables {
|
|
|
2659
2640
|
headers: {
|
|
2660
2641
|
Authorization: `Bearer ${apiKey}`,
|
|
2661
2642
|
'Content-Type': 'application/json',
|
|
2662
|
-
'API-Version': API_VERSION,
|
|
2663
2643
|
},
|
|
2664
2644
|
body: JSON.stringify({
|
|
2665
2645
|
query: `query {
|
|
@@ -2725,7 +2705,7 @@ class Worktables {
|
|
|
2725
2705
|
headers: {
|
|
2726
2706
|
Authorization: `Bearer ${apiKey}`,
|
|
2727
2707
|
'Content-Type': 'application/json',
|
|
2728
|
-
'API-Version':
|
|
2708
|
+
'API-Version': '2025-01',
|
|
2729
2709
|
},
|
|
2730
2710
|
body: JSON.stringify({
|
|
2731
2711
|
query: `query {
|
|
@@ -2760,7 +2740,7 @@ class Worktables {
|
|
|
2760
2740
|
headers: {
|
|
2761
2741
|
Authorization: `Bearer ${apiKey}`,
|
|
2762
2742
|
'Content-Type': 'application/json',
|
|
2763
|
-
'API-Version':
|
|
2743
|
+
'API-Version': '2025-01',
|
|
2764
2744
|
},
|
|
2765
2745
|
body: JSON.stringify({
|
|
2766
2746
|
query: `query {
|
|
@@ -2784,20 +2764,9 @@ class Worktables {
|
|
|
2784
2764
|
}),
|
|
2785
2765
|
});
|
|
2786
2766
|
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
|
-
}
|
|
2794
2767
|
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) || [];
|
|
2795
2768
|
for (const item of items) {
|
|
2796
|
-
if (item.subitems
|
|
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) {
|
|
2769
|
+
if (item.subitems && item.subitems.length > 0) {
|
|
2801
2770
|
const subitem = item.subitems[0];
|
|
2802
2771
|
if (subitem.board && subitem.board.columns) {
|
|
2803
2772
|
subitemBoardColumns = subitem.board.columns;
|
|
@@ -2836,7 +2805,7 @@ class Worktables {
|
|
|
2836
2805
|
headers: {
|
|
2837
2806
|
Authorization: `Bearer ${apiKey}`,
|
|
2838
2807
|
'Content-Type': 'application/json',
|
|
2839
|
-
'API-Version':
|
|
2808
|
+
'API-Version': '2025-01',
|
|
2840
2809
|
},
|
|
2841
2810
|
body: JSON.stringify({
|
|
2842
2811
|
query: `query {
|
|
@@ -2892,7 +2861,7 @@ class Worktables {
|
|
|
2892
2861
|
headers: {
|
|
2893
2862
|
Authorization: `Bearer ${apiKey}`,
|
|
2894
2863
|
'Content-Type': 'application/json',
|
|
2895
|
-
'API-Version':
|
|
2864
|
+
'API-Version': '2025-01',
|
|
2896
2865
|
},
|
|
2897
2866
|
body: JSON.stringify({
|
|
2898
2867
|
query: `query {
|
|
@@ -2927,7 +2896,7 @@ class Worktables {
|
|
|
2927
2896
|
headers: {
|
|
2928
2897
|
Authorization: `Bearer ${apiKey}`,
|
|
2929
2898
|
'Content-Type': 'application/json',
|
|
2930
|
-
'API-Version':
|
|
2899
|
+
'API-Version': '2025-01',
|
|
2931
2900
|
},
|
|
2932
2901
|
body: JSON.stringify({
|
|
2933
2902
|
query: `query {
|
|
@@ -2992,7 +2961,7 @@ class Worktables {
|
|
|
2992
2961
|
headers: {
|
|
2993
2962
|
Authorization: `Bearer ${apiKey}`,
|
|
2994
2963
|
'Content-Type': 'application/json',
|
|
2995
|
-
'API-Version':
|
|
2964
|
+
'API-Version': '2025-01',
|
|
2996
2965
|
},
|
|
2997
2966
|
body: JSON.stringify({
|
|
2998
2967
|
query: `query {
|
|
@@ -3047,7 +3016,7 @@ class Worktables {
|
|
|
3047
3016
|
headers: {
|
|
3048
3017
|
Authorization: `Bearer ${apiKey}`,
|
|
3049
3018
|
'Content-Type': 'application/json',
|
|
3050
|
-
'API-Version':
|
|
3019
|
+
'API-Version': '2025-01',
|
|
3051
3020
|
},
|
|
3052
3021
|
body: {
|
|
3053
3022
|
query: `{ folders (limit: ${limit}, page: ${page}, workspace_ids: ${workspaceId}) { id name } }`,
|
|
@@ -3084,7 +3053,7 @@ class Worktables {
|
|
|
3084
3053
|
headers: {
|
|
3085
3054
|
Authorization: `Bearer ${apiKey}`,
|
|
3086
3055
|
'Content-Type': 'application/json',
|
|
3087
|
-
'API-Version':
|
|
3056
|
+
'API-Version': '2025-01',
|
|
3088
3057
|
},
|
|
3089
3058
|
body: {
|
|
3090
3059
|
query: `{ users (limit: ${limit}, page: ${page}) { id name } }`,
|
|
@@ -3116,7 +3085,6 @@ class Worktables {
|
|
|
3116
3085
|
headers: {
|
|
3117
3086
|
Authorization: `Bearer ${apiKey}`,
|
|
3118
3087
|
'Content-Type': 'application/json',
|
|
3119
|
-
'API-Version': API_VERSION,
|
|
3120
3088
|
},
|
|
3121
3089
|
body: {
|
|
3122
3090
|
query: `{ teams { id name } }`,
|
|
@@ -3140,7 +3108,6 @@ class Worktables {
|
|
|
3140
3108
|
headers: {
|
|
3141
3109
|
Authorization: `Bearer ${apiKey}`,
|
|
3142
3110
|
'Content-Type': 'application/json',
|
|
3143
|
-
'API-Version': API_VERSION,
|
|
3144
3111
|
},
|
|
3145
3112
|
body: JSON.stringify({
|
|
3146
3113
|
query: `query { boards(ids: ${boardId}) { columns { id title type } } }`,
|
|
@@ -3167,7 +3134,6 @@ class Worktables {
|
|
|
3167
3134
|
headers: {
|
|
3168
3135
|
Authorization: `Bearer ${apiKey}`,
|
|
3169
3136
|
'Content-Type': 'application/json',
|
|
3170
|
-
'API-Version': API_VERSION,
|
|
3171
3137
|
},
|
|
3172
3138
|
body: JSON.stringify({
|
|
3173
3139
|
query: `query { boards(ids: ${boardId}) { updates { id body } } }`,
|
|
@@ -3205,7 +3171,6 @@ class Worktables {
|
|
|
3205
3171
|
headers: {
|
|
3206
3172
|
Authorization: `Bearer ${apiKey}`,
|
|
3207
3173
|
'Content-Type': 'application/json',
|
|
3208
|
-
'API-Version': API_VERSION,
|
|
3209
3174
|
},
|
|
3210
3175
|
body: JSON.stringify({
|
|
3211
3176
|
query: `query {
|
|
@@ -3250,7 +3215,7 @@ class Worktables {
|
|
|
3250
3215
|
const headers = {
|
|
3251
3216
|
Authorization: `Bearer ${apiKey}`,
|
|
3252
3217
|
'Content-Type': 'application/json',
|
|
3253
|
-
'API-Version':
|
|
3218
|
+
'API-Version': '2025-01',
|
|
3254
3219
|
};
|
|
3255
3220
|
switch (resource) {
|
|
3256
3221
|
case 'board': {
|
|
@@ -4110,10 +4075,7 @@ class Worktables {
|
|
|
4110
4075
|
const itemConnectionResponse = await this.helpers.request({
|
|
4111
4076
|
method: 'POST',
|
|
4112
4077
|
url: 'https://api.monday.com/v2',
|
|
4113
|
-
headers
|
|
4114
|
-
...headers,
|
|
4115
|
-
'API-Version': API_VERSION,
|
|
4116
|
-
},
|
|
4078
|
+
headers,
|
|
4117
4079
|
body: { query: mutation },
|
|
4118
4080
|
});
|
|
4119
4081
|
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) || [];
|
|
@@ -4318,7 +4280,6 @@ class Worktables {
|
|
|
4318
4280
|
headers: {
|
|
4319
4281
|
Authorization: `Bearer ${apiKey}`,
|
|
4320
4282
|
'Content-Type': 'application/json',
|
|
4321
|
-
'API-Version': API_VERSION,
|
|
4322
4283
|
},
|
|
4323
4284
|
body: {
|
|
4324
4285
|
query: `query {
|
|
@@ -4532,7 +4493,6 @@ class Worktables {
|
|
|
4532
4493
|
headers: {
|
|
4533
4494
|
Authorization: `Bearer ${apiKey}`,
|
|
4534
4495
|
'Content-Type': 'application/json',
|
|
4535
|
-
'API-Version': API_VERSION,
|
|
4536
4496
|
},
|
|
4537
4497
|
body: {
|
|
4538
4498
|
query: `query {
|
|
@@ -4594,7 +4554,6 @@ class Worktables {
|
|
|
4594
4554
|
headers: {
|
|
4595
4555
|
Authorization: `Bearer ${apiKey}`,
|
|
4596
4556
|
'Content-Type': 'application/json',
|
|
4597
|
-
'API-Version': API_VERSION,
|
|
4598
4557
|
},
|
|
4599
4558
|
body: { query: mutation },
|
|
4600
4559
|
});
|
|
@@ -5905,7 +5864,7 @@ class Worktables {
|
|
|
5905
5864
|
const uploadFile = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
5906
5865
|
headers: {
|
|
5907
5866
|
Authorization: headers.Authorization,
|
|
5908
|
-
'API-Version':
|
|
5867
|
+
'API-Version': '2025-01',
|
|
5909
5868
|
...form.getHeaders(),
|
|
5910
5869
|
},
|
|
5911
5870
|
maxContentLength: Infinity,
|
|
@@ -6217,7 +6176,7 @@ class Worktables {
|
|
|
6217
6176
|
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
6218
6177
|
headers: {
|
|
6219
6178
|
Authorization: headers.Authorization,
|
|
6220
|
-
'API-Version':
|
|
6179
|
+
'API-Version': '2025-01',
|
|
6221
6180
|
...form.getHeaders(),
|
|
6222
6181
|
},
|
|
6223
6182
|
maxContentLength: Infinity,
|
|
@@ -6279,7 +6238,7 @@ class Worktables {
|
|
|
6279
6238
|
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
6280
6239
|
headers: {
|
|
6281
6240
|
Authorization: headers.Authorization,
|
|
6282
|
-
'API-Version':
|
|
6241
|
+
'API-Version': '2025-01',
|
|
6283
6242
|
...form.getHeaders(),
|
|
6284
6243
|
},
|
|
6285
6244
|
maxContentLength: Infinity,
|
|
@@ -6388,7 +6347,7 @@ class Worktables {
|
|
|
6388
6347
|
const uploadResponse = await axios_1.default.post('https://api.monday.com/v2/file', form, {
|
|
6389
6348
|
headers: {
|
|
6390
6349
|
Authorization: headers.Authorization,
|
|
6391
|
-
'API-Version':
|
|
6350
|
+
'API-Version': '2025-01',
|
|
6392
6351
|
...form.getHeaders(),
|
|
6393
6352
|
},
|
|
6394
6353
|
maxContentLength: Infinity,
|
|
@@ -6601,7 +6560,6 @@ class Worktables {
|
|
|
6601
6560
|
headers: {
|
|
6602
6561
|
Authorization: `Bearer ${apiKey}`,
|
|
6603
6562
|
'Content-Type': 'application/json',
|
|
6604
|
-
'API-Version': API_VERSION,
|
|
6605
6563
|
},
|
|
6606
6564
|
body: {
|
|
6607
6565
|
query: `{
|
|
@@ -6633,7 +6591,6 @@ class Worktables {
|
|
|
6633
6591
|
headers: {
|
|
6634
6592
|
Authorization: `Bearer ${apiKey}`,
|
|
6635
6593
|
'Content-Type': 'application/json',
|
|
6636
|
-
'API-Version': API_VERSION,
|
|
6637
6594
|
},
|
|
6638
6595
|
body: {
|
|
6639
6596
|
query: `{
|