@ndustrial/contxt-sdk 5.5.7 → 5.6.1

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.
Files changed (230) hide show
  1. package/.nvmrc +1 -1
  2. package/eslint.config.mjs +44 -0
  3. package/esm/bus/channels.js +1883 -216
  4. package/esm/bus/channels.js.map +1 -1
  5. package/esm/bus/index.browser.js +218 -37
  6. package/esm/bus/index.browser.js.map +1 -1
  7. package/esm/bus/index.js +906 -94
  8. package/esm/bus/index.js.map +1 -1
  9. package/esm/bus/webSocketConnection.browser.js +86 -12
  10. package/esm/bus/webSocketConnection.browser.js.map +1 -1
  11. package/esm/bus/webSocketConnection.js +2464 -332
  12. package/esm/bus/webSocketConnection.js.map +1 -1
  13. package/esm/config/audiences.js +37 -1
  14. package/esm/config/audiences.js.map +1 -1
  15. package/esm/config/defaults.js +37 -1
  16. package/esm/config/defaults.js.map +1 -1
  17. package/esm/config/index.js +1622 -203
  18. package/esm/config/index.js.map +1 -1
  19. package/esm/coordinator/applications.js +1019 -172
  20. package/esm/coordinator/applications.js.map +1 -1
  21. package/esm/coordinator/consent.js +603 -76
  22. package/esm/coordinator/consent.js.map +1 -1
  23. package/esm/coordinator/edgeNodes.js +520 -40
  24. package/esm/coordinator/edgeNodes.js.map +1 -1
  25. package/esm/coordinator/index.js +811 -54
  26. package/esm/coordinator/index.js.map +1 -1
  27. package/esm/coordinator/organizations.js +533 -60
  28. package/esm/coordinator/organizations.js.map +1 -1
  29. package/esm/coordinator/permissions.js +914 -107
  30. package/esm/coordinator/permissions.js.map +1 -1
  31. package/esm/coordinator/roles.js +2146 -258
  32. package/esm/coordinator/roles.js.map +1 -1
  33. package/esm/coordinator/users.js +3427 -484
  34. package/esm/coordinator/users.js.map +1 -1
  35. package/esm/events/index.js +2301 -393
  36. package/esm/events/index.js.map +1 -1
  37. package/esm/files/index.js +2053 -410
  38. package/esm/files/index.js.map +1 -1
  39. package/esm/index.js +1002 -148
  40. package/esm/index.js.map +1 -1
  41. package/esm/iot/feedTypes.js +188 -25
  42. package/esm/iot/feedTypes.js.map +1 -1
  43. package/esm/iot/feeds.js +420 -59
  44. package/esm/iot/feeds.js.map +1 -1
  45. package/esm/iot/fieldCategories.js +1172 -195
  46. package/esm/iot/fieldCategories.js.map +1 -1
  47. package/esm/iot/fieldGroupings.js +1689 -255
  48. package/esm/iot/fieldGroupings.js.map +1 -1
  49. package/esm/iot/fields.js +254 -28
  50. package/esm/iot/fields.js.map +1 -1
  51. package/esm/iot/index.js +212 -34
  52. package/esm/iot/index.js.map +1 -1
  53. package/esm/iot/outputs.js +320 -31
  54. package/esm/iot/outputs.js.map +1 -1
  55. package/esm/nionic/index.js +1097 -97
  56. package/esm/nionic/index.js.map +1 -1
  57. package/esm/request.js +1313 -219
  58. package/esm/request.js.map +1 -1
  59. package/esm/sessionTypes/auth0WebAuth.js +3395 -409
  60. package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
  61. package/esm/sessionTypes/index.js +213 -22
  62. package/esm/sessionTypes/index.js.map +1 -1
  63. package/esm/sessionTypes/machineAuth.js +1314 -144
  64. package/esm/sessionTypes/machineAuth.js.map +1 -1
  65. package/esm/sessionTypes/passwordGrantAuth.js +1060 -145
  66. package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
  67. package/esm/utils/events/formatEventUpdateToServer.js +107 -4
  68. package/esm/utils/events/formatEventUpdateToServer.js.map +1 -1
  69. package/esm/utils/events/index.js +54 -2
  70. package/esm/utils/events/index.js.map +1 -1
  71. package/esm/utils/iot/formatOutputFieldDataFromServer.js +227 -14
  72. package/esm/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
  73. package/esm/utils/iot/index.js +56 -3
  74. package/esm/utils/iot/index.js.map +1 -1
  75. package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js +207 -7
  76. package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
  77. package/esm/utils/objects/createCaseChangeFn.js +449 -18
  78. package/esm/utils/objects/createCaseChangeFn.js.map +1 -1
  79. package/esm/utils/objects/index.js +56 -3
  80. package/esm/utils/objects/index.js.map +1 -1
  81. package/esm/utils/objects/map.js +520 -26
  82. package/esm/utils/objects/map.js.map +1 -1
  83. package/esm/utils/objects/toCamelCase.js +39 -3
  84. package/esm/utils/objects/toCamelCase.js.map +1 -1
  85. package/esm/utils/objects/toSnakeCase.js +39 -3
  86. package/esm/utils/objects/toSnakeCase.js.map +1 -1
  87. package/esm/utils/pagination/formatPaginatedDataFromServer.js +268 -11
  88. package/esm/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
  89. package/esm/utils/pagination/index.js +54 -2
  90. package/esm/utils/pagination/index.js.map +1 -1
  91. package/esm/utils/url/index.js +47 -2
  92. package/esm/utils/url/index.js.map +1 -1
  93. package/esm/utils/url/stringifyParams.js +176 -10
  94. package/esm/utils/url/stringifyParams.js.map +1 -1
  95. package/lib/bus/channels.js +1880 -223
  96. package/lib/bus/channels.js.map +1 -1
  97. package/lib/bus/index.browser.js +215 -43
  98. package/lib/bus/index.browser.js.map +1 -1
  99. package/lib/bus/index.js +903 -106
  100. package/lib/bus/index.js.map +1 -1
  101. package/lib/bus/webSocketConnection.browser.js +83 -15
  102. package/lib/bus/webSocketConnection.browser.js.map +1 -1
  103. package/lib/bus/webSocketConnection.js +2461 -339
  104. package/lib/bus/webSocketConnection.js.map +1 -1
  105. package/lib/config/audiences.js +33 -2
  106. package/lib/config/audiences.js.map +1 -1
  107. package/lib/config/defaults.js +33 -2
  108. package/lib/config/defaults.js.map +1 -1
  109. package/lib/config/index.js +1619 -212
  110. package/lib/config/index.js.map +1 -1
  111. package/lib/coordinator/applications.js +1016 -174
  112. package/lib/coordinator/applications.js.map +1 -1
  113. package/lib/coordinator/consent.js +600 -78
  114. package/lib/coordinator/consent.js.map +1 -1
  115. package/lib/coordinator/edgeNodes.js +517 -42
  116. package/lib/coordinator/edgeNodes.js.map +1 -1
  117. package/lib/coordinator/index.js +808 -78
  118. package/lib/coordinator/index.js.map +1 -1
  119. package/lib/coordinator/organizations.js +530 -62
  120. package/lib/coordinator/organizations.js.map +1 -1
  121. package/lib/coordinator/permissions.js +911 -109
  122. package/lib/coordinator/permissions.js.map +1 -1
  123. package/lib/coordinator/roles.js +2143 -260
  124. package/lib/coordinator/roles.js.map +1 -1
  125. package/lib/coordinator/users.js +3423 -489
  126. package/lib/coordinator/users.js.map +1 -1
  127. package/lib/events/index.js +2297 -404
  128. package/lib/events/index.js.map +1 -1
  129. package/lib/files/index.js +2050 -418
  130. package/lib/files/index.js.map +1 -1
  131. package/lib/index.js +999 -183
  132. package/lib/index.js.map +1 -1
  133. package/lib/iot/feedTypes.js +185 -27
  134. package/lib/iot/feedTypes.js.map +1 -1
  135. package/lib/iot/feeds.js +417 -61
  136. package/lib/iot/feeds.js.map +1 -1
  137. package/lib/iot/fieldCategories.js +1169 -203
  138. package/lib/iot/fieldCategories.js.map +1 -1
  139. package/lib/iot/fieldGroupings.js +1686 -263
  140. package/lib/iot/fieldGroupings.js.map +1 -1
  141. package/lib/iot/fields.js +251 -30
  142. package/lib/iot/fields.js.map +1 -1
  143. package/lib/iot/index.js +209 -55
  144. package/lib/iot/index.js.map +1 -1
  145. package/lib/iot/outputs.js +317 -34
  146. package/lib/iot/outputs.js.map +1 -1
  147. package/lib/nionic/index.js +1094 -98
  148. package/lib/nionic/index.js.map +1 -1
  149. package/lib/request.js +1310 -226
  150. package/lib/request.js.map +1 -1
  151. package/lib/sessionTypes/auth0WebAuth.js +3391 -421
  152. package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
  153. package/lib/sessionTypes/index.js +209 -26
  154. package/lib/sessionTypes/index.js.map +1 -1
  155. package/lib/sessionTypes/machineAuth.js +1311 -151
  156. package/lib/sessionTypes/machineAuth.js.map +1 -1
  157. package/lib/sessionTypes/passwordGrantAuth.js +1057 -156
  158. package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
  159. package/lib/utils/events/formatEventUpdateToServer.js +102 -4
  160. package/lib/utils/events/formatEventUpdateToServer.js.map +1 -1
  161. package/lib/utils/events/index.js +51 -10
  162. package/lib/utils/events/index.js.map +1 -1
  163. package/lib/utils/iot/formatOutputFieldDataFromServer.js +224 -18
  164. package/lib/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
  165. package/lib/utils/iot/index.js +53 -15
  166. package/lib/utils/iot/index.js.map +1 -1
  167. package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js +203 -13
  168. package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
  169. package/lib/utils/objects/createCaseChangeFn.js +446 -25
  170. package/lib/utils/objects/createCaseChangeFn.js.map +1 -1
  171. package/lib/utils/objects/index.js +53 -15
  172. package/lib/utils/objects/index.js.map +1 -1
  173. package/lib/utils/objects/map.js +517 -33
  174. package/lib/utils/objects/map.js.map +1 -1
  175. package/lib/utils/objects/toCamelCase.js +36 -11
  176. package/lib/utils/objects/toCamelCase.js.map +1 -1
  177. package/lib/utils/objects/toSnakeCase.js +36 -11
  178. package/lib/utils/objects/toSnakeCase.js.map +1 -1
  179. package/lib/utils/pagination/formatPaginatedDataFromServer.js +265 -14
  180. package/lib/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
  181. package/lib/utils/pagination/index.js +51 -10
  182. package/lib/utils/pagination/index.js.map +1 -1
  183. package/lib/utils/url/index.js +44 -7
  184. package/lib/utils/url/index.js.map +1 -1
  185. package/lib/utils/url/stringifyParams.js +172 -18
  186. package/lib/utils/url/stringifyParams.js.map +1 -1
  187. package/package.json +32 -36
  188. package/src/bus/channels.js +6 -6
  189. package/src/bus/channels.spec.js +1 -1
  190. package/src/coordinator/applications.js +7 -7
  191. package/src/coordinator/applications.spec.js +1 -1
  192. package/src/coordinator/consent.js +3 -3
  193. package/src/coordinator/edgeNodes.js +3 -3
  194. package/src/coordinator/edgeNodes.spec.js +1 -1
  195. package/src/coordinator/organizations.js +4 -4
  196. package/src/coordinator/organizations.spec.js +1 -1
  197. package/src/coordinator/permissions.js +6 -6
  198. package/src/coordinator/permissions.spec.js +1 -1
  199. package/src/coordinator/roles.js +9 -9
  200. package/src/coordinator/roles.spec.js +1 -1
  201. package/src/coordinator/users.js +13 -13
  202. package/src/coordinator/users.spec.js +294 -294
  203. package/src/events/index.js +18 -18
  204. package/src/events/index.spec.js +3 -3
  205. package/src/files/index.js +9 -9
  206. package/src/files/index.spec.js +2 -2
  207. package/src/index.js +3 -1
  208. package/src/iot/feedTypes.js +2 -2
  209. package/src/iot/feeds.js +4 -4
  210. package/src/iot/feeds.spec.js +1 -1
  211. package/src/iot/fieldCategories.js +10 -10
  212. package/src/iot/fieldCategories.spec.js +2 -2
  213. package/src/iot/fieldGroupings.js +10 -10
  214. package/src/iot/fieldGroupings.spec.js +2 -2
  215. package/src/iot/fields.js +2 -2
  216. package/src/iot/fields.spec.js +1 -1
  217. package/src/iot/outputs.js +2 -2
  218. package/src/iot/outputs.spec.js +1 -1
  219. package/src/sessionTypes/auth0WebAuth.spec.js +1 -1
  220. package/src/utils/events/index.js +2 -1
  221. package/src/utils/iot/formatOutputFieldDataFromServer.js +5 -5
  222. package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +2 -2
  223. package/src/utils/iot/index.js +2 -1
  224. package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.js +3 -1
  225. package/src/utils/objects/index.js +2 -1
  226. package/src/utils/pagination/formatPaginatedDataFromServer.js +3 -3
  227. package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +1 -1
  228. package/src/utils/pagination/index.js +2 -1
  229. package/support/mocharc.yml +1 -1
  230. package/.eslintrc +0 -24
@@ -1,25 +1,945 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1
+ "use strict";
4
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ require("core-js/modules/es.json.stringify.js");
8
+ require("core-js/modules/es.promise.js");
9
+ require("core-js/modules/es.regexp.exec.js");
10
+ require("core-js/modules/es.string.replace.js");
11
+ function cov_1dj5bzb0jx() {
12
+ var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/nionic/index.js";
13
+ var hash = "6464e939cc4984c30a3a9a4853066d01e086ef8f";
14
+ var global = new Function("return this")();
15
+ var gcv = "__coverage__";
16
+ var coverageData = {
17
+ path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/nionic/index.js",
18
+ statementMap: {
19
+ "0": {
20
+ start: {
21
+ line: 12,
22
+ column: 4
23
+ },
24
+ end: {
25
+ line: 12,
26
+ column: 58
27
+ }
28
+ },
29
+ "1": {
30
+ start: {
31
+ line: 13,
32
+ column: 4
33
+ },
34
+ end: {
35
+ line: 13,
36
+ column: 28
37
+ }
38
+ },
39
+ "2": {
40
+ start: {
41
+ line: 14,
42
+ column: 4
43
+ },
44
+ end: {
45
+ line: 14,
46
+ column: 20
47
+ }
48
+ },
49
+ "3": {
50
+ start: {
51
+ line: 17,
52
+ column: 4
53
+ },
54
+ end: {
55
+ line: 32,
56
+ column: 6
57
+ }
58
+ },
59
+ "4": {
60
+ start: {
61
+ line: 35,
62
+ column: 25
63
+ },
64
+ end: {
65
+ line: 37,
66
+ column: 3
67
+ }
68
+ },
69
+ "5": {
70
+ start: {
71
+ line: 40,
72
+ column: 4
73
+ },
74
+ end: {
75
+ line: 40,
76
+ column: 58
77
+ }
78
+ },
79
+ "6": {
80
+ start: {
81
+ line: 40,
82
+ column: 24
83
+ },
84
+ end: {
85
+ line: 40,
86
+ column: 58
87
+ }
88
+ },
89
+ "7": {
90
+ start: {
91
+ line: 41,
92
+ column: 4
93
+ },
94
+ end: {
95
+ line: 41,
96
+ column: 65
97
+ }
98
+ },
99
+ "8": {
100
+ start: {
101
+ line: 45,
102
+ column: 21
103
+ },
104
+ end: {
105
+ line: 45,
106
+ column: 53
107
+ }
108
+ },
109
+ "9": {
110
+ start: {
111
+ line: 46,
112
+ column: 16
113
+ },
114
+ end: {
115
+ line: 46,
116
+ column: 72
117
+ }
118
+ },
119
+ "10": {
120
+ start: {
121
+ line: 47,
122
+ column: 4
123
+ },
124
+ end: {
125
+ line: 52,
126
+ column: 7
127
+ }
128
+ },
129
+ "11": {
130
+ start: {
131
+ line: 48,
132
+ column: 6
133
+ },
134
+ end: {
135
+ line: 50,
136
+ column: 7
137
+ }
138
+ },
139
+ "12": {
140
+ start: {
141
+ line: 49,
142
+ column: 8
143
+ },
144
+ end: {
145
+ line: 49,
146
+ column: 66
147
+ }
148
+ },
149
+ "13": {
150
+ start: {
151
+ line: 51,
152
+ column: 6
153
+ },
154
+ end: {
155
+ line: 51,
156
+ column: 40
157
+ }
158
+ },
159
+ "14": {
160
+ start: {
161
+ line: 56,
162
+ column: 4
163
+ },
164
+ end: {
165
+ line: 56,
166
+ column: 60
167
+ }
168
+ },
169
+ "15": {
170
+ start: {
171
+ line: 60,
172
+ column: 33
173
+ },
174
+ end: {
175
+ line: 60,
176
+ column: 40
177
+ }
178
+ },
179
+ "16": {
180
+ start: {
181
+ line: 61,
182
+ column: 4
183
+ },
184
+ end: {
185
+ line: 81,
186
+ column: 45
187
+ }
188
+ },
189
+ "17": {
190
+ start: {
191
+ line: 81,
192
+ column: 22
193
+ },
194
+ end: {
195
+ line: 81,
196
+ column: 43
197
+ }
198
+ },
199
+ "18": {
200
+ start: {
201
+ line: 85,
202
+ column: 33
203
+ },
204
+ end: {
205
+ line: 85,
206
+ column: 40
207
+ }
208
+ },
209
+ "19": {
210
+ start: {
211
+ line: 86,
212
+ column: 4
213
+ },
214
+ end: {
215
+ line: 105,
216
+ column: 37
217
+ }
218
+ },
219
+ "20": {
220
+ start: {
221
+ line: 105,
222
+ column: 22
223
+ },
224
+ end: {
225
+ line: 105,
226
+ column: 35
227
+ }
228
+ },
229
+ "21": {
230
+ start: {
231
+ line: 109,
232
+ column: 4
233
+ },
234
+ end: {
235
+ line: 121,
236
+ column: 50
237
+ }
238
+ },
239
+ "22": {
240
+ start: {
241
+ line: 121,
242
+ column: 22
243
+ },
244
+ end: {
245
+ line: 121,
246
+ column: 48
247
+ }
248
+ },
249
+ "23": {
250
+ start: {
251
+ line: 129,
252
+ column: 33
253
+ },
254
+ end: {
255
+ line: 129,
256
+ column: 40
257
+ }
258
+ },
259
+ "24": {
260
+ start: {
261
+ line: 130,
262
+ column: 4
263
+ },
264
+ end: {
265
+ line: 149,
266
+ column: 54
267
+ }
268
+ },
269
+ "25": {
270
+ start: {
271
+ line: 149,
272
+ column: 22
273
+ },
274
+ end: {
275
+ line: 149,
276
+ column: 52
277
+ }
278
+ }
279
+ },
280
+ fnMap: {
281
+ "0": {
282
+ name: "(anonymous_0)",
283
+ decl: {
284
+ start: {
285
+ line: 11,
286
+ column: 2
287
+ },
288
+ end: {
289
+ line: 11,
290
+ column: 3
291
+ }
292
+ },
293
+ loc: {
294
+ start: {
295
+ line: 11,
296
+ column: 28
297
+ },
298
+ end: {
299
+ line: 33,
300
+ column: 3
301
+ }
302
+ },
303
+ line: 11
304
+ },
305
+ "1": {
306
+ name: "(anonymous_1)",
307
+ decl: {
308
+ start: {
309
+ line: 39,
310
+ column: 2
311
+ },
312
+ end: {
313
+ line: 39,
314
+ column: 3
315
+ }
316
+ },
317
+ loc: {
318
+ start: {
319
+ line: 39,
320
+ column: 30
321
+ },
322
+ end: {
323
+ line: 42,
324
+ column: 3
325
+ }
326
+ },
327
+ line: 39
328
+ },
329
+ "2": {
330
+ name: "(anonymous_2)",
331
+ decl: {
332
+ start: {
333
+ line: 44,
334
+ column: 2
335
+ },
336
+ end: {
337
+ line: 44,
338
+ column: 3
339
+ }
340
+ },
341
+ loc: {
342
+ start: {
343
+ line: 44,
344
+ column: 33
345
+ },
346
+ end: {
347
+ line: 53,
348
+ column: 3
349
+ }
350
+ },
351
+ line: 44
352
+ },
353
+ "3": {
354
+ name: "(anonymous_3)",
355
+ decl: {
356
+ start: {
357
+ line: 47,
358
+ column: 49
359
+ },
360
+ end: {
361
+ line: 47,
362
+ column: 50
363
+ }
364
+ },
365
+ loc: {
366
+ start: {
367
+ line: 47,
368
+ column: 59
369
+ },
370
+ end: {
371
+ line: 52,
372
+ column: 5
373
+ }
374
+ },
375
+ line: 47
376
+ },
377
+ "4": {
378
+ name: "(anonymous_4)",
379
+ decl: {
380
+ start: {
381
+ line: 55,
382
+ column: 2
383
+ },
384
+ end: {
385
+ line: 55,
386
+ column: 3
387
+ }
388
+ },
389
+ loc: {
390
+ start: {
391
+ line: 55,
392
+ column: 53
393
+ },
394
+ end: {
395
+ line: 57,
396
+ column: 3
397
+ }
398
+ },
399
+ line: 55
400
+ },
401
+ "5": {
402
+ name: "(anonymous_5)",
403
+ decl: {
404
+ start: {
405
+ line: 59,
406
+ column: 2
407
+ },
408
+ end: {
409
+ line: 59,
410
+ column: 3
411
+ }
412
+ },
413
+ loc: {
414
+ start: {
415
+ line: 59,
416
+ column: 66
417
+ },
418
+ end: {
419
+ line: 82,
420
+ column: 3
421
+ }
422
+ },
423
+ line: 59
424
+ },
425
+ "6": {
426
+ name: "(anonymous_6)",
427
+ decl: {
428
+ start: {
429
+ line: 81,
430
+ column: 12
431
+ },
432
+ end: {
433
+ line: 81,
434
+ column: 13
435
+ }
436
+ },
437
+ loc: {
438
+ start: {
439
+ line: 81,
440
+ column: 22
441
+ },
442
+ end: {
443
+ line: 81,
444
+ column: 43
445
+ }
446
+ },
447
+ line: 81
448
+ },
449
+ "7": {
450
+ name: "(anonymous_7)",
451
+ decl: {
452
+ start: {
453
+ line: 84,
454
+ column: 2
455
+ },
456
+ end: {
457
+ line: 84,
458
+ column: 3
459
+ }
460
+ },
461
+ loc: {
462
+ start: {
463
+ line: 84,
464
+ column: 73
465
+ },
466
+ end: {
467
+ line: 106,
468
+ column: 3
469
+ }
470
+ },
471
+ line: 84
472
+ },
473
+ "8": {
474
+ name: "(anonymous_8)",
475
+ decl: {
476
+ start: {
477
+ line: 105,
478
+ column: 12
479
+ },
480
+ end: {
481
+ line: 105,
482
+ column: 13
483
+ }
484
+ },
485
+ loc: {
486
+ start: {
487
+ line: 105,
488
+ column: 22
489
+ },
490
+ end: {
491
+ line: 105,
492
+ column: 35
493
+ }
494
+ },
495
+ line: 105
496
+ },
497
+ "9": {
498
+ name: "(anonymous_9)",
499
+ decl: {
500
+ start: {
501
+ line: 108,
502
+ column: 2
503
+ },
504
+ end: {
505
+ line: 108,
506
+ column: 3
507
+ }
508
+ },
509
+ loc: {
510
+ start: {
511
+ line: 108,
512
+ column: 57
513
+ },
514
+ end: {
515
+ line: 122,
516
+ column: 3
517
+ }
518
+ },
519
+ line: 108
520
+ },
521
+ "10": {
522
+ name: "(anonymous_10)",
523
+ decl: {
524
+ start: {
525
+ line: 121,
526
+ column: 12
527
+ },
528
+ end: {
529
+ line: 121,
530
+ column: 13
531
+ }
532
+ },
533
+ loc: {
534
+ start: {
535
+ line: 121,
536
+ column: 22
537
+ },
538
+ end: {
539
+ line: 121,
540
+ column: 48
541
+ }
542
+ },
543
+ line: 121
544
+ },
545
+ "11": {
546
+ name: "(anonymous_11)",
547
+ decl: {
548
+ start: {
549
+ line: 124,
550
+ column: 2
551
+ },
552
+ end: {
553
+ line: 124,
554
+ column: 3
555
+ }
556
+ },
557
+ loc: {
558
+ start: {
559
+ line: 128,
560
+ column: 4
561
+ },
562
+ end: {
563
+ line: 150,
564
+ column: 3
565
+ }
566
+ },
567
+ line: 128
568
+ },
569
+ "12": {
570
+ name: "(anonymous_12)",
571
+ decl: {
572
+ start: {
573
+ line: 149,
574
+ column: 12
575
+ },
576
+ end: {
577
+ line: 149,
578
+ column: 13
579
+ }
580
+ },
581
+ loc: {
582
+ start: {
583
+ line: 149,
584
+ column: 22
585
+ },
586
+ end: {
587
+ line: 149,
588
+ column: 52
589
+ }
590
+ },
591
+ line: 149
592
+ }
593
+ },
594
+ branchMap: {
595
+ "0": {
596
+ loc: {
597
+ start: {
598
+ line: 40,
599
+ column: 4
600
+ },
601
+ end: {
602
+ line: 40,
603
+ column: 58
604
+ }
605
+ },
606
+ type: "if",
607
+ locations: [{
608
+ start: {
609
+ line: 40,
610
+ column: 4
611
+ },
612
+ end: {
613
+ line: 40,
614
+ column: 58
615
+ }
616
+ }, {
617
+ start: {
618
+ line: undefined,
619
+ column: undefined
620
+ },
621
+ end: {
622
+ line: undefined,
623
+ column: undefined
624
+ }
625
+ }],
626
+ line: 40
627
+ },
628
+ "1": {
629
+ loc: {
630
+ start: {
631
+ line: 41,
632
+ column: 11
633
+ },
634
+ end: {
635
+ line: 41,
636
+ column: 64
637
+ }
638
+ },
639
+ type: "binary-expr",
640
+ locations: [{
641
+ start: {
642
+ line: 41,
643
+ column: 11
644
+ },
645
+ end: {
646
+ line: 41,
647
+ column: 47
648
+ }
649
+ }, {
650
+ start: {
651
+ line: 41,
652
+ column: 51
653
+ },
654
+ end: {
655
+ line: 41,
656
+ column: 64
657
+ }
658
+ }],
659
+ line: 41
660
+ },
661
+ "2": {
662
+ loc: {
663
+ start: {
664
+ line: 48,
665
+ column: 6
666
+ },
667
+ end: {
668
+ line: 50,
669
+ column: 7
670
+ }
671
+ },
672
+ type: "if",
673
+ locations: [{
674
+ start: {
675
+ line: 48,
676
+ column: 6
677
+ },
678
+ end: {
679
+ line: 50,
680
+ column: 7
681
+ }
682
+ }, {
683
+ start: {
684
+ line: undefined,
685
+ column: undefined
686
+ },
687
+ end: {
688
+ line: undefined,
689
+ column: undefined
690
+ }
691
+ }],
692
+ line: 48
693
+ },
694
+ "3": {
695
+ loc: {
696
+ start: {
697
+ line: 55,
698
+ column: 37
699
+ },
700
+ end: {
701
+ line: 55,
702
+ column: 51
703
+ }
704
+ },
705
+ type: "default-arg",
706
+ locations: [{
707
+ start: {
708
+ line: 55,
709
+ column: 49
710
+ },
711
+ end: {
712
+ line: 55,
713
+ column: 51
714
+ }
715
+ }],
716
+ line: 55
717
+ },
718
+ "4": {
719
+ loc: {
720
+ start: {
721
+ line: 59,
722
+ column: 34
723
+ },
724
+ end: {
725
+ line: 59,
726
+ column: 64
727
+ }
728
+ },
729
+ type: "default-arg",
730
+ locations: [{
731
+ start: {
732
+ line: 59,
733
+ column: 44
734
+ },
735
+ end: {
736
+ line: 59,
737
+ column: 64
738
+ }
739
+ }],
740
+ line: 59
741
+ },
742
+ "5": {
743
+ loc: {
744
+ start: {
745
+ line: 84,
746
+ column: 41
747
+ },
748
+ end: {
749
+ line: 84,
750
+ column: 71
751
+ }
752
+ },
753
+ type: "default-arg",
754
+ locations: [{
755
+ start: {
756
+ line: 84,
757
+ column: 51
758
+ },
759
+ end: {
760
+ line: 84,
761
+ column: 71
762
+ }
763
+ }],
764
+ line: 84
765
+ },
766
+ "6": {
767
+ loc: {
768
+ start: {
769
+ line: 126,
770
+ column: 31
771
+ },
772
+ end: {
773
+ line: 126,
774
+ column: 50
775
+ }
776
+ },
777
+ type: "default-arg",
778
+ locations: [{
779
+ start: {
780
+ line: 126,
781
+ column: 45
782
+ },
783
+ end: {
784
+ line: 126,
785
+ column: 50
786
+ }
787
+ }],
788
+ line: 126
789
+ },
790
+ "7": {
791
+ loc: {
792
+ start: {
793
+ line: 127,
794
+ column: 4
795
+ },
796
+ end: {
797
+ line: 127,
798
+ column: 34
799
+ }
800
+ },
801
+ type: "default-arg",
802
+ locations: [{
803
+ start: {
804
+ line: 127,
805
+ column: 14
806
+ },
807
+ end: {
808
+ line: 127,
809
+ column: 34
810
+ }
811
+ }],
812
+ line: 127
813
+ },
814
+ "8": {
815
+ loc: {
816
+ start: {
817
+ line: 135,
818
+ column: 14
819
+ },
820
+ end: {
821
+ line: 135,
822
+ column: 62
823
+ }
824
+ },
825
+ type: "cond-expr",
826
+ locations: [{
827
+ start: {
828
+ line: 135,
829
+ column: 28
830
+ },
831
+ end: {
832
+ line: 135,
833
+ column: 47
834
+ }
835
+ }, {
836
+ start: {
837
+ line: 135,
838
+ column: 50
839
+ },
840
+ end: {
841
+ line: 135,
842
+ column: 62
843
+ }
844
+ }],
845
+ line: 135
846
+ }
847
+ },
848
+ s: {
849
+ "0": 0,
850
+ "1": 0,
851
+ "2": 0,
852
+ "3": 0,
853
+ "4": 0,
854
+ "5": 0,
855
+ "6": 0,
856
+ "7": 0,
857
+ "8": 0,
858
+ "9": 0,
859
+ "10": 0,
860
+ "11": 0,
861
+ "12": 0,
862
+ "13": 0,
863
+ "14": 0,
864
+ "15": 0,
865
+ "16": 0,
866
+ "17": 0,
867
+ "18": 0,
868
+ "19": 0,
869
+ "20": 0,
870
+ "21": 0,
871
+ "22": 0,
872
+ "23": 0,
873
+ "24": 0,
874
+ "25": 0
875
+ },
876
+ f: {
877
+ "0": 0,
878
+ "1": 0,
879
+ "2": 0,
880
+ "3": 0,
881
+ "4": 0,
882
+ "5": 0,
883
+ "6": 0,
884
+ "7": 0,
885
+ "8": 0,
886
+ "9": 0,
887
+ "10": 0,
888
+ "11": 0,
889
+ "12": 0
890
+ },
891
+ b: {
892
+ "0": [0, 0],
893
+ "1": [0, 0],
894
+ "2": [0, 0],
895
+ "3": [0],
896
+ "4": [0],
897
+ "5": [0],
898
+ "6": [0],
899
+ "7": [0],
900
+ "8": [0, 0]
901
+ },
902
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
903
+ hash: "6464e939cc4984c30a3a9a4853066d01e086ef8f"
904
+ };
905
+ var coverage = global[gcv] || (global[gcv] = {});
906
+ if (!coverage[path] || coverage[path].hash !== hash) {
907
+ coverage[path] = coverageData;
908
+ }
909
+ var actualCoverage = coverage[path];
910
+ {
911
+ // @ts-ignore
912
+ cov_1dj5bzb0jx = function () {
913
+ return actualCoverage;
914
+ };
915
+ }
916
+ return actualCoverage;
917
+ }
918
+ cov_1dj5bzb0jx();
919
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
920
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
921
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
922
  /**
6
923
  * Module that provides access to Nionic platform.
7
924
  *
8
925
  * @typicalname contxtSdk.nionic
9
926
  */
10
- var Nionic = function () {
927
+ class Nionic {
11
928
  /**
12
929
  * @param {Object} sdk An instance of the SDK so the module can communicate with other modules.
13
930
  * @param {Object} request An instance of the request module tied to this module's audience.
14
931
  */
15
- function Nionic(sdk, request) {
16
- _classCallCheck(this, Nionic);
17
-
18
- this._baseUrl = '' + sdk.config.audiences.nionic.host;
932
+ constructor(sdk, request) {
933
+ cov_1dj5bzb0jx().f[0]++;
934
+ cov_1dj5bzb0jx().s[0]++;
935
+ this._baseUrl = `${sdk.config.audiences.nionic.host}`;
936
+ cov_1dj5bzb0jx().s[1]++;
19
937
  this._request = request;
938
+ cov_1dj5bzb0jx().s[2]++;
20
939
  this._sdk = sdk;
21
940
 
22
941
  // Backwards compatibility for legacy uuid's
942
+ cov_1dj5bzb0jx().s[3]++;
23
943
  this._orgIdToTenantId = {
24
944
  '18d8b68e-3e59-418e-9f23-47b7cd6bdd6b': 'genan',
25
945
  '02efa741-a96f-4124-a463-ae13a704b8fc': 'lineage',
@@ -37,95 +957,175 @@ var Nionic = function () {
37
957
  'c18cf4fb-13ec-4e19-9475-cc1be484ba27': 'waterbridge'
38
958
  };
39
959
  }
40
-
41
- _createClass(Nionic, [{
42
- key: '_getTenantId',
43
- value: function _getTenantId(orgOrTenantId) {
44
- if (!orgOrTenantId) throw Error('Tenant is required');
45
- return this._orgIdToTenantId[orgOrTenantId] || orgOrTenantId;
46
- }
47
- }, {
48
- key: '_query',
49
- value: function _query(orgOrTenantId, options) {
50
- var tenantId = this._getTenantId(orgOrTenantId);
51
- var url = this._baseUrl.replace('<tenant>', tenantId) + '/graphql';
52
- return this._request.post(url, options).then(function (resp) {
53
- if (resp.errors) {
54
- return Promise.reject(Error(JSON.stringify(resp.errors)));
55
- }
56
- return Promise.resolve(resp.data);
57
- });
58
- }
59
- }, {
60
- key: 'executeQuery',
61
- value: function executeQuery(orgOrTenantId, query) {
62
- var variables = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
63
-
64
- return this._query(orgOrTenantId, { query: query, variables: variables });
65
- }
66
- }, {
67
- key: 'getAllFacilities',
68
- value: function getAllFacilities(orgOrTenantId) {
69
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Nionic.queryDefaults;
70
- var additionalFields = options.additionalFields;
71
-
72
- return this._query(orgOrTenantId, {
73
- query: '\n query {\n facilities {\n nodes {\n id\n name\n slug\n address\n city\n state\n zip\n timezone: timezoneName\n createdAt\n updatedAt\n ' + additionalFields.join('\n') + '\n }\n }\n }\n '
74
- }).then(function (data) {
75
- return data.facilities.nodes;
76
- });
960
+ _getTenantId(orgOrTenantId) {
961
+ cov_1dj5bzb0jx().f[1]++;
962
+ cov_1dj5bzb0jx().s[5]++;
963
+ if (!orgOrTenantId) {
964
+ cov_1dj5bzb0jx().b[0][0]++;
965
+ cov_1dj5bzb0jx().s[6]++;
966
+ throw Error('Tenant is required');
967
+ } else {
968
+ cov_1dj5bzb0jx().b[0][1]++;
77
969
  }
78
- }, {
79
- key: 'getFacility',
80
- value: function getFacility(orgOrTenantId, facilityId) {
81
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Nionic.queryDefaults;
82
- var additionalFields = options.additionalFields;
83
-
84
- return this._query(orgOrTenantId, {
85
- query: '\n query($facilityId: Int!) {\n facility(id: $facilityId) {\n id\n name\n slug\n address\n city\n state\n zip\n timezone: timezoneName\n createdAt\n updatedAt\n ' + additionalFields.join('\n') + '\n }\n }\n ',
86
- variables: { facilityId: parseInt(facilityId) }
87
- }).then(function (resp) {
88
- return resp.facility;
89
- });
90
- }
91
- }, {
92
- key: 'getFacilityMetricLabels',
93
- value: function getFacilityMetricLabels(orgOrTenantId, _ref) {
94
- var facilityId = _ref.facilityId;
95
-
96
- return this._query(orgOrTenantId, {
97
- query: '\n query($facilityId: Int!) {\n facility(id: $facilityId) {\n metricLabels {\n sourceId\n label\n }\n }\n }\n ',
98
- variables: { facilityId: parseInt(facilityId) }
99
- }).then(function (resp) {
100
- return resp.facility.metricLabels;
101
- });
102
- }
103
- }, {
104
- key: 'getFacilityMetrics',
105
- value: function getFacilityMetrics(orgOrTenantId, _ref2) {
106
- var facilityId = _ref2.facilityId,
107
- metricLabel = _ref2.metricLabel,
108
- _ref2$mutableOnly = _ref2.mutableOnly,
109
- mutableOnly = _ref2$mutableOnly === undefined ? false : _ref2$mutableOnly;
110
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Nionic.queryDefaults;
111
- var additionalFields = options.additionalFields;
112
-
113
- return this._query(orgOrTenantId, {
114
- query: '\n query($facilityId: Int!, $metricLabel: String!) {\n facility(id: $facilityId) {\n ' + (mutableOnly ? 'mutableMetricData' : 'metricData') + '(label: $metricLabel) {\n nodes {\n time\n sourceId\n label\n data\n ' + additionalFields.join('\n') + '\n }\n }\n }\n }\n ',
115
- variables: { facilityId: parseInt(facilityId), metricLabel: metricLabel }
116
- }).then(function (resp) {
117
- return resp.facility.metricData.nodes;
118
- });
119
- }
120
- }]);
121
-
122
- return Nionic;
123
- }();
124
-
125
- Nionic.queryDefaults = {
970
+ cov_1dj5bzb0jx().s[7]++;
971
+ return (cov_1dj5bzb0jx().b[1][0]++, this._orgIdToTenantId[orgOrTenantId]) || (cov_1dj5bzb0jx().b[1][1]++, orgOrTenantId);
972
+ }
973
+ _query(orgOrTenantId, options) {
974
+ cov_1dj5bzb0jx().f[2]++;
975
+ const tenantId = (cov_1dj5bzb0jx().s[8]++, this._getTenantId(orgOrTenantId));
976
+ const url = (cov_1dj5bzb0jx().s[9]++, `${this._baseUrl.replace('<tenant>', tenantId)}/graphql`);
977
+ cov_1dj5bzb0jx().s[10]++;
978
+ return this._request.post(url, options).then(resp => {
979
+ cov_1dj5bzb0jx().f[3]++;
980
+ cov_1dj5bzb0jx().s[11]++;
981
+ if (resp.errors) {
982
+ cov_1dj5bzb0jx().b[2][0]++;
983
+ cov_1dj5bzb0jx().s[12]++;
984
+ return Promise.reject(Error(JSON.stringify(resp.errors)));
985
+ } else {
986
+ cov_1dj5bzb0jx().b[2][1]++;
987
+ }
988
+ cov_1dj5bzb0jx().s[13]++;
989
+ return Promise.resolve(resp.data);
990
+ });
991
+ }
992
+ executeQuery(orgOrTenantId, query) {
993
+ let variables = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (cov_1dj5bzb0jx().b[3][0]++, {});
994
+ cov_1dj5bzb0jx().f[4]++;
995
+ cov_1dj5bzb0jx().s[14]++;
996
+ return this._query(orgOrTenantId, {
997
+ query,
998
+ variables
999
+ });
1000
+ }
1001
+ getAllFacilities(orgOrTenantId) {
1002
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_1dj5bzb0jx().b[4][0]++, Nionic.queryDefaults);
1003
+ cov_1dj5bzb0jx().f[5]++;
1004
+ const _ref = (cov_1dj5bzb0jx().s[15]++, options),
1005
+ additionalFields = _ref.additionalFields;
1006
+ cov_1dj5bzb0jx().s[16]++;
1007
+ return this._query(orgOrTenantId, {
1008
+ query: `
1009
+ query {
1010
+ facilities {
1011
+ nodes {
1012
+ id
1013
+ name
1014
+ slug
1015
+ address
1016
+ city
1017
+ state
1018
+ zip
1019
+ timezone: timezoneName
1020
+ createdAt
1021
+ updatedAt
1022
+ ${additionalFields.join('\n')}
1023
+ }
1024
+ }
1025
+ }
1026
+ `
1027
+ }).then(data => {
1028
+ cov_1dj5bzb0jx().f[6]++;
1029
+ cov_1dj5bzb0jx().s[17]++;
1030
+ return data.facilities.nodes;
1031
+ });
1032
+ }
1033
+ getFacility(orgOrTenantId, facilityId) {
1034
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (cov_1dj5bzb0jx().b[5][0]++, Nionic.queryDefaults);
1035
+ cov_1dj5bzb0jx().f[7]++;
1036
+ const _ref2 = (cov_1dj5bzb0jx().s[18]++, options),
1037
+ additionalFields = _ref2.additionalFields;
1038
+ cov_1dj5bzb0jx().s[19]++;
1039
+ return this._query(orgOrTenantId, {
1040
+ query: `
1041
+ query($facilityId: Int!) {
1042
+ facility(id: $facilityId) {
1043
+ id
1044
+ name
1045
+ slug
1046
+ address
1047
+ city
1048
+ state
1049
+ zip
1050
+ timezone: timezoneName
1051
+ createdAt
1052
+ updatedAt
1053
+ ${additionalFields.join('\n')}
1054
+ }
1055
+ }
1056
+ `,
1057
+ variables: {
1058
+ facilityId: parseInt(facilityId)
1059
+ }
1060
+ }).then(resp => {
1061
+ cov_1dj5bzb0jx().f[8]++;
1062
+ cov_1dj5bzb0jx().s[20]++;
1063
+ return resp.facility;
1064
+ });
1065
+ }
1066
+ getFacilityMetricLabels(orgOrTenantId, _ref3) {
1067
+ let facilityId = _ref3.facilityId;
1068
+ cov_1dj5bzb0jx().f[9]++;
1069
+ cov_1dj5bzb0jx().s[21]++;
1070
+ return this._query(orgOrTenantId, {
1071
+ query: `
1072
+ query($facilityId: Int!) {
1073
+ facility(id: $facilityId) {
1074
+ metricLabels {
1075
+ sourceId
1076
+ label
1077
+ }
1078
+ }
1079
+ }
1080
+ `,
1081
+ variables: {
1082
+ facilityId: parseInt(facilityId)
1083
+ }
1084
+ }).then(resp => {
1085
+ cov_1dj5bzb0jx().f[10]++;
1086
+ cov_1dj5bzb0jx().s[22]++;
1087
+ return resp.facility.metricLabels;
1088
+ });
1089
+ }
1090
+ getFacilityMetrics(orgOrTenantId, _ref4) {
1091
+ let facilityId = _ref4.facilityId,
1092
+ metricLabel = _ref4.metricLabel,
1093
+ _ref4$mutableOnly = _ref4.mutableOnly,
1094
+ mutableOnly = _ref4$mutableOnly === void 0 ? (cov_1dj5bzb0jx().b[6][0]++, false) : _ref4$mutableOnly;
1095
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (cov_1dj5bzb0jx().b[7][0]++, Nionic.queryDefaults);
1096
+ cov_1dj5bzb0jx().f[11]++;
1097
+ const _ref5 = (cov_1dj5bzb0jx().s[23]++, options),
1098
+ additionalFields = _ref5.additionalFields;
1099
+ cov_1dj5bzb0jx().s[24]++;
1100
+ return this._query(orgOrTenantId, {
1101
+ query: `
1102
+ query($facilityId: Int!, $metricLabel: String!) {
1103
+ facility(id: $facilityId) {
1104
+ ${mutableOnly ? (cov_1dj5bzb0jx().b[8][0]++, 'mutableMetricData') : (cov_1dj5bzb0jx().b[8][1]++, 'metricData')}(label: $metricLabel) {
1105
+ nodes {
1106
+ time
1107
+ sourceId
1108
+ label
1109
+ data
1110
+ ${additionalFields.join('\n')}
1111
+ }
1112
+ }
1113
+ }
1114
+ }
1115
+ `,
1116
+ variables: {
1117
+ facilityId: parseInt(facilityId),
1118
+ metricLabel
1119
+ }
1120
+ }).then(resp => {
1121
+ cov_1dj5bzb0jx().f[12]++;
1122
+ cov_1dj5bzb0jx().s[25]++;
1123
+ return resp.facility.metricData.nodes;
1124
+ });
1125
+ }
1126
+ }
1127
+ _defineProperty(Nionic, "queryDefaults", (cov_1dj5bzb0jx().s[4]++, {
126
1128
  additionalFields: []
127
- };
128
-
129
-
130
- export default Nionic;
1129
+ }));
1130
+ var _default = exports.default = Nionic;
131
1131
  //# sourceMappingURL=index.js.map