@wals-pro/n8n-nodes-weclapp 0.3.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.
Files changed (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -0
  3. package/dist/credentials/WeclappApi.credentials.d.ts +10 -0
  4. package/dist/credentials/WeclappApi.credentials.js +56 -0
  5. package/dist/credentials/WeclappApi.credentials.js.map +1 -0
  6. package/dist/credentials/weclapp.dark.svg +19 -0
  7. package/dist/credentials/weclapp.light.svg +19 -0
  8. package/dist/nodes/Weclapp/GenericFunctions.d.ts +19 -0
  9. package/dist/nodes/Weclapp/GenericFunctions.js +287 -0
  10. package/dist/nodes/Weclapp/GenericFunctions.js.map +1 -0
  11. package/dist/nodes/Weclapp/SharedFields.d.ts +24 -0
  12. package/dist/nodes/Weclapp/SharedFields.js +348 -0
  13. package/dist/nodes/Weclapp/SharedFields.js.map +1 -0
  14. package/dist/nodes/Weclapp/Weclapp.node.d.ts +27 -0
  15. package/dist/nodes/Weclapp/Weclapp.node.js +231 -0
  16. package/dist/nodes/Weclapp/Weclapp.node.js.map +1 -0
  17. package/dist/nodes/Weclapp/actions/applyPayment.d.ts +9 -0
  18. package/dist/nodes/Weclapp/actions/applyPayment.js +64 -0
  19. package/dist/nodes/Weclapp/actions/applyPayment.js.map +1 -0
  20. package/dist/nodes/Weclapp/actions/articlePriceSync.d.ts +41 -0
  21. package/dist/nodes/Weclapp/actions/articlePriceSync.js +238 -0
  22. package/dist/nodes/Weclapp/actions/articlePriceSync.js.map +1 -0
  23. package/dist/nodes/Weclapp/actions/documentUpload.d.ts +3 -0
  24. package/dist/nodes/Weclapp/actions/documentUpload.js +90 -0
  25. package/dist/nodes/Weclapp/actions/documentUpload.js.map +1 -0
  26. package/dist/nodes/Weclapp/descriptions/ArticleDescription.d.ts +3 -0
  27. package/dist/nodes/Weclapp/descriptions/ArticleDescription.js +724 -0
  28. package/dist/nodes/Weclapp/descriptions/ArticleDescription.js.map +1 -0
  29. package/dist/nodes/Weclapp/descriptions/BankDescription.d.ts +6 -0
  30. package/dist/nodes/Weclapp/descriptions/BankDescription.js +471 -0
  31. package/dist/nodes/Weclapp/descriptions/BankDescription.js.map +1 -0
  32. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.d.ts +4 -0
  33. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js +238 -0
  34. package/dist/nodes/Weclapp/descriptions/CustomApiDescription.js.map +1 -0
  35. package/dist/nodes/Weclapp/descriptions/DocumentDescription.d.ts +3 -0
  36. package/dist/nodes/Weclapp/descriptions/DocumentDescription.js +976 -0
  37. package/dist/nodes/Weclapp/descriptions/DocumentDescription.js.map +1 -0
  38. package/dist/nodes/Weclapp/descriptions/PartyDescription.d.ts +4 -0
  39. package/dist/nodes/Weclapp/descriptions/PartyDescription.js +408 -0
  40. package/dist/nodes/Weclapp/descriptions/PartyDescription.js.map +1 -0
  41. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.d.ts +4 -0
  42. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js +628 -0
  43. package/dist/nodes/Weclapp/descriptions/ProductionOrderDescription.js.map +1 -0
  44. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.d.ts +3 -0
  45. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js +559 -0
  46. package/dist/nodes/Weclapp/descriptions/PurchaseInvoiceDescription.js.map +1 -0
  47. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.d.ts +3 -0
  48. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js +681 -0
  49. package/dist/nodes/Weclapp/descriptions/PurchaseOrderDescription.js.map +1 -0
  50. package/dist/nodes/Weclapp/descriptions/QuotationDescription.d.ts +3 -0
  51. package/dist/nodes/Weclapp/descriptions/QuotationDescription.js +1069 -0
  52. package/dist/nodes/Weclapp/descriptions/QuotationDescription.js.map +1 -0
  53. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.d.ts +3 -0
  54. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js +994 -0
  55. package/dist/nodes/Weclapp/descriptions/SalesInvoiceDescription.js.map +1 -0
  56. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.d.ts +4 -0
  57. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js +1122 -0
  58. package/dist/nodes/Weclapp/descriptions/SalesOrderDescription.js.map +1 -0
  59. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.d.ts +3 -0
  60. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js +502 -0
  61. package/dist/nodes/Weclapp/descriptions/ShipmentDescription.js.map +1 -0
  62. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.d.ts +9 -0
  63. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js +664 -0
  64. package/dist/nodes/Weclapp/descriptions/TagUnitUserDescription.js.map +1 -0
  65. package/dist/nodes/Weclapp/descriptions/TicketDescription.d.ts +9 -0
  66. package/dist/nodes/Weclapp/descriptions/TicketDescription.js +745 -0
  67. package/dist/nodes/Weclapp/descriptions/TicketDescription.js.map +1 -0
  68. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.d.ts +35 -0
  69. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js +935 -0
  70. package/dist/nodes/Weclapp/descriptions/WarehouseDescription.js.map +1 -0
  71. package/dist/nodes/Weclapp/descriptions/WebhookDescription.d.ts +4 -0
  72. package/dist/nodes/Weclapp/descriptions/WebhookDescription.js +411 -0
  73. package/dist/nodes/Weclapp/descriptions/WebhookDescription.js.map +1 -0
  74. package/dist/nodes/Weclapp/descriptions/index.d.ts +3 -0
  75. package/dist/nodes/Weclapp/descriptions/index.js +56 -0
  76. package/dist/nodes/Weclapp/descriptions/index.js.map +1 -0
  77. package/dist/nodes/Weclapp/generated/entityMetadata.d.ts +3 -0
  78. package/dist/nodes/Weclapp/generated/entityMetadata.js +368 -0
  79. package/dist/nodes/Weclapp/generated/entityMetadata.js.map +1 -0
  80. package/dist/nodes/Weclapp/generated/openapiMetadata.d.ts +3 -0
  81. package/dist/nodes/Weclapp/generated/openapiMetadata.js +212 -0
  82. package/dist/nodes/Weclapp/generated/openapiMetadata.js.map +1 -0
  83. package/dist/nodes/Weclapp/methods/customAttributes.d.ts +32 -0
  84. package/dist/nodes/Weclapp/methods/customAttributes.js +156 -0
  85. package/dist/nodes/Weclapp/methods/customAttributes.js.map +1 -0
  86. package/dist/nodes/Weclapp/methods/loadOptions.d.ts +3 -0
  87. package/dist/nodes/Weclapp/methods/loadOptions.js +107 -0
  88. package/dist/nodes/Weclapp/methods/loadOptions.js.map +1 -0
  89. package/dist/nodes/Weclapp/weclapp.dark.svg +19 -0
  90. package/dist/nodes/Weclapp/weclapp.light.svg +19 -0
  91. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.d.ts +12 -0
  92. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js +198 -0
  93. package/dist/nodes/WeclappTrigger/WeclappTrigger.node.js.map +1 -0
  94. package/dist/nodes/WeclappTrigger/weclapp.dark.svg +19 -0
  95. package/dist/nodes/WeclappTrigger/weclapp.light.svg +19 -0
  96. package/dist/package.json +78 -0
  97. package/dist/tsconfig.tsbuildinfo +1 -0
  98. package/package.json +78 -0
@@ -0,0 +1,287 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SIMPLIFY_FIELDS = void 0;
4
+ exports.resolveWeclappUrl = resolveWeclappUrl;
5
+ exports.weclappApiRequest = weclappApiRequest;
6
+ exports.weclappApiRequestAllItems = weclappApiRequestAllItems;
7
+ exports.buildFilterParams = buildFilterParams;
8
+ exports.parseApiProblem = parseApiProblem;
9
+ exports.simplifyEntity = simplifyEntity;
10
+ exports.simplifyPostReceive = simplifyPostReceive;
11
+ exports.mergeAdditionalProperties = mergeAdditionalProperties;
12
+ exports.handleBinaryDownload = handleBinaryDownload;
13
+ const n8n_workflow_1 = require("n8n-workflow");
14
+ const VALID_OPERATORS = new Set([
15
+ 'eq',
16
+ 'ne',
17
+ 'lt',
18
+ 'gt',
19
+ 'le',
20
+ 'ge',
21
+ 'null',
22
+ 'notnull',
23
+ 'like',
24
+ 'notlike',
25
+ 'ilike',
26
+ 'notilike',
27
+ 'in',
28
+ 'notin',
29
+ ]);
30
+ exports.SIMPLIFY_FIELDS = {
31
+ article: ['id', 'articleNumber', 'name', 'articleType', 'active', 'unitId', 'version'],
32
+ party: ['id', 'partyNumber', 'name', 'firstName', 'lastName', 'partyType', 'active', 'version'],
33
+ salesOrder: [
34
+ 'id',
35
+ 'orderNumber',
36
+ 'commission',
37
+ 'salesOrderPaymentType',
38
+ 'orderDate',
39
+ 'status',
40
+ 'grossAmount',
41
+ 'version',
42
+ ],
43
+ salesInvoice: ['id', 'invoiceNumber', 'status', 'paymentStatus', 'salesInvoiceType', 'version'],
44
+ purchaseInvoice: ['id', 'invoiceNumber', 'status', 'paymentStatus', 'version'],
45
+ purchaseOrder: ['id', 'purchaseOrderNumber', 'status', 'version'],
46
+ quotation: ['id', 'quotationNumber', 'status', 'version'],
47
+ shipment: ['id', 'shipmentNumber', 'shipmentType', 'deliveryDate', 'version'],
48
+ ticket: ['id', 'ticketNumber', 'subject', 'ticketStatusId', 'version'],
49
+ productionOrder: ['id', 'productionOrderNumber', 'status', 'version'],
50
+ document: ['id', 'name', 'description', 'entityName', 'version'],
51
+ warehouse: ['id', 'name', 'active', 'version'],
52
+ warehouseStock: ['id', 'articleId', 'warehouseId', 'quantity', 'version'],
53
+ warehouseStockMovement: ['id', 'movementNumber', 'articleId', 'quantity', 'version'],
54
+ bankAccount: ['id', 'accountNumber', 'name', 'active', 'version'],
55
+ bankTransaction: ['id', 'externalRecordNumber', 'description', 'version'],
56
+ tag: ['id', 'name', 'version'],
57
+ unit: ['id', 'name', 'description', 'version'],
58
+ user: ['id', 'username', 'firstName', 'lastName', 'status', 'version'],
59
+ webhook: ['id', 'entityName', 'active', 'version'],
60
+ comment: ['id', 'entityName', 'authorName', 'version'],
61
+ customAttributeDefinition: ['id', 'attributeKey', 'label', 'attributeType', 'version'],
62
+ };
63
+ async function resolveWeclappUrl(ctx, endpoint) {
64
+ if (endpoint.startsWith('http://') || endpoint.startsWith('https://')) {
65
+ return endpoint;
66
+ }
67
+ const creds = await ctx.getCredentials('weclappApi');
68
+ const baseUrl = String(creds.baseUrl).replace(/\/+$/, '');
69
+ const path = endpoint.startsWith('/') ? endpoint : `/${endpoint}`;
70
+ return `${baseUrl}${path}`;
71
+ }
72
+ async function weclappApiRequest(method, endpoint, body, qs) {
73
+ const url = await resolveWeclappUrl(this, endpoint);
74
+ try {
75
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'weclappApi', {
76
+ method,
77
+ url,
78
+ body,
79
+ qs,
80
+ json: true,
81
+ });
82
+ return response;
83
+ }
84
+ catch (err) {
85
+ parseApiProblem(this, err);
86
+ }
87
+ }
88
+ async function weclappApiRequestAllItems(method, endpoint, qs, pageSize = 1000, maxPages = 100) {
89
+ var _a;
90
+ const results = [];
91
+ for (let page = 1; page <= maxPages; page++) {
92
+ const response = await weclappApiRequest.call(this, method, endpoint, undefined, {
93
+ ...qs,
94
+ page,
95
+ pageSize,
96
+ });
97
+ const batch = (_a = response.result) !== null && _a !== void 0 ? _a : [];
98
+ results.push(...batch);
99
+ if (batch.length < pageSize) {
100
+ break;
101
+ }
102
+ }
103
+ return results;
104
+ }
105
+ function buildFilterParams(filters, node) {
106
+ var _a, _b;
107
+ const params = {};
108
+ for (const filter of filters) {
109
+ const op = filter.operator.startsWith('-') ? filter.operator.slice(1) : filter.operator;
110
+ if (op === 'gte' || op === 'lte') {
111
+ const correct = op === 'gte' ? '-ge' : '-le';
112
+ const msg = `Invalid weclapp filter operator "-${op}". ` +
113
+ `This operator does not exist and would silently match nothing. ` +
114
+ `Use -ge / -le for greater-or-equal / less-or-equal. ` +
115
+ `Correct operator: "${correct}".`;
116
+ if (node) {
117
+ throw new n8n_workflow_1.NodeOperationError(node.getNode(), msg);
118
+ }
119
+ throw new n8n_workflow_1.NodeOperationError({ id: '', name: '', type: '', typeVersion: 1, position: [0, 0], parameters: {} }, msg);
120
+ }
121
+ if (!VALID_OPERATORS.has(op)) {
122
+ const msg = `Invalid weclapp filter operator "${filter.operator}". ` +
123
+ `Valid operators: ${[...VALID_OPERATORS].map((o) => '-' + o).join(', ')}.`;
124
+ if (node) {
125
+ throw new n8n_workflow_1.NodeOperationError(node.getNode(), msg);
126
+ }
127
+ throw new n8n_workflow_1.NodeOperationError({ id: '', name: '', type: '', typeVersion: 1, position: [0, 0], parameters: {} }, msg);
128
+ }
129
+ const key = `${filter.field}-${op}`;
130
+ if (op === 'null' || op === 'notnull') {
131
+ params[key] = '';
132
+ continue;
133
+ }
134
+ if (op === 'in' || op === 'notin') {
135
+ if (Array.isArray(filter.value)) {
136
+ params[key] = JSON.stringify(filter.value);
137
+ }
138
+ else {
139
+ const raw = String((_a = filter.value) !== null && _a !== void 0 ? _a : '').trim();
140
+ if (raw.startsWith('[')) {
141
+ params[key] = raw;
142
+ }
143
+ else if (raw.length > 0) {
144
+ const values = raw
145
+ .split(',')
146
+ .map((token) => token.trim())
147
+ .filter((token) => token.length > 0);
148
+ params[key] = JSON.stringify(values);
149
+ }
150
+ else {
151
+ params[key] = '';
152
+ }
153
+ }
154
+ continue;
155
+ }
156
+ params[key] = String((_b = filter.value) !== null && _b !== void 0 ? _b : '');
157
+ }
158
+ return params;
159
+ }
160
+ function parseApiProblem(context, err) {
161
+ var _a, _b, _c, _d;
162
+ let body = {};
163
+ if (err && typeof err === 'object') {
164
+ const e = err;
165
+ const causeBody = (_a = e.cause) === null || _a === void 0 ? void 0 : _a.response;
166
+ if ((causeBody === null || causeBody === void 0 ? void 0 : causeBody.body) && typeof causeBody.body === 'object') {
167
+ body = causeBody.body;
168
+ }
169
+ else if (e.body && typeof e.body === 'object') {
170
+ body = e.body;
171
+ }
172
+ else if (e.response && typeof e.response === 'object') {
173
+ const r = e.response;
174
+ if (r.body && typeof r.body === 'object') {
175
+ body = r.body;
176
+ }
177
+ }
178
+ }
179
+ const status = (_b = body.status) !== null && _b !== void 0 ? _b : '';
180
+ const title = (_c = body.title) !== null && _c !== void 0 ? _c : '';
181
+ const detail = (_d = body.detail) !== null && _d !== void 0 ? _d : '';
182
+ const validationDetails = [];
183
+ const items = body.items;
184
+ if (Array.isArray(items)) {
185
+ for (const item of items) {
186
+ if (Array.isArray(item.validationMessages)) {
187
+ for (const vm of item.validationMessages) {
188
+ if (vm.description) {
189
+ validationDetails.push(vm.description);
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+ const detailPart = validationDetails.length > 0 ? validationDetails.join('; ') : detail;
196
+ const parts = [];
197
+ if (status)
198
+ parts.push(String(status));
199
+ if (title)
200
+ parts.push(title);
201
+ if (detailPart)
202
+ parts.push(detailPart);
203
+ const rawErr = err;
204
+ const baseMessage = parts.length > 0
205
+ ? parts.join(': ')
206
+ : (rawErr === null || rawErr === void 0 ? void 0 : rawErr.message) || 'Unknown weclapp API error';
207
+ const isRateLimited = String(status) === '429';
208
+ const message = isRateLimited
209
+ ? 'Rate limited by weclapp — retry after a moment. ' + baseMessage
210
+ : baseMessage;
211
+ const node = context.getNode();
212
+ throw new n8n_workflow_1.NodeApiError(node, body, {
213
+ message,
214
+ httpCode: status ? String(status) : undefined,
215
+ });
216
+ }
217
+ function simplifyEntity(entity, resource) {
218
+ const fields = exports.SIMPLIFY_FIELDS[resource];
219
+ if (!fields) {
220
+ return entity;
221
+ }
222
+ const simplified = {};
223
+ for (const field of fields) {
224
+ if (Object.prototype.hasOwnProperty.call(entity, field)) {
225
+ simplified[field] = entity[field];
226
+ }
227
+ }
228
+ return simplified;
229
+ }
230
+ async function simplifyPostReceive(items, _response) {
231
+ const simplify = this.getNodeParameter('simplify', false);
232
+ if (!simplify) {
233
+ return items;
234
+ }
235
+ const resource = this.getNodeParameter('resource');
236
+ return items.map((item) => ({
237
+ ...item,
238
+ json: simplifyEntity(item.json, resource),
239
+ }));
240
+ }
241
+ async function mergeAdditionalProperties(items, response) {
242
+ const body = response === null || response === void 0 ? void 0 : response.body;
243
+ const additional = body === null || body === void 0 ? void 0 : body.additionalProperties;
244
+ if (!additional || typeof additional !== 'object' || Array.isArray(additional)) {
245
+ return items;
246
+ }
247
+ return items.map((item, index) => {
248
+ const merged = {};
249
+ for (const [name, values] of Object.entries(additional)) {
250
+ if (Array.isArray(values)) {
251
+ merged[name] = values[index];
252
+ }
253
+ }
254
+ if (Object.keys(merged).length === 0) {
255
+ return item;
256
+ }
257
+ return {
258
+ ...item,
259
+ json: {
260
+ ...item.json,
261
+ additionalProperties: merged,
262
+ },
263
+ };
264
+ });
265
+ }
266
+ async function handleBinaryDownload(method, endpoint, filename, body, qs) {
267
+ var _a;
268
+ const url = await resolveWeclappUrl(this, endpoint);
269
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'weclappApi', {
270
+ method,
271
+ url,
272
+ body,
273
+ qs,
274
+ encoding: 'arraybuffer',
275
+ returnFullResponse: true,
276
+ });
277
+ const fullResponse = response;
278
+ const contentType = (_a = fullResponse.headers['content-type']) !== null && _a !== void 0 ? _a : 'application/octet-stream';
279
+ const binaryData = await this.helpers.prepareBinaryData(fullResponse.body, filename, contentType);
280
+ return {
281
+ json: {},
282
+ binary: {
283
+ data: binaryData,
284
+ },
285
+ };
286
+ }
287
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Weclapp/GenericFunctions.ts"],"names":[],"mappings":";;;AA+GA,8CAYC;AAkBD,8CAoBC;AAgBD,8DA2BC;AAqBD,8CA0EC;AAmBD,0CAmEC;AAaD,wCAcC;AAgBD,kDAgBC;AA2BD,8DAgCC;AAmBD,oDAsCC;AAniBD,+CAAgE;AAkBhE,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC/B,IAAI;IACJ,IAAI;IACJ,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AC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO;YACN,GAAG,IAAI;YACP,IAAI,EAAE;gBACL,GAAG,IAAI,CAAC,IAAI;gBACZ,oBAAoB,EAAE,MAAM;aAC5B;SACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAmBM,KAAK,UAAU,oBAAoB,CAEzC,MAA2B,EAC3B,QAAgB,EAChB,QAAgB,EAChB,IAAkB,EAClB,EAAgB;;IAEhB,MAAM,GAAG,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE;QAC1F,MAAM;QACN,GAAG;QACH,IAAI;QACJ,EAAE;QACF,QAAQ,EAAE,aAAa;QACvB,kBAAkB,EAAE,IAAI;KACxB,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,QAGpB,CAAC;IAEF,MAAM,WAAW,GAChB,MAAA,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,mCAAI,0BAA0B,CAAC;IAEpE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CACtD,YAAY,CAAC,IAAI,EACjB,QAAQ,EACR,WAAW,CACX,CAAC;IAEF,OAAO;QACN,IAAI,EAAE,EAAE;QACR,MAAM,EAAE;YACP,IAAI,EAAE,UAAU;SAChB;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { IHttpRequestOptions, INodeProperties, INodePropertyRouting, IN8nRequestOperationPaginationOffset } from 'n8n-workflow';
2
+ export type WeclappFilterEntry = {
3
+ field: string;
4
+ operator: string;
5
+ value?: string;
6
+ };
7
+ export declare const paginationConfig: IN8nRequestOperationPaginationOffset;
8
+ export declare function filtersPreSend(this: {
9
+ getNodeParameter: (name: string, fallback?: unknown) => unknown;
10
+ }, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
11
+ export declare function additionalFieldsPreSend(this: {
12
+ getNodeParameter: (name: string, fallback?: unknown) => unknown;
13
+ }, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
14
+ export declare function emptyJsonBodyPreSend(this: unknown, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
15
+ export declare const limitField: INodeProperties;
16
+ export declare const listPaginationRouting: Pick<INodePropertyRouting, 'operations' | 'send'>;
17
+ export declare const filtersCollection: INodeProperties;
18
+ export declare const additionalFields: INodeProperties;
19
+ export declare const ignoreMissingPropertiesField: INodeProperties;
20
+ export declare const simplifyField: INodeProperties;
21
+ export declare function customAttributesPreSend(this: {
22
+ getNodeParameter: (name: string, fallback?: unknown) => unknown;
23
+ }, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
24
+ export declare const customAttributesField: INodeProperties;
@@ -0,0 +1,348 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customAttributesField = exports.simplifyField = exports.ignoreMissingPropertiesField = exports.additionalFields = exports.filtersCollection = exports.listPaginationRouting = exports.limitField = exports.paginationConfig = void 0;
4
+ exports.filtersPreSend = filtersPreSend;
5
+ exports.additionalFieldsPreSend = additionalFieldsPreSend;
6
+ exports.emptyJsonBodyPreSend = emptyJsonBodyPreSend;
7
+ exports.customAttributesPreSend = customAttributesPreSend;
8
+ const GenericFunctions_1 = require("./GenericFunctions");
9
+ const customAttributes_1 = require("./methods/customAttributes");
10
+ exports.paginationConfig = {
11
+ type: 'offset',
12
+ properties: {
13
+ limitParameter: 'pageSize',
14
+ offsetParameter: 'page',
15
+ pageSize: 1000,
16
+ rootProperty: 'result',
17
+ type: 'query',
18
+ },
19
+ };
20
+ async function filtersPreSend(requestOptions) {
21
+ var _a, _b, _c;
22
+ const filtersParam = this.getNodeParameter('filters', {});
23
+ const entries = (_a = filtersParam === null || filtersParam === void 0 ? void 0 : filtersParam.filter) !== null && _a !== void 0 ? _a : [];
24
+ const filterQs = entries.length > 0 ? (0, GenericFunctions_1.buildFilterParams)(entries) : {};
25
+ const rawFilterParam = this.getNodeParameter('filters', {});
26
+ const rawExpression = ((_b = rawFilterParam === null || rawFilterParam === void 0 ? void 0 : rawFilterParam.rawFilter) !== null && _b !== void 0 ? _b : [])
27
+ .map((entry) => { var _a; return (_a = entry === null || entry === void 0 ? void 0 : entry.expression) === null || _a === void 0 ? void 0 : _a.trim(); })
28
+ .find((expr) => expr && expr.length > 0);
29
+ const rawFilterQs = {};
30
+ if (rawExpression) {
31
+ rawFilterQs.filter = rawExpression;
32
+ }
33
+ if (entries.length === 0 && !rawExpression) {
34
+ return requestOptions;
35
+ }
36
+ return {
37
+ ...requestOptions,
38
+ qs: {
39
+ ...((_c = requestOptions.qs) !== null && _c !== void 0 ? _c : {}),
40
+ ...filterQs,
41
+ ...rawFilterQs,
42
+ },
43
+ };
44
+ }
45
+ async function additionalFieldsPreSend(requestOptions) {
46
+ var _a, _b, _c, _d;
47
+ const params = this.getNodeParameter('additionalFields', {});
48
+ const normalizeCsv = (raw) => raw
49
+ .split(',')
50
+ .map((token) => token.trim())
51
+ .filter((token) => token.length > 0)
52
+ .join(',');
53
+ const additions = {};
54
+ const properties = (_a = params === null || params === void 0 ? void 0 : params.properties) === null || _a === void 0 ? void 0 : _a.trim();
55
+ if (properties) {
56
+ additions.properties = normalizeCsv(properties);
57
+ }
58
+ const includeReferencedEntities = (_b = params === null || params === void 0 ? void 0 : params.includeReferencedEntities) === null || _b === void 0 ? void 0 : _b.trim();
59
+ if (includeReferencedEntities) {
60
+ additions.includeReferencedEntities = normalizeCsv(includeReferencedEntities);
61
+ }
62
+ const requestedAdditionalProperties = (_c = params === null || params === void 0 ? void 0 : params.additionalProperties) === null || _c === void 0 ? void 0 : _c.trim();
63
+ if (requestedAdditionalProperties) {
64
+ additions.additionalProperties = normalizeCsv(requestedAdditionalProperties);
65
+ }
66
+ if ((params === null || params === void 0 ? void 0 : params.serializeNulls) === true) {
67
+ additions.serializeNulls = true;
68
+ }
69
+ if (Object.keys(additions).length === 0) {
70
+ return requestOptions;
71
+ }
72
+ return {
73
+ ...requestOptions,
74
+ qs: {
75
+ ...((_d = requestOptions.qs) !== null && _d !== void 0 ? _d : {}),
76
+ ...additions,
77
+ },
78
+ };
79
+ }
80
+ async function emptyJsonBodyPreSend(requestOptions) {
81
+ return {
82
+ ...requestOptions,
83
+ body: '{}',
84
+ };
85
+ }
86
+ exports.limitField = {
87
+ displayName: 'Limit',
88
+ name: 'limit',
89
+ type: 'number',
90
+ default: 0,
91
+ description: 'Max number of results to return. Leave empty (0) to return ALL results — the node paginates automatically.',
92
+ typeOptions: {
93
+ minValue: 0,
94
+ },
95
+ routing: {
96
+ send: {
97
+ type: 'query',
98
+ property: 'pageSize',
99
+ value: '={{ $value > 0 ? $value : 1000 }}',
100
+ },
101
+ },
102
+ };
103
+ exports.listPaginationRouting = {
104
+ operations: {
105
+ pagination: exports.paginationConfig,
106
+ },
107
+ send: {
108
+ paginate: '={{ !$parameter.limit }}',
109
+ },
110
+ };
111
+ exports.filtersCollection = {
112
+ displayName: 'Filters',
113
+ name: 'filters',
114
+ type: 'fixedCollection',
115
+ placeholder: 'Add filter',
116
+ default: {},
117
+ typeOptions: {
118
+ multipleValues: true,
119
+ },
120
+ routing: {
121
+ send: {
122
+ preSend: [filtersPreSend],
123
+ },
124
+ },
125
+ options: [
126
+ {
127
+ displayName: 'Filter',
128
+ name: 'filter',
129
+ values: [
130
+ {
131
+ displayName: 'Field',
132
+ name: 'field',
133
+ type: 'string',
134
+ required: true,
135
+ default: '',
136
+ description: 'Entity property name (e.g., articleNumber, partyType)',
137
+ placeholder: 'e.g. articleNumber',
138
+ },
139
+ {
140
+ displayName: 'Operator',
141
+ name: 'operator',
142
+ type: 'options',
143
+ default: 'eq',
144
+ options: [
145
+ {
146
+ name: 'Case-Insensitive Like',
147
+ value: 'ilike',
148
+ description: 'Case-insensitive LIKE pattern matching',
149
+ },
150
+ {
151
+ name: 'Case-Insensitive Not Like',
152
+ value: 'notilike',
153
+ description: 'Case-insensitive negated LIKE pattern matching',
154
+ },
155
+ {
156
+ name: 'Equals',
157
+ value: 'eq',
158
+ description: 'Field value equals the given value',
159
+ },
160
+ {
161
+ name: 'Greater Than',
162
+ value: 'gt',
163
+ description: 'Field value is strictly greater than the given value',
164
+ },
165
+ {
166
+ name: 'Greater Than or Equal',
167
+ value: 'ge',
168
+ description: 'Field value is greater than or equal to the given value',
169
+ },
170
+ {
171
+ name: 'In (JSON Array)',
172
+ value: 'in',
173
+ description: 'Field value is one of the values in a JSON array (e.g., ["a","b"])',
174
+ },
175
+ {
176
+ name: 'Is Not Null',
177
+ value: 'notnull',
178
+ description: 'Field value is not null (leave Value empty)',
179
+ },
180
+ {
181
+ name: 'Is Null',
182
+ value: 'null',
183
+ description: 'Field value is null (leave Value empty)',
184
+ },
185
+ {
186
+ name: 'Less Than',
187
+ value: 'lt',
188
+ description: 'Field value is strictly less than the given value',
189
+ },
190
+ {
191
+ name: 'Less Than or Equal',
192
+ value: 'le',
193
+ description: 'Field value is less than or equal to the given value',
194
+ },
195
+ {
196
+ name: 'Like',
197
+ value: 'like',
198
+ description: 'SQL-style LIKE pattern matching (use % and _ wildcards)',
199
+ },
200
+ {
201
+ name: 'Not Equals',
202
+ value: 'ne',
203
+ description: 'Field value does not equal the given value',
204
+ },
205
+ {
206
+ name: 'Not In (JSON Array)',
207
+ value: 'notin',
208
+ description: 'Field value is not one of the values in a JSON array (e.g., ["a","b"])',
209
+ },
210
+ {
211
+ name: 'Not Like',
212
+ value: 'notlike',
213
+ description: 'Negated SQL-style LIKE pattern matching',
214
+ },
215
+ ],
216
+ },
217
+ {
218
+ displayName: 'Value',
219
+ name: 'value',
220
+ type: 'string',
221
+ default: '',
222
+ description: 'Filter value. For in/notin use a JSON array (e.g. ["a","b"]). For null/notnull operators leave this empty — the value is ignored by weclapp.',
223
+ },
224
+ ],
225
+ },
226
+ {
227
+ displayName: 'Raw Filter',
228
+ name: 'rawFilter',
229
+ values: [
230
+ {
231
+ displayName: 'Expression',
232
+ name: 'expression',
233
+ type: 'string',
234
+ typeOptions: {
235
+ rows: 3,
236
+ },
237
+ default: '',
238
+ placeholder: '((shipped = true) or (fulfillmentProviderId null))',
239
+ description: "Raw weclapp filter= expression, sent verbatim as the API's `filter` query parameter. Supports OR / AND / parentheses per the weclapp filter grammar. Warning: mixing this with the field-operator filters above is not additive — prefer one approach per request.",
240
+ },
241
+ ],
242
+ },
243
+ ],
244
+ };
245
+ exports.additionalFields = {
246
+ displayName: 'Additional Fields',
247
+ name: 'additionalFields',
248
+ type: 'collection',
249
+ placeholder: 'Add field',
250
+ default: {},
251
+ routing: {
252
+ send: {
253
+ preSend: [additionalFieldsPreSend],
254
+ },
255
+ },
256
+ options: [
257
+ {
258
+ displayName: 'Properties',
259
+ name: 'properties',
260
+ type: 'string',
261
+ default: '',
262
+ description: 'Comma-separated list of fields to include in the response',
263
+ placeholder: 'e.g. ID,articleNumber,name',
264
+ },
265
+ {
266
+ displayName: 'Include Referenced Entities',
267
+ name: 'includeReferencedEntities',
268
+ type: 'string',
269
+ default: '',
270
+ description: 'Comma-separated list of referenced entity IDs to expand',
271
+ placeholder: 'e.g. article,party',
272
+ },
273
+ {
274
+ displayName: 'Additional Properties',
275
+ name: 'additionalProperties',
276
+ type: 'string',
277
+ default: '',
278
+ description: 'Comma-separated list of weclapp computed properties to fetch (returned index-aligned and merged onto each row under `additionalProperties`)',
279
+ placeholder: 'e.g. availability,currentSalesPrice',
280
+ },
281
+ {
282
+ displayName: 'Serialize Nulls',
283
+ name: 'serializeNulls',
284
+ type: 'boolean',
285
+ default: false,
286
+ description: 'Whether to include null-valued fields in the response',
287
+ },
288
+ ],
289
+ };
290
+ exports.ignoreMissingPropertiesField = {
291
+ displayName: 'Ignore Missing Properties',
292
+ name: 'ignoreMissingProperties',
293
+ type: 'boolean',
294
+ default: true,
295
+ description: 'Whether to ignore fields missing from the body on update (weclapp PUT with ignoreMissingProperties=true)',
296
+ };
297
+ exports.simplifyField = {
298
+ displayName: 'Simplify',
299
+ name: 'simplify',
300
+ type: 'boolean',
301
+ default: true,
302
+ description: 'Whether to return a simplified version of the response instead of the raw data',
303
+ };
304
+ async function customAttributesPreSend(requestOptions) {
305
+ const rmv = this.getNodeParameter('customAttributes', {});
306
+ const attributes = rmv ? (0, customAttributes_1.buildWeclappCustomAttributes)(rmv) : [];
307
+ if (attributes.length === 0) {
308
+ return requestOptions;
309
+ }
310
+ const existingBody = requestOptions.body && typeof requestOptions.body === 'object'
311
+ ? requestOptions.body
312
+ : {};
313
+ return {
314
+ ...requestOptions,
315
+ body: {
316
+ ...existingBody,
317
+ customAttributes: attributes,
318
+ },
319
+ };
320
+ }
321
+ exports.customAttributesField = {
322
+ displayName: 'Custom Attributes',
323
+ name: 'customAttributes',
324
+ type: 'resourceMapper',
325
+ noDataExpression: true,
326
+ default: { mappingMode: 'defineBelow', value: null },
327
+ description: 'Set weclapp custom attributes for this record, typed by their definition',
328
+ typeOptions: {
329
+ loadOptionsDependsOn: ['resource'],
330
+ resourceMapper: {
331
+ resourceMapperMethod: 'getCustomAttributeFields',
332
+ mode: 'add',
333
+ fieldWords: {
334
+ singular: 'custom attribute',
335
+ plural: 'custom attributes',
336
+ },
337
+ addAllFields: false,
338
+ multiKeyMatch: false,
339
+ supportAutoMap: false,
340
+ },
341
+ },
342
+ routing: {
343
+ send: {
344
+ preSend: [customAttributesPreSend],
345
+ },
346
+ },
347
+ };
348
+ //# sourceMappingURL=SharedFields.js.map