@ndustrial/contxt-sdk 5.5.6 → 5.6.0

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 (233) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +6 -0
  3. package/eslint.config.mjs +44 -0
  4. package/esm/bus/channels.js +1883 -216
  5. package/esm/bus/channels.js.map +1 -1
  6. package/esm/bus/index.browser.js +218 -37
  7. package/esm/bus/index.browser.js.map +1 -1
  8. package/esm/bus/index.js +906 -94
  9. package/esm/bus/index.js.map +1 -1
  10. package/esm/bus/webSocketConnection.browser.js +86 -12
  11. package/esm/bus/webSocketConnection.browser.js.map +1 -1
  12. package/esm/bus/webSocketConnection.js +2464 -332
  13. package/esm/bus/webSocketConnection.js.map +1 -1
  14. package/esm/config/audiences.js +37 -1
  15. package/esm/config/audiences.js.map +1 -1
  16. package/esm/config/defaults.js +37 -1
  17. package/esm/config/defaults.js.map +1 -1
  18. package/esm/config/index.js +1622 -203
  19. package/esm/config/index.js.map +1 -1
  20. package/esm/coordinator/applications.js +1019 -172
  21. package/esm/coordinator/applications.js.map +1 -1
  22. package/esm/coordinator/consent.js +603 -76
  23. package/esm/coordinator/consent.js.map +1 -1
  24. package/esm/coordinator/edgeNodes.js +520 -40
  25. package/esm/coordinator/edgeNodes.js.map +1 -1
  26. package/esm/coordinator/index.js +811 -54
  27. package/esm/coordinator/index.js.map +1 -1
  28. package/esm/coordinator/organizations.js +533 -60
  29. package/esm/coordinator/organizations.js.map +1 -1
  30. package/esm/coordinator/permissions.js +914 -107
  31. package/esm/coordinator/permissions.js.map +1 -1
  32. package/esm/coordinator/roles.js +2146 -258
  33. package/esm/coordinator/roles.js.map +1 -1
  34. package/esm/coordinator/users.js +3393 -484
  35. package/esm/coordinator/users.js.map +1 -1
  36. package/esm/events/index.js +2301 -393
  37. package/esm/events/index.js.map +1 -1
  38. package/esm/files/index.js +2053 -410
  39. package/esm/files/index.js.map +1 -1
  40. package/esm/index.js +1002 -148
  41. package/esm/index.js.map +1 -1
  42. package/esm/iot/feedTypes.js +188 -25
  43. package/esm/iot/feedTypes.js.map +1 -1
  44. package/esm/iot/feeds.js +420 -59
  45. package/esm/iot/feeds.js.map +1 -1
  46. package/esm/iot/fieldCategories.js +1172 -195
  47. package/esm/iot/fieldCategories.js.map +1 -1
  48. package/esm/iot/fieldGroupings.js +1689 -255
  49. package/esm/iot/fieldGroupings.js.map +1 -1
  50. package/esm/iot/fields.js +254 -28
  51. package/esm/iot/fields.js.map +1 -1
  52. package/esm/iot/index.js +212 -34
  53. package/esm/iot/index.js.map +1 -1
  54. package/esm/iot/outputs.js +320 -31
  55. package/esm/iot/outputs.js.map +1 -1
  56. package/esm/nionic/index.js +1097 -97
  57. package/esm/nionic/index.js.map +1 -1
  58. package/esm/request.js +1313 -221
  59. package/esm/request.js.map +1 -1
  60. package/esm/sessionTypes/auth0WebAuth.js +3395 -409
  61. package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
  62. package/esm/sessionTypes/index.js +213 -22
  63. package/esm/sessionTypes/index.js.map +1 -1
  64. package/esm/sessionTypes/machineAuth.js +1314 -144
  65. package/esm/sessionTypes/machineAuth.js.map +1 -1
  66. package/esm/sessionTypes/passwordGrantAuth.js +1060 -145
  67. package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
  68. package/esm/utils/events/formatEventUpdateToServer.js +107 -4
  69. package/esm/utils/events/formatEventUpdateToServer.js.map +1 -1
  70. package/esm/utils/events/index.js +54 -2
  71. package/esm/utils/events/index.js.map +1 -1
  72. package/esm/utils/iot/formatOutputFieldDataFromServer.js +227 -14
  73. package/esm/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
  74. package/esm/utils/iot/index.js +56 -3
  75. package/esm/utils/iot/index.js.map +1 -1
  76. package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js +207 -7
  77. package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
  78. package/esm/utils/objects/createCaseChangeFn.js +449 -18
  79. package/esm/utils/objects/createCaseChangeFn.js.map +1 -1
  80. package/esm/utils/objects/index.js +56 -3
  81. package/esm/utils/objects/index.js.map +1 -1
  82. package/esm/utils/objects/map.js +520 -26
  83. package/esm/utils/objects/map.js.map +1 -1
  84. package/esm/utils/objects/toCamelCase.js +39 -3
  85. package/esm/utils/objects/toCamelCase.js.map +1 -1
  86. package/esm/utils/objects/toSnakeCase.js +39 -3
  87. package/esm/utils/objects/toSnakeCase.js.map +1 -1
  88. package/esm/utils/pagination/formatPaginatedDataFromServer.js +268 -11
  89. package/esm/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
  90. package/esm/utils/pagination/index.js +54 -2
  91. package/esm/utils/pagination/index.js.map +1 -1
  92. package/esm/utils/url/index.js +47 -2
  93. package/esm/utils/url/index.js.map +1 -1
  94. package/esm/utils/url/stringifyParams.js +176 -10
  95. package/esm/utils/url/stringifyParams.js.map +1 -1
  96. package/lib/bus/channels.js +1880 -223
  97. package/lib/bus/channels.js.map +1 -1
  98. package/lib/bus/index.browser.js +215 -43
  99. package/lib/bus/index.browser.js.map +1 -1
  100. package/lib/bus/index.js +903 -106
  101. package/lib/bus/index.js.map +1 -1
  102. package/lib/bus/webSocketConnection.browser.js +83 -15
  103. package/lib/bus/webSocketConnection.browser.js.map +1 -1
  104. package/lib/bus/webSocketConnection.js +2461 -339
  105. package/lib/bus/webSocketConnection.js.map +1 -1
  106. package/lib/config/audiences.js +33 -2
  107. package/lib/config/audiences.js.map +1 -1
  108. package/lib/config/defaults.js +33 -2
  109. package/lib/config/defaults.js.map +1 -1
  110. package/lib/config/index.js +1619 -212
  111. package/lib/config/index.js.map +1 -1
  112. package/lib/coordinator/applications.js +1016 -174
  113. package/lib/coordinator/applications.js.map +1 -1
  114. package/lib/coordinator/consent.js +600 -78
  115. package/lib/coordinator/consent.js.map +1 -1
  116. package/lib/coordinator/edgeNodes.js +517 -42
  117. package/lib/coordinator/edgeNodes.js.map +1 -1
  118. package/lib/coordinator/index.js +808 -78
  119. package/lib/coordinator/index.js.map +1 -1
  120. package/lib/coordinator/organizations.js +530 -62
  121. package/lib/coordinator/organizations.js.map +1 -1
  122. package/lib/coordinator/permissions.js +911 -109
  123. package/lib/coordinator/permissions.js.map +1 -1
  124. package/lib/coordinator/roles.js +2143 -260
  125. package/lib/coordinator/roles.js.map +1 -1
  126. package/lib/coordinator/users.js +3389 -489
  127. package/lib/coordinator/users.js.map +1 -1
  128. package/lib/events/index.js +2297 -404
  129. package/lib/events/index.js.map +1 -1
  130. package/lib/files/index.js +2050 -418
  131. package/lib/files/index.js.map +1 -1
  132. package/lib/index.js +999 -183
  133. package/lib/index.js.map +1 -1
  134. package/lib/iot/feedTypes.js +185 -27
  135. package/lib/iot/feedTypes.js.map +1 -1
  136. package/lib/iot/feeds.js +417 -61
  137. package/lib/iot/feeds.js.map +1 -1
  138. package/lib/iot/fieldCategories.js +1169 -203
  139. package/lib/iot/fieldCategories.js.map +1 -1
  140. package/lib/iot/fieldGroupings.js +1686 -263
  141. package/lib/iot/fieldGroupings.js.map +1 -1
  142. package/lib/iot/fields.js +251 -30
  143. package/lib/iot/fields.js.map +1 -1
  144. package/lib/iot/index.js +209 -55
  145. package/lib/iot/index.js.map +1 -1
  146. package/lib/iot/outputs.js +317 -34
  147. package/lib/iot/outputs.js.map +1 -1
  148. package/lib/nionic/index.js +1094 -98
  149. package/lib/nionic/index.js.map +1 -1
  150. package/lib/request.js +1310 -228
  151. package/lib/request.js.map +1 -1
  152. package/lib/sessionTypes/auth0WebAuth.js +3391 -421
  153. package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
  154. package/lib/sessionTypes/index.js +209 -26
  155. package/lib/sessionTypes/index.js.map +1 -1
  156. package/lib/sessionTypes/machineAuth.js +1311 -151
  157. package/lib/sessionTypes/machineAuth.js.map +1 -1
  158. package/lib/sessionTypes/passwordGrantAuth.js +1057 -156
  159. package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
  160. package/lib/utils/events/formatEventUpdateToServer.js +102 -4
  161. package/lib/utils/events/formatEventUpdateToServer.js.map +1 -1
  162. package/lib/utils/events/index.js +51 -10
  163. package/lib/utils/events/index.js.map +1 -1
  164. package/lib/utils/iot/formatOutputFieldDataFromServer.js +224 -18
  165. package/lib/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
  166. package/lib/utils/iot/index.js +53 -15
  167. package/lib/utils/iot/index.js.map +1 -1
  168. package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js +203 -13
  169. package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
  170. package/lib/utils/objects/createCaseChangeFn.js +446 -25
  171. package/lib/utils/objects/createCaseChangeFn.js.map +1 -1
  172. package/lib/utils/objects/index.js +53 -15
  173. package/lib/utils/objects/index.js.map +1 -1
  174. package/lib/utils/objects/map.js +517 -33
  175. package/lib/utils/objects/map.js.map +1 -1
  176. package/lib/utils/objects/toCamelCase.js +36 -11
  177. package/lib/utils/objects/toCamelCase.js.map +1 -1
  178. package/lib/utils/objects/toSnakeCase.js +36 -11
  179. package/lib/utils/objects/toSnakeCase.js.map +1 -1
  180. package/lib/utils/pagination/formatPaginatedDataFromServer.js +265 -14
  181. package/lib/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
  182. package/lib/utils/pagination/index.js +51 -10
  183. package/lib/utils/pagination/index.js.map +1 -1
  184. package/lib/utils/url/index.js +44 -7
  185. package/lib/utils/url/index.js.map +1 -1
  186. package/lib/utils/url/stringifyParams.js +172 -18
  187. package/lib/utils/url/stringifyParams.js.map +1 -1
  188. package/package.json +31 -35
  189. package/src/bus/channels.js +6 -6
  190. package/src/bus/channels.spec.js +1 -1
  191. package/src/coordinator/applications.js +7 -7
  192. package/src/coordinator/applications.spec.js +1 -1
  193. package/src/coordinator/consent.js +3 -3
  194. package/src/coordinator/edgeNodes.js +3 -3
  195. package/src/coordinator/edgeNodes.spec.js +1 -1
  196. package/src/coordinator/organizations.js +4 -4
  197. package/src/coordinator/organizations.spec.js +1 -1
  198. package/src/coordinator/permissions.js +6 -6
  199. package/src/coordinator/permissions.spec.js +1 -1
  200. package/src/coordinator/roles.js +9 -9
  201. package/src/coordinator/roles.spec.js +1 -1
  202. package/src/coordinator/users.js +12 -12
  203. package/src/coordinator/users.spec.js +1 -1
  204. package/src/events/index.js +18 -18
  205. package/src/events/index.spec.js +3 -3
  206. package/src/files/index.js +9 -9
  207. package/src/files/index.spec.js +2 -2
  208. package/src/index.js +3 -1
  209. package/src/iot/feedTypes.js +2 -2
  210. package/src/iot/feeds.js +4 -4
  211. package/src/iot/feeds.spec.js +1 -1
  212. package/src/iot/fieldCategories.js +10 -10
  213. package/src/iot/fieldCategories.spec.js +2 -2
  214. package/src/iot/fieldGroupings.js +10 -10
  215. package/src/iot/fieldGroupings.spec.js +2 -2
  216. package/src/iot/fields.js +2 -2
  217. package/src/iot/fields.spec.js +1 -1
  218. package/src/iot/outputs.js +2 -2
  219. package/src/iot/outputs.spec.js +1 -1
  220. package/src/request.js +2 -4
  221. package/src/request.spec.js +1 -1
  222. package/src/sessionTypes/auth0WebAuth.spec.js +1 -1
  223. package/src/utils/events/index.js +2 -1
  224. package/src/utils/iot/formatOutputFieldDataFromServer.js +5 -5
  225. package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +2 -2
  226. package/src/utils/iot/index.js +2 -1
  227. package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.js +3 -1
  228. package/src/utils/objects/index.js +2 -1
  229. package/src/utils/pagination/formatPaginatedDataFromServer.js +3 -3
  230. package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +1 -1
  231. package/src/utils/pagination/index.js +2 -1
  232. package/support/mocharc.yml +1 -1
  233. package/.eslintrc +0 -24
package/esm/index.js CHANGED
@@ -1,20 +1,854 @@
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 _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
4
-
5
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
-
7
- import Bus from './bus';
8
- import Config from './config';
9
- import Coordinator from './coordinator';
10
- import Events from './events';
11
- import Files from './files';
12
- import Iot from './iot';
13
- import Nionic from './nionic';
14
- import Request from './request';
15
- import * as sessionTypes from './sessionTypes';
16
- import { toSnakeCase, toCamelCase } from './utils/objects';
1
+ "use strict";
17
2
 
3
+ require("core-js/modules/es.weak-map.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.toSnakeCase = exports.toCamelCase = exports.default = void 0;
8
+ require("core-js/modules/es.array.filter.js");
9
+ require("core-js/modules/es.array.index-of.js");
10
+ require("core-js/modules/es.array.iterator.js");
11
+ require("core-js/modules/esnext.iterator.constructor.js");
12
+ require("core-js/modules/esnext.iterator.filter.js");
13
+ require("core-js/modules/esnext.iterator.for-each.js");
14
+ var _bus = _interopRequireDefault(require("./bus"));
15
+ var _config = _interopRequireDefault(require("./config"));
16
+ var _coordinator = _interopRequireDefault(require("./coordinator"));
17
+ var _events = _interopRequireDefault(require("./events"));
18
+ var _files = _interopRequireDefault(require("./files"));
19
+ var _iot = _interopRequireDefault(require("./iot"));
20
+ var _nionic = _interopRequireDefault(require("./nionic"));
21
+ var _request = _interopRequireDefault(require("./request"));
22
+ var sessionTypes = _interopRequireWildcard(require("./sessionTypes"));
23
+ var _objects = _interopRequireDefault(require("./utils/objects"));
24
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
25
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
27
+ function cov_s22podzns() {
28
+ var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/index.js";
29
+ var hash = "8ba085b54f1fc2d7475575ca4fbfda6a6e4265d2";
30
+ var global = new Function("return this")();
31
+ var gcv = "__coverage__";
32
+ var coverageData = {
33
+ path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/index.js",
34
+ statementMap: {
35
+ "0": {
36
+ start: {
37
+ line: 75,
38
+ column: 4
39
+ },
40
+ end: {
41
+ line: 75,
42
+ column: 34
43
+ }
44
+ },
45
+ "1": {
46
+ start: {
47
+ line: 76,
48
+ column: 4
49
+ },
50
+ end: {
51
+ line: 76,
52
+ column: 31
53
+ }
54
+ },
55
+ "2": {
56
+ start: {
57
+ line: 78,
58
+ column: 4
59
+ },
60
+ end: {
61
+ line: 78,
62
+ column: 54
63
+ }
64
+ },
65
+ "3": {
66
+ start: {
67
+ line: 80,
68
+ column: 4
69
+ },
70
+ end: {
71
+ line: 80,
72
+ column: 53
73
+ }
74
+ },
75
+ "4": {
76
+ start: {
77
+ line: 81,
78
+ column: 4
79
+ },
80
+ end: {
81
+ line: 81,
82
+ column: 74
83
+ }
84
+ },
85
+ "5": {
86
+ start: {
87
+ line: 82,
88
+ column: 4
89
+ },
90
+ end: {
91
+ line: 85,
92
+ column: 6
93
+ }
94
+ },
95
+ "6": {
96
+ start: {
97
+ line: 86,
98
+ column: 4
99
+ },
100
+ end: {
101
+ line: 86,
102
+ column: 66
103
+ }
104
+ },
105
+ "7": {
106
+ start: {
107
+ line: 87,
108
+ column: 4
109
+ },
110
+ end: {
111
+ line: 87,
112
+ column: 63
113
+ }
114
+ },
115
+ "8": {
116
+ start: {
117
+ line: 88,
118
+ column: 4
119
+ },
120
+ end: {
121
+ line: 88,
122
+ column: 57
123
+ }
124
+ },
125
+ "9": {
126
+ start: {
127
+ line: 89,
128
+ column: 4
129
+ },
130
+ end: {
131
+ line: 89,
132
+ column: 66
133
+ }
134
+ },
135
+ "10": {
136
+ start: {
137
+ line: 91,
138
+ column: 4
139
+ },
140
+ end: {
141
+ line: 91,
142
+ column: 36
143
+ }
144
+ },
145
+ "11": {
146
+ start: {
147
+ line: 104,
148
+ column: 4
149
+ },
150
+ end: {
151
+ line: 108,
152
+ column: 5
153
+ }
154
+ },
155
+ "12": {
156
+ start: {
157
+ line: 105,
158
+ column: 6
159
+ },
160
+ end: {
161
+ line: 107,
162
+ column: 8
163
+ }
164
+ },
165
+ "13": {
166
+ start: {
167
+ line: 110,
168
+ column: 4
169
+ },
170
+ end: {
171
+ line: 110,
172
+ column: 67
173
+ }
174
+ },
175
+ "14": {
176
+ start: {
177
+ line: 112,
178
+ column: 4
179
+ },
180
+ end: {
181
+ line: 112,
182
+ column: 73
183
+ }
184
+ },
185
+ "15": {
186
+ start: {
187
+ line: 114,
188
+ column: 4
189
+ },
190
+ end: {
191
+ line: 116,
192
+ column: 5
193
+ }
194
+ },
195
+ "16": {
196
+ start: {
197
+ line: 115,
198
+ column: 6
199
+ },
200
+ end: {
201
+ line: 115,
202
+ column: 59
203
+ }
204
+ },
205
+ "17": {
206
+ start: {
207
+ line: 118,
208
+ column: 4
209
+ },
210
+ end: {
211
+ line: 118,
212
+ column: 73
213
+ }
214
+ },
215
+ "18": {
216
+ start: {
217
+ line: 127,
218
+ column: 4
219
+ },
220
+ end: {
221
+ line: 129,
222
+ column: 5
223
+ }
224
+ },
225
+ "19": {
226
+ start: {
227
+ line: 128,
228
+ column: 6
229
+ },
230
+ end: {
231
+ line: 128,
232
+ column: 65
233
+ }
234
+ },
235
+ "20": {
236
+ start: {
237
+ line: 131,
238
+ column: 4
239
+ },
240
+ end: {
241
+ line: 131,
242
+ column: 47
243
+ }
244
+ },
245
+ "21": {
246
+ start: {
247
+ line: 132,
248
+ column: 4
249
+ },
250
+ end: {
251
+ line: 132,
252
+ column: 50
253
+ }
254
+ },
255
+ "22": {
256
+ start: {
257
+ line: 134,
258
+ column: 4
259
+ },
260
+ end: {
261
+ line: 134,
262
+ column: 57
263
+ }
264
+ },
265
+ "23": {
266
+ start: {
267
+ line: 136,
268
+ column: 4
269
+ },
270
+ end: {
271
+ line: 136,
272
+ column: 45
273
+ }
274
+ },
275
+ "24": {
276
+ start: {
277
+ line: 137,
278
+ column: 4
279
+ },
280
+ end: {
281
+ line: 139,
282
+ column: 6
283
+ }
284
+ },
285
+ "25": {
286
+ start: {
287
+ line: 138,
288
+ column: 16
289
+ },
290
+ end: {
291
+ line: 138,
292
+ column: 35
293
+ }
294
+ },
295
+ "26": {
296
+ start: {
297
+ line: 153,
298
+ column: 4
299
+ },
300
+ end: {
301
+ line: 165,
302
+ column: 5
303
+ }
304
+ },
305
+ "27": {
306
+ start: {
307
+ line: 155,
308
+ column: 8
309
+ },
310
+ end: {
311
+ line: 155,
312
+ column: 51
313
+ }
314
+ },
315
+ "28": {
316
+ start: {
317
+ line: 158,
318
+ column: 8
319
+ },
320
+ end: {
321
+ line: 158,
322
+ column: 56
323
+ }
324
+ },
325
+ "29": {
326
+ start: {
327
+ line: 161,
328
+ column: 8
329
+ },
330
+ end: {
331
+ line: 161,
332
+ column: 50
333
+ }
334
+ },
335
+ "30": {
336
+ start: {
337
+ line: 164,
338
+ column: 8
339
+ },
340
+ end: {
341
+ line: 164,
342
+ column: 56
343
+ }
344
+ },
345
+ "31": {
346
+ start: {
347
+ line: 179,
348
+ column: 4
349
+ },
350
+ end: {
351
+ line: 179,
352
+ column: 43
353
+ }
354
+ },
355
+ "32": {
356
+ start: {
357
+ line: 191,
358
+ column: 4
359
+ },
360
+ end: {
361
+ line: 196,
362
+ column: 7
363
+ }
364
+ },
365
+ "33": {
366
+ start: {
367
+ line: 192,
368
+ column: 6
369
+ },
370
+ end: {
371
+ line: 195,
372
+ column: 8
373
+ }
374
+ },
375
+ "34": {
376
+ start: {
377
+ line: 200,
378
+ column: 37
379
+ },
380
+ end: {
381
+ line: 200,
382
+ column: 48
383
+ }
384
+ }
385
+ },
386
+ fnMap: {
387
+ "0": {
388
+ name: "(anonymous_0)",
389
+ decl: {
390
+ start: {
391
+ line: 74,
392
+ column: 2
393
+ },
394
+ end: {
395
+ line: 74,
396
+ column: 3
397
+ }
398
+ },
399
+ loc: {
400
+ start: {
401
+ line: 74,
402
+ column: 66
403
+ },
404
+ end: {
405
+ line: 92,
406
+ column: 3
407
+ }
408
+ },
409
+ line: 74
410
+ },
411
+ "1": {
412
+ name: "(anonymous_1)",
413
+ decl: {
414
+ start: {
415
+ line: 103,
416
+ column: 2
417
+ },
418
+ end: {
419
+ line: 103,
420
+ column: 3
421
+ }
422
+ },
423
+ loc: {
424
+ start: {
425
+ line: 103,
426
+ column: 61
427
+ },
428
+ end: {
429
+ line: 119,
430
+ column: 3
431
+ }
432
+ },
433
+ line: 103
434
+ },
435
+ "2": {
436
+ name: "(anonymous_2)",
437
+ decl: {
438
+ start: {
439
+ line: 126,
440
+ column: 2
441
+ },
442
+ end: {
443
+ line: 126,
444
+ column: 3
445
+ }
446
+ },
447
+ loc: {
448
+ start: {
449
+ line: 126,
450
+ column: 35
451
+ },
452
+ end: {
453
+ line: 140,
454
+ column: 3
455
+ }
456
+ },
457
+ line: 126
458
+ },
459
+ "3": {
460
+ name: "(anonymous_3)",
461
+ decl: {
462
+ start: {
463
+ line: 138,
464
+ column: 6
465
+ },
466
+ end: {
467
+ line: 138,
468
+ column: 7
469
+ }
470
+ },
471
+ loc: {
472
+ start: {
473
+ line: 138,
474
+ column: 16
475
+ },
476
+ end: {
477
+ line: 138,
478
+ column: 35
479
+ }
480
+ },
481
+ line: 138
482
+ },
483
+ "4": {
484
+ name: "(anonymous_4)",
485
+ decl: {
486
+ start: {
487
+ line: 152,
488
+ column: 2
489
+ },
490
+ end: {
491
+ line: 152,
492
+ column: 3
493
+ }
494
+ },
495
+ loc: {
496
+ start: {
497
+ line: 152,
498
+ column: 34
499
+ },
500
+ end: {
501
+ line: 166,
502
+ column: 3
503
+ }
504
+ },
505
+ line: 152
506
+ },
507
+ "5": {
508
+ name: "(anonymous_5)",
509
+ decl: {
510
+ start: {
511
+ line: 178,
512
+ column: 2
513
+ },
514
+ end: {
515
+ line: 178,
516
+ column: 3
517
+ }
518
+ },
519
+ loc: {
520
+ start: {
521
+ line: 178,
522
+ column: 31
523
+ },
524
+ end: {
525
+ line: 180,
526
+ column: 3
527
+ }
528
+ },
529
+ line: 178
530
+ },
531
+ "6": {
532
+ name: "(anonymous_6)",
533
+ decl: {
534
+ start: {
535
+ line: 190,
536
+ column: 2
537
+ },
538
+ end: {
539
+ line: 190,
540
+ column: 3
541
+ }
542
+ },
543
+ loc: {
544
+ start: {
545
+ line: 190,
546
+ column: 21
547
+ },
548
+ end: {
549
+ line: 197,
550
+ column: 3
551
+ }
552
+ },
553
+ line: 190
554
+ },
555
+ "7": {
556
+ name: "(anonymous_7)",
557
+ decl: {
558
+ start: {
559
+ line: 191,
560
+ column: 33
561
+ },
562
+ end: {
563
+ line: 191,
564
+ column: 34
565
+ }
566
+ },
567
+ loc: {
568
+ start: {
569
+ line: 191,
570
+ column: 49
571
+ },
572
+ end: {
573
+ line: 196,
574
+ column: 5
575
+ }
576
+ },
577
+ line: 191
578
+ }
579
+ },
580
+ branchMap: {
581
+ "0": {
582
+ loc: {
583
+ start: {
584
+ line: 74,
585
+ column: 16
586
+ },
587
+ end: {
588
+ line: 74,
589
+ column: 27
590
+ }
591
+ },
592
+ type: "default-arg",
593
+ locations: [{
594
+ start: {
595
+ line: 74,
596
+ column: 25
597
+ },
598
+ end: {
599
+ line: 74,
600
+ column: 27
601
+ }
602
+ }],
603
+ line: 74
604
+ },
605
+ "1": {
606
+ loc: {
607
+ start: {
608
+ line: 74,
609
+ column: 29
610
+ },
611
+ end: {
612
+ line: 74,
613
+ column: 49
614
+ }
615
+ },
616
+ type: "default-arg",
617
+ locations: [{
618
+ start: {
619
+ line: 74,
620
+ column: 47
621
+ },
622
+ end: {
623
+ line: 74,
624
+ column: 49
625
+ }
626
+ }],
627
+ line: 74
628
+ },
629
+ "2": {
630
+ loc: {
631
+ start: {
632
+ line: 104,
633
+ column: 4
634
+ },
635
+ end: {
636
+ line: 108,
637
+ column: 5
638
+ }
639
+ },
640
+ type: "if",
641
+ locations: [{
642
+ start: {
643
+ line: 104,
644
+ column: 4
645
+ },
646
+ end: {
647
+ line: 108,
648
+ column: 5
649
+ }
650
+ }, {
651
+ start: {
652
+ line: undefined,
653
+ column: undefined
654
+ },
655
+ end: {
656
+ line: undefined,
657
+ column: undefined
658
+ }
659
+ }],
660
+ line: 104
661
+ },
662
+ "3": {
663
+ loc: {
664
+ start: {
665
+ line: 114,
666
+ column: 4
667
+ },
668
+ end: {
669
+ line: 116,
670
+ column: 5
671
+ }
672
+ },
673
+ type: "if",
674
+ locations: [{
675
+ start: {
676
+ line: 114,
677
+ column: 4
678
+ },
679
+ end: {
680
+ line: 116,
681
+ column: 5
682
+ }
683
+ }, {
684
+ start: {
685
+ line: undefined,
686
+ column: undefined
687
+ },
688
+ end: {
689
+ line: undefined,
690
+ column: undefined
691
+ }
692
+ }],
693
+ line: 114
694
+ },
695
+ "4": {
696
+ loc: {
697
+ start: {
698
+ line: 127,
699
+ column: 4
700
+ },
701
+ end: {
702
+ line: 129,
703
+ column: 5
704
+ }
705
+ },
706
+ type: "if",
707
+ locations: [{
708
+ start: {
709
+ line: 127,
710
+ column: 4
711
+ },
712
+ end: {
713
+ line: 129,
714
+ column: 5
715
+ }
716
+ }, {
717
+ start: {
718
+ line: undefined,
719
+ column: undefined
720
+ },
721
+ end: {
722
+ line: undefined,
723
+ column: undefined
724
+ }
725
+ }],
726
+ line: 127
727
+ },
728
+ "5": {
729
+ loc: {
730
+ start: {
731
+ line: 153,
732
+ column: 4
733
+ },
734
+ end: {
735
+ line: 165,
736
+ column: 5
737
+ }
738
+ },
739
+ type: "switch",
740
+ locations: [{
741
+ start: {
742
+ line: 154,
743
+ column: 6
744
+ },
745
+ end: {
746
+ line: 155,
747
+ column: 51
748
+ }
749
+ }, {
750
+ start: {
751
+ line: 157,
752
+ column: 6
753
+ },
754
+ end: {
755
+ line: 158,
756
+ column: 56
757
+ }
758
+ }, {
759
+ start: {
760
+ line: 160,
761
+ column: 6
762
+ },
763
+ end: {
764
+ line: 161,
765
+ column: 50
766
+ }
767
+ }, {
768
+ start: {
769
+ line: 163,
770
+ column: 6
771
+ },
772
+ end: {
773
+ line: 164,
774
+ column: 56
775
+ }
776
+ }],
777
+ line: 153
778
+ }
779
+ },
780
+ s: {
781
+ "0": 0,
782
+ "1": 0,
783
+ "2": 0,
784
+ "3": 0,
785
+ "4": 0,
786
+ "5": 0,
787
+ "6": 0,
788
+ "7": 0,
789
+ "8": 0,
790
+ "9": 0,
791
+ "10": 0,
792
+ "11": 0,
793
+ "12": 0,
794
+ "13": 0,
795
+ "14": 0,
796
+ "15": 0,
797
+ "16": 0,
798
+ "17": 0,
799
+ "18": 0,
800
+ "19": 0,
801
+ "20": 0,
802
+ "21": 0,
803
+ "22": 0,
804
+ "23": 0,
805
+ "24": 0,
806
+ "25": 0,
807
+ "26": 0,
808
+ "27": 0,
809
+ "28": 0,
810
+ "29": 0,
811
+ "30": 0,
812
+ "31": 0,
813
+ "32": 0,
814
+ "33": 0,
815
+ "34": 0
816
+ },
817
+ f: {
818
+ "0": 0,
819
+ "1": 0,
820
+ "2": 0,
821
+ "3": 0,
822
+ "4": 0,
823
+ "5": 0,
824
+ "6": 0,
825
+ "7": 0
826
+ },
827
+ b: {
828
+ "0": [0],
829
+ "1": [0],
830
+ "2": [0, 0],
831
+ "3": [0, 0],
832
+ "4": [0, 0],
833
+ "5": [0, 0, 0, 0]
834
+ },
835
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
836
+ hash: "8ba085b54f1fc2d7475575ca4fbfda6a6e4265d2"
837
+ };
838
+ var coverage = global[gcv] || (global[gcv] = {});
839
+ if (!coverage[path] || coverage[path].hash !== hash) {
840
+ coverage[path] = coverageData;
841
+ }
842
+ var actualCoverage = coverage[path];
843
+ {
844
+ // @ts-ignore
845
+ cov_s22podzns = function () {
846
+ return actualCoverage;
847
+ };
848
+ }
849
+ return actualCoverage;
850
+ }
851
+ cov_s22podzns();
18
852
  /**
19
853
  * An adapter that allows the SDK to authenticate with different services and manage various tokens.
20
854
  * Can authenticate with a service like Auth0 and then with Contxt or can communicate directly
@@ -69,8 +903,7 @@ import { toSnakeCase, toCamelCase } from './utils/objects';
69
903
  * sessionType: 'auth0WebAuth'
70
904
  * });
71
905
  */
72
-
73
- var ContxtSdk = function () {
906
+ class ContxtSdk {
74
907
  /**
75
908
  * @param {UserConfig} config The user provided configuration options
76
909
  * @param {Object.<string, ExternalModule>} [externalModules] User provided external modules that
@@ -78,28 +911,34 @@ var ContxtSdk = function () {
78
911
  * @param {string} sessionType The type of auth session you wish to use (e.g. auth0WebAuth
79
912
  * or machine)
80
913
  */
81
- function ContxtSdk(_ref) {
82
- var _ref$config = _ref.config,
83
- config = _ref$config === undefined ? {} : _ref$config,
84
- _ref$externalModules = _ref.externalModules,
85
- externalModules = _ref$externalModules === undefined ? {} : _ref$externalModules,
86
- sessionType = _ref.sessionType;
87
-
88
- _classCallCheck(this, ContxtSdk);
89
-
914
+ constructor(_ref) {
915
+ let _ref$config = _ref.config,
916
+ config = _ref$config === void 0 ? (cov_s22podzns().b[0][0]++, {}) : _ref$config,
917
+ _ref$externalModules = _ref.externalModules,
918
+ externalModules = _ref$externalModules === void 0 ? (cov_s22podzns().b[1][0]++, {}) : _ref$externalModules,
919
+ sessionType = _ref.sessionType;
920
+ cov_s22podzns().f[0]++;
921
+ cov_s22podzns().s[0]++;
90
922
  this._dynamicModuleNames = [];
923
+ cov_s22podzns().s[1]++;
91
924
  this._replacedModules = {};
92
-
93
- this.config = new Config(config, externalModules);
94
-
925
+ cov_s22podzns().s[2]++;
926
+ this.config = new _config.default(config, externalModules);
927
+ cov_s22podzns().s[3]++;
95
928
  this.auth = this._createAuthSession(sessionType);
96
- this.bus = new Bus(this, this._createRequest('bus'), this.config.bus);
97
- this.coordinator = new Coordinator(this, this._createRequest('coordinator'));
98
- this.events = new Events(this, this._createRequest('events'));
99
- this.files = new Files(this, this._createRequest('files'));
100
- this.iot = new Iot(this, this._createRequest('iot'));
101
- this.nionic = new Nionic(this, this._createRequest('nionic'));
102
-
929
+ cov_s22podzns().s[4]++;
930
+ this.bus = new _bus.default(this, this._createRequest('bus'), this.config.bus);
931
+ cov_s22podzns().s[5]++;
932
+ this.coordinator = new _coordinator.default(this, this._createRequest('coordinator'));
933
+ cov_s22podzns().s[6]++;
934
+ this.events = new _events.default(this, this._createRequest('events'));
935
+ cov_s22podzns().s[7]++;
936
+ this.files = new _files.default(this, this._createRequest('files'));
937
+ cov_s22podzns().s[8]++;
938
+ this.iot = new _iot.default(this, this._createRequest('iot'));
939
+ cov_s22podzns().s[9]++;
940
+ this.nionic = new _nionic.default(this, this._createRequest('nionic'));
941
+ cov_s22podzns().s[10]++;
103
942
  this._decorate(externalModules);
104
943
  }
105
944
 
@@ -112,123 +951,138 @@ var ContxtSdk = function () {
112
951
  * point for the module in the SDK (i.e. customModule -> sdk.customModule)
113
952
  * @param {ExternalModule} externalModule
114
953
  */
115
-
116
-
117
- _createClass(ContxtSdk, [{
118
- key: 'mountDynamicModule',
119
- value: function mountDynamicModule(moduleName, _ref2) {
120
- var clientId = _ref2.clientId,
121
- host = _ref2.host,
122
- module = _ref2.module;
123
-
124
- if (this._dynamicModuleNames.indexOf(moduleName) > -1) {
125
- throw new Error('An dynamic module of the name `' + moduleName + '` already exists. This problem can be rectified by using a different name for the new module.');
126
- }
127
-
128
- this.config.addDynamicAudience(moduleName, { clientId: clientId, host: host });
129
-
130
- this._dynamicModuleNames = [].concat(_toConsumableArray(this._dynamicModuleNames), [moduleName]);
131
-
132
- if (this[moduleName]) {
133
- this._replacedModules[moduleName] = this[moduleName];
134
- }
135
-
136
- this[moduleName] = new module(this, this._createRequest(moduleName));
954
+ mountDynamicModule(moduleName, _ref2) {
955
+ let clientId = _ref2.clientId,
956
+ host = _ref2.host,
957
+ module = _ref2.module;
958
+ cov_s22podzns().f[1]++;
959
+ cov_s22podzns().s[11]++;
960
+ if (this._dynamicModuleNames.indexOf(moduleName) > -1) {
961
+ cov_s22podzns().b[2][0]++;
962
+ cov_s22podzns().s[12]++;
963
+ throw new Error(`An dynamic module of the name \`${moduleName}\` already exists. This problem can be rectified by using a different name for the new module.`);
964
+ } else {
965
+ cov_s22podzns().b[2][1]++;
137
966
  }
138
-
139
- /**
140
- * Unmounts a dynamic module from the SDK
141
- *
142
- * @param {string} moduleName The name of the dynamic module to unmount
143
- */
144
-
145
- }, {
146
- key: 'unmountDynamicModule',
147
- value: function unmountDynamicModule(moduleName) {
148
- if (this._dynamicModuleNames.indexOf(moduleName) === -1) {
149
- throw new Error('There is no external module to unmount.');
150
- }
151
-
152
- this.auth.clearCurrentApiToken(moduleName);
153
- this.config.removeDynamicAudience(moduleName);
154
-
155
- this[moduleName] = this._replacedModules[moduleName];
156
-
157
- delete this._replacedModules[moduleName];
158
- this._dynamicModuleNames = this._dynamicModuleNames.filter(function (name) {
159
- return name !== moduleName;
160
- });
967
+ cov_s22podzns().s[13]++;
968
+ this.config.addDynamicAudience(moduleName, {
969
+ clientId,
970
+ host
971
+ });
972
+ cov_s22podzns().s[14]++;
973
+ this._dynamicModuleNames = [...this._dynamicModuleNames, moduleName];
974
+ cov_s22podzns().s[15]++;
975
+ if (this[moduleName]) {
976
+ cov_s22podzns().b[3][0]++;
977
+ cov_s22podzns().s[16]++;
978
+ this._replacedModules[moduleName] = this[moduleName];
979
+ } else {
980
+ cov_s22podzns().b[3][1]++;
161
981
  }
982
+ cov_s22podzns().s[17]++;
983
+ this[moduleName] = new module(this, this._createRequest(moduleName));
984
+ }
162
985
 
163
- /**
164
- * Returns a new instance of the session type requested
165
- *
166
- * @param {string} sessionType
167
- *
168
- * @returns {SessionType} sessionType
169
- * @throws {Error}
170
- *
171
- * @private
172
- */
173
-
174
- }, {
175
- key: '_createAuthSession',
176
- value: function _createAuthSession(sessionType) {
177
- switch (sessionType) {
178
- case sessionTypes.TYPES.AUTH0_WEB_AUTH:
179
- return new sessionTypes.Auth0WebAuth(this);
180
-
181
- case sessionTypes.TYPES.PASSWORD_GRANT_AUTH:
182
- return new sessionTypes.PasswordGrantAuth(this);
183
-
184
- case sessionTypes.TYPES.MACHINE_AUTH:
185
- return new sessionTypes.MachineAuth(this);
186
-
187
- default:
188
- throw new Error('Invalid sessionType provided');
189
- }
190
- }
191
-
192
- /**
193
- * Returns an instance of the Request module that is tied to the requested audience
194
- *
195
- * @param {string} audienceName The audience name of the service you are trying to reach
196
- * (e.g. facilities or feeds)
197
- *
198
- * @returns {Object} Request module
199
- *
200
- * @private
201
- */
202
-
203
- }, {
204
- key: '_createRequest',
205
- value: function _createRequest(audienceName) {
206
- return new Request(this, audienceName);
986
+ /**
987
+ * Unmounts a dynamic module from the SDK
988
+ *
989
+ * @param {string} moduleName The name of the dynamic module to unmount
990
+ */
991
+ unmountDynamicModule(moduleName) {
992
+ cov_s22podzns().f[2]++;
993
+ cov_s22podzns().s[18]++;
994
+ if (this._dynamicModuleNames.indexOf(moduleName) === -1) {
995
+ cov_s22podzns().b[4][0]++;
996
+ cov_s22podzns().s[19]++;
997
+ throw new Error('There is no external module to unmount.');
998
+ } else {
999
+ cov_s22podzns().b[4][1]++;
207
1000
  }
1001
+ cov_s22podzns().s[20]++;
1002
+ this.auth.clearCurrentApiToken(moduleName);
1003
+ cov_s22podzns().s[21]++;
1004
+ this.config.removeDynamicAudience(moduleName);
1005
+ cov_s22podzns().s[22]++;
1006
+ this[moduleName] = this._replacedModules[moduleName];
1007
+ cov_s22podzns().s[23]++;
1008
+ delete this._replacedModules[moduleName];
1009
+ cov_s22podzns().s[24]++;
1010
+ this._dynamicModuleNames = this._dynamicModuleNames.filter(name => {
1011
+ cov_s22podzns().f[3]++;
1012
+ cov_s22podzns().s[25]++;
1013
+ return name !== moduleName;
1014
+ });
1015
+ }
208
1016
 
209
- /**
210
- * Decorates custom modules onto the SDK instance so they behave as first-class citizens.
211
- *
212
- * @param {Object} modules
213
- * @param {function} modules.module
214
- *
215
- * @private
216
- */
217
-
218
- }, {
219
- key: '_decorate',
220
- value: function _decorate(modules) {
221
- var _this = this;
222
-
223
- Object.keys(modules).forEach(function (moduleName) {
224
- _this[moduleName] = new modules[moduleName].module(_this, _this._createRequest(moduleName));
225
- });
1017
+ /**
1018
+ * Returns a new instance of the session type requested
1019
+ *
1020
+ * @param {string} sessionType
1021
+ *
1022
+ * @returns {SessionType} sessionType
1023
+ * @throws {Error}
1024
+ *
1025
+ * @private
1026
+ */
1027
+ _createAuthSession(sessionType) {
1028
+ cov_s22podzns().f[4]++;
1029
+ cov_s22podzns().s[26]++;
1030
+ switch (sessionType) {
1031
+ case sessionTypes.TYPES.AUTH0_WEB_AUTH:
1032
+ cov_s22podzns().b[5][0]++;
1033
+ cov_s22podzns().s[27]++;
1034
+ return new sessionTypes.Auth0WebAuth(this);
1035
+ case sessionTypes.TYPES.PASSWORD_GRANT_AUTH:
1036
+ cov_s22podzns().b[5][1]++;
1037
+ cov_s22podzns().s[28]++;
1038
+ return new sessionTypes.PasswordGrantAuth(this);
1039
+ case sessionTypes.TYPES.MACHINE_AUTH:
1040
+ cov_s22podzns().b[5][2]++;
1041
+ cov_s22podzns().s[29]++;
1042
+ return new sessionTypes.MachineAuth(this);
1043
+ default:
1044
+ cov_s22podzns().b[5][3]++;
1045
+ cov_s22podzns().s[30]++;
1046
+ throw new Error('Invalid sessionType provided');
226
1047
  }
227
- }]);
1048
+ }
228
1049
 
229
- return ContxtSdk;
230
- }();
1050
+ /**
1051
+ * Returns an instance of the Request module that is tied to the requested audience
1052
+ *
1053
+ * @param {string} audienceName The audience name of the service you are trying to reach
1054
+ * (e.g. facilities or feeds)
1055
+ *
1056
+ * @returns {Object} Request module
1057
+ *
1058
+ * @private
1059
+ */
1060
+ _createRequest(audienceName) {
1061
+ cov_s22podzns().f[5]++;
1062
+ cov_s22podzns().s[31]++;
1063
+ return new _request.default(this, audienceName);
1064
+ }
231
1065
 
232
- export default ContxtSdk;
233
- export { toSnakeCase, toCamelCase };
1066
+ /**
1067
+ * Decorates custom modules onto the SDK instance so they behave as first-class citizens.
1068
+ *
1069
+ * @param {Object} modules
1070
+ * @param {function} modules.module
1071
+ *
1072
+ * @private
1073
+ */
1074
+ _decorate(modules) {
1075
+ cov_s22podzns().f[6]++;
1076
+ cov_s22podzns().s[32]++;
1077
+ Object.keys(modules).forEach(moduleName => {
1078
+ cov_s22podzns().f[7]++;
1079
+ cov_s22podzns().s[33]++;
1080
+ this[moduleName] = new modules[moduleName].module(this, this._createRequest(moduleName));
1081
+ });
1082
+ }
1083
+ }
1084
+ const _ref3 = (cov_s22podzns().s[34]++, _objects.default),
1085
+ toSnakeCase = exports.toSnakeCase = _ref3.toSnakeCase,
1086
+ toCamelCase = exports.toCamelCase = _ref3.toCamelCase;
1087
+ var _default = exports.default = ContxtSdk;
234
1088
  //# sourceMappingURL=index.js.map