@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.
Files changed (50) hide show
  1. package/.prettierrc +6 -6
  2. package/.vscode/launch.json +23 -23
  3. package/CHANGELOG.md +61 -52
  4. package/README.md +126 -126
  5. package/docker-compose.yml +14 -14
  6. package/examples/example.json +625 -625
  7. package/nodes/SQLQuery.html +179 -179
  8. package/nodes/SQLQuery.js +46 -46
  9. package/nodes/authenticateSap.html +146 -146
  10. package/nodes/authenticateSap.js +129 -129
  11. package/nodes/closeSap.html +128 -97
  12. package/nodes/closeSap.js +36 -36
  13. package/nodes/createSQLQuery.html +165 -165
  14. package/nodes/createSQLQuery.js +70 -70
  15. package/nodes/createSap.html +391 -391
  16. package/nodes/createSap.js +40 -40
  17. package/nodes/crossJoinSap.html +394 -394
  18. package/nodes/crossJoinSap.js +37 -37
  19. package/nodes/deleteSap.html +406 -406
  20. package/nodes/deleteSap.js +35 -35
  21. package/nodes/getSap.html +427 -427
  22. package/nodes/getSap.js +34 -34
  23. package/nodes/listSap.html +402 -402
  24. package/nodes/listSap.js +37 -37
  25. package/nodes/manageErrors.js +38 -38
  26. package/nodes/manipulateEntitySap.html +176 -176
  27. package/nodes/manipulateEntitySap.js +46 -46
  28. package/nodes/nextLink.html +100 -100
  29. package/nodes/nextLink.js +18 -18
  30. package/nodes/patchSap.html +424 -424
  31. package/nodes/patchSap.js +40 -40
  32. package/nodes/serviceSap.html +160 -206
  33. package/nodes/serviceSap.js +39 -39
  34. package/nodes/support.js +363 -363
  35. package/package.json +65 -65
  36. package/resources/entities.json +59 -59
  37. package/resources/services.json +343 -343
  38. package/test/authenticateSap.spec.js +307 -307
  39. package/test/closeSap.spec.js +156 -156
  40. package/test/createSQLQuery.spec.js +174 -174
  41. package/test/createSap.spec.js +183 -183
  42. package/test/crossJoinSap.spec.js +156 -156
  43. package/test/deleteSap.spec.js +156 -156
  44. package/test/getSap.spec.js +156 -156
  45. package/test/listSap.spec.js +156 -156
  46. package/test/manipulateEntitySap.spec.js +191 -191
  47. package/test/patchSap.spec.js +184 -184
  48. package/test/serviceSap.spec.js +170 -170
  49. package/test/support.spec.js +1419 -1419
  50. package/data/.gitkeep +0 -0
@@ -1,35 +1,35 @@
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 DeleteSapNode(config) {
8
- RED.nodes.createNode(this, config);
9
- const node = this;
10
-
11
- // reset status
12
- node.status({});
13
-
14
- node.on('input', async (msg, send, done) => {
15
- // reset status
16
- node.status({});
17
-
18
- try {
19
- const options = { method: 'DELETE', hasRawQuery: true, hasEntityId: true, data: {} };
20
- const login = Support.login;
21
- const result = await Support.sendRequest({ node, msg, config, axios, login, options });
22
- msg.payload = VerifyErrorSL(node, msg, result.data, true );// result.data;
23
- msg.statusCode = result.status;
24
- if(result.status <= 205) {
25
- node.status({ fill: 'green', shape: 'dot', text: 'success' });
26
- node.send(msg);
27
- }
28
- } catch (error) {
29
- node.status({ fill: 'red', shape: 'dot', text: 'Error' });
30
- done(error);
31
- }
32
- });
33
- }
34
- RED.nodes.registerType('deleteSap', DeleteSapNode, {});
35
- };
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 DeleteSapNode(config) {
8
+ RED.nodes.createNode(this, config);
9
+ const node = this;
10
+
11
+ // reset status
12
+ node.status({});
13
+
14
+ node.on('input', async (msg, send, done) => {
15
+ // reset status
16
+ node.status({});
17
+
18
+ try {
19
+ const options = { method: 'DELETE', hasRawQuery: true, hasEntityId: true, data: {} };
20
+ const login = Support.login;
21
+ const result = await Support.sendRequest({ node, msg, config, axios, login, options });
22
+ msg.payload = VerifyErrorSL(node, msg, result.data, true );// result.data;
23
+ msg.statusCode = result.status;
24
+ if(result.status <= 205) {
25
+ node.status({ fill: 'green', shape: 'dot', text: 'success' });
26
+ node.send(msg);
27
+ }
28
+ } catch (error) {
29
+ node.status({ fill: 'red', shape: 'dot', text: 'Error' });
30
+ done(error);
31
+ }
32
+ });
33
+ }
34
+ RED.nodes.registerType('deleteSap', DeleteSapNode, {});
35
+ };