@yousolution/node-red-contrib-you-sap-service-layer 0.2.8 → 0.2.10
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/CHANGELOG.md +8 -0
- package/nodes/authenticateSap.js +9 -1
- package/nodes/createSap.html +1 -0
- package/nodes/deleteSap.html +53 -2
- package/nodes/getSap.html +50 -2
- package/nodes/listSap.html +1 -0
- package/nodes/patchSap.html +49 -1
- package/nodes/support.js +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
# [0.2.10] - 2025-03-20
|
|
6
|
+
|
|
7
|
+
- Add Manage AlternateCatNum on LayerOne2SL Get / List / Create / Delete / Update
|
|
8
|
+
|
|
9
|
+
# [0.2.9] - 2025-02-19
|
|
10
|
+
|
|
11
|
+
- Added Manage Dynamic User on Autentication Service Layer
|
|
12
|
+
|
|
5
13
|
# [0.2.8] - 2025-01-22
|
|
6
14
|
|
|
7
15
|
- Added error handling configuration from library or manual on ServiceSAP Node
|
package/nodes/authenticateSap.js
CHANGED
|
@@ -50,9 +50,17 @@ module.exports = function (RED) {
|
|
|
50
50
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
//If User setted from msg
|
|
54
55
|
if (node.credentials.userType == 'msg') {
|
|
55
56
|
const user = msg[node.credentials.user];
|
|
57
|
+
let currentUser = globalContext.get(`_YOU_SapServiceLayer_${node.id}.credentials.UserName`);
|
|
58
|
+
|
|
59
|
+
if(user !== currentUser) {
|
|
60
|
+
console.log('Reset User');
|
|
61
|
+
globalContext.set(`_YOU_SapServiceLayer_${node.id}.headers`, null);
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
globalContext.set(`_YOU_SapServiceLayer_${node.id}.credentials.UserName`, user);
|
|
57
65
|
}
|
|
58
66
|
|
package/nodes/createSap.html
CHANGED
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
<option value="AssetTransfer">AssetTransfer</option>
|
|
86
86
|
<option value="Attachments2">Attachments2</option>
|
|
87
87
|
<option value="AttributeGroups">AttributeGroups</option>
|
|
88
|
+
<option value="AlternateCatNum">AlternateCatNum</option>
|
|
88
89
|
<option value="BankChargesAllocationCodes">BankChargesAllocationCodes</option>
|
|
89
90
|
<option value="Banks">Banks</option>
|
|
90
91
|
<option value="BankStatements">BankStatements</option>
|
package/nodes/deleteSap.html
CHANGED
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
entity: { value: '' },
|
|
8
8
|
udo: { value: '' },
|
|
9
9
|
udt: { value: '' },
|
|
10
|
-
entityId: { value: '' },
|
|
10
|
+
entityId: { value: '', validate: (v) => true },
|
|
11
11
|
docEntry: { value: '', validate: (v) => true },
|
|
12
12
|
code: { value: '', validate: (v) => true },
|
|
13
13
|
headers: { value: '' },
|
|
14
|
+
AlternateCatNumItemId: { value: '', validate: (v) => true },
|
|
15
|
+
AlternateCatNumCardCodeId: { value: '', validate: (v) => true },
|
|
16
|
+
AlternateCatNumSubstituteId: { value: '', validate: (v) => true },
|
|
14
17
|
},
|
|
15
18
|
inputs: 1,
|
|
16
19
|
outputs: 1,
|
|
@@ -26,6 +29,27 @@
|
|
|
26
29
|
value: 'entityId',
|
|
27
30
|
});
|
|
28
31
|
|
|
32
|
+
$('#node-input-AlternateCatNumItemId').typedInput({
|
|
33
|
+
type: 'msg',
|
|
34
|
+
types: ['msg'],
|
|
35
|
+
typeField: '#node-input-AlternateCatNumItemId-type',
|
|
36
|
+
value: 'AlternateCatNumItemId',
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
$('#node-input-AlternateCatNumCardCodeId').typedInput({
|
|
40
|
+
type: 'msg',
|
|
41
|
+
types: ['msg'],
|
|
42
|
+
typeField: '#node-input-AlternateCatNumCardCodeId-type',
|
|
43
|
+
value: 'AlternateCatNumCardCodeId',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
$('#node-input-AlternateCatNumSubstituteId').typedInput({
|
|
47
|
+
type: 'msg',
|
|
48
|
+
types: ['msg'],
|
|
49
|
+
typeField: '#node-input-AlternateCatNumSubstituteId-type',
|
|
50
|
+
value: 'AlternateCatNumSubstituteId',
|
|
51
|
+
});
|
|
52
|
+
|
|
29
53
|
$('#node-input-docEntry').typedInput({
|
|
30
54
|
type: 'msg',
|
|
31
55
|
types: ['msg'],
|
|
@@ -55,7 +79,15 @@
|
|
|
55
79
|
jQuery('#container-udt').show();
|
|
56
80
|
jQuery('#container-code').show();
|
|
57
81
|
}
|
|
58
|
-
if (jQuery(this).val()
|
|
82
|
+
if (jQuery(this).val() === 'AlternateCatNum') {
|
|
83
|
+
jQuery('#container-AlternateCatNumItemId').show();
|
|
84
|
+
jQuery('#container-AlternateCatNumCardCodeId').show();
|
|
85
|
+
jQuery('#container-AlternateCatNumSubstituteId').show();
|
|
86
|
+
}
|
|
87
|
+
if (
|
|
88
|
+
jQuery(this).val() !== 'UDO' ||
|
|
89
|
+
(jQuery(this).val() !== 'UDT' && jQuery(this).val() !== 'AlternateCatNum')
|
|
90
|
+
) {
|
|
59
91
|
jQuery('#container-entityId').hide();
|
|
60
92
|
}
|
|
61
93
|
});
|
|
@@ -90,6 +122,7 @@
|
|
|
90
122
|
<option value="AssetTransfer">AssetTransfer</option>
|
|
91
123
|
<option value="Attachments2">Attachments2</option>
|
|
92
124
|
<option value="AttributeGroups">AttributeGroups</option>
|
|
125
|
+
<option value="AlternateCatNum">AlternateCatNum</option>
|
|
93
126
|
<option value="BankChargesAllocationCodes">BankChargesAllocationCodes</option>
|
|
94
127
|
<option value="Banks">Banks</option>
|
|
95
128
|
<option value="BankStatements">BankStatements</option>
|
|
@@ -285,6 +318,24 @@
|
|
|
285
318
|
<input type="text" id="node-input-udt" placeholder="UDT Name" />
|
|
286
319
|
</div>
|
|
287
320
|
|
|
321
|
+
<!-- Init Section for Manage Special Case AlternateCatNum-->
|
|
322
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumItemId">
|
|
323
|
+
<label for="node-input-type"><i class="fa fa-key"></i> ItemCode</label>
|
|
324
|
+
<input type="text" id="node-input-AlternateCatNumItemId" />
|
|
325
|
+
<input type="hidden" id="node-input-AlternateCatNumItemId-type" />
|
|
326
|
+
</div>
|
|
327
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumCardCodeId">
|
|
328
|
+
<label for="node-input-type"><i class="fa fa-key"></i> CardCode</label>
|
|
329
|
+
<input type="text" id="node-input-AlternateCatNumCardCodeId" />
|
|
330
|
+
<input type="hidden" id="node-input-AlternateCatNumCardCodeId-type" />
|
|
331
|
+
</div>
|
|
332
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumSubstituteId">
|
|
333
|
+
<label for="node-input-type"><i class="fa fa-key"></i> Substitute</label>
|
|
334
|
+
<input type="text" id="node-input-AlternateCatNumSubstituteId" />
|
|
335
|
+
<input type="hidden" id="node-input-AlternateCatNumSubstituteId-type" />
|
|
336
|
+
</div>
|
|
337
|
+
<!-- End Section for Manage Special Case AlternateCatNum-->
|
|
338
|
+
|
|
288
339
|
<div class="form-row" style="display:none" id="container-entityId">
|
|
289
340
|
<label for="node-input-type"><i class="fa fa-key"></i> EntityId</label>
|
|
290
341
|
<input type="text" id="node-input-entityId" />
|
package/nodes/getSap.html
CHANGED
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
entity: { value: '' },
|
|
8
8
|
udo: { value: '' },
|
|
9
9
|
udt: { value: '' },
|
|
10
|
-
entityId:
|
|
10
|
+
entityId: { value: '', validate: (v) => true },
|
|
11
11
|
docEntry: { value: '', validate: (v) => true },
|
|
12
12
|
code: { value: '', validate: (v) => true },
|
|
13
13
|
headers: { value: '' },
|
|
14
14
|
query: { value: 'query={};' },
|
|
15
|
+
AlternateCatNumItemId: { value: '', validate: (v) => true },
|
|
16
|
+
AlternateCatNumCardCodeId: { value: '', validate: (v) => true },
|
|
17
|
+
AlternateCatNumSubstituteId: { value: '', validate: (v) => true },
|
|
15
18
|
},
|
|
16
19
|
inputs: 1,
|
|
17
20
|
outputs: 1,
|
|
@@ -27,6 +30,27 @@
|
|
|
27
30
|
value: 'entityId',
|
|
28
31
|
});
|
|
29
32
|
|
|
33
|
+
$('#node-input-AlternateCatNumItemId').typedInput({
|
|
34
|
+
type: 'msg',
|
|
35
|
+
types: ['msg'],
|
|
36
|
+
typeField: '#node-input-AlternateCatNumItemId-type',
|
|
37
|
+
value: 'AlternateCatNumItemId',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
$('#node-input-AlternateCatNumCardCodeId').typedInput({
|
|
41
|
+
type: 'msg',
|
|
42
|
+
types: ['msg'],
|
|
43
|
+
typeField: '#node-input-AlternateCatNumCardCodeId-type',
|
|
44
|
+
value: 'AlternateCatNumCardCodeId',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
$('#node-input-AlternateCatNumSubstituteId').typedInput({
|
|
48
|
+
type: 'msg',
|
|
49
|
+
types: ['msg'],
|
|
50
|
+
typeField: '#node-input-AlternateCatNumSubstituteId-type',
|
|
51
|
+
value: 'AlternateCatNumSubstituteId',
|
|
52
|
+
});
|
|
53
|
+
|
|
30
54
|
$('#node-input-docEntry').typedInput({
|
|
31
55
|
type: 'msg',
|
|
32
56
|
types: ['msg'],
|
|
@@ -69,7 +93,12 @@
|
|
|
69
93
|
jQuery('#container-udt').show();
|
|
70
94
|
jQuery('#container-code').show();
|
|
71
95
|
}
|
|
72
|
-
if (jQuery(this).val()
|
|
96
|
+
if (jQuery(this).val() === 'AlternateCatNum') {
|
|
97
|
+
jQuery('#container-AlternateCatNumItemId').show();
|
|
98
|
+
jQuery('#container-AlternateCatNumCardCodeId').show();
|
|
99
|
+
jQuery('#container-AlternateCatNumSubstituteId').show();
|
|
100
|
+
}
|
|
101
|
+
if (jQuery(this).val() !== 'UDO' && jQuery(this).val() !== 'UDT' && jQuery(this).val() !== 'AlternateCatNum') {
|
|
73
102
|
jQuery('#container-entityId').show();
|
|
74
103
|
}
|
|
75
104
|
});
|
|
@@ -118,6 +147,7 @@
|
|
|
118
147
|
<option value="AssetTransfer">AssetTransfer</option>
|
|
119
148
|
<option value="Attachments2">Attachments2</option>
|
|
120
149
|
<option value="AttributeGroups">AttributeGroups</option>
|
|
150
|
+
<option value="AlternateCatNum">AlternateCatNum</option>
|
|
121
151
|
<option value="BankChargesAllocationCodes">BankChargesAllocationCodes</option>
|
|
122
152
|
<option value="Banks">Banks</option>
|
|
123
153
|
<option value="BankStatements">BankStatements</option>
|
|
@@ -365,6 +395,24 @@
|
|
|
365
395
|
<input type="hidden" id="node-input-entityId-type" />
|
|
366
396
|
</div>
|
|
367
397
|
|
|
398
|
+
<!-- Init Section for Manage Special Case AlternateCatNum-->
|
|
399
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumItemId">
|
|
400
|
+
<label for="node-input-type"><i class="fa fa-key"></i> ItemCode</label>
|
|
401
|
+
<input type="text" id="node-input-AlternateCatNumItemId" />
|
|
402
|
+
<input type="hidden" id="node-input-AlternateCatNumItemId-type" />
|
|
403
|
+
</div>
|
|
404
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumCardCodeId">
|
|
405
|
+
<label for="node-input-type"><i class="fa fa-key"></i> CardCode</label>
|
|
406
|
+
<input type="text" id="node-input-AlternateCatNumCardCodeId" />
|
|
407
|
+
<input type="hidden" id="node-input-AlternateCatNumCardCodeId-type" />
|
|
408
|
+
</div>
|
|
409
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumSubstituteId">
|
|
410
|
+
<label for="node-input-type"><i class="fa fa-key"></i> Substitute</label>
|
|
411
|
+
<input type="text" id="node-input-AlternateCatNumSubstituteId" />
|
|
412
|
+
<input type="hidden" id="node-input-AlternateCatNumSubstituteId-type" />
|
|
413
|
+
</div>
|
|
414
|
+
<!-- End Section for Manage Special Case AlternateCatNum-->
|
|
415
|
+
|
|
368
416
|
<div class="form-row" style="display:none" id="container-docEntry">
|
|
369
417
|
<label for="node-input-type"><i class="fa fa-key"></i> DocEntry</label>
|
|
370
418
|
<input type="text" id="node-input-docEntry" />
|
package/nodes/listSap.html
CHANGED
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
<option value="AssetTransfer">AssetTransfer</option>
|
|
109
109
|
<option value="Attachments2">Attachments2</option>
|
|
110
110
|
<option value="AttributeGroups">AttributeGroups</option>
|
|
111
|
+
<option value="AlternateCatNum">AlternateCatNum</option>
|
|
111
112
|
<option value="BankChargesAllocationCodes">BankChargesAllocationCodes</option>
|
|
112
113
|
<option value="Banks">Banks</option>
|
|
113
114
|
<option value="BankStatements">BankStatements</option>
|
package/nodes/patchSap.html
CHANGED
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
headers: { value: '' },
|
|
21
21
|
bodyPatch: { value: '' },
|
|
22
|
+
AlternateCatNumItemId: { value: '', validate: (v) => true },
|
|
23
|
+
AlternateCatNumCardCodeId: { value: '', validate: (v) => true },
|
|
24
|
+
AlternateCatNumSubstituteId: { value: '', validate: (v) => true },
|
|
22
25
|
},
|
|
23
26
|
inputs: 1,
|
|
24
27
|
outputs: 1,
|
|
@@ -41,6 +44,27 @@
|
|
|
41
44
|
value: 'docEntry',
|
|
42
45
|
});
|
|
43
46
|
|
|
47
|
+
$('#node-input-AlternateCatNumItemId').typedInput({
|
|
48
|
+
type: 'msg',
|
|
49
|
+
types: ['msg'],
|
|
50
|
+
typeField: '#node-input-AlternateCatNumItemId-type',
|
|
51
|
+
value: 'AlternateCatNumItemId',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
$('#node-input-AlternateCatNumCardCodeId').typedInput({
|
|
55
|
+
type: 'msg',
|
|
56
|
+
types: ['msg'],
|
|
57
|
+
typeField: '#node-input-AlternateCatNumCardCodeId-type',
|
|
58
|
+
value: 'AlternateCatNumCardCodeId',
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
$('#node-input-AlternateCatNumSubstituteId').typedInput({
|
|
62
|
+
type: 'msg',
|
|
63
|
+
types: ['msg'],
|
|
64
|
+
typeField: '#node-input-AlternateCatNumSubstituteId-type',
|
|
65
|
+
value: 'AlternateCatNumSubstituteId',
|
|
66
|
+
});
|
|
67
|
+
|
|
44
68
|
$('#node-input-code').typedInput({
|
|
45
69
|
type: 'msg',
|
|
46
70
|
types: ['msg'],
|
|
@@ -77,7 +101,12 @@
|
|
|
77
101
|
jQuery('#container-udt').show();
|
|
78
102
|
jQuery('#container-code').show();
|
|
79
103
|
}
|
|
80
|
-
if (jQuery(this).val()
|
|
104
|
+
if (jQuery(this).val() === 'AlternateCatNum') {
|
|
105
|
+
jQuery('#container-AlternateCatNumItemId').show();
|
|
106
|
+
jQuery('#container-AlternateCatNumCardCodeId').show();
|
|
107
|
+
jQuery('#container-AlternateCatNumSubstituteId').show();
|
|
108
|
+
}
|
|
109
|
+
if (jQuery(this).val() !== 'UDO' && jQuery(this).val() !== 'UDT' && jQuery(this).val() !== 'AlternateCatNum') {
|
|
81
110
|
jQuery('#container-entityId').show();
|
|
82
111
|
}
|
|
83
112
|
});
|
|
@@ -125,6 +154,7 @@
|
|
|
125
154
|
<option value="AssetTransfer">AssetTransfer</option>
|
|
126
155
|
<option value="Attachments2">Attachments2</option>
|
|
127
156
|
<option value="AttributeGroups">AttributeGroups</option>
|
|
157
|
+
<option value="AlternateCatNum">AlternateCatNum</option>
|
|
128
158
|
<option value="BankChargesAllocationCodes">BankChargesAllocationCodes</option>
|
|
129
159
|
<option value="Banks">Banks</option>
|
|
130
160
|
<option value="BankStatements">BankStatements</option>
|
|
@@ -361,6 +391,24 @@
|
|
|
361
391
|
<input type="hidden" id="node-input-entityId-type" />
|
|
362
392
|
</div>
|
|
363
393
|
|
|
394
|
+
<!-- Init Section for Manage Special Case AlternateCatNum-->
|
|
395
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumItemId">
|
|
396
|
+
<label for="node-input-type"><i class="fa fa-key"></i> ItemCode</label>
|
|
397
|
+
<input type="text" id="node-input-AlternateCatNumItemId" />
|
|
398
|
+
<input type="hidden" id="node-input-AlternateCatNumItemId-type" />
|
|
399
|
+
</div>
|
|
400
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumCardCodeId">
|
|
401
|
+
<label for="node-input-type"><i class="fa fa-key"></i> CardCode</label>
|
|
402
|
+
<input type="text" id="node-input-AlternateCatNumCardCodeId" />
|
|
403
|
+
<input type="hidden" id="node-input-AlternateCatNumCardCodeId-type" />
|
|
404
|
+
</div>
|
|
405
|
+
<div class="form-row" style="display:none" id="container-AlternateCatNumSubstituteId">
|
|
406
|
+
<label for="node-input-type"><i class="fa fa-key"></i> Substitute</label>
|
|
407
|
+
<input type="text" id="node-input-AlternateCatNumSubstituteId" />
|
|
408
|
+
<input type="hidden" id="node-input-AlternateCatNumSubstituteId-type" />
|
|
409
|
+
</div>
|
|
410
|
+
<!-- End Section for Manage Special Case AlternateCatNum-->
|
|
411
|
+
|
|
364
412
|
<div class="form-row" style="display:none" id="container-docEntry">
|
|
365
413
|
<label for="node-input-type"><i class="fa fa-gears"></i> DocEntry</label>
|
|
366
414
|
<input type="text" id="node-input-docEntry" placeholder="DocEntry" />
|
package/nodes/support.js
CHANGED
|
@@ -245,6 +245,9 @@ function generateRequest(node, msg, config, options) {
|
|
|
245
245
|
|
|
246
246
|
if (options.hasEntityId) {
|
|
247
247
|
let entityId = msg[config.entityId];
|
|
248
|
+
if (!entityId && config.entity != 'UDO' && config.entity != 'UDT' && config.entity != 'AlternateCatNum') {
|
|
249
|
+
throw new Error('Missing entityId');
|
|
250
|
+
}
|
|
248
251
|
if (!entityId && config.entity != 'UDO' && config.entity != 'UDT') {
|
|
249
252
|
throw new Error('Missing entityId');
|
|
250
253
|
}
|
|
@@ -265,7 +268,14 @@ function generateRequest(node, msg, config, options) {
|
|
|
265
268
|
}
|
|
266
269
|
|
|
267
270
|
if (thickIdApi.includes(entity) || config.entity === 'UDT') {
|
|
268
|
-
if(
|
|
271
|
+
if(entity === 'AlternateCatNum') { // Manage Special Case AlternateCatNum
|
|
272
|
+
let ItemCode = msg[config.AlternateCatNumItemId];
|
|
273
|
+
let CardCode = msg[config.AlternateCatNumCardCodeId];
|
|
274
|
+
let Substitute = msg[config.AlternateCatNumSubstituteId]
|
|
275
|
+
url = `https://${host}:${port}/b1s/${version}/${entity}(ItemCode='${ItemCode}', CardCode='${CardCode}', Substitute='${Substitute}')`;
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
else if(Number.isInteger(entityId)){
|
|
269
279
|
url = `https://${host}:${port}/b1s/${version}/${entity}(${entityId})`;
|
|
270
280
|
}
|
|
271
281
|
else {
|