@limetech/n8n-nodes-lime 2.5.3 → 2.5.4
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/.releaserc.json +1 -0
- package/CHANGELOG.md +7 -0
- package/dist/credentials/FortnoxApi.credentials.d.ts +9 -0
- package/dist/credentials/FortnoxApi.credentials.js +57 -0
- package/dist/credentials/FortnoxApi.credentials.js.map +1 -0
- package/dist/credentials/LimeCrmApi.credentials.d.ts +9 -0
- package/dist/credentials/LimeCrmApi.credentials.js +70 -0
- package/dist/credentials/LimeCrmApi.credentials.js.map +1 -0
- package/dist/credentials/index.d.ts +2 -0
- package/dist/credentials/index.js +19 -0
- package/dist/credentials/index.js.map +1 -0
- package/dist/nodes/errorHandling.d.ts +11 -0
- package/dist/nodes/errorHandling.js +20 -0
- package/dist/nodes/errorHandling.js.map +1 -0
- package/dist/nodes/fortnox/Fortnox.node.d.ts +5 -0
- package/dist/nodes/fortnox/Fortnox.node.js +95 -0
- package/dist/nodes/fortnox/Fortnox.node.js.map +1 -0
- package/dist/nodes/fortnox/Fortnox.node.json +18 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.d.ts +5 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.js +155 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.js.map +1 -0
- package/dist/nodes/fortnox/FortnoxTrigger.node.json +18 -0
- package/dist/nodes/fortnox/commons.d.ts +25 -0
- package/dist/nodes/fortnox/commons.js +44 -0
- package/dist/nodes/fortnox/commons.js.map +1 -0
- package/dist/nodes/fortnox/fortnoxLogo.svg +15 -0
- package/dist/nodes/fortnox/index.d.ts +6 -0
- package/dist/nodes/fortnox/index.js +23 -0
- package/dist/nodes/fortnox/index.js.map +1 -0
- package/dist/nodes/fortnox/model.d.ts +20 -0
- package/dist/nodes/fortnox/model.js +3 -0
- package/dist/nodes/fortnox/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.js +31 -0
- package/dist/nodes/fortnox/resources/customers/filterParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/index.d.ts +7 -0
- package/dist/nodes/fortnox/resources/customers/index.js +85 -0
- package/dist/nodes/fortnox/resources/customers/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/model.d.ts +99 -0
- package/dist/nodes/fortnox/resources/customers/model.js +3 -0
- package/dist/nodes/fortnox/resources/customers/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js +281 -0
- package/dist/nodes/fortnox/resources/customers/operations/create.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.d.ts +9 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +38 -0
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +38 -0
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +68 -0
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/index.d.ts +5 -0
- package/dist/nodes/fortnox/resources/customers/operations/index.js +42 -0
- package/dist/nodes/fortnox/resources/customers/operations/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +261 -0
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.js +30 -0
- package/dist/nodes/fortnox/resources/customers/sortParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js +72 -0
- package/dist/nodes/fortnox/resources/invoice/filterParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/index.d.ts +7 -0
- package/dist/nodes/fortnox/resources/invoice/index.js +81 -0
- package/dist/nodes/fortnox/resources/invoice/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.d.ts +2 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js +193 -0
- package/dist/nodes/fortnox/resources/invoice/invoiceParameters.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/model.d.ts +147 -0
- package/dist/nodes/fortnox/resources/invoice/model.js +3 -0
- package/dist/nodes/fortnox/resources/invoice/model.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js +64 -0
- package/dist/nodes/fortnox/resources/invoice/operations/create.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +37 -0
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +92 -0
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/index.d.ts +4 -0
- package/dist/nodes/fortnox/resources/invoice/operations/index.js +41 -0
- package/dist/nodes/fortnox/resources/invoice/operations/index.js.map +1 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.d.ts +10 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +64 -0
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -0
- package/dist/nodes/fortnox/transport/errorCodes.d.ts +1 -0
- package/dist/nodes/fortnox/transport/errorCodes.js +50 -0
- package/dist/nodes/fortnox/transport/errorCodes.js.map +1 -0
- package/dist/nodes/fortnox/transport/index.d.ts +3 -0
- package/dist/nodes/fortnox/transport/index.js +76 -0
- package/dist/nodes/fortnox/transport/index.js.map +1 -0
- package/dist/nodes/index.d.ts +4 -0
- package/dist/nodes/index.js +21 -0
- package/dist/nodes/index.js.map +1 -0
- package/dist/nodes/lime-crm/LimeCrm.node.json +18 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.d.ts +19 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.js +122 -0
- package/dist/nodes/lime-crm/LimeCrmNode.node.js.map +1 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.d.ts +18 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js +215 -0
- package/dist/nodes/lime-crm/LimeCrmTrigger.node.js.map +1 -0
- package/dist/nodes/lime-crm/assets/lime-crm.svg +1 -0
- package/dist/nodes/lime-crm/index.d.ts +9 -0
- package/dist/nodes/lime-crm/index.js +26 -0
- package/dist/nodes/lime-crm/index.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getLimetypeProperties.d.ts +5 -0
- package/dist/nodes/lime-crm/methods/getLimetypeProperties.js +47 -0
- package/dist/nodes/lime-crm/methods/getLimetypeProperties.js.map +1 -0
- package/dist/nodes/lime-crm/methods/getLimetypes.d.ts +2 -0
- package/dist/nodes/lime-crm/methods/getLimetypes.js +20 -0
- package/dist/nodes/lime-crm/methods/getLimetypes.js.map +1 -0
- package/dist/nodes/lime-crm/methods/index.d.ts +3 -0
- package/dist/nodes/lime-crm/methods/index.js +15 -0
- package/dist/nodes/lime-crm/methods/index.js.map +1 -0
- package/dist/nodes/lime-crm/methods/resourceMapping.d.ts +4 -0
- package/dist/nodes/lime-crm/methods/resourceMapping.js +71 -0
- package/dist/nodes/lime-crm/methods/resourceMapping.js.map +1 -0
- package/dist/nodes/lime-crm/models/constants.d.ts +9 -0
- package/dist/nodes/lime-crm/models/constants.js +10 -0
- package/dist/nodes/lime-crm/models/constants.js.map +1 -0
- package/dist/nodes/lime-crm/models/index.d.ts +6 -0
- package/dist/nodes/lime-crm/models/index.js +13 -0
- package/dist/nodes/lime-crm/models/index.js.map +1 -0
- package/dist/nodes/lime-crm/models/limeobject.d.ts +4 -0
- package/dist/nodes/lime-crm/models/limeobject.js +3 -0
- package/dist/nodes/lime-crm/models/limeobject.js.map +1 -0
- package/dist/nodes/lime-crm/models/limetype.d.ts +24 -0
- package/dist/nodes/lime-crm/models/limetype.js +3 -0
- package/dist/nodes/lime-crm/models/limetype.js.map +1 -0
- package/dist/nodes/lime-crm/models/propertyTypes.d.ts +4 -0
- package/dist/nodes/lime-crm/models/propertyTypes.js +5 -0
- package/dist/nodes/lime-crm/models/propertyTypes.js.map +1 -0
- package/dist/nodes/lime-crm/models/users.d.ts +13 -0
- package/dist/nodes/lime-crm/models/users.js +3 -0
- package/dist/nodes/lime-crm/models/users.js.map +1 -0
- package/dist/nodes/lime-crm/models/webhook.d.ts +18 -0
- package/dist/nodes/lime-crm/models/webhook.js +3 -0
- package/dist/nodes/lime-crm/models/webhook.js.map +1 -0
- package/dist/nodes/lime-crm/resources/admin/index.d.ts +7 -0
- package/dist/nodes/lime-crm/resources/admin/index.js +89 -0
- package/dist/nodes/lime-crm/resources/admin/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.js +123 -0
- package/dist/nodes/lime-crm/resources/admin/operations/getManyUsers.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.js +87 -0
- package/dist/nodes/lime-crm/resources/admin/operations/getSingleUser.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/admin/operations/index.d.ts +2 -0
- package/dist/nodes/lime-crm/resources/admin/operations/index.js +39 -0
- package/dist/nodes/lime-crm/resources/admin/operations/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/index.d.ts +7 -0
- package/dist/nodes/lime-crm/resources/data/index.js +108 -0
- package/dist/nodes/lime-crm/resources/data/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/createSingleObject.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/data/operations/createSingleObject.operation.js +124 -0
- package/dist/nodes/lime-crm/resources/data/operations/createSingleObject.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.d.ts +10 -0
- package/dist/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.js +52 -0
- package/dist/nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/getManyObjects.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/data/operations/getManyObjects.operation.js +299 -0
- package/dist/nodes/lime-crm/resources/data/operations/getManyObjects.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/getSingleFile.operation.d.ts +9 -0
- package/dist/nodes/lime-crm/resources/data/operations/getSingleFile.operation.js +125 -0
- package/dist/nodes/lime-crm/resources/data/operations/getSingleFile.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/getSingleObject.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/data/operations/getSingleObject.operation.js +79 -0
- package/dist/nodes/lime-crm/resources/data/operations/getSingleObject.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/index.d.ts +6 -0
- package/dist/nodes/lime-crm/resources/data/operations/index.js +43 -0
- package/dist/nodes/lime-crm/resources/data/operations/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.js +146 -0
- package/dist/nodes/lime-crm/resources/data/operations/updateSingleObject.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/metadata/index.d.ts +7 -0
- package/dist/nodes/lime-crm/resources/metadata/index.js +93 -0
- package/dist/nodes/lime-crm/resources/metadata/index.js.map +1 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.d.ts +10 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.js +16 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getAllLimetypes.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.js +113 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getSingleFileMetadata.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.d.ts +11 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.js +37 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/getSingleLimetype.operation.js.map +1 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/index.d.ts +3 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/index.js +40 -0
- package/dist/nodes/lime-crm/resources/metadata/operations/index.js.map +1 -0
- package/dist/nodes/lime-crm/transport/commons.d.ts +14 -0
- package/dist/nodes/lime-crm/transport/commons.js +52 -0
- package/dist/nodes/lime-crm/transport/commons.js.map +1 -0
- package/dist/nodes/lime-crm/transport/files.d.ts +26 -0
- package/dist/nodes/lime-crm/transport/files.js +96 -0
- package/dist/nodes/lime-crm/transport/files.js.map +1 -0
- package/dist/nodes/lime-crm/transport/index.d.ts +7 -0
- package/dist/nodes/lime-crm/transport/index.js +32 -0
- package/dist/nodes/lime-crm/transport/index.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limeQuery.d.ts +10 -0
- package/dist/nodes/lime-crm/transport/limeQuery.js +18 -0
- package/dist/nodes/lime-crm/transport/limeQuery.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limeobjects.d.ts +16 -0
- package/dist/nodes/lime-crm/transport/limeobjects.js +76 -0
- package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -0
- package/dist/nodes/lime-crm/transport/limetypes.d.ts +33 -0
- package/dist/nodes/lime-crm/transport/limetypes.js +85 -0
- package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -0
- package/dist/nodes/lime-crm/transport/users.d.ts +6 -0
- package/dist/nodes/lime-crm/transport/users.js +159 -0
- package/dist/nodes/lime-crm/transport/users.js.map +1 -0
- package/dist/nodes/lime-crm/transport/webhooks.d.ts +14 -0
- package/dist/nodes/lime-crm/transport/webhooks.js +51 -0
- package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -0
- package/dist/nodes/lime-crm/utils/files.d.ts +8 -0
- package/dist/nodes/lime-crm/utils/files.js +103 -0
- package/dist/nodes/lime-crm/utils/files.js.map +1 -0
- package/dist/nodes/lime-crm/utils/hmac.d.ts +1 -0
- package/dist/nodes/lime-crm/utils/hmac.js +11 -0
- package/dist/nodes/lime-crm/utils/hmac.js.map +1 -0
- package/dist/nodes/lime-crm/utils/index.d.ts +4 -0
- package/dist/nodes/lime-crm/utils/index.js +16 -0
- package/dist/nodes/lime-crm/utils/index.js.map +1 -0
- package/dist/nodes/lime-crm/utils/webhook.d.ts +2 -0
- package/dist/nodes/lime-crm/utils/webhook.js +34 -0
- package/dist/nodes/lime-crm/utils/webhook.js.map +1 -0
- package/dist/nodes/modules.d.ts +12 -0
- package/dist/nodes/modules.js +16 -0
- package/dist/nodes/modules.js.map +1 -0
- package/dist/nodes/response.d.ts +18 -0
- package/dist/nodes/response.js +3 -0
- package/dist/nodes/response.js.map +1 -0
- package/dist/package.json +70 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.properties = exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../../transport");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
const utils_1 = require("../../../utils");
|
|
8
|
+
const methods_1 = require("../../../methods");
|
|
9
|
+
exports.description = {
|
|
10
|
+
name: 'Create Single Object',
|
|
11
|
+
value: 'createSingleObject',
|
|
12
|
+
description: 'Create a single new object',
|
|
13
|
+
action: 'Create single object',
|
|
14
|
+
};
|
|
15
|
+
exports.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Limetype',
|
|
18
|
+
name: 'limetype',
|
|
19
|
+
type: 'options',
|
|
20
|
+
typeOptions: {
|
|
21
|
+
loadOptionsMethod: 'getLimetypes',
|
|
22
|
+
},
|
|
23
|
+
required: true,
|
|
24
|
+
default: '',
|
|
25
|
+
description: 'The type of entity to create',
|
|
26
|
+
displayOptions: {
|
|
27
|
+
show: {
|
|
28
|
+
resource: [models_1.DATA_RESOURCE],
|
|
29
|
+
operation: ['createSingleObject'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Input Method',
|
|
35
|
+
name: 'inputMethod',
|
|
36
|
+
type: 'options',
|
|
37
|
+
options: [
|
|
38
|
+
{
|
|
39
|
+
name: 'Form Fields',
|
|
40
|
+
value: 'fields',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'JSON',
|
|
44
|
+
value: 'json',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
default: 'fields',
|
|
48
|
+
description: 'How to input the object data',
|
|
49
|
+
displayOptions: {
|
|
50
|
+
show: {
|
|
51
|
+
resource: [models_1.DATA_RESOURCE],
|
|
52
|
+
operation: ['createSingleObject'],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Properties',
|
|
58
|
+
name: 'properties',
|
|
59
|
+
type: 'resourceMapper',
|
|
60
|
+
placeholder: 'Add Property',
|
|
61
|
+
typeOptions: {
|
|
62
|
+
resourceMapper: {
|
|
63
|
+
resourceMapperMethod: 'getCreateMappingColumns',
|
|
64
|
+
mode: 'add',
|
|
65
|
+
addAllFields: false,
|
|
66
|
+
supportAutoMap: false,
|
|
67
|
+
},
|
|
68
|
+
loadOptionsDependsOn: ['limetype'],
|
|
69
|
+
},
|
|
70
|
+
default: {
|
|
71
|
+
value: null,
|
|
72
|
+
},
|
|
73
|
+
displayOptions: {
|
|
74
|
+
show: {
|
|
75
|
+
resource: [models_1.DATA_RESOURCE],
|
|
76
|
+
operation: ['createSingleObject'],
|
|
77
|
+
inputMethod: ['fields'],
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Object (JSON)',
|
|
83
|
+
name: 'objectJson',
|
|
84
|
+
type: 'json',
|
|
85
|
+
default: '{\n "name": "New Company",\n "phone": "123-456-7890"\n}',
|
|
86
|
+
description: 'Object to create in JSON format',
|
|
87
|
+
displayOptions: {
|
|
88
|
+
show: {
|
|
89
|
+
resource: [models_1.DATA_RESOURCE],
|
|
90
|
+
operation: ['createSingleObject'],
|
|
91
|
+
inputMethod: ['json'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
typeOptions: {
|
|
95
|
+
alwaysOpenEditWindow: true,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
async function execute(i) {
|
|
100
|
+
const limetype = this.getNodeParameter('limetype', i);
|
|
101
|
+
const inputMethod = this.getNodeParameter('inputMethod', i);
|
|
102
|
+
let objectData;
|
|
103
|
+
const propertiesResponse = await (0, transport_1.getProperties)(this, limetype);
|
|
104
|
+
if (!propertiesResponse.success)
|
|
105
|
+
return propertiesResponse.data;
|
|
106
|
+
const properties = propertiesResponse.data;
|
|
107
|
+
if (inputMethod === 'json') {
|
|
108
|
+
const jsonInput = this.getNodeParameter('objectJson', i);
|
|
109
|
+
objectData = JSON.parse(jsonInput);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
objectData = (0, methods_1.parseResourceMapperFields)(this, i, 'properties');
|
|
113
|
+
}
|
|
114
|
+
const fileProperties = (0, utils_1.getFilePropertiesNames)(properties, new Set(Object.keys(objectData)));
|
|
115
|
+
const setFilePropertiesResponse = await (0, utils_1.setFileProperties)(this, i, fileProperties, objectData);
|
|
116
|
+
if (!setFilePropertiesResponse.success)
|
|
117
|
+
return setFilePropertiesResponse.data;
|
|
118
|
+
const createLimeobjectResponse = await (0, transport_1.createLimeobject)(this, limetype, setFilePropertiesResponse.data);
|
|
119
|
+
if (!createLimeobjectResponse.success)
|
|
120
|
+
return createLimeobjectResponse.data;
|
|
121
|
+
const response = await (0, utils_1.processFileResponse)(this, fileProperties, createLimeobjectResponse.data);
|
|
122
|
+
return response.json.data;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=createSingleObject.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSingleObject.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/createSingleObject.operation.ts"],"names":[],"mappings":";;;AA2IA,0BA6CC;AAtLD,kDAAqE;AACrE,4CAAgD;AAChD,0CAIwB;AAExB,8CAA6D;AAOhD,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,sBAAsB;CACjC,CAAC;AAYW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACT,iBAAiB,EAAE,cAAc;SACpC;QACD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,cAAc,EAAE;YACZ,IAAI,EAA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4BAAgB,EACnD,IAAI,EACJ,QAAQ,EACR,yBAAyB,CAAC,IAAI,CACjC,CAAC;IACF,IAAI,CAAC,wBAAwB,CAAC,OAAO;QAAE,OAAO,wBAAwB,CAAC,IAAI,CAAC;IAE5E,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAmB,EACtC,IAAI,EACJ,cAAc,EACd,wBAAwB,CAAC,IAAI,CAChC,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { WorkflowResponse } from '../../../../response';
|
|
3
|
+
export declare const description: {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
description: string;
|
|
7
|
+
action: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const properties: INodeProperties[];
|
|
10
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<WorkflowResponse<Record<string, never>>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.properties = exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../../transport");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
exports.description = {
|
|
8
|
+
name: 'Delete Single Object',
|
|
9
|
+
value: 'deleteSingleObject',
|
|
10
|
+
description: 'Delete one specific object',
|
|
11
|
+
action: 'Delete single object',
|
|
12
|
+
};
|
|
13
|
+
exports.properties = [
|
|
14
|
+
{
|
|
15
|
+
displayName: 'Limetype',
|
|
16
|
+
name: 'limetype',
|
|
17
|
+
type: 'options',
|
|
18
|
+
typeOptions: {
|
|
19
|
+
loadOptionsMethod: 'getLimetypes',
|
|
20
|
+
},
|
|
21
|
+
required: true,
|
|
22
|
+
default: '',
|
|
23
|
+
description: 'The type of entity to delete',
|
|
24
|
+
displayOptions: {
|
|
25
|
+
show: {
|
|
26
|
+
resource: [models_1.DATA_RESOURCE],
|
|
27
|
+
operation: ['deleteSingleObject'],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Object ID',
|
|
33
|
+
name: 'objectId',
|
|
34
|
+
type: 'string',
|
|
35
|
+
required: true,
|
|
36
|
+
default: '',
|
|
37
|
+
description: 'The ID of the object to delete',
|
|
38
|
+
displayOptions: {
|
|
39
|
+
show: {
|
|
40
|
+
resource: [models_1.DATA_RESOURCE],
|
|
41
|
+
operation: ['deleteSingleObject'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
async function execute(i) {
|
|
47
|
+
const limetype = this.getNodeParameter('limetype', i);
|
|
48
|
+
const objectId = this.getNodeParameter('objectId', i);
|
|
49
|
+
const response = await (0, transport_1.deleteLimeobject)(this, limetype, objectId);
|
|
50
|
+
return response.data;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=deleteSingleObject.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteSingleObject.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/deleteSingleObject.operation.ts"],"names":[],"mappings":";;;AA8EA,0BASC;AArFD,kDAAsD;AACtD,4CAAgD;AAQnC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,sBAAsB;CACjC,CAAC;AAWW,QAAA,UAAU,GAAsB;IACzC;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACT,iBAAiB,EAAE,cAAc;SACpC;QACD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,sBAAa,CAAC;gBACzB,SAAS,EAAE,CAAC,oBAAoB,CAAC;aACpC;SACJ;KACJ;IACD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,gCAAgC;QAC7C,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,sBAAa,CAAC;gBACzB,SAAS,EAAE,CAAC,oBAAoB,CAAC;aACpC;SACJ;KACJ;CACJ,CAAC;AAmBK,KAAK,UAAU,OAAO,CAEzB,CAAS;IAET,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAW,CAAC;IAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAW,CAAC;IAEhE,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAgB,EAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClE,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { IncludedProperties } from '../../../transport';
|
|
3
|
+
import { WorkflowResponse } from '../../../../response';
|
|
4
|
+
export declare const description: {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
description: string;
|
|
8
|
+
action: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const properties: INodeProperties[];
|
|
11
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<WorkflowResponse<IncludedProperties[]>>;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.properties = exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const transport_1 = require("../../../transport");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
exports.description = {
|
|
8
|
+
name: 'Get Many Objects',
|
|
9
|
+
value: 'getManyObjects',
|
|
10
|
+
description: 'Get a list of many objects',
|
|
11
|
+
action: 'Get many objects',
|
|
12
|
+
};
|
|
13
|
+
const BATCHSIZE = 200;
|
|
14
|
+
exports.properties = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Limetype',
|
|
17
|
+
name: 'limetype',
|
|
18
|
+
type: 'options',
|
|
19
|
+
typeOptions: {
|
|
20
|
+
loadOptionsMethod: 'getLimetypes',
|
|
21
|
+
},
|
|
22
|
+
required: true,
|
|
23
|
+
default: '',
|
|
24
|
+
description: 'The type of entity to query',
|
|
25
|
+
displayOptions: {
|
|
26
|
+
show: {
|
|
27
|
+
resource: [models_1.DATA_RESOURCE],
|
|
28
|
+
operation: ['getManyObjects'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Response Format',
|
|
34
|
+
name: 'responseFormatInputMethod',
|
|
35
|
+
type: 'options',
|
|
36
|
+
required: true,
|
|
37
|
+
default: 'fields',
|
|
38
|
+
description: 'Select how the response should be formatted',
|
|
39
|
+
displayOptions: {
|
|
40
|
+
show: {
|
|
41
|
+
resource: [models_1.DATA_RESOURCE],
|
|
42
|
+
operation: ['getManyObjects'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
options: [
|
|
46
|
+
{
|
|
47
|
+
name: 'Properties',
|
|
48
|
+
value: 'fields',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'JSON',
|
|
52
|
+
value: 'json',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Response Format (Form Fields)',
|
|
58
|
+
name: 'responseFormatProperties',
|
|
59
|
+
type: 'fixedCollection',
|
|
60
|
+
placeholder: 'Add Property',
|
|
61
|
+
typeOptions: {
|
|
62
|
+
multipleValues: true,
|
|
63
|
+
},
|
|
64
|
+
default: {},
|
|
65
|
+
displayOptions: {
|
|
66
|
+
show: {
|
|
67
|
+
resource: [models_1.DATA_RESOURCE],
|
|
68
|
+
operation: ['getManyObjects'],
|
|
69
|
+
responseFormatInputMethod: ['fields'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Property',
|
|
75
|
+
name: 'property',
|
|
76
|
+
values: [
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Property Name',
|
|
79
|
+
name: 'name',
|
|
80
|
+
type: 'options',
|
|
81
|
+
typeOptions: {
|
|
82
|
+
sortable: true,
|
|
83
|
+
loadOptionsMethod: 'getNoHasManyProperties',
|
|
84
|
+
loadOptionsDependsOn: ['limetype'],
|
|
85
|
+
},
|
|
86
|
+
default: '',
|
|
87
|
+
description: 'Name of the property',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Response Format (JSON)',
|
|
95
|
+
name: 'responseFormatJson',
|
|
96
|
+
type: 'json',
|
|
97
|
+
required: true,
|
|
98
|
+
default: '{\n\t"object": {\n\t\t"_id": ""\n\t}\n}',
|
|
99
|
+
description: 'Information included in the response when using JSON format',
|
|
100
|
+
displayOptions: {
|
|
101
|
+
show: {
|
|
102
|
+
resource: [models_1.DATA_RESOURCE],
|
|
103
|
+
operation: ['getManyObjects'],
|
|
104
|
+
responseFormatInputMethod: ['json'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
displayName: 'Filter (JSON)',
|
|
110
|
+
name: 'filter',
|
|
111
|
+
type: 'json',
|
|
112
|
+
default: '{}',
|
|
113
|
+
description: "The filter DSL defining the query's conditions",
|
|
114
|
+
displayOptions: {
|
|
115
|
+
show: {
|
|
116
|
+
resource: [models_1.DATA_RESOURCE],
|
|
117
|
+
operation: ['getManyObjects'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
displayName: 'Limit',
|
|
123
|
+
name: 'limit',
|
|
124
|
+
type: 'number',
|
|
125
|
+
default: models_1.DEFAULT_API_OBJECT_LIMIT,
|
|
126
|
+
description: 'The maximum number of records to return',
|
|
127
|
+
displayOptions: {
|
|
128
|
+
show: {
|
|
129
|
+
resource: [models_1.DATA_RESOURCE],
|
|
130
|
+
operation: ['getManyObjects'],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Order By',
|
|
136
|
+
name: 'orderByInputMethod',
|
|
137
|
+
type: 'options',
|
|
138
|
+
required: true,
|
|
139
|
+
default: 'fields',
|
|
140
|
+
description: 'Select how the response should be ordered',
|
|
141
|
+
displayOptions: {
|
|
142
|
+
show: {
|
|
143
|
+
resource: [models_1.DATA_RESOURCE],
|
|
144
|
+
operation: ['getManyObjects'],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
options: [
|
|
148
|
+
{
|
|
149
|
+
name: 'Form Fields',
|
|
150
|
+
value: 'fields',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'JSON',
|
|
154
|
+
value: 'json',
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
displayName: 'Order By (Form Fields)',
|
|
160
|
+
name: 'orderByProperties',
|
|
161
|
+
type: 'fixedCollection',
|
|
162
|
+
placeholder: 'Add Property',
|
|
163
|
+
typeOptions: {
|
|
164
|
+
multipleValues: true,
|
|
165
|
+
},
|
|
166
|
+
default: {},
|
|
167
|
+
description: 'The list of properties by which to order the query results',
|
|
168
|
+
displayOptions: {
|
|
169
|
+
show: {
|
|
170
|
+
resource: [models_1.DATA_RESOURCE],
|
|
171
|
+
operation: ['getManyObjects'],
|
|
172
|
+
orderByInputMethod: ['fields'],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
options: [
|
|
176
|
+
{
|
|
177
|
+
name: 'orderByFields',
|
|
178
|
+
displayName: 'Order By Fields',
|
|
179
|
+
values: [
|
|
180
|
+
{
|
|
181
|
+
displayName: 'Property Name',
|
|
182
|
+
name: 'propertyName',
|
|
183
|
+
type: 'options',
|
|
184
|
+
required: true,
|
|
185
|
+
typeOptions: {
|
|
186
|
+
sortable: true,
|
|
187
|
+
loadOptionsMethod: 'getNoHasManyProperties',
|
|
188
|
+
loadOptionsDependsOn: ['limetype'],
|
|
189
|
+
},
|
|
190
|
+
default: '',
|
|
191
|
+
description: 'Name of the property to order by',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
displayName: 'Sort Direction',
|
|
195
|
+
name: 'sortDirection',
|
|
196
|
+
type: 'options',
|
|
197
|
+
default: 'ASC',
|
|
198
|
+
description: 'Ordering direction',
|
|
199
|
+
options: [
|
|
200
|
+
{ name: 'Ascending', value: 'ASC' },
|
|
201
|
+
{ name: 'Descending', value: 'DESC' },
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
displayName: 'Order By (JSON)',
|
|
210
|
+
name: 'orderByJson',
|
|
211
|
+
type: 'json',
|
|
212
|
+
required: true,
|
|
213
|
+
default: '[\n\t{\n\t\t"_id": "ASC"\n\t}\n]',
|
|
214
|
+
description: 'Provide ordering in JSON',
|
|
215
|
+
displayOptions: {
|
|
216
|
+
show: {
|
|
217
|
+
resource: [models_1.DATA_RESOURCE],
|
|
218
|
+
operation: ['getManyObjects'],
|
|
219
|
+
orderByInputMethod: ['json'],
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
];
|
|
224
|
+
function createResponseFormatObject(properties = []) {
|
|
225
|
+
const object = { _id: '' };
|
|
226
|
+
for (const { name } of properties) {
|
|
227
|
+
if (name)
|
|
228
|
+
object[name] = '';
|
|
229
|
+
}
|
|
230
|
+
return { object };
|
|
231
|
+
}
|
|
232
|
+
function getOrderBy(orderByCollection) {
|
|
233
|
+
const orderBy = orderByCollection.orderByFields &&
|
|
234
|
+
orderByCollection.orderByFields.map((field) => ({
|
|
235
|
+
[field.propertyName]: field.sortDirection,
|
|
236
|
+
}));
|
|
237
|
+
return orderBy || [{ _id: 'ASC' }];
|
|
238
|
+
}
|
|
239
|
+
async function fetchLimeObjects(limetype, responseFormat, filter, limit, orderBy) {
|
|
240
|
+
const allResults = [];
|
|
241
|
+
const parsedFilter = JSON.parse(filter);
|
|
242
|
+
const unlimited = limit === null || limit === 0;
|
|
243
|
+
const targetLimit = unlimited ? Infinity : limit;
|
|
244
|
+
let fetched = 0;
|
|
245
|
+
let currentOffset = 0;
|
|
246
|
+
while (fetched < targetLimit) {
|
|
247
|
+
const currentLimit = targetLimit === Infinity
|
|
248
|
+
? BATCHSIZE
|
|
249
|
+
: Math.min(BATCHSIZE, targetLimit - fetched);
|
|
250
|
+
const q = JSON.stringify({
|
|
251
|
+
limetype,
|
|
252
|
+
responseFormat: responseFormat,
|
|
253
|
+
filter: parsedFilter,
|
|
254
|
+
limit: currentLimit,
|
|
255
|
+
offset: currentOffset,
|
|
256
|
+
orderBy: orderBy,
|
|
257
|
+
});
|
|
258
|
+
const batchResponse = await (0, transport_1.queryLimeobjects)(this, q);
|
|
259
|
+
if (!batchResponse.success)
|
|
260
|
+
return batchResponse.data;
|
|
261
|
+
const batch = batchResponse.data;
|
|
262
|
+
const collected = batch.objects.length;
|
|
263
|
+
if (collected === 0)
|
|
264
|
+
break;
|
|
265
|
+
allResults.push(...batch.objects);
|
|
266
|
+
fetched += collected;
|
|
267
|
+
currentOffset += collected;
|
|
268
|
+
if (collected < currentLimit)
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
return allResults;
|
|
272
|
+
}
|
|
273
|
+
async function execute(i) {
|
|
274
|
+
const limetype = this.getNodeParameter('limetype', i);
|
|
275
|
+
const responseFormatInputMethod = this.getNodeParameter('responseFormatInputMethod', i);
|
|
276
|
+
const orderByInputMethod = this.getNodeParameter('orderByInputMethod', i);
|
|
277
|
+
const filter = this.getNodeParameter('filter', i);
|
|
278
|
+
const limit = this.getNodeParameter('limit', i, models_1.DEFAULT_API_OBJECT_LIMIT);
|
|
279
|
+
let response;
|
|
280
|
+
if (responseFormatInputMethod === 'fields') {
|
|
281
|
+
const properties = this.getNodeParameter('responseFormatProperties', i);
|
|
282
|
+
response = createResponseFormatObject(properties.property);
|
|
283
|
+
}
|
|
284
|
+
else if (responseFormatInputMethod === 'json') {
|
|
285
|
+
response = this.getNodeParameter('responseFormatJson', i);
|
|
286
|
+
response = JSON.parse(response);
|
|
287
|
+
}
|
|
288
|
+
let orderBy;
|
|
289
|
+
if (orderByInputMethod === 'fields') {
|
|
290
|
+
const orderByCollection = this.getNodeParameter('orderByProperties', i);
|
|
291
|
+
orderBy = getOrderBy(orderByCollection);
|
|
292
|
+
}
|
|
293
|
+
else if (orderByInputMethod === 'json') {
|
|
294
|
+
orderBy = this.getNodeParameter('orderByJson', i);
|
|
295
|
+
orderBy = JSON.parse(orderBy);
|
|
296
|
+
}
|
|
297
|
+
return await fetchLimeObjects.call(this, limetype, response, filter, limit, orderBy);
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=getManyObjects.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getManyObjects.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/getManyObjects.operation.ts"],"names":[],"mappings":";;;AAqcA,0BAiDC;AApfD,kDAA0E;AAC1E,4CAA0E;AAQ7D,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,gBAAgB;I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SAAM,IAAI,kBAAkB,KAAK,MAAM,EAAE,CAAC;QACvC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAW,CAAC;QAC5D,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,gBAAgB,CAAC,IAAI,CAC9B,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description: string;
|
|
6
|
+
action: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const properties: INodeProperties[];
|
|
9
|
+
export declare function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.properties = exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const transport_1 = require("../../../transport");
|
|
7
|
+
const models_1 = require("../../../models");
|
|
8
|
+
exports.description = {
|
|
9
|
+
name: 'Get Single File',
|
|
10
|
+
value: 'getSingleFile',
|
|
11
|
+
description: 'Get the file data for one specific file',
|
|
12
|
+
action: 'Get single file',
|
|
13
|
+
};
|
|
14
|
+
exports.properties = [
|
|
15
|
+
{
|
|
16
|
+
displayName: 'Get by',
|
|
17
|
+
name: 'source',
|
|
18
|
+
type: 'options',
|
|
19
|
+
required: true,
|
|
20
|
+
placeholder: 'Add Source',
|
|
21
|
+
displayOptions: {
|
|
22
|
+
show: {
|
|
23
|
+
resource: [models_1.DATA_RESOURCE],
|
|
24
|
+
operation: ['getSingleFile'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
name: 'File ID',
|
|
30
|
+
value: 'byFile',
|
|
31
|
+
description: 'Get file by its ID',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Limeobject ID',
|
|
35
|
+
value: 'byLimeobject',
|
|
36
|
+
description: "Get file by it's associated Limeobject ID",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
default: 'byFile',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Limetype',
|
|
43
|
+
name: 'limetype',
|
|
44
|
+
type: 'options',
|
|
45
|
+
typeOptions: {
|
|
46
|
+
loadOptionsMethod: 'getLimetypes',
|
|
47
|
+
},
|
|
48
|
+
required: true,
|
|
49
|
+
default: '',
|
|
50
|
+
description: 'The type of entity associated with the file',
|
|
51
|
+
displayOptions: {
|
|
52
|
+
show: {
|
|
53
|
+
resource: [models_1.DATA_RESOURCE],
|
|
54
|
+
operation: ['getSingleFile'],
|
|
55
|
+
source: ['byLimeobject'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
displayName: 'Identifier',
|
|
61
|
+
name: 'identifier',
|
|
62
|
+
type: 'string',
|
|
63
|
+
required: true,
|
|
64
|
+
default: '',
|
|
65
|
+
description: 'The ID of the file or Limeobject to retrieve',
|
|
66
|
+
displayOptions: {
|
|
67
|
+
show: {
|
|
68
|
+
resource: [models_1.DATA_RESOURCE],
|
|
69
|
+
operation: ['getSingleFile'],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
placeholder: 'e.g., 12345',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'File type property',
|
|
76
|
+
name: 'property',
|
|
77
|
+
type: 'options',
|
|
78
|
+
typeOptions: {
|
|
79
|
+
loadOptionsMethod: 'getFileProperties',
|
|
80
|
+
loadOptionsDependsOn: ['limetype'],
|
|
81
|
+
},
|
|
82
|
+
required: true,
|
|
83
|
+
default: '',
|
|
84
|
+
description: 'The type of entity associated with the file',
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
resource: [models_1.DATA_RESOURCE],
|
|
88
|
+
operation: ['getSingleFile'],
|
|
89
|
+
source: ['byLimeobject'],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
async function execute(i) {
|
|
95
|
+
const source = this.getNodeParameter('source', i);
|
|
96
|
+
const id = this.getNodeParameter('identifier', i);
|
|
97
|
+
if (source == 'byFile') {
|
|
98
|
+
const fileResponse = await (0, transport_1.getFileContent)(this, id);
|
|
99
|
+
if (!fileResponse.success)
|
|
100
|
+
return {
|
|
101
|
+
json: fileResponse.data,
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
json: {},
|
|
105
|
+
binary: { data: fileResponse.data },
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (source == 'byLimeobject') {
|
|
109
|
+
const limetype = this.getNodeParameter('limetype', i);
|
|
110
|
+
const property = this.getNodeParameter('property', i);
|
|
111
|
+
const fileResponse = await (0, transport_1.getFileContentByLimetype)(this, limetype, id, property);
|
|
112
|
+
if (!fileResponse.success)
|
|
113
|
+
return {
|
|
114
|
+
json: fileResponse.data,
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
json: {},
|
|
118
|
+
binary: {
|
|
119
|
+
data: fileResponse.data,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `The source "${source}" is not supported!`);
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=getSingleFile.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSingleFile.operation.js","sourceRoot":"","sources":["../../../../../../nodes/lime-crm/resources/data/operations/getSingleFile.operation.ts"],"names":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