@ipt-solution/n8n-nodes-ipt-restapi2 0.0.0-stage → 0.1.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/LICENSE.md +21 -0
- package/README.md +350 -2
- package/dist/credentials/IptRestApi2Api.credentials.d.ts +10 -0
- package/dist/credentials/IptRestApi2Api.credentials.js +88 -0
- package/dist/credentials/IptRestApi2Api.credentials.js.map +1 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.d.ts +9 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.js +120 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.js.map +1 -0
- package/dist/nodes/IptRestApi2/IptRestApi2.node.json +18 -0
- package/dist/nodes/IptRestApi2/iptRestApi2.dark.svg +1 -0
- package/dist/nodes/IptRestApi2/iptRestApi2.svg +1 -0
- package/dist/nodes/IptRestApi2/resources/address/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/address/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/address/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/address/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/address/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/address/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/index.js +18 -0
- package/dist/nodes/IptRestApi2/resources/address/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/address/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/address/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/address/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/customer/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/customer/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/customer/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/customer/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/customer/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/customer/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/customer/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/customer/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/customer/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/product/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/product/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/product/get.js +33 -0
- package/dist/nodes/IptRestApi2/resources/product/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/product/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/index.js +18 -0
- package/dist/nodes/IptRestApi2/resources/product/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/product/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/product/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/product/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.d.ts +3 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.js +149 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.js +9 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.js +38 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.js +23 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.js +20 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/actions.d.ts +3 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/actions.js +197 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/actions.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/create.js +9 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/get.js +38 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/index.js +23 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/salesOrder/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.js +20 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/create.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/create.js +8 -0
- package/dist/nodes/IptRestApi2/resources/supplier/create.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/delete.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/delete.js +7 -0
- package/dist/nodes/IptRestApi2/resources/supplier/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/get.d.ts +6 -0
- package/dist/nodes/IptRestApi2/resources/supplier/get.js +31 -0
- package/dist/nodes/IptRestApi2/resources/supplier/get.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/getAll.js +12 -0
- package/dist/nodes/IptRestApi2/resources/supplier/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/index.js +20 -0
- package/dist/nodes/IptRestApi2/resources/supplier/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/supplier/update.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/supplier/update.js +8 -0
- package/dist/nodes/IptRestApi2/resources/supplier/update.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/tableData/getAll.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/tableData/getAll.js +68 -0
- package/dist/nodes/IptRestApi2/resources/tableData/getAll.js.map +1 -0
- package/dist/nodes/IptRestApi2/resources/tableData/index.d.ts +2 -0
- package/dist/nodes/IptRestApi2/resources/tableData/index.js +43 -0
- package/dist/nodes/IptRestApi2/resources/tableData/index.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/actions.d.ts +15 -0
- package/dist/nodes/IptRestApi2/shared/actions.js +171 -0
- package/dist/nodes/IptRestApi2/shared/actions.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/delete.d.ts +4 -0
- package/dist/nodes/IptRestApi2/shared/delete.js +115 -0
- package/dist/nodes/IptRestApi2/shared/delete.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/filters.d.ts +3 -0
- package/dist/nodes/IptRestApi2/shared/filters.js +116 -0
- package/dist/nodes/IptRestApi2/shared/filters.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/operations.d.ts +7 -0
- package/dist/nodes/IptRestApi2/shared/operations.js +76 -0
- package/dist/nodes/IptRestApi2/shared/operations.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/read.d.ts +16 -0
- package/dist/nodes/IptRestApi2/shared/read.js +276 -0
- package/dist/nodes/IptRestApi2/shared/read.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/resource.d.ts +11 -0
- package/dist/nodes/IptRestApi2/shared/resource.js +21 -0
- package/dist/nodes/IptRestApi2/shared/resource.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/response.d.ts +4 -0
- package/dist/nodes/IptRestApi2/shared/response.js +45 -0
- package/dist/nodes/IptRestApi2/shared/response.js.map +1 -0
- package/dist/nodes/IptRestApi2/shared/write.d.ts +6 -0
- package/dist/nodes/IptRestApi2/shared/write.js +194 -0
- package/dist/nodes/IptRestApi2/shared/write.js.map +1 -0
- package/dist/package.json +41 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +39 -4
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterValues = filterValues;
|
|
4
|
+
exports.filterQuery = filterQuery;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const nonFilterParameters = [
|
|
7
|
+
'_resetduplicatecache',
|
|
8
|
+
'alldata',
|
|
9
|
+
'attributes',
|
|
10
|
+
'attributetargets',
|
|
11
|
+
'bookingdate',
|
|
12
|
+
'clause',
|
|
13
|
+
'clientid',
|
|
14
|
+
'commissions',
|
|
15
|
+
'discounts',
|
|
16
|
+
'distinct',
|
|
17
|
+
'download',
|
|
18
|
+
'entityid',
|
|
19
|
+
'exec',
|
|
20
|
+
'execute',
|
|
21
|
+
'expand',
|
|
22
|
+
'fields',
|
|
23
|
+
'filter',
|
|
24
|
+
'force',
|
|
25
|
+
'format',
|
|
26
|
+
'from',
|
|
27
|
+
'fullcopy',
|
|
28
|
+
'groupby',
|
|
29
|
+
'having',
|
|
30
|
+
'history',
|
|
31
|
+
'into',
|
|
32
|
+
'limit',
|
|
33
|
+
'logdatefrom',
|
|
34
|
+
'logdateto',
|
|
35
|
+
'multidelete',
|
|
36
|
+
'multiean',
|
|
37
|
+
'offset',
|
|
38
|
+
'orderby',
|
|
39
|
+
'page',
|
|
40
|
+
'pagesize',
|
|
41
|
+
'parameters',
|
|
42
|
+
'payload',
|
|
43
|
+
'payments',
|
|
44
|
+
'positions',
|
|
45
|
+
'prices',
|
|
46
|
+
'products',
|
|
47
|
+
'reftype',
|
|
48
|
+
'resolveactiontypes',
|
|
49
|
+
'resolveusers',
|
|
50
|
+
'search',
|
|
51
|
+
'select',
|
|
52
|
+
'since',
|
|
53
|
+
'skip',
|
|
54
|
+
'sort',
|
|
55
|
+
'sourceorderid',
|
|
56
|
+
'table',
|
|
57
|
+
'targetordertype',
|
|
58
|
+
'taxes',
|
|
59
|
+
'top',
|
|
60
|
+
'transferaccounting',
|
|
61
|
+
'union',
|
|
62
|
+
'variants',
|
|
63
|
+
'where',
|
|
64
|
+
];
|
|
65
|
+
const columnNamePattern = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
66
|
+
function filterValues(labelPlural, filterExample) {
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Filter',
|
|
70
|
+
name: 'filter',
|
|
71
|
+
values: [
|
|
72
|
+
{
|
|
73
|
+
displayName: 'Field Name',
|
|
74
|
+
name: 'field',
|
|
75
|
+
type: 'string',
|
|
76
|
+
default: '',
|
|
77
|
+
placeholder: filterExample,
|
|
78
|
+
description: `Name of a field of ${labelPlural}. Upper and lower case do not matter.`,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Value',
|
|
82
|
+
name: 'value',
|
|
83
|
+
type: 'string',
|
|
84
|
+
default: '',
|
|
85
|
+
description: 'The field must have exactly this value. Write dates as 2026-10-01 or 01.10.2026, decimals with a point or a comma, and yes/no fields as -1 (yes) or 0 (no).',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
function filterQuery(node, filters, labelPlural, filterExample, nameHint, note) {
|
|
92
|
+
var _a, _b;
|
|
93
|
+
const qs = {};
|
|
94
|
+
for (const filter of filters) {
|
|
95
|
+
const field = String((_a = filter.field) !== null && _a !== void 0 ? _a : '').trim();
|
|
96
|
+
const value = String((_b = filter.value) !== null && _b !== void 0 ? _b : '');
|
|
97
|
+
if (!columnNamePattern.test(field) || nonFilterParameters.includes(field.toLowerCase())) {
|
|
98
|
+
throw new n8n_workflow_1.NodeOperationError(node, `"${field}" cannot be used as a filter`, {
|
|
99
|
+
description: `Use a field name of ${labelPlural}, for example ${filterExample}.${nameHint}${note}`,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (value.trim() === '') {
|
|
103
|
+
throw new n8n_workflow_1.NodeOperationError(node, `The filter "${field}" has no value`, {
|
|
104
|
+
description: `Every filter needs a value.${note}`,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (Object.keys(qs).some((name) => name.toLowerCase() === field.toLowerCase())) {
|
|
108
|
+
throw new n8n_workflow_1.NodeOperationError(node, `The filter "${field}" is set twice`, {
|
|
109
|
+
description: `Use each field only once.${note}`,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
qs[field] = value;
|
|
113
|
+
}
|
|
114
|
+
return qs;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/filters.ts"],"names":[],"mappings":";;AA8EA,oCA8BC;AAKD,kCAgCC;AAjJD,+CAKsB;AAStB,MAAM,mBAAmB,GAAG;IAC3B,sBAAsB;IACtB,SAAS;IACT,YAAY;IACZ,kBAAkB;IAClB,aAAa;IACb,QAAQ;IACR,UAAU;IACV,aAAa;IACb,WAAW;IACX,UAAU;IACV,UAAU;IACV,UAAU;IACV,MAAM;IACN,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,aAAa;IACb,WAAW;IACX,aAAa;IACb,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,YAAY;IACZ,SAAS;IACT,UAAU;IACV,WAAW;IACX,QAAQ;IACR,UAAU;IACV,SAAS;IACT,oBAAoB;IACpB,cAAc;IACd,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,eAAe;IACf,OAAO;IACP,iBAAiB;IACjB,OAAO;IACP,KAAK;IACL,oBAAoB;IACpB,OAAO;IACP,UAAU;IACV,OAAO;CACP,CAAC;AAGF,MAAM,iB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,KAAK,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,iCAAkB,CAAC,IAAI,EAAE,eAAe,KAAK,gBAAgB,EAAE;gBACxE,WAAW,EAAE,8BAA8B,IAAI,EAAE;aACjD,CAAC,CAAC;QACJ,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YAChF,MAAM,IAAI,iCAAkB,CAAC,IAAI,EAAE,eAAe,KAAK,gBAAgB,EAAE;gBACxE,WAAW,EAAE,4BAA4B,IAAI,EAAE;aAC/C,CAAC,CAAC;QACJ,CAAC;QACD,EAAE,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import type { ResourceInfo } from './resource';
|
|
3
|
+
export interface OperationTexts {
|
|
4
|
+
createDescription?: string;
|
|
5
|
+
getDescription?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function operationProperty(info: ResourceInfo, texts?: OperationTexts, additionalOperations?: INodePropertyOptions[]): INodeProperties;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.operationProperty = operationProperty;
|
|
4
|
+
const delete_1 = require("./delete");
|
|
5
|
+
const response_1 = require("./response");
|
|
6
|
+
function operationProperty(info, texts = {}, additionalOperations = []) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const record = `${/^[aeiou]/.test(info.label) ? 'an' : 'a'} ${info.label}`;
|
|
9
|
+
const recordUrl = `=${info.path}/{{encodeURIComponent($parameter.${info.idParameter})}}`;
|
|
10
|
+
const standardOperations = [
|
|
11
|
+
{
|
|
12
|
+
name: 'Create',
|
|
13
|
+
value: 'create',
|
|
14
|
+
action: `Create ${record} in myfactory`,
|
|
15
|
+
description: (_a = texts.createDescription) !== null && _a !== void 0 ? _a : `Create a new ${info.label}`,
|
|
16
|
+
routing: {
|
|
17
|
+
request: { method: 'POST', url: info.path, ignoreHttpStatusErrors: true },
|
|
18
|
+
output: { postReceive: response_1.baseItemsOutput },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Delete',
|
|
23
|
+
value: 'delete',
|
|
24
|
+
action: `Delete ${record} in myfactory`,
|
|
25
|
+
description: `Delete ${record}`,
|
|
26
|
+
routing: {
|
|
27
|
+
request: { method: 'DELETE', url: recordUrl, ignoreHttpStatusErrors: true },
|
|
28
|
+
output: { postReceive: [response_1.throwOnApiError, (0, delete_1.deletedOutput)(info)] },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Get',
|
|
33
|
+
value: 'get',
|
|
34
|
+
action: `Get ${record} from myfactory`,
|
|
35
|
+
description: (_b = texts.getDescription) !== null && _b !== void 0 ? _b : `Get the data of a single ${info.label}`,
|
|
36
|
+
routing: {
|
|
37
|
+
request: { method: 'GET', url: recordUrl, ignoreHttpStatusErrors: true },
|
|
38
|
+
output: { postReceive: response_1.baseItemsOutput },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Get Many',
|
|
43
|
+
value: 'getAll',
|
|
44
|
+
action: `Get many ${info.labelPlural} from myfactory`,
|
|
45
|
+
description: `Get many ${info.labelPlural}`,
|
|
46
|
+
routing: {
|
|
47
|
+
request: { method: 'GET', url: info.path, ignoreHttpStatusErrors: true },
|
|
48
|
+
output: { postReceive: response_1.baseItemsOutput },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Update',
|
|
53
|
+
value: 'update',
|
|
54
|
+
action: `Update ${record} in myfactory`,
|
|
55
|
+
description: `Change the given fields of ${record}`,
|
|
56
|
+
routing: {
|
|
57
|
+
request: { method: 'PUT', url: recordUrl, ignoreHttpStatusErrors: true },
|
|
58
|
+
output: { postReceive: response_1.baseItemsOutput },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
return {
|
|
63
|
+
displayName: 'Operation',
|
|
64
|
+
name: 'operation',
|
|
65
|
+
type: 'options',
|
|
66
|
+
noDataExpression: true,
|
|
67
|
+
displayOptions: {
|
|
68
|
+
show: {
|
|
69
|
+
resource: [info.resource],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
options: [...standardOperations, ...additionalOperations].sort((a, b) => a.name.localeCompare(b.name)),
|
|
73
|
+
default: 'getAll',
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/operations.ts"],"names":[],"mappings":";;AAcA,8CAgFC;AA7FD,qCAAyC;AACzC,yCAA8D;AAY9D,SAAgB,iBAAiB,CAChC,IAAkB,EAClB,QAAwB,EAAE,EAC1B,uBAA+C,EAAE;;IAEjD,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3E,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,oCAAoC,IAAI,CAAC,WAAW,KAAK,CAAC;IAIzF,MAAM,kBAAkB,GAA2B;QAClD;YACC,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,UAAU,MAAM,eAAe;YACvC,WAAW,EAAE,MAAA,KAAK,CAAC,iBAAiB,mCAAI,gBAAgB,IAAI,CAAC,KAAK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E;aACxC;SACD;QACD;YACC,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,UAAU,MAAM,eAAe;YACvC,WAAW,EAAE,8BAA8B,MAAM,EAAE;YACnD,OAAO,EAAE;gBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,sBAAsB,EAAE,IAAI,EAAE;gBACxE,MAAM,EAAE,EAAE,WAAW,EAAE,0BAAe,EAAE;aACxC;SACD;KACD,CAAC;IAEF,OAAO;QACN,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;aACzB;SACD;QAED,OAAO,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACvE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAC5B;QACD,OAAO,EAAE,QAAQ;KACjB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
import { type ResourceInfo } from './resource';
|
|
3
|
+
export declare function includeOption(includes: INodePropertyOptions[]): INodeProperties;
|
|
4
|
+
export declare function fieldsOption(placeholder: string): INodeProperties;
|
|
5
|
+
export declare const allDataOption: INodeProperties;
|
|
6
|
+
export declare function simplifyProperty(resource: string, operation: 'get' | 'getAll', simplifiedFields: string[]): INodeProperties;
|
|
7
|
+
export declare function getProperties(info: ResourceInfo, simplifiedFields: string[], includes: INodePropertyOptions[]): INodeProperties[];
|
|
8
|
+
export interface GetManyExamples {
|
|
9
|
+
fields: string;
|
|
10
|
+
sort: string;
|
|
11
|
+
filterField: string;
|
|
12
|
+
clause: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function clauseOption(condition: string, rangeField: string, placeholder: string): INodeProperties;
|
|
15
|
+
export declare function paginationProperties(resource: string): INodeProperties[];
|
|
16
|
+
export declare function getManyProperties(info: ResourceInfo, simplifiedFields: string[], includes: INodePropertyOptions[], examples: GetManyExamples): INodeProperties[];
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allDataOption = void 0;
|
|
4
|
+
exports.includeOption = includeOption;
|
|
5
|
+
exports.fieldsOption = fieldsOption;
|
|
6
|
+
exports.simplifyProperty = simplifyProperty;
|
|
7
|
+
exports.getProperties = getProperties;
|
|
8
|
+
exports.clauseOption = clauseOption;
|
|
9
|
+
exports.paginationProperties = paginationProperties;
|
|
10
|
+
exports.getManyProperties = getManyProperties;
|
|
11
|
+
const filters_1 = require("./filters");
|
|
12
|
+
const resource_1 = require("./resource");
|
|
13
|
+
function includeOption(includes) {
|
|
14
|
+
return {
|
|
15
|
+
displayName: 'Include',
|
|
16
|
+
name: 'include',
|
|
17
|
+
type: 'multiOptions',
|
|
18
|
+
options: includes,
|
|
19
|
+
default: [],
|
|
20
|
+
description: 'Additional data to load with each record',
|
|
21
|
+
routing: {
|
|
22
|
+
send: {
|
|
23
|
+
type: 'query',
|
|
24
|
+
property: 'expand',
|
|
25
|
+
value: '={{ $value.join(",") }}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function fieldsOption(placeholder) {
|
|
31
|
+
return {
|
|
32
|
+
displayName: 'Fields',
|
|
33
|
+
name: 'fields',
|
|
34
|
+
type: 'string',
|
|
35
|
+
default: '',
|
|
36
|
+
placeholder,
|
|
37
|
+
description: 'Comma-separated list of fields to return. Leave empty for all fields.',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.allDataOption = {
|
|
41
|
+
displayName: 'All Data',
|
|
42
|
+
name: 'allData',
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
default: false,
|
|
45
|
+
description: 'Whether to return all fields of each record instead of the base fields only',
|
|
46
|
+
};
|
|
47
|
+
function simplifyProperty(resource, operation, simplifiedFields) {
|
|
48
|
+
async function sendFieldSelection(requestOptions) {
|
|
49
|
+
const fieldsValue = this.getNodeParameter('options.fields', '');
|
|
50
|
+
const ownFields = (typeof fieldsValue === 'string' ? fieldsValue : '')
|
|
51
|
+
.split(',')
|
|
52
|
+
.map((field) => field.trim())
|
|
53
|
+
.filter((field) => field !== '');
|
|
54
|
+
const simplify = this.getNodeParameter('simplify', false) === true;
|
|
55
|
+
const allData = this.getNodeParameter('options.allData', false) === true;
|
|
56
|
+
const fields = ownFields.length > 0 ? ownFields : simplify ? simplifiedFields : [];
|
|
57
|
+
const qs = { ...requestOptions.qs };
|
|
58
|
+
if (fields.length > 0) {
|
|
59
|
+
qs.fields = fields.join(',');
|
|
60
|
+
}
|
|
61
|
+
if (operation === 'getAll' && (fields.length > 0 || allData)) {
|
|
62
|
+
qs.alldata = 'true';
|
|
63
|
+
}
|
|
64
|
+
requestOptions.qs = qs;
|
|
65
|
+
return requestOptions;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
displayName: 'Simplify',
|
|
69
|
+
name: 'simplify',
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
displayOptions: {
|
|
72
|
+
show: {
|
|
73
|
+
resource: [resource],
|
|
74
|
+
operation: [operation],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
default: false,
|
|
78
|
+
description: `Whether to return only these fields instead of the raw data: ${simplifiedFields.join(', ')}`,
|
|
79
|
+
routing: {
|
|
80
|
+
send: {
|
|
81
|
+
preSend: [sendFieldSelection],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function getProperties(info, simplifiedFields, includes) {
|
|
87
|
+
const properties = [
|
|
88
|
+
(0, resource_1.idProperty)(info, { operation: ['get', 'update'] }),
|
|
89
|
+
simplifyProperty(info.resource, 'get', simplifiedFields),
|
|
90
|
+
];
|
|
91
|
+
if (includes.length > 0) {
|
|
92
|
+
properties.push({
|
|
93
|
+
displayName: 'Options',
|
|
94
|
+
name: 'options',
|
|
95
|
+
type: 'collection',
|
|
96
|
+
placeholder: 'Add option',
|
|
97
|
+
displayOptions: {
|
|
98
|
+
show: {
|
|
99
|
+
resource: [info.resource],
|
|
100
|
+
operation: ['get'],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
default: {},
|
|
104
|
+
options: [includeOption(includes)],
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return properties;
|
|
108
|
+
}
|
|
109
|
+
async function sendClause(requestOptions) {
|
|
110
|
+
const clauseValue = this.getNodeParameter('options.clause', '');
|
|
111
|
+
const clause = typeof clauseValue === 'string' ? clauseValue.trim() : '';
|
|
112
|
+
if (clause !== '') {
|
|
113
|
+
requestOptions.qs = { ...requestOptions.qs, clause: `(${clause})` };
|
|
114
|
+
}
|
|
115
|
+
return requestOptions;
|
|
116
|
+
}
|
|
117
|
+
function clauseOption(condition, rangeField, placeholder) {
|
|
118
|
+
return {
|
|
119
|
+
displayName: 'Clause',
|
|
120
|
+
name: 'clause',
|
|
121
|
+
type: 'string',
|
|
122
|
+
default: '',
|
|
123
|
+
placeholder,
|
|
124
|
+
description: `${condition} Write = as $EQ$, <> as $NE$, < as $LT$, > as $GT$, >= as $GT$$EQ$, <= as $LT$$EQ$, % as $P100$ and : as $2P$. Write dates as 'yyyyMMdd'. Example: BookingDate$GT$$EQ$'20261001' AND BookingDate$LT$'20261101'. Only printable ASCII (no umlauts, no line breaks) and no ; -- /* or SQL keywords such as SELECT, SET, UPDATE, CHAR or CONVERT (also inside text), otherwise the API answers with status 400. Keep it under 2000 characters: instead of a long IN (...) list, filter on another field or use a range such as ${rangeField}$GT$5000 and continue with the next range. See the README for details.`,
|
|
125
|
+
routing: {
|
|
126
|
+
send: {
|
|
127
|
+
preSend: [sendClause],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function searchOptions(info, examples) {
|
|
133
|
+
async function sendFilters(requestOptions) {
|
|
134
|
+
const filters = this.getNodeParameter('options.filters.filter', []);
|
|
135
|
+
const qs = (0, filters_1.filterQuery)(this.getNode(), filters, info.labelPlural, examples.filterField, ' Use Options > Clause for dates and comparisons.', '');
|
|
136
|
+
requestOptions.qs = { ...requestOptions.qs, ...qs };
|
|
137
|
+
return requestOptions;
|
|
138
|
+
}
|
|
139
|
+
return [
|
|
140
|
+
clauseOption(`SQL condition on the table columns of the ${info.labelPlural}, combined with the filters by AND.`, info.idField, examples.clause),
|
|
141
|
+
{
|
|
142
|
+
displayName: 'Filters',
|
|
143
|
+
name: 'filters',
|
|
144
|
+
type: 'fixedCollection',
|
|
145
|
+
placeholder: 'Add Filter',
|
|
146
|
+
typeOptions: {
|
|
147
|
+
multipleValues: true,
|
|
148
|
+
},
|
|
149
|
+
default: {},
|
|
150
|
+
description: `Return only ${info.labelPlural} that match every filter exactly (field = value)`,
|
|
151
|
+
options: (0, filters_1.filterValues)(info.labelPlural, examples.filterField),
|
|
152
|
+
routing: {
|
|
153
|
+
send: {
|
|
154
|
+
preSend: [sendFilters],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
function paginationProperties(resource) {
|
|
161
|
+
const showOnlyForGetMany = {
|
|
162
|
+
operation: ['getAll'],
|
|
163
|
+
resource: [resource],
|
|
164
|
+
};
|
|
165
|
+
return [
|
|
166
|
+
{
|
|
167
|
+
displayName: 'Return All',
|
|
168
|
+
name: 'returnAll',
|
|
169
|
+
type: 'boolean',
|
|
170
|
+
displayOptions: {
|
|
171
|
+
show: showOnlyForGetMany,
|
|
172
|
+
},
|
|
173
|
+
default: false,
|
|
174
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
175
|
+
routing: {
|
|
176
|
+
send: {
|
|
177
|
+
paginate: '={{ $value }}',
|
|
178
|
+
type: 'query',
|
|
179
|
+
property: 'pagesize',
|
|
180
|
+
value: '1000',
|
|
181
|
+
},
|
|
182
|
+
operations: {
|
|
183
|
+
pagination: {
|
|
184
|
+
type: 'generic',
|
|
185
|
+
properties: {
|
|
186
|
+
continue: '={{ $response.body.Result.PageNumber < $response.body.Result.TotalPages }}',
|
|
187
|
+
request: {
|
|
188
|
+
url: '={{ $request.url }}?page={{ $response.body ? $response.body.Result.PageNumber + 1 : 1 }}',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
displayName: 'Limit',
|
|
197
|
+
name: 'limit',
|
|
198
|
+
type: 'number',
|
|
199
|
+
displayOptions: {
|
|
200
|
+
show: {
|
|
201
|
+
...showOnlyForGetMany,
|
|
202
|
+
returnAll: [false],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
typeOptions: {
|
|
206
|
+
minValue: 1,
|
|
207
|
+
maxValue: 1000,
|
|
208
|
+
},
|
|
209
|
+
default: 50,
|
|
210
|
+
routing: {
|
|
211
|
+
send: {
|
|
212
|
+
type: 'query',
|
|
213
|
+
property: 'pagesize',
|
|
214
|
+
},
|
|
215
|
+
output: {
|
|
216
|
+
maxResults: '={{$value}}',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
description: 'Max number of results to return',
|
|
220
|
+
},
|
|
221
|
+
];
|
|
222
|
+
}
|
|
223
|
+
function getManyProperties(info, simplifiedFields, includes, examples) {
|
|
224
|
+
const showOnlyForGetMany = {
|
|
225
|
+
operation: ['getAll'],
|
|
226
|
+
resource: [info.resource],
|
|
227
|
+
};
|
|
228
|
+
const sortOption = {
|
|
229
|
+
displayName: 'Sort',
|
|
230
|
+
name: 'sort',
|
|
231
|
+
type: 'string',
|
|
232
|
+
default: '',
|
|
233
|
+
placeholder: examples.sort,
|
|
234
|
+
description: 'Comma-separated list of fields to sort by. A leading minus sorts in descending order.',
|
|
235
|
+
routing: {
|
|
236
|
+
send: {
|
|
237
|
+
type: 'query',
|
|
238
|
+
property: 'sort',
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
const options = [
|
|
243
|
+
exports.allDataOption,
|
|
244
|
+
fieldsOption(examples.fields),
|
|
245
|
+
sortOption,
|
|
246
|
+
...searchOptions(info, examples),
|
|
247
|
+
];
|
|
248
|
+
if (includes.length > 0) {
|
|
249
|
+
options.push(includeOption(includes));
|
|
250
|
+
}
|
|
251
|
+
return [
|
|
252
|
+
...paginationProperties(info.resource),
|
|
253
|
+
simplifyProperty(info.resource, 'getAll', simplifiedFields),
|
|
254
|
+
{
|
|
255
|
+
displayName: 'Under Options, use Filters for simple matches and Clause for dates, comparisons and OR.',
|
|
256
|
+
name: `${info.resource}SearchNotice`,
|
|
257
|
+
type: 'notice',
|
|
258
|
+
displayOptions: {
|
|
259
|
+
show: showOnlyForGetMany,
|
|
260
|
+
},
|
|
261
|
+
default: '',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
displayName: 'Options',
|
|
265
|
+
name: 'options',
|
|
266
|
+
type: 'collection',
|
|
267
|
+
placeholder: 'Add option',
|
|
268
|
+
displayOptions: {
|
|
269
|
+
show: showOnlyForGetMany,
|
|
270
|
+
},
|
|
271
|
+
default: {},
|
|
272
|
+
options: options.sort((a, b) => a.displayName.localeCompare(b.displayName)),
|
|
273
|
+
},
|
|
274
|
+
];
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/read.ts"],"names":[],"mappings":";;;AAYA,sCAmBC;AAID,oCASC;AAaD,4CAoDC;AAID,sCA0BC;AA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,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;SAC3E;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IDisplayOptions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export interface ResourceInfo {
|
|
3
|
+
resource: string;
|
|
4
|
+
path: string;
|
|
5
|
+
label: string;
|
|
6
|
+
labelPlural: string;
|
|
7
|
+
idParameter: string;
|
|
8
|
+
idDisplayName: string;
|
|
9
|
+
idField: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function idProperty(info: ResourceInfo, show: NonNullable<IDisplayOptions['show']>): INodeProperties;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.idProperty = idProperty;
|
|
4
|
+
function idProperty(info, show) {
|
|
5
|
+
return {
|
|
6
|
+
displayName: info.idDisplayName,
|
|
7
|
+
name: info.idParameter,
|
|
8
|
+
type: 'string',
|
|
9
|
+
required: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: [info.resource],
|
|
13
|
+
...show,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
default: '',
|
|
17
|
+
placeholder: '1234',
|
|
18
|
+
description: `Numeric ID of the ${info.label} (field ${info.idField})`,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/resource.ts"],"names":[],"mappings":";;AAsBA,gCAmBC;AAnBD,SAAgB,UAAU,CACzB,IAAkB,EAClB,IAA0C;IAE1C,OAAO;QACN,WAAW,EAAE,IAAI,CAAC,aAAa;QAC/B,IAAI,EAAE,IAAI,CAAC,WAAW;QACtB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC;gBACzB,GAAG,IAAI;aACP;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,MAAM;QACnB,WAAW,EAAE,qBAAqB,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,OAAO,GAAG;KACtE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type IExecuteSingleFunctions, type IN8nHttpFullResponse, type INodeExecutionData, type PostReceiveAction } from 'n8n-workflow';
|
|
2
|
+
export declare function throwOnApiError(this: IExecuteSingleFunctions, items: INodeExecutionData[], response: IN8nHttpFullResponse): Promise<INodeExecutionData[]>;
|
|
3
|
+
export declare const resultOutput: PostReceiveAction[];
|
|
4
|
+
export declare const baseItemsOutput: PostReceiveAction[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseItemsOutput = exports.resultOutput = void 0;
|
|
4
|
+
exports.throwOnApiError = throwOnApiError;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
async function throwOnApiError(items, response) {
|
|
7
|
+
const body = typeof response.body === 'object' && response.body !== null
|
|
8
|
+
? response.body
|
|
9
|
+
: {};
|
|
10
|
+
const apiErrors = Array.isArray(body.Error) ? body.Error : [];
|
|
11
|
+
if (response.statusCode < 400 && apiErrors.length === 0) {
|
|
12
|
+
return items;
|
|
13
|
+
}
|
|
14
|
+
const message = apiErrors
|
|
15
|
+
.map((apiError) => apiError.Message)
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.join(' | ');
|
|
18
|
+
const clauseHint = response.statusCode === 400 && message.startsWith('Filter produced invalid SQL')
|
|
19
|
+
? "Check Filters and Clause: use column names of the table. In the Clause write $EQ$ instead of =, text in single quotes, dates as 'yyyyMMdd' and no long IN lists."
|
|
20
|
+
: undefined;
|
|
21
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), body, {
|
|
22
|
+
message: message || undefined,
|
|
23
|
+
description: clauseHint,
|
|
24
|
+
httpCode: String(response.statusCode),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.resultOutput = [
|
|
28
|
+
throwOnApiError,
|
|
29
|
+
{
|
|
30
|
+
type: 'rootProperty',
|
|
31
|
+
properties: {
|
|
32
|
+
property: 'Result',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
exports.baseItemsOutput = [
|
|
37
|
+
throwOnApiError,
|
|
38
|
+
{
|
|
39
|
+
type: 'rootProperty',
|
|
40
|
+
properties: {
|
|
41
|
+
property: 'Result.BaseItems',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/response.ts"],"names":[],"mappings":";;;AAaA,0CA8BC;AA3CD,+CAQsB;AAKf,KAAK,UAAU,eAAe,CAEpC,KAA2B,EAC3B,QAA8B;IAE9B,MAAM,IAAI,GACT,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,IAAI;QAC1D,CAAC,CAAE,QAAQ,CAAC,IAAoB;QAChC,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,KAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjF,IAAI,QAAQ,CAAC,UAAU,GAAG,GAAG,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,SAAS;SACvB,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;SACnC,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,KAAK,CAAC,CAAC;IAGd,MAAM,UAAU,GACf,QAAQ,CAAC,UAAU,KAAK,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC;QAC/E,CAAC,CAAC,kKAAkK;QACpK,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAkB,EAAE;QAC1D,OAAO,EAAE,OAAO,IAAI,SAAS;QAC7B,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;KACrC,CAAC,CAAC;AACJ,CAAC;AAIY,QAAA,YAAY,GAAwB;IAChD,eAAe;IACf;QACC,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE;YACX,QAAQ,EAAE,QAAQ;SAClB;KACD;CACD,CAAC;AAGW,QAAA,eAAe,GAAwB;IACnD,eAAe;IACf;QACC,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE;YACX,QAAQ,EAAE,kBAAkB;SAC5B;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ILoadOptionsFunctions, type INodeProperties, type ResourceMapperFields } from 'n8n-workflow';
|
|
2
|
+
import type { ResourceInfo } from './resource';
|
|
3
|
+
export declare function writeFieldsLoader(resources: ResourceInfo[]): (this: ILoadOptionsFunctions) => Promise<ResourceMapperFields>;
|
|
4
|
+
export declare function createDataProperty(resource: string, description: string, example: string, allDataDescription?: string): INodeProperties[];
|
|
5
|
+
export declare function returnPositionsProperty(resource: string): INodeProperties;
|
|
6
|
+
export declare function updateDataProperty(resource: string, example: string, note?: string): INodeProperties[];
|