@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":"list.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/document_note/list.operation.ts"],"names":[],"mappings":";;;AA4EA,0BAyBC;AArGD,+CAMsB;AACtB,+CAAsD;AAEzC,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,WAAW,EAAE,8CAA8C;QAC3D,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,MAAM,CAAC;aACnB;SACD;QACD,IAAI,EAAE,kDAAkD;QACxD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,gBAAgB;oBAClC,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,sBAAsB;gBACnC,IAAI,E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AAC,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;IAED,OAAO;QACN,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;KACpE,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,123 @@
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: 'Document ID',
9
+ name: 'id',
10
+ default: { mode: 'list', value: '' },
11
+ description: 'ID of the document associated with the note',
12
+ displayOptions: {
13
+ show: {
14
+ resource: ['document_note'],
15
+ operation: ['remove'],
16
+ },
17
+ },
18
+ hint: 'The ID of the document associated with the note',
19
+ modes: [
20
+ {
21
+ displayName: 'From List',
22
+ name: 'list',
23
+ placeholder: `Select a Document...`,
24
+ type: 'list',
25
+ typeOptions: {
26
+ searchListMethod: 'documentSearch',
27
+ searchFilterRequired: false,
28
+ searchable: true,
29
+ },
30
+ },
31
+ {
32
+ displayName: 'By ID',
33
+ name: 'id',
34
+ placeholder: `Enter Document ID...`,
35
+ type: 'string',
36
+ validation: [
37
+ {
38
+ type: 'regex',
39
+ properties: {
40
+ regex: '^[1-9][0-9]*$',
41
+ errorMessage: 'The ID must be a positive integer',
42
+ },
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ displayName: 'By URL',
48
+ name: 'url',
49
+ placeholder: `Enter Document URL...`,
50
+ type: 'string',
51
+ validation: [
52
+ {
53
+ type: 'regex',
54
+ properties: {
55
+ regex: '^(?:http|https)://(?:.+?)/documents/(\\d+)/details$',
56
+ errorMessage: 'The URL must be a valid Paperless document URL (e.g. https://paperless.example.com/documents/123/details)',
57
+ },
58
+ },
59
+ ],
60
+ extractValue: {
61
+ type: 'regex',
62
+ regex: '^(?:http|https)://(?:.+?)/documents/(\\d+)/details$',
63
+ },
64
+ },
65
+ ],
66
+ placeholder: 'ID of the document',
67
+ required: true,
68
+ type: 'resourceLocator',
69
+ },
70
+ {
71
+ displayName: 'Note ID',
72
+ name: 'node_id',
73
+ default: { mode: 'list', value: '' },
74
+ description: 'ID of the note to remove',
75
+ displayOptions: {
76
+ show: {
77
+ resource: ['document_note'],
78
+ operation: ['remove'],
79
+ },
80
+ },
81
+ hint: 'The ID of the note to remove',
82
+ modes: [
83
+ {
84
+ displayName: 'From List',
85
+ name: 'list',
86
+ placeholder: `Select a Document...`,
87
+ type: 'list',
88
+ typeOptions: {
89
+ searchListMethod: 'documentNoteSearch',
90
+ searchFilterRequired: false,
91
+ searchable: true,
92
+ },
93
+ },
94
+ {
95
+ displayName: 'By ID',
96
+ name: 'id',
97
+ placeholder: `Enter Document ID...`,
98
+ type: 'string',
99
+ validation: [
100
+ {
101
+ type: 'regex',
102
+ properties: {
103
+ regex: '^[1-9][0-9]*$',
104
+ errorMessage: 'The ID must be a positive integer',
105
+ },
106
+ },
107
+ ],
108
+ },
109
+ ],
110
+ placeholder: 'ID of the note',
111
+ required: true,
112
+ type: 'resourceLocator',
113
+ },
114
+ ];
115
+ async function execute(itemIndex) {
116
+ const id = this.getNodeParameter('id', itemIndex).value;
117
+ const noteId = this.getNodeParameter('node_id', itemIndex)
118
+ .value;
119
+ const endpoint = `/documents/${id}/notes/?id=${noteId}`;
120
+ await transport_1.apiRequest.call(this, itemIndex, 'DELETE', endpoint);
121
+ return { json: { results: [true] } };
122
+ }
123
+ //# sourceMappingURL=remove.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/document_note/remove.operation.ts"],"names":[],"mappings":";;;AAuHA,0BAWC;AA5HD,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,WAAW,EAAE,6CAA6C;QAC1D,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,IAAI,EAAE,iDAAiD;QACvD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,gBAAgB;oBAClC,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,sBAAsB;gBACnC,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;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,KAAK;gBACX,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACX;wBACC,IAAI,EAAE,OAAO;wBACb,UAAU,EAAE;4BACX,KA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mC,CAAC,KAAK,CAAC;IAC3F,MAAM,MAAM,GAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAmC;SAC3F,KAAK,CAAC;IACR,MAAM,QAAQ,GAAG,cAAc,EAAE,cAAc,MAAM,EAAE,CAAC;IACxD,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>;
@@ -0,0 +1,67 @@
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: 'Name',
9
+ name: 'name',
10
+ displayOptions: {
11
+ show: {
12
+ resource: ['document_type'],
13
+ operation: ['create'],
14
+ },
15
+ },
16
+ placeholder: 'Name of the document_type',
17
+ required: true,
18
+ type: 'string',
19
+ default: '',
20
+ },
21
+ {
22
+ displayName: 'Matching Algorithm',
23
+ name: 'matching_algorithm',
24
+ default: 6,
25
+ displayOptions: {
26
+ show: {
27
+ resource: ['document_type'],
28
+ operation: ['create'],
29
+ },
30
+ },
31
+ options: [
32
+ { name: 'None: Disable matching', value: 0 },
33
+ { name: 'Any: Document contains any of these words (space separated)', value: 1 },
34
+ { name: 'All: Document contains all of these words (space separated)', value: 2 },
35
+ { name: 'Exact: Document contains this string', value: 3 },
36
+ { name: 'Regular Expression: Document Matches This Regular Expression', value: 4 },
37
+ { name: 'Fuzzy: Document contains a word similar to this word', value: 5 },
38
+ { name: 'Auto: Learn matching automatically', value: 6 },
39
+ ],
40
+ type: 'options',
41
+ },
42
+ {
43
+ displayName: 'Matching Expression',
44
+ name: 'match',
45
+ default: '',
46
+ displayOptions: {
47
+ show: {
48
+ resource: ['document_type'],
49
+ operation: ['create'],
50
+ matching_algorithm: [1, 2, 3, 4, 5],
51
+ },
52
+ },
53
+ placeholder: 'Matching expression to match',
54
+ type: 'string',
55
+ },
56
+ ];
57
+ async function execute(itemIndex) {
58
+ const endpoint = `/document_types/`;
59
+ const body = {
60
+ name: this.getNodeParameter('name', itemIndex),
61
+ matching_algorithm: this.getNodeParameter('matching_algorithm', itemIndex),
62
+ match: this.getNodeParameter('match', itemIndex, ''),
63
+ };
64
+ const response = (await transport_1.apiRequest.call(this, itemIndex, 'POST', endpoint, body));
65
+ return { json: { results: [response] } };
66
+ }
67
+ //# sourceMappingURL=create.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/document_type/create.operation.ts"],"names":[],"mappings":";;;AAuDA,0BAcC;AApED,+CAA6C;AAEhC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,WAAW,EAAE,2BAA2B;QACxC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;KACX;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,CAAC;QACV,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,wBAAwB,EAAE,KA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,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: ['document_type'] },
54
+ },
55
+ noDataExpression: true,
56
+ options: [
57
+ {
58
+ name: 'Create a Document Type',
59
+ value: 'create',
60
+ action: 'Create a new document type',
61
+ },
62
+ {
63
+ name: 'Delete a Document Type',
64
+ value: 'remove',
65
+ action: 'Delete a document type',
66
+ },
67
+ {
68
+ name: 'Get a Document Type',
69
+ value: 'get',
70
+ action: 'Get a document type',
71
+ },
72
+ {
73
+ name: 'List Document Types',
74
+ value: 'list',
75
+ action: 'List all document types',
76
+ },
77
+ {
78
+ name: 'Update a Document Type',
79
+ value: 'update',
80
+ action: 'Update a document type',
81
+ },
82
+ ],
83
+ type: 'options',
84
+ },
85
+ ...create.description,
86
+ ...get.description,
87
+ ...list.description,
88
+ ...remove.description,
89
+ ...update.description,
90
+ ];
91
+ //# sourceMappingURL=document_type.resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document_type.resource.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/document_type/document_type.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,eAAe,CAAC,EAAE;SACrC;QACD,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,4BAA4B;aACpC;YACD;gBACC,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,wBAAwB;aAChC;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,qBAAqB;aAC7B;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,yBAAyB;aACjC;YACD;gBACC,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,wBAAwB;aAChC;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: ['document_type'],
14
+ operation: ['get'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Document Type...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'documentTypeSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Document Type 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 document_type',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ ];
50
+ async function execute(itemIndex) {
51
+ const id = this.getNodeParameter('id', itemIndex).value;
52
+ const endpoint = `/document_types/${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/document_type/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,oBAAoB;oBACtC,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 = '/document_types/';
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 document types 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/document_type/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: ['document_type'],
14
+ operation: ['remove'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Document Type...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'documentTypeSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Document Type 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 document_type',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ ];
50
+ async function execute(itemIndex) {
51
+ const id = this.getNodeParameter('id', itemIndex).value;
52
+ const endpoint = `/document_types/${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/document_type/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,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;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,oBAAoB;oBACtC,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,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>;
@@ -0,0 +1,111 @@
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: ['document_type'],
14
+ operation: ['update'],
15
+ },
16
+ },
17
+ modes: [
18
+ {
19
+ displayName: 'From List',
20
+ name: 'list',
21
+ placeholder: `Select a Document Type...`,
22
+ type: 'list',
23
+ typeOptions: {
24
+ searchListMethod: 'documentTypeSearch',
25
+ searchFilterRequired: false,
26
+ searchable: true,
27
+ },
28
+ },
29
+ {
30
+ displayName: 'By ID',
31
+ name: 'id',
32
+ placeholder: `Enter Document Type 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 document_type',
46
+ required: true,
47
+ type: 'resourceLocator',
48
+ },
49
+ {
50
+ displayName: 'Update Fields',
51
+ name: 'update_fields',
52
+ default: {},
53
+ displayOptions: {
54
+ show: {
55
+ resource: ['document_type'],
56
+ operation: ['update'],
57
+ },
58
+ },
59
+ options: [
60
+ {
61
+ displayName: 'Name',
62
+ name: 'name',
63
+ placeholder: 'Name of the document_type',
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 = `/document_types/${id}/`;
97
+ const updateFields = this.getNodeParameter('update_fields', itemIndex, {});
98
+ const body = {};
99
+ if (updateFields.name) {
100
+ body.name = updateFields.name;
101
+ }
102
+ if (updateFields.matching_algorithm) {
103
+ body.matching_algorithm = updateFields.matching_algorithm;
104
+ }
105
+ if (updateFields.match) {
106
+ body.match = updateFields.match;
107
+ }
108
+ const response = (await transport_1.apiRequest.call(this, itemIndex, 'PATCH', endpoint, body));
109
+ return { json: { results: [response] } };
110
+ }
111
+ //# sourceMappingURL=update.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/document_type/update.operation.ts"],"names":[],"mappings":";;;AAiGA,0BAu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AAC,kBAAkB,EAAE,CAAC;QACrC,IAAI,CAAC,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC;IAC3D,CAAC;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAQ,CAAC;IAE1F,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { AllEntities } from 'n8n-workflow';
2
+ export type PaperlessType = AllEntities<{
3
+ asn: 'next';
4
+ correspondent: 'create' | 'get' | 'list' | 'remove' | 'update';
5
+ custom_field: 'create' | 'get' | 'list' | 'remove' | 'update';
6
+ document: 'create' | 'list' | 'get' | 'get_history' | 'get_metadata' | 'get_metadata_suggestions' | 'get_preview' | 'get_sharelink' | 'remove' | 'update';
7
+ document_metadata: 'suggest';
8
+ document_note: 'create' | 'list' | 'remove';
9
+ document_type: 'create' | 'get' | 'list' | 'remove' | 'update';
10
+ tag: 'create' | 'get' | 'list' | 'remove' | 'update';
11
+ task: 'get';
12
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=node.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.type.js","sourceRoot":"","sources":["../../../../../nodes/Paperless/v2/actions/node.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;