@yousolution/node-red-contrib-you-sap-service-layer 0.2.2 → 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 -6
- package/.vscode/launch.json +23 -23
- package/CHANGELOG.md +57 -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 +206 -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/.prettierrc
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"useTabs":false,
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"printWidth": 120
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"singleQuote": true,
|
|
3
|
+
"useTabs":false,
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"printWidth": 120
|
|
6
|
+
}
|
package/.vscode/launch.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.0",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"args": [
|
|
6
|
-
"-u",
|
|
7
|
-
"tdd",
|
|
8
|
-
"--timeout",
|
|
9
|
-
"999999",
|
|
10
|
-
"--colors",
|
|
11
|
-
"${workspaceFolder}/test"
|
|
12
|
-
],
|
|
13
|
-
"internalConsoleOptions": "openOnSessionStart",
|
|
14
|
-
"name": "Mocha Tests",
|
|
15
|
-
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
|
|
16
|
-
"request": "launch",
|
|
17
|
-
"skipFiles": [
|
|
18
|
-
"<node_internals>/**"
|
|
19
|
-
],
|
|
20
|
-
"type": "pwa-node"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"args": [
|
|
6
|
+
"-u",
|
|
7
|
+
"tdd",
|
|
8
|
+
"--timeout",
|
|
9
|
+
"999999",
|
|
10
|
+
"--colors",
|
|
11
|
+
"${workspaceFolder}/test"
|
|
12
|
+
],
|
|
13
|
+
"internalConsoleOptions": "openOnSessionStart",
|
|
14
|
+
"name": "Mocha Tests",
|
|
15
|
+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
|
|
16
|
+
"request": "launch",
|
|
17
|
+
"skipFiles": [
|
|
18
|
+
"<node_internals>/**"
|
|
19
|
+
],
|
|
20
|
+
"type": "pwa-node"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,52 +1,57 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- We have
|
|
18
|
-
- We
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
# [0.0.
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
# [0.0.
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
# [0.2.3] - 2024-11-01
|
|
6
|
+
|
|
7
|
+
- Upgrade List on CloseSap Node
|
|
8
|
+
|
|
9
|
+
# [0.2.2] - 2024-10-23
|
|
10
|
+
|
|
11
|
+
- Fix compatibility node-RED > 3.1.0
|
|
12
|
+
|
|
13
|
+
# [0.2.0] - 2024-06-19
|
|
14
|
+
|
|
15
|
+
> *Warning Breaking Change!* please make backups of flows and try in test environment before upgrading
|
|
16
|
+
|
|
17
|
+
- We have improved the management of login token expiration
|
|
18
|
+
- We have updated the manage dynamic login on AUTH Request
|
|
19
|
+
- We have updated the result handling in PATCH request
|
|
20
|
+
- We have resolved an error send Entry on UDT PATCH request
|
|
21
|
+
- We have updated the result handling in SERVICE request
|
|
22
|
+
- We have updated the error parsing function
|
|
23
|
+
- We Add Service "OrdersService_Preview" on SERVICE
|
|
24
|
+
- Bug Fix
|
|
25
|
+
- Library Axios & Odata Updated
|
|
26
|
+
|
|
27
|
+
# [0.1.1] - 2022-12-09
|
|
28
|
+
|
|
29
|
+
- Added label output to nextLink block
|
|
30
|
+
- Fix authentication for subflows compatibility
|
|
31
|
+
- Bug fix
|
|
32
|
+
|
|
33
|
+
# [0.1.0] - 2022-07-28
|
|
34
|
+
|
|
35
|
+
- Added sqlQuery node to execute saved sql from SAP Service Layer
|
|
36
|
+
- Added a second output to the nextLink node to check when pagination is finished
|
|
37
|
+
- Bug fix
|
|
38
|
+
|
|
39
|
+
# [0.0.5] - 2022-05-27
|
|
40
|
+
|
|
41
|
+
- Change cross join
|
|
42
|
+
- Fix html icons
|
|
43
|
+
|
|
44
|
+
# [0.0.4] - 2022-05-12
|
|
45
|
+
|
|
46
|
+
- Add all services of SAP service layer
|
|
47
|
+
- Add manipulate entity
|
|
48
|
+
|
|
49
|
+
# [0.0.3] - 2022-04-15
|
|
50
|
+
|
|
51
|
+
- Refactoring and add unit tests
|
|
52
|
+
|
|
53
|
+
# [0.0.1] - 2021-11-22
|
|
54
|
+
|
|
55
|
+
### First release.
|
|
56
|
+
|
|
57
|
+
- First public release of unofficial SAP Service Layer for NODE-RED.
|
package/README.md
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
<!-- [![NPM version][npm-version-image]][npm-url]
|
|
2
|
-
[![NPM downloads per month][npm-downloads-month-image]][npm-url]
|
|
3
|
-
[![NPM downloads total][npm-downloads-total-image]][npm-url]
|
|
4
|
-
[![MIT License][license-image]][license-url] -->
|
|
5
|
-
|
|
6
|
-
# Unofficial SAP Service layer nodes for Node-RED.
|
|
7
|
-
|
|
8
|
-
[](https://nodered.org)
|
|
9
|
-
|
|
10
|
-
This module provides a set of nodes for Node-RED to quickly create integration flows with SAP service layer.
|
|
11
|
-
|
|
12
|
-
# Installation
|
|
13
|
-
|
|
14
|
-
[](https://nodei.co/npm/node-red-contrib-you-sap-service-layer/)
|
|
15
|
-
|
|
16
|
-
You can install the nodes using node-red's "Manage palette" in the side bar.
|
|
17
|
-
|
|
18
|
-
Or run the following command in the root directory of your Node-RED installation
|
|
19
|
-
|
|
20
|
-
npm install @yousolution/node-red-contrib-you-sap-service-layer --save
|
|
21
|
-
|
|
22
|
-
# Dependencies
|
|
23
|
-
|
|
24
|
-
The nodes are tested with `Node.js v12.22.6` and `Node-RED v2.0.6`.
|
|
25
|
-
|
|
26
|
-
- [axios](https://github.com/axios/axios)
|
|
27
|
-
- [odata-query](https://github.com/techniq/odata-query)
|
|
28
|
-
|
|
29
|
-
# Changelog
|
|
30
|
-
|
|
31
|
-
Changes can be followed [here](/CHANGELOG.md).
|
|
32
|
-
|
|
33
|
-
# Usage
|
|
34
|
-
|
|
35
|
-
## Basics
|
|
36
|
-
|
|
37
|
-
### Authenticate (node authenticateSap)
|
|
38
|
-
|
|
39
|
-
Use this node to authenticate with a valid SAP service layer API access\
|
|
40
|
-
The node requires the following credentials:
|
|
41
|
-
|
|
42
|
-
- host
|
|
43
|
-
- port
|
|
44
|
-
- company
|
|
45
|
-
- user
|
|
46
|
-
- password
|
|
47
|
-
|
|
48
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
49
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
50
|
-
|
|
51
|
-
### Retrieve a list of entities (node listSap)
|
|
52
|
-
|
|
53
|
-
Use this node to retrieve a list of entities
|
|
54
|
-
|
|
55
|
-
1. Select the type of entity you want to retrieve as a list
|
|
56
|
-
2. If you want to add filter/options use oData params _optional_\
|
|
57
|
-
Query options on entities:
|
|
58
|
-
|
|
59
|
-
| option | description |
|
|
60
|
-
| -------- | --------------------------------------------------------------------------- |
|
|
61
|
-
| $filter | Restrict the set of business objects returned. |
|
|
62
|
-
| $orderby | Specify the order in which business objects are returned from the service. |
|
|
63
|
-
| $select | Restrict the service to return only the properties requested by the client. |
|
|
64
|
-
| $skip | Specify that the result excludes the first n entities. |
|
|
65
|
-
| $top | Specify that only the first n records should be returned. |
|
|
66
|
-
|
|
67
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
68
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
69
|
-
|
|
70
|
-
### Get single entity (node getSap)
|
|
71
|
-
|
|
72
|
-
Use this node to get a single entity by providing the primary key
|
|
73
|
-
|
|
74
|
-
1. Select the type of entity you want to retrieve
|
|
75
|
-
2. Use _objectId_ as primary key of entity
|
|
76
|
-
3. Use _oData_ to filter the response fields _optional_\
|
|
77
|
-
|
|
78
|
-
Query options on single entity:
|
|
79
|
-
|
|
80
|
-
| option | description |
|
|
81
|
-
| ------- | --------------------------------------------------------------------------- |
|
|
82
|
-
| $select | Restrict the service to return only the properties requested by the client. |
|
|
83
|
-
|
|
84
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
85
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
86
|
-
|
|
87
|
-
### Create a new entity (node createSap)
|
|
88
|
-
|
|
89
|
-
Use this node to create a new entity.
|
|
90
|
-
|
|
91
|
-
1. Select the type of entity you want to create
|
|
92
|
-
2. Use _msg.bodyPost_ to provide the entity's fields
|
|
93
|
-
3. Use _msg.createParams_ to provide object params
|
|
94
|
-
|
|
95
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
96
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
97
|
-
|
|
98
|
-
### Update an object
|
|
99
|
-
|
|
100
|
-
Use this node to update an object.
|
|
101
|
-
|
|
102
|
-
1. Select the type of object you want to update
|
|
103
|
-
2. Use _objectId_ as primary key of object
|
|
104
|
-
3. Use _msg.updateParams_ to provide object params
|
|
105
|
-
|
|
106
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
107
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
108
|
-
|
|
109
|
-
### Delete an Object
|
|
110
|
-
|
|
111
|
-
Use this node to delete an object.
|
|
112
|
-
|
|
113
|
-
1. Select the type of object you want to delete
|
|
114
|
-
2. Use _objectId_ as primary key of object
|
|
115
|
-
|
|
116
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
117
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
118
|
-
|
|
119
|
-
### Count the number of objects per type
|
|
120
|
-
|
|
121
|
-
Use this node to count the number of objects per type.
|
|
122
|
-
|
|
123
|
-
1. Select the type of object you want to count
|
|
124
|
-
|
|
125
|
-
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
126
|
-
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
1
|
+
<!-- [![NPM version][npm-version-image]][npm-url]
|
|
2
|
+
[![NPM downloads per month][npm-downloads-month-image]][npm-url]
|
|
3
|
+
[![NPM downloads total][npm-downloads-total-image]][npm-url]
|
|
4
|
+
[![MIT License][license-image]][license-url] -->
|
|
5
|
+
|
|
6
|
+
# Unofficial SAP Service layer nodes for Node-RED.
|
|
7
|
+
|
|
8
|
+
[](https://nodered.org)
|
|
9
|
+
|
|
10
|
+
This module provides a set of nodes for Node-RED to quickly create integration flows with SAP service layer.
|
|
11
|
+
|
|
12
|
+
# Installation
|
|
13
|
+
|
|
14
|
+
[](https://nodei.co/npm/node-red-contrib-you-sap-service-layer/)
|
|
15
|
+
|
|
16
|
+
You can install the nodes using node-red's "Manage palette" in the side bar.
|
|
17
|
+
|
|
18
|
+
Or run the following command in the root directory of your Node-RED installation
|
|
19
|
+
|
|
20
|
+
npm install @yousolution/node-red-contrib-you-sap-service-layer --save
|
|
21
|
+
|
|
22
|
+
# Dependencies
|
|
23
|
+
|
|
24
|
+
The nodes are tested with `Node.js v12.22.6` and `Node-RED v2.0.6`.
|
|
25
|
+
|
|
26
|
+
- [axios](https://github.com/axios/axios)
|
|
27
|
+
- [odata-query](https://github.com/techniq/odata-query)
|
|
28
|
+
|
|
29
|
+
# Changelog
|
|
30
|
+
|
|
31
|
+
Changes can be followed [here](/CHANGELOG.md).
|
|
32
|
+
|
|
33
|
+
# Usage
|
|
34
|
+
|
|
35
|
+
## Basics
|
|
36
|
+
|
|
37
|
+
### Authenticate (node authenticateSap)
|
|
38
|
+
|
|
39
|
+
Use this node to authenticate with a valid SAP service layer API access\
|
|
40
|
+
The node requires the following credentials:
|
|
41
|
+
|
|
42
|
+
- host
|
|
43
|
+
- port
|
|
44
|
+
- company
|
|
45
|
+
- user
|
|
46
|
+
- password
|
|
47
|
+
|
|
48
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
49
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
50
|
+
|
|
51
|
+
### Retrieve a list of entities (node listSap)
|
|
52
|
+
|
|
53
|
+
Use this node to retrieve a list of entities
|
|
54
|
+
|
|
55
|
+
1. Select the type of entity you want to retrieve as a list
|
|
56
|
+
2. If you want to add filter/options use oData params _optional_\
|
|
57
|
+
Query options on entities:
|
|
58
|
+
|
|
59
|
+
| option | description |
|
|
60
|
+
| -------- | --------------------------------------------------------------------------- |
|
|
61
|
+
| $filter | Restrict the set of business objects returned. |
|
|
62
|
+
| $orderby | Specify the order in which business objects are returned from the service. |
|
|
63
|
+
| $select | Restrict the service to return only the properties requested by the client. |
|
|
64
|
+
| $skip | Specify that the result excludes the first n entities. |
|
|
65
|
+
| $top | Specify that only the first n records should be returned. |
|
|
66
|
+
|
|
67
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
68
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
69
|
+
|
|
70
|
+
### Get single entity (node getSap)
|
|
71
|
+
|
|
72
|
+
Use this node to get a single entity by providing the primary key
|
|
73
|
+
|
|
74
|
+
1. Select the type of entity you want to retrieve
|
|
75
|
+
2. Use _objectId_ as primary key of entity
|
|
76
|
+
3. Use _oData_ to filter the response fields _optional_\
|
|
77
|
+
|
|
78
|
+
Query options on single entity:
|
|
79
|
+
|
|
80
|
+
| option | description |
|
|
81
|
+
| ------- | --------------------------------------------------------------------------- |
|
|
82
|
+
| $select | Restrict the service to return only the properties requested by the client. |
|
|
83
|
+
|
|
84
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
85
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
86
|
+
|
|
87
|
+
### Create a new entity (node createSap)
|
|
88
|
+
|
|
89
|
+
Use this node to create a new entity.
|
|
90
|
+
|
|
91
|
+
1. Select the type of entity you want to create
|
|
92
|
+
2. Use _msg.bodyPost_ to provide the entity's fields
|
|
93
|
+
3. Use _msg.createParams_ to provide object params
|
|
94
|
+
|
|
95
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
96
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
97
|
+
|
|
98
|
+
### Update an object
|
|
99
|
+
|
|
100
|
+
Use this node to update an object.
|
|
101
|
+
|
|
102
|
+
1. Select the type of object you want to update
|
|
103
|
+
2. Use _objectId_ as primary key of object
|
|
104
|
+
3. Use _msg.updateParams_ to provide object params
|
|
105
|
+
|
|
106
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
107
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
108
|
+
|
|
109
|
+
### Delete an Object
|
|
110
|
+
|
|
111
|
+
Use this node to delete an object.
|
|
112
|
+
|
|
113
|
+
1. Select the type of object you want to delete
|
|
114
|
+
2. Use _objectId_ as primary key of object
|
|
115
|
+
|
|
116
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
117
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
|
118
|
+
|
|
119
|
+
### Count the number of objects per type
|
|
120
|
+
|
|
121
|
+
Use this node to count the number of objects per type.
|
|
122
|
+
|
|
123
|
+
1. Select the type of object you want to count
|
|
124
|
+
|
|
125
|
+
You can see how to use it in the example flows in the _/examples_ directory.\
|
|
126
|
+
_For more details see official [SAP Service layer documentation](https://sap-samples.github.io/smb-summit-hackathon/b1sl.html)_
|
package/docker-compose.yml
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
version: '3.7'
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
nodered:
|
|
5
|
-
image: nodered/node-red:3.1.9-18
|
|
6
|
-
# network_mode: host
|
|
7
|
-
extra_hosts:
|
|
8
|
-
- 'api.yousolution.local:192.168.1.100'
|
|
9
|
-
volumes:
|
|
10
|
-
- ./data:/data
|
|
11
|
-
ports:
|
|
12
|
-
- '1880:1880'
|
|
13
|
-
environment:
|
|
14
|
-
NODE_ENV: 'dev'
|
|
1
|
+
version: '3.7'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
nodered:
|
|
5
|
+
image: nodered/node-red:3.1.9-18
|
|
6
|
+
# network_mode: host
|
|
7
|
+
extra_hosts:
|
|
8
|
+
- 'api.yousolution.local:192.168.1.100'
|
|
9
|
+
volumes:
|
|
10
|
+
- ./data:/data
|
|
11
|
+
ports:
|
|
12
|
+
- '1880:1880'
|
|
13
|
+
environment:
|
|
14
|
+
NODE_ENV: 'dev'
|