node-red-contrib-teamogy-api 0.0.2 → 0.0.6
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/README.md +10 -2
- package/examples/examples.json +88 -0
- package/package.json +5 -4
- package/teamogy-client.html +815 -539
- package/teamogy-client.js +193 -50
package/teamogy-client.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
|
|
2
|
+
let requests = `[
|
|
3
3
|
{"v":"r_companies", "e":"Contacts", "m":["GET","POST","PATCH"]},
|
|
4
4
|
{"v":"r_documents", "e":"Documents", "m":["GET","POST","PATCH"]},
|
|
5
5
|
{"v":"r_jobs", "e":"Jobs", "m":["GET","POST","PATCH"]},
|
|
@@ -7,590 +7,866 @@
|
|
|
7
7
|
{"v":"r_time", "e":"Time", "m":["POST"]},
|
|
8
8
|
{"v":"r_users", "e":"Users", "m":["GET","POST"]}
|
|
9
9
|
]`;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{"v":"v_companies
|
|
19
|
-
{"v":"v_companies-
|
|
20
|
-
{"v":"
|
|
21
|
-
{"v":"
|
|
22
|
-
{"v":"
|
|
23
|
-
|
|
24
|
-
{"v":"
|
|
25
|
-
{"v":"
|
|
26
|
-
{"v":"
|
|
27
|
-
|
|
28
|
-
{"v":"
|
|
29
|
-
{"v":"
|
|
30
|
-
{"v":"
|
|
31
|
-
{"v":"
|
|
32
|
-
{"v":"
|
|
33
|
-
{"v":"
|
|
34
|
-
|
|
35
|
-
{"v":"
|
|
10
|
+
|
|
11
|
+
let values1 = JSON.parse(requests);
|
|
12
|
+
|
|
13
|
+
let views = `[
|
|
14
|
+
{"v":"v_units", "e":"Config - Units", "m":["GET"]},
|
|
15
|
+
{"v":"v_users", "e":"Config - Users", "m":["GET"]},
|
|
16
|
+
{"v":"v_groups", "e":"Config - Groups", "m":["GET"]},
|
|
17
|
+
|
|
18
|
+
{"v":"v_companies", "e":"Contacts - Companies - All", "m":["GET"]},
|
|
19
|
+
{"v":"v_companies-client", "e":"Contacts - Companies - Clients only", "m":["GET"]},
|
|
20
|
+
{"v":"v_companies-supplier", "e":"Contacts - Companies - Suppliers only", "m":["GET"]},
|
|
21
|
+
{"v":"v_persons", "e":"Contacts - Persons", "m":["GET"]},
|
|
22
|
+
{"v":"v_brands", "e":"Contacts - Brands", "m":["GET"]},
|
|
23
|
+
|
|
24
|
+
{"v":"v_documents", "e":"Documents - All", "m":["GET"]},
|
|
25
|
+
{"v":"v_documents-order-purchase", "e":"Documents - Purchase Orders", "m":["GET"]},
|
|
26
|
+
{"v":"v_documents-quotation-sales", "e":"Documents - Sales Quotations", "m":["GET"]},
|
|
27
|
+
|
|
28
|
+
{"v":"v_invoices-purchase", "e":"Finance - Purchase Invoices", "m":["GET"]},
|
|
29
|
+
{"v":"v_invoices-sales", "e":"Finance - Sales Invoices", "m":["GET"]},
|
|
30
|
+
{"v":"v_internals-purchase", "e":"Finance - Purchase Internal Documents", "m":["GET"]},
|
|
31
|
+
{"v":"v_internals-sales", "e":"Finance - Sales Internal Documents", "m":["GET"]},
|
|
32
|
+
{"v":"v_overheads-client", "e":"Finance - Client Overheads", "m":["GET"]},
|
|
33
|
+
{"v":"v_overheads-internal", "e":"Finance - Internal Overheads", "m":["GET"]},
|
|
34
|
+
{"v":"v_cashboxes", "e":"Finance - Cashboxes", "m":["GET"]},
|
|
35
|
+
{"v":"v_journal", "e":"Finance - Journal", "m":["GET"]},
|
|
36
|
+
|
|
37
|
+
{"v":"v_intervals-absence", "e":"Time Intervals - Absences", "m":["GET"]},
|
|
38
|
+
{"v":"v_intervals-attendance", "e":"Time Intervals - Attendances", "m":["GET"]},
|
|
39
|
+
{"v":"v_intervals-track", "e":"Time Intervals - Time Tracks", "m":["GET"]},
|
|
40
|
+
|
|
41
|
+
{"v":"v_binders", "e":"Binders", "m":["GET"]},
|
|
36
42
|
{"v":"v_opportunities", "e":"Opportunities", "m":["GET"]},
|
|
37
|
-
{"v":"
|
|
43
|
+
{"v":"v_jobs", "e":"Jobs", "m":["GET"]},
|
|
38
44
|
{"v":"v_tasks", "e":"Tasks", "m":["GET"]},
|
|
39
|
-
{"v":"
|
|
45
|
+
{"v":"v_gems", "e":"Gems", "m":["GET"]}
|
|
46
|
+
|
|
40
47
|
]`;
|
|
41
|
-
|
|
42
|
-
let values2 = JSON.parse(views)
|
|
43
|
-
|
|
44
|
-
function decodeJwt(token) {
|
|
45
|
-
try {
|
|
46
|
-
return JSON.parse(atob(token.split(".")[1]));
|
|
47
|
-
} catch (e) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
48
|
|
|
49
|
+
let values2 = JSON.parse(views);
|
|
50
|
+
|
|
51
|
+
function decodeJwt(token) {
|
|
52
|
+
try {
|
|
53
|
+
return JSON.parse(atob(token.split(".")[1]));
|
|
54
|
+
} catch (e) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
52
58
|
</script>
|
|
53
59
|
|
|
54
60
|
<script type="text/x-red" data-template-name="teamogy-config">
|
|
55
|
-
|
|
61
|
+
|
|
56
62
|
<div class="form-row">
|
|
57
63
|
<label for="node-config-input-name"><i class="fa fa-tag"></i><span>Name</span></label>
|
|
58
64
|
<input type="text" id="node-config-input-name" placeholder="name">
|
|
59
65
|
</div>
|
|
60
|
-
|
|
66
|
+
|
|
61
67
|
<div class="form-row">
|
|
62
68
|
<ul style="min-width: 600px; margin-bottom: 20px;" id="config-tabs"></ul>
|
|
63
69
|
</div>
|
|
64
|
-
|
|
70
|
+
|
|
65
71
|
<div id="config-tabs-content" style="min-height: 170px;">
|
|
66
|
-
|
|
72
|
+
|
|
67
73
|
<div id="config-tab-config" style="display: none;">
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
|
|
75
|
+
<div class="form-row">
|
|
70
76
|
<label for="node-config-input-host"><i class="fa fa-server"></i> <span>Domain</span></label>
|
|
71
77
|
<input type="text" id="node-config-input-host" placeholder="subdomain.teamogy.com">
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="form-row">
|
|
75
81
|
<label for="node-config-input-unit"><i class="fa fa-square-o"></i> <span>Unit/Agency</span></label>
|
|
76
|
-
<input type="number" id="node-config-input-unit" min="
|
|
82
|
+
<input type="number" id="node-config-input-unit" min="0" max="100" step="1" placeholder="1" style="width: 20%">
|
|
77
83
|
</div>
|
|
78
|
-
|
|
84
|
+
|
|
79
85
|
<div class="form-row">
|
|
80
86
|
<label for="node-config-input-token"><i class="fa fa-lock"></i> <span>Token</span></label>
|
|
81
87
|
<input type="password" id="node-config-input-token" placeholder="token">
|
|
82
88
|
</div>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
|
|
90
|
+
<div class="form-row">
|
|
91
|
+
<label for="node-config-input-tokendata" style="vertical-align: top;"><i class="fa fa-lock"></i> <span>Token data</span></label>
|
|
92
|
+
<label id="node-config-label-tokendata" style="width: 50%"></label>
|
|
93
|
+
<input type="hidden" id="node-config-input-tokendata" placeholder="">
|
|
88
94
|
</div>
|
|
89
|
-
|
|
95
|
+
|
|
90
96
|
<div class="form-row">
|
|
91
97
|
<label for="node-config-input-apilimit"><i class="fa fa-step-forward"></i> <span>Req/min</span></label>
|
|
92
98
|
<input type="number" id="node-config-input-apilimit" min="1" max="1000" step="1" placeholder="60" style="width: 20%">
|
|
93
99
|
</div>
|
|
94
|
-
|
|
100
|
+
|
|
95
101
|
</div>
|
|
96
|
-
|
|
102
|
+
|
|
97
103
|
</div>
|
|
98
104
|
</script>
|
|
99
105
|
|
|
100
106
|
<script type="text/javascript">
|
|
101
|
-
RED.nodes.registerType(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
107
|
+
RED.nodes.registerType("teamogy-config", {
|
|
108
|
+
category: "config",
|
|
109
|
+
color: "#fe4c00",
|
|
110
|
+
defaults: {
|
|
111
|
+
name: {
|
|
112
|
+
value: "",
|
|
113
|
+
},
|
|
114
|
+
host: {
|
|
115
|
+
value: "",
|
|
116
|
+
required: true,
|
|
117
|
+
},
|
|
118
|
+
unit: {
|
|
119
|
+
value: 1,
|
|
120
|
+
required: true,
|
|
121
|
+
},
|
|
122
|
+
tokendata: {
|
|
123
|
+
value: "",
|
|
124
|
+
required: false,
|
|
125
|
+
},
|
|
126
|
+
apilimit: {
|
|
127
|
+
value: 60,
|
|
128
|
+
required: true,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
credentials: {
|
|
132
|
+
token: {
|
|
133
|
+
type: "password",
|
|
134
|
+
required: true,
|
|
135
|
+
},
|
|
136
|
+
required: true,
|
|
137
|
+
},
|
|
138
|
+
label: function () {
|
|
139
|
+
if (!this.name) {
|
|
140
|
+
this.name = this.host + "/" + this.unit;
|
|
141
|
+
}
|
|
142
|
+
return this.name;
|
|
143
|
+
},
|
|
144
|
+
labelStyle: function () {
|
|
145
|
+
return this.name ? "node_label_italic" : "";
|
|
146
|
+
},
|
|
147
|
+
oneditprepare: function () {
|
|
148
|
+
$("#node-config-label-tokendata").html(this.tokendata);
|
|
149
|
+
|
|
150
|
+
$("#node-config-input-token").on("change", function () {
|
|
151
|
+
if ($(this).val() != "__PWRD__") {
|
|
152
|
+
let pt = decodeJwt($("#node-config-input-token").val());
|
|
153
|
+
|
|
154
|
+
if (pt == null) {
|
|
155
|
+
$("#node-config-label-tokendata").html("Invalid token format");
|
|
156
|
+
$("#node-config-input-tokendata").val("Invalid token format");
|
|
157
|
+
} else {
|
|
158
|
+
pt.iat = new Date(pt.iat * 1000).toISOString();
|
|
159
|
+
|
|
160
|
+
let rt = "";
|
|
161
|
+
$.each(pt, function (key, value) {
|
|
162
|
+
rt = rt + key + ": " + value + "<br>";
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
$("#node-config-label-tokendata").html(rt);
|
|
166
|
+
$("#node-config-input-tokendata").val(rt);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
$("#node-config-input-unit").on("change", function () {
|
|
172
|
+
if (!$.isNumeric($(this).val())) {
|
|
173
|
+
$(this).val(1);
|
|
174
|
+
} else {
|
|
175
|
+
if ($(this).val() < 0 || $(this).val() > 100) {
|
|
176
|
+
$(this).val(1);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
$("#node-config-input-apilimit").on("change", function () {
|
|
182
|
+
if (!$.isNumeric($(this).val())) {
|
|
183
|
+
$(this).val(60);
|
|
184
|
+
} else {
|
|
185
|
+
if ($(this).val() < 1 || $(this).val() > 1000) {
|
|
186
|
+
$(this).val(60);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const tabs = RED.tabs.create({
|
|
192
|
+
id: "config-tabs",
|
|
193
|
+
onchange: function (tab) {
|
|
194
|
+
$("#config-tabs-content").children().hide();
|
|
195
|
+
$("#" + tab.id).show();
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
tabs.addTab({
|
|
200
|
+
id: "config-tab-config",
|
|
201
|
+
label: "Connection",
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
});
|
|
194
205
|
</script>
|
|
195
206
|
|
|
196
207
|
<style type="text/css">
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
208
|
+
.dynamic-dropdown-row {
|
|
209
|
+
padding: 6px 0;
|
|
210
|
+
}
|
|
200
211
|
</style>
|
|
201
212
|
|
|
202
213
|
<script type="text/x-red" data-template-name="teamogy-client">
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
214
|
+
|
|
215
|
+
<div class="form-row">
|
|
216
|
+
<label for="node-input-name" style="width: 130px"><i class="icon-tag"></i><span>Name</span></label>
|
|
217
|
+
<input type="text" id="node-input-name" placeholder="name" style="width:65%">
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<div class="form-row">
|
|
221
|
+
<ul style="min-width: 600px; margin-bottom: 20px;" id="config-tabs"></ul>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div id="config-tabs-content" style="min-height: 170px;">
|
|
225
|
+
|
|
226
|
+
<div id="config-tab-config" style="display: none;">
|
|
227
|
+
|
|
228
|
+
<div class="form-row">
|
|
229
|
+
<label for="node-input-configuration" style="width: 130px"><i class="fa fa-globe"></i><span> Connection</span></label>
|
|
230
|
+
<input type="text" id="node-input-configuration" style="width:65%">
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<div class="form-row">
|
|
234
|
+
<label for="node-input-mode" style="width: 130px"><i class="fa fa-refresh"></i> <span>Request views</span></label>
|
|
235
|
+
<input type="checkbox" id="node-input-mode" style=" width:20px;">
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<div class="form-row">
|
|
239
|
+
<label for="node-input-entity" style="width: 130px"><i class="fa fa-caret-down"></i> Select entity</label>
|
|
240
|
+
<select id="node-input-entity" style="width:65%">
|
|
241
|
+
</select>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div class="form-row">
|
|
245
|
+
<label for="node-input-method" style="width: 130px"><i class="fa fa-caret-down"></i> Select method</label>
|
|
246
|
+
<select id="node-input-method" style="width:65%">
|
|
247
|
+
</select>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<div class="form-row">
|
|
251
|
+
<label for="node-input-source" style="width: 130px"><i class="fa fa-caret-down"></i> Source</label>
|
|
252
|
+
<select id="node-input-source" style='width:65%'>
|
|
253
|
+
<option value="static">Static command</option>
|
|
254
|
+
<option value="dynamic">Dynamic from message </option>
|
|
255
|
+
</select>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<div class="form-row" id="node-row-editor">
|
|
259
|
+
<div class="form-row">
|
|
260
|
+
<label for="node-input-params" style="width: 130px"><i class="fa fa-code"></i> Parameters</label>
|
|
261
|
+
</div>
|
|
262
|
+
<div class="form-row">
|
|
263
|
+
<div style="height: 100px; min-height:100px;" class="node-text-editor" id="node-input-params" style='width:65%'></div>
|
|
264
|
+
</div>
|
|
265
|
+
<div class="form-row">
|
|
266
|
+
<label for="node-input-body" style="width: 130px"><i class="fa fa-code"></i> Body</label>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="form-row">
|
|
269
|
+
<div style="height: 100px; min-height:100px;" class="node-text-editor" id="node-input-body" style='width:65%'></div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
<div class="form-row" id="node-row-response-option">
|
|
274
|
+
<div style="margin-bottom: 10px;"></div>
|
|
275
|
+
<label style="width: 130px"><span>View option</span></label>
|
|
276
|
+
<div style="margin-bottom: 5px;"></div>
|
|
277
|
+
<div class="form-row">
|
|
278
|
+
<label for="node-input-merge" style="width: 130px"><i class="fa fa-compress"></i> <span> Merge</span></label>
|
|
279
|
+
<input type="checkbox" id="node-input-merge" style=" width:20px;">
|
|
280
|
+
</div>
|
|
281
|
+
<div class="form-row">
|
|
282
|
+
<label for="node-input-limit" style="width: 130px"><i class="fa fa-step-forward"></i><span> Limit</span></label>
|
|
283
|
+
<input type="number" id="node-input-limit" min="0" step="1" style="width:20%">
|
|
284
|
+
</div>
|
|
285
|
+
<div class="form-row">
|
|
286
|
+
<label for="node-input-paging" style="width: 130px"><i class="fa fa-eject"></i><span> Paging</span></label>
|
|
287
|
+
<input type="number" id="node-input-paging" min="0" max="1000" step="1" style="width:20%">
|
|
288
|
+
</div>
|
|
289
|
+
<div class="form-row">
|
|
290
|
+
<label for="node-input-offset" style="width: 130px"><i class="fa fa-forward"></i><span> Offset</span></label>
|
|
291
|
+
<input type="number" id="node-input-offset" min="0" step="1" style="width:20%">
|
|
292
|
+
</div>
|
|
293
|
+
<div class="form-row">
|
|
294
|
+
<label for="node-input-delay" style="width: 130px"><i class="fa fa-clock-o"></i><span> Pag. delay (s)</span></label>
|
|
295
|
+
<input type="number" id="node-input-delay" min="0" max="600" step="1" style="width:20%">
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<div class="form-row" id="node-row-editor-dynamic">
|
|
300
|
+
<div class="form-row">
|
|
301
|
+
<label for="node-input-params" style="width: 130px"><i class="fa fa-code"></i> Source of body</label>
|
|
302
|
+
<input type="text" id="node-input-body-source" style="width: 65%">
|
|
303
|
+
<input type="hidden" id="node-input-body-source-type" style="width: 0px">
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<div class="form-row" id="node-row-error-option">
|
|
308
|
+
<div style="margin-bottom: 10px;"></div>
|
|
309
|
+
<label style="width: 130px"><span>If an error occurs</span></label>
|
|
310
|
+
<div style="margin-bottom: 5px;"></div>
|
|
311
|
+
<div class="form-row">
|
|
312
|
+
<label for="node-input-repeat" style="width: 130px"><i class="fa fa-repeat"></i><span> Req. repeat</span></label>
|
|
313
|
+
<input type="number" id="node-input-repeat" min="0" max="10" step="1" style="width:20%">
|
|
314
|
+
</div>
|
|
315
|
+
<div class="form-row">
|
|
316
|
+
<label for="node-input-rdelay" style="width: 130px"><i class="fa fa-clock-o"></i><span> Req. delay (s)</span></label>
|
|
317
|
+
<input type="number" id="node-input-rdelay" min="0" max="600" step="1" style="width:20%">
|
|
318
|
+
</div>
|
|
288
319
|
</div>
|
|
289
|
-
|
|
290
|
-
</div>
|
|
320
|
+
|
|
291
321
|
</div>
|
|
322
|
+
</div>
|
|
292
323
|
</script>
|
|
293
324
|
|
|
294
325
|
<script type="text/javascript">
|
|
295
|
-
RED.nodes.registerType(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
$('#node-input-limit').val(this.limit);
|
|
368
|
-
$('#node-input-paging').val(this.paging);
|
|
369
|
-
$('#node-input-offset').val(this.offset);
|
|
370
|
-
|
|
371
|
-
$('#node-input-mode').val(this.mode);
|
|
372
|
-
$('#node-input-body-source').val(this.bodysource);
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
if(this.mode===true) {
|
|
376
|
-
values = values2;
|
|
377
|
-
} else {
|
|
378
|
-
values = values1;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
$('#node-input-mode').on('change', function() {
|
|
382
|
-
if ($(this).is(':checked')) {
|
|
383
|
-
values = values2;
|
|
384
|
-
if($('#node-input-source').val()=='static'){ $('#node-row-response-option').show(); }
|
|
385
|
-
} else {
|
|
386
|
-
values = values1;
|
|
387
|
-
$('#node-row-response-option').hide();
|
|
388
|
-
}
|
|
389
|
-
let se = fillEntity (values)
|
|
390
|
-
fillMethod (se)
|
|
391
|
-
})
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
function fillEntity (values) {
|
|
395
|
-
$('#node-input-entity').empty()
|
|
396
|
-
for (let value of values) {
|
|
397
|
-
$('#node-input-entity').append($("<option></option>").attr("value", value.v).text(value.e));
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
const fe = $('#node-input-entity option[value=' + entity +']').val();
|
|
401
|
-
if(fe != undefined ) {
|
|
402
|
-
$('#node-input-entity').val(entity);
|
|
403
|
-
} else {
|
|
404
|
-
$('#node-input-entity').prop('selectedIndex',0);;
|
|
405
|
-
}
|
|
406
|
-
return $('#node-input-entity').val();
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
function fillMethod (entity) {
|
|
410
|
-
$('#node-input-method').empty()
|
|
411
|
-
for (let value of values) {
|
|
412
|
-
if (value.v === entity) {
|
|
413
|
-
for (let method of value.m) {
|
|
414
|
-
$('#node-input-method').append($("<option></option>").attr("value", method).text(method));
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
const fe = $('#node-input-method option[value=' + method +']').val();
|
|
420
|
-
if(fe != undefined ) {
|
|
421
|
-
$('#node-input-method').val(method);
|
|
422
|
-
} else {
|
|
423
|
-
$('#node-input-method').prop('selectedIndex',0);;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
$('#node-input-entity').on('change', function() {
|
|
428
|
-
fillMethod ($(this).val())
|
|
429
|
-
})
|
|
430
|
-
|
|
431
|
-
$('#node-input-source').on('change', function() {
|
|
432
|
-
if($(this).val()=='static') {
|
|
433
|
-
$('#node-row-editor').show();
|
|
434
|
-
$('#node-row-editor-dynamic').hide();
|
|
435
|
-
if($('#node-input-mode').is(':checked') == true) {
|
|
436
|
-
$('#node-row-response-option').show();
|
|
437
|
-
}
|
|
438
|
-
} else {
|
|
439
|
-
$('#node-row-editor').hide();
|
|
440
|
-
$('#node-row-editor-dynamic').show();
|
|
441
|
-
$('#node-row-response-option').hide();
|
|
442
|
-
}
|
|
443
|
-
})
|
|
444
|
-
|
|
445
|
-
$("#node-input-body-source").typedInput({
|
|
446
|
-
type:"msg",
|
|
447
|
-
types:["msg"],
|
|
448
|
-
typeField: "#node-input-body-source-type"
|
|
449
|
-
})
|
|
450
|
-
|
|
451
|
-
$('#node-input-limit').on('change', function() {
|
|
452
|
-
if(!$.isNumeric($(this).val())) { $(this).val(0) }
|
|
453
|
-
})
|
|
454
|
-
|
|
455
|
-
$('#node-input-paging').on('change', function() {
|
|
456
|
-
if(!$.isNumeric($(this).val())) { $(this).val(1000) }
|
|
457
|
-
})
|
|
458
|
-
|
|
459
|
-
$('#node-input-offset').on('change', function() {
|
|
460
|
-
if(!$.isNumeric($(this).val())) { $(this).val(0) }
|
|
461
|
-
})
|
|
462
|
-
|
|
463
|
-
this.editorp = RED.editor.createEditor({
|
|
464
|
-
id: 'node-input-params',
|
|
465
|
-
mode: 'ace/mode/text',
|
|
466
|
-
value: this.cparams
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
this.editorb = RED.editor.createEditor({
|
|
470
|
-
id: 'node-input-body',
|
|
471
|
-
mode: 'ace/mode/json',
|
|
472
|
-
value: this.cbody
|
|
473
|
-
});
|
|
474
|
-
|
|
475
|
-
const tabs = RED.tabs.create({
|
|
476
|
-
id: "config-tabs",
|
|
477
|
-
onchange: function(tab) {
|
|
478
|
-
$("#config-tabs-content").children().hide();
|
|
479
|
-
$("#" + tab.id).show();
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
tabs.addTab({
|
|
484
|
-
id: "config-tab-config",
|
|
485
|
-
label: "Configuration"
|
|
486
|
-
});
|
|
487
|
-
},
|
|
488
|
-
oneditsave: function(){
|
|
489
|
-
this.mode = $("#node-input-mode").val();
|
|
490
|
-
this.entity = $("#node-input-entity").val();
|
|
491
|
-
this.method = $("#node-input-method").val();
|
|
492
|
-
this.source = $("#node-input-source").val();
|
|
493
|
-
this.merge = $("#node-input-merge").val();
|
|
494
|
-
this.bodysource = $("#node-input-body-source").val();
|
|
495
|
-
|
|
496
|
-
if(!$("#node-input-limit").val()) {this.limit = 0} else {this.limit = $("#node-input-limit").val();}
|
|
497
|
-
if(!$("#node-input-offset").val()) {this.offset = 0} else {this.offset = $("#node-input-offset").val();}
|
|
498
|
-
this.paging = $("#node-input-paging").val();
|
|
499
|
-
|
|
500
|
-
this.cparams = this.editorp.getValue();
|
|
501
|
-
this.editorp.destroy();
|
|
502
|
-
delete this.editorp;
|
|
503
|
-
|
|
504
|
-
this.cbody = this.editorb.getValue();
|
|
505
|
-
this.editorb.destroy();
|
|
506
|
-
delete this.editorb;
|
|
326
|
+
RED.nodes.registerType("teamogy-client", {
|
|
327
|
+
category: "TF collection",
|
|
328
|
+
color: "#fe4c00",
|
|
329
|
+
defaults: {
|
|
330
|
+
name: {
|
|
331
|
+
value: "",
|
|
332
|
+
},
|
|
333
|
+
configuration: {
|
|
334
|
+
type: "teamogy-config",
|
|
335
|
+
required: true,
|
|
336
|
+
},
|
|
337
|
+
mode: {
|
|
338
|
+
value: false,
|
|
339
|
+
},
|
|
340
|
+
method: {
|
|
341
|
+
value: "GET",
|
|
342
|
+
},
|
|
343
|
+
entity: {
|
|
344
|
+
value: "r_users",
|
|
345
|
+
},
|
|
346
|
+
source: {
|
|
347
|
+
value: "static",
|
|
348
|
+
},
|
|
349
|
+
cparams: {
|
|
350
|
+
value: "",
|
|
351
|
+
},
|
|
352
|
+
cbody: {
|
|
353
|
+
value: "",
|
|
354
|
+
},
|
|
355
|
+
bodysource: {
|
|
356
|
+
value: "payload",
|
|
357
|
+
},
|
|
358
|
+
merge: {
|
|
359
|
+
value: true,
|
|
360
|
+
},
|
|
361
|
+
limit: {
|
|
362
|
+
value: 0,
|
|
363
|
+
required: true,
|
|
364
|
+
},
|
|
365
|
+
paging: {
|
|
366
|
+
value: 1000,
|
|
367
|
+
required: true,
|
|
368
|
+
},
|
|
369
|
+
offset: {
|
|
370
|
+
value: 0,
|
|
371
|
+
required: true,
|
|
372
|
+
},
|
|
373
|
+
delay: {
|
|
374
|
+
value: 0,
|
|
375
|
+
required: true,
|
|
376
|
+
},
|
|
377
|
+
repeat: {
|
|
378
|
+
value: 5,
|
|
379
|
+
required: true,
|
|
380
|
+
},
|
|
381
|
+
rdelay: {
|
|
382
|
+
value: 30,
|
|
383
|
+
required: true,
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
inputs: 1,
|
|
387
|
+
outputs: 1,
|
|
388
|
+
icon: "bridge.svg",
|
|
389
|
+
align: "left",
|
|
390
|
+
label: function () {
|
|
391
|
+
return this.name || "teamogy";
|
|
392
|
+
},
|
|
393
|
+
paletteLabel: function () {
|
|
394
|
+
return this.name || "teamogy";
|
|
395
|
+
},
|
|
396
|
+
labelStyle: function () {
|
|
397
|
+
return this.name ? "node_label_italic" : "";
|
|
507
398
|
},
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
399
|
+
oneditprepare: function () {
|
|
400
|
+
let values;
|
|
401
|
+
let mode = this.mode;
|
|
402
|
+
let entity = this.entity;
|
|
403
|
+
let method = this.method;
|
|
404
|
+
let source = this.source;
|
|
405
|
+
let params = this.cparams;
|
|
406
|
+
let body = this.cbody;
|
|
407
|
+
|
|
408
|
+
$("#node-input-source").val(this.source);
|
|
409
|
+
$("#node-input-merge").val(this.merge);
|
|
410
|
+
$("#node-input-limit").val(this.limit);
|
|
411
|
+
$("#node-input-paging").val(this.paging);
|
|
412
|
+
$("#node-input-offset").val(this.offset);
|
|
413
|
+
$("#node-input-delay").val(this.delay);
|
|
414
|
+
$("#node-input-repeat").val(this.repeat);
|
|
415
|
+
$("#node-input-rdelay").val(this.rdelay);
|
|
416
|
+
|
|
417
|
+
$("#node-input-mode").val(this.mode);
|
|
418
|
+
$("#node-input-body-source").val(this.bodysource);
|
|
419
|
+
|
|
420
|
+
if (this.mode === true) {
|
|
421
|
+
values = values2;
|
|
422
|
+
} else {
|
|
423
|
+
values = values1;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
$("#node-input-mode").on("change", function () {
|
|
427
|
+
if ($(this).is(":checked")) {
|
|
428
|
+
values = values2;
|
|
429
|
+
if ($("#node-input-source").val() == "static") {
|
|
430
|
+
$("#node-row-response-option").show();
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
values = values1;
|
|
434
|
+
$("#node-row-response-option").hide();
|
|
435
|
+
}
|
|
436
|
+
let se = fillEntity(values);
|
|
437
|
+
fillMethod(se);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
function fillEntity(values) {
|
|
441
|
+
$("#node-input-entity").empty();
|
|
442
|
+
for (let value of values) {
|
|
443
|
+
$("#node-input-entity").append(
|
|
444
|
+
$("<option></option>").attr("value", value.v).text(value.e),
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const fe = $("#node-input-entity option[value=" + entity + "]").val();
|
|
449
|
+
if (fe != undefined) {
|
|
450
|
+
$("#node-input-entity").val(entity);
|
|
451
|
+
} else {
|
|
452
|
+
$("#node-input-entity").prop("selectedIndex", 0);
|
|
453
|
+
}
|
|
454
|
+
return $("#node-input-entity").val();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function fillMethod(entity) {
|
|
458
|
+
$("#node-input-method").empty();
|
|
459
|
+
for (let value of values) {
|
|
460
|
+
if (value.v === entity) {
|
|
461
|
+
for (let method of value.m) {
|
|
462
|
+
$("#node-input-method").append(
|
|
463
|
+
$("<option></option>").attr("value", method).text(method),
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
const fe = $("#node-input-method option[value=" + method + "]").val();
|
|
470
|
+
if (fe != undefined) {
|
|
471
|
+
$("#node-input-method").val(method);
|
|
472
|
+
} else {
|
|
473
|
+
$("#node-input-method").prop("selectedIndex", 0);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
$("#node-input-entity").on("change", function () {
|
|
478
|
+
fillMethod($(this).val());
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
$("#node-input-source").on("change", function () {
|
|
482
|
+
if ($(this).val() == "static") {
|
|
483
|
+
$("#node-row-editor").show();
|
|
484
|
+
$("#node-row-editor-dynamic").hide();
|
|
485
|
+
if ($("#node-input-mode").is(":checked") == true) {
|
|
486
|
+
$("#node-row-response-option").show();
|
|
487
|
+
}
|
|
488
|
+
} else {
|
|
489
|
+
$("#node-row-editor").hide();
|
|
490
|
+
$("#node-row-editor-dynamic").show();
|
|
491
|
+
$("#node-row-response-option").hide();
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
$("#node-input-body-source").typedInput({
|
|
496
|
+
type: "msg",
|
|
497
|
+
types: ["msg"],
|
|
498
|
+
typeField: "#node-input-body-source-type",
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
$("#node-input-limit").on("change", function () {
|
|
502
|
+
if (!$.isNumeric($(this).val())) {
|
|
503
|
+
$(this).val(0);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
$("#node-input-paging").on("change", function () {
|
|
508
|
+
if (!$.isNumeric($(this).val())) {
|
|
509
|
+
$(this).val(1000);
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
$("#node-input-offset").on("change", function () {
|
|
514
|
+
if (!$.isNumeric($(this).val())) {
|
|
515
|
+
$(this).val(0);
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
$("#node-input-delay").on("change", function () {
|
|
520
|
+
if (!$.isNumeric($(this).val())) {
|
|
521
|
+
$(this).val(0);
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
$("#node-input-repeat").on("change", function () {
|
|
525
|
+
if (!$.isNumeric($(this).val())) {
|
|
526
|
+
$(this).val(5);
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
$("#node-input-rdelay").on("change", function () {
|
|
531
|
+
if (!$.isNumeric($(this).val())) {
|
|
532
|
+
$(this).val(30);
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
this.editorp = RED.editor.createEditor({
|
|
537
|
+
id: "node-input-params",
|
|
538
|
+
mode: "ace/mode/text",
|
|
539
|
+
value: this.cparams,
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
this.editorb = RED.editor.createEditor({
|
|
543
|
+
id: "node-input-body",
|
|
544
|
+
mode: "ace/mode/json",
|
|
545
|
+
value: this.cbody,
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
const tabs = RED.tabs.create({
|
|
549
|
+
id: "config-tabs",
|
|
550
|
+
onchange: function (tab) {
|
|
551
|
+
$("#config-tabs-content").children().hide();
|
|
552
|
+
$("#" + tab.id).show();
|
|
553
|
+
},
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
tabs.addTab({
|
|
557
|
+
id: "config-tab-config",
|
|
558
|
+
label: "Configuration",
|
|
559
|
+
});
|
|
560
|
+
},
|
|
561
|
+
oneditsave: function () {
|
|
562
|
+
this.mode = $("#node-input-mode").val();
|
|
563
|
+
this.entity = $("#node-input-entity").val();
|
|
564
|
+
this.method = $("#node-input-method").val();
|
|
565
|
+
this.source = $("#node-input-source").val();
|
|
566
|
+
this.merge = $("#node-input-merge").val();
|
|
567
|
+
this.bodysource = $("#node-input-body-source").val();
|
|
568
|
+
|
|
569
|
+
if (!$("#node-input-limit").val()) {
|
|
570
|
+
this.limit = 0;
|
|
571
|
+
} else {
|
|
572
|
+
this.limit = $("#node-input-limit").val();
|
|
573
|
+
}
|
|
574
|
+
if (!$("#node-input-offset").val()) {
|
|
575
|
+
this.offset = 0;
|
|
576
|
+
} else {
|
|
577
|
+
this.offset = $("#node-input-offset").val();
|
|
578
|
+
}
|
|
579
|
+
this.paging = $("#node-input-paging").val();
|
|
580
|
+
|
|
581
|
+
if (!$("#node-input-delay").val()) {
|
|
582
|
+
this.delay = 0;
|
|
583
|
+
} else {
|
|
584
|
+
this.delay = $("#node-input-delay").val();
|
|
585
|
+
}
|
|
586
|
+
if (!$("#node-input-repeat").val()) {
|
|
587
|
+
this.repeat = 0;
|
|
588
|
+
} else {
|
|
589
|
+
this.repeat = $("#node-input-repeat").val();
|
|
590
|
+
}
|
|
591
|
+
if (!$("#node-input-rdelay").val()) {
|
|
592
|
+
this.rdelay = 0;
|
|
593
|
+
} else {
|
|
594
|
+
this.rdelay = $("#node-input-rdelay").val();
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
this.cparams = this.editorp.getValue();
|
|
598
|
+
this.editorp.destroy();
|
|
599
|
+
delete this.editorp;
|
|
600
|
+
|
|
601
|
+
this.cbody = this.editorb.getValue();
|
|
602
|
+
this.editorb.destroy();
|
|
603
|
+
delete this.editorb;
|
|
604
|
+
},
|
|
605
|
+
oneditcancel: function () {
|
|
606
|
+
this.editorp.destroy();
|
|
607
|
+
delete this.editorp;
|
|
608
|
+
|
|
609
|
+
this.editorb.destroy();
|
|
610
|
+
delete this.editorb;
|
|
611
|
+
},
|
|
612
|
+
});
|
|
516
613
|
</script>
|
|
517
614
|
|
|
518
615
|
<script type="text/html" data-help-name="teamogy-client">
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
</
|
|
616
|
+
<p>Connect to a Teamogy API.</p>
|
|
617
|
+
|
|
618
|
+
<p>You must configure Connection before using this node.</p>
|
|
619
|
+
|
|
620
|
+
<h3>Connection configuration</h3>
|
|
621
|
+
<dl class="message-properties">
|
|
622
|
+
<dt class="optional">
|
|
623
|
+
Name (optional)<span class="property-type">string</span>
|
|
624
|
+
</dt>
|
|
625
|
+
<dd>you can enter a name or it will be generated on first save</dd>
|
|
626
|
+
<dt>Subdomain (required)<span class="property-type">string</span></dt>
|
|
627
|
+
<dd>
|
|
628
|
+
enter the name of the subdomain and the domain, in the format:
|
|
629
|
+
subdomain.domain.com
|
|
630
|
+
</dd>
|
|
631
|
+
<dt>Unit/Agency (required)<span class="property-type">number</span></dt>
|
|
632
|
+
<dd>enter the number of unit or agency</dd>
|
|
633
|
+
<dt>Token (required)<span class="property-type">string</span></dt>
|
|
634
|
+
<dd>
|
|
635
|
+
enter the generated API token for the given subdomain and Unit/Agency
|
|
636
|
+
</dd>
|
|
637
|
+
<dt>Req/min (required)<span class="property-type">number</span></dt>
|
|
638
|
+
<dd>
|
|
639
|
+
enter the maximum number of API requests per minute for the given
|
|
640
|
+
subdomain, if the limit is greater than allowed, further requests will be
|
|
641
|
+
rejected (not processed)
|
|
642
|
+
</dd>
|
|
643
|
+
</dl>
|
|
644
|
+
|
|
645
|
+
<h3>Input</h3>
|
|
646
|
+
<dl class="message-properties">
|
|
647
|
+
<dt class="optional">
|
|
648
|
+
Name (optional)<span class="property-type">string</span>
|
|
649
|
+
</dt>
|
|
650
|
+
<dd>you can enter a name for the given node (recommended)</dd>
|
|
651
|
+
<dt>
|
|
652
|
+
Connection (required)<span class="property-type">selection - list</span>
|
|
653
|
+
</dt>
|
|
654
|
+
<dd>select the configured connection</dd>
|
|
655
|
+
<dt>
|
|
656
|
+
Request views (required)<span class="property-type"
|
|
657
|
+
>checkbox - yes/no</span
|
|
658
|
+
>
|
|
659
|
+
</dt>
|
|
660
|
+
<dd>check for requests for API views (see description below)</dd>
|
|
661
|
+
<dt>Token (required)<span class="property-type">selection - list</span></dt>
|
|
662
|
+
<dd>select the desired entity</dd>
|
|
663
|
+
<dt>
|
|
664
|
+
Req/min (required)<span class="property-type">selection - list</span>
|
|
665
|
+
</dt>
|
|
666
|
+
<dd>select an available method</dd>
|
|
667
|
+
<dt>
|
|
668
|
+
Source (required)<span class="property-type">selection - list</span>
|
|
669
|
+
</dt>
|
|
670
|
+
<dd>
|
|
671
|
+
the parameters or even the request body can be static, i.e. from the
|
|
672
|
+
Params and Body fields in the form, or dynamic as part of the input
|
|
673
|
+
message.
|
|
674
|
+
</dd>
|
|
675
|
+
<dt>Source of body (required)<span class="property-type">string</span></dt>
|
|
676
|
+
<dd>the parameter set the source of the body, default is msg.payload</dd>
|
|
677
|
+
<dt>Params (optional)<span class="property-type">string | object</span></dt>
|
|
678
|
+
<dd>
|
|
679
|
+
you can enter the params in the case of a static request as a string, in
|
|
680
|
+
the case of a dynamic also as an object, according to the API
|
|
681
|
+
specification for the given entity
|
|
682
|
+
</dd>
|
|
683
|
+
<dd> </dd>
|
|
684
|
+
<dd>Examples:</dd>
|
|
685
|
+
<dd>
|
|
686
|
+
In the case of a static request, enter the desired values according to
|
|
687
|
+
the selected entity and method in the Params field. Values for Params
|
|
688
|
+
are listed on separate lines.
|
|
689
|
+
</dd>
|
|
690
|
+
<dd>id=3</dd>
|
|
691
|
+
<dd>registration=12345678</dd>
|
|
692
|
+
<dd> </dd>
|
|
693
|
+
<dd>In the case of a static request for API views</dd>
|
|
694
|
+
<dd>columns=firstName,lastName</dd>
|
|
695
|
+
<dd>externalFilter=id>5</dd>
|
|
696
|
+
<dd> </dd>
|
|
697
|
+
<dd>In the case of a dynamic request for API views, as string</dd>
|
|
698
|
+
<dd>id=2&name=John</dd>
|
|
699
|
+
<dd> </dd>
|
|
700
|
+
<dd>or also as an object</dd>
|
|
701
|
+
<dd>msg.params.id = 2</dd>
|
|
702
|
+
<dd>msg.params.name = "John"</dd>
|
|
703
|
+
<dd> </dd>
|
|
704
|
+
<dt>
|
|
705
|
+
Body (optional)<span class="property-type">JSON string | object</span>
|
|
706
|
+
</dt>
|
|
707
|
+
<dd>
|
|
708
|
+
you can enter the body in the case of a static request as a JSON string,
|
|
709
|
+
in the case of a dynamic also as an object, you can nest objects and
|
|
710
|
+
arrays in the body without restrictions according to the API specification
|
|
711
|
+
for the given entity
|
|
712
|
+
</dd>
|
|
713
|
+
<dd> </dd>
|
|
714
|
+
<dd>Examples:</dd>
|
|
715
|
+
<dd>
|
|
716
|
+
In the case of a static request, enter the desired values according to
|
|
717
|
+
the selected entity and method in the Body field.
|
|
718
|
+
</dd>
|
|
719
|
+
<dd>{</dd>
|
|
720
|
+
<dd> "id": 3,</dd>
|
|
721
|
+
<dd> "registration": 12345678</dd>
|
|
722
|
+
<dd>}</dd>
|
|
723
|
+
<dd> </dd>
|
|
724
|
+
<dd>In the case of a dynamic request for API views, as JSON string</dd>
|
|
725
|
+
<dd>{"id": 3,"name": "John"}</dd>
|
|
726
|
+
<dd> </dd>
|
|
727
|
+
<dd>or also as an object</dd>
|
|
728
|
+
<dd>msg.body.id = 2</dd>
|
|
729
|
+
<dd>msg.body.name = "John"</dd>
|
|
730
|
+
<dd>msg.body.address = addresses // array of objects</dd>
|
|
731
|
+
<dd> </dd>
|
|
732
|
+
<dd>
|
|
733
|
+
If you use requests for API views you can use additional options, the
|
|
734
|
+
options can also be used in dynamic requests
|
|
735
|
+
</dd>
|
|
736
|
+
<dt class="optional">
|
|
737
|
+
Merge (optional) (also in msg.merge (boolean))<span class="property-type"
|
|
738
|
+
>checkbox - yes/no</span
|
|
739
|
+
>
|
|
740
|
+
</dt>
|
|
741
|
+
<dd>
|
|
742
|
+
check if you want the output message to contain all returned records. In
|
|
743
|
+
the background, processing is still taking place according to the Paging
|
|
744
|
+
settings, but individual messages are not sent to the output, but only the
|
|
745
|
+
final merged one containing all the returned records. (if not specified
|
|
746
|
+
the value no is used)
|
|
747
|
+
</dd>
|
|
748
|
+
<dt class="optional">
|
|
749
|
+
Limit (optional) (also in msg.limit)<span class="property-type"
|
|
750
|
+
>number</span
|
|
751
|
+
>
|
|
752
|
+
</dt>
|
|
753
|
+
<dd>
|
|
754
|
+
limitation of the total number of records in the response (if not
|
|
755
|
+
specified, the value 0 is used, the value 0 means no limit)
|
|
756
|
+
</dd>
|
|
757
|
+
<dt class="optional">
|
|
758
|
+
Paging (optional) (also in msg.paging)<span class="property-type"
|
|
759
|
+
>number</span
|
|
760
|
+
>
|
|
761
|
+
</dt>
|
|
762
|
+
<dd>
|
|
763
|
+
division of responses into multiple parts with the number of records
|
|
764
|
+
returned (if not specified, the value 1000 is used)
|
|
765
|
+
</dd>
|
|
766
|
+
<dt class="optional">
|
|
767
|
+
Offset (optional) (also in msg.offset)<span class="property-type"
|
|
768
|
+
>number</span
|
|
769
|
+
>
|
|
770
|
+
</dt>
|
|
771
|
+
<dd>
|
|
772
|
+
specifies from which record to start returning data. For example, if you
|
|
773
|
+
have 100 records total and want to return records 50-100, set Offset to
|
|
774
|
+
50. To return all records from the beginning, leave it at 0 (if not
|
|
775
|
+
specified, the value 0 is used))
|
|
776
|
+
</dd>
|
|
777
|
+
<dt class="optional">
|
|
778
|
+
Delay (optional) (also in msg.delay)<span class="property-type"
|
|
779
|
+
>number</span
|
|
780
|
+
>
|
|
781
|
+
</dt>
|
|
782
|
+
<dd>
|
|
783
|
+
specifies the delay between requests, which is used for pagination (if not
|
|
784
|
+
specified, the value 0 is used)
|
|
785
|
+
</dd>
|
|
786
|
+
<dt class="optional">
|
|
787
|
+
Req. repeat (optional) (also in msg.repeat)<span class="property-type"
|
|
788
|
+
>number</span
|
|
789
|
+
>
|
|
790
|
+
</dt>
|
|
791
|
+
<dd>
|
|
792
|
+
specifies the number of errors after which the request will be repeated
|
|
793
|
+
(if not specified, the value 5 is used)
|
|
794
|
+
</dd>
|
|
795
|
+
<dt class="optional">
|
|
796
|
+
Req. delay (s) (optional) (also in msg.rdelay)<span class="property-type"
|
|
797
|
+
>number</span
|
|
798
|
+
>
|
|
799
|
+
</dt>
|
|
800
|
+
<dd>
|
|
801
|
+
specifies the delay between requests, which is used when retrying a
|
|
802
|
+
request in case of an error (if not specified, the value 30 is used)
|
|
803
|
+
</dd>
|
|
804
|
+
<dt class="optional">
|
|
805
|
+
Skip (optional in message only, msg.skip)<span class="property-type"
|
|
806
|
+
>boolean</span
|
|
807
|
+
>
|
|
808
|
+
</dt>
|
|
809
|
+
<dd>
|
|
810
|
+
adding the msg.skip=true will allow the message to pass through to the
|
|
811
|
+
output without processing
|
|
812
|
+
</dd>
|
|
813
|
+
<dt class="optional">
|
|
814
|
+
Connection (optional in message, msg.connection)<span
|
|
815
|
+
class="property-type"
|
|
816
|
+
>string</span
|
|
817
|
+
>
|
|
818
|
+
</dt>
|
|
819
|
+
<dd>replaces connection from configuration, use connection name</dd>
|
|
820
|
+
<dt class="optional">
|
|
821
|
+
Unit (optional in message, msg.unit)<span class="property-type"
|
|
822
|
+
>number</span
|
|
823
|
+
>
|
|
824
|
+
</dt>
|
|
825
|
+
<dd>replaces unit from connection configuration, use unit/agency id</dd>
|
|
826
|
+
<dt class="optional">
|
|
827
|
+
Entity (optional in message, msg.entity)<span class="property-type"
|
|
828
|
+
>string</span
|
|
829
|
+
>
|
|
830
|
+
</dt>
|
|
831
|
+
<dd>
|
|
832
|
+
replaces entity from configuration, use v_entityName for views or
|
|
833
|
+
r_entityName
|
|
834
|
+
</dd>
|
|
835
|
+
<dt class="optional">
|
|
836
|
+
Method (optional in message, msg.method)<span class="property-type"
|
|
837
|
+
>string</span
|
|
838
|
+
>
|
|
839
|
+
</dt>
|
|
840
|
+
<dd>
|
|
841
|
+
replaces method from configuration, use the available method for the given
|
|
842
|
+
entity
|
|
843
|
+
</dd>
|
|
844
|
+
</dl>
|
|
845
|
+
|
|
846
|
+
<h3>Output</h3>
|
|
847
|
+
<dl class="message-properties">
|
|
848
|
+
<dt>payload<span class="property-type">string | object</span></dt>
|
|
849
|
+
<dd>the standard output of the response</dd>
|
|
850
|
+
<dt>count<span class="property-type">number</span></dt>
|
|
851
|
+
<dd>number of records in the output</dd>
|
|
852
|
+
<dt>error<span class="property-type">string</span></dt>
|
|
853
|
+
<dd>error message</dd>
|
|
854
|
+
<dt>msg.*<span class="property-type">string | object</span></dt>
|
|
855
|
+
<dd>all properties of the input message</dd>
|
|
856
|
+
</dl>
|
|
857
|
+
|
|
858
|
+
<h3>References</h3>
|
|
859
|
+
<ul>
|
|
860
|
+
<li>
|
|
861
|
+
<a href="https://teamogy.com/teamogy-flow">Teamogy Flow docs</a> - full
|
|
862
|
+
description of Teamogy Flow
|
|
863
|
+
</li>
|
|
864
|
+
<li>
|
|
865
|
+
<a href="https://readme.teamogy.com/reference/integration-options"
|
|
866
|
+
>Teamogy API docs</a
|
|
867
|
+
>
|
|
868
|
+
- full description of parameters for <code>msg.params</code> and
|
|
869
|
+
<code>msg.body</code> properties, and also options for API views
|
|
870
|
+
</li>
|
|
871
|
+
</ul>
|
|
872
|
+
</script>
|