@yousolution/node-red-contrib-you-sap-service-layer 0.2.2 → 0.2.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/.prettierrc +6 -6
- package/.vscode/launch.json +23 -23
- package/CHANGELOG.md +61 -52
- package/README.md +126 -126
- package/docker-compose.yml +14 -14
- package/examples/example.json +625 -625
- package/nodes/SQLQuery.html +179 -179
- package/nodes/SQLQuery.js +46 -46
- package/nodes/authenticateSap.html +146 -146
- package/nodes/authenticateSap.js +129 -129
- package/nodes/closeSap.html +128 -97
- package/nodes/closeSap.js +36 -36
- package/nodes/createSQLQuery.html +165 -165
- package/nodes/createSQLQuery.js +70 -70
- package/nodes/createSap.html +391 -391
- package/nodes/createSap.js +40 -40
- package/nodes/crossJoinSap.html +394 -394
- package/nodes/crossJoinSap.js +37 -37
- package/nodes/deleteSap.html +406 -406
- package/nodes/deleteSap.js +35 -35
- package/nodes/getSap.html +427 -427
- package/nodes/getSap.js +34 -34
- package/nodes/listSap.html +402 -402
- package/nodes/listSap.js +37 -37
- package/nodes/manageErrors.js +38 -38
- package/nodes/manipulateEntitySap.html +176 -176
- package/nodes/manipulateEntitySap.js +46 -46
- package/nodes/nextLink.html +100 -100
- package/nodes/nextLink.js +18 -18
- package/nodes/patchSap.html +424 -424
- package/nodes/patchSap.js +40 -40
- package/nodes/serviceSap.html +160 -206
- package/nodes/serviceSap.js +39 -39
- package/nodes/support.js +363 -363
- package/package.json +65 -65
- package/resources/entities.json +59 -59
- package/resources/services.json +343 -343
- package/test/authenticateSap.spec.js +307 -307
- package/test/closeSap.spec.js +156 -156
- package/test/createSQLQuery.spec.js +174 -174
- package/test/createSap.spec.js +183 -183
- package/test/crossJoinSap.spec.js +156 -156
- package/test/deleteSap.spec.js +156 -156
- package/test/getSap.spec.js +156 -156
- package/test/listSap.spec.js +156 -156
- package/test/manipulateEntitySap.spec.js +191 -191
- package/test/patchSap.spec.js +184 -184
- package/test/serviceSap.spec.js +170 -170
- package/test/support.spec.js +1419 -1419
- package/data/.gitkeep +0 -0
package/nodes/createSap.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
2
|
-
const axios = require('axios');
|
|
3
|
-
const Support = require('./support');
|
|
4
|
-
const { VerifyErrorSL } = require('./manageErrors');
|
|
5
|
-
|
|
6
|
-
module.exports = function (RED) {
|
|
7
|
-
function CreateSapNode(config) {
|
|
8
|
-
RED.nodes.createNode(this, config);
|
|
9
|
-
const node = this;
|
|
10
|
-
// reset status
|
|
11
|
-
node.status({});
|
|
12
|
-
|
|
13
|
-
node.on('input', async (msg, send, done) => {
|
|
14
|
-
// reset status
|
|
15
|
-
node.status({});
|
|
16
|
-
try {
|
|
17
|
-
let data = msg[config.bodyPost];
|
|
18
|
-
if (!data) {
|
|
19
|
-
node.status({ fill: 'red', shape: 'dot', text: 'bodyPost must have value' });
|
|
20
|
-
done(new Error('bodyPost must have value'));
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const options = { method: 'POST', hasRawQuery: false, data: data };
|
|
24
|
-
const login = Support.login;
|
|
25
|
-
const result = await Support.sendRequest({ node, msg, config, axios, login, options });
|
|
26
|
-
msg.payload =VerifyErrorSL(node, msg, result.data);// result.data;
|
|
27
|
-
msg.statusCode = result.status;
|
|
28
|
-
if(msg.payload) {
|
|
29
|
-
node.status({ fill: 'green', shape: 'dot', text: 'success' });
|
|
30
|
-
node.send(msg);
|
|
31
|
-
}
|
|
32
|
-
} catch (error) {
|
|
33
|
-
node.status({ fill: 'red', shape: 'dot', text: 'Error' });
|
|
34
|
-
//node.error(error, msg);
|
|
35
|
-
// done(error);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
RED.nodes.registerType('createSap', CreateSapNode, {});
|
|
40
|
-
};
|
|
1
|
+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
2
|
+
const axios = require('axios');
|
|
3
|
+
const Support = require('./support');
|
|
4
|
+
const { VerifyErrorSL } = require('./manageErrors');
|
|
5
|
+
|
|
6
|
+
module.exports = function (RED) {
|
|
7
|
+
function CreateSapNode(config) {
|
|
8
|
+
RED.nodes.createNode(this, config);
|
|
9
|
+
const node = this;
|
|
10
|
+
// reset status
|
|
11
|
+
node.status({});
|
|
12
|
+
|
|
13
|
+
node.on('input', async (msg, send, done) => {
|
|
14
|
+
// reset status
|
|
15
|
+
node.status({});
|
|
16
|
+
try {
|
|
17
|
+
let data = msg[config.bodyPost];
|
|
18
|
+
if (!data) {
|
|
19
|
+
node.status({ fill: 'red', shape: 'dot', text: 'bodyPost must have value' });
|
|
20
|
+
done(new Error('bodyPost must have value'));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const options = { method: 'POST', hasRawQuery: false, data: data };
|
|
24
|
+
const login = Support.login;
|
|
25
|
+
const result = await Support.sendRequest({ node, msg, config, axios, login, options });
|
|
26
|
+
msg.payload =VerifyErrorSL(node, msg, result.data);// result.data;
|
|
27
|
+
msg.statusCode = result.status;
|
|
28
|
+
if(msg.payload) {
|
|
29
|
+
node.status({ fill: 'green', shape: 'dot', text: 'success' });
|
|
30
|
+
node.send(msg);
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
node.status({ fill: 'red', shape: 'dot', text: 'Error' });
|
|
34
|
+
//node.error(error, msg);
|
|
35
|
+
// done(error);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
RED.nodes.registerType('createSap', CreateSapNode, {});
|
|
40
|
+
};
|