@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/closeSap.html
CHANGED
|
@@ -1,98 +1,129 @@
|
|
|
1
|
-
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('closeSap',{
|
|
3
|
-
category: 'Sap',
|
|
4
|
-
color: '#FFC300',
|
|
5
|
-
defaults: {
|
|
6
|
-
name: {value: ''},
|
|
7
|
-
entity: {value: ''},
|
|
8
|
-
entityId: {value: ''}
|
|
9
|
-
},
|
|
10
|
-
inputs:1,
|
|
11
|
-
outputs:1,
|
|
12
|
-
icon: 'font-awesome/fa-times-circle-o',
|
|
13
|
-
label: function() {
|
|
14
|
-
return this.name||"Sap close";
|
|
15
|
-
},
|
|
16
|
-
oneditprepare: function() {
|
|
17
|
-
$("#node-input-entityId").typedInput({
|
|
18
|
-
type:"msg",
|
|
19
|
-
types:["msg"],
|
|
20
|
-
typeField: "#node-input-entityId-type",
|
|
21
|
-
value: 'entityId'
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<script type="text/html" data-template-name="closeSap">
|
|
28
|
-
<div class="form-row">
|
|
29
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
30
|
-
<input type="text" id="node-input-name" placeholder="Name">
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<div class="form-row">
|
|
34
|
-
<label for="node-input-type"><i class="fa fa-cube"></i> Entity</label>
|
|
35
|
-
<select name="node-input-entity" id="node-input-entity">
|
|
36
|
-
<option value="
|
|
37
|
-
<option value="
|
|
38
|
-
<option value="
|
|
39
|
-
<option value="
|
|
40
|
-
<option value="
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('closeSap',{
|
|
3
|
+
category: 'Sap',
|
|
4
|
+
color: '#FFC300',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: {value: ''},
|
|
7
|
+
entity: {value: ''},
|
|
8
|
+
entityId: {value: ''}
|
|
9
|
+
},
|
|
10
|
+
inputs:1,
|
|
11
|
+
outputs:1,
|
|
12
|
+
icon: 'font-awesome/fa-times-circle-o',
|
|
13
|
+
label: function() {
|
|
14
|
+
return this.name||"Sap close";
|
|
15
|
+
},
|
|
16
|
+
oneditprepare: function() {
|
|
17
|
+
$("#node-input-entityId").typedInput({
|
|
18
|
+
type:"msg",
|
|
19
|
+
types:["msg"],
|
|
20
|
+
typeField: "#node-input-entityId-type",
|
|
21
|
+
value: 'entityId'
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script type="text/html" data-template-name="closeSap">
|
|
28
|
+
<div class="form-row">
|
|
29
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
30
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="form-row">
|
|
34
|
+
<label for="node-input-type"><i class="fa fa-cube"></i> Entity</label>
|
|
35
|
+
<select name="node-input-entity" id="node-input-entity">
|
|
36
|
+
<option value="CorrectionInvoice">CorrectionInvoice</option>
|
|
37
|
+
<option value="CorrectionInvoiceReversal">CorrectionInvoiceReversal</option>
|
|
38
|
+
<option value="CorrectionPurchaseInvoice">CorrectionPurchaseInvoice</option>
|
|
39
|
+
<option value="CorrectionPurchaseInvoiceReversal">CorrectionPurchaseInvoiceReversal</option>
|
|
40
|
+
<option value="CreditNotes">CreditNotes</option>
|
|
41
|
+
<option value="DeliveryNotes">DeliveryNotes</option>
|
|
42
|
+
<option value="DownPayments">DownPayments</option>
|
|
43
|
+
<option value="Drafts">Drafts</option>
|
|
44
|
+
<option value="EmployeesInfo">EmployeesInfo</option>
|
|
45
|
+
<option value="GoodsReturnRequest">GoodsReturnRequest</option>
|
|
46
|
+
<option value="InventoryCountings">InventoryCountings</option>
|
|
47
|
+
<option value="InventoryGenEntries">InventoryGenEntries</option>
|
|
48
|
+
<option value="InventoryGenExits">InventoryGenExits</option>
|
|
49
|
+
<option value="InventoryTransferRequests">InventoryTransferRequests</option>
|
|
50
|
+
<option value="Invoices">Invoices</option>
|
|
51
|
+
<option value="LandedCostsLandedCost">LandedCostsLandedCost</option>
|
|
52
|
+
<option value="MaterialRevaluation">MaterialRevaluation</option>
|
|
53
|
+
<option value="Orders">Orders</option>
|
|
54
|
+
<option value="PurchaseCreditNotes">PurchaseCreditNotes</option>
|
|
55
|
+
<option value="PurchaseDeliveryNotes">PurchaseDeliveryNotes</option>
|
|
56
|
+
<option value="PurchaseDownPayments">PurchaseDownPayments</option>
|
|
57
|
+
<option value="PurchaseInvoices">PurchaseInvoices</option>
|
|
58
|
+
<option value="PurchaseOrders">PurchaseOrders</option>
|
|
59
|
+
<option value="PurchaseQuotations">PurchaseQuotations</option>
|
|
60
|
+
<option value="PurchaseRequests">PurchaseRequests</option>
|
|
61
|
+
<option value="PurchaseReturns">PurchaseReturns</option>
|
|
62
|
+
<option value="Quotations">Quotations</option>
|
|
63
|
+
<option value="ReturnRequest">ReturnRequest</option>
|
|
64
|
+
<option value="Returns">Returns</option>
|
|
65
|
+
<option value="SalesOpportunities">SalesOpportunities</option>
|
|
66
|
+
<option value="ServiceCalls">ServiceCalls</option>
|
|
67
|
+
<option value="ServiceContracts">ServiceContracts</option>
|
|
68
|
+
<option value="StockTransferDrafts">StockTransferDrafts</option>
|
|
69
|
+
<option value="StockTransfers">StockTransfers</option>
|
|
70
|
+
<option value="Users">Users</option>
|
|
71
|
+
|
|
72
|
+
</select>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="form-row">
|
|
76
|
+
<label for="node-input-type"><i class="fa fa-key"></i> entityId</label>
|
|
77
|
+
<input type="text" id="node-input-entityId">
|
|
78
|
+
<input type="hidden" id="node-input-entityId-type">
|
|
79
|
+
</div>
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<!-- Documentation -->
|
|
83
|
+
<script type="text/html" data-help-name="closeSap">
|
|
84
|
+
<p>Close action</p>
|
|
85
|
+
|
|
86
|
+
<h3>Inputs</h3>
|
|
87
|
+
<dl class="message-properties">
|
|
88
|
+
<dt>Name
|
|
89
|
+
<span class="property-type">string</span>
|
|
90
|
+
</dt>
|
|
91
|
+
<dd> the node's name </dd>
|
|
92
|
+
<dt>Entity
|
|
93
|
+
<span class="property-type">string</span>
|
|
94
|
+
</dt>
|
|
95
|
+
<dd> the entity name of SAP </dd>
|
|
96
|
+
<dt>entityId
|
|
97
|
+
<span class="property-type">number | string</span>
|
|
98
|
+
</dt>
|
|
99
|
+
<dd> the id of the entity of SAP </dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
<h3>Outputs</h3>
|
|
103
|
+
<ol class="node-ports">
|
|
104
|
+
<li>Standard output
|
|
105
|
+
<dl class="message-properties">
|
|
106
|
+
<dt>payload <span class="property-type">string</span></dt>
|
|
107
|
+
<dd>the standard output of the command.</dd>
|
|
108
|
+
</dl>
|
|
109
|
+
</li>
|
|
110
|
+
</ol>
|
|
111
|
+
|
|
112
|
+
<h3>Details</h3>
|
|
113
|
+
<p>this node is used to close the entity of SAP.
|
|
114
|
+
See the examples to understand how to use it.
|
|
115
|
+
</p>
|
|
116
|
+
<!-- <p><code>msg.payload</code> is used as the payload of the published message.
|
|
117
|
+
If it contains an entity it will be converted to a JSON string before being sent.
|
|
118
|
+
If it contains a binary Buffer the message will be published as-is.</p>
|
|
119
|
+
<p>The topic used can be configured in the node or, if left blank, can be set
|
|
120
|
+
by <code>msg.topic</code>.</p>
|
|
121
|
+
<p>Likewise the QoS and retain values can be configured in the node or, if left
|
|
122
|
+
blank, set by <code>msg.qos</code> and <code>msg.retain</code> respectively.</p> -->
|
|
123
|
+
|
|
124
|
+
<h3>References</h3>
|
|
125
|
+
<ul>
|
|
126
|
+
<li><a href="https://sap-samples.github.io/smb-summit-hackathon/b1sl.html" target="_black">Service layer API docs</a> - for more details </li>
|
|
127
|
+
<li><a href="https://github.com/yousolution-cloud/node-red-contrib-you-sap-service-layer">@yousolution-cloud/node-red-contrib-you-sap-service-layer</a> - the nodes github repository</li>
|
|
128
|
+
</ul>
|
|
98
129
|
</script>
|
package/nodes/closeSap.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
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
|
-
|
|
7
|
-
module.exports = function (RED) {
|
|
8
|
-
function CloseSapNode(config) {
|
|
9
|
-
RED.nodes.createNode(this, config);
|
|
10
|
-
const node = this;
|
|
11
|
-
|
|
12
|
-
// reset status
|
|
13
|
-
node.status({});
|
|
14
|
-
|
|
15
|
-
node.on('input', async (msg, send, done) => {
|
|
16
|
-
// reset status
|
|
17
|
-
node.status({});
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
const options = { method: 'POST', hasRawQuery: false, hasEntityId: true, isClose: true };
|
|
21
|
-
const login = Support.login;
|
|
22
|
-
const result = await Support.sendRequest({ node, msg, config, axios, login, options });
|
|
23
|
-
msg.payload = VerifyErrorSL(node, msg, result.data);// result.data;
|
|
24
|
-
msg.statusCode = result.status;
|
|
25
|
-
if(msg.payload) {
|
|
26
|
-
node.status({ fill: 'green', shape: 'dot', text: 'success' });
|
|
27
|
-
node.send(msg);
|
|
28
|
-
}
|
|
29
|
-
} catch (error) {
|
|
30
|
-
node.status({ fill: 'red', shape: 'dot', text: 'Error' });
|
|
31
|
-
done(error);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
RED.nodes.registerType('closeSap', CloseSapNode, {});
|
|
36
|
-
};
|
|
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
|
+
|
|
7
|
+
module.exports = function (RED) {
|
|
8
|
+
function CloseSapNode(config) {
|
|
9
|
+
RED.nodes.createNode(this, config);
|
|
10
|
+
const node = this;
|
|
11
|
+
|
|
12
|
+
// reset status
|
|
13
|
+
node.status({});
|
|
14
|
+
|
|
15
|
+
node.on('input', async (msg, send, done) => {
|
|
16
|
+
// reset status
|
|
17
|
+
node.status({});
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const options = { method: 'POST', hasRawQuery: false, hasEntityId: true, isClose: true };
|
|
21
|
+
const login = Support.login;
|
|
22
|
+
const result = await Support.sendRequest({ node, msg, config, axios, login, options });
|
|
23
|
+
msg.payload = VerifyErrorSL(node, msg, result.data);// result.data;
|
|
24
|
+
msg.statusCode = result.status;
|
|
25
|
+
if(msg.payload) {
|
|
26
|
+
node.status({ fill: 'green', shape: 'dot', text: 'success' });
|
|
27
|
+
node.send(msg);
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
node.status({ fill: 'red', shape: 'dot', text: 'Error' });
|
|
31
|
+
done(error);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
RED.nodes.registerType('closeSap', CloseSapNode, {});
|
|
36
|
+
};
|
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('createSQLQuery',{
|
|
3
|
-
category: 'Sap',
|
|
4
|
-
color: '#FFC300',
|
|
5
|
-
defaults: {
|
|
6
|
-
name: {value: ''},
|
|
7
|
-
sqlCode: {value: ''},
|
|
8
|
-
sqlName: {value: ''},
|
|
9
|
-
sqlText: {value: ''},
|
|
10
|
-
headers: {value: ''},
|
|
11
|
-
bodyPost: {value: ''}
|
|
12
|
-
},
|
|
13
|
-
inputs:1,
|
|
14
|
-
outputs:1,
|
|
15
|
-
icon: 'font-awesome/fa-plus',
|
|
16
|
-
label: function() {
|
|
17
|
-
return this.name||"Create SQL Query";
|
|
18
|
-
},
|
|
19
|
-
oneditprepare: function() {
|
|
20
|
-
|
|
21
|
-
$("#node-input-sqlCode").typedInput({
|
|
22
|
-
type:"msg",
|
|
23
|
-
types:["msg"],
|
|
24
|
-
typeField: "#node-input-sqlCode-type",
|
|
25
|
-
value: 'sqlCode'
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
$("#node-input-sqlName").typedInput({
|
|
29
|
-
type:"msg",
|
|
30
|
-
types:["msg"],
|
|
31
|
-
typeField: "#node-input-sqlName-type",
|
|
32
|
-
value: 'sqlName'
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
$("#node-input-sqlText").typedInput({
|
|
36
|
-
type:"msg",
|
|
37
|
-
types:["msg"],
|
|
38
|
-
typeField: "#node-input-sqlText-type",
|
|
39
|
-
value: 'sqlText'
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
$("#node-input-headers").typedInput({
|
|
43
|
-
type:"msg",
|
|
44
|
-
types:["msg"],
|
|
45
|
-
typeField: "#node-input-headers-type",
|
|
46
|
-
value: 'headers'
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
$("#node-input-bodyPost").typedInput({
|
|
50
|
-
type:"msg",
|
|
51
|
-
types:["msg"],
|
|
52
|
-
typeField: "#node-input-bodyPost-type",
|
|
53
|
-
value: 'bodyPost'
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// jQuery("#node-input-entity").change(function() {
|
|
57
|
-
// jQuery('#container-udo').hide();
|
|
58
|
-
// jQuery('#container-udt').hide();
|
|
59
|
-
// jQuery('#container-partnerName').hide();
|
|
60
|
-
// jQuery('#container-scriptName').hide();
|
|
61
|
-
// if (jQuery(this).val() === 'UDO'){
|
|
62
|
-
// jQuery('#container-udo').show();
|
|
63
|
-
// }
|
|
64
|
-
// if (jQuery(this).val() === 'UDT'){
|
|
65
|
-
// jQuery('#container-udt').show();
|
|
66
|
-
// }
|
|
67
|
-
// if (jQuery(this).val() === 'script'){
|
|
68
|
-
// jQuery('#container-partnerName').show();
|
|
69
|
-
// jQuery('#container-scriptName').show();
|
|
70
|
-
// }
|
|
71
|
-
|
|
72
|
-
// });
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
</script>
|
|
76
|
-
|
|
77
|
-
<script type="text/html" data-template-name="createSQLQuery">
|
|
78
|
-
<div class="form-row">
|
|
79
|
-
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
80
|
-
<input type="text" id="node-input-name" placeholder="Name">
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div class="form-row">
|
|
84
|
-
<label for="node-input-type"><i class="fa fa-cog"></i> SqlCode</label>
|
|
85
|
-
<input type="text" id="node-input-sqlCode">
|
|
86
|
-
<input type="hidden" id="node-input-sqlCode-type">
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<div class="form-row">
|
|
90
|
-
<label for="node-input-type"><i class="fa fa-cog"></i> SqlName</label>
|
|
91
|
-
<input type="text" id="node-input-sqlName">
|
|
92
|
-
<input type="hidden" id="node-input-sqlName-type">
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="form-row">
|
|
96
|
-
<label for="node-input-type"><i class="fa fa-cog"></i> SqlText</label>
|
|
97
|
-
<input type="text" id="node-input-sqlText">
|
|
98
|
-
<input type="hidden" id="node-input-sqlText-type">
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<div class="form-row">
|
|
102
|
-
<label for="node-input-type"><i class="fa fa-cog"></i> Headers</label>
|
|
103
|
-
<input type="text" id="node-input-headers">
|
|
104
|
-
<input type="hidden" id="node-input-headers-type">
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div class="form-row">
|
|
108
|
-
<label for="node-input-type"><i class="fa fa-cog"></i> BodyPost</label>
|
|
109
|
-
<input type="text" id="node-input-bodyPost">
|
|
110
|
-
<input type="hidden" id="node-input-bodyPost-type">
|
|
111
|
-
</div>
|
|
112
|
-
</script>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<!-- Documentation -->
|
|
116
|
-
<script type="text/html" data-help-name="createSQLQuery">
|
|
117
|
-
<p>Create a new SQL query from SAP service layer</p>
|
|
118
|
-
|
|
119
|
-
<h3>Inputs</h3>
|
|
120
|
-
<dl class="message-properties">
|
|
121
|
-
<dt>Name
|
|
122
|
-
<span class="property-type">string</span>
|
|
123
|
-
</dt>
|
|
124
|
-
<dd> the node's name </dd>
|
|
125
|
-
<dt>Entity
|
|
126
|
-
<span class="property-type">string</span>
|
|
127
|
-
</dt>
|
|
128
|
-
<dd> the entity name of SAP resource </dd>
|
|
129
|
-
<dt>EntityId
|
|
130
|
-
<span class="property-type">number | string</span>
|
|
131
|
-
</dt>
|
|
132
|
-
<dd> the id of the entity of SAP resource </dd>
|
|
133
|
-
<dt>bodyPost
|
|
134
|
-
<span class="property-type">object</span>
|
|
135
|
-
</dt>
|
|
136
|
-
<dd> the data of the entity </dd>
|
|
137
|
-
</dl>
|
|
138
|
-
|
|
139
|
-
<h3>Outputs</h3>
|
|
140
|
-
<ol class="node-ports">
|
|
141
|
-
<li>Standard output
|
|
142
|
-
<dl class="message-properties">
|
|
143
|
-
<dt>payload <span class="property-type">string</span></dt>
|
|
144
|
-
<dd>the standard output of the command.</dd>
|
|
145
|
-
</dl>
|
|
146
|
-
</li>
|
|
147
|
-
</ol>
|
|
148
|
-
|
|
149
|
-
<h3>Details</h3>
|
|
150
|
-
<p>this node is used to create the entity of SAP.
|
|
151
|
-
See the examples to understand how to use it.
|
|
152
|
-
</p>
|
|
153
|
-
<!-- <p><code>msg.payload</code> is used as the payload of the published message.
|
|
154
|
-
If it contains an Object it will be converted to a JSON string before being sent.
|
|
155
|
-
If it contains a binary Buffer the message will be published as-is.</p>
|
|
156
|
-
<p>The topic used can be configured in the node or, if left blank, can be set
|
|
157
|
-
by <code>msg.topic</code>.</p>
|
|
158
|
-
<p>Likewise the QoS and retain values can be configured in the node or, if left
|
|
159
|
-
blank, set by <code>msg.qos</code> and <code>msg.retain</code> respectively.</p> -->
|
|
160
|
-
|
|
161
|
-
<h3>References</h3>
|
|
162
|
-
<ul>
|
|
163
|
-
<li><a href="https://sap-samples.github.io/smb-summit-hackathon/b1sl.html" target="_black">Service layer API docs</a> - for more details </li>
|
|
164
|
-
<li><a href="https://github.com/yousolution-cloud/node-red-contrib-you-sap-service-layer">@yousolution-cloud/node-red-contrib-you-sap-service-layer</a> - the nodes github repository</li>
|
|
165
|
-
</ul>
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType('createSQLQuery',{
|
|
3
|
+
category: 'Sap',
|
|
4
|
+
color: '#FFC300',
|
|
5
|
+
defaults: {
|
|
6
|
+
name: {value: ''},
|
|
7
|
+
sqlCode: {value: ''},
|
|
8
|
+
sqlName: {value: ''},
|
|
9
|
+
sqlText: {value: ''},
|
|
10
|
+
headers: {value: ''},
|
|
11
|
+
bodyPost: {value: ''}
|
|
12
|
+
},
|
|
13
|
+
inputs:1,
|
|
14
|
+
outputs:1,
|
|
15
|
+
icon: 'font-awesome/fa-plus',
|
|
16
|
+
label: function() {
|
|
17
|
+
return this.name||"Create SQL Query";
|
|
18
|
+
},
|
|
19
|
+
oneditprepare: function() {
|
|
20
|
+
|
|
21
|
+
$("#node-input-sqlCode").typedInput({
|
|
22
|
+
type:"msg",
|
|
23
|
+
types:["msg"],
|
|
24
|
+
typeField: "#node-input-sqlCode-type",
|
|
25
|
+
value: 'sqlCode'
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
$("#node-input-sqlName").typedInput({
|
|
29
|
+
type:"msg",
|
|
30
|
+
types:["msg"],
|
|
31
|
+
typeField: "#node-input-sqlName-type",
|
|
32
|
+
value: 'sqlName'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
$("#node-input-sqlText").typedInput({
|
|
36
|
+
type:"msg",
|
|
37
|
+
types:["msg"],
|
|
38
|
+
typeField: "#node-input-sqlText-type",
|
|
39
|
+
value: 'sqlText'
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
$("#node-input-headers").typedInput({
|
|
43
|
+
type:"msg",
|
|
44
|
+
types:["msg"],
|
|
45
|
+
typeField: "#node-input-headers-type",
|
|
46
|
+
value: 'headers'
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
$("#node-input-bodyPost").typedInput({
|
|
50
|
+
type:"msg",
|
|
51
|
+
types:["msg"],
|
|
52
|
+
typeField: "#node-input-bodyPost-type",
|
|
53
|
+
value: 'bodyPost'
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// jQuery("#node-input-entity").change(function() {
|
|
57
|
+
// jQuery('#container-udo').hide();
|
|
58
|
+
// jQuery('#container-udt').hide();
|
|
59
|
+
// jQuery('#container-partnerName').hide();
|
|
60
|
+
// jQuery('#container-scriptName').hide();
|
|
61
|
+
// if (jQuery(this).val() === 'UDO'){
|
|
62
|
+
// jQuery('#container-udo').show();
|
|
63
|
+
// }
|
|
64
|
+
// if (jQuery(this).val() === 'UDT'){
|
|
65
|
+
// jQuery('#container-udt').show();
|
|
66
|
+
// }
|
|
67
|
+
// if (jQuery(this).val() === 'script'){
|
|
68
|
+
// jQuery('#container-partnerName').show();
|
|
69
|
+
// jQuery('#container-scriptName').show();
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
|
+
// });
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<script type="text/html" data-template-name="createSQLQuery">
|
|
78
|
+
<div class="form-row">
|
|
79
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
80
|
+
<input type="text" id="node-input-name" placeholder="Name">
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div class="form-row">
|
|
84
|
+
<label for="node-input-type"><i class="fa fa-cog"></i> SqlCode</label>
|
|
85
|
+
<input type="text" id="node-input-sqlCode">
|
|
86
|
+
<input type="hidden" id="node-input-sqlCode-type">
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="form-row">
|
|
90
|
+
<label for="node-input-type"><i class="fa fa-cog"></i> SqlName</label>
|
|
91
|
+
<input type="text" id="node-input-sqlName">
|
|
92
|
+
<input type="hidden" id="node-input-sqlName-type">
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<div class="form-row">
|
|
96
|
+
<label for="node-input-type"><i class="fa fa-cog"></i> SqlText</label>
|
|
97
|
+
<input type="text" id="node-input-sqlText">
|
|
98
|
+
<input type="hidden" id="node-input-sqlText-type">
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="form-row">
|
|
102
|
+
<label for="node-input-type"><i class="fa fa-cog"></i> Headers</label>
|
|
103
|
+
<input type="text" id="node-input-headers">
|
|
104
|
+
<input type="hidden" id="node-input-headers-type">
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="form-row">
|
|
108
|
+
<label for="node-input-type"><i class="fa fa-cog"></i> BodyPost</label>
|
|
109
|
+
<input type="text" id="node-input-bodyPost">
|
|
110
|
+
<input type="hidden" id="node-input-bodyPost-type">
|
|
111
|
+
</div>
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<!-- Documentation -->
|
|
116
|
+
<script type="text/html" data-help-name="createSQLQuery">
|
|
117
|
+
<p>Create a new SQL query from SAP service layer</p>
|
|
118
|
+
|
|
119
|
+
<h3>Inputs</h3>
|
|
120
|
+
<dl class="message-properties">
|
|
121
|
+
<dt>Name
|
|
122
|
+
<span class="property-type">string</span>
|
|
123
|
+
</dt>
|
|
124
|
+
<dd> the node's name </dd>
|
|
125
|
+
<dt>Entity
|
|
126
|
+
<span class="property-type">string</span>
|
|
127
|
+
</dt>
|
|
128
|
+
<dd> the entity name of SAP resource </dd>
|
|
129
|
+
<dt>EntityId
|
|
130
|
+
<span class="property-type">number | string</span>
|
|
131
|
+
</dt>
|
|
132
|
+
<dd> the id of the entity of SAP resource </dd>
|
|
133
|
+
<dt>bodyPost
|
|
134
|
+
<span class="property-type">object</span>
|
|
135
|
+
</dt>
|
|
136
|
+
<dd> the data of the entity </dd>
|
|
137
|
+
</dl>
|
|
138
|
+
|
|
139
|
+
<h3>Outputs</h3>
|
|
140
|
+
<ol class="node-ports">
|
|
141
|
+
<li>Standard output
|
|
142
|
+
<dl class="message-properties">
|
|
143
|
+
<dt>payload <span class="property-type">string</span></dt>
|
|
144
|
+
<dd>the standard output of the command.</dd>
|
|
145
|
+
</dl>
|
|
146
|
+
</li>
|
|
147
|
+
</ol>
|
|
148
|
+
|
|
149
|
+
<h3>Details</h3>
|
|
150
|
+
<p>this node is used to create the entity of SAP.
|
|
151
|
+
See the examples to understand how to use it.
|
|
152
|
+
</p>
|
|
153
|
+
<!-- <p><code>msg.payload</code> is used as the payload of the published message.
|
|
154
|
+
If it contains an Object it will be converted to a JSON string before being sent.
|
|
155
|
+
If it contains a binary Buffer the message will be published as-is.</p>
|
|
156
|
+
<p>The topic used can be configured in the node or, if left blank, can be set
|
|
157
|
+
by <code>msg.topic</code>.</p>
|
|
158
|
+
<p>Likewise the QoS and retain values can be configured in the node or, if left
|
|
159
|
+
blank, set by <code>msg.qos</code> and <code>msg.retain</code> respectively.</p> -->
|
|
160
|
+
|
|
161
|
+
<h3>References</h3>
|
|
162
|
+
<ul>
|
|
163
|
+
<li><a href="https://sap-samples.github.io/smb-summit-hackathon/b1sl.html" target="_black">Service layer API docs</a> - for more details </li>
|
|
164
|
+
<li><a href="https://github.com/yousolution-cloud/node-red-contrib-you-sap-service-layer">@yousolution-cloud/node-red-contrib-you-sap-service-layer</a> - the nodes github repository</li>
|
|
165
|
+
</ul>
|
|
166
166
|
</script>
|