n8n-nodes-n8ndesigner-salla-n8nai 0.3.161 → 0.3.163
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.
|
@@ -7636,14 +7636,93 @@ function buildRequest(node, meta, itemIndex) {
|
|
|
7636
7636
|
path,
|
|
7637
7637
|
qs,
|
|
7638
7638
|
body: finalBody
|
|
7639
|
-
};
|
|
7640
|
-
}
|
|
7641
|
-
function
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
{
|
|
7645
|
-
|
|
7646
|
-
|
|
7639
|
+
};
|
|
7640
|
+
}
|
|
7641
|
+
function extractListRecordsAndMeta(payload) {
|
|
7642
|
+
const pickMeta = (envelope, recordsKey) => {
|
|
7643
|
+
if (!envelope || typeof envelope !== "object") {
|
|
7644
|
+
return {};
|
|
7645
|
+
}
|
|
7646
|
+
const allowedKeys = [
|
|
7647
|
+
"status",
|
|
7648
|
+
"success",
|
|
7649
|
+
"pagination",
|
|
7650
|
+
"message",
|
|
7651
|
+
"error",
|
|
7652
|
+
"errors",
|
|
7653
|
+
"code",
|
|
7654
|
+
"fields",
|
|
7655
|
+
"meta",
|
|
7656
|
+
"links",
|
|
7657
|
+
"backendStatus",
|
|
7658
|
+
"backendError"
|
|
7659
|
+
];
|
|
7660
|
+
const meta = {};
|
|
7661
|
+
for (const key of Object.keys(envelope)) {
|
|
7662
|
+
if (key === recordsKey || key === "raw" || key === "rawResponse" || key === "body") {
|
|
7663
|
+
continue;
|
|
7664
|
+
}
|
|
7665
|
+
if (allowedKeys.includes(key)) {
|
|
7666
|
+
meta[key] = envelope[key];
|
|
7667
|
+
continue;
|
|
7668
|
+
}
|
|
7669
|
+
if (!allowedKeys.includes(key) && (typeof envelope[key] !== "object" || envelope[key] === null)) {
|
|
7670
|
+
meta[key] = envelope[key];
|
|
7671
|
+
}
|
|
7672
|
+
}
|
|
7673
|
+
return meta;
|
|
7674
|
+
};
|
|
7675
|
+
if (payload && typeof payload === "object" && Array.isArray(payload.data)) {
|
|
7676
|
+
return {
|
|
7677
|
+
isList: true,
|
|
7678
|
+
records: payload.data,
|
|
7679
|
+
meta: pickMeta(payload, "data")
|
|
7680
|
+
};
|
|
7681
|
+
}
|
|
7682
|
+
if (payload && typeof payload === "object" && payload.data && typeof payload.data === "object" && Array.isArray(payload.data.data)) {
|
|
7683
|
+
return {
|
|
7684
|
+
isList: true,
|
|
7685
|
+
records: payload.data.data,
|
|
7686
|
+
meta: pickMeta(payload.data, "data")
|
|
7687
|
+
};
|
|
7688
|
+
}
|
|
7689
|
+
if (Array.isArray(payload)) {
|
|
7690
|
+
return {
|
|
7691
|
+
isList: true,
|
|
7692
|
+
records: payload,
|
|
7693
|
+
meta: pickMeta({}, "data")
|
|
7694
|
+
};
|
|
7695
|
+
}
|
|
7696
|
+
return {
|
|
7697
|
+
isList: false,
|
|
7698
|
+
nonList: payload
|
|
7699
|
+
};
|
|
7700
|
+
}
|
|
7701
|
+
function formatResponseItems(response, returnMode) {
|
|
7702
|
+
const { isList, records, meta } = extractListRecordsAndMeta(response);
|
|
7703
|
+
if (isList) {
|
|
7704
|
+
const safeMeta = meta && typeof meta === "object" ? meta : {};
|
|
7705
|
+
if (!records || records.length === 0) {
|
|
7706
|
+
return [
|
|
7707
|
+
{
|
|
7708
|
+
__sallaMeta: safeMeta,
|
|
7709
|
+
__isEmpty: true
|
|
7710
|
+
}
|
|
7711
|
+
];
|
|
7712
|
+
}
|
|
7713
|
+
return records.map((entry) => {
|
|
7714
|
+
const normalized = entry && typeof entry === "object" && !Array.isArray(entry) ? { ...entry } : { value: entry };
|
|
7715
|
+
return {
|
|
7716
|
+
...normalized,
|
|
7717
|
+
__sallaMeta: safeMeta
|
|
7718
|
+
};
|
|
7719
|
+
});
|
|
7720
|
+
}
|
|
7721
|
+
if (returnMode === "fullEnvelope") {
|
|
7722
|
+
return [
|
|
7723
|
+
{
|
|
7724
|
+
ok: response.ok,
|
|
7725
|
+
status: response.status,
|
|
7647
7726
|
data: response.data ?? null,
|
|
7648
7727
|
error: response.error ?? null,
|
|
7649
7728
|
raw: response.raw ?? null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "n8n-nodes-n8ndesigner-salla-n8nai",
|
|
3
|
-
"version": "0.3.
|
|
2
|
+
"name": "n8n-nodes-n8ndesigner-salla-n8nai",
|
|
3
|
+
"version": "0.3.163",
|
|
4
4
|
"description": "Salla nodes for n8n (Actions + Triggers)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"README.md",
|
|
13
13
|
"LICENSE"
|
|
14
14
|
],
|
|
15
|
-
"keywords": [
|
|
16
|
-
"n8ndesigner",
|
|
17
|
-
"salla-nodes",
|
|
18
|
-
"n8nai",
|
|
19
|
-
"n8n-salla",
|
|
20
|
-
"n8n-designer"
|
|
21
|
-
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"n8ndesigner",
|
|
17
|
+
"salla-nodes",
|
|
18
|
+
"n8nai",
|
|
19
|
+
"n8n-salla",
|
|
20
|
+
"n8n-designer"
|
|
21
|
+
],
|
|
22
22
|
"author": "N8NDesigner",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "echo \"Skipping build; dist already compiled\"",
|
|
@@ -31,11 +31,6 @@
|
|
|
31
31
|
"n8n": {
|
|
32
32
|
"nodes": [
|
|
33
33
|
"dist/nodes/Actions/SallaActions.node.js",
|
|
34
|
-
"dist/nodes/Orders/UpdateOrderStatus.node.js",
|
|
35
|
-
"dist/nodes/Customers/DeleteCustomer.node.js",
|
|
36
|
-
"dist/nodes/Triggers/OrderStatusUpdatedTrigger.node.js",
|
|
37
|
-
"dist/nodes/Triggers/CustomerCreatedTrigger.node.js",
|
|
38
|
-
"dist/nodes/Triggers/SallaTriggers.node.js",
|
|
39
34
|
"dist/nodes/Triggers/SallaTrigger.node.js"
|
|
40
35
|
],
|
|
41
36
|
"credentials": [
|