@tom-schorn/n8n-nodes-paperless 0.1.3

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 (163) hide show
  1. package/LICENSE.md +23 -0
  2. package/README.md +122 -0
  3. package/dist/credentials/PaperlessApi.credentials.d.ts +8 -0
  4. package/dist/credentials/PaperlessApi.credentials.js +38 -0
  5. package/dist/credentials/PaperlessApi.credentials.js.map +1 -0
  6. package/dist/nodes/Paperless/Paperless.node.d.ts +4 -0
  7. package/dist/nodes/Paperless/Paperless.node.js +24 -0
  8. package/dist/nodes/Paperless/Paperless.node.js.map +1 -0
  9. package/dist/nodes/Paperless/Paperless.node.json +14 -0
  10. package/dist/nodes/Paperless/v2/PaperlessV2.node.d.ts +10 -0
  11. package/dist/nodes/Paperless/v2/PaperlessV2.node.js +56 -0
  12. package/dist/nodes/Paperless/v2/PaperlessV2.node.js.map +1 -0
  13. package/dist/nodes/Paperless/v2/actions/asn/asn.resource.d.ts +4 -0
  14. package/dist/nodes/Paperless/v2/actions/asn/asn.resource.js +60 -0
  15. package/dist/nodes/Paperless/v2/actions/asn/asn.resource.js.map +1 -0
  16. package/dist/nodes/Paperless/v2/actions/asn/next.operation.d.ts +3 -0
  17. package/dist/nodes/Paperless/v2/actions/asn/next.operation.js +14 -0
  18. package/dist/nodes/Paperless/v2/actions/asn/next.operation.js.map +1 -0
  19. package/dist/nodes/Paperless/v2/actions/correspondent/correspondent.resource.d.ts +8 -0
  20. package/dist/nodes/Paperless/v2/actions/correspondent/correspondent.resource.js +91 -0
  21. package/dist/nodes/Paperless/v2/actions/correspondent/correspondent.resource.js.map +1 -0
  22. package/dist/nodes/Paperless/v2/actions/correspondent/create.operation.d.ts +3 -0
  23. package/dist/nodes/Paperless/v2/actions/correspondent/create.operation.js +67 -0
  24. package/dist/nodes/Paperless/v2/actions/correspondent/create.operation.js.map +1 -0
  25. package/dist/nodes/Paperless/v2/actions/correspondent/get.operation.d.ts +3 -0
  26. package/dist/nodes/Paperless/v2/actions/correspondent/get.operation.js +56 -0
  27. package/dist/nodes/Paperless/v2/actions/correspondent/get.operation.js.map +1 -0
  28. package/dist/nodes/Paperless/v2/actions/correspondent/list.operation.d.ts +3 -0
  29. package/dist/nodes/Paperless/v2/actions/correspondent/list.operation.js +21 -0
  30. package/dist/nodes/Paperless/v2/actions/correspondent/list.operation.js.map +1 -0
  31. package/dist/nodes/Paperless/v2/actions/correspondent/remove.operation.d.ts +3 -0
  32. package/dist/nodes/Paperless/v2/actions/correspondent/remove.operation.js +56 -0
  33. package/dist/nodes/Paperless/v2/actions/correspondent/remove.operation.js.map +1 -0
  34. package/dist/nodes/Paperless/v2/actions/correspondent/update.operation.d.ts +3 -0
  35. package/dist/nodes/Paperless/v2/actions/correspondent/update.operation.js +107 -0
  36. package/dist/nodes/Paperless/v2/actions/correspondent/update.operation.js.map +1 -0
  37. package/dist/nodes/Paperless/v2/actions/custom_field/create.operation.d.ts +3 -0
  38. package/dist/nodes/Paperless/v2/actions/custom_field/create.operation.js +116 -0
  39. package/dist/nodes/Paperless/v2/actions/custom_field/create.operation.js.map +1 -0
  40. package/dist/nodes/Paperless/v2/actions/custom_field/custom_field.resource.d.ts +8 -0
  41. package/dist/nodes/Paperless/v2/actions/custom_field/custom_field.resource.js +91 -0
  42. package/dist/nodes/Paperless/v2/actions/custom_field/custom_field.resource.js.map +1 -0
  43. package/dist/nodes/Paperless/v2/actions/custom_field/get.operation.d.ts +3 -0
  44. package/dist/nodes/Paperless/v2/actions/custom_field/get.operation.js +56 -0
  45. package/dist/nodes/Paperless/v2/actions/custom_field/get.operation.js.map +1 -0
  46. package/dist/nodes/Paperless/v2/actions/custom_field/list.operation.d.ts +3 -0
  47. package/dist/nodes/Paperless/v2/actions/custom_field/list.operation.js +21 -0
  48. package/dist/nodes/Paperless/v2/actions/custom_field/list.operation.js.map +1 -0
  49. package/dist/nodes/Paperless/v2/actions/custom_field/remove.operation.d.ts +3 -0
  50. package/dist/nodes/Paperless/v2/actions/custom_field/remove.operation.js +56 -0
  51. package/dist/nodes/Paperless/v2/actions/custom_field/remove.operation.js.map +1 -0
  52. package/dist/nodes/Paperless/v2/actions/custom_field/update.operation.d.ts +3 -0
  53. package/dist/nodes/Paperless/v2/actions/custom_field/update.operation.js +128 -0
  54. package/dist/nodes/Paperless/v2/actions/custom_field/update.operation.js.map +1 -0
  55. package/dist/nodes/Paperless/v2/actions/document/create.operation.d.ts +3 -0
  56. package/dist/nodes/Paperless/v2/actions/document/create.operation.js +209 -0
  57. package/dist/nodes/Paperless/v2/actions/document/create.operation.js.map +1 -0
  58. package/dist/nodes/Paperless/v2/actions/document/document.resource.d.ts +13 -0
  59. package/dist/nodes/Paperless/v2/actions/document/document.resource.js +131 -0
  60. package/dist/nodes/Paperless/v2/actions/document/document.resource.js.map +1 -0
  61. package/dist/nodes/Paperless/v2/actions/document/get.operation.d.ts +3 -0
  62. package/dist/nodes/Paperless/v2/actions/document/get.operation.js +77 -0
  63. package/dist/nodes/Paperless/v2/actions/document/get.operation.js.map +1 -0
  64. package/dist/nodes/Paperless/v2/actions/document/get_history.operation.d.ts +3 -0
  65. package/dist/nodes/Paperless/v2/actions/document/get_history.operation.js +86 -0
  66. package/dist/nodes/Paperless/v2/actions/document/get_history.operation.js.map +1 -0
  67. package/dist/nodes/Paperless/v2/actions/document/get_metadata.operation.d.ts +3 -0
  68. package/dist/nodes/Paperless/v2/actions/document/get_metadata.operation.js +79 -0
  69. package/dist/nodes/Paperless/v2/actions/document/get_metadata.operation.js.map +1 -0
  70. package/dist/nodes/Paperless/v2/actions/document/get_metadata_suggestions.operation.d.ts +3 -0
  71. package/dist/nodes/Paperless/v2/actions/document/get_metadata_suggestions.operation.js +119 -0
  72. package/dist/nodes/Paperless/v2/actions/document/get_metadata_suggestions.operation.js.map +1 -0
  73. package/dist/nodes/Paperless/v2/actions/document/get_preview.operation.d.ts +3 -0
  74. package/dist/nodes/Paperless/v2/actions/document/get_preview.operation.js +84 -0
  75. package/dist/nodes/Paperless/v2/actions/document/get_preview.operation.js.map +1 -0
  76. package/dist/nodes/Paperless/v2/actions/document/get_sharelink.operation.d.ts +3 -0
  77. package/dist/nodes/Paperless/v2/actions/document/get_sharelink.operation.js +79 -0
  78. package/dist/nodes/Paperless/v2/actions/document/get_sharelink.operation.js.map +1 -0
  79. package/dist/nodes/Paperless/v2/actions/document/list.operation.d.ts +3 -0
  80. package/dist/nodes/Paperless/v2/actions/document/list.operation.js +21 -0
  81. package/dist/nodes/Paperless/v2/actions/document/list.operation.js.map +1 -0
  82. package/dist/nodes/Paperless/v2/actions/document/remove.operation.d.ts +3 -0
  83. package/dist/nodes/Paperless/v2/actions/document/remove.operation.js +77 -0
  84. package/dist/nodes/Paperless/v2/actions/document/remove.operation.js.map +1 -0
  85. package/dist/nodes/Paperless/v2/actions/document/update.operation.d.ts +3 -0
  86. package/dist/nodes/Paperless/v2/actions/document/update.operation.js +368 -0
  87. package/dist/nodes/Paperless/v2/actions/document/update.operation.js.map +1 -0
  88. package/dist/nodes/Paperless/v2/actions/document_note/create.operation.d.ts +3 -0
  89. package/dist/nodes/Paperless/v2/actions/document_note/create.operation.js +98 -0
  90. package/dist/nodes/Paperless/v2/actions/document_note/create.operation.js.map +1 -0
  91. package/dist/nodes/Paperless/v2/actions/document_note/document_note.resource.d.ts +6 -0
  92. package/dist/nodes/Paperless/v2/actions/document_note/document_note.resource.js +75 -0
  93. package/dist/nodes/Paperless/v2/actions/document_note/document_note.resource.js.map +1 -0
  94. package/dist/nodes/Paperless/v2/actions/document_note/list.operation.d.ts +3 -0
  95. package/dist/nodes/Paperless/v2/actions/document_note/list.operation.js +86 -0
  96. package/dist/nodes/Paperless/v2/actions/document_note/list.operation.js.map +1 -0
  97. package/dist/nodes/Paperless/v2/actions/document_note/remove.operation.d.ts +3 -0
  98. package/dist/nodes/Paperless/v2/actions/document_note/remove.operation.js +123 -0
  99. package/dist/nodes/Paperless/v2/actions/document_note/remove.operation.js.map +1 -0
  100. package/dist/nodes/Paperless/v2/actions/document_type/create.operation.d.ts +3 -0
  101. package/dist/nodes/Paperless/v2/actions/document_type/create.operation.js +67 -0
  102. package/dist/nodes/Paperless/v2/actions/document_type/create.operation.js.map +1 -0
  103. package/dist/nodes/Paperless/v2/actions/document_type/document_type.resource.d.ts +8 -0
  104. package/dist/nodes/Paperless/v2/actions/document_type/document_type.resource.js +91 -0
  105. package/dist/nodes/Paperless/v2/actions/document_type/document_type.resource.js.map +1 -0
  106. package/dist/nodes/Paperless/v2/actions/document_type/get.operation.d.ts +3 -0
  107. package/dist/nodes/Paperless/v2/actions/document_type/get.operation.js +56 -0
  108. package/dist/nodes/Paperless/v2/actions/document_type/get.operation.js.map +1 -0
  109. package/dist/nodes/Paperless/v2/actions/document_type/list.operation.d.ts +3 -0
  110. package/dist/nodes/Paperless/v2/actions/document_type/list.operation.js +21 -0
  111. package/dist/nodes/Paperless/v2/actions/document_type/list.operation.js.map +1 -0
  112. package/dist/nodes/Paperless/v2/actions/document_type/remove.operation.d.ts +3 -0
  113. package/dist/nodes/Paperless/v2/actions/document_type/remove.operation.js +56 -0
  114. package/dist/nodes/Paperless/v2/actions/document_type/remove.operation.js.map +1 -0
  115. package/dist/nodes/Paperless/v2/actions/document_type/update.operation.d.ts +3 -0
  116. package/dist/nodes/Paperless/v2/actions/document_type/update.operation.js +111 -0
  117. package/dist/nodes/Paperless/v2/actions/document_type/update.operation.js.map +1 -0
  118. package/dist/nodes/Paperless/v2/actions/node.type.d.ts +12 -0
  119. package/dist/nodes/Paperless/v2/actions/node.type.js +3 -0
  120. package/dist/nodes/Paperless/v2/actions/node.type.js.map +1 -0
  121. package/dist/nodes/Paperless/v2/actions/router.d.ts +2 -0
  122. package/dist/nodes/Paperless/v2/actions/router.js +92 -0
  123. package/dist/nodes/Paperless/v2/actions/router.js.map +1 -0
  124. package/dist/nodes/Paperless/v2/actions/tag/create.operation.d.ts +3 -0
  125. package/dist/nodes/Paperless/v2/actions/tag/create.operation.js +67 -0
  126. package/dist/nodes/Paperless/v2/actions/tag/create.operation.js.map +1 -0
  127. package/dist/nodes/Paperless/v2/actions/tag/get.operation.d.ts +3 -0
  128. package/dist/nodes/Paperless/v2/actions/tag/get.operation.js +56 -0
  129. package/dist/nodes/Paperless/v2/actions/tag/get.operation.js.map +1 -0
  130. package/dist/nodes/Paperless/v2/actions/tag/list.operation.d.ts +3 -0
  131. package/dist/nodes/Paperless/v2/actions/tag/list.operation.js +21 -0
  132. package/dist/nodes/Paperless/v2/actions/tag/list.operation.js.map +1 -0
  133. package/dist/nodes/Paperless/v2/actions/tag/remove.operation.d.ts +3 -0
  134. package/dist/nodes/Paperless/v2/actions/tag/remove.operation.js +56 -0
  135. package/dist/nodes/Paperless/v2/actions/tag/remove.operation.js.map +1 -0
  136. package/dist/nodes/Paperless/v2/actions/tag/tag.resource.d.ts +8 -0
  137. package/dist/nodes/Paperless/v2/actions/tag/tag.resource.js +91 -0
  138. package/dist/nodes/Paperless/v2/actions/tag/tag.resource.js.map +1 -0
  139. package/dist/nodes/Paperless/v2/actions/tag/update.operation.d.ts +3 -0
  140. package/dist/nodes/Paperless/v2/actions/tag/update.operation.js +107 -0
  141. package/dist/nodes/Paperless/v2/actions/tag/update.operation.js.map +1 -0
  142. package/dist/nodes/Paperless/v2/actions/task/get.operation.d.ts +3 -0
  143. package/dist/nodes/Paperless/v2/actions/task/get.operation.js +38 -0
  144. package/dist/nodes/Paperless/v2/actions/task/get.operation.js.map +1 -0
  145. package/dist/nodes/Paperless/v2/actions/task/task.resource.d.ts +4 -0
  146. package/dist/nodes/Paperless/v2/actions/task/task.resource.js +59 -0
  147. package/dist/nodes/Paperless/v2/actions/task/task.resource.js.map +1 -0
  148. package/dist/nodes/Paperless/v2/actions/version.d.ts +2 -0
  149. package/dist/nodes/Paperless/v2/actions/version.js +117 -0
  150. package/dist/nodes/Paperless/v2/actions/version.js.map +1 -0
  151. package/dist/nodes/Paperless/v2/methods/index.d.ts +1 -0
  152. package/dist/nodes/Paperless/v2/methods/index.js +38 -0
  153. package/dist/nodes/Paperless/v2/methods/index.js.map +1 -0
  154. package/dist/nodes/Paperless/v2/methods/listSearch.d.ts +8 -0
  155. package/dist/nodes/Paperless/v2/methods/listSearch.js +71 -0
  156. package/dist/nodes/Paperless/v2/methods/listSearch.js.map +1 -0
  157. package/dist/nodes/Paperless/v2/paperless-ngx.svg +1 -0
  158. package/dist/nodes/Paperless/v2/transport/index.d.ts +3 -0
  159. package/dist/nodes/Paperless/v2/transport/index.js +50 -0
  160. package/dist/nodes/Paperless/v2/transport/index.js.map +1 -0
  161. package/dist/package.json +74 -0
  162. package/index.js +0 -0
  163. package/package.json +74 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/correspondent/get.operation.ts"],"names":[],"mappings":";;;AAqDA,0BASC;AAxDD,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,qBAAqB;oBACvC,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACX;wBACC,IAAI,EAAE,OAAO;wBACb,UAAU,EAAE;4BACX,KAAK,EAAE,eAAe;4BACtB,YAAY,EAAE,mCAAmC;yBACjD;qBACD;iBACD;aACD;SACD;QACD,WAAW,EAAE,yBAAyB;QACtC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB;KACvB;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,EAAE,GAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAmC,CAAC,KAAK,CAAC;IAC3F,MAAM,QAAQ,GAAG,mBAAmB,EAAE,GAAG,CAAC;IAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAQ,CAAC;IAElF,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const transport_1 = require("../../transport");
7
+ exports.description = [];
8
+ async function execute(itemIndex) {
9
+ const endpoint = '/correspondents/';
10
+ const responses = (await transport_1.apiRequestPaginated.call(this, itemIndex, 'GET', endpoint));
11
+ const statusCode = responses.reduce((acc, response) => acc + response.statusCode, 0) / responses.length;
12
+ if (statusCode !== 200) {
13
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The correspondents you are requesting could not be found`, {
14
+ description: JSON.stringify(responses.map((response) => { var _a, _b; return (_b = (_a = response === null || response === void 0 ? void 0 : response.body) === null || _a === void 0 ? void 0 : _a.details) !== null && _b !== void 0 ? _b : response === null || response === void 0 ? void 0 : response.statusMessage; })),
15
+ });
16
+ }
17
+ return {
18
+ json: { results: responses.map((response) => response.body.results).flat() },
19
+ };
20
+ }
21
+ //# sourceMappingURL=list.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/correspondent/list.operation.ts"],"names":[],"mappings":";;;AAUA,0BAuBC;AAjCD,+CAKsB;AACtB,+CAAsD;AAEzC,QAAA,WAAW,GAAsB,EAAE,CAAC;AAE1C,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,QAAQ,GAAG,kBAAkB,CAAC;IACpC,MAAM,SAAS,GAAG,CAAC,MAAM,+BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAU,CAAC;IAE9F,MAAM,UAAU,GACf,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;IACtF,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACxB,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,0DAA0D,EAC1D;YACC,WAAW,EAAE,IAAI,CAAC,SAAS,CAC1B,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,OAAO,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,CAAA,EAAA,CAAC,CAC/E;SACD,CACD,CAAC;IACH,CAAC;IACD,OAAO;QACN,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;KAC5E,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const transport_1 = require("../../transport");
6
+ exports.description = [
7
+ {
8
+ displayName: 'ID',
9
+ name: 'id',
10
+ default: { mode: 'list', value: '' },
11
+ displayOptions: {
12
+ show: {
13
+ resource: ['correspondent'],
14
+ operation: ['remove'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Correspondent...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'correspondentSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Correspondent ID...`,
33
+ type: 'string',
34
+ validation: [
35
+ {
36
+ type: 'regex',
37
+ properties: {
38
+ regex: '^[1-9][0-9]*$',
39
+ errorMessage: 'The ID must be a positive integer',
40
+ },
41
+ },
42
+ ],
43
+ },
44
+ ],
45
+ placeholder: 'ID of the correspondent',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ ];
50
+ async function execute(itemIndex) {
51
+ const id = this.getNodeParameter('id', itemIndex).value;
52
+ const endpoint = `/correspondents/${id}/`;
53
+ await transport_1.apiRequest.call(this, itemIndex, 'DELETE', endpoint);
54
+ return { json: { results: [true] } };
55
+ }
56
+ //# sourceMappingURL=remove.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.operation.js","sourceRoot":"","sources":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AE3D,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const transport_1 = require("../../transport");
6
+ exports.description = [
7
+ {
8
+ displayName: 'ID',
9
+ name: 'id',
10
+ default: { mode: 'list', value: '' },
11
+ displayOptions: {
12
+ show: {
13
+ resource: ['correspondent'],
14
+ operation: ['update'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Correspondent...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'correspondentSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Correspondent ID...`,
33
+ type: 'string',
34
+ validation: [
35
+ {
36
+ type: 'regex',
37
+ properties: {
38
+ regex: '^[1-9][0-9]*$',
39
+ errorMessage: 'The ID must be a positive integer',
40
+ },
41
+ },
42
+ ],
43
+ },
44
+ ],
45
+ placeholder: 'ID of the correspondent',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ {
50
+ displayName: 'Update Fields',
51
+ name: 'update_fields',
52
+ default: {},
53
+ displayOptions: {
54
+ show: {
55
+ resource: ['correspondent'],
56
+ operation: ['update'],
57
+ },
58
+ },
59
+ options: [
60
+ {
61
+ displayName: 'Name',
62
+ name: 'name',
63
+ placeholder: 'Name of the correspondent',
64
+ type: 'string',
65
+ default: '',
66
+ },
67
+ {
68
+ displayName: 'Matching Algorithm',
69
+ name: 'matching_algorithm',
70
+ default: 6,
71
+ options: [
72
+ { name: 'None: Disable matching', value: 0 },
73
+ { name: 'Any: Document contains any of these words (space separated)', value: 1 },
74
+ { name: 'All: Document contains all of these words (space separated)', value: 2 },
75
+ { name: 'Exact: Document contains this string', value: 3 },
76
+ { name: 'Regular Expression: Document Matches This Regular Expression', value: 4 },
77
+ { name: 'Fuzzy: Document contains a word similar to this word', value: 5 },
78
+ { name: 'Auto: Learn matching automatically', value: 6 },
79
+ ],
80
+ type: 'options',
81
+ },
82
+ {
83
+ displayName: 'Matching Expression',
84
+ name: 'match',
85
+ default: '',
86
+ placeholder: 'Matching expression to match',
87
+ type: 'string',
88
+ },
89
+ ],
90
+ placeholder: 'Add Field',
91
+ type: 'collection',
92
+ },
93
+ ];
94
+ async function execute(itemIndex) {
95
+ const id = this.getNodeParameter('id', itemIndex).value;
96
+ const endpoint = `/correspondents/${id}/`;
97
+ const updateFields = this.getNodeParameter('update_fields', itemIndex, {});
98
+ const body = {};
99
+ for (const key of Object.keys(updateFields)) {
100
+ if (updateFields[key] !== null && updateFields[key] !== undefined) {
101
+ body[key] = updateFields[key];
102
+ }
103
+ }
104
+ const response = (await transport_1.apiRequest.call(this, itemIndex, 'PATCH', endpoint, body));
105
+ return { json: { results: [response] } };
106
+ }
107
+ //# sourceMappingURL=update.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/correspondent/update.operation.ts"],"names":[],"mappings":";;;AAiGA,0BAqBC;AAhHD,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,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,CAAQ,CAAC;IAE1F,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const crypto_1 = require("crypto");
6
+ const transport_1 = require("../../transport");
7
+ exports.description = [
8
+ {
9
+ displayName: 'Name',
10
+ name: 'name',
11
+ displayOptions: {
12
+ show: {
13
+ resource: ['custom_field'],
14
+ operation: ['create'],
15
+ },
16
+ },
17
+ placeholder: 'Name of the custom field',
18
+ required: true,
19
+ type: 'string',
20
+ default: '',
21
+ },
22
+ {
23
+ displayName: 'Data Type',
24
+ name: 'data_type',
25
+ default: 'string',
26
+ description: 'The data type of the custom field',
27
+ displayOptions: {
28
+ show: {
29
+ resource: ['custom_field'],
30
+ operation: ['create'],
31
+ },
32
+ },
33
+ options: [
34
+ { name: 'Boolean', value: 'boolean' },
35
+ { name: 'Date', value: 'date' },
36
+ { name: 'Document Link', value: 'documentlink' },
37
+ { name: 'Float', value: 'float' },
38
+ { name: 'Integer', value: 'integer' },
39
+ { name: 'Monetary', value: 'monetary' },
40
+ { name: 'Select', value: 'select' },
41
+ { name: 'String', value: 'string' },
42
+ { name: 'URL', value: 'url' },
43
+ ],
44
+ type: 'options',
45
+ },
46
+ {
47
+ displayName: 'Select Options',
48
+ name: 'select_options',
49
+ default: [],
50
+ description: 'The options for the select data type',
51
+ displayOptions: {
52
+ show: {
53
+ resource: ['custom_field'],
54
+ operation: ['create'],
55
+ data_type: ['select'],
56
+ },
57
+ },
58
+ options: [
59
+ {
60
+ displayName: 'Option',
61
+ name: 'option',
62
+ values: [
63
+ {
64
+ displayName: 'Name',
65
+ name: 'name',
66
+ type: 'string',
67
+ default: '',
68
+ description: 'The name of the select option',
69
+ },
70
+ ],
71
+ },
72
+ ],
73
+ placeholder: 'Add Option',
74
+ type: 'fixedCollection',
75
+ typeOptions: {
76
+ multipleValues: true,
77
+ },
78
+ },
79
+ {
80
+ displayName: 'Default Currency',
81
+ name: 'default_currency',
82
+ default: '',
83
+ description: 'The default currency for the monetary data type',
84
+ displayOptions: {
85
+ show: {
86
+ resource: ['custom_field'],
87
+ operation: ['create'],
88
+ data_type: ['monetary'],
89
+ },
90
+ },
91
+ type: 'string',
92
+ },
93
+ ];
94
+ async function execute(itemIndex) {
95
+ const endpoint = `/custom_fields/`;
96
+ const body = {
97
+ name: this.getNodeParameter('name', itemIndex),
98
+ data_type: this.getNodeParameter('data_type', itemIndex),
99
+ extra_data: {},
100
+ };
101
+ this.logger.debug(`Creating custom field: ${JSON.stringify(this.getNodeParameter('select_options', itemIndex, null))}`);
102
+ const selectOptions = this.getNodeParameter('select_options', itemIndex, null);
103
+ if (selectOptions) {
104
+ body.extra_data.select_options = selectOptions.option.map((option) => ({
105
+ label: option.name.trim(),
106
+ id: (0, crypto_1.createHash)('sha256').update(option.name.trim()).digest('hex'),
107
+ }));
108
+ }
109
+ const defaultCurrency = this.getNodeParameter('default_currency', itemIndex, null);
110
+ if (defaultCurrency) {
111
+ body.extra_data.default_currency = defaultCurrency;
112
+ }
113
+ const response = (await transport_1.apiRequest.call(this, itemIndex, 'POST', endpoint, body));
114
+ return { json: { results: [response] } };
115
+ }
116
+ //# sourceMappingURL=create.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/custom_field/create.operation.ts"],"names":[],"mappings":";;;AA4FA,0BA8BC;AA1HD,mCAAoC;AAEpC,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,MAAM;QACn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AI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAQ,CAAC;IACtF,IAAI,aAAa,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,CAAC,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAwB,EAAE,EAAE,CAAC,CAAC;YACxF,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE;YACzB,EAAE,EAAE,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SACjE,CAAC,CAAC,CAAC;IACL,CAAC;IACD,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,SAAS,EAAE,IAAI,CAAQ,CAAC;IAC1F,IAAI,eAAe,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,CAAC,gBAAgB,GAAG,eAAe,CAAC;IACpD,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAQ,CAAC;IAEzF,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { INodeProperties } from 'n8n-workflow';
2
+ import * as create from './create.operation';
3
+ import * as get from './get.operation';
4
+ import * as list from './list.operation';
5
+ import * as remove from './remove.operation';
6
+ import * as update from './update.operation';
7
+ export { create, get, list, remove, update };
8
+ export declare const description: INodeProperties[];
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.description = exports.update = exports.remove = exports.list = exports.get = exports.create = void 0;
37
+ const create = __importStar(require("./create.operation"));
38
+ exports.create = create;
39
+ const get = __importStar(require("./get.operation"));
40
+ exports.get = get;
41
+ const list = __importStar(require("./list.operation"));
42
+ exports.list = list;
43
+ const remove = __importStar(require("./remove.operation"));
44
+ exports.remove = remove;
45
+ const update = __importStar(require("./update.operation"));
46
+ exports.update = update;
47
+ exports.description = [
48
+ {
49
+ displayName: 'Operation',
50
+ name: 'operation',
51
+ default: 'list',
52
+ displayOptions: {
53
+ show: { resource: ['custom_field'] },
54
+ },
55
+ noDataExpression: true,
56
+ options: [
57
+ {
58
+ name: 'Create a Custom Field',
59
+ value: 'create',
60
+ action: 'Create a new custom field',
61
+ },
62
+ {
63
+ name: 'Delete a Custom Field',
64
+ value: 'remove',
65
+ action: 'Delete a custom field',
66
+ },
67
+ {
68
+ name: 'Get a Custom Field',
69
+ value: 'get',
70
+ action: 'Get a custom field',
71
+ },
72
+ {
73
+ name: 'List Custom Fields',
74
+ value: 'list',
75
+ action: 'List all custom fields',
76
+ },
77
+ {
78
+ name: 'Update a Custom Field',
79
+ value: 'update',
80
+ action: 'Update a custom field',
81
+ },
82
+ ],
83
+ type: 'options',
84
+ },
85
+ ...create.description,
86
+ ...get.description,
87
+ ...list.description,
88
+ ...remove.description,
89
+ ...update.description,
90
+ ];
91
+ //# sourceMappingURL=custom_field.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom_field.resource.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/custom_field/custom_field.resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAA6C;AAMpC,wBAAM;AALf,qDAAuC;AAKtB,kBAAG;AAJpB,uDAAyC;AAInB,oBAAI;AAH1B,2DAA6C;AAGjB,wBAAM;AAFlC,2DAA6C;AAET,wBAAM;AAE7B,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE;YACf,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE;SACpC;QACD,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,uBAAuB;gBAC7B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,2BAA2B;aACnC;YACD;gBACC,IAAI,EAAE,uBAAuB;gBAC7B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,uBAAuB;aAC/B;YACD;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,oBAAoB;aAC5B;YACD;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,wBAAwB;aAChC;YACD;gBACC,IAAI,EAAE,uBAAuB;gBAC7B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,uBAAuB;aAC/B;SACD;QACD,IAAI,EAAE,SAAS;KACf;IACD,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,GAAG,CAAC,WAAW;IAClB,GAAG,IAAI,CAAC,WAAW;IACnB,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,MAAM,CAAC,WAAW;CACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const transport_1 = require("../../transport");
6
+ exports.description = [
7
+ {
8
+ displayName: 'ID',
9
+ name: 'id',
10
+ default: { mode: 'list', value: '' },
11
+ displayOptions: {
12
+ show: {
13
+ resource: ['custom_field'],
14
+ operation: ['get'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Custom Field...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'customFieldSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Custom Field ID...`,
33
+ type: 'string',
34
+ validation: [
35
+ {
36
+ type: 'regex',
37
+ properties: {
38
+ regex: '^[1-9][0-9]*$',
39
+ errorMessage: 'The ID must be a positive integer',
40
+ },
41
+ },
42
+ ],
43
+ },
44
+ ],
45
+ placeholder: 'ID of the custom_field',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ ];
50
+ async function execute(itemIndex) {
51
+ const id = this.getNodeParameter('id', itemIndex).value;
52
+ const endpoint = `/custom_fields/${id}/`;
53
+ const response = (await transport_1.apiRequest.call(this, itemIndex, 'GET', endpoint));
54
+ return { json: { results: [response] } };
55
+ }
56
+ //# sourceMappingURL=get.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/custom_field/get.operation.ts"],"names":[],"mappings":";;;AAqDA,0BASC;AAxDD,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,cAAc,CAAC;gBAC1B,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,mBAAmB;oBACrC,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACX;wBACC,IAAI,EAAE,OAAO;wBACb,UAAU,EAAE;4BACX,KAAK,EAAE,eAAe;4BACtB,YAAY,EAAE,mCAAmC;yBACjD;qBACD;iBACD;aACD;SACD;QACD,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB;KACvB;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,EAAE,GAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAmC,CAAC,KAAK,CAAC;IAC3F,MAAM,QAAQ,GAAG,kBAAkB,EAAE,GAAG,CAAC;IACzC,MAAM,QAAQ,GAAG,CAAC,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAQ,CAAC;IAElF,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const transport_1 = require("../../transport");
7
+ exports.description = [];
8
+ async function execute(itemIndex) {
9
+ const endpoint = '/custom_fields/';
10
+ const responses = (await transport_1.apiRequestPaginated.call(this, itemIndex, 'GET', endpoint));
11
+ const statusCode = responses.reduce((acc, response) => acc + response.statusCode, 0) / responses.length;
12
+ if (statusCode !== 200) {
13
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The custom fields you are requesting could not be found`, {
14
+ description: JSON.stringify(responses.map((response) => { var _a, _b; return (_b = (_a = response === null || response === void 0 ? void 0 : response.body) === null || _a === void 0 ? void 0 : _a.details) !== null && _b !== void 0 ? _b : response === null || response === void 0 ? void 0 : response.statusMessage; })),
15
+ });
16
+ }
17
+ return {
18
+ json: { results: responses.map((response) => response.body.results).flat() },
19
+ };
20
+ }
21
+ //# sourceMappingURL=list.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/custom_field/list.operation.ts"],"names":[],"mappings":";;;AAUA,0BAuBC;AAjCD,+CAKsB;AACtB,+CAAsD;AAEzC,QAAA,WAAW,GAAsB,EAAE,CAAC;AAE1C,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,QAAQ,GAAG,iBAAiB,CAAC;IACnC,MAAM,SAAS,GAAG,CAAC,MAAM,+BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAU,CAAC;IAE9F,MAAM,UAAU,GACf,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC;IACtF,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACxB,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,yDAAyD,EACzD;YACC,WAAW,EAAE,IAAI,CAAC,SAAS,CAC1B,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,OAAO,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,CAAA,EAAA,CAAC,CAC/E;SACD,CACD,CAAC;IACH,CAAC;IACD,OAAO;QACN,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;KAC5E,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const transport_1 = require("../../transport");
6
+ exports.description = [
7
+ {
8
+ displayName: 'ID',
9
+ name: 'id',
10
+ default: { mode: 'list', value: '' },
11
+ displayOptions: {
12
+ show: {
13
+ resource: ['custom_field'],
14
+ operation: ['remove'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Custom Field...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'customFieldSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Custom Field ID...`,
33
+ type: 'string',
34
+ validation: [
35
+ {
36
+ type: 'regex',
37
+ properties: {
38
+ regex: '^[1-9][0-9]*$',
39
+ errorMessage: 'The ID must be a positive integer',
40
+ },
41
+ },
42
+ ],
43
+ },
44
+ ],
45
+ placeholder: 'ID of the custom_field',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ ];
50
+ async function execute(itemIndex) {
51
+ const id = this.getNodeParameter('id', itemIndex).value;
52
+ const endpoint = `/custom_fields/${id}/`;
53
+ await transport_1.apiRequest.call(this, itemIndex, 'DELETE', endpoint);
54
+ return { json: { results: [true] } };
55
+ }
56
+ //# sourceMappingURL=remove.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/custom_field/remove.operation.ts"],"names":[],"mappings":";;;AAqDA,0BASC;AAxDD,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,cAAc,CAAC;gBAC1B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,mBAAmB;oBACrC,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,0BAA0B;gBACvC,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACX;wBACC,IAAI,EAAE,OAAO;wBACb,UAAU,EAAE;4BACX,KAAK,EAAE,eAAe;4BACtB,YAAY,EAAE,mCAAmC;yBACjD;qBACD;iBACD;aACD;SACD;QACD,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,iBAAiB;KACvB;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,EAAE,GAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAmC,CAAC,KAAK,CAAC;IAC3F,MAAM,QAAQ,GAAG,kBAAkB,EAAE,GAAG,CAAC;IACzC,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE3D,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AACtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: INodeProperties[];
3
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData>;