@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,123 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fileFields = exports.fileOperations = void 0;
|
|
4
|
+
exports.fileOperations = {
|
|
5
|
+
displayName: 'Operation',
|
|
6
|
+
name: 'operation',
|
|
7
|
+
type: 'options',
|
|
8
|
+
noDataExpression: true,
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
resource: ['file'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Upload',
|
|
17
|
+
value: 'upload',
|
|
18
|
+
description: 'Upload a file attachment',
|
|
19
|
+
action: 'Upload a file',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Get Files',
|
|
23
|
+
value: 'getFiles',
|
|
24
|
+
description: 'List file attachments',
|
|
25
|
+
action: 'Get file attachments',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Download',
|
|
29
|
+
value: 'download',
|
|
30
|
+
description: 'Download a file attachment',
|
|
31
|
+
action: 'Download a file',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
default: 'upload',
|
|
35
|
+
};
|
|
36
|
+
exports.fileFields = [
|
|
37
|
+
{
|
|
38
|
+
displayName: 'Form Name',
|
|
39
|
+
name: 'formName',
|
|
40
|
+
type: 'options',
|
|
41
|
+
typeOptions: {
|
|
42
|
+
loadOptionsMethod: 'getForms',
|
|
43
|
+
},
|
|
44
|
+
required: true,
|
|
45
|
+
displayOptions: { show: { resource: ['file'] } },
|
|
46
|
+
default: '',
|
|
47
|
+
description: 'The form that owns the file attachments',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Record ID',
|
|
51
|
+
name: 'recordId',
|
|
52
|
+
type: 'string',
|
|
53
|
+
required: true,
|
|
54
|
+
displayOptions: { show: { resource: ['file'] } },
|
|
55
|
+
default: '',
|
|
56
|
+
description: 'The ID of the record to attach files to',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Files Sub-Form',
|
|
60
|
+
name: 'filesSubForm',
|
|
61
|
+
type: 'options',
|
|
62
|
+
typeOptions: {
|
|
63
|
+
loadOptionsMethod: 'getSubForms',
|
|
64
|
+
},
|
|
65
|
+
required: true,
|
|
66
|
+
displayOptions: { show: { resource: ['file'] } },
|
|
67
|
+
default: 'EXTFILES',
|
|
68
|
+
description: 'The sub-form that holds file attachments (usually EXTFILES). Switch to expression mode to type manually.',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'File ID',
|
|
72
|
+
name: 'fileId',
|
|
73
|
+
type: 'string',
|
|
74
|
+
required: true,
|
|
75
|
+
displayOptions: {
|
|
76
|
+
show: { resource: ['file'], operation: ['download'] },
|
|
77
|
+
},
|
|
78
|
+
default: '',
|
|
79
|
+
description: 'The ID of the file attachment to download',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Binary Property',
|
|
83
|
+
name: 'binaryPropertyName',
|
|
84
|
+
type: 'string',
|
|
85
|
+
required: true,
|
|
86
|
+
displayOptions: {
|
|
87
|
+
show: { resource: ['file'], operation: ['upload'] },
|
|
88
|
+
},
|
|
89
|
+
default: 'data',
|
|
90
|
+
description: 'The name of the binary property containing the file to upload',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'File Name',
|
|
94
|
+
name: 'fileName',
|
|
95
|
+
type: 'string',
|
|
96
|
+
displayOptions: {
|
|
97
|
+
show: { resource: ['file'], operation: ['upload'] },
|
|
98
|
+
},
|
|
99
|
+
default: '',
|
|
100
|
+
description: 'Override the file name (leave empty to use original name)',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
displayName: 'File Description',
|
|
104
|
+
name: 'fileDescription',
|
|
105
|
+
type: 'string',
|
|
106
|
+
displayOptions: {
|
|
107
|
+
show: { resource: ['file'], operation: ['upload'] },
|
|
108
|
+
},
|
|
109
|
+
default: '',
|
|
110
|
+
description: 'Optional description for the file attachment',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
displayName: 'Output Binary Property',
|
|
114
|
+
name: 'outputBinaryProperty',
|
|
115
|
+
type: 'string',
|
|
116
|
+
required: true,
|
|
117
|
+
displayOptions: {
|
|
118
|
+
show: { resource: ['file'], operation: ['download'] },
|
|
119
|
+
},
|
|
120
|
+
default: 'data',
|
|
121
|
+
description: 'The name of the binary property to store the downloaded file',
|
|
122
|
+
},
|
|
123
|
+
];
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFiles = getFiles;
|
|
4
|
+
const priorityApi_1 = require("../../transport/priorityApi");
|
|
5
|
+
async function getFiles(execFns, index, context) {
|
|
6
|
+
const formName = execFns.getNodeParameter('formName', index);
|
|
7
|
+
const recordId = execFns.getNodeParameter('recordId', index);
|
|
8
|
+
const filesSubForm = execFns.getNodeParameter('filesSubForm', index);
|
|
9
|
+
const prefix = context.connectionType === 'router' ? '' : '/api';
|
|
10
|
+
const urlPath = `${prefix}/${formName}('${recordId}')/${filesSubForm}`;
|
|
11
|
+
const response = await (0, priorityApi_1.priorityApiRequest)(execFns, 'GET', urlPath, context);
|
|
12
|
+
if (response.value && Array.isArray(response.value)) {
|
|
13
|
+
return response.value;
|
|
14
|
+
}
|
|
15
|
+
return [response];
|
|
16
|
+
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.download = exports.getFiles = exports.upload = exports.fileFields = exports.fileOperations = void 0;
|
|
4
|
+
var file_properties_1 = require("./file.properties");
|
|
5
|
+
Object.defineProperty(exports, "fileOperations", { enumerable: true, get: function () { return file_properties_1.fileOperations; } });
|
|
6
|
+
Object.defineProperty(exports, "fileFields", { enumerable: true, get: function () { return file_properties_1.fileFields; } });
|
|
7
|
+
var upload_operation_1 = require("./upload.operation");
|
|
8
|
+
Object.defineProperty(exports, "upload", { enumerable: true, get: function () { return upload_operation_1.upload; } });
|
|
9
|
+
var getFiles_operation_1 = require("./getFiles.operation");
|
|
10
|
+
Object.defineProperty(exports, "getFiles", { enumerable: true, get: function () { return getFiles_operation_1.getFiles; } });
|
|
11
|
+
var download_operation_1 = require("./download.operation");
|
|
12
|
+
Object.defineProperty(exports, "download", { enumerable: true, get: function () { return download_operation_1.download; } });
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upload = upload;
|
|
4
|
+
const priorityApi_1 = require("../../transport/priorityApi");
|
|
5
|
+
async function upload(execFns, index, context) {
|
|
6
|
+
const formName = execFns.getNodeParameter('formName', index);
|
|
7
|
+
const recordId = execFns.getNodeParameter('recordId', index);
|
|
8
|
+
const filesSubForm = execFns.getNodeParameter('filesSubForm', index);
|
|
9
|
+
const binaryPropertyName = execFns.getNodeParameter('binaryPropertyName', index);
|
|
10
|
+
const fileName = execFns.getNodeParameter('fileName', index, '');
|
|
11
|
+
const fileDescription = execFns.getNodeParameter('fileDescription', index, '');
|
|
12
|
+
const binaryData = execFns.helpers.assertBinaryData(index, binaryPropertyName);
|
|
13
|
+
const dataBuffer = await execFns.helpers.getBinaryDataBuffer(index, binaryPropertyName);
|
|
14
|
+
const base64Data = dataBuffer.toString('base64');
|
|
15
|
+
const actualFileName = fileName || binaryData.fileName || 'file';
|
|
16
|
+
const body = {
|
|
17
|
+
EXTFILENAME: actualFileName,
|
|
18
|
+
EXTFILEDATA: base64Data,
|
|
19
|
+
};
|
|
20
|
+
if (fileDescription) {
|
|
21
|
+
body.EXTFILEDES = fileDescription;
|
|
22
|
+
}
|
|
23
|
+
const prefix = context.connectionType === 'router' ? '' : '/api';
|
|
24
|
+
const urlPath = `${prefix}/${formName}('${recordId}')/${filesSubForm}`;
|
|
25
|
+
return (0, priorityApi_1.priorityApiRequest)(execFns, 'POST', urlPath, context, body);
|
|
26
|
+
}
|
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activate = activate;
|
|
4
|
+
const priorityApi_1 = require("../../transport/priorityApi");
|
|
5
|
+
function extractKeyFields(execFns, index, paramName) {
|
|
6
|
+
const keyFields = execFns.getNodeParameter(paramName, index);
|
|
7
|
+
const result = {};
|
|
8
|
+
if (keyFields && keyFields.keyValues) {
|
|
9
|
+
const keyValues = keyFields.keyValues;
|
|
10
|
+
if (Array.isArray(keyValues)) {
|
|
11
|
+
for (const kv of keyValues) {
|
|
12
|
+
if (kv.fieldName && kv.fieldValue !== undefined) {
|
|
13
|
+
result[kv.fieldName] = kv.fieldValue;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
async function activate(execFns, index, context) {
|
|
21
|
+
const formName = execFns.getNodeParameter('formName', index);
|
|
22
|
+
const procedureName = execFns.getNodeParameter('procedureName', index);
|
|
23
|
+
const keyFieldsData = extractKeyFields(execFns, index, 'recordKeyFields');
|
|
24
|
+
const credentials = await execFns.getCredentials('priorityErpApi');
|
|
25
|
+
const language = String(credentials.language || 3);
|
|
26
|
+
const body = {
|
|
27
|
+
form: formName,
|
|
28
|
+
activate: procedureName,
|
|
29
|
+
...keyFieldsData,
|
|
30
|
+
run: 1,
|
|
31
|
+
};
|
|
32
|
+
return (0, priorityApi_1.priorityApiRequest)(execFns, 'POST', `/functions?language=${language}`, context, body);
|
|
33
|
+
}
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activateSubForm = activateSubForm;
|
|
4
|
+
const priorityApi_1 = require("../../transport/priorityApi");
|
|
5
|
+
function extractKeyFields(execFns, index, paramName) {
|
|
6
|
+
const keyFields = execFns.getNodeParameter(paramName, index);
|
|
7
|
+
const result = {};
|
|
8
|
+
if (keyFields && keyFields.keyValues) {
|
|
9
|
+
const keyValues = keyFields.keyValues;
|
|
10
|
+
if (Array.isArray(keyValues)) {
|
|
11
|
+
for (const kv of keyValues) {
|
|
12
|
+
if (kv.fieldName && kv.fieldValue !== undefined) {
|
|
13
|
+
result[kv.fieldName] = kv.fieldValue;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
async function activateSubForm(execFns, index, context) {
|
|
21
|
+
const formName = execFns.getNodeParameter('formName', index);
|
|
22
|
+
const procedureName = execFns.getNodeParameter('procedureName', index);
|
|
23
|
+
const subFormName = execFns.getNodeParameter('subFormName', index);
|
|
24
|
+
const keyFieldsData = extractKeyFields(execFns, index, 'recordKeyFields');
|
|
25
|
+
const subKeyFieldsData = extractKeyFields(execFns, index, 'subFormKeyFields');
|
|
26
|
+
const credentials = await execFns.getCredentials('priorityErpApi');
|
|
27
|
+
const language = String(credentials.language || 3);
|
|
28
|
+
const body = {
|
|
29
|
+
form: formName,
|
|
30
|
+
activate: procedureName,
|
|
31
|
+
subform: subFormName,
|
|
32
|
+
...keyFieldsData,
|
|
33
|
+
...subKeyFieldsData,
|
|
34
|
+
run: 6,
|
|
35
|
+
};
|
|
36
|
+
return (0, priorityApi_1.priorityApiRequest)(execFns, 'POST', `/functions?language=${language}`, context, body);
|
|
37
|
+
}
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.activateSubForm = exports.activate = exports.procedureFields = exports.procedureOperations = void 0;
|
|
4
|
+
var procedure_properties_1 = require("./procedure.properties");
|
|
5
|
+
Object.defineProperty(exports, "procedureOperations", { enumerable: true, get: function () { return procedure_properties_1.procedureOperations; } });
|
|
6
|
+
Object.defineProperty(exports, "procedureFields", { enumerable: true, get: function () { return procedure_properties_1.procedureFields; } });
|
|
7
|
+
var activate_operation_1 = require("./activate.operation");
|
|
8
|
+
Object.defineProperty(exports, "activate", { enumerable: true, get: function () { return activate_operation_1.activate; } });
|
|
9
|
+
var activateSubForm_operation_1 = require("./activateSubForm.operation");
|
|
10
|
+
Object.defineProperty(exports, "activateSubForm", { enumerable: true, get: function () { return activateSubForm_operation_1.activateSubForm; } });
|
|
@@ -1 +1,157 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.procedureFields = exports.procedureOperations = void 0;
|
|
4
|
+
exports.procedureOperations = {
|
|
5
|
+
displayName: 'Operation',
|
|
6
|
+
name: 'operation',
|
|
7
|
+
type: 'options',
|
|
8
|
+
noDataExpression: true,
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
resource: ['procedure'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Activate',
|
|
17
|
+
value: 'activate',
|
|
18
|
+
description: 'Activate a procedure on a form',
|
|
19
|
+
action: 'Activate a procedure',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Activate on Sub-Form',
|
|
23
|
+
value: 'activateSubForm',
|
|
24
|
+
description: 'Activate a procedure on a sub-form record',
|
|
25
|
+
action: 'Activate a procedure on a sub form',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
default: 'activate',
|
|
29
|
+
};
|
|
30
|
+
exports.procedureFields = [
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Form Name',
|
|
33
|
+
name: 'formName',
|
|
34
|
+
type: 'options',
|
|
35
|
+
typeOptions: {
|
|
36
|
+
loadOptionsMethod: 'getForms',
|
|
37
|
+
},
|
|
38
|
+
required: true,
|
|
39
|
+
displayOptions: { show: { resource: ['procedure'] } },
|
|
40
|
+
default: '',
|
|
41
|
+
description: 'The form on which to activate the procedure. Switch to expression mode to type manually.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Procedure Name',
|
|
45
|
+
name: 'procedureName',
|
|
46
|
+
type: 'options',
|
|
47
|
+
typeOptions: {
|
|
48
|
+
loadOptionsMethod: 'getProcedures',
|
|
49
|
+
loadOptionsDependsOn: ['formName'],
|
|
50
|
+
},
|
|
51
|
+
required: true,
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
resource: ['procedure'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
default: '',
|
|
58
|
+
description: 'The procedure to activate. Switch to expression mode to type manually.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Record Key Fields',
|
|
62
|
+
name: 'recordKeyFields',
|
|
63
|
+
placeholder: 'Add Key Field',
|
|
64
|
+
type: 'fixedCollection',
|
|
65
|
+
typeOptions: {
|
|
66
|
+
multipleValues: true,
|
|
67
|
+
},
|
|
68
|
+
required: true,
|
|
69
|
+
displayOptions: { show: { resource: ['procedure'] } },
|
|
70
|
+
default: {},
|
|
71
|
+
description: 'The key field(s) to identify the record for the procedure',
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
name: 'keyValues',
|
|
75
|
+
displayName: 'Key Field',
|
|
76
|
+
values: [
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Field Name',
|
|
79
|
+
name: 'fieldName',
|
|
80
|
+
type: 'options',
|
|
81
|
+
typeOptions: {
|
|
82
|
+
loadOptionsMethod: 'getProcedureFields',
|
|
83
|
+
loadOptionsDependsOn: ['formName'],
|
|
84
|
+
},
|
|
85
|
+
default: '',
|
|
86
|
+
description: 'The key field name in Priority. Switch to expression mode to type manually.',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Field Value',
|
|
90
|
+
name: 'fieldValue',
|
|
91
|
+
type: 'string',
|
|
92
|
+
default: '',
|
|
93
|
+
placeholder: 'e.g., SO2300001',
|
|
94
|
+
description: 'The value of the key field',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
displayName: 'Sub-Form Name',
|
|
102
|
+
name: 'subFormName',
|
|
103
|
+
type: 'options',
|
|
104
|
+
typeOptions: {
|
|
105
|
+
loadOptionsMethod: 'getSubForms',
|
|
106
|
+
},
|
|
107
|
+
required: true,
|
|
108
|
+
displayOptions: {
|
|
109
|
+
show: { resource: ['procedure'], operation: ['activateSubForm'] },
|
|
110
|
+
},
|
|
111
|
+
default: '',
|
|
112
|
+
placeholder: 'e.g., ORDERITEMS_SUBFORM',
|
|
113
|
+
description: 'The sub-form name for the procedure',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Sub-Form Key Fields',
|
|
117
|
+
name: 'subFormKeyFields',
|
|
118
|
+
placeholder: 'Add Key Field',
|
|
119
|
+
type: 'fixedCollection',
|
|
120
|
+
typeOptions: {
|
|
121
|
+
multipleValues: true,
|
|
122
|
+
},
|
|
123
|
+
required: true,
|
|
124
|
+
displayOptions: {
|
|
125
|
+
show: { resource: ['procedure'], operation: ['activateSubForm'] },
|
|
126
|
+
},
|
|
127
|
+
default: {},
|
|
128
|
+
description: 'The key field(s) to identify the sub-form record',
|
|
129
|
+
options: [
|
|
130
|
+
{
|
|
131
|
+
name: 'keyValues',
|
|
132
|
+
displayName: 'Key Field',
|
|
133
|
+
values: [
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Field Name',
|
|
136
|
+
name: 'fieldName',
|
|
137
|
+
type: 'options',
|
|
138
|
+
typeOptions: {
|
|
139
|
+
loadOptionsMethod: 'getSubFormProcedureFields',
|
|
140
|
+
loadOptionsDependsOn: ['formName', 'subFormName'],
|
|
141
|
+
},
|
|
142
|
+
default: '',
|
|
143
|
+
description: 'The key field name. Switch to expression mode to type manually.',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
displayName: 'Field Value',
|
|
147
|
+
name: 'fieldValue',
|
|
148
|
+
type: 'string',
|
|
149
|
+
default: '',
|
|
150
|
+
placeholder: 'e.g., 1',
|
|
151
|
+
description: 'The value of the key field',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
];
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.create = create;
|
|
4
|
+
const utils_1 = require("../../helpers/utils");
|
|
5
|
+
const priorityApi_1 = require("../../transport/priorityApi");
|
|
6
|
+
async function create(execFns, index, context) {
|
|
7
|
+
const parentForm = execFns.getNodeParameter('parentForm', index);
|
|
8
|
+
const parentId = execFns.getNodeParameter('parentId', index);
|
|
9
|
+
const subFormName = execFns.getNodeParameter('subFormName', index);
|
|
10
|
+
const fieldsUi = execFns.getNodeParameter('fieldsUi', index);
|
|
11
|
+
const body = (0, utils_1.extractFieldValues)(fieldsUi);
|
|
12
|
+
const prefix = context.connectionType === 'router' ? '' : '/api';
|
|
13
|
+
const urlPath = `${prefix}/${parentForm}('${parentId}')/${subFormName}`;
|
|
14
|
+
return (0, priorityApi_1.priorityApiRequest)(execFns, 'POST', urlPath, context, body);
|
|
15
|
+
}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteSubForm = deleteSubForm;
|
|
4
|
+
const priorityApi_1 = require("../../transport/priorityApi");
|
|
5
|
+
async function deleteSubForm(execFns, index, context) {
|
|
6
|
+
const parentForm = execFns.getNodeParameter('parentForm', index);
|
|
7
|
+
const parentId = execFns.getNodeParameter('parentId', index);
|
|
8
|
+
const subFormName = execFns.getNodeParameter('subFormName', index);
|
|
9
|
+
const subFormId = execFns.getNodeParameter('subFormId', index);
|
|
10
|
+
const prefix = context.connectionType === 'router' ? '' : '/api';
|
|
11
|
+
const urlPath = `${prefix}/${parentForm}('${parentId}')/${subFormName}('${subFormId}')`;
|
|
12
|
+
await (0, priorityApi_1.priorityApiRequest)(execFns, 'DELETE', urlPath, context);
|
|
13
|
+
return { success: true, subFormId };
|
|
14
|
+
}
|