@worktables/n8n-nodes-worktables 12.29.0 → 12.30.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.
|
@@ -26,7 +26,7 @@ class Worktables {
|
|
|
26
26
|
},
|
|
27
27
|
usableAsTool: true,
|
|
28
28
|
inputs: ["main"],
|
|
29
|
-
outputs: ["main"],
|
|
29
|
+
outputs: ["main", 'error'],
|
|
30
30
|
credentials: [
|
|
31
31
|
{
|
|
32
32
|
name: 'WorktablesApi',
|
|
@@ -580,6 +580,17 @@ class Worktables {
|
|
|
580
580
|
hint: 'If 0 is provided, all boards will be returned',
|
|
581
581
|
displayOptions: { show: { operation: ['listBoards'] } },
|
|
582
582
|
},
|
|
583
|
+
{
|
|
584
|
+
displayName: 'Request Timeout (ms)',
|
|
585
|
+
name: 'requestTimeout',
|
|
586
|
+
type: 'number',
|
|
587
|
+
typeOptions: {
|
|
588
|
+
minValue: 1000,
|
|
589
|
+
},
|
|
590
|
+
default: 30000,
|
|
591
|
+
hint: 'Timeout per request to Monday API. Increase if you expect many boards.',
|
|
592
|
+
displayOptions: { show: { operation: ['listBoards'] } },
|
|
593
|
+
},
|
|
583
594
|
{
|
|
584
595
|
displayName: 'Filter by Workspace',
|
|
585
596
|
name: 'filterByWorkspace',
|
|
@@ -3484,6 +3495,7 @@ class Worktables {
|
|
|
3484
3495
|
const boardKind = this.getNodeParameter('boardKind', 0);
|
|
3485
3496
|
const orderBy = this.getNodeParameter('orderBy', 0);
|
|
3486
3497
|
const state = this.getNodeParameter('state', 0);
|
|
3498
|
+
const requestTimeout = this.getNodeParameter('requestTimeout', 0, 30000);
|
|
3487
3499
|
const apiKey = credentials === null || credentials === void 0 ? void 0 : credentials.apiKey;
|
|
3488
3500
|
if (!apiKey) {
|
|
3489
3501
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), { message: 'API Key not found' });
|
|
@@ -3499,6 +3511,7 @@ class Worktables {
|
|
|
3499
3511
|
const responseData = await this.helpers.request({
|
|
3500
3512
|
method: 'POST',
|
|
3501
3513
|
url: 'https://api.monday.com/v2',
|
|
3514
|
+
timeout: requestTimeout || undefined,
|
|
3502
3515
|
headers: {
|
|
3503
3516
|
Authorization: `Bearer ${apiKey}`,
|
|
3504
3517
|
'Content-Type': 'application/json',
|
|
@@ -4548,11 +4561,26 @@ class Worktables {
|
|
|
4548
4561
|
if (!response.success) {
|
|
4549
4562
|
const parsed = JSON.parse(response.data);
|
|
4550
4563
|
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4564
|
+
const errorData = Array.isArray(firstError) ? firstError[0] : firstError;
|
|
4565
|
+
console.log('Error:', errorData);
|
|
4566
|
+
if (this.getNode().continueOnFail) {
|
|
4567
|
+
return [
|
|
4568
|
+
[],
|
|
4569
|
+
[{
|
|
4570
|
+
json: {
|
|
4571
|
+
error: errorData.message || JSON.stringify(errorData),
|
|
4572
|
+
details: errorData,
|
|
4573
|
+
raw: parsed
|
|
4574
|
+
}
|
|
4575
|
+
}]
|
|
4576
|
+
];
|
|
4577
|
+
}
|
|
4578
|
+
else {
|
|
4579
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), errorData, {
|
|
4580
|
+
message: errorData.message || 'Unknown error',
|
|
4581
|
+
description: JSON.stringify(errorData, null, 2),
|
|
4582
|
+
});
|
|
4583
|
+
}
|
|
4556
4584
|
}
|
|
4557
4585
|
const parsedResponse = JSON.parse(responseRaw);
|
|
4558
4586
|
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);
|
|
@@ -6033,10 +6061,25 @@ class Worktables {
|
|
|
6033
6061
|
else {
|
|
6034
6062
|
const parsed = JSON.parse(response.data);
|
|
6035
6063
|
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6064
|
+
const errorData = Array.isArray(firstError) ? firstError[0] : firstError;
|
|
6065
|
+
if (this.getNode().continueOnFail) {
|
|
6066
|
+
return [
|
|
6067
|
+
[],
|
|
6068
|
+
[{
|
|
6069
|
+
json: {
|
|
6070
|
+
error: errorData.message || JSON.stringify(errorData),
|
|
6071
|
+
details: errorData,
|
|
6072
|
+
raw: parsed
|
|
6073
|
+
}
|
|
6074
|
+
}]
|
|
6075
|
+
];
|
|
6076
|
+
}
|
|
6077
|
+
else {
|
|
6078
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), errorData, {
|
|
6079
|
+
message: errorData.message || 'Unknown error',
|
|
6080
|
+
description: JSON.stringify(errorData, null, 2),
|
|
6081
|
+
});
|
|
6082
|
+
}
|
|
6040
6083
|
}
|
|
6041
6084
|
}
|
|
6042
6085
|
case 'createUpdate': {
|
|
@@ -6563,11 +6606,26 @@ class Worktables {
|
|
|
6563
6606
|
else {
|
|
6564
6607
|
const parsed = JSON.parse(response.data);
|
|
6565
6608
|
const firstError = parsed.errors || { message: 'Unknown error' };
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6609
|
+
const errorData = Array.isArray(firstError) ? firstError[0] : firstError;
|
|
6610
|
+
console.log('Error:', errorData);
|
|
6611
|
+
if (this.getNode().continueOnFail) {
|
|
6612
|
+
return [
|
|
6613
|
+
[],
|
|
6614
|
+
[{
|
|
6615
|
+
json: {
|
|
6616
|
+
error: errorData.message || JSON.stringify(errorData),
|
|
6617
|
+
details: errorData,
|
|
6618
|
+
raw: parsed
|
|
6619
|
+
}
|
|
6620
|
+
}]
|
|
6621
|
+
];
|
|
6622
|
+
}
|
|
6623
|
+
else {
|
|
6624
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), errorData, {
|
|
6625
|
+
message: errorData.message || 'Unknown error',
|
|
6626
|
+
description: JSON.stringify(errorData, null, 2),
|
|
6627
|
+
});
|
|
6628
|
+
}
|
|
6571
6629
|
}
|
|
6572
6630
|
}
|
|
6573
6631
|
}
|