n8n-nodes-synca 1.0.0
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/dist/credentials/SyncaApi.credentials.d.ts +9 -0
- package/dist/credentials/SyncaApi.credentials.js +51 -0
- package/dist/credentials/SyncaApi.credentials.js.map +1 -0
- package/dist/nodes/Cashcow/SyncaCashcow.node.d.ts +10 -0
- package/dist/nodes/Cashcow/SyncaCashcow.node.js +185 -0
- package/dist/nodes/Cashcow/SyncaCashcow.node.js.map +1 -0
- package/dist/nodes/Cashcow/constants/cashcow-check-order-tracking.constant.d.ts +30 -0
- package/dist/nodes/Cashcow/constants/cashcow-check-order-tracking.constant.js +37 -0
- package/dist/nodes/Cashcow/constants/cashcow-check-order-tracking.constant.js.map +1 -0
- package/dist/nodes/Cashcow/constants/cashcow-create-or-update-product.constant.d.ts +117 -0
- package/dist/nodes/Cashcow/constants/cashcow-create-or-update-product.constant.js +290 -0
- package/dist/nodes/Cashcow/constants/cashcow-create-or-update-product.constant.js.map +1 -0
- package/dist/nodes/Cashcow/constants/cashcow-create-order.constant.d.ts +189 -0
- package/dist/nodes/Cashcow/constants/cashcow-create-order.constant.js +420 -0
- package/dist/nodes/Cashcow/constants/cashcow-create-order.constant.js.map +1 -0
- package/dist/nodes/Cashcow/constants/cashcow-get-store-mailbox.constant.d.ts +46 -0
- package/dist/nodes/Cashcow/constants/cashcow-get-store-mailbox.constant.js +166 -0
- package/dist/nodes/Cashcow/constants/cashcow-get-store-mailbox.constant.js.map +1 -0
- package/dist/nodes/Cashcow/icon copy 2.svg +53 -0
- package/dist/nodes/Cashcow/icon copy.svg +65 -0
- package/dist/nodes/Cashcow/icon.svg +1 -0
- package/dist/nodes/Cashcow/last-icon.svg +38 -0
- package/dist/nodes/Mirakl/SyncaMirakl.node.d.ts +0 -0
- package/dist/nodes/Mirakl/SyncaMirakl.node.js +2 -0
- package/dist/nodes/Mirakl/SyncaMirakl.node.js.map +1 -0
- package/dist/nodes/OLD_SyncaPriority.node.d.ts +10 -0
- package/dist/nodes/OLD_SyncaPriority.node.js +389 -0
- package/dist/nodes/OLD_SyncaPriority.node.js.map +1 -0
- package/dist/nodes/Priority/SyncaPriority.node.d.ts +18 -0
- package/dist/nodes/Priority/SyncaPriority.node.js +313 -0
- package/dist/nodes/Priority/SyncaPriority.node.js.map +1 -0
- package/dist/nodes/Priority/constants/methods.d.ts +15 -0
- package/dist/nodes/Priority/constants/methods.js +299 -0
- package/dist/nodes/Priority/constants/methods.js.map +1 -0
- package/dist/nodes/Priority/constants/priority-agents.constant.d.ts +39 -0
- package/dist/nodes/Priority/constants/priority-agents.constant.js +114 -0
- package/dist/nodes/Priority/constants/priority-agents.constant.js.map +1 -0
- package/dist/nodes/Priority/constants/priority-generic.constant.d.ts +158 -0
- package/dist/nodes/Priority/constants/priority-generic.constant.js +219 -0
- package/dist/nodes/Priority/constants/priority-generic.constant.js.map +1 -0
- package/dist/nodes/Priority/constants/priority-procedure.constant.d.ts +129 -0
- package/dist/nodes/Priority/constants/priority-procedure.constant.js +178 -0
- package/dist/nodes/Priority/constants/priority-procedure.constant.js.map +1 -0
- package/dist/nodes/Priority/constants/priority-products.constant.d.ts +158 -0
- package/dist/nodes/Priority/constants/priority-products.constant.js +209 -0
- package/dist/nodes/Priority/constants/priority-products.constant.js.map +1 -0
- package/dist/nodes/Priority/constants/priority-purchase-orders.constant.d.ts +158 -0
- package/dist/nodes/Priority/constants/priority-purchase-orders.constant.js +218 -0
- package/dist/nodes/Priority/constants/priority-purchase-orders.constant.js.map +1 -0
- package/dist/nodes/Priority/constants/priority-sales.constant.d.ts +158 -0
- package/dist/nodes/Priority/constants/priority-sales.constant.js +383 -0
- package/dist/nodes/Priority/constants/priority-sales.constant.js.map +1 -0
- package/dist/nodes/Priority/icon.png +0 -0
- package/dist/nodes/Priority/icon.svg +1 -0
- package/dist/nodes/Superpharm/SyncaSuperpharm.node.d.ts +10 -0
- package/dist/nodes/Superpharm/SyncaSuperpharm.node.js +1072 -0
- package/dist/nodes/Superpharm/SyncaSuperpharm.node.js.map +1 -0
- package/dist/nodes/Superpharm/icon.svg +1 -0
- package/dist/nodes/Superpharm/old-icon.svg +22 -0
- package/dist/package.json +55 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncaPriority = void 0;
|
|
4
|
+
const methods_1 = require("./constants/methods");
|
|
5
|
+
const priority_products_constant_1 = require("./constants/priority-products.constant");
|
|
6
|
+
const priority_sales_constant_1 = require("./constants/priority-sales.constant");
|
|
7
|
+
const priority_purchase_orders_constant_1 = require("./constants/priority-purchase-orders.constant");
|
|
8
|
+
const priority_procedure_constant_1 = require("./constants/priority-procedure.constant");
|
|
9
|
+
const priority_generic_constant_1 = require("./constants/priority-generic.constant");
|
|
10
|
+
const opDict = {
|
|
11
|
+
'eq': "=",
|
|
12
|
+
'in': "=",
|
|
13
|
+
'startWith': "=",
|
|
14
|
+
'endWith': "=",
|
|
15
|
+
'neq': "<>",
|
|
16
|
+
'gt': ">",
|
|
17
|
+
'gte': ">=",
|
|
18
|
+
'lt': "<",
|
|
19
|
+
'lte': "<=",
|
|
20
|
+
};
|
|
21
|
+
function getFinalFilter(f) {
|
|
22
|
+
const op = opDict[f.op];
|
|
23
|
+
let fromval = f.fromval;
|
|
24
|
+
if (f.op === 'in') {
|
|
25
|
+
fromval = `*${fromval}*`;
|
|
26
|
+
}
|
|
27
|
+
if (f.op === 'startWith') {
|
|
28
|
+
fromval = `${fromval}*`;
|
|
29
|
+
}
|
|
30
|
+
if (f.op === 'endWith') {
|
|
31
|
+
fromval = `*${fromval}`;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
fromval,
|
|
35
|
+
op: op,
|
|
36
|
+
field: f.field
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function processFieldsToSend(value, schemas) {
|
|
40
|
+
var _a;
|
|
41
|
+
const result = {};
|
|
42
|
+
if (value === null)
|
|
43
|
+
return result;
|
|
44
|
+
for (const key in value) {
|
|
45
|
+
const isRemoved = (_a = schemas.find(s => s.id === key)) === null || _a === void 0 ? void 0 : _a.removed;
|
|
46
|
+
if (!isRemoved) {
|
|
47
|
+
result[key] = value[key];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
class SyncaPriority {
|
|
53
|
+
constructor() {
|
|
54
|
+
this.description = {
|
|
55
|
+
usableAsTool: true,
|
|
56
|
+
displayName: 'Synca Priority ERP',
|
|
57
|
+
name: 'customNewSyncaPriority',
|
|
58
|
+
icon: { light: 'file:icon.svg', dark: 'file:icon.svg' },
|
|
59
|
+
group: ['transform'],
|
|
60
|
+
version: 1,
|
|
61
|
+
description: 'Interact with Priority ERP for Products, Sales, Purchase Orders, Agents, and Procedures',
|
|
62
|
+
defaults: {
|
|
63
|
+
name: 'Synca Priority ERP',
|
|
64
|
+
},
|
|
65
|
+
inputs: ["main"],
|
|
66
|
+
outputs: ["main"],
|
|
67
|
+
credentials: [
|
|
68
|
+
{
|
|
69
|
+
name: 'customSyncaApiCredentials',
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
properties: [
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Credentials',
|
|
76
|
+
name: 'credentials',
|
|
77
|
+
type: 'options',
|
|
78
|
+
typeOptions: {
|
|
79
|
+
loadOptionsMethod: 'getCredentials',
|
|
80
|
+
},
|
|
81
|
+
default: '',
|
|
82
|
+
required: true,
|
|
83
|
+
description: 'Select the credentials to use',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Resource',
|
|
87
|
+
name: 'resource',
|
|
88
|
+
type: 'options',
|
|
89
|
+
noDataExpression: true,
|
|
90
|
+
options: [
|
|
91
|
+
{
|
|
92
|
+
name: 'Products',
|
|
93
|
+
value: 'products',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'Sales',
|
|
97
|
+
value: 'sales',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'Purchase Orders',
|
|
101
|
+
value: 'purchaseOrders',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'Procedures',
|
|
105
|
+
value: 'procedures',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'Generic',
|
|
109
|
+
value: 'generic',
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
default: 'products',
|
|
113
|
+
description: 'The resource to operate on',
|
|
114
|
+
},
|
|
115
|
+
...priority_products_constant_1.PriorityProducts.declare,
|
|
116
|
+
...priority_sales_constant_1.PrioritySales.declare,
|
|
117
|
+
...priority_purchase_orders_constant_1.PriorityPurchaseOrders.declare,
|
|
118
|
+
...priority_procedure_constant_1.PriorityProcedures.declare,
|
|
119
|
+
...priority_generic_constant_1.PriorityGeneric.declare,
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Limit',
|
|
122
|
+
name: 'limit',
|
|
123
|
+
type: 'number',
|
|
124
|
+
typeOptions: {
|
|
125
|
+
minValue: 1,
|
|
126
|
+
maxValue: 1000,
|
|
127
|
+
},
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
operation: ['search_form', 'search_sub_form', 'list_products', 'list_customers', 'list_orders', 'list_invoices', 'list_purchase_orders', 'list_agents', 'list_price_lists'],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
default: 50,
|
|
134
|
+
description: 'Max number of results to return',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
displayName: 'Skip',
|
|
138
|
+
name: 'skip',
|
|
139
|
+
type: 'number',
|
|
140
|
+
typeOptions: {
|
|
141
|
+
minValue: 0,
|
|
142
|
+
},
|
|
143
|
+
displayOptions: {
|
|
144
|
+
show: {
|
|
145
|
+
operation: ['search_form', 'search_sub_form', 'list_products', 'list_customers', 'list_orders', 'list_invoices', 'list_purchase_orders', 'list_agents', 'list_price_lists'],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
default: '',
|
|
149
|
+
description: 'number of items to skip',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
this.methods = methods_1.PriorityMethods;
|
|
154
|
+
}
|
|
155
|
+
async execute() {
|
|
156
|
+
const items = this.getInputData();
|
|
157
|
+
const returnData = [];
|
|
158
|
+
for (let i = 0; i < items.length; i++) {
|
|
159
|
+
try {
|
|
160
|
+
const credentialsId = this.getNodeParameter('credentials', i);
|
|
161
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
162
|
+
const apiToken = credentials.apiToken;
|
|
163
|
+
const baseURL = credentials.baseUrl;
|
|
164
|
+
let operation = this.getNodeParameter('operation', i);
|
|
165
|
+
let requestParams = {};
|
|
166
|
+
let tempFields;
|
|
167
|
+
switch (operation) {
|
|
168
|
+
case 'get_product':
|
|
169
|
+
case 'get_customer':
|
|
170
|
+
case 'get_order':
|
|
171
|
+
case 'get_invoice':
|
|
172
|
+
case 'get_purchase_order':
|
|
173
|
+
const param = `${operation.split('_')[1]}Id`;
|
|
174
|
+
requestParams = {
|
|
175
|
+
id: this.getNodeParameter(param, i),
|
|
176
|
+
formName: methods_1.operationToFormName[operation]
|
|
177
|
+
};
|
|
178
|
+
operation = 'get_row_in_form';
|
|
179
|
+
break;
|
|
180
|
+
case 'create_product':
|
|
181
|
+
case 'update_product':
|
|
182
|
+
case 'create_customer':
|
|
183
|
+
case 'update_customer':
|
|
184
|
+
case 'create_order':
|
|
185
|
+
case 'update_order':
|
|
186
|
+
case 'create_invoice':
|
|
187
|
+
case 'update_invoice':
|
|
188
|
+
case 'create_purchase_order':
|
|
189
|
+
case 'update_purchase_order':
|
|
190
|
+
case 'add_to_form':
|
|
191
|
+
case 'update_row_in_form':
|
|
192
|
+
const formFilters = this.getNodeParameter('filters.filter', 0, []);
|
|
193
|
+
tempFields = this.getNodeParameter('rowData', 0, {});
|
|
194
|
+
requestParams = {
|
|
195
|
+
formName: operation.includes('form') ? this.getNodeParameter('formName', i) : methods_1.operationToFormName[operation],
|
|
196
|
+
fields: processFieldsToSend(tempFields.value, tempFields.schema),
|
|
197
|
+
formFilters: formFilters.map(f => getFinalFilter(f))
|
|
198
|
+
};
|
|
199
|
+
if (operation.startsWith('update_'))
|
|
200
|
+
operation = 'update_row_in_form';
|
|
201
|
+
else
|
|
202
|
+
operation = 'add_to_form';
|
|
203
|
+
break;
|
|
204
|
+
case 'get_agent':
|
|
205
|
+
requestParams = {
|
|
206
|
+
id: this.getNodeParameter('agentId', i),
|
|
207
|
+
};
|
|
208
|
+
break;
|
|
209
|
+
case 'run_procedures':
|
|
210
|
+
const parameters = this.getNodeParameter('fields', 0, {});
|
|
211
|
+
console.log({ parameters });
|
|
212
|
+
requestParams = {
|
|
213
|
+
procedure_name: this.getNodeParameter('procedureName', i),
|
|
214
|
+
parameters: parameters.value
|
|
215
|
+
};
|
|
216
|
+
break;
|
|
217
|
+
case 'list_products':
|
|
218
|
+
case 'list_customers':
|
|
219
|
+
case 'list_orders':
|
|
220
|
+
case 'list_invoices':
|
|
221
|
+
case 'list_purchase_orders':
|
|
222
|
+
case 'search_form':
|
|
223
|
+
const filters = this.getNodeParameter('filters.filter', 0, []);
|
|
224
|
+
const finalFormName = operation.startsWith('list_') ? methods_1.operationToFormName[operation] : this.getNodeParameter('formName', i);
|
|
225
|
+
if (operation.startsWith('list_')) {
|
|
226
|
+
operation = 'search_form';
|
|
227
|
+
}
|
|
228
|
+
const fields = this.getNodeParameter('fields', 0, []);
|
|
229
|
+
requestParams = {
|
|
230
|
+
formName: finalFormName,
|
|
231
|
+
limit: this.getNodeParameter('limit', i, 50),
|
|
232
|
+
skip: this.getNodeParameter('skip', i, 0),
|
|
233
|
+
fields,
|
|
234
|
+
filters: filters.map(f => getFinalFilter(f))
|
|
235
|
+
};
|
|
236
|
+
break;
|
|
237
|
+
case 'search_sub_form':
|
|
238
|
+
const searchSubFormFilters = this.getNodeParameter('filters.filter', 0, []);
|
|
239
|
+
const searchSubFormFields = this.getNodeParameter('fields', 0, []);
|
|
240
|
+
requestParams = {
|
|
241
|
+
formName: this.getNodeParameter('formName', i),
|
|
242
|
+
subFormName: this.getNodeParameter('subFormName', i),
|
|
243
|
+
mainEntityId: this.getNodeParameter('mainEntityId', i),
|
|
244
|
+
limit: this.getNodeParameter('limit', i, 50),
|
|
245
|
+
skip: this.getNodeParameter('skip', i, 0),
|
|
246
|
+
fields: searchSubFormFields,
|
|
247
|
+
filters: searchSubFormFilters.map(f => getFinalFilter(f))
|
|
248
|
+
};
|
|
249
|
+
break;
|
|
250
|
+
case 'add_to_sub_form':
|
|
251
|
+
tempFields = this.getNodeParameter('rowData', 0, {});
|
|
252
|
+
requestParams = {
|
|
253
|
+
formName: this.getNodeParameter('formName', i),
|
|
254
|
+
subFormName: this.getNodeParameter('subFormName', i),
|
|
255
|
+
mainEntityId: this.getNodeParameter('mainEntityId', i),
|
|
256
|
+
fields: processFieldsToSend(tempFields.value, tempFields.schema),
|
|
257
|
+
};
|
|
258
|
+
break;
|
|
259
|
+
case 'update_row_in_sub_form':
|
|
260
|
+
const subFormFilters = this.getNodeParameter('filters.filter', 0, []);
|
|
261
|
+
tempFields = this.getNodeParameter('rowData', 0, {});
|
|
262
|
+
requestParams = {
|
|
263
|
+
formName: this.getNodeParameter('formName', i),
|
|
264
|
+
subFormName: this.getNodeParameter('subFormName', i),
|
|
265
|
+
mainEntityId: this.getNodeParameter('mainEntityId', i),
|
|
266
|
+
fields: processFieldsToSend(tempFields.value, tempFields.schema),
|
|
267
|
+
subFormFilters: subFormFilters.map(f => getFinalFilter(f))
|
|
268
|
+
};
|
|
269
|
+
break;
|
|
270
|
+
default:
|
|
271
|
+
if (operation.startsWith('list_')) {
|
|
272
|
+
requestParams = {
|
|
273
|
+
limit: this.getNodeParameter('limit', i, 50),
|
|
274
|
+
skip: this.getNodeParameter('skip', i, 0),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const url = `${baseURL}/v1/invoke/${credentialsId}/${operation}`;
|
|
279
|
+
const options = {
|
|
280
|
+
method: 'POST',
|
|
281
|
+
url,
|
|
282
|
+
headers: {
|
|
283
|
+
'x-api-token': apiToken,
|
|
284
|
+
'Content-Type': 'application/json',
|
|
285
|
+
},
|
|
286
|
+
body: requestParams,
|
|
287
|
+
};
|
|
288
|
+
console.log({ executeOptions: options });
|
|
289
|
+
const responseData = await this.helpers.httpRequest(options);
|
|
290
|
+
returnData.push({
|
|
291
|
+
json: responseData,
|
|
292
|
+
pairedItem: { item: i },
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
console.log({ error });
|
|
297
|
+
if (this.continueOnFail()) {
|
|
298
|
+
returnData.push({
|
|
299
|
+
json: {
|
|
300
|
+
error: error.message,
|
|
301
|
+
},
|
|
302
|
+
pairedItem: { item: i },
|
|
303
|
+
});
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
throw error;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return [returnData];
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
exports.SyncaPriority = SyncaPriority;
|
|
313
|
+
//# sourceMappingURL=SyncaPriority.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncaPriority.node.js","sourceRoot":"","sources":["../../../nodes/Priority/SyncaPriority.node.ts"],"names":[],"mappings":";;;AAUA,iDAA2E;AAC3E,uFAA0E;AAC1E,iFAAoE;AACpE,qGAAuF;AAEvF,yFAA6E;AAC7E,qFAAwE;AAGxE,MAAM,MAAM,GAA2B;IACtC,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,GAAG;IACd,KAAK,EAAE,IAAI;IACX,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AAK,CAAC;aACZ;SACD;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA3lBD,sCA2lBC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ILoadOptionsFunctions, INodePropertyOptions, ResourceMapperFields } from "n8n-workflow";
|
|
2
|
+
export declare const operationToFormName: Record<string, string>;
|
|
3
|
+
export declare const PriorityMethods: {
|
|
4
|
+
loadOptions: {
|
|
5
|
+
getCredentials(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
6
|
+
getSubForms(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
getForms(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
getFormFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
9
|
+
getProcedures(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
10
|
+
};
|
|
11
|
+
resourceMapping: {
|
|
12
|
+
getMappingColumns(this: ILoadOptionsFunctions): Promise<ResourceMapperFields>;
|
|
13
|
+
getFormFields(this: ILoadOptionsFunctions): Promise<ResourceMapperFields>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriorityMethods = exports.operationToFormName = void 0;
|
|
4
|
+
exports.operationToFormName = {
|
|
5
|
+
'list_products': 'LOGPART',
|
|
6
|
+
'create_product': 'LOGPART',
|
|
7
|
+
'update_product': 'LOGPART',
|
|
8
|
+
'get_product': 'LOGPART',
|
|
9
|
+
'list_orders': 'ORDERS',
|
|
10
|
+
'create_order': 'ORDERS',
|
|
11
|
+
'update_order': 'ORDERS',
|
|
12
|
+
'get_order': 'ORDERS',
|
|
13
|
+
'list_customers': 'CUSTOMERS',
|
|
14
|
+
'create_customer': 'CUSTOMERS',
|
|
15
|
+
'update_customer': 'CUSTOMERS',
|
|
16
|
+
'get_customer': 'CUSTOMERS',
|
|
17
|
+
'list_invoices': 'TINVOICES',
|
|
18
|
+
'create_invoice': 'TINVOICES',
|
|
19
|
+
'update_invoice': 'TINVOICES',
|
|
20
|
+
'get_invoice': 'TINVOICES',
|
|
21
|
+
'list_purchase_orders': 'PORDERS',
|
|
22
|
+
'create_purchase_order': 'PORDERS',
|
|
23
|
+
'update_purchase_order': 'PORDERS',
|
|
24
|
+
'get_purchase_order': 'PORDERS',
|
|
25
|
+
};
|
|
26
|
+
function mapType(t) {
|
|
27
|
+
switch (t) {
|
|
28
|
+
case 'duration':
|
|
29
|
+
case 'int':
|
|
30
|
+
case 'number':
|
|
31
|
+
return 'number';
|
|
32
|
+
case 'date':
|
|
33
|
+
case 'datetime':
|
|
34
|
+
return 'dateTime';
|
|
35
|
+
case 'time':
|
|
36
|
+
return 'time';
|
|
37
|
+
case 'checkbox':
|
|
38
|
+
case 'bool':
|
|
39
|
+
return 'boolean';
|
|
40
|
+
default:
|
|
41
|
+
return 'string';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.PriorityMethods = {
|
|
45
|
+
loadOptions: {
|
|
46
|
+
async getCredentials() {
|
|
47
|
+
try {
|
|
48
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
49
|
+
const options = {
|
|
50
|
+
method: 'GET',
|
|
51
|
+
url: `${credentials.baseUrl}/v1/invoke/get-credentials`,
|
|
52
|
+
headers: {
|
|
53
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
const response = await this.helpers.httpRequest(options);
|
|
57
|
+
if (Array.isArray(response)) {
|
|
58
|
+
return response.map((cred) => ({
|
|
59
|
+
name: cred.name || cred.id,
|
|
60
|
+
value: cred.id,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
async getSubForms() {
|
|
70
|
+
var _a;
|
|
71
|
+
try {
|
|
72
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
73
|
+
const credentialsId = this.getNodeParameter('credentials');
|
|
74
|
+
const operation = this.getNodeParameter('operation');
|
|
75
|
+
let formName;
|
|
76
|
+
try {
|
|
77
|
+
formName = this.getNodeParameter('formName');
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
formName = exports.operationToFormName[operation];
|
|
81
|
+
}
|
|
82
|
+
console.log({ credentials, credentialsId, operation, formName });
|
|
83
|
+
const url = `${credentials.baseUrl}/v1/invoke/${credentialsId}/get_subforms`;
|
|
84
|
+
const options = {
|
|
85
|
+
method: 'POST',
|
|
86
|
+
url: url,
|
|
87
|
+
headers: {
|
|
88
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
89
|
+
},
|
|
90
|
+
body: { formName: (_a = exports.operationToFormName[operation]) !== null && _a !== void 0 ? _a : formName }
|
|
91
|
+
};
|
|
92
|
+
const response = await this.helpers.httpRequest(options);
|
|
93
|
+
if (Array.isArray(response.data)) {
|
|
94
|
+
return response.data.map((cred) => ({
|
|
95
|
+
name: cred.name || cred.id,
|
|
96
|
+
value: cred.id,
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
return [];
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
async getForms() {
|
|
106
|
+
try {
|
|
107
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
108
|
+
const credentialsId = this.getNodeParameter('credentials');
|
|
109
|
+
const url = `${credentials.baseUrl}/v1/invoke/${credentialsId}/get_forms`;
|
|
110
|
+
const options = {
|
|
111
|
+
method: 'POST',
|
|
112
|
+
url: url,
|
|
113
|
+
headers: {
|
|
114
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const response = await this.helpers.httpRequest(options);
|
|
118
|
+
if (Array.isArray(response.data)) {
|
|
119
|
+
return response.data.map((cred) => ({
|
|
120
|
+
name: cred.name || cred.id,
|
|
121
|
+
value: cred.id,
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
async getFormFields() {
|
|
131
|
+
try {
|
|
132
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
133
|
+
const credentialsId = this.getNodeParameter('credentials');
|
|
134
|
+
const operation = this.getNodeParameter('operation');
|
|
135
|
+
let formName;
|
|
136
|
+
try {
|
|
137
|
+
formName = this.getNodeParameter('formName');
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
formName = exports.operationToFormName[operation];
|
|
141
|
+
}
|
|
142
|
+
let subFormName;
|
|
143
|
+
try {
|
|
144
|
+
subFormName = this.getNodeParameter('subFormName');
|
|
145
|
+
}
|
|
146
|
+
catch (e) { }
|
|
147
|
+
const url = `${credentials.baseUrl}/v1/invoke/${credentialsId}/get_form_fields`;
|
|
148
|
+
const options = {
|
|
149
|
+
method: 'POST',
|
|
150
|
+
url: url,
|
|
151
|
+
headers: {
|
|
152
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
153
|
+
},
|
|
154
|
+
body: { formName, subFormName }
|
|
155
|
+
};
|
|
156
|
+
const response = await this.helpers.httpRequest(options);
|
|
157
|
+
if (Array.isArray(response.data)) {
|
|
158
|
+
return response.data.map((cred) => ({
|
|
159
|
+
name: cred.name || cred.id,
|
|
160
|
+
value: cred.id,
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
async getProcedures() {
|
|
170
|
+
try {
|
|
171
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
172
|
+
const credentialsId = this.getNodeParameter('credentials');
|
|
173
|
+
const url = `${credentials.baseUrl}/v1/invoke/${credentialsId}/get_procedures`;
|
|
174
|
+
const options = {
|
|
175
|
+
method: 'POST',
|
|
176
|
+
url: url,
|
|
177
|
+
headers: {
|
|
178
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
const response = await this.helpers.httpRequest(options);
|
|
182
|
+
if (Array.isArray(response.data)) {
|
|
183
|
+
return response.data.map((cred) => ({
|
|
184
|
+
name: cred.name || cred.id,
|
|
185
|
+
value: cred.id,
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
resourceMapping: {
|
|
196
|
+
async getMappingColumns() {
|
|
197
|
+
var _a, _b, _c;
|
|
198
|
+
try {
|
|
199
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
200
|
+
const credentialsId = this.getNodeParameter('credentials');
|
|
201
|
+
const url = `${credentials.baseUrl}/v1/invoke/${credentialsId}/get_procedure_columns`;
|
|
202
|
+
const options = {
|
|
203
|
+
method: 'POST',
|
|
204
|
+
url: url,
|
|
205
|
+
headers: {
|
|
206
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
207
|
+
},
|
|
208
|
+
body: { procedure_name: this.getNodeParameter('procedureName') }
|
|
209
|
+
};
|
|
210
|
+
const response = await this.helpers.httpRequest(options);
|
|
211
|
+
let results = [];
|
|
212
|
+
if (Array.isArray((_a = response.data) === null || _a === void 0 ? void 0 : _a.EditFields)) {
|
|
213
|
+
results = response.data.EditFields.map((f, i) => ({
|
|
214
|
+
id: `${f.field}`,
|
|
215
|
+
required: f.mandatory === 1,
|
|
216
|
+
displayName: f.title,
|
|
217
|
+
type: 'string',
|
|
218
|
+
display: true,
|
|
219
|
+
}));
|
|
220
|
+
}
|
|
221
|
+
if (Array.isArray((_b = response.data) === null || _b === void 0 ? void 0 : _b.fields)) {
|
|
222
|
+
results = response.data.fields.map((f, i) => ({
|
|
223
|
+
id: `${f.field}`,
|
|
224
|
+
required: f.mandatory === 1,
|
|
225
|
+
displayName: f.title,
|
|
226
|
+
options: f.options,
|
|
227
|
+
type: f.options ? 'options' : mapType(f.type),
|
|
228
|
+
display: true,
|
|
229
|
+
}));
|
|
230
|
+
}
|
|
231
|
+
return { fields: results, emptyFieldsNotice: 'לא נמצאו שדות לפרוצדורה.' };
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
return { fields: [], emptyFieldsNotice: (_c = error.message) !== null && _c !== void 0 ? _c : 'היראה שגיאה בטעינת השדות לפרוצדורה, נסה שנית מאוחר יותר.' };
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
async getFormFields() {
|
|
238
|
+
try {
|
|
239
|
+
const credentials = await this.getCredentials('customSyncaApiCredentials');
|
|
240
|
+
const credentialsId = this.getNodeParameter('credentials');
|
|
241
|
+
const operation = this.getNodeParameter('operation');
|
|
242
|
+
let formName;
|
|
243
|
+
try {
|
|
244
|
+
formName = this.getNodeParameter('formName');
|
|
245
|
+
}
|
|
246
|
+
catch (e) {
|
|
247
|
+
formName = exports.operationToFormName[operation];
|
|
248
|
+
}
|
|
249
|
+
let subFormName;
|
|
250
|
+
try {
|
|
251
|
+
subFormName = this.getNodeParameter('subFormName');
|
|
252
|
+
}
|
|
253
|
+
catch (e) { }
|
|
254
|
+
let subSubFormName;
|
|
255
|
+
try {
|
|
256
|
+
subSubFormName = this.getNodeParameter('subSubFormName');
|
|
257
|
+
}
|
|
258
|
+
catch (e) { }
|
|
259
|
+
const url = `${credentials.baseUrl}/v1/invoke/${credentialsId}/get_form_fields_for_add`;
|
|
260
|
+
const options = {
|
|
261
|
+
method: 'POST',
|
|
262
|
+
url: url,
|
|
263
|
+
headers: {
|
|
264
|
+
'x-api-token': credentials === null || credentials === void 0 ? void 0 : credentials.apiToken,
|
|
265
|
+
},
|
|
266
|
+
body: { operation, formName, subFormName, subSubFormName }
|
|
267
|
+
};
|
|
268
|
+
const response = await this.helpers.httpRequest(options);
|
|
269
|
+
if (response.success === false) {
|
|
270
|
+
return { fields: [], emptyFieldsNotice: response.error.message };
|
|
271
|
+
}
|
|
272
|
+
if (Array.isArray(response.data)) {
|
|
273
|
+
const result = {
|
|
274
|
+
fields: response.data.map((f) => {
|
|
275
|
+
const temp = {
|
|
276
|
+
id: f.id,
|
|
277
|
+
displayName: f.name || f.key,
|
|
278
|
+
type: f.choices ? 'options' : mapType(f.type),
|
|
279
|
+
required: !!f.required,
|
|
280
|
+
display: true,
|
|
281
|
+
options: f.choices,
|
|
282
|
+
canBeUsedToMatch: false,
|
|
283
|
+
defaultMatch: false,
|
|
284
|
+
};
|
|
285
|
+
return temp;
|
|
286
|
+
})
|
|
287
|
+
};
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
return { fields: [], emptyFieldsNotice: 'אין שדות למסך זה' };
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
console.log({ error });
|
|
294
|
+
return { fields: [], emptyFieldsNotice: 'אין שדות למסך זה' };
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../nodes/Priority/constants/methods.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAA2B;IACvD,eAAe,EAAE,SAAS;IAC1B,gBAAgB,EAAE,SAAS;IAC3B,gBAAgB,EAAE,SA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