@yousolution/node-red-contrib-you-sap-service-layer 0.0.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.
@@ -0,0 +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
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ # [0.0.1] - 2021-11-22
6
+
7
+ ### First release.
8
+
9
+ - First public release of unofficial SAP Service Layer for NODE-RED.
10
+
11
+ # [0.0.3] - 2022-04-15
12
+
13
+ - Refactoring and add unit tests
package/README.md ADDED
@@ -0,0 +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
+ [![Platform](https://img.shields.io/badge/platform-Node--RED-red)](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
+ [![NPM](https://nodei.co/npm/node-red-contrib-you-sap-service-layer.png?downloads=true)](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/data/.gitkeep ADDED
File without changes
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "node-red-project",
3
+ "description": "A Node-RED Project",
4
+ "version": "0.0.1",
5
+ "private": true,
6
+ "dependencies": {
7
+ "@types/node-red": "^1.1.1",
8
+ "@yousolution/node-red-contrib-you-sap-service-layer": "file:yousolution-node-red-contrib-you-sap-service-layer-0.0.3.tgz",
9
+ "@yousolution/node-red-contrib-you-yousolution.cloud": "file:nodes/yousolution-node-red-contrib-you-yousolution.cloud-0.0.1-1.tgz",
10
+ "faker": "^6.6.6",
11
+ "node-red-contrib-sse-client": "~0.2.2",
12
+ "node-red-node-email": "~1.14.0"
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ nodered:
5
+ image: nodered/node-red:2.0.6-12
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'