@accede/node-red-contrib-odbcwritenow 1.0.1 → 1.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.
- package/odbcwritenow.html +6 -1
- package/odbcwritenow.js +10 -2
- package/package.json +3 -4
package/odbcwritenow.html
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
defaults: {
|
|
6
6
|
name: {value:""},
|
|
7
7
|
apikey: {value:""},
|
|
8
|
-
what: {value:""}
|
|
8
|
+
what: {value:""},
|
|
9
|
+
orderby: {value:""}
|
|
9
10
|
},
|
|
10
11
|
inputs: 1,
|
|
11
12
|
outputs: 2,
|
|
@@ -25,6 +26,10 @@
|
|
|
25
26
|
<label for="node-input-what"><i class="fa fa-lock"></i> What</label>
|
|
26
27
|
<input type="text" id="node-input-what" placeholder="sales_invoice_item">
|
|
27
28
|
</div>
|
|
29
|
+
<div class="form-row">
|
|
30
|
+
<label for="node-input-orderby"><i class="fa fa-lock"></i> OrderBy</label>
|
|
31
|
+
<input type="text" id="node-input-orderby" placeholder="OrderBy">
|
|
32
|
+
</div>
|
|
28
33
|
<div class="form-row">
|
|
29
34
|
<label for="node-input-apikey"><i class="fa fa-lock"></i> APIKey</label>
|
|
30
35
|
<input type="text" id="node-input-apikey" placeholder="APIKey">
|
package/odbcwritenow.js
CHANGED
|
@@ -54,11 +54,15 @@ module.exports = function(RED) {
|
|
|
54
54
|
const page = parseInt(encodeURIComponent(msg.page || 0));
|
|
55
55
|
const apikey = encodeURIComponent(msg.apikey || config.apikey);
|
|
56
56
|
const what = encodeURIComponent(config.what)
|
|
57
|
+
const orderby = encodeURIComponent(msg.orderby || config.orderby);
|
|
58
|
+
|
|
59
|
+
|
|
57
60
|
|
|
58
61
|
msg.page = page
|
|
59
62
|
msg.what = what
|
|
60
63
|
msg.retry = 0
|
|
61
64
|
|
|
65
|
+
var orderbystr = "";
|
|
62
66
|
var filtersstr = "";
|
|
63
67
|
const filters = encodeURIComponent(msg.filters || "")
|
|
64
68
|
if (filters.length > 0) {
|
|
@@ -72,10 +76,14 @@ module.exports = function(RED) {
|
|
|
72
76
|
|
|
73
77
|
const dateto = encodeURIComponent(msg.dateto || "")
|
|
74
78
|
if (dateto.length > 0) {
|
|
75
|
-
filtersstr += `&
|
|
79
|
+
filtersstr += `&dateto=${dateto}`
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (orderby.length > 0) {
|
|
83
|
+
orderbystr += `&orderby=${orderby}`
|
|
76
84
|
}
|
|
77
85
|
|
|
78
|
-
const url = `https://myobsync.accede.com.au/download/${what}/json/${page}?apikey=${apikey}${filtersstr}`;
|
|
86
|
+
const url = `https://myobsync.accede.com.au/download/${what}/json/${page}?apikey=${apikey}${filtersstr}${orderbystr}`;
|
|
79
87
|
DoImport(msg, url, node)
|
|
80
88
|
|
|
81
89
|
});
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accede/node-red-contrib-odbcwritenow",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "ISC",
|
|
11
|
-
"description": "",
|
|
12
11
|
"node-red": {
|
|
13
|
-
|
|
12
|
+
"version": ">=4.0.0",
|
|
14
13
|
"nodes": {
|
|
15
14
|
"odbcwritenow-get": "odbcwritenow.js"
|
|
16
15
|
}
|