@yousolution/node-red-contrib-you-sap-service-layer 0.2.1 → 0.2.3
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 -0
- package/.vscode/launch.json +23 -23
- package/CHANGELOG.md +57 -49
- 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 -407
- package/nodes/deleteSap.js +35 -35
- package/nodes/getSap.html +427 -445
- 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 -434
- package/nodes/patchSap.js +40 -40
- package/nodes/serviceSap.html +206 -206
- package/nodes/serviceSap.js +39 -44
- 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/nodes/getSap.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
2
|
-
const axios = require('axios');
|
|
3
|
-
const Support = require('./support');
|
|
4
|
-
const { VerifyErrorSL } = require('./manageErrors');
|
|
5
|
-
// const buildQuery = require('odata-query').default;
|
|
6
|
-
|
|
7
|
-
module.exports = function (RED) {
|
|
8
|
-
function GetSapNode(config) {
|
|
9
|
-
RED.nodes.createNode(this, config);
|
|
10
|
-
const node = this;
|
|
11
|
-
// reset status
|
|
12
|
-
node.status({});
|
|
13
|
-
|
|
14
|
-
node.on('input', async (msg, send, done) => {
|
|
15
|
-
// reset status
|
|
16
|
-
node.status({});
|
|
17
|
-
try {
|
|
18
|
-
const options = { method: 'GET', hasRawQuery: true, hasEntityId: true };
|
|
19
|
-
const login = Support.login;
|
|
20
|
-
const result = await Support.sendRequest({ node, msg, config, axios, login, options });
|
|
21
|
-
msg.payload = VerifyErrorSL(node, msg, result.data);//result.data;
|
|
22
|
-
msg.statusCode = result.status;
|
|
23
|
-
if(msg.payload) {
|
|
24
|
-
node.status({ fill: 'green', shape: 'dot', text: 'success' });
|
|
25
|
-
node.send(msg);
|
|
26
|
-
}
|
|
27
|
-
} catch (error) {
|
|
28
|
-
node.status({ fill: 'red', shape: 'dot', text: 'Error' });
|
|
29
|
-
done(error);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
RED.nodes.registerType('getSap', GetSapNode, {});
|
|
34
|
-
};
|
|
1
|
+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
|
2
|
+
const axios = require('axios');
|
|
3
|
+
const Support = require('./support');
|
|
4
|
+
const { VerifyErrorSL } = require('./manageErrors');
|
|
5
|
+
// const buildQuery = require('odata-query').default;
|
|
6
|
+
|
|
7
|
+
module.exports = function (RED) {
|
|
8
|
+
function GetSapNode(config) {
|
|
9
|
+
RED.nodes.createNode(this, config);
|
|
10
|
+
const node = this;
|
|
11
|
+
// reset status
|
|
12
|
+
node.status({});
|
|
13
|
+
|
|
14
|
+
node.on('input', async (msg, send, done) => {
|
|
15
|
+
// reset status
|
|
16
|
+
node.status({});
|
|
17
|
+
try {
|
|
18
|
+
const options = { method: 'GET', hasRawQuery: true, hasEntityId: true };
|
|
19
|
+
const login = Support.login;
|
|
20
|
+
const result = await Support.sendRequest({ node, msg, config, axios, login, options });
|
|
21
|
+
msg.payload = VerifyErrorSL(node, msg, result.data);//result.data;
|
|
22
|
+
msg.statusCode = result.status;
|
|
23
|
+
if(msg.payload) {
|
|
24
|
+
node.status({ fill: 'green', shape: 'dot', text: 'success' });
|
|
25
|
+
node.send(msg);
|
|
26
|
+
}
|
|
27
|
+
} catch (error) {
|
|
28
|
+
node.status({ fill: 'red', shape: 'dot', text: 'Error' });
|
|
29
|
+
done(error);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
RED.nodes.registerType('getSap', GetSapNode, {});
|
|
34
|
+
};
|