@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.
Files changed (194) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +350 -2
  3. package/dist/credentials/IptRestApi2Api.credentials.d.ts +10 -0
  4. package/dist/credentials/IptRestApi2Api.credentials.js +88 -0
  5. package/dist/credentials/IptRestApi2Api.credentials.js.map +1 -0
  6. package/dist/nodes/IptRestApi2/IptRestApi2.node.d.ts +9 -0
  7. package/dist/nodes/IptRestApi2/IptRestApi2.node.js +120 -0
  8. package/dist/nodes/IptRestApi2/IptRestApi2.node.js.map +1 -0
  9. package/dist/nodes/IptRestApi2/IptRestApi2.node.json +18 -0
  10. package/dist/nodes/IptRestApi2/iptRestApi2.dark.svg +1 -0
  11. package/dist/nodes/IptRestApi2/iptRestApi2.svg +1 -0
  12. package/dist/nodes/IptRestApi2/resources/address/create.d.ts +2 -0
  13. package/dist/nodes/IptRestApi2/resources/address/create.js +8 -0
  14. package/dist/nodes/IptRestApi2/resources/address/create.js.map +1 -0
  15. package/dist/nodes/IptRestApi2/resources/address/delete.d.ts +2 -0
  16. package/dist/nodes/IptRestApi2/resources/address/delete.js +7 -0
  17. package/dist/nodes/IptRestApi2/resources/address/delete.js.map +1 -0
  18. package/dist/nodes/IptRestApi2/resources/address/get.d.ts +6 -0
  19. package/dist/nodes/IptRestApi2/resources/address/get.js +31 -0
  20. package/dist/nodes/IptRestApi2/resources/address/get.js.map +1 -0
  21. package/dist/nodes/IptRestApi2/resources/address/getAll.d.ts +2 -0
  22. package/dist/nodes/IptRestApi2/resources/address/getAll.js +12 -0
  23. package/dist/nodes/IptRestApi2/resources/address/getAll.js.map +1 -0
  24. package/dist/nodes/IptRestApi2/resources/address/index.d.ts +2 -0
  25. package/dist/nodes/IptRestApi2/resources/address/index.js +18 -0
  26. package/dist/nodes/IptRestApi2/resources/address/index.js.map +1 -0
  27. package/dist/nodes/IptRestApi2/resources/address/update.d.ts +2 -0
  28. package/dist/nodes/IptRestApi2/resources/address/update.js +8 -0
  29. package/dist/nodes/IptRestApi2/resources/address/update.js.map +1 -0
  30. package/dist/nodes/IptRestApi2/resources/customer/create.d.ts +2 -0
  31. package/dist/nodes/IptRestApi2/resources/customer/create.js +8 -0
  32. package/dist/nodes/IptRestApi2/resources/customer/create.js.map +1 -0
  33. package/dist/nodes/IptRestApi2/resources/customer/delete.d.ts +2 -0
  34. package/dist/nodes/IptRestApi2/resources/customer/delete.js +7 -0
  35. package/dist/nodes/IptRestApi2/resources/customer/delete.js.map +1 -0
  36. package/dist/nodes/IptRestApi2/resources/customer/get.d.ts +6 -0
  37. package/dist/nodes/IptRestApi2/resources/customer/get.js +31 -0
  38. package/dist/nodes/IptRestApi2/resources/customer/get.js.map +1 -0
  39. package/dist/nodes/IptRestApi2/resources/customer/getAll.d.ts +2 -0
  40. package/dist/nodes/IptRestApi2/resources/customer/getAll.js +12 -0
  41. package/dist/nodes/IptRestApi2/resources/customer/getAll.js.map +1 -0
  42. package/dist/nodes/IptRestApi2/resources/customer/index.d.ts +2 -0
  43. package/dist/nodes/IptRestApi2/resources/customer/index.js +20 -0
  44. package/dist/nodes/IptRestApi2/resources/customer/index.js.map +1 -0
  45. package/dist/nodes/IptRestApi2/resources/customer/update.d.ts +2 -0
  46. package/dist/nodes/IptRestApi2/resources/customer/update.js +8 -0
  47. package/dist/nodes/IptRestApi2/resources/customer/update.js.map +1 -0
  48. package/dist/nodes/IptRestApi2/resources/product/create.d.ts +2 -0
  49. package/dist/nodes/IptRestApi2/resources/product/create.js +8 -0
  50. package/dist/nodes/IptRestApi2/resources/product/create.js.map +1 -0
  51. package/dist/nodes/IptRestApi2/resources/product/delete.d.ts +2 -0
  52. package/dist/nodes/IptRestApi2/resources/product/delete.js +7 -0
  53. package/dist/nodes/IptRestApi2/resources/product/delete.js.map +1 -0
  54. package/dist/nodes/IptRestApi2/resources/product/get.d.ts +6 -0
  55. package/dist/nodes/IptRestApi2/resources/product/get.js +33 -0
  56. package/dist/nodes/IptRestApi2/resources/product/get.js.map +1 -0
  57. package/dist/nodes/IptRestApi2/resources/product/getAll.d.ts +2 -0
  58. package/dist/nodes/IptRestApi2/resources/product/getAll.js +12 -0
  59. package/dist/nodes/IptRestApi2/resources/product/getAll.js.map +1 -0
  60. package/dist/nodes/IptRestApi2/resources/product/index.d.ts +2 -0
  61. package/dist/nodes/IptRestApi2/resources/product/index.js +18 -0
  62. package/dist/nodes/IptRestApi2/resources/product/index.js.map +1 -0
  63. package/dist/nodes/IptRestApi2/resources/product/update.d.ts +2 -0
  64. package/dist/nodes/IptRestApi2/resources/product/update.js +8 -0
  65. package/dist/nodes/IptRestApi2/resources/product/update.js.map +1 -0
  66. package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.d.ts +3 -0
  67. package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.js +149 -0
  68. package/dist/nodes/IptRestApi2/resources/purchaseOrder/actions.js.map +1 -0
  69. package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.d.ts +2 -0
  70. package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.js +9 -0
  71. package/dist/nodes/IptRestApi2/resources/purchaseOrder/create.js.map +1 -0
  72. package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.d.ts +2 -0
  73. package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.js +7 -0
  74. package/dist/nodes/IptRestApi2/resources/purchaseOrder/delete.js.map +1 -0
  75. package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.d.ts +6 -0
  76. package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.js +38 -0
  77. package/dist/nodes/IptRestApi2/resources/purchaseOrder/get.js.map +1 -0
  78. package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.d.ts +2 -0
  79. package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.js +12 -0
  80. package/dist/nodes/IptRestApi2/resources/purchaseOrder/getAll.js.map +1 -0
  81. package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.d.ts +2 -0
  82. package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.js +23 -0
  83. package/dist/nodes/IptRestApi2/resources/purchaseOrder/index.js.map +1 -0
  84. package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.d.ts +2 -0
  85. package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.js +8 -0
  86. package/dist/nodes/IptRestApi2/resources/purchaseOrder/update.js.map +1 -0
  87. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.d.ts +2 -0
  88. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.js +20 -0
  89. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/create.js.map +1 -0
  90. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.d.ts +2 -0
  91. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.js +7 -0
  92. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/delete.js.map +1 -0
  93. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.d.ts +6 -0
  94. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.js +31 -0
  95. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/get.js.map +1 -0
  96. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.d.ts +2 -0
  97. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.js +12 -0
  98. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/getAll.js.map +1 -0
  99. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.d.ts +2 -0
  100. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.js +20 -0
  101. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/index.js.map +1 -0
  102. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.d.ts +2 -0
  103. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.js +8 -0
  104. package/dist/nodes/IptRestApi2/resources/purchaseOrderPosition/update.js.map +1 -0
  105. package/dist/nodes/IptRestApi2/resources/salesOrder/actions.d.ts +3 -0
  106. package/dist/nodes/IptRestApi2/resources/salesOrder/actions.js +197 -0
  107. package/dist/nodes/IptRestApi2/resources/salesOrder/actions.js.map +1 -0
  108. package/dist/nodes/IptRestApi2/resources/salesOrder/create.d.ts +2 -0
  109. package/dist/nodes/IptRestApi2/resources/salesOrder/create.js +9 -0
  110. package/dist/nodes/IptRestApi2/resources/salesOrder/create.js.map +1 -0
  111. package/dist/nodes/IptRestApi2/resources/salesOrder/delete.d.ts +2 -0
  112. package/dist/nodes/IptRestApi2/resources/salesOrder/delete.js +7 -0
  113. package/dist/nodes/IptRestApi2/resources/salesOrder/delete.js.map +1 -0
  114. package/dist/nodes/IptRestApi2/resources/salesOrder/get.d.ts +6 -0
  115. package/dist/nodes/IptRestApi2/resources/salesOrder/get.js +38 -0
  116. package/dist/nodes/IptRestApi2/resources/salesOrder/get.js.map +1 -0
  117. package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.d.ts +2 -0
  118. package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.js +12 -0
  119. package/dist/nodes/IptRestApi2/resources/salesOrder/getAll.js.map +1 -0
  120. package/dist/nodes/IptRestApi2/resources/salesOrder/index.d.ts +2 -0
  121. package/dist/nodes/IptRestApi2/resources/salesOrder/index.js +23 -0
  122. package/dist/nodes/IptRestApi2/resources/salesOrder/index.js.map +1 -0
  123. package/dist/nodes/IptRestApi2/resources/salesOrder/update.d.ts +2 -0
  124. package/dist/nodes/IptRestApi2/resources/salesOrder/update.js +8 -0
  125. package/dist/nodes/IptRestApi2/resources/salesOrder/update.js.map +1 -0
  126. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.d.ts +2 -0
  127. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.js +20 -0
  128. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/create.js.map +1 -0
  129. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.d.ts +2 -0
  130. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.js +7 -0
  131. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/delete.js.map +1 -0
  132. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.d.ts +6 -0
  133. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.js +31 -0
  134. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/get.js.map +1 -0
  135. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.d.ts +2 -0
  136. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.js +12 -0
  137. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/getAll.js.map +1 -0
  138. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.d.ts +2 -0
  139. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.js +20 -0
  140. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/index.js.map +1 -0
  141. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.d.ts +2 -0
  142. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.js +8 -0
  143. package/dist/nodes/IptRestApi2/resources/salesOrderPosition/update.js.map +1 -0
  144. package/dist/nodes/IptRestApi2/resources/supplier/create.d.ts +2 -0
  145. package/dist/nodes/IptRestApi2/resources/supplier/create.js +8 -0
  146. package/dist/nodes/IptRestApi2/resources/supplier/create.js.map +1 -0
  147. package/dist/nodes/IptRestApi2/resources/supplier/delete.d.ts +2 -0
  148. package/dist/nodes/IptRestApi2/resources/supplier/delete.js +7 -0
  149. package/dist/nodes/IptRestApi2/resources/supplier/delete.js.map +1 -0
  150. package/dist/nodes/IptRestApi2/resources/supplier/get.d.ts +6 -0
  151. package/dist/nodes/IptRestApi2/resources/supplier/get.js +31 -0
  152. package/dist/nodes/IptRestApi2/resources/supplier/get.js.map +1 -0
  153. package/dist/nodes/IptRestApi2/resources/supplier/getAll.d.ts +2 -0
  154. package/dist/nodes/IptRestApi2/resources/supplier/getAll.js +12 -0
  155. package/dist/nodes/IptRestApi2/resources/supplier/getAll.js.map +1 -0
  156. package/dist/nodes/IptRestApi2/resources/supplier/index.d.ts +2 -0
  157. package/dist/nodes/IptRestApi2/resources/supplier/index.js +20 -0
  158. package/dist/nodes/IptRestApi2/resources/supplier/index.js.map +1 -0
  159. package/dist/nodes/IptRestApi2/resources/supplier/update.d.ts +2 -0
  160. package/dist/nodes/IptRestApi2/resources/supplier/update.js +8 -0
  161. package/dist/nodes/IptRestApi2/resources/supplier/update.js.map +1 -0
  162. package/dist/nodes/IptRestApi2/resources/tableData/getAll.d.ts +2 -0
  163. package/dist/nodes/IptRestApi2/resources/tableData/getAll.js +68 -0
  164. package/dist/nodes/IptRestApi2/resources/tableData/getAll.js.map +1 -0
  165. package/dist/nodes/IptRestApi2/resources/tableData/index.d.ts +2 -0
  166. package/dist/nodes/IptRestApi2/resources/tableData/index.js +43 -0
  167. package/dist/nodes/IptRestApi2/resources/tableData/index.js.map +1 -0
  168. package/dist/nodes/IptRestApi2/shared/actions.d.ts +15 -0
  169. package/dist/nodes/IptRestApi2/shared/actions.js +171 -0
  170. package/dist/nodes/IptRestApi2/shared/actions.js.map +1 -0
  171. package/dist/nodes/IptRestApi2/shared/delete.d.ts +4 -0
  172. package/dist/nodes/IptRestApi2/shared/delete.js +115 -0
  173. package/dist/nodes/IptRestApi2/shared/delete.js.map +1 -0
  174. package/dist/nodes/IptRestApi2/shared/filters.d.ts +3 -0
  175. package/dist/nodes/IptRestApi2/shared/filters.js +116 -0
  176. package/dist/nodes/IptRestApi2/shared/filters.js.map +1 -0
  177. package/dist/nodes/IptRestApi2/shared/operations.d.ts +7 -0
  178. package/dist/nodes/IptRestApi2/shared/operations.js +76 -0
  179. package/dist/nodes/IptRestApi2/shared/operations.js.map +1 -0
  180. package/dist/nodes/IptRestApi2/shared/read.d.ts +16 -0
  181. package/dist/nodes/IptRestApi2/shared/read.js +276 -0
  182. package/dist/nodes/IptRestApi2/shared/read.js.map +1 -0
  183. package/dist/nodes/IptRestApi2/shared/resource.d.ts +11 -0
  184. package/dist/nodes/IptRestApi2/shared/resource.js +21 -0
  185. package/dist/nodes/IptRestApi2/shared/resource.js.map +1 -0
  186. package/dist/nodes/IptRestApi2/shared/response.d.ts +4 -0
  187. package/dist/nodes/IptRestApi2/shared/response.js +45 -0
  188. package/dist/nodes/IptRestApi2/shared/response.js.map +1 -0
  189. package/dist/nodes/IptRestApi2/shared/write.d.ts +6 -0
  190. package/dist/nodes/IptRestApi2/shared/write.js +194 -0
  191. package/dist/nodes/IptRestApi2/shared/write.js.map +1 -0
  192. package/dist/package.json +41 -0
  193. package/dist/tsconfig.tsbuildinfo +1 -0
  194. package/package.json +39 -4
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supplierGetDescription = exports.supplierSimplifiedFields = exports.supplierIncludes = exports.supplierInfo = void 0;
4
+ const read_1 = require("../../shared/read");
5
+ exports.supplierInfo = {
6
+ resource: 'supplier',
7
+ path: '/suppliers',
8
+ label: 'supplier',
9
+ labelPlural: 'suppliers',
10
+ idParameter: 'supplierId',
11
+ idDisplayName: 'Supplier ID',
12
+ idField: 'SupplierID',
13
+ };
14
+ exports.supplierIncludes = [
15
+ { name: 'Attributes', value: 'attributes' },
16
+ { name: 'History', value: 'history' },
17
+ ];
18
+ exports.supplierSimplifiedFields = [
19
+ 'SupplierID',
20
+ 'SupplierNumber',
21
+ 'AddressID',
22
+ 'MatchcodeAdd',
23
+ 'SupplierGroup',
24
+ 'CurrencyUnit',
25
+ 'PaymentConditions',
26
+ 'IsFreezed',
27
+ 'InActive',
28
+ 'ChangeDate',
29
+ ];
30
+ exports.supplierGetDescription = (0, read_1.getProperties)(exports.supplierInfo, exports.supplierSimplifiedFields, exports.supplierIncludes);
31
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../nodes/IptRestApi2/resources/supplier/get.ts"],"names":[],"mappings":";;;AACA,4CAAkD;AAIrC,QAAA,YAAY,GAAiB;IACzC,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,YAAY;IACzB,aAAa,EAAE,aAAa;IAC5B,OAAO,EAAE,YAAY;CACrB,CAAC;AAGW,QAAA,gBAAgB,GAA2B;IACvD,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;CACrC,CAAC;AAIW,QAAA,wBAAwB,GAAG;IACvC,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,cAAc;IACd,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,UAAU;IACV,YAAY;CACZ,CAAC;AAEW,QAAA,sBAAsB,GAAsB,IAAA,oBAAa,EACrE,oBAAY,EACZ,gCAAwB,EACxB,wBAAgB,CAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const supplierGetManyDescription: INodeProperties[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supplierGetManyDescription = void 0;
4
+ const read_1 = require("../../shared/read");
5
+ const get_1 = require("./get");
6
+ exports.supplierGetManyDescription = (0, read_1.getManyProperties)(get_1.supplierInfo, get_1.supplierSimplifiedFields, get_1.supplierIncludes, {
7
+ fields: 'SupplierID,SupplierNumber,AddressID',
8
+ sort: '-ChangeDate,SupplierNumber',
9
+ filterField: 'SupplierGroup',
10
+ clause: "ChangeDate$GT$$EQ$'20261001'",
11
+ });
12
+ //# sourceMappingURL=getAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAll.js","sourceRoot":"","sources":["../../../../../nodes/IptRestApi2/resources/supplier/getAll.ts"],"names":[],"mappings":";;;AACA,4CAAsD;AACtD,+BAAiF;AAEpE,QAAA,0BAA0B,GAAsB,IAAA,wBAAiB,EAC7E,kBAAY,EACZ,8BAAwB,EACxB,sBAAgB,EAChB;IACC,MAAM,EAAE,qCAAqC;IAC7C,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,eAAe;IAC5B,MAAM,EAAE,8BAA8B;CACtC,CACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const supplierDescription: INodeProperties[];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supplierDescription = void 0;
4
+ const operations_1 = require("../../shared/operations");
5
+ const create_1 = require("./create");
6
+ const delete_1 = require("./delete");
7
+ const get_1 = require("./get");
8
+ const getAll_1 = require("./getAll");
9
+ const update_1 = require("./update");
10
+ exports.supplierDescription = [
11
+ (0, operations_1.operationProperty)(get_1.supplierInfo, {
12
+ createDescription: 'Create a new supplier for an existing address',
13
+ }),
14
+ ...create_1.supplierCreateDescription,
15
+ ...delete_1.supplierDeleteDescription,
16
+ ...get_1.supplierGetDescription,
17
+ ...getAll_1.supplierGetManyDescription,
18
+ ...update_1.supplierUpdateDescription,
19
+ ];
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/IptRestApi2/resources/supplier/index.ts"],"names":[],"mappings":";;;AACA,wDAA4D;AAC5D,qCAAqD;AACrD,qCAAqD;AACrD,+BAA6D;AAC7D,qCAAsD;AACtD,qCAAqD;AAExC,QAAA,mBAAmB,GAAsB;IACrD,IAAA,8BAAiB,EAAC,kBAAY,EAAE;QAC/B,iBAAiB,EAAE,+CAA+C;KAClE,CAAC;IACF,GAAG,kCAAyB;IAC5B,GAAG,kCAAyB;IAC5B,GAAG,4BAAsB;IACzB,GAAG,mCAA0B;IAC7B,GAAG,kCAAyB;CAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const supplierUpdateDescription: INodeProperties[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supplierUpdateDescription = void 0;
4
+ const write_1 = require("../../shared/write");
5
+ exports.supplierUpdateDescription = [
6
+ ...(0, write_1.updateDataProperty)('supplier', '{"MinOrderValue": 250, "DefaultDiscount": 2}'),
7
+ ];
8
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../nodes/IptRestApi2/resources/supplier/update.ts"],"names":[],"mappings":";;;AACA,8CAAwD;AAG3C,QAAA,yBAAyB,GAAsB;IAC3D,GAAG,IAAA,0BAAkB,EAAC,UAAU,EAAE,8CAA8C,CAAC;CACjF,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const tableDataGetManyDescription: INodeProperties[];
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tableDataGetManyDescription = void 0;
4
+ const read_1 = require("../../shared/read");
5
+ const showOnlyForGetMany = {
6
+ resource: ['tableData'],
7
+ operation: ['getAll'],
8
+ };
9
+ async function sendFields(requestOptions) {
10
+ const fieldsValue = this.getNodeParameter('options.fields', '');
11
+ const fields = typeof fieldsValue === 'string' ? fieldsValue.trim() : '';
12
+ if (fields !== '') {
13
+ requestOptions.qs = { ...requestOptions.qs, fields };
14
+ }
15
+ return requestOptions;
16
+ }
17
+ exports.tableDataGetManyDescription = [
18
+ {
19
+ displayName: 'If rights are set for the access point, the API key needs the read right TableDatas. Under Options, use Clause to search and Fields to choose columns. The API cannot sort this list, so Return All over more than 1000 rows can skip or repeat rows. Narrow large tables with Clause so that the result fits on one page.',
20
+ name: 'tableDataNotice',
21
+ type: 'notice',
22
+ displayOptions: {
23
+ show: showOnlyForGetMany,
24
+ },
25
+ default: '',
26
+ },
27
+ {
28
+ displayName: 'Table',
29
+ name: 'table',
30
+ type: 'string',
31
+ required: true,
32
+ displayOptions: {
33
+ show: showOnlyForGetMany,
34
+ },
35
+ default: '',
36
+ placeholder: 'tdProducts',
37
+ description: 'Name of a table or view in the myfactory client database, without schema, for example tdProducts. The tables of the interface itself (tdIptRestApi2...) are not available.',
38
+ routing: {
39
+ send: {
40
+ type: 'query',
41
+ property: 'table',
42
+ },
43
+ },
44
+ },
45
+ ...(0, read_1.paginationProperties)('tableData'),
46
+ {
47
+ displayName: 'Options',
48
+ name: 'options',
49
+ type: 'collection',
50
+ placeholder: 'Add option',
51
+ displayOptions: {
52
+ show: showOnlyForGetMany,
53
+ },
54
+ default: {},
55
+ options: [
56
+ (0, read_1.clauseOption)('SQL condition on the columns of the table or view.', '<key column>', "ChangeDate$GT$$EQ$'20261001'"),
57
+ {
58
+ ...(0, read_1.fieldsOption)('ProductID,ProductNumber,Matchcode'),
59
+ routing: {
60
+ send: {
61
+ preSend: [sendFields],
62
+ },
63
+ },
64
+ },
65
+ ],
66
+ },
67
+ ];
68
+ //# sourceMappingURL=getAll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAll.js","sourceRoot":"","sources":["../../../../../nodes/IptRestApi2/resources/tableData/getAll.ts"],"names":[],"mappings":";;;AACA,4CAAqF;AAErF,MAAM,kBAAkB,GAAG;IAC1B,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,SAAS,EAAE,CAAC,QAAQ,CAAC;CACrB,CAAC;AAIF,KAAK,UAAU,UAAU,CAExB,cAAmC;IAEnC,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EA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
+ export declare const tableDataDescription: INodeProperties[];
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tableDataDescription = void 0;
4
+ const response_1 = require("../../shared/response");
5
+ const getAll_1 = require("./getAll");
6
+ exports.tableDataDescription = [
7
+ {
8
+ displayName: 'Operation',
9
+ name: 'operation',
10
+ type: 'options',
11
+ noDataExpression: true,
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['tableData'],
15
+ },
16
+ },
17
+ options: [
18
+ {
19
+ name: 'Get Many',
20
+ value: 'getAll',
21
+ action: 'Get many table rows from myfactory',
22
+ description: 'Get the rows of a table or view',
23
+ routing: {
24
+ request: { method: 'GET', url: '/tabledatas', ignoreHttpStatusErrors: true },
25
+ output: {
26
+ postReceive: [
27
+ ...response_1.baseItemsOutput,
28
+ {
29
+ type: 'rootProperty',
30
+ properties: {
31
+ property: 'Data',
32
+ },
33
+ },
34
+ ],
35
+ },
36
+ },
37
+ },
38
+ ],
39
+ default: 'getAll',
40
+ },
41
+ ...getAll_1.tableDataGetManyDescription,
42
+ ];
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/IptRestApi2/resources/tableData/index.ts"],"names":[],"mappings":";;;AACA,oDAAwD;AACxD,qCAAuD;AAG1C,QAAA,oBAAoB,GAAsB;IACtD;QACC,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,WAAW,CAAC;aACvB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,oCAAoC;gBAC5C,WAAW,EAAE,iCAAiC;gBAC9C,OAAO,EAAE;oBACR,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,sBAAsB,EAAE,IAAI,EAAE;oBAC5E,MAAM,EAAE;wBACP,WAAW,EAAE;4BACZ,GAAG,0BAAe;4BAElB;gCACC,IAAI,EAAE,cAAc;gCACpB,UAAU,EAAE;oCACX,QAAQ,EAAE,MAAM;iCAChB;6BACD;yBACD;qBACD;iBACD;aACD;SACD;QACD,OAAO,EAAE,QAAQ;KACjB;IACD,GAAG,oCAA2B;CAC9B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { INodeProperties, INodePropertyOptions } from 'n8n-workflow';
2
+ import type { ResourceInfo } from './resource';
3
+ export declare function recordAction(info: ResourceInfo, name: string, value: string, action: string, description: string, apiAction: string): INodePropertyOptions;
4
+ export declare function transformOperation(info: ResourceInfo, action: string, description: string): INodePropertyOptions;
5
+ export declare function showFor(resource: string, operation: string): {
6
+ show: {
7
+ resource: string[];
8
+ operation: string[];
9
+ };
10
+ };
11
+ export declare function actionNotice(resource: string, operation: string, text: string): INodeProperties;
12
+ export declare function bodySwitch(displayName: string, name: string, description: string): INodeProperties;
13
+ export declare function bodyNumber(displayName: string, name: string, description: string): INodeProperties;
14
+ export declare function changeCurrencyProperties(info: ResourceInfo): INodeProperties[];
15
+ export declare function transformProperties(info: ResourceInfo, sourceHint: string, targetTypeDescription: string): INodeProperties[];
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.recordAction = recordAction;
4
+ exports.transformOperation = transformOperation;
5
+ exports.showFor = showFor;
6
+ exports.actionNotice = actionNotice;
7
+ exports.bodySwitch = bodySwitch;
8
+ exports.bodyNumber = bodyNumber;
9
+ exports.changeCurrencyProperties = changeCurrencyProperties;
10
+ exports.transformProperties = transformProperties;
11
+ const response_1 = require("./response");
12
+ function recordAction(info, name, value, action, description, apiAction) {
13
+ return {
14
+ name,
15
+ value,
16
+ action,
17
+ description,
18
+ routing: {
19
+ request: {
20
+ method: 'POST',
21
+ url: `=${info.path}/{{encodeURIComponent($parameter.${info.idParameter})}}/${apiAction}`,
22
+ headers: { 'Content-Type': 'application/json' },
23
+ ignoreHttpStatusErrors: true,
24
+ },
25
+ output: {
26
+ postReceive: response_1.resultOutput,
27
+ },
28
+ },
29
+ };
30
+ }
31
+ function transformOperation(info, action, description) {
32
+ return {
33
+ name: 'Transform',
34
+ value: 'transform',
35
+ action,
36
+ description,
37
+ routing: {
38
+ request: {
39
+ method: 'POST',
40
+ url: `${info.path}/transform`,
41
+ ignoreHttpStatusErrors: true,
42
+ },
43
+ output: {
44
+ postReceive: response_1.baseItemsOutput,
45
+ },
46
+ },
47
+ };
48
+ }
49
+ function showFor(resource, operation) {
50
+ return {
51
+ show: {
52
+ resource: [resource],
53
+ operation: [operation],
54
+ },
55
+ };
56
+ }
57
+ function actionNotice(resource, operation, text) {
58
+ return {
59
+ displayName: text,
60
+ name: `${operation}Notice`,
61
+ type: 'notice',
62
+ displayOptions: showFor(resource, operation),
63
+ default: '',
64
+ };
65
+ }
66
+ function bodySwitch(displayName, name, description) {
67
+ return {
68
+ displayName,
69
+ name,
70
+ type: 'boolean',
71
+ default: false,
72
+ description,
73
+ routing: { send: { type: 'body', property: name } },
74
+ };
75
+ }
76
+ function bodyNumber(displayName, name, description) {
77
+ async function sendUnlessZero(requestOptions) {
78
+ const raw = this.getNodeParameter(`additionalFields.${name}`, 0);
79
+ const value = typeof raw === 'number' ? raw : Number(raw);
80
+ if (Number.isFinite(value) && value !== 0) {
81
+ requestOptions.body = { ...requestOptions.body, [name]: value };
82
+ }
83
+ return requestOptions;
84
+ }
85
+ return {
86
+ displayName,
87
+ name,
88
+ type: 'number',
89
+ default: 0,
90
+ description: `${description}. 0 is not sent.`,
91
+ routing: { send: { preSend: [sendUnlessZero] } },
92
+ };
93
+ }
94
+ function changeCurrencyProperties(info) {
95
+ return [
96
+ {
97
+ displayName: 'Currency',
98
+ name: 'currency',
99
+ type: 'string',
100
+ required: true,
101
+ displayOptions: showFor(info.resource, 'changeCurrency'),
102
+ default: '',
103
+ placeholder: 'USD',
104
+ description: `Code of a currency set up in myfactory to switch the ${info.label} to. The API does not check the code.`,
105
+ routing: { send: { type: 'body', property: 'currency' } },
106
+ },
107
+ {
108
+ displayName: 'Additional Fields',
109
+ name: 'additionalFields',
110
+ type: 'collection',
111
+ placeholder: 'Add Field',
112
+ displayOptions: showFor(info.resource, 'changeCurrency'),
113
+ default: {},
114
+ options: [
115
+ {
116
+ displayName: 'Exchange Rate',
117
+ name: 'rate',
118
+ type: 'number',
119
+ default: 0,
120
+ description: 'Fixed exchange rate. 0 uses the daily rate set up in myfactory.',
121
+ routing: { send: { type: 'body', property: 'rate' } },
122
+ },
123
+ ],
124
+ },
125
+ ];
126
+ }
127
+ function transformProperties(info, sourceHint, targetTypeDescription) {
128
+ return [
129
+ {
130
+ displayName: 'Source Order ID',
131
+ name: 'sourceOrderId',
132
+ type: 'string',
133
+ required: true,
134
+ displayOptions: showFor(info.resource, 'transform'),
135
+ default: '',
136
+ placeholder: '1234',
137
+ description: `Numeric ID of the ${info.label} to transform (field ${info.idField})`,
138
+ hint: sourceHint,
139
+ routing: { send: { type: 'query', property: 'sourceorderid' } },
140
+ },
141
+ {
142
+ displayName: 'Target Order Type',
143
+ name: 'targetOrderType',
144
+ type: 'number',
145
+ required: true,
146
+ displayOptions: showFor(info.resource, 'transform'),
147
+ default: 0,
148
+ description: targetTypeDescription,
149
+ routing: { send: { type: 'query', property: 'targetordertype' } },
150
+ },
151
+ {
152
+ displayName: 'Additional Fields',
153
+ name: 'additionalFields',
154
+ type: 'collection',
155
+ placeholder: 'Add Field',
156
+ displayOptions: showFor(info.resource, 'transform'),
157
+ default: {},
158
+ options: [
159
+ {
160
+ displayName: 'Full Copy',
161
+ name: 'fullCopy',
162
+ type: 'boolean',
163
+ default: false,
164
+ description: 'Whether to take over all positions instead of only the positions that are still open',
165
+ routing: { send: { type: 'query', property: 'fullcopy' } },
166
+ },
167
+ ],
168
+ },
169
+ ];
170
+ }
171
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/actions.ts"],"names":[],"mappings":";;AAaA,oCA2BC;AAKD,gDAqBC;AAGD,0BAOC;AAGD,oCAQC;AAID,gCAaC;AAMD,gCAyBC;AAGD,4DAgCC;AAGD,kDAgDC;AAtND,yCAA2D;AAM3D,SAAgB,YAAY,CAC3B,IAAkB,EAClB,IAAY,EACZ,KAAa,EACb,MAAc,EACd,WAAmB,EACnB,SAAiB;IAEjB,OAAO;QACN,IAAI;QACJ,KAAK;QACL,MAAM;QACN,WAAW;QACX,OAAO,EAAE;YACR,OAAO,EAAE;gBACR,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,IAAI,IAAI,CAAC,IAAI,oCAAoC,IAAI,CAAC,WAAW,OAAO,SAAS,EAAE;gBAGxF,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;gBAC/C,sBAAsB,EAAE,IAAI;aAC5B;YACD,MAAM,EAAE;gBACP,WAAW,EAAE,uBAAY;aACzB;SACD;KACD,CAAC;AACH,CAAC;AAKD,SAAgB,kBAAkB,CACjC,IAAkB,EAClB,MAAc,EACd,WAAmB;IAEnB,OAAO;QACN,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,WAAW;QAClB,MAAM;QACN,WAAW;QACX,OAAO,EAAE;YACR,OAAO,EAAE;gBACR,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,YAAY;gBAC7B,sBAAsB,EAAE,IAAI;aAC5B;YACD,MAAM,EAAE;gBACP,WAAW,EAAE,0BAAe;aAC5B;SACD;KACD,CAAC;AACH,CAAC;AAGD,SAAgB,OAAO,CAAC,QAAgB,EAAE,SAAiB;IAC1D,OAAO;QACN,IAAI,EAAE;YACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,SAAS,EAAE,CAAC,SAAS,C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AAI,CAAC,QAAQ,EAAE,WAAW,CAAC;YACnD,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,qBAAqB,IAAI,CAAC,KAAK,wBAAwB,IAAI,CAAC,OAAO,GAAG;YACnF,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE;SAC/D;QACD;YACC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC;YACnD,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,qBAAqB;YAClC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE;SACjE;QACD;YACC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,WAAW;YACxB,cAAc,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC;YACnD,OAAO,EAAE,EAAE;YACX,OAAO,EAAE;gBACR;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;oBACd,WAAW,EACV,sFAAsF;oBACvF,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE;iBAC1D;aACD;SACD;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type INodeProperties, type PostReceiveAction } from 'n8n-workflow';
2
+ import { type ResourceInfo } from './resource';
3
+ export declare function deleteProperties(info: ResourceInfo, notice: string, filterExample?: string): INodeProperties[];
4
+ export declare function deletedOutput(info: ResourceInfo): PostReceiveAction;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteProperties = deleteProperties;
4
+ exports.deletedOutput = deletedOutput;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const filters_1 = require("./filters");
7
+ const resource_1 = require("./resource");
8
+ function deleteProperties(info, notice, filterExample) {
9
+ const deleteNotice = {
10
+ displayName: notice,
11
+ name: `${info.resource}DeleteNotice`,
12
+ type: 'notice',
13
+ displayOptions: {
14
+ show: {
15
+ resource: [info.resource],
16
+ operation: ['delete'],
17
+ },
18
+ },
19
+ default: '',
20
+ };
21
+ if (filterExample === undefined) {
22
+ return [deleteNotice, (0, resource_1.idProperty)(info, { operation: ['delete'] })];
23
+ }
24
+ async function sendDeleteFilters(requestOptions) {
25
+ if (!this.getNodeParameter('deleteMultiple', false)) {
26
+ return requestOptions;
27
+ }
28
+ const filters = this.getNodeParameter('filters.filter', []);
29
+ const qs = (0, filters_1.filterQuery)(this.getNode(), filters, info.labelPlural, filterExample, ' Delete Multiple only accepts fields that must equal a value.', ' Nothing was deleted.');
30
+ if (Object.keys(qs).length === 0) {
31
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Delete Multiple needs at least one filter', {
32
+ description: `Without a filter the API would delete every ${info.label}. Nothing was deleted.`,
33
+ });
34
+ }
35
+ requestOptions.url = info.path;
36
+ requestOptions.qs = { ...qs, multidelete: 'true' };
37
+ return requestOptions;
38
+ }
39
+ return [
40
+ deleteNotice,
41
+ (0, resource_1.idProperty)(info, { operation: ['delete'], deleteMultiple: [false] }),
42
+ {
43
+ displayName: 'Delete Multiple',
44
+ name: 'deleteMultiple',
45
+ type: 'boolean',
46
+ noDataExpression: true,
47
+ displayOptions: {
48
+ show: {
49
+ resource: [info.resource],
50
+ operation: ['delete'],
51
+ },
52
+ },
53
+ default: false,
54
+ description: `Whether to delete every ${info.label} that matches the filters instead of one ${info.label} by ID`,
55
+ routing: {
56
+ send: {
57
+ preSend: [sendDeleteFilters],
58
+ },
59
+ },
60
+ },
61
+ {
62
+ displayName: `All ${info.labelPlural} that match every filter are deleted, one after the other. The delete stops at the first ${info.label} that is still in use, and the ${info.labelPlural} deleted before stay deleted. Check the filters with Get Many first.`,
63
+ name: 'deleteMultipleNotice',
64
+ type: 'notice',
65
+ displayOptions: {
66
+ show: {
67
+ resource: [info.resource],
68
+ operation: ['delete'],
69
+ deleteMultiple: [true],
70
+ },
71
+ },
72
+ default: '',
73
+ },
74
+ {
75
+ displayName: 'Filters',
76
+ name: 'filters',
77
+ type: 'fixedCollection',
78
+ required: true,
79
+ placeholder: 'Add Filter',
80
+ typeOptions: {
81
+ multipleValues: true,
82
+ },
83
+ displayOptions: {
84
+ show: {
85
+ resource: [info.resource],
86
+ operation: ['delete'],
87
+ deleteMultiple: [true],
88
+ },
89
+ },
90
+ default: {},
91
+ description: `Only ${info.labelPlural} that match every filter exactly (field = value) are deleted`,
92
+ options: (0, filters_1.filterValues)(info.labelPlural, filterExample),
93
+ },
94
+ ];
95
+ }
96
+ function deletedOutput(info) {
97
+ return async function (_items, response) {
98
+ var _a, _b;
99
+ const body = response.body;
100
+ const records = Array.isArray(body.Result) ? body.Result : [];
101
+ if (this.getNodeParameter('deleteMultiple', false)) {
102
+ return [
103
+ {
104
+ json: {
105
+ deleted: true,
106
+ [`${info.idField}s`]: records.map((record) => record[info.idField]),
107
+ },
108
+ },
109
+ ];
110
+ }
111
+ const id = (_b = (_a = records[0]) === null || _a === void 0 ? void 0 : _a[info.idField]) !== null && _b !== void 0 ? _b : Number(this.getNodeParameter(info.idParameter));
112
+ return [{ json: { deleted: true, [info.idField]: id } }];
113
+ };
114
+ }
115
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../nodes/IptRestApi2/shared/delete.ts"],"names":[],"mappings":";;AAgBA,4CAgHC;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EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1D,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type IDataObject, type INode, type INodePropertyCollection } from 'n8n-workflow';
2
+ export declare function filterValues(labelPlural: string, filterExample: string): INodePropertyCollection[];
3
+ export declare function filterQuery(node: INode, filters: IDataObject[], labelPlural: string, filterExample: string, nameHint: string, note: string): IDataObject;