@leonailtd/n8n-nodes-priority-erp 3.1.1 → 3.2.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/LICENSE +27 -15
- package/dist/LICENSE +27 -15
- package/dist/credentials/PriorityErpApi.credentials.js +134 -1
- package/dist/credentials/PriorityErpWebSdk.credentials.js +134 -1
- package/dist/nodes/PriorityERP/PriorityERP.node.js +311 -1
- package/dist/nodes/PriorityERP/actions/batch/batch.properties.js +83 -1
- package/dist/nodes/PriorityERP/actions/batch/execute.operation.js +43 -1
- package/dist/nodes/PriorityERP/actions/batch/index.js +8 -1
- package/dist/nodes/PriorityERP/actions/entity/create.operation.js +13 -1
- package/dist/nodes/PriorityERP/actions/entity/delete.operation.js +12 -1
- package/dist/nodes/PriorityERP/actions/entity/entity.properties.js +296 -1
- package/dist/nodes/PriorityERP/actions/entity/get.operation.js +35 -1
- package/dist/nodes/PriorityERP/actions/entity/getMany.operation.js +43 -1
- package/dist/nodes/PriorityERP/actions/entity/index.js +16 -1
- package/dist/nodes/PriorityERP/actions/entity/update.operation.js +14 -1
- package/dist/nodes/PriorityERP/actions/file/download.operation.js +23 -1
- package/dist/nodes/PriorityERP/actions/file/file.properties.js +123 -1
- package/dist/nodes/PriorityERP/actions/file/getFiles.operation.js +16 -1
- package/dist/nodes/PriorityERP/actions/file/index.js +12 -1
- package/dist/nodes/PriorityERP/actions/file/upload.operation.js +26 -1
- package/dist/nodes/PriorityERP/actions/procedure/activate.operation.js +33 -1
- package/dist/nodes/PriorityERP/actions/procedure/activateSubForm.operation.js +37 -1
- package/dist/nodes/PriorityERP/actions/procedure/index.js +10 -1
- package/dist/nodes/PriorityERP/actions/procedure/procedure.properties.js +157 -1
- package/dist/nodes/PriorityERP/actions/subForm/create.operation.js +15 -1
- package/dist/nodes/PriorityERP/actions/subForm/delete.operation.js +14 -1
- package/dist/nodes/PriorityERP/actions/subForm/get.operation.js +37 -1
- package/dist/nodes/PriorityERP/actions/subForm/getMany.operation.js +45 -1
- package/dist/nodes/PriorityERP/actions/subForm/index.js +16 -1
- package/dist/nodes/PriorityERP/actions/subForm/subForm.properties.js +304 -1
- package/dist/nodes/PriorityERP/actions/subForm/update.operation.js +16 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/create.operation.js +17 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/delete.operation.js +16 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/get.operation.js +39 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/getMany.operation.js +47 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/index.js +16 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/subSubForm.properties.js +296 -1
- package/dist/nodes/PriorityERP/actions/subSubForm/update.operation.js +18 -1
- package/dist/nodes/PriorityERP/actions/text/getText.operation.js +16 -1
- package/dist/nodes/PriorityERP/actions/text/index.js +10 -1
- package/dist/nodes/PriorityERP/actions/text/setText.operation.js +19 -1
- package/dist/nodes/PriorityERP/actions/text/text.properties.js +107 -1
- package/dist/nodes/PriorityERP/helpers/odata.js +54 -1
- package/dist/nodes/PriorityERP/helpers/utils.js +62 -1
- package/dist/nodes/PriorityERP/methods/loadOptions.js +643 -1
- package/dist/nodes/PriorityERP/transport/priorityApi.js +203 -1
- package/dist/package.json +2 -2
- package/package.json +3 -3
|
@@ -1 +1,107 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textFields = exports.textOperations = void 0;
|
|
4
|
+
exports.textOperations = {
|
|
5
|
+
displayName: 'Operation',
|
|
6
|
+
name: 'operation',
|
|
7
|
+
type: 'options',
|
|
8
|
+
noDataExpression: true,
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
resource: ['text'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Get Text',
|
|
17
|
+
value: 'getText',
|
|
18
|
+
description: 'Get text content from a sub-form',
|
|
19
|
+
action: 'Get text content',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Set Text',
|
|
23
|
+
value: 'setText',
|
|
24
|
+
description: 'Set text content on a sub-form',
|
|
25
|
+
action: 'Set text content',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
default: 'getText',
|
|
29
|
+
};
|
|
30
|
+
exports.textFields = [
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Form Name',
|
|
33
|
+
name: 'formName',
|
|
34
|
+
type: 'options',
|
|
35
|
+
typeOptions: {
|
|
36
|
+
loadOptionsMethod: 'getForms',
|
|
37
|
+
},
|
|
38
|
+
required: true,
|
|
39
|
+
displayOptions: { show: { resource: ['text'] } },
|
|
40
|
+
default: '',
|
|
41
|
+
description: 'The parent form name. Switch to expression mode to type manually.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Record ID',
|
|
45
|
+
name: 'recordId',
|
|
46
|
+
type: 'string',
|
|
47
|
+
required: true,
|
|
48
|
+
displayOptions: { show: { resource: ['text'] } },
|
|
49
|
+
default: '',
|
|
50
|
+
description: 'The ID of the parent record',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Sub-Form Name',
|
|
54
|
+
name: 'subFormName',
|
|
55
|
+
type: 'options',
|
|
56
|
+
typeOptions: {
|
|
57
|
+
loadOptionsMethod: 'getSubForms',
|
|
58
|
+
},
|
|
59
|
+
required: true,
|
|
60
|
+
displayOptions: { show: { resource: ['text'] } },
|
|
61
|
+
default: '',
|
|
62
|
+
description: 'The sub-form containing the text field. Switch to expression mode to type manually.',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
displayName: 'Sub-Form ID',
|
|
66
|
+
name: 'subFormId',
|
|
67
|
+
type: 'string',
|
|
68
|
+
required: true,
|
|
69
|
+
displayOptions: { show: { resource: ['text'] } },
|
|
70
|
+
default: '',
|
|
71
|
+
description: 'The ID of the sub-form record',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
displayName: 'Text Sub-Form Name',
|
|
75
|
+
name: 'textSubFormName',
|
|
76
|
+
type: 'options',
|
|
77
|
+
typeOptions: {
|
|
78
|
+
loadOptionsMethod: 'getTextSubForms',
|
|
79
|
+
},
|
|
80
|
+
required: true,
|
|
81
|
+
displayOptions: { show: { resource: ['text'] } },
|
|
82
|
+
default: '',
|
|
83
|
+
description: 'The text sub-form name. Switch to expression mode to type manually.',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Text Content',
|
|
87
|
+
name: 'textContent',
|
|
88
|
+
type: 'string',
|
|
89
|
+
typeOptions: {
|
|
90
|
+
rows: 5,
|
|
91
|
+
},
|
|
92
|
+
required: true,
|
|
93
|
+
displayOptions: {
|
|
94
|
+
show: { resource: ['text'], operation: ['setText'] },
|
|
95
|
+
},
|
|
96
|
+
default: '',
|
|
97
|
+
description: 'The text content to set',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Text Field Name',
|
|
101
|
+
name: 'textFieldName',
|
|
102
|
+
type: 'string',
|
|
103
|
+
displayOptions: { show: { resource: ['text'] } },
|
|
104
|
+
default: 'TEXT',
|
|
105
|
+
description: 'The field name that holds the text (usually TEXT)',
|
|
106
|
+
},
|
|
107
|
+
];
|
|
@@ -1 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildODataQuery = buildODataQuery;
|
|
4
|
+
exports.buildFilterString = buildFilterString;
|
|
5
|
+
exports.buildOrderByString = buildOrderByString;
|
|
6
|
+
function buildODataQuery(options) {
|
|
7
|
+
const qs = {};
|
|
8
|
+
if (options.select) {
|
|
9
|
+
qs.$select = Array.isArray(options.select) ? options.select.join(',') : options.select;
|
|
10
|
+
}
|
|
11
|
+
if (options.filter)
|
|
12
|
+
qs.$filter = options.filter;
|
|
13
|
+
if (options.orderby)
|
|
14
|
+
qs.$orderby = options.orderby;
|
|
15
|
+
if (options.expand) {
|
|
16
|
+
qs.$expand = Array.isArray(options.expand) ? options.expand.join(',') : options.expand;
|
|
17
|
+
}
|
|
18
|
+
if (options.top)
|
|
19
|
+
qs.$top = options.top;
|
|
20
|
+
if (options.skip)
|
|
21
|
+
qs.$skip = options.skip;
|
|
22
|
+
if (options.since)
|
|
23
|
+
qs.$since = options.since;
|
|
24
|
+
return qs;
|
|
25
|
+
}
|
|
26
|
+
function buildFilterString(filterValues) {
|
|
27
|
+
const functionOperators = ['contains', 'startswith', 'endswith'];
|
|
28
|
+
const parts = [];
|
|
29
|
+
for (const filter of filterValues) {
|
|
30
|
+
const column = filter.column;
|
|
31
|
+
const operator = filter.operator;
|
|
32
|
+
const value = filter.value;
|
|
33
|
+
if (!column || !operator)
|
|
34
|
+
continue;
|
|
35
|
+
if (functionOperators.includes(operator)) {
|
|
36
|
+
parts.push(`${operator}(${column},'${value}')`);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
parts.push(`${column} ${operator} '${value}'`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return parts.join(' and ');
|
|
43
|
+
}
|
|
44
|
+
function buildOrderByString(sortValues) {
|
|
45
|
+
const parts = [];
|
|
46
|
+
for (const sort of sortValues) {
|
|
47
|
+
const column = sort.column;
|
|
48
|
+
const direction = sort.direction || 'asc';
|
|
49
|
+
if (!column)
|
|
50
|
+
continue;
|
|
51
|
+
parts.push(`${column} ${direction}`);
|
|
52
|
+
}
|
|
53
|
+
return parts.join(', ');
|
|
54
|
+
}
|
|
@@ -1 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildRequestUrl = buildRequestUrl;
|
|
4
|
+
exports.extractFieldValues = extractFieldValues;
|
|
5
|
+
exports.baseRequestOptions = baseRequestOptions;
|
|
6
|
+
exports.fetchFieldLabels = fetchFieldLabels;
|
|
7
|
+
function buildRequestUrl(context, path) {
|
|
8
|
+
if (context.connectionType === 'router') {
|
|
9
|
+
return { url: `${context.baseUrl}${path}` };
|
|
10
|
+
}
|
|
11
|
+
return { url: path, baseURL: context.baseUrl };
|
|
12
|
+
}
|
|
13
|
+
function extractFieldValues(fieldsUi) {
|
|
14
|
+
const body = {};
|
|
15
|
+
if (fieldsUi && fieldsUi.fieldValues) {
|
|
16
|
+
const fieldValues = fieldsUi.fieldValues;
|
|
17
|
+
if (Array.isArray(fieldValues)) {
|
|
18
|
+
for (const field of fieldValues) {
|
|
19
|
+
if (field.fieldName && field.fieldValue !== undefined) {
|
|
20
|
+
body[field.fieldName] = field.fieldValue;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return body;
|
|
26
|
+
}
|
|
27
|
+
function baseRequestOptions() {
|
|
28
|
+
return {
|
|
29
|
+
json: true,
|
|
30
|
+
timeout: 300000,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const ROUTER_BASE_URL = 'https://php-api-941574646138.me-west1.run.app/api/priority';
|
|
34
|
+
async function fetchFieldLabels(execFns, formName, context) {
|
|
35
|
+
try {
|
|
36
|
+
const labels = {};
|
|
37
|
+
if (context.connectionType === 'router') {
|
|
38
|
+
const requestOptions = {
|
|
39
|
+
method: 'GET',
|
|
40
|
+
url: `${ROUTER_BASE_URL}/rpc/rpc`,
|
|
41
|
+
headers: {
|
|
42
|
+
TABLE_NAME: formName,
|
|
43
|
+
READ: '1',
|
|
44
|
+
},
|
|
45
|
+
json: true,
|
|
46
|
+
timeout: 15000,
|
|
47
|
+
};
|
|
48
|
+
const response = await execFns.helpers.httpRequestWithAuthentication.call(execFns, 'priorityErpApi', requestOptions);
|
|
49
|
+
if (Array.isArray(response)) {
|
|
50
|
+
for (const item of response) {
|
|
51
|
+
if (item.columnName && item.description) {
|
|
52
|
+
labels[item.columnName] = item.description;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return labels;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
}
|