@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.
- package/LICENSE.md +23 -0
- package/README.md +122 -0
- package/dist/credentials/PaperlessApi.credentials.d.ts +8 -0
- package/dist/credentials/PaperlessApi.credentials.js +38 -0
- package/dist/credentials/PaperlessApi.credentials.js.map +1 -0
- package/dist/nodes/Paperless/Paperless.node.d.ts +4 -0
- package/dist/nodes/Paperless/Paperless.node.js +24 -0
- package/dist/nodes/Paperless/Paperless.node.js.map +1 -0
- package/dist/nodes/Paperless/Paperless.node.json +14 -0
- package/dist/nodes/Paperless/v2/PaperlessV2.node.d.ts +10 -0
- package/dist/nodes/Paperless/v2/PaperlessV2.node.js +56 -0
- package/dist/nodes/Paperless/v2/PaperlessV2.node.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/asn/asn.resource.d.ts +4 -0
- package/dist/nodes/Paperless/v2/actions/asn/asn.resource.js +60 -0
- package/dist/nodes/Paperless/v2/actions/asn/asn.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/asn/next.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/asn/next.operation.js +14 -0
- package/dist/nodes/Paperless/v2/actions/asn/next.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/correspondent.resource.d.ts +8 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/correspondent.resource.js +91 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/correspondent.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/create.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/create.operation.js +67 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/create.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/get.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/get.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/get.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/list.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/list.operation.js +21 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/list.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/remove.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/remove.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/remove.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/update.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/update.operation.js +107 -0
- package/dist/nodes/Paperless/v2/actions/correspondent/update.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/create.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/create.operation.js +116 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/create.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/custom_field.resource.d.ts +8 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/custom_field.resource.js +91 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/custom_field.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/get.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/get.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/get.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/list.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/list.operation.js +21 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/list.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/remove.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/remove.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/remove.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/update.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/update.operation.js +128 -0
- package/dist/nodes/Paperless/v2/actions/custom_field/update.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/create.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/create.operation.js +209 -0
- package/dist/nodes/Paperless/v2/actions/document/create.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/document.resource.d.ts +13 -0
- package/dist/nodes/Paperless/v2/actions/document/document.resource.js +131 -0
- package/dist/nodes/Paperless/v2/actions/document/document.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/get.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/get.operation.js +77 -0
- package/dist/nodes/Paperless/v2/actions/document/get.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/get_history.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/get_history.operation.js +86 -0
- package/dist/nodes/Paperless/v2/actions/document/get_history.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/get_metadata.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/get_metadata.operation.js +79 -0
- package/dist/nodes/Paperless/v2/actions/document/get_metadata.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/get_metadata_suggestions.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/get_metadata_suggestions.operation.js +119 -0
- package/dist/nodes/Paperless/v2/actions/document/get_metadata_suggestions.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/get_preview.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/get_preview.operation.js +84 -0
- package/dist/nodes/Paperless/v2/actions/document/get_preview.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/get_sharelink.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/get_sharelink.operation.js +79 -0
- package/dist/nodes/Paperless/v2/actions/document/get_sharelink.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/list.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/list.operation.js +21 -0
- package/dist/nodes/Paperless/v2/actions/document/list.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/remove.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/remove.operation.js +77 -0
- package/dist/nodes/Paperless/v2/actions/document/remove.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document/update.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document/update.operation.js +368 -0
- package/dist/nodes/Paperless/v2/actions/document/update.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_note/create.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_note/create.operation.js +98 -0
- package/dist/nodes/Paperless/v2/actions/document_note/create.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_note/document_note.resource.d.ts +6 -0
- package/dist/nodes/Paperless/v2/actions/document_note/document_note.resource.js +75 -0
- package/dist/nodes/Paperless/v2/actions/document_note/document_note.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_note/list.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_note/list.operation.js +86 -0
- package/dist/nodes/Paperless/v2/actions/document_note/list.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_note/remove.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_note/remove.operation.js +123 -0
- package/dist/nodes/Paperless/v2/actions/document_note/remove.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_type/create.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_type/create.operation.js +67 -0
- package/dist/nodes/Paperless/v2/actions/document_type/create.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_type/document_type.resource.d.ts +8 -0
- package/dist/nodes/Paperless/v2/actions/document_type/document_type.resource.js +91 -0
- package/dist/nodes/Paperless/v2/actions/document_type/document_type.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_type/get.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_type/get.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/document_type/get.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_type/list.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_type/list.operation.js +21 -0
- package/dist/nodes/Paperless/v2/actions/document_type/list.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_type/remove.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_type/remove.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/document_type/remove.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/document_type/update.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/document_type/update.operation.js +111 -0
- package/dist/nodes/Paperless/v2/actions/document_type/update.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/node.type.d.ts +12 -0
- package/dist/nodes/Paperless/v2/actions/node.type.js +3 -0
- package/dist/nodes/Paperless/v2/actions/node.type.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/router.d.ts +2 -0
- package/dist/nodes/Paperless/v2/actions/router.js +92 -0
- package/dist/nodes/Paperless/v2/actions/router.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/tag/create.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/tag/create.operation.js +67 -0
- package/dist/nodes/Paperless/v2/actions/tag/create.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/tag/get.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/tag/get.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/tag/get.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/tag/list.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/tag/list.operation.js +21 -0
- package/dist/nodes/Paperless/v2/actions/tag/list.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/tag/remove.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/tag/remove.operation.js +56 -0
- package/dist/nodes/Paperless/v2/actions/tag/remove.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/tag/tag.resource.d.ts +8 -0
- package/dist/nodes/Paperless/v2/actions/tag/tag.resource.js +91 -0
- package/dist/nodes/Paperless/v2/actions/tag/tag.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/tag/update.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/tag/update.operation.js +107 -0
- package/dist/nodes/Paperless/v2/actions/tag/update.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/task/get.operation.d.ts +3 -0
- package/dist/nodes/Paperless/v2/actions/task/get.operation.js +38 -0
- package/dist/nodes/Paperless/v2/actions/task/get.operation.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/task/task.resource.d.ts +4 -0
- package/dist/nodes/Paperless/v2/actions/task/task.resource.js +59 -0
- package/dist/nodes/Paperless/v2/actions/task/task.resource.js.map +1 -0
- package/dist/nodes/Paperless/v2/actions/version.d.ts +2 -0
- package/dist/nodes/Paperless/v2/actions/version.js +117 -0
- package/dist/nodes/Paperless/v2/actions/version.js.map +1 -0
- package/dist/nodes/Paperless/v2/methods/index.d.ts +1 -0
- package/dist/nodes/Paperless/v2/methods/index.js +38 -0
- package/dist/nodes/Paperless/v2/methods/index.js.map +1 -0
- package/dist/nodes/Paperless/v2/methods/listSearch.d.ts +8 -0
- package/dist/nodes/Paperless/v2/methods/listSearch.js +71 -0
- package/dist/nodes/Paperless/v2/methods/listSearch.js.map +1 -0
- package/dist/nodes/Paperless/v2/paperless-ngx.svg +1 -0
- package/dist/nodes/Paperless/v2/transport/index.d.ts +3 -0
- package/dist/nodes/Paperless/v2/transport/index.js +50 -0
- package/dist/nodes/Paperless/v2/transport/index.js.map +1 -0
- package/dist/package.json +74 -0
- package/index.js +0 -0
- package/package.json +74 -0
|
@@ -0,0 +1,92 @@
|
|
|
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.router = router;
|
|
37
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
38
|
+
const asn = __importStar(require("./asn/asn.resource"));
|
|
39
|
+
const correspondent = __importStar(require("./correspondent/correspondent.resource"));
|
|
40
|
+
const custom_field = __importStar(require("./custom_field/custom_field.resource"));
|
|
41
|
+
const document = __importStar(require("./document/document.resource"));
|
|
42
|
+
const document_note = __importStar(require("./document_note/document_note.resource"));
|
|
43
|
+
const document_type = __importStar(require("./document_type/document_type.resource"));
|
|
44
|
+
const tag = __importStar(require("./tag/tag.resource"));
|
|
45
|
+
const task = __importStar(require("./task/task.resource"));
|
|
46
|
+
async function router() {
|
|
47
|
+
var _a;
|
|
48
|
+
const returnData = [];
|
|
49
|
+
for (let itemIndex = 0; itemIndex < this.getInputData().length; itemIndex++) {
|
|
50
|
+
const resource = this.getNodeParameter('resource', itemIndex);
|
|
51
|
+
const operation = this.getNodeParameter('operation', itemIndex);
|
|
52
|
+
const paperlessNodeData = { resource, operation };
|
|
53
|
+
try {
|
|
54
|
+
switch (paperlessNodeData.resource) {
|
|
55
|
+
case 'asn':
|
|
56
|
+
returnData.push(await asn[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
57
|
+
break;
|
|
58
|
+
case 'correspondent':
|
|
59
|
+
returnData.push(await correspondent[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
60
|
+
break;
|
|
61
|
+
case 'custom_field':
|
|
62
|
+
returnData.push(await custom_field[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
63
|
+
break;
|
|
64
|
+
case 'document':
|
|
65
|
+
returnData.push(await document[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
66
|
+
break;
|
|
67
|
+
case 'document_note':
|
|
68
|
+
returnData.push(await document_note[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
69
|
+
break;
|
|
70
|
+
case 'document_type':
|
|
71
|
+
returnData.push(await document_type[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
72
|
+
break;
|
|
73
|
+
case 'tag':
|
|
74
|
+
returnData.push(await tag[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
75
|
+
break;
|
|
76
|
+
case 'task':
|
|
77
|
+
returnData.push(await task[paperlessNodeData.operation].execute.call(this, itemIndex));
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The operation "${paperlessNodeData.operation}" on resource "${paperlessNodeData.resource}" is not supported.`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if ((_a = error.description) === null || _a === void 0 ? void 0 : _a.includes('cannot accept the provided value')) {
|
|
85
|
+
error.description += ". Consider using 'Typecast' option";
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return [returnData];
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../../nodes/Paperless/v2/actions/router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,wBA2DC;AAvED,+CAAyF;AAGzF,wDAA0C;AAC1C,sFAAwE;AACxE,mFAAqE;AACrE,uEAAyD;AACzD,sFAAwE;AACxE,sFAAwE;AACxE,wDAA0C;AAC1C,2DAA6C;AAEtC,KAAK,UAAU,MAAM;;IAC3B,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAgB,UAAU,EAAE,SAAS,CAAC,CAAC;QAC7E,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAChE,MAAM,iBAAiB,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAmB,CAAC;QAEnE,IAAI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,CAAC,CAAC;oBACtF,MAAM;gBACP,KAAK,MAAM;oBACV,UAAU,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;oBACvF,MAAM;gBACP;oBACC,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,kBAAkB,iBAAiB,CAAC,SAAS,kBAAkB,iBAAiB,CAAC,QAAQ,qBAAqB,CAC9G,CAAC;YACJ,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,MAAA,KAAK,CAAC,WAAW,0CAAE,QAAQ,CAAC,kCAAkC,CAAC,EAAE,CAAC;gBACrE,KAAK,CAAC,WAAW,IAAI,oCAAoC,CAAC;YAC3D,CAAC;YACD,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -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: ['tag'],
|
|
13
|
+
operation: ['create'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
placeholder: 'Name of the tag',
|
|
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: ['tag'],
|
|
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: ['tag'],
|
|
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 = `/tags/`;
|
|
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/tag/create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CAAC;gBACrB,kBAAkB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;aACnC;SACD;QACD,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,QAAQ;KACd;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC1B,MAAM,IAAI,GAAG;QACZ,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC;QAC9C,kBAAkB,EAAE,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,SAAS,CAAC;QAC1E,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC;KACpD,CAAC;IAEF,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,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: ['tag'],
|
|
14
|
+
operation: ['get'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
modes: [
|
|
18
|
+
{
|
|
19
|
+
displayName: 'From List',
|
|
20
|
+
name: 'list',
|
|
21
|
+
placeholder: `Select a Tag...`,
|
|
22
|
+
type: 'list',
|
|
23
|
+
typeOptions: {
|
|
24
|
+
searchListMethod: 'tagSearch',
|
|
25
|
+
searchFilterRequired: false,
|
|
26
|
+
searchable: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'By ID',
|
|
31
|
+
name: 'id',
|
|
32
|
+
placeholder: `Enter Tag 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 tag',
|
|
46
|
+
required: true,
|
|
47
|
+
type: 'resourceLocator',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
async function execute(itemIndex) {
|
|
51
|
+
const id = this.getNodeParameter('id', itemIndex).value;
|
|
52
|
+
const endpoint = `/tags/${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/tag/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,KAAK,CAAC;gBACjB,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,WAAW;oBAC7B,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,iBAAiB;gBAC9B,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,eAAe;QAC5B,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,SAAS,EAAE,GAAG,CAAC;IAChC,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,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 = '/tags/';
|
|
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 tags 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/tag/list.operation.ts"],"names":[],"mappings":";;;AAUA,0BAmBC;AA7BD,+CAKsB;AACtB,+CAAsD;AAEzC,QAAA,WAAW,GAAsB,EAAE,CAAC;AAE1C,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC1B,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,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,gDAAgD,EAAE;YAC9F,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,CAAC,CAAC;IACJ,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,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: ['tag'],
|
|
14
|
+
operation: ['remove'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
modes: [
|
|
18
|
+
{
|
|
19
|
+
displayName: 'From List',
|
|
20
|
+
name: 'list',
|
|
21
|
+
placeholder: `Select a Tag...`,
|
|
22
|
+
type: 'list',
|
|
23
|
+
typeOptions: {
|
|
24
|
+
searchListMethod: 'tagSearch',
|
|
25
|
+
searchFilterRequired: false,
|
|
26
|
+
searchable: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'By ID',
|
|
31
|
+
name: 'id',
|
|
32
|
+
placeholder: `Enter Tag 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 tag',
|
|
46
|
+
required: true,
|
|
47
|
+
type: 'resourceLocator',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
async function execute(itemIndex) {
|
|
51
|
+
const id = this.getNodeParameter('id', itemIndex).value;
|
|
52
|
+
const endpoint = `/tags/${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/tag/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,KAAK,CAAC;gBACjB,SAAS,EAAE,CAAC,QAAQ,CAAC;aACrB;SACD;QACD,KAAK,EAAE;YACN;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE;oBACZ,gBAAgB,EAAE,WAAW;oBAC7B,oBAAoB,EAAE,KAAK;oBAC3B,UAAU,EAAE,IAAI;iBAChB;aACD;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,IAAI;gBACV,WAAW,EAAE,iBAAiB;gBAC9B,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,eAAe;QAC5B,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,SAAS,EAAE,GAAG,CAAC;IAChC,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,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: ['tag'] },
|
|
54
|
+
},
|
|
55
|
+
noDataExpression: true,
|
|
56
|
+
options: [
|
|
57
|
+
{
|
|
58
|
+
name: 'Create a Tag',
|
|
59
|
+
value: 'create',
|
|
60
|
+
action: 'Create a new tag',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Delete a Tag',
|
|
64
|
+
value: 'remove',
|
|
65
|
+
action: 'Delete a tag',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'Get a Tag',
|
|
69
|
+
value: 'get',
|
|
70
|
+
action: 'Get a tag',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'List Tags',
|
|
74
|
+
value: 'list',
|
|
75
|
+
action: 'List all tags',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Update a Tag',
|
|
79
|
+
value: 'update',
|
|
80
|
+
action: 'Update a tag',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
type: 'options',
|
|
84
|
+
},
|
|
85
|
+
...create.description,
|
|
86
|
+
...get.description,
|
|
87
|
+
...list.description,
|
|
88
|
+
...remove.description,
|
|
89
|
+
...update.description,
|
|
90
|
+
];
|
|
91
|
+
//# sourceMappingURL=tag.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.resource.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/tag/tag.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,KAAK,CAAC,EAAE;SAC3B;QACD,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,kBAAkB;aAC1B;YACD;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,cAAc;aACtB;YACD;gBACC,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,WAAW;aACnB;YACD;gBACC,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,eAAe;aACvB;YACD;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,QAAQ;gBACf,MAAM,EAAE,cAAc;aACtB;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,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: ['tag'],
|
|
14
|
+
operation: ['update'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
modes: [
|
|
18
|
+
{
|
|
19
|
+
displayName: 'From List',
|
|
20
|
+
name: 'list',
|
|
21
|
+
placeholder: `Select a Tag...`,
|
|
22
|
+
type: 'list',
|
|
23
|
+
typeOptions: {
|
|
24
|
+
searchListMethod: 'tagSearch',
|
|
25
|
+
searchFilterRequired: false,
|
|
26
|
+
searchable: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'By ID',
|
|
31
|
+
name: 'id',
|
|
32
|
+
placeholder: `Enter Tag 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 tag',
|
|
46
|
+
required: true,
|
|
47
|
+
type: 'resourceLocator',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Update Fields',
|
|
51
|
+
name: 'update_fields',
|
|
52
|
+
default: {},
|
|
53
|
+
displayOptions: {
|
|
54
|
+
show: {
|
|
55
|
+
resource: ['tag'],
|
|
56
|
+
operation: ['update'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
options: [
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Name',
|
|
62
|
+
name: 'name',
|
|
63
|
+
placeholder: 'Name of the tag',
|
|
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 = `/tags/${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/tag/update.operation.ts"],"names":[],"mappings":";;;AAiGA,0BAqBC;AAhHD,+CAA6C;AAEhC,QAAA,WAA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EAAE,CAAC;YACnE,IAAI,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;IACF,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,38 @@
|
|
|
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
|
+
{
|
|
9
|
+
displayName: 'ID',
|
|
10
|
+
name: 'id',
|
|
11
|
+
default: '',
|
|
12
|
+
displayOptions: {
|
|
13
|
+
show: {
|
|
14
|
+
resource: ['task'],
|
|
15
|
+
operation: ['get'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
placeholder: 'ID of the task',
|
|
19
|
+
required: true,
|
|
20
|
+
type: 'string',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
async function execute(itemIndex) {
|
|
24
|
+
const endpoint = `/tasks/`;
|
|
25
|
+
const responses = (await transport_1.apiRequestPaginated.call(this, itemIndex, 'GET', endpoint));
|
|
26
|
+
const task_id = this.getNodeParameter('id', itemIndex);
|
|
27
|
+
const task = responses
|
|
28
|
+
.map((response) => response.body)
|
|
29
|
+
.flat()
|
|
30
|
+
.find((task) => task.task_id === task_id);
|
|
31
|
+
if (!task) {
|
|
32
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Task with ID ${task_id} not found.`);
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
json: { results: [task] },
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=get.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Paperless/v2/actions/task/get.operation.ts"],"names":[],"mappings":";;;AAyBA,0BAoBC;AA7CD,+CAKsB;AACtB,+CAAsD;AAEzC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,MAAM,CAAC;gBAClB,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,QAAQ;KACd;CACD,CAAC;AAEK,KAAK,UAAU,OAAO,CAE5B,SAAiB;IAEjB,MAAM,QAAQ,GAAG,SAAS,CAAC;IAC3B,MAAM,SAAS,GAAG,CAAC,MAAM,+BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAU,CAAC;IAE9F,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,SAAS;SACpB,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;SAChC,IAAI,EAAE;SACN,IAAI,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAEhD,IAAI,CAAC,IAAI,EAAE,CAAC;QACX,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,gBAAgB,OAAO,aAAa,CAAC,CAAC;IACpF,CAAC;IAED,OAAO;QACN,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE;KACzB,CAAC;AACH,CAAC"}
|