node-red-contrib-mobius-flow-base 3.1.5 → 3.1.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.
@@ -8,9 +8,9 @@ class EngineApiCalls {
8
8
  this.apiClient = apiClient;
9
9
  };
10
10
  discover = async (uri, callback) => {
11
- if (!this.apiClient)
12
- throw new Error('No API client set');
13
11
  try {
12
+ if (!this.apiClient)
13
+ throw new Error('No API client set');
14
14
  const response = await this.apiClient({
15
15
  method: 'get',
16
16
  url: `/mobius/discover/${uri}`,
@@ -22,9 +22,9 @@ class EngineApiCalls {
22
22
  }
23
23
  };
24
24
  writeResource = async (uri, value, priority, callback) => {
25
- if (!this.apiClient)
26
- throw new Error('No API client set');
27
25
  try {
26
+ if (!this.apiClient)
27
+ throw new Error('No API client set');
28
28
  const response = await this.apiClient({
29
29
  method: 'patch',
30
30
  url: `/mobius/object/resource/${uri}`,
@@ -40,9 +40,9 @@ class EngineApiCalls {
40
40
  }
41
41
  };
42
42
  writeMultiResource = async (uri, updates, callback) => {
43
- if (!this.apiClient)
44
- throw new Error('No API client set');
45
43
  try {
44
+ if (!this.apiClient)
45
+ throw new Error('No API client set');
46
46
  const response = await this.apiClient({
47
47
  method: 'patch',
48
48
  url: `/mobius/object/resource/${uri}`,
@@ -55,9 +55,9 @@ class EngineApiCalls {
55
55
  }
56
56
  };
57
57
  clearResource = async (uri, priority, callback) => {
58
- if (!this.apiClient)
59
- throw new Error('No API client set');
60
58
  try {
59
+ if (!this.apiClient)
60
+ throw new Error('No API client set');
61
61
  const response = await this.apiClient({
62
62
  method: 'patch',
63
63
  url: `/mobius/object/resource/clear/${uri}`,
@@ -72,9 +72,9 @@ class EngineApiCalls {
72
72
  }
73
73
  };
74
74
  readResource = async (uri, callback) => {
75
- if (!this.apiClient)
76
- throw new Error('No API client set');
77
75
  try {
76
+ if (!this.apiClient)
77
+ throw new Error('No API client set');
78
78
  const response = await this.apiClient({
79
79
  method: 'get',
80
80
  url: `/mobius/object/resource/${uri}`,
@@ -86,9 +86,9 @@ class EngineApiCalls {
86
86
  }
87
87
  };
88
88
  readObject = async (uri, callback) => {
89
- if (!this.apiClient)
90
- throw new Error('No API client set');
91
89
  try {
90
+ if (!this.apiClient)
91
+ throw new Error('No API client set');
92
92
  const response = await this.apiClient({
93
93
  method: 'get',
94
94
  url: `/mobius/object/${uri}`,
@@ -100,9 +100,9 @@ class EngineApiCalls {
100
100
  }
101
101
  };
102
102
  sendBroadcastCommand = async (cid, commandData) => {
103
- if (!this.apiClient)
104
- throw new Error('No API client set');
105
103
  try {
104
+ if (!this.apiClient)
105
+ throw new Error('No API client set');
106
106
  const response = await this.apiClient({
107
107
  method: 'post',
108
108
  url: `/mobius/command/${cid}`,
@@ -114,9 +114,9 @@ class EngineApiCalls {
114
114
  }
115
115
  };
116
116
  sendDirectCommand = async (uri, cid, commandData, timeout, callback) => {
117
- if (!this.apiClient)
118
- throw new Error('No API client set');
119
117
  try {
118
+ if (!this.apiClient)
119
+ throw new Error('No API client set');
120
120
  const response = await this.apiClient({
121
121
  method: 'post',
122
122
  url: `/mobius/directCommand/${cid}`,
@@ -133,9 +133,9 @@ class EngineApiCalls {
133
133
  }
134
134
  };
135
135
  getServiceConfig = async (uri, callback) => {
136
- if (!this.apiClient)
137
- throw new Error('No API client set');
138
136
  try {
137
+ if (!this.apiClient)
138
+ throw new Error('No API client set');
139
139
  const response = await this.apiClient({
140
140
  method: 'get',
141
141
  url: `/mobius/service/config/${uri}`,
@@ -147,9 +147,9 @@ class EngineApiCalls {
147
147
  }
148
148
  };
149
149
  updateObject = async (uri, config, callback) => {
150
- if (!this.apiClient)
151
- throw new Error('No API client set');
152
150
  try {
151
+ if (!this.apiClient)
152
+ throw new Error('No API client set');
153
153
  const response = await this.apiClient({
154
154
  method: 'post',
155
155
  url: `/mobius/object/config/${uri}`,
@@ -162,9 +162,9 @@ class EngineApiCalls {
162
162
  }
163
163
  };
164
164
  filterObjectsByRIDValue = async (uri, pids, rid, limit, func, callback) => {
165
- if (!this.apiClient)
166
- throw new Error('No API client set');
167
165
  try {
166
+ if (!this.apiClient)
167
+ throw new Error('No API client set');
168
168
  const discoveries = [];
169
169
  for (let pid of pids) {
170
170
  discoveries.push(this.apiClient({
@@ -211,9 +211,9 @@ class EngineApiCalls {
211
211
  }
212
212
  };
213
213
  getHubId = async (callback) => {
214
- if (!this.apiClient)
215
- throw new Error('No API client set');
216
214
  try {
215
+ if (!this.apiClient)
216
+ throw new Error('No API client set');
217
217
  const response = await this.apiClient({
218
218
  method: 'get',
219
219
  url: `/mobius/admin/settings`,
@@ -225,9 +225,9 @@ class EngineApiCalls {
225
225
  }
226
226
  };
227
227
  getNodeConfig = async (uri, callback) => {
228
- if (!this.apiClient)
229
- throw new Error('No API client set');
230
228
  try {
229
+ if (!this.apiClient)
230
+ throw new Error('No API client set');
231
231
  const response = await this.apiClient({
232
232
  method: 'get',
233
233
  url: `/mobius/node/config/${uri}`,
@@ -239,9 +239,9 @@ class EngineApiCalls {
239
239
  }
240
240
  };
241
241
  changeAdminPassword = async (password, callback) => {
242
- if (!this.apiClient)
243
- throw new Error('No API client set');
244
242
  try {
243
+ if (!this.apiClient)
244
+ throw new Error('No API client set');
245
245
  const response = await this.apiClient({
246
246
  method: 'get',
247
247
  url: `/auth/user/admin`,
@@ -261,9 +261,9 @@ class EngineApiCalls {
261
261
  }
262
262
  };
263
263
  getNodeConfigTree = async (hid, callback) => {
264
- if (!this.apiClient)
265
- throw new Error('No API client set');
266
264
  try {
265
+ if (!this.apiClient)
266
+ throw new Error('No API client set');
267
267
  const response = await this.apiClient({
268
268
  method: 'get',
269
269
  url: `/mobius/node/configtree/${hid}`,
@@ -275,9 +275,9 @@ class EngineApiCalls {
275
275
  }
276
276
  };
277
277
  getProfileByPid = async (hid, pid, callback) => {
278
- if (!this.apiClient)
279
- throw new Error('No API client set');
280
278
  try {
279
+ if (!this.apiClient)
280
+ throw new Error('No API client set');
281
281
  const response = await this.apiClient({
282
282
  method: 'get',
283
283
  url: `/mobius/profile/object/${hid}/${pid}`,
@@ -289,9 +289,9 @@ class EngineApiCalls {
289
289
  }
290
290
  };
291
291
  getAllObjectProfiles = async (hid, callback) => {
292
- if (!this.apiClient)
293
- throw new Error('No API client set');
294
292
  try {
293
+ if (!this.apiClient)
294
+ throw new Error('No API client set');
295
295
  const response = await this.apiClient({
296
296
  method: 'get',
297
297
  url: `/mobius/profile/object/${hid}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-mobius-flow-base",
3
- "version": "3.1.5",
3
+ "version": "3.1.6",
4
4
  "description": "Node-RED base nodes for Mobius Flow",
5
5
  "main": "index.js",
6
6
  "types": "dist/index.d.ts",