@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,559 +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: 'Execute Query',
|
|
30
|
-
value: 'executeQuery',
|
|
31
|
-
description: 'Execute a custom query against the Lime CRM database',
|
|
32
|
-
action: 'Execute a custom query',
|
|
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 entity type in Lime CRM to query',
|
|
45
|
-
displayOptions: {
|
|
46
|
-
show: {
|
|
47
|
-
resource: [
|
|
48
|
-
'queryApi',
|
|
49
|
-
],
|
|
50
|
-
operation: [
|
|
51
|
-
'executeQuery',
|
|
52
|
-
],
|
|
53
|
-
queryMode: [
|
|
54
|
-
'guided',
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
displayName: 'Query Mode',
|
|
61
|
-
name: 'queryMode',
|
|
62
|
-
type: 'options',
|
|
63
|
-
options: [
|
|
64
|
-
{
|
|
65
|
-
name: 'Guided (UI Builder)',
|
|
66
|
-
value: 'guided',
|
|
67
|
-
description: 'Build your query using the user interface',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'Code (JSON)',
|
|
71
|
-
value: 'code',
|
|
72
|
-
description: 'Write your query as a JSON object',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
default: 'guided',
|
|
76
|
-
displayOptions: {
|
|
77
|
-
show: {
|
|
78
|
-
resource: [
|
|
79
|
-
'queryApi',
|
|
80
|
-
],
|
|
81
|
-
operation: [
|
|
82
|
-
'executeQuery',
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: 'Query',
|
|
89
|
-
name: 'query',
|
|
90
|
-
type: 'json',
|
|
91
|
-
default: '{\n "limetype": "company",\n "properties": ["name", "phone"],\n "filter": {\n "relation": {\n "equals": "customer"\n }\n },\n "take": 10\n}',
|
|
92
|
-
required: true,
|
|
93
|
-
description: 'The query to execute. Must be valid JSON format. See <a href="https://docs.lime-crm.com/query-api/" target="_blank">Query API documentation</a>.',
|
|
94
|
-
displayOptions: {
|
|
95
|
-
show: {
|
|
96
|
-
resource: [
|
|
97
|
-
'queryApi',
|
|
98
|
-
],
|
|
99
|
-
operation: [
|
|
100
|
-
'executeQuery',
|
|
101
|
-
],
|
|
102
|
-
queryMode: [
|
|
103
|
-
'code',
|
|
104
|
-
],
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
typeOptions: {
|
|
108
|
-
alwaysOpenEditWindow: true,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
displayName: 'Properties',
|
|
113
|
-
name: 'properties',
|
|
114
|
-
type: 'multiOptions',
|
|
115
|
-
typeOptions: {
|
|
116
|
-
loadOptionsMethod: 'getLimeTypeProperties',
|
|
117
|
-
loadOptionsDependsOn: ['limeType'],
|
|
118
|
-
},
|
|
119
|
-
default: [],
|
|
120
|
-
description: 'Properties to retrieve from the selected Lime type',
|
|
121
|
-
displayOptions: {
|
|
122
|
-
show: {
|
|
123
|
-
resource: [
|
|
124
|
-
'queryApi',
|
|
125
|
-
],
|
|
126
|
-
operation: [
|
|
127
|
-
'executeQuery',
|
|
128
|
-
],
|
|
129
|
-
queryMode: [
|
|
130
|
-
'guided',
|
|
131
|
-
],
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
displayName: 'Include Relations',
|
|
137
|
-
name: 'includeRelations',
|
|
138
|
-
type: 'boolean',
|
|
139
|
-
default: false,
|
|
140
|
-
description: 'Whether to include properties from related objects',
|
|
141
|
-
displayOptions: {
|
|
142
|
-
show: {
|
|
143
|
-
resource: [
|
|
144
|
-
'queryApi',
|
|
145
|
-
],
|
|
146
|
-
operation: [
|
|
147
|
-
'executeQuery',
|
|
148
|
-
],
|
|
149
|
-
queryMode: [
|
|
150
|
-
'guided',
|
|
151
|
-
],
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
displayName: 'Relations Configuration',
|
|
157
|
-
name: 'relationsConfig',
|
|
158
|
-
placeholder: 'Add Relation',
|
|
159
|
-
type: 'fixedCollection',
|
|
160
|
-
typeOptions: {
|
|
161
|
-
multipleValues: true,
|
|
162
|
-
},
|
|
163
|
-
default: {},
|
|
164
|
-
description: 'Configure properties from related objects',
|
|
165
|
-
displayOptions: {
|
|
166
|
-
show: {
|
|
167
|
-
resource: [
|
|
168
|
-
'queryApi',
|
|
169
|
-
],
|
|
170
|
-
operation: [
|
|
171
|
-
'executeQuery',
|
|
172
|
-
],
|
|
173
|
-
queryMode: [
|
|
174
|
-
'guided',
|
|
175
|
-
],
|
|
176
|
-
includeRelations: [
|
|
177
|
-
true,
|
|
178
|
-
],
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
options: [
|
|
182
|
-
{
|
|
183
|
-
name: 'relation',
|
|
184
|
-
displayName: 'Relation',
|
|
185
|
-
values: [
|
|
186
|
-
{
|
|
187
|
-
displayName: 'Relation Name',
|
|
188
|
-
name: 'relationName',
|
|
189
|
-
type: 'options',
|
|
190
|
-
typeOptions: {
|
|
191
|
-
loadOptionsMethod: 'getLimeTypeRelations',
|
|
192
|
-
loadOptionsDependsOn: ['limetype'],
|
|
193
|
-
},
|
|
194
|
-
default: '',
|
|
195
|
-
description: 'The name of the relation',
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
displayName: 'Properties',
|
|
199
|
-
name: 'properties',
|
|
200
|
-
type: 'multiOptions',
|
|
201
|
-
typeOptions: {
|
|
202
|
-
loadOptionsMethod: 'getRelatedTypeProperties',
|
|
203
|
-
loadOptionsDependsOn: ['limetype', 'relationsConfig.relation[].relationName'],
|
|
204
|
-
},
|
|
205
|
-
default: [],
|
|
206
|
-
description: 'Properties from the related entity',
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
displayName: 'Add Filter',
|
|
214
|
-
name: 'addFilter',
|
|
215
|
-
type: 'boolean',
|
|
216
|
-
default: false,
|
|
217
|
-
description: 'Whether to add a filter to the query',
|
|
218
|
-
displayOptions: {
|
|
219
|
-
show: {
|
|
220
|
-
resource: [
|
|
221
|
-
'queryApi',
|
|
222
|
-
],
|
|
223
|
-
operation: [
|
|
224
|
-
'executeQuery',
|
|
225
|
-
],
|
|
226
|
-
queryMode: [
|
|
227
|
-
'guided',
|
|
228
|
-
],
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
displayName: 'Filter',
|
|
234
|
-
name: 'filter',
|
|
235
|
-
type: 'json',
|
|
236
|
-
default: '{\n "key": "name",\n "op": "contains",\n "exp": "Lime"\n}',
|
|
237
|
-
description: 'Filter to apply to the query (JSON format)',
|
|
238
|
-
displayOptions: {
|
|
239
|
-
show: {
|
|
240
|
-
resource: [
|
|
241
|
-
'queryApi',
|
|
242
|
-
],
|
|
243
|
-
operation: [
|
|
244
|
-
'executeQuery',
|
|
245
|
-
],
|
|
246
|
-
queryMode: [
|
|
247
|
-
'guided',
|
|
248
|
-
],
|
|
249
|
-
addFilter: [
|
|
250
|
-
true,
|
|
251
|
-
],
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
typeOptions: {
|
|
255
|
-
alwaysOpenEditWindow: true,
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
displayName: 'Limit',
|
|
260
|
-
name: 'limit',
|
|
261
|
-
type: 'number',
|
|
262
|
-
default: 50,
|
|
263
|
-
description: 'Maximum number of records to return',
|
|
264
|
-
displayOptions: {
|
|
265
|
-
show: {
|
|
266
|
-
resource: [
|
|
267
|
-
'queryApi',
|
|
268
|
-
],
|
|
269
|
-
operation: [
|
|
270
|
-
'executeQuery',
|
|
271
|
-
],
|
|
272
|
-
queryMode: [
|
|
273
|
-
'guided',
|
|
274
|
-
],
|
|
275
|
-
returnAll: [
|
|
276
|
-
false,
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
displayName: 'Offset',
|
|
283
|
-
name: 'offset',
|
|
284
|
-
type: 'number',
|
|
285
|
-
default: 0,
|
|
286
|
-
description: 'Number of records to skip',
|
|
287
|
-
displayOptions: {
|
|
288
|
-
show: {
|
|
289
|
-
resource: [
|
|
290
|
-
'queryApi',
|
|
291
|
-
],
|
|
292
|
-
operation: [
|
|
293
|
-
'executeQuery',
|
|
294
|
-
],
|
|
295
|
-
queryMode: [
|
|
296
|
-
'guided',
|
|
297
|
-
],
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
displayName: 'Add Sorting',
|
|
303
|
-
name: 'addSorting',
|
|
304
|
-
type: 'boolean',
|
|
305
|
-
default: false,
|
|
306
|
-
description: 'Whether to add sorting to the query',
|
|
307
|
-
displayOptions: {
|
|
308
|
-
show: {
|
|
309
|
-
resource: [
|
|
310
|
-
'queryApi',
|
|
311
|
-
],
|
|
312
|
-
operation: [
|
|
313
|
-
'executeQuery',
|
|
314
|
-
],
|
|
315
|
-
queryMode: [
|
|
316
|
-
'guided',
|
|
317
|
-
],
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
displayName: 'Sort Field',
|
|
323
|
-
name: 'sortField',
|
|
324
|
-
type: 'options',
|
|
325
|
-
typeOptions: {
|
|
326
|
-
loadOptionsMethod: 'getAllSortableFields',
|
|
327
|
-
loadOptionsDependsOn: ['limetype', 'includeRelations', 'relationsConfig.relation'],
|
|
328
|
-
},
|
|
329
|
-
default: '',
|
|
330
|
-
description: 'Field to sort by',
|
|
331
|
-
displayOptions: {
|
|
332
|
-
show: {
|
|
333
|
-
resource: [
|
|
334
|
-
'queryApi',
|
|
335
|
-
],
|
|
336
|
-
operation: [
|
|
337
|
-
'executeQuery',
|
|
338
|
-
],
|
|
339
|
-
queryMode: [
|
|
340
|
-
'guided',
|
|
341
|
-
],
|
|
342
|
-
addSorting: [
|
|
343
|
-
true,
|
|
344
|
-
],
|
|
345
|
-
},
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
displayName: 'Sort Direction',
|
|
350
|
-
name: 'sortDirection',
|
|
351
|
-
type: 'options',
|
|
352
|
-
options: [
|
|
353
|
-
{
|
|
354
|
-
name: 'Ascending (A-Z)',
|
|
355
|
-
value: 'ASC',
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
name: 'Descending (Z-A)',
|
|
359
|
-
value: 'DESC',
|
|
360
|
-
},
|
|
361
|
-
],
|
|
362
|
-
default: 'ASC',
|
|
363
|
-
description: 'Sort direction',
|
|
364
|
-
displayOptions: {
|
|
365
|
-
show: {
|
|
366
|
-
resource: [
|
|
367
|
-
'queryApi',
|
|
368
|
-
],
|
|
369
|
-
operation: [
|
|
370
|
-
'executeQuery',
|
|
371
|
-
],
|
|
372
|
-
queryMode: [
|
|
373
|
-
'guided',
|
|
374
|
-
],
|
|
375
|
-
addSorting: [
|
|
376
|
-
true,
|
|
377
|
-
],
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
displayName: 'Return All',
|
|
383
|
-
name: 'returnAll',
|
|
384
|
-
type: 'boolean',
|
|
385
|
-
displayOptions: {
|
|
386
|
-
show: {
|
|
387
|
-
resource: [
|
|
388
|
-
'queryApi',
|
|
389
|
-
],
|
|
390
|
-
operation: [
|
|
391
|
-
'executeQuery',
|
|
392
|
-
],
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
default: false,
|
|
396
|
-
description: 'Whether to return all results or respect the limit parameter',
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
displayName: 'Options',
|
|
400
|
-
name: 'options',
|
|
401
|
-
type: 'collection',
|
|
402
|
-
placeholder: 'Add Option',
|
|
403
|
-
default: {},
|
|
404
|
-
displayOptions: {
|
|
405
|
-
show: {
|
|
406
|
-
resource: [
|
|
407
|
-
'queryApi',
|
|
408
|
-
],
|
|
409
|
-
operation: [
|
|
410
|
-
'executeQuery',
|
|
411
|
-
],
|
|
412
|
-
},
|
|
413
|
-
},
|
|
414
|
-
options: [
|
|
415
|
-
{
|
|
416
|
-
displayName: 'Include Metadata',
|
|
417
|
-
name: 'includeMetadata',
|
|
418
|
-
type: 'boolean',
|
|
419
|
-
default: false,
|
|
420
|
-
description: 'Whether to include metadata about the query result (total count, pagination info, etc.)',
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
displayName: 'Timeout (ms)',
|
|
424
|
-
name: 'timeout',
|
|
425
|
-
type: 'number',
|
|
426
|
-
default: 30000,
|
|
427
|
-
description: 'Timeout for the query in milliseconds',
|
|
428
|
-
},
|
|
429
|
-
],
|
|
430
|
-
},
|
|
431
|
-
];
|
|
432
|
-
async function execute(i) {
|
|
433
|
-
const { apiRequest } = await Promise.resolve().then(() => __importStar(require('../../../transport')));
|
|
434
|
-
const queryMode = this.getNodeParameter('queryMode', i);
|
|
435
|
-
const returnAll = this.getNodeParameter('returnAll', i);
|
|
436
|
-
const options = this.getNodeParameter('options', i, {});
|
|
437
|
-
let queryObject;
|
|
438
|
-
if (queryMode === 'code') {
|
|
439
|
-
const queryJson = this.getNodeParameter('query', i);
|
|
440
|
-
try {
|
|
441
|
-
if (typeof queryJson === 'string') {
|
|
442
|
-
queryObject = JSON.parse(queryJson);
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
queryObject = queryJson;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
catch (error) {
|
|
449
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON in query: ' + error.message);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
queryObject = {};
|
|
454
|
-
const limetype = this.getNodeParameter('limeType', i);
|
|
455
|
-
queryObject.limetype = limetype;
|
|
456
|
-
const properties = this.getNodeParameter('properties', i, []);
|
|
457
|
-
const responseFormat = { object: {} };
|
|
458
|
-
properties.forEach((property) => {
|
|
459
|
-
responseFormat.object[property] = null;
|
|
460
|
-
});
|
|
461
|
-
const includeRelations = this.getNodeParameter('includeRelations', i, false);
|
|
462
|
-
if (includeRelations) {
|
|
463
|
-
const relations = this.getNodeParameter('relationsConfig.relation', i, []);
|
|
464
|
-
relations.forEach((relationConfig) => {
|
|
465
|
-
const relationName = relationConfig.relationName;
|
|
466
|
-
const relationProperties = relationConfig.properties || [];
|
|
467
|
-
if (relationName && relationProperties.length > 0) {
|
|
468
|
-
const relationObject = {};
|
|
469
|
-
relationProperties.forEach((property) => {
|
|
470
|
-
relationObject[property] = null;
|
|
471
|
-
});
|
|
472
|
-
responseFormat.object[relationName] = relationObject;
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
queryObject.responseFormat = responseFormat;
|
|
477
|
-
const addFilter = this.getNodeParameter('addFilter', i, false);
|
|
478
|
-
if (addFilter) {
|
|
479
|
-
try {
|
|
480
|
-
const filterJson = this.getNodeParameter('filter', i);
|
|
481
|
-
queryObject.filter = typeof filterJson === 'string' ? JSON.parse(filterJson) : filterJson;
|
|
482
|
-
}
|
|
483
|
-
catch (error) {
|
|
484
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON in filter: ' + error.message);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
if (!returnAll) {
|
|
488
|
-
queryObject.limit = this.getNodeParameter('limit', i, 50);
|
|
489
|
-
}
|
|
490
|
-
queryObject.offset = this.getNodeParameter('offset', i, 0);
|
|
491
|
-
const addSorting = this.getNodeParameter('addSorting', i, false);
|
|
492
|
-
if (addSorting) {
|
|
493
|
-
const sortField = this.getNodeParameter('sortField', i, '');
|
|
494
|
-
const sortDirection = this.getNodeParameter('sortDirection', i, 'ASC');
|
|
495
|
-
if (sortField) {
|
|
496
|
-
const orderBy = [];
|
|
497
|
-
const orderItem = {};
|
|
498
|
-
orderItem[sortField] = sortDirection;
|
|
499
|
-
orderBy.push(orderItem);
|
|
500
|
-
queryObject.orderBy = orderBy;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
if (returnAll) {
|
|
505
|
-
queryObject.limit = 10000;
|
|
506
|
-
}
|
|
507
|
-
if (options.includeMetadata) {
|
|
508
|
-
queryObject.includemetadata = true;
|
|
509
|
-
}
|
|
510
|
-
const endpoint = '/api/v1/query/';
|
|
511
|
-
try {
|
|
512
|
-
const requestOptions = {
|
|
513
|
-
method: 'GET',
|
|
514
|
-
endpoint,
|
|
515
|
-
qs: { q: JSON.stringify(queryObject) },
|
|
516
|
-
};
|
|
517
|
-
if (options.timeout) {
|
|
518
|
-
requestOptions.timeout = options.timeout;
|
|
519
|
-
}
|
|
520
|
-
if (returnAll && queryObject.limit) {
|
|
521
|
-
const results = [];
|
|
522
|
-
let hasMoreData = true;
|
|
523
|
-
let currentOffset = queryObject.offset || 0;
|
|
524
|
-
while (hasMoreData) {
|
|
525
|
-
queryObject.offset = currentOffset;
|
|
526
|
-
requestOptions.qs = { q: JSON.stringify(queryObject) };
|
|
527
|
-
const response = await apiRequest.call(this, requestOptions);
|
|
528
|
-
if (response && response.data && Array.isArray(response.data)) {
|
|
529
|
-
results.push(...response.data);
|
|
530
|
-
if (response.data.length < queryObject.limit) {
|
|
531
|
-
hasMoreData = false;
|
|
532
|
-
}
|
|
533
|
-
else {
|
|
534
|
-
currentOffset += response.data.length;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
hasMoreData = false;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
const finalResponse = { data: results };
|
|
542
|
-
if (options.includeMetadata) {
|
|
543
|
-
finalResponse.metadata = {
|
|
544
|
-
totalCount: results.length,
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
return finalResponse.objects;
|
|
548
|
-
}
|
|
549
|
-
else {
|
|
550
|
-
const response = await apiRequest.call(this, requestOptions);
|
|
551
|
-
return response.objects;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
catch (error) {
|
|
555
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Query execution failed: ${error.message}`);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
exports.execute = execute;
|
|
559
|
-
//# sourceMappingURL=executeQuery.operation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executeQuery.operation.js","sourceRoot":"","sources":["../../../../../../nodes/LimeCrm/resources/queryApi/operations/executeQuery.operation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAKsB;AAET,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,sDAAsD;IACnE,MAAM,EAAE,wBAAwB;CACnC,CAAC;AAEW,QAAA,UAAU,GAAsB;IAEzC;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACT,iBAAiB,EAAE,cAAc;S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C;SAC3B;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,2BAA2B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;KAC5F;AACL,CAAC;AA5KD,0BA4KC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiRequest = void 0;
|
|
4
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
async function apiRequest(options) {
|
|
6
|
-
var _a;
|
|
7
|
-
const credentials = await this.getCredentials('limeCrmApi');
|
|
8
|
-
if (!credentials) {
|
|
9
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No credentials provided');
|
|
10
|
-
}
|
|
11
|
-
const baseURL = credentials.url;
|
|
12
|
-
const apiKey = credentials.apiKey;
|
|
13
|
-
const headers = {
|
|
14
|
-
'X-API-Key': apiKey,
|
|
15
|
-
'Accept': 'application/json',
|
|
16
|
-
'Content-Type': 'application/json',
|
|
17
|
-
};
|
|
18
|
-
const endpoint = options.endpoint;
|
|
19
|
-
const method = options.method || 'GET';
|
|
20
|
-
try {
|
|
21
|
-
const requestOptions = {
|
|
22
|
-
method,
|
|
23
|
-
uri: `${baseURL}${endpoint}`,
|
|
24
|
-
json: true,
|
|
25
|
-
headers,
|
|
26
|
-
};
|
|
27
|
-
if (options.qs) {
|
|
28
|
-
requestOptions.qs = options.qs;
|
|
29
|
-
}
|
|
30
|
-
if (options.body && method !== 'GET') {
|
|
31
|
-
requestOptions.body = options.body;
|
|
32
|
-
}
|
|
33
|
-
if (options.timeout) {
|
|
34
|
-
requestOptions.timeout = options.timeout;
|
|
35
|
-
}
|
|
36
|
-
return await this.helpers.request(requestOptions);
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
if (error.response) {
|
|
40
|
-
const statusCode = error.response.statusCode;
|
|
41
|
-
const errorMessage = ((_a = error.response.body) === null || _a === void 0 ? void 0 : _a.message) || error.message;
|
|
42
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `API request failed [${statusCode}]: ${errorMessage}`);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `API request failed: ${error.message}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.apiRequest = apiRequest;
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/LimeCrm/transport/index.ts"],"names":[],"mappings":";;;AAAA,+CAAyG;AAKlG,KAAK,UAAU,UAAU,CAE5B,OAAoB;;IAGpB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAE5D,IAAI,CAAC,WAAW,EAAE;QACd,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,yBAAyB,CAAC,CAAC;KAC3E;IAED,MAAM,OAAO,GAAG,WAAW,CAAC,GAAa,CAAC;IAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC;IAG5C,MAAM,OAAO,GAAG;QACZ,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,kBAAkB;QAC5B,cAAc,EAAE,kBAAkB;KACrC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAkB,CAAC;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAgB,IAAI,KAAK,CAAC;IAEjD,IAAI;QACA,MAAM,cAAc,GAAgB;YAChC,MAAM;YACN,GAAG,EAAE,GAAG,OAAO,GAAG,QAAQ,EAAE;YAC5B,IAAI,EAAE,IAAI;YACV,OAAO;SACV,CAAC;QAGF,IAAI,OAAO,CAAC,EAAE,EAAE;YACZ,cAAc,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;SAClC;QAGD,IAAI,OAAO,CAAC,IAAI,IAAI,MAAM,KAAK,KAAK,EAAE;YAClC,cAAc,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;SACtC;QAGD,IAAI,OAAO,CAAC,OAAO,EAAE;YACjB,cAAc,CAAC,OAAO,GAAG,OAAO,CAAC,OAAiB,CAAC;SACtD;QAGD,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KACrD;IAAC,OAAO,KAAK,EAAE;QAEZ,IAAI,KAAK,CAAC,QAAQ,EAAE;YAEhB,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC7C,MAAM,YAAY,GAAG,CAAA,MAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,0CAAE,OAAO,KAAI,KAAK,CAAC,OAAO,CAAC;YAEnE,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,uBAAuB,UAAU,MAAM,YAAY,EAAE,CACxD,CAAC;SACL;aAAM;YAEH,MAAM,IAAI,iCAAkB,CACxB,IAAI,CAAC,OAAO,EAAE,EACd,uBAAuB,KAAK,CAAC,OAAO,EAAE,CACzC,CAAC;SACL;KACJ;AACL,CAAC;AApED,gCAoEC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
-
export declare class LimeGo implements INodeType {
|
|
3
|
-
description: INodeTypeDescription;
|
|
4
|
-
methods: {
|
|
5
|
-
loadOptions: {};
|
|
6
|
-
};
|
|
7
|
-
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
8
|
-
}
|