@limetech/n8n-nodes-lime 0.3.2 → 0.3.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/.github/workflows/mark-stale.yml +21 -0
- package/CHANGELOG.md +54 -0
- package/Dockerfile +2 -2
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js +10 -1
- package/dist/nodes/fortnox/resources/customers/operations/delete.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js +10 -1
- package/dist/nodes/fortnox/resources/customers/operations/get.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/getAll.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js +10 -1
- package/dist/nodes/fortnox/resources/customers/operations/update.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js +10 -1
- package/dist/nodes/fortnox/resources/invoice/operations/get.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/getAll.operation.js.map +1 -1
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js +10 -1
- package/dist/nodes/fortnox/resources/invoice/operations/update.operation.js.map +1 -1
- package/dist/nodes/fortnox/transport/index.js +5 -0
- package/dist/nodes/fortnox/transport/index.js.map +1 -1
- package/dist/nodes/lime-crm/commons/webhook.d.ts +1 -0
- package/dist/nodes/lime-crm/commons/webhook.js +1 -0
- package/dist/nodes/lime-crm/commons/webhook.js.map +1 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js +18 -1
- package/dist/nodes/lime-crm/resources/limeObject/operations/search.operation.js.map +1 -1
- package/dist/nodes/lime-crm/transport/commons.d.ts +1 -1
- package/dist/nodes/lime-crm/transport/commons.js +1 -0
- package/dist/nodes/lime-crm/transport/commons.js.map +1 -1
- package/dist/nodes/lime-crm/transport/limeobjects.d.ts +5 -5
- package/dist/nodes/lime-crm/transport/limeobjects.js +106 -22
- package/dist/nodes/lime-crm/transport/limeobjects.js.map +1 -1
- package/dist/nodes/lime-crm/transport/limetypes.js +17 -2
- package/dist/nodes/lime-crm/transport/limetypes.js.map +1 -1
- package/dist/nodes/lime-crm/transport/webhooks.js +11 -1
- package/dist/nodes/lime-crm/transport/webhooks.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/nodes/fortnox/resources/customers/operations/delete.operation.ts +11 -1
- package/nodes/fortnox/resources/customers/operations/get.operation.ts +11 -1
- package/nodes/fortnox/resources/customers/operations/getAll.operation.ts +1 -1
- package/nodes/fortnox/resources/customers/operations/update.operation.ts +11 -1
- package/nodes/fortnox/resources/invoice/operations/get.operation.ts +11 -1
- package/nodes/fortnox/resources/invoice/operations/getAll.operation.ts +1 -1
- package/nodes/fortnox/resources/invoice/operations/update.operation.ts +11 -1
- package/nodes/fortnox/transport/index.ts +5 -0
- package/nodes/lime-crm/commons/webhook.ts +2 -0
- package/nodes/lime-crm/resources/limeObject/operations/search.operation.ts +19 -6
- package/nodes/lime-crm/transport/commons.ts +2 -1
- package/nodes/lime-crm/transport/limeobjects.ts +141 -29
- package/nodes/lime-crm/transport/limetypes.ts +19 -2
- package/nodes/lime-crm/transport/webhooks.ts +12 -1
- package/package.json +1 -1
- package/dist/credentials/LimeGoApi.credentials.d.ts +0 -15
- package/dist/credentials/LimeGoApi.credentials.js +0 -32
- package/dist/credentials/LimeGoApi.credentials.js.map +0 -1
- package/dist/nodes/LimeCrm/GenericTypes.d.ts +0 -80
- package/dist/nodes/LimeCrm/GenericTypes.js +0 -7
- package/dist/nodes/LimeCrm/GenericTypes.js.map +0 -1
- package/dist/nodes/LimeCrm/LimeCrmNode.node.d.ts +0 -17
- package/dist/nodes/LimeCrm/LimeCrmNode.node.js +0 -114
- package/dist/nodes/LimeCrm/LimeCrmNode.node.js.map +0 -1
- package/dist/nodes/LimeCrm/LimeCrmTrigger/LimeCrmTrigger.node.d.ts +0 -17
- package/dist/nodes/LimeCrm/LimeCrmTrigger/LimeCrmTrigger.node.js +0 -408
- package/dist/nodes/LimeCrm/LimeCrmTrigger/LimeCrmTrigger.node.js.map +0 -1
- package/dist/nodes/LimeCrm/LimeCrmTrigger.node.d.ts +0 -17
- package/dist/nodes/LimeCrm/LimeCrmTrigger.node.js +0 -439
- package/dist/nodes/LimeCrm/LimeCrmTrigger.node.js.map +0 -1
- package/dist/nodes/LimeCrm/lime-crm.svg +0 -1
- package/dist/nodes/LimeCrm/methods/getAllSortableFields.d.ts +0 -7
- package/dist/nodes/LimeCrm/methods/getAllSortableFields.js +0 -53
- package/dist/nodes/LimeCrm/methods/getAllSortableFields.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getLimeTypeProperties.d.ts +0 -3
- package/dist/nodes/LimeCrm/methods/getLimeTypeProperties.js +0 -40
- package/dist/nodes/LimeCrm/methods/getLimeTypeProperties.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getLimeTypeRelations.d.ts +0 -7
- package/dist/nodes/LimeCrm/methods/getLimeTypeRelations.js +0 -30
- package/dist/nodes/LimeCrm/methods/getLimeTypeRelations.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getLimeTypes.d.ts +0 -3
- package/dist/nodes/LimeCrm/methods/getLimeTypes.js +0 -33
- package/dist/nodes/LimeCrm/methods/getLimeTypes.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/getRelatedTypeProperties.d.ts +0 -7
- package/dist/nodes/LimeCrm/methods/getRelatedTypeProperties.js +0 -39
- package/dist/nodes/LimeCrm/methods/getRelatedTypeProperties.js.map +0 -1
- package/dist/nodes/LimeCrm/methods/index.d.ts +0 -5
- package/dist/nodes/LimeCrm/methods/index.js +0 -14
- package/dist/nodes/LimeCrm/methods/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/commonFields.d.ts +0 -4
- package/dist/nodes/LimeCrm/resources/limeObject/commonFields.js +0 -165
- package/dist/nodes/LimeCrm/resources/limeObject/commonFields.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/index.d.ts +0 -6
- package/dist/nodes/LimeCrm/resources/limeObject/index.js +0 -79
- package/dist/nodes/LimeCrm/resources/limeObject/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/common.operation.d.ts +0 -2
- package/dist/nodes/LimeCrm/resources/limeObject/operations/common.operation.js +0 -36
- package/dist/nodes/LimeCrm/resources/limeObject/operations/common.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/create.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/create.operation.js +0 -234
- package/dist/nodes/LimeCrm/resources/limeObject/operations/create.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/delete.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/delete.operation.js +0 -136
- package/dist/nodes/LimeCrm/resources/limeObject/operations/delete.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/get.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/get.operation.js +0 -125
- package/dist/nodes/LimeCrm/resources/limeObject/operations/get.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/getAll.operation.d.ts +0 -3
- package/dist/nodes/LimeCrm/resources/limeObject/operations/getAll.operation.js +0 -212
- package/dist/nodes/LimeCrm/resources/limeObject/operations/getAll.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/search.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/search.operation.js +0 -232
- package/dist/nodes/LimeCrm/resources/limeObject/operations/search.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.js +0 -186
- package/dist/nodes/LimeCrm/resources/limeObject/operations/update.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/index.d.ts +0 -6
- package/dist/nodes/LimeCrm/resources/limeType/index.js +0 -81
- package/dist/nodes/LimeCrm/resources/limeType/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/getProperties.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/getProperties.operation.js +0 -112
- package/dist/nodes/LimeCrm/resources/limeType/operations/getProperties.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/getRelations.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/getRelations.operation.js +0 -112
- package/dist/nodes/LimeCrm/resources/limeType/operations/getRelations.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/getType.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/getType.operation.js +0 -70
- package/dist/nodes/LimeCrm/resources/limeType/operations/getType.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/limeType/operations/listTypes.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/limeType/operations/listTypes.operation.js +0 -86
- package/dist/nodes/LimeCrm/resources/limeType/operations/listTypes.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/queryApi/index.d.ts +0 -6
- package/dist/nodes/LimeCrm/resources/queryApi/index.js +0 -57
- package/dist/nodes/LimeCrm/resources/queryApi/index.js.map +0 -1
- package/dist/nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.d.ts +0 -9
- package/dist/nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.js +0 -559
- package/dist/nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.js.map +0 -1
- package/dist/nodes/LimeCrm/transport/index.d.ts +0 -2
- package/dist/nodes/LimeCrm/transport/index.js +0 -50
- package/dist/nodes/LimeCrm/transport/index.js.map +0 -1
- package/dist/nodes/LimeGo/LimeGo.node.d.ts +0 -8
- package/dist/nodes/LimeGo/LimeGo.node.js +0 -123
- package/dist/nodes/LimeGo/LimeGo.node.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/get.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/get.operation.js +0 -39
- package/dist/nodes/LimeGo/actions/organization/get.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/getByExternalKey.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/getByExternalKey.operation.js +0 -54
- package/dist/nodes/LimeGo/actions/organization/getByExternalKey.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/index.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/organization/index.js +0 -92
- package/dist/nodes/LimeGo/actions/organization/index.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/organizationFields.d.ts +0 -2
- package/dist/nodes/LimeGo/actions/organization/organizationFields.js +0 -162
- package/dist/nodes/LimeGo/actions/organization/organizationFields.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/search.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/search.operation.js +0 -70
- package/dist/nodes/LimeGo/actions/organization/search.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/organization/update.operation.d.ts +0 -5
- package/dist/nodes/LimeGo/actions/organization/update.operation.js +0 -125
- package/dist/nodes/LimeGo/actions/organization/update.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/createMail.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/createMail.operation.js +0 -130
- package/dist/nodes/LimeGo/actions/person/createMail.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/get.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/get.operation.js +0 -45
- package/dist/nodes/LimeGo/actions/person/get.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/index.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/index.js +0 -92
- package/dist/nodes/LimeGo/actions/person/index.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/personFields.d.ts +0 -2
- package/dist/nodes/LimeGo/actions/person/personFields.js +0 -134
- package/dist/nodes/LimeGo/actions/person/personFields.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/search.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/search.operation.js +0 -81
- package/dist/nodes/LimeGo/actions/person/search.operation.js.map +0 -1
- package/dist/nodes/LimeGo/actions/person/update.operation.d.ts +0 -7
- package/dist/nodes/LimeGo/actions/person/update.operation.js +0 -104
- package/dist/nodes/LimeGo/actions/person/update.operation.js.map +0 -1
- package/dist/nodes/LimeGo/lime-go.svg +0 -1
- package/dist/nodes/LimeGo/transport/graphqlRequest.d.ts +0 -2
- package/dist/nodes/LimeGo/transport/graphqlRequest.js +0 -23
- package/dist/nodes/LimeGo/transport/graphqlRequest.js.map +0 -1
|
@@ -1,234 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.execute = exports.properties = exports.description = void 0;
|
|
27
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
28
|
-
exports.description = {
|
|
29
|
-
name: 'Create Object',
|
|
30
|
-
value: 'create',
|
|
31
|
-
description: 'Create a new object',
|
|
32
|
-
action: 'Create an object',
|
|
33
|
-
};
|
|
34
|
-
exports.properties = [
|
|
35
|
-
{
|
|
36
|
-
displayName: 'LimeType',
|
|
37
|
-
name: 'limeType',
|
|
38
|
-
type: 'options',
|
|
39
|
-
typeOptions: {
|
|
40
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
41
|
-
},
|
|
42
|
-
required: true,
|
|
43
|
-
default: '',
|
|
44
|
-
description: 'The type of entity to create',
|
|
45
|
-
displayOptions: {
|
|
46
|
-
show: {
|
|
47
|
-
resource: [
|
|
48
|
-
'limeObject',
|
|
49
|
-
],
|
|
50
|
-
operation: [
|
|
51
|
-
'create',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
displayName: 'Input Method',
|
|
58
|
-
name: 'inputMethod',
|
|
59
|
-
type: 'options',
|
|
60
|
-
options: [
|
|
61
|
-
{
|
|
62
|
-
name: 'Form Fields',
|
|
63
|
-
value: 'fields',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'JSON',
|
|
67
|
-
value: 'json',
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
default: 'fields',
|
|
71
|
-
description: 'How to input the object data',
|
|
72
|
-
displayOptions: {
|
|
73
|
-
show: {
|
|
74
|
-
resource: [
|
|
75
|
-
'limeObject',
|
|
76
|
-
],
|
|
77
|
-
operation: [
|
|
78
|
-
'create',
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
displayName: 'Properties',
|
|
85
|
-
name: 'properties',
|
|
86
|
-
type: 'fixedCollection',
|
|
87
|
-
placeholder: 'Add Property',
|
|
88
|
-
typeOptions: {
|
|
89
|
-
multipleValues: true,
|
|
90
|
-
sortable: true,
|
|
91
|
-
loadOptionsMethod: 'getLimeTypeProperties',
|
|
92
|
-
loadOptionsDependsOn: ['limeType'],
|
|
93
|
-
},
|
|
94
|
-
default: {},
|
|
95
|
-
displayOptions: {
|
|
96
|
-
show: {
|
|
97
|
-
resource: [
|
|
98
|
-
'limeObject',
|
|
99
|
-
],
|
|
100
|
-
operation: [
|
|
101
|
-
'create',
|
|
102
|
-
],
|
|
103
|
-
inputMethod: [
|
|
104
|
-
'fields',
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
options: [
|
|
109
|
-
{
|
|
110
|
-
displayName: 'Property',
|
|
111
|
-
name: 'property',
|
|
112
|
-
values: [
|
|
113
|
-
{
|
|
114
|
-
displayName: 'Property Name',
|
|
115
|
-
name: 'name',
|
|
116
|
-
type: 'options',
|
|
117
|
-
typeOptions: {
|
|
118
|
-
loadOptionsMethod: 'getLimeTypeProperties',
|
|
119
|
-
loadOptionsDependsOn: ['limeType'],
|
|
120
|
-
},
|
|
121
|
-
default: '',
|
|
122
|
-
description: 'Name of the property',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
displayName: 'Property Value',
|
|
126
|
-
name: 'value',
|
|
127
|
-
type: 'string',
|
|
128
|
-
default: '',
|
|
129
|
-
description: 'Value of the property',
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
displayName: 'Object (JSON)',
|
|
137
|
-
name: 'objectJson',
|
|
138
|
-
type: 'json',
|
|
139
|
-
default: '{\n "name": "New Company",\n "phone": "123-456-7890"\n}',
|
|
140
|
-
description: 'Object to create in JSON format',
|
|
141
|
-
displayOptions: {
|
|
142
|
-
show: {
|
|
143
|
-
resource: [
|
|
144
|
-
'limeObject',
|
|
145
|
-
],
|
|
146
|
-
operation: [
|
|
147
|
-
'create',
|
|
148
|
-
],
|
|
149
|
-
inputMethod: [
|
|
150
|
-
'json',
|
|
151
|
-
],
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
typeOptions: {
|
|
155
|
-
alwaysOpenEditWindow: true,
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
displayName: 'Options',
|
|
160
|
-
name: 'options',
|
|
161
|
-
type: 'collection',
|
|
162
|
-
placeholder: 'Add Option',
|
|
163
|
-
default: {},
|
|
164
|
-
displayOptions: {
|
|
165
|
-
show: {
|
|
166
|
-
resource: [
|
|
167
|
-
'limeObject',
|
|
168
|
-
],
|
|
169
|
-
operation: [
|
|
170
|
-
'create',
|
|
171
|
-
],
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
options: [
|
|
175
|
-
{
|
|
176
|
-
displayName: 'Return Created Object',
|
|
177
|
-
name: 'returnObject',
|
|
178
|
-
type: 'boolean',
|
|
179
|
-
default: true,
|
|
180
|
-
description: 'Whether to return the created object data',
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
},
|
|
184
|
-
];
|
|
185
|
-
async function execute(i) {
|
|
186
|
-
const { apiRequest } = await Promise.resolve().then(() => __importStar(require('../../../transport')));
|
|
187
|
-
const limeType = this.getNodeParameter('limeType', i);
|
|
188
|
-
const inputMethod = this.getNodeParameter('inputMethod', i);
|
|
189
|
-
const options = this.getNodeParameter('options', i, {});
|
|
190
|
-
if (!limeType) {
|
|
191
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Lime type must be provided');
|
|
192
|
-
}
|
|
193
|
-
let objectData;
|
|
194
|
-
if (inputMethod === 'json') {
|
|
195
|
-
try {
|
|
196
|
-
const jsonInput = this.getNodeParameter('objectJson', i);
|
|
197
|
-
objectData = typeof jsonInput === 'string' ? JSON.parse(jsonInput) : jsonInput;
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON input: ' + error.message);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
objectData = {};
|
|
205
|
-
const propertiesInput = this.getNodeParameter('properties.property', i, []);
|
|
206
|
-
if (propertiesInput && propertiesInput.length > 0) {
|
|
207
|
-
propertiesInput.forEach((prop) => {
|
|
208
|
-
if (prop.name && prop.value !== undefined) {
|
|
209
|
-
objectData[prop.name] = prop.value;
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
const endpoint = `/api/v1/limeobject/${encodeURIComponent(limeType)}/`;
|
|
215
|
-
try {
|
|
216
|
-
const response = await apiRequest.call(this, {
|
|
217
|
-
method: 'POST',
|
|
218
|
-
endpoint,
|
|
219
|
-
body: objectData,
|
|
220
|
-
});
|
|
221
|
-
if (options.returnObject === true && response && response._id) {
|
|
222
|
-
return await apiRequest.call(this, {
|
|
223
|
-
method: 'GET',
|
|
224
|
-
endpoint: `${endpoint}/${response._id}`,
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
return response;
|
|
228
|
-
}
|
|
229
|
-
catch (error) {
|
|
230
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to create ${limeType} object: ${error.message}`);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
exports.execute = execute;
|
|
234
|
-
//# sourceMappingURL=create.operation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/LimeCrm/resources/limeObject/operations/create.operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;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G,CAAC,EAAE;YAC/C,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC7B,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;oBACvC,UAAU,CAAC,IAAI,CAAC,IAAc,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;iBAChD;YACL,CAAC,CAAC,CAAC;SACN;KACJ;IAED,MAAM,QAAQ,GAAG,sBAAsB,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC;IAEvE,IAAI;QACA,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE;YACzC,MAAM,EAAE,MAAM;YACd,QAAQ;YACR,IAAI,EAAE,UAAU;SACnB,CAAC,CAAC;QAGH,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,IAAI,QAAQ,IAAI,QAAQ,CAAC,GAAG,EAAE;YAC3D,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE;gBAC/B,MAAM,EAAE,KAAK;gBACb,QAAQ,EAAE,GAAG,QAAQ,IAAI,QAAQ,CAAC,GAAG,EAAE;aAC1C,CAAC,CAAC;SACN;QAED,OAAO,QAAQ,CAAC;KACnB;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,oBAAoB,QAAQ,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KACzG;AACL,CAAC;AA1DD,0BA0DC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, 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<any>;
|
|
@@ -1,136 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.execute = exports.properties = exports.description = void 0;
|
|
27
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
28
|
-
exports.description = {
|
|
29
|
-
name: 'Delete Object',
|
|
30
|
-
value: 'delete',
|
|
31
|
-
description: 'Delete an existing object',
|
|
32
|
-
action: 'Delete an object',
|
|
33
|
-
};
|
|
34
|
-
exports.properties = [
|
|
35
|
-
{
|
|
36
|
-
displayName: 'Lime Type',
|
|
37
|
-
name: 'limeType',
|
|
38
|
-
type: 'options',
|
|
39
|
-
typeOptions: {
|
|
40
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
41
|
-
},
|
|
42
|
-
required: true,
|
|
43
|
-
default: '',
|
|
44
|
-
description: 'The type of entity to delete',
|
|
45
|
-
displayOptions: {
|
|
46
|
-
show: {
|
|
47
|
-
resource: [
|
|
48
|
-
'limeObject',
|
|
49
|
-
],
|
|
50
|
-
operation: [
|
|
51
|
-
'delete',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
displayName: 'Object ID',
|
|
58
|
-
name: 'objectId',
|
|
59
|
-
type: 'string',
|
|
60
|
-
required: true,
|
|
61
|
-
default: '',
|
|
62
|
-
description: 'The ID of the object to delete',
|
|
63
|
-
displayOptions: {
|
|
64
|
-
show: {
|
|
65
|
-
resource: [
|
|
66
|
-
'limeObject',
|
|
67
|
-
],
|
|
68
|
-
operation: [
|
|
69
|
-
'delete',
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
displayName: 'Options',
|
|
76
|
-
name: 'options',
|
|
77
|
-
type: 'collection',
|
|
78
|
-
placeholder: 'Add Option',
|
|
79
|
-
default: {},
|
|
80
|
-
displayOptions: {
|
|
81
|
-
show: {
|
|
82
|
-
resource: [
|
|
83
|
-
'limeObject',
|
|
84
|
-
],
|
|
85
|
-
operation: [
|
|
86
|
-
'delete',
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
options: [
|
|
91
|
-
{
|
|
92
|
-
displayName: 'Force Delete',
|
|
93
|
-
name: 'forceDelete',
|
|
94
|
-
type: 'boolean',
|
|
95
|
-
default: false,
|
|
96
|
-
description: 'Whether to force deletion even if there are references to this object',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
async function execute(i) {
|
|
102
|
-
const { apiRequest } = await Promise.resolve().then(() => __importStar(require('../../../transport')));
|
|
103
|
-
const limeType = this.getNodeParameter('limeType', i);
|
|
104
|
-
const objectId = this.getNodeParameter('objectId', i);
|
|
105
|
-
const options = this.getNodeParameter('options', i, {});
|
|
106
|
-
if (!limeType) {
|
|
107
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Lime type must be provided');
|
|
108
|
-
}
|
|
109
|
-
if (!objectId) {
|
|
110
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Object ID must be provided');
|
|
111
|
-
}
|
|
112
|
-
let endpoint = `/api/v1/limeobject/${encodeURIComponent(limeType)}/${encodeURIComponent(objectId)}`;
|
|
113
|
-
const queryParams = {};
|
|
114
|
-
if (options.forceDelete === true) {
|
|
115
|
-
queryParams.force = true;
|
|
116
|
-
}
|
|
117
|
-
try {
|
|
118
|
-
const response = await apiRequest.call(this, {
|
|
119
|
-
method: 'DELETE',
|
|
120
|
-
endpoint,
|
|
121
|
-
qs: queryParams,
|
|
122
|
-
});
|
|
123
|
-
return {
|
|
124
|
-
success: true,
|
|
125
|
-
limeType,
|
|
126
|
-
objectId,
|
|
127
|
-
message: `Successfully deleted ${limeType} with ID: ${objectId}`,
|
|
128
|
-
...response,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to delete ${limeType} object with ID ${objectId}: ${error.message}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
exports.execute = execute;
|
|
136
|
-
//# sourceMappingURL=delete.operation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.operation.js","sourceRoot":"","sources":["../../../../../../nodes/LimeCrm/resources/limeObject/operations/delete.operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAKsB;AAET,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,2BAA2B;IACxC,MAAM,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import { IExecuteFunctions, 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<any>;
|
|
@@ -1,125 +0,0 @@
|
|
|
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 (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.execute = exports.properties = exports.description = void 0;
|
|
27
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
28
|
-
exports.description = {
|
|
29
|
-
name: 'Get Object',
|
|
30
|
-
value: 'get',
|
|
31
|
-
description: 'Get a single object by ID',
|
|
32
|
-
action: 'Get an object',
|
|
33
|
-
};
|
|
34
|
-
exports.properties = [
|
|
35
|
-
{
|
|
36
|
-
displayName: 'Lime Type',
|
|
37
|
-
name: 'limeType',
|
|
38
|
-
type: 'options',
|
|
39
|
-
typeOptions: {
|
|
40
|
-
loadOptionsMethod: 'getLimeTypes',
|
|
41
|
-
},
|
|
42
|
-
required: true,
|
|
43
|
-
default: '',
|
|
44
|
-
description: 'The type of entity to retrieve',
|
|
45
|
-
displayOptions: {
|
|
46
|
-
show: {
|
|
47
|
-
resource: [
|
|
48
|
-
'limeObject',
|
|
49
|
-
],
|
|
50
|
-
operation: [
|
|
51
|
-
'get',
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
displayName: 'Object ID',
|
|
58
|
-
name: 'objectId',
|
|
59
|
-
type: 'string',
|
|
60
|
-
required: true,
|
|
61
|
-
default: '',
|
|
62
|
-
description: 'The ID of the object to retrieve',
|
|
63
|
-
displayOptions: {
|
|
64
|
-
show: {
|
|
65
|
-
resource: [
|
|
66
|
-
'limeObject',
|
|
67
|
-
],
|
|
68
|
-
operation: [
|
|
69
|
-
'get',
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
displayName: 'Properties to Return',
|
|
76
|
-
name: 'properties',
|
|
77
|
-
type: 'multiOptions',
|
|
78
|
-
typeOptions: {
|
|
79
|
-
loadOptionsMethod: 'getLimeTypeProperties',
|
|
80
|
-
loadOptionsDependsOn: ['limeType'],
|
|
81
|
-
},
|
|
82
|
-
default: [],
|
|
83
|
-
description: 'Properties to include in the response',
|
|
84
|
-
displayOptions: {
|
|
85
|
-
show: {
|
|
86
|
-
resource: [
|
|
87
|
-
'limeObject',
|
|
88
|
-
],
|
|
89
|
-
operation: [
|
|
90
|
-
'get',
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
];
|
|
96
|
-
async function execute(i) {
|
|
97
|
-
const { apiRequest } = await Promise.resolve().then(() => __importStar(require('../../../transport')));
|
|
98
|
-
const limeType = this.getNodeParameter('limeType', i);
|
|
99
|
-
const objectId = this.getNodeParameter('objectId', i);
|
|
100
|
-
const properties = this.getNodeParameter('properties', i, []);
|
|
101
|
-
if (!limeType) {
|
|
102
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Lime type must be provided');
|
|
103
|
-
}
|
|
104
|
-
if (!objectId) {
|
|
105
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Object ID must be provided');
|
|
106
|
-
}
|
|
107
|
-
const queryParams = {};
|
|
108
|
-
if (properties && properties.length > 0) {
|
|
109
|
-
queryParams._fields = properties.join(',');
|
|
110
|
-
}
|
|
111
|
-
const endpoint = `/api/v1/limeobject/${encodeURIComponent(limeType)}/${encodeURIComponent(objectId)}/`;
|
|
112
|
-
try {
|
|
113
|
-
const response = await apiRequest.call(this, {
|
|
114
|
-
method: 'GET',
|
|
115
|
-
endpoint,
|
|
116
|
-
qs: queryParams,
|
|
117
|
-
});
|
|
118
|
-
return response;
|
|
119
|
-
}
|
|
120
|
-
catch (error) {
|
|
121
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to get ${limeType} object with ID ${objectId}: ${error.message}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.execute = execute;
|
|
125
|
-
//# sourceMappingURL=get.operation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../../nodes/LimeCrm/resources/limeObject/operations/get.operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAKsB;AAET,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,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