@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
@@ -1,14 +1,1404 @@
1
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
2
-
3
- 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; }; }();
4
-
5
- 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); } }
6
-
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
-
9
- import defaultAudiences from './audiences';
10
- import defaultConfigs from './defaults';
1
+ "use strict";
11
2
 
3
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
4
+ require("core-js/modules/esnext.iterator.for-each.js");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ require("core-js/modules/es.array.filter.js");
10
+ require("core-js/modules/es.array.index-of.js");
11
+ require("core-js/modules/es.array.iterator.js");
12
+ require("core-js/modules/esnext.iterator.constructor.js");
13
+ require("core-js/modules/esnext.iterator.filter.js");
14
+ require("core-js/modules/esnext.iterator.reduce.js");
15
+ var _audiences = _interopRequireDefault(require("./audiences"));
16
+ var _defaults = _interopRequireDefault(require("./defaults"));
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ function cov_1n1bb4mnsz() {
19
+ var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/config/index.js";
20
+ var hash = "e2e1bec209d833852fd33c484710a2590a9a6d81";
21
+ var global = new Function("return this")();
22
+ var gcv = "__coverage__";
23
+ var coverageData = {
24
+ path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/config/index.js",
25
+ statementMap: {
26
+ "0": {
27
+ start: {
28
+ line: 99,
29
+ column: 4
30
+ },
31
+ end: {
32
+ line: 99,
33
+ column: 36
34
+ }
35
+ },
36
+ "1": {
37
+ start: {
38
+ line: 101,
39
+ column: 4
40
+ },
41
+ end: {
42
+ line: 101,
43
+ column: 36
44
+ }
45
+ },
46
+ "2": {
47
+ start: {
48
+ line: 102,
49
+ column: 4
50
+ },
51
+ end: {
52
+ line: 102,
53
+ column: 33
54
+ }
55
+ },
56
+ "3": {
57
+ start: {
58
+ line: 104,
59
+ column: 4
60
+ },
61
+ end: {
62
+ line: 108,
63
+ column: 7
64
+ }
65
+ },
66
+ "4": {
67
+ start: {
68
+ line: 110,
69
+ column: 4
70
+ },
71
+ end: {
72
+ line: 113,
73
+ column: 6
74
+ }
75
+ },
76
+ "5": {
77
+ start: {
78
+ line: 115,
79
+ column: 4
80
+ },
81
+ end: {
82
+ line: 118,
83
+ column: 6
84
+ }
85
+ },
86
+ "6": {
87
+ start: {
88
+ line: 120,
89
+ column: 4
90
+ },
91
+ end: {
92
+ line: 123,
93
+ column: 6
94
+ }
95
+ },
96
+ "7": {
97
+ start: {
98
+ line: 127,
99
+ column: 4
100
+ },
101
+ end: {
102
+ line: 131,
103
+ column: 5
104
+ }
105
+ },
106
+ "8": {
107
+ start: {
108
+ line: 128,
109
+ column: 6
110
+ },
111
+ end: {
112
+ line: 130,
113
+ column: 8
114
+ }
115
+ },
116
+ "9": {
117
+ start: {
118
+ line: 133,
119
+ column: 4
120
+ },
121
+ end: {
122
+ line: 137,
123
+ column: 5
124
+ }
125
+ },
126
+ "10": {
127
+ start: {
128
+ line: 134,
129
+ column: 6
130
+ },
131
+ end: {
132
+ line: 136,
133
+ column: 8
134
+ }
135
+ },
136
+ "11": {
137
+ start: {
138
+ line: 139,
139
+ column: 4
140
+ },
141
+ end: {
142
+ line: 139,
143
+ column: 79
144
+ }
145
+ },
146
+ "12": {
147
+ start: {
148
+ line: 141,
149
+ column: 4
150
+ },
151
+ end: {
152
+ line: 143,
153
+ column: 5
154
+ }
155
+ },
156
+ "13": {
157
+ start: {
158
+ line: 142,
159
+ column: 6
160
+ },
161
+ end: {
162
+ line: 142,
163
+ column: 75
164
+ }
165
+ },
166
+ "14": {
167
+ start: {
168
+ line: 145,
169
+ column: 4
170
+ },
171
+ end: {
172
+ line: 148,
173
+ column: 6
174
+ }
175
+ },
176
+ "15": {
177
+ start: {
178
+ line: 152,
179
+ column: 4
180
+ },
181
+ end: {
182
+ line: 154,
183
+ column: 5
184
+ }
185
+ },
186
+ "16": {
187
+ start: {
188
+ line: 153,
189
+ column: 6
190
+ },
191
+ end: {
192
+ line: 153,
193
+ column: 65
194
+ }
195
+ },
196
+ "17": {
197
+ start: {
198
+ line: 156,
199
+ column: 4
200
+ },
201
+ end: {
202
+ line: 156,
203
+ column: 73
204
+ }
205
+ },
206
+ "18": {
207
+ start: {
208
+ line: 158,
209
+ column: 4
210
+ },
211
+ end: {
212
+ line: 158,
213
+ column: 49
214
+ }
215
+ },
216
+ "19": {
217
+ start: {
218
+ line: 159,
219
+ column: 4
220
+ },
221
+ end: {
222
+ line: 161,
223
+ column: 6
224
+ }
225
+ },
226
+ "20": {
227
+ start: {
228
+ line: 160,
229
+ column: 16
230
+ },
231
+ end: {
232
+ line: 160,
233
+ column: 37
234
+ }
235
+ },
236
+ "21": {
237
+ start: {
238
+ line: 177,
239
+ column: 4
240
+ },
241
+ end: {
242
+ line: 194,
243
+ column: 5
244
+ }
245
+ },
246
+ "22": {
247
+ start: {
248
+ line: 178,
249
+ column: 23
250
+ },
251
+ end: {
252
+ line: 181,
253
+ column: 7
254
+ }
255
+ },
256
+ "23": {
257
+ start: {
258
+ line: 183,
259
+ column: 6
260
+ },
261
+ end: {
262
+ line: 185,
263
+ column: 7
264
+ }
265
+ },
266
+ "24": {
267
+ start: {
268
+ line: 184,
269
+ column: 8
270
+ },
271
+ end: {
272
+ line: 184,
273
+ column: 46
274
+ }
275
+ },
276
+ "25": {
277
+ start: {
278
+ line: 187,
279
+ column: 6
280
+ },
281
+ end: {
282
+ line: 187,
283
+ column: 22
284
+ }
285
+ },
286
+ "26": {
287
+ start: {
288
+ line: 188,
289
+ column: 11
290
+ },
291
+ end: {
292
+ line: 194,
293
+ column: 5
294
+ }
295
+ },
296
+ "27": {
297
+ start: {
298
+ line: 189,
299
+ column: 6
300
+ },
301
+ end: {
302
+ line: 189,
303
+ column: 35
304
+ }
305
+ },
306
+ "28": {
307
+ start: {
308
+ line: 191,
309
+ column: 6
310
+ },
311
+ end: {
312
+ line: 193,
313
+ column: 8
314
+ }
315
+ },
316
+ "29": {
317
+ start: {
318
+ line: 217,
319
+ column: 8
320
+ },
321
+ end: {
322
+ line: 217,
323
+ column: 15
324
+ }
325
+ },
326
+ "30": {
327
+ start: {
328
+ line: 219,
329
+ column: 4
330
+ },
331
+ end: {
332
+ line: 226,
333
+ column: 6
334
+ }
335
+ },
336
+ "31": {
337
+ start: {
338
+ line: 242,
339
+ column: 4
340
+ },
341
+ end: {
342
+ line: 260,
343
+ column: 11
344
+ }
345
+ },
346
+ "32": {
347
+ start: {
348
+ line: 243,
349
+ column: 23
350
+ },
351
+ end: {
352
+ line: 243,
353
+ column: 52
354
+ }
355
+ },
356
+ "33": {
357
+ start: {
358
+ line: 244,
359
+ column: 19
360
+ },
361
+ end: {
362
+ line: 244,
363
+ column: 44
364
+ }
365
+ },
366
+ "34": {
367
+ start: {
368
+ line: 245,
369
+ column: 26
370
+ },
371
+ end: {
372
+ line: 245,
373
+ column: 57
374
+ }
375
+ },
376
+ "35": {
377
+ start: {
378
+ line: 246,
379
+ column: 22
380
+ },
381
+ end: {
382
+ line: 246,
383
+ column: 45
384
+ }
385
+ },
386
+ "36": {
387
+ start: {
388
+ line: 248,
389
+ column: 6
390
+ },
391
+ end: {
392
+ line: 252,
393
+ column: 7
394
+ }
395
+ },
396
+ "37": {
397
+ start: {
398
+ line: 249,
399
+ column: 8
400
+ },
401
+ end: {
402
+ line: 251,
403
+ column: 10
404
+ }
405
+ },
406
+ "38": {
407
+ start: {
408
+ line: 254,
409
+ column: 6
410
+ },
411
+ end: {
412
+ line: 257,
413
+ column: 8
414
+ }
415
+ },
416
+ "39": {
417
+ start: {
418
+ line: 259,
419
+ column: 6
420
+ },
421
+ end: {
422
+ line: 259,
423
+ column: 18
424
+ }
425
+ },
426
+ "40": {
427
+ start: {
428
+ line: 278,
429
+ column: 4
430
+ },
431
+ end: {
432
+ line: 292,
433
+ column: 11
434
+ }
435
+ },
436
+ "41": {
437
+ start: {
438
+ line: 279,
439
+ column: 33
440
+ },
441
+ end: {
442
+ line: 279,
443
+ column: 57
444
+ }
445
+ },
446
+ "42": {
447
+ start: {
448
+ line: 280,
449
+ column: 30
450
+ },
451
+ end: {
452
+ line: 280,
453
+ column: 44
454
+ }
455
+ },
456
+ "43": {
457
+ start: {
458
+ line: 282,
459
+ column: 6
460
+ },
461
+ end: {
462
+ line: 289,
463
+ column: 7
464
+ }
465
+ },
466
+ "44": {
467
+ start: {
468
+ line: 283,
469
+ column: 8
470
+ },
471
+ end: {
472
+ line: 286,
473
+ column: 10
474
+ }
475
+ },
476
+ "45": {
477
+ start: {
478
+ line: 288,
479
+ column: 8
480
+ },
481
+ end: {
482
+ line: 288,
483
+ column: 41
484
+ }
485
+ },
486
+ "46": {
487
+ start: {
488
+ line: 291,
489
+ column: 6
490
+ },
491
+ end: {
492
+ line: 291,
493
+ column: 18
494
+ }
495
+ }
496
+ },
497
+ fnMap: {
498
+ "0": {
499
+ name: "(anonymous_0)",
500
+ decl: {
501
+ start: {
502
+ line: 98,
503
+ column: 2
504
+ },
505
+ end: {
506
+ line: 98,
507
+ column: 3
508
+ }
509
+ },
510
+ loc: {
511
+ start: {
512
+ line: 98,
513
+ column: 43
514
+ },
515
+ end: {
516
+ line: 124,
517
+ column: 3
518
+ }
519
+ },
520
+ line: 98
521
+ },
522
+ "1": {
523
+ name: "(anonymous_1)",
524
+ decl: {
525
+ start: {
526
+ line: 126,
527
+ column: 2
528
+ },
529
+ end: {
530
+ line: 126,
531
+ column: 3
532
+ }
533
+ },
534
+ loc: {
535
+ start: {
536
+ line: 126,
537
+ column: 55
538
+ },
539
+ end: {
540
+ line: 149,
541
+ column: 3
542
+ }
543
+ },
544
+ line: 126
545
+ },
546
+ "2": {
547
+ name: "(anonymous_2)",
548
+ decl: {
549
+ start: {
550
+ line: 151,
551
+ column: 2
552
+ },
553
+ end: {
554
+ line: 151,
555
+ column: 3
556
+ }
557
+ },
558
+ loc: {
559
+ start: {
560
+ line: 151,
561
+ column: 38
562
+ },
563
+ end: {
564
+ line: 162,
565
+ column: 3
566
+ }
567
+ },
568
+ line: 151
569
+ },
570
+ "3": {
571
+ name: "(anonymous_3)",
572
+ decl: {
573
+ start: {
574
+ line: 160,
575
+ column: 6
576
+ },
577
+ end: {
578
+ line: 160,
579
+ column: 7
580
+ }
581
+ },
582
+ loc: {
583
+ start: {
584
+ line: 160,
585
+ column: 16
586
+ },
587
+ end: {
588
+ line: 160,
589
+ column: 37
590
+ }
591
+ },
592
+ line: 160
593
+ },
594
+ "4": {
595
+ name: "(anonymous_4)",
596
+ decl: {
597
+ start: {
598
+ line: 176,
599
+ column: 2
600
+ },
601
+ end: {
602
+ line: 176,
603
+ column: 3
604
+ }
605
+ },
606
+ loc: {
607
+ start: {
608
+ line: 176,
609
+ column: 50
610
+ },
611
+ end: {
612
+ line: 195,
613
+ column: 3
614
+ }
615
+ },
616
+ line: 176
617
+ },
618
+ "5": {
619
+ name: "(anonymous_5)",
620
+ decl: {
621
+ start: {
622
+ line: 212,
623
+ column: 2
624
+ },
625
+ end: {
626
+ line: 212,
627
+ column: 3
628
+ }
629
+ },
630
+ loc: {
631
+ start: {
632
+ line: 212,
633
+ column: 30
634
+ },
635
+ end: {
636
+ line: 227,
637
+ column: 3
638
+ }
639
+ },
640
+ line: 212
641
+ },
642
+ "6": {
643
+ name: "(anonymous_6)",
644
+ decl: {
645
+ start: {
646
+ line: 241,
647
+ column: 2
648
+ },
649
+ end: {
650
+ line: 241,
651
+ column: 3
652
+ }
653
+ },
654
+ loc: {
655
+ start: {
656
+ line: 241,
657
+ column: 45
658
+ },
659
+ end: {
660
+ line: 261,
661
+ column: 3
662
+ }
663
+ },
664
+ line: 241
665
+ },
666
+ "7": {
667
+ name: "(anonymous_7)",
668
+ decl: {
669
+ start: {
670
+ line: 242,
671
+ column: 47
672
+ },
673
+ end: {
674
+ line: 242,
675
+ column: 48
676
+ }
677
+ },
678
+ loc: {
679
+ start: {
680
+ line: 242,
681
+ column: 62
682
+ },
683
+ end: {
684
+ line: 260,
685
+ column: 5
686
+ }
687
+ },
688
+ line: 242
689
+ },
690
+ "8": {
691
+ name: "(anonymous_8)",
692
+ decl: {
693
+ start: {
694
+ line: 277,
695
+ column: 2
696
+ },
697
+ end: {
698
+ line: 277,
699
+ column: 3
700
+ }
701
+ },
702
+ loc: {
703
+ start: {
704
+ line: 277,
705
+ column: 65
706
+ },
707
+ end: {
708
+ line: 293,
709
+ column: 3
710
+ }
711
+ },
712
+ line: 277
713
+ },
714
+ "9": {
715
+ name: "(anonymous_9)",
716
+ decl: {
717
+ start: {
718
+ line: 278,
719
+ column: 41
720
+ },
721
+ end: {
722
+ line: 278,
723
+ column: 42
724
+ }
725
+ },
726
+ loc: {
727
+ start: {
728
+ line: 278,
729
+ column: 56
730
+ },
731
+ end: {
732
+ line: 292,
733
+ column: 5
734
+ }
735
+ },
736
+ line: 278
737
+ }
738
+ },
739
+ branchMap: {
740
+ "0": {
741
+ loc: {
742
+ start: {
743
+ line: 127,
744
+ column: 4
745
+ },
746
+ end: {
747
+ line: 131,
748
+ column: 5
749
+ }
750
+ },
751
+ type: "if",
752
+ locations: [{
753
+ start: {
754
+ line: 127,
755
+ column: 4
756
+ },
757
+ end: {
758
+ line: 131,
759
+ column: 5
760
+ }
761
+ }, {
762
+ start: {
763
+ line: undefined,
764
+ column: undefined
765
+ },
766
+ end: {
767
+ line: undefined,
768
+ column: undefined
769
+ }
770
+ }],
771
+ line: 127
772
+ },
773
+ "1": {
774
+ loc: {
775
+ start: {
776
+ line: 127,
777
+ column: 8
778
+ },
779
+ end: {
780
+ line: 127,
781
+ column: 26
782
+ }
783
+ },
784
+ type: "binary-expr",
785
+ locations: [{
786
+ start: {
787
+ line: 127,
788
+ column: 8
789
+ },
790
+ end: {
791
+ line: 127,
792
+ column: 17
793
+ }
794
+ }, {
795
+ start: {
796
+ line: 127,
797
+ column: 21
798
+ },
799
+ end: {
800
+ line: 127,
801
+ column: 26
802
+ }
803
+ }],
804
+ line: 127
805
+ },
806
+ "2": {
807
+ loc: {
808
+ start: {
809
+ line: 133,
810
+ column: 4
811
+ },
812
+ end: {
813
+ line: 137,
814
+ column: 5
815
+ }
816
+ },
817
+ type: "if",
818
+ locations: [{
819
+ start: {
820
+ line: 133,
821
+ column: 4
822
+ },
823
+ end: {
824
+ line: 137,
825
+ column: 5
826
+ }
827
+ }, {
828
+ start: {
829
+ line: undefined,
830
+ column: undefined
831
+ },
832
+ end: {
833
+ line: undefined,
834
+ column: undefined
835
+ }
836
+ }],
837
+ line: 133
838
+ },
839
+ "3": {
840
+ loc: {
841
+ start: {
842
+ line: 141,
843
+ column: 4
844
+ },
845
+ end: {
846
+ line: 143,
847
+ column: 5
848
+ }
849
+ },
850
+ type: "if",
851
+ locations: [{
852
+ start: {
853
+ line: 141,
854
+ column: 4
855
+ },
856
+ end: {
857
+ line: 143,
858
+ column: 5
859
+ }
860
+ }, {
861
+ start: {
862
+ line: undefined,
863
+ column: undefined
864
+ },
865
+ end: {
866
+ line: undefined,
867
+ column: undefined
868
+ }
869
+ }],
870
+ line: 141
871
+ },
872
+ "4": {
873
+ loc: {
874
+ start: {
875
+ line: 152,
876
+ column: 4
877
+ },
878
+ end: {
879
+ line: 154,
880
+ column: 5
881
+ }
882
+ },
883
+ type: "if",
884
+ locations: [{
885
+ start: {
886
+ line: 152,
887
+ column: 4
888
+ },
889
+ end: {
890
+ line: 154,
891
+ column: 5
892
+ }
893
+ }, {
894
+ start: {
895
+ line: undefined,
896
+ column: undefined
897
+ },
898
+ end: {
899
+ line: undefined,
900
+ column: undefined
901
+ }
902
+ }],
903
+ line: 152
904
+ },
905
+ "5": {
906
+ loc: {
907
+ start: {
908
+ line: 177,
909
+ column: 4
910
+ },
911
+ end: {
912
+ line: 194,
913
+ column: 5
914
+ }
915
+ },
916
+ type: "if",
917
+ locations: [{
918
+ start: {
919
+ line: 177,
920
+ column: 4
921
+ },
922
+ end: {
923
+ line: 194,
924
+ column: 5
925
+ }
926
+ }, {
927
+ start: {
928
+ line: 188,
929
+ column: 11
930
+ },
931
+ end: {
932
+ line: 194,
933
+ column: 5
934
+ }
935
+ }],
936
+ line: 177
937
+ },
938
+ "6": {
939
+ loc: {
940
+ start: {
941
+ line: 177,
942
+ column: 8
943
+ },
944
+ end: {
945
+ line: 177,
946
+ column: 38
947
+ }
948
+ },
949
+ type: "binary-expr",
950
+ locations: [{
951
+ start: {
952
+ line: 177,
953
+ column: 8
954
+ },
955
+ end: {
956
+ line: 177,
957
+ column: 23
958
+ }
959
+ }, {
960
+ start: {
961
+ line: 177,
962
+ column: 27
963
+ },
964
+ end: {
965
+ line: 177,
966
+ column: 38
967
+ }
968
+ }],
969
+ line: 177
970
+ },
971
+ "7": {
972
+ loc: {
973
+ start: {
974
+ line: 183,
975
+ column: 6
976
+ },
977
+ end: {
978
+ line: 185,
979
+ column: 7
980
+ }
981
+ },
982
+ type: "if",
983
+ locations: [{
984
+ start: {
985
+ line: 183,
986
+ column: 6
987
+ },
988
+ end: {
989
+ line: 185,
990
+ column: 7
991
+ }
992
+ }, {
993
+ start: {
994
+ line: undefined,
995
+ column: undefined
996
+ },
997
+ end: {
998
+ line: undefined,
999
+ column: undefined
1000
+ }
1001
+ }],
1002
+ line: 183
1003
+ },
1004
+ "8": {
1005
+ loc: {
1006
+ start: {
1007
+ line: 188,
1008
+ column: 11
1009
+ },
1010
+ end: {
1011
+ line: 194,
1012
+ column: 5
1013
+ }
1014
+ },
1015
+ type: "if",
1016
+ locations: [{
1017
+ start: {
1018
+ line: 188,
1019
+ column: 11
1020
+ },
1021
+ end: {
1022
+ line: 194,
1023
+ column: 5
1024
+ }
1025
+ }, {
1026
+ start: {
1027
+ line: 190,
1028
+ column: 11
1029
+ },
1030
+ end: {
1031
+ line: 194,
1032
+ column: 5
1033
+ }
1034
+ }],
1035
+ line: 188
1036
+ },
1037
+ "9": {
1038
+ loc: {
1039
+ start: {
1040
+ line: 212,
1041
+ column: 16
1042
+ },
1043
+ end: {
1044
+ line: 212,
1045
+ column: 28
1046
+ }
1047
+ },
1048
+ type: "default-arg",
1049
+ locations: [{
1050
+ start: {
1051
+ line: 212,
1052
+ column: 26
1053
+ },
1054
+ end: {
1055
+ line: 212,
1056
+ column: 28
1057
+ }
1058
+ }],
1059
+ line: 212
1060
+ },
1061
+ "10": {
1062
+ loc: {
1063
+ start: {
1064
+ line: 214,
1065
+ column: 6
1066
+ },
1067
+ end: {
1068
+ line: 214,
1069
+ column: 30
1070
+ }
1071
+ },
1072
+ type: "default-arg",
1073
+ locations: [{
1074
+ start: {
1075
+ line: 214,
1076
+ column: 28
1077
+ },
1078
+ end: {
1079
+ line: 214,
1080
+ column: 30
1081
+ }
1082
+ }],
1083
+ line: 214
1084
+ },
1085
+ "11": {
1086
+ loc: {
1087
+ start: {
1088
+ line: 215,
1089
+ column: 6
1090
+ },
1091
+ end: {
1092
+ line: 215,
1093
+ column: 24
1094
+ }
1095
+ },
1096
+ type: "default-arg",
1097
+ locations: [{
1098
+ start: {
1099
+ line: 215,
1100
+ column: 12
1101
+ },
1102
+ end: {
1103
+ line: 215,
1104
+ column: 24
1105
+ }
1106
+ }],
1107
+ line: 215
1108
+ },
1109
+ "12": {
1110
+ loc: {
1111
+ start: {
1112
+ line: 216,
1113
+ column: 6
1114
+ },
1115
+ end: {
1116
+ line: 216,
1117
+ column: 26
1118
+ }
1119
+ },
1120
+ type: "default-arg",
1121
+ locations: [{
1122
+ start: {
1123
+ line: 216,
1124
+ column: 24
1125
+ },
1126
+ end: {
1127
+ line: 216,
1128
+ column: 26
1129
+ }
1130
+ }],
1131
+ line: 216
1132
+ },
1133
+ "13": {
1134
+ loc: {
1135
+ start: {
1136
+ line: 245,
1137
+ column: 26
1138
+ },
1139
+ end: {
1140
+ line: 245,
1141
+ column: 57
1142
+ }
1143
+ },
1144
+ type: "binary-expr",
1145
+ locations: [{
1146
+ start: {
1147
+ line: 245,
1148
+ column: 26
1149
+ },
1150
+ end: {
1151
+ line: 245,
1152
+ column: 36
1153
+ }
1154
+ }, {
1155
+ start: {
1156
+ line: 245,
1157
+ column: 40
1158
+ },
1159
+ end: {
1160
+ line: 245,
1161
+ column: 57
1162
+ }
1163
+ }],
1164
+ line: 245
1165
+ },
1166
+ "14": {
1167
+ loc: {
1168
+ start: {
1169
+ line: 246,
1170
+ column: 22
1171
+ },
1172
+ end: {
1173
+ line: 246,
1174
+ column: 45
1175
+ }
1176
+ },
1177
+ type: "binary-expr",
1178
+ locations: [{
1179
+ start: {
1180
+ line: 246,
1181
+ column: 22
1182
+ },
1183
+ end: {
1184
+ line: 246,
1185
+ column: 28
1186
+ }
1187
+ }, {
1188
+ start: {
1189
+ line: 246,
1190
+ column: 32
1191
+ },
1192
+ end: {
1193
+ line: 246,
1194
+ column: 45
1195
+ }
1196
+ }],
1197
+ line: 246
1198
+ },
1199
+ "15": {
1200
+ loc: {
1201
+ start: {
1202
+ line: 248,
1203
+ column: 6
1204
+ },
1205
+ end: {
1206
+ line: 252,
1207
+ column: 7
1208
+ }
1209
+ },
1210
+ type: "if",
1211
+ locations: [{
1212
+ start: {
1213
+ line: 248,
1214
+ column: 6
1215
+ },
1216
+ end: {
1217
+ line: 252,
1218
+ column: 7
1219
+ }
1220
+ }, {
1221
+ start: {
1222
+ line: undefined,
1223
+ column: undefined
1224
+ },
1225
+ end: {
1226
+ line: undefined,
1227
+ column: undefined
1228
+ }
1229
+ }],
1230
+ line: 248
1231
+ },
1232
+ "16": {
1233
+ loc: {
1234
+ start: {
1235
+ line: 248,
1236
+ column: 12
1237
+ },
1238
+ end: {
1239
+ line: 248,
1240
+ column: 34
1241
+ }
1242
+ },
1243
+ type: "binary-expr",
1244
+ locations: [{
1245
+ start: {
1246
+ line: 248,
1247
+ column: 12
1248
+ },
1249
+ end: {
1250
+ line: 248,
1251
+ column: 23
1252
+ }
1253
+ }, {
1254
+ start: {
1255
+ line: 248,
1256
+ column: 27
1257
+ },
1258
+ end: {
1259
+ line: 248,
1260
+ column: 34
1261
+ }
1262
+ }],
1263
+ line: 248
1264
+ },
1265
+ "17": {
1266
+ loc: {
1267
+ start: {
1268
+ line: 282,
1269
+ column: 6
1270
+ },
1271
+ end: {
1272
+ line: 289,
1273
+ column: 7
1274
+ }
1275
+ },
1276
+ type: "if",
1277
+ locations: [{
1278
+ start: {
1279
+ line: 282,
1280
+ column: 6
1281
+ },
1282
+ end: {
1283
+ line: 289,
1284
+ column: 7
1285
+ }
1286
+ }, {
1287
+ start: {
1288
+ line: 287,
1289
+ column: 13
1290
+ },
1291
+ end: {
1292
+ line: 289,
1293
+ column: 7
1294
+ }
1295
+ }],
1296
+ line: 282
1297
+ }
1298
+ },
1299
+ s: {
1300
+ "0": 0,
1301
+ "1": 0,
1302
+ "2": 0,
1303
+ "3": 0,
1304
+ "4": 0,
1305
+ "5": 0,
1306
+ "6": 0,
1307
+ "7": 0,
1308
+ "8": 0,
1309
+ "9": 0,
1310
+ "10": 0,
1311
+ "11": 0,
1312
+ "12": 0,
1313
+ "13": 0,
1314
+ "14": 0,
1315
+ "15": 0,
1316
+ "16": 0,
1317
+ "17": 0,
1318
+ "18": 0,
1319
+ "19": 0,
1320
+ "20": 0,
1321
+ "21": 0,
1322
+ "22": 0,
1323
+ "23": 0,
1324
+ "24": 0,
1325
+ "25": 0,
1326
+ "26": 0,
1327
+ "27": 0,
1328
+ "28": 0,
1329
+ "29": 0,
1330
+ "30": 0,
1331
+ "31": 0,
1332
+ "32": 0,
1333
+ "33": 0,
1334
+ "34": 0,
1335
+ "35": 0,
1336
+ "36": 0,
1337
+ "37": 0,
1338
+ "38": 0,
1339
+ "39": 0,
1340
+ "40": 0,
1341
+ "41": 0,
1342
+ "42": 0,
1343
+ "43": 0,
1344
+ "44": 0,
1345
+ "45": 0,
1346
+ "46": 0
1347
+ },
1348
+ f: {
1349
+ "0": 0,
1350
+ "1": 0,
1351
+ "2": 0,
1352
+ "3": 0,
1353
+ "4": 0,
1354
+ "5": 0,
1355
+ "6": 0,
1356
+ "7": 0,
1357
+ "8": 0,
1358
+ "9": 0
1359
+ },
1360
+ b: {
1361
+ "0": [0, 0],
1362
+ "1": [0, 0],
1363
+ "2": [0, 0],
1364
+ "3": [0, 0],
1365
+ "4": [0, 0],
1366
+ "5": [0, 0],
1367
+ "6": [0, 0],
1368
+ "7": [0, 0],
1369
+ "8": [0, 0],
1370
+ "9": [0],
1371
+ "10": [0],
1372
+ "11": [0],
1373
+ "12": [0],
1374
+ "13": [0, 0],
1375
+ "14": [0, 0],
1376
+ "15": [0, 0],
1377
+ "16": [0, 0],
1378
+ "17": [0, 0]
1379
+ },
1380
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
1381
+ hash: "e2e1bec209d833852fd33c484710a2590a9a6d81"
1382
+ };
1383
+ var coverage = global[gcv] || (global[gcv] = {});
1384
+ if (!coverage[path] || coverage[path].hash !== hash) {
1385
+ coverage[path] = coverageData;
1386
+ }
1387
+ var actualCoverage = coverage[path];
1388
+ {
1389
+ // @ts-ignore
1390
+ cov_1n1bb4mnsz = function () {
1391
+ return actualCoverage;
1392
+ };
1393
+ }
1394
+ return actualCoverage;
1395
+ }
1396
+ cov_1n1bb4mnsz();
1397
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1398
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1399
+ 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; }
1400
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
1401
+ 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); }
12
1402
  /**
13
1403
  * A single audience used for authenticating and communicating with an individual API.
14
1404
  *
@@ -97,221 +1487,250 @@ import defaultConfigs from './defaults';
97
1487
  *
98
1488
  * @typicalname contxtSdk.config
99
1489
  */
100
-
101
- var Config = function () {
1490
+ class Config {
102
1491
  /**
103
1492
  * @param {UserConfig} userConfig The user provided configuration options
104
1493
  * @param {Object.<string, ExternalModule>} [externalModules] User provided external modules that should be treated as
105
1494
  * first class citizens
106
1495
  */
107
- function Config(userConfig, externalModules) {
108
- _classCallCheck(this, Config);
109
-
1496
+ constructor(userConfig, externalModules) {
1497
+ cov_1n1bb4mnsz().f[0]++;
1498
+ cov_1n1bb4mnsz().s[0]++;
110
1499
  Object.assign(this, userConfig);
111
-
1500
+ cov_1n1bb4mnsz().s[1]++;
112
1501
  this._dynamicAudienceNames = [];
1502
+ cov_1n1bb4mnsz().s[2]++;
113
1503
  this._replacedAudiences = {};
114
-
1504
+ cov_1n1bb4mnsz().s[3]++;
115
1505
  this.audiences = this._getAudiences({
116
- externalModules: externalModules,
1506
+ externalModules,
117
1507
  customModuleConfigs: userConfig.auth.customModuleConfigs,
118
1508
  env: userConfig.auth.env
119
1509
  });
120
-
121
- this.auth = _extends({}, defaultConfigs.auth, userConfig.auth);
122
-
123
- this.interceptors = _extends({}, defaultConfigs.interceptors, userConfig.interceptors);
124
-
125
- this.bus = _extends({}, defaultConfigs.bus, userConfig.bus);
1510
+ cov_1n1bb4mnsz().s[4]++;
1511
+ this.auth = _objectSpread(_objectSpread({}, _defaults.default.auth), userConfig.auth);
1512
+ cov_1n1bb4mnsz().s[5]++;
1513
+ this.interceptors = _objectSpread(_objectSpread({}, _defaults.default.interceptors), userConfig.interceptors);
1514
+ cov_1n1bb4mnsz().s[6]++;
1515
+ this.bus = _objectSpread(_objectSpread({}, _defaults.default.bus), userConfig.bus);
126
1516
  }
127
-
128
- _createClass(Config, [{
129
- key: 'addDynamicAudience',
130
- value: function addDynamicAudience(audienceName, _ref) {
131
- var clientId = _ref.clientId,
132
- host = _ref.host;
133
-
134
- if (!clientId || !host) {
135
- throw new Error('A dynamic audience must contain `clientId` and `host` properties');
136
- }
137
-
138
- if (this._dynamicAudienceNames.indexOf(audienceName) > -1) {
139
- throw new Error('A dynamic audience of the name `' + audienceName + '` already exists. This problem can be rectified by using a different name for the audience.');
140
- }
141
-
142
- this._dynamicAudienceNames = [].concat(_toConsumableArray(this._dynamicAudienceNames), [audienceName]);
143
-
144
- if (this.audiences[audienceName]) {
145
- this._replacedAudiences[audienceName] = this.audiences[audienceName];
146
- }
147
-
148
- this.audiences[audienceName] = {
149
- clientId: clientId,
150
- host: host
151
- };
1517
+ addDynamicAudience(audienceName, _ref) {
1518
+ let clientId = _ref.clientId,
1519
+ host = _ref.host;
1520
+ cov_1n1bb4mnsz().f[1]++;
1521
+ cov_1n1bb4mnsz().s[7]++;
1522
+ if ((cov_1n1bb4mnsz().b[1][0]++, !clientId) || (cov_1n1bb4mnsz().b[1][1]++, !host)) {
1523
+ cov_1n1bb4mnsz().b[0][0]++;
1524
+ cov_1n1bb4mnsz().s[8]++;
1525
+ throw new Error('A dynamic audience must contain `clientId` and `host` properties');
1526
+ } else {
1527
+ cov_1n1bb4mnsz().b[0][1]++;
152
1528
  }
153
- }, {
154
- key: 'removeDynamicAudience',
155
- value: function removeDynamicAudience(audienceName) {
156
- if (this._dynamicAudienceNames.indexOf(audienceName) === -1) {
157
- throw new Error('There is no dynamic audience to remove.');
158
- }
159
-
160
- this.audiences[audienceName] = this._replacedAudiences[audienceName];
161
-
162
- delete this._replacedAudiences[audienceName];
163
- this._dynamicAudienceNames = this._dynamicAudienceNames.filter(function (name) {
164
- return name !== audienceName;
165
- });
1529
+ cov_1n1bb4mnsz().s[9]++;
1530
+ if (this._dynamicAudienceNames.indexOf(audienceName) > -1) {
1531
+ cov_1n1bb4mnsz().b[2][0]++;
1532
+ cov_1n1bb4mnsz().s[10]++;
1533
+ throw new Error(`A dynamic audience of the name \`${audienceName}\` already exists. This problem can be rectified by using a different name for the audience.`);
1534
+ } else {
1535
+ cov_1n1bb4mnsz().b[2][1]++;
166
1536
  }
1537
+ cov_1n1bb4mnsz().s[11]++;
1538
+ this._dynamicAudienceNames = [...this._dynamicAudienceNames, audienceName];
1539
+ cov_1n1bb4mnsz().s[12]++;
1540
+ if (this.audiences[audienceName]) {
1541
+ cov_1n1bb4mnsz().b[3][0]++;
1542
+ cov_1n1bb4mnsz().s[13]++;
1543
+ this._replacedAudiences[audienceName] = this.audiences[audienceName];
1544
+ } else {
1545
+ cov_1n1bb4mnsz().b[3][1]++;
1546
+ }
1547
+ cov_1n1bb4mnsz().s[14]++;
1548
+ this.audiences[audienceName] = {
1549
+ clientId,
1550
+ host
1551
+ };
1552
+ }
1553
+ removeDynamicAudience(audienceName) {
1554
+ cov_1n1bb4mnsz().f[2]++;
1555
+ cov_1n1bb4mnsz().s[15]++;
1556
+ if (this._dynamicAudienceNames.indexOf(audienceName) === -1) {
1557
+ cov_1n1bb4mnsz().b[4][0]++;
1558
+ cov_1n1bb4mnsz().s[16]++;
1559
+ throw new Error('There is no dynamic audience to remove.');
1560
+ } else {
1561
+ cov_1n1bb4mnsz().b[4][1]++;
1562
+ }
1563
+ cov_1n1bb4mnsz().s[17]++;
1564
+ this.audiences[audienceName] = this._replacedAudiences[audienceName];
1565
+ cov_1n1bb4mnsz().s[18]++;
1566
+ delete this._replacedAudiences[audienceName];
1567
+ cov_1n1bb4mnsz().s[19]++;
1568
+ this._dynamicAudienceNames = this._dynamicAudienceNames.filter(name => {
1569
+ cov_1n1bb4mnsz().f[3]++;
1570
+ cov_1n1bb4mnsz().s[20]++;
1571
+ return name !== audienceName;
1572
+ });
1573
+ }
167
1574
 
168
- /**
169
- * Parses a custom module configuration for a valid environment/audience. Requires either a
170
- * clientId and host, or an environment that matches a default audience/environment.
171
- *
172
- * @param {CustomAudience} config A custom audience configuration to parse
173
- * @param {Object.<string, Audience>} audiences An object with keys for environment names and values of Audience information
174
- *
175
- * @returns {Audience}
176
- * @throws {Error}
177
- *
178
- * @private
179
- */
180
-
181
- }, {
182
- key: '_getAudienceFromCustomConfig',
183
- value: function _getAudienceFromCustomConfig(config, audiences) {
184
- if (config.clientId && config.host) {
185
- var audience = {
186
- clientId: config.clientId,
187
- host: config.host
188
- };
189
-
190
- if (config.webSocket) {
191
- audience.webSocket = config.webSocket;
192
- }
193
-
194
- return audience;
195
- } else if (config.env) {
1575
+ /**
1576
+ * Parses a custom module configuration for a valid environment/audience. Requires either a
1577
+ * clientId and host, or an environment that matches a default audience/environment.
1578
+ *
1579
+ * @param {CustomAudience} config A custom audience configuration to parse
1580
+ * @param {Object.<string, Audience>} audiences An object with keys for environment names and values of Audience information
1581
+ *
1582
+ * @returns {Audience}
1583
+ * @throws {Error}
1584
+ *
1585
+ * @private
1586
+ */
1587
+ _getAudienceFromCustomConfig(config, audiences) {
1588
+ cov_1n1bb4mnsz().f[4]++;
1589
+ cov_1n1bb4mnsz().s[21]++;
1590
+ if ((cov_1n1bb4mnsz().b[6][0]++, config.clientId) && (cov_1n1bb4mnsz().b[6][1]++, config.host)) {
1591
+ cov_1n1bb4mnsz().b[5][0]++;
1592
+ const audience = (cov_1n1bb4mnsz().s[22]++, {
1593
+ clientId: config.clientId,
1594
+ host: config.host
1595
+ });
1596
+ cov_1n1bb4mnsz().s[23]++;
1597
+ if (config.webSocket) {
1598
+ cov_1n1bb4mnsz().b[7][0]++;
1599
+ cov_1n1bb4mnsz().s[24]++;
1600
+ audience.webSocket = config.webSocket;
1601
+ } else {
1602
+ cov_1n1bb4mnsz().b[7][1]++;
1603
+ }
1604
+ cov_1n1bb4mnsz().s[25]++;
1605
+ return audience;
1606
+ } else {
1607
+ cov_1n1bb4mnsz().b[5][1]++;
1608
+ cov_1n1bb4mnsz().s[26]++;
1609
+ if (config.env) {
1610
+ cov_1n1bb4mnsz().b[8][0]++;
1611
+ cov_1n1bb4mnsz().s[27]++;
196
1612
  return audiences[config.env];
197
1613
  } else {
1614
+ cov_1n1bb4mnsz().b[8][1]++;
1615
+ cov_1n1bb4mnsz().s[28]++;
198
1616
  throw new Error('Custom module configurations must either contain a `host` and `clientId` or specify a specific target environment via the `env` property');
199
1617
  }
200
1618
  }
1619
+ }
201
1620
 
202
- /**
203
- * Reconciles the main environment with custom environments and external modules.
204
- *
205
- * @param {Object} options
206
- * @param {Object.<string, CustomAudience>} [options.customModuleConfigs = {}] Any custom
207
- * configurations for internal modules
208
- * @param {string} [options.env = 'production'] The base environment for any
209
- * non-overridden modules
210
- * @param {Object.<string, ExternalModule>} [options.externalModules = {}] An object of external
211
- * modules from which to build a set of audiences
212
- *
213
- * @returns {Object.<string, Audience>}
214
- *
215
- * @private
216
- */
217
-
218
- }, {
219
- key: '_getAudiences',
220
- value: function _getAudiences() {
221
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
222
- var _options$customModule = options.customModuleConfigs,
223
- customModuleConfigs = _options$customModule === undefined ? {} : _options$customModule,
224
- _options$env = options.env,
225
- env = _options$env === undefined ? 'production' : _options$env,
226
- _options$externalModu = options.externalModules,
227
- externalModules = _options$externalModu === undefined ? {} : _options$externalModu;
228
-
229
-
230
- return _extends({}, this._getInternalAudiences({
231
- customModuleConfigs: customModuleConfigs,
232
- env: env,
233
- audiences: defaultAudiences
234
- }), this._getExternalAudiences({ externalModules: externalModules }));
235
- }
236
-
237
- /**
238
- * Builds up the audiences for external modules.
239
- *
240
- * @param {Object}
241
- * @param {Object.<string, ExternalModule>} externalModules An object of external modules from
242
- * which to build a set of audiences
243
- *
244
- * @returns {Object.<string, Audience>}
245
- * @throws {Error}
246
- *
247
- * @private
248
- */
249
-
250
- }, {
251
- key: '_getExternalAudiences',
252
- value: function _getExternalAudiences(_ref2) {
253
- var externalModules = _ref2.externalModules;
254
-
255
- return Object.keys(externalModules).reduce(function (memo, key) {
256
- var clientId = externalModules[key].clientId;
257
- var host = externalModules[key].host;
258
- var hasClientId = !!clientId || clientId === null;
259
- var hasHost = !!host || host === null;
260
-
261
- if (!(hasClientId && hasHost)) {
262
- throw new Error('External modules must contain `clientId` and `host` properties');
263
- }
264
-
265
- memo[key] = {
266
- clientId: clientId,
267
- host: host
268
- };
269
-
270
- return memo;
271
- }, {});
272
- }
273
-
274
- /**
275
- * Reconciles the main environment with custom environments to build up audiences for
276
- * internal modules.
277
- *
278
- * @param {Object.<string, Environments>} audiences All possible audiences/environments for
279
- * internal modules
280
- * @param {Object.<string, CustomAudience>} customModuleConfigs Any custom configurations for
281
- * internal modules
282
- * @param {string} env The base environment for any non-overridden modules
283
- *
284
- * @returns {Object.<string, Audience>}
285
- *
286
- * @private
287
- */
288
-
289
- }, {
290
- key: '_getInternalAudiences',
291
- value: function _getInternalAudiences(_ref3) {
292
- var _this = this;
293
-
294
- var audiences = _ref3.audiences,
295
- customModuleConfigs = _ref3.customModuleConfigs,
296
- env = _ref3.env;
297
-
298
- return Object.keys(audiences).reduce(function (memo, key) {
299
- var customModuleConfig = customModuleConfigs[key];
300
- var moduleAudiences = audiences[key];
301
-
302
- if (customModuleConfig) {
303
- memo[key] = _this._getAudienceFromCustomConfig(customModuleConfig, moduleAudiences);
304
- } else {
305
- memo[key] = moduleAudiences[env];
306
- }
307
-
308
- return memo;
309
- }, {});
310
- }
311
- }]);
1621
+ /**
1622
+ * Reconciles the main environment with custom environments and external modules.
1623
+ *
1624
+ * @param {Object} options
1625
+ * @param {Object.<string, CustomAudience>} [options.customModuleConfigs = {}] Any custom
1626
+ * configurations for internal modules
1627
+ * @param {string} [options.env = 'production'] The base environment for any
1628
+ * non-overridden modules
1629
+ * @param {Object.<string, ExternalModule>} [options.externalModules = {}] An object of external
1630
+ * modules from which to build a set of audiences
1631
+ *
1632
+ * @returns {Object.<string, Audience>}
1633
+ *
1634
+ * @private
1635
+ */
1636
+ _getAudiences() {
1637
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (cov_1n1bb4mnsz().b[9][0]++, {});
1638
+ cov_1n1bb4mnsz().f[5]++;
1639
+ const _ref2 = (cov_1n1bb4mnsz().s[29]++, options),
1640
+ _ref2$customModuleCon = _ref2.customModuleConfigs,
1641
+ customModuleConfigs = _ref2$customModuleCon === void 0 ? (cov_1n1bb4mnsz().b[10][0]++, {}) : _ref2$customModuleCon,
1642
+ _ref2$env = _ref2.env,
1643
+ env = _ref2$env === void 0 ? (cov_1n1bb4mnsz().b[11][0]++, 'production') : _ref2$env,
1644
+ _ref2$externalModules = _ref2.externalModules,
1645
+ externalModules = _ref2$externalModules === void 0 ? (cov_1n1bb4mnsz().b[12][0]++, {}) : _ref2$externalModules;
1646
+ cov_1n1bb4mnsz().s[30]++;
1647
+ return _objectSpread(_objectSpread({}, this._getInternalAudiences({
1648
+ customModuleConfigs,
1649
+ env,
1650
+ audiences: _audiences.default
1651
+ })), this._getExternalAudiences({
1652
+ externalModules
1653
+ }));
1654
+ }
312
1655
 
313
- return Config;
314
- }();
1656
+ /**
1657
+ * Builds up the audiences for external modules.
1658
+ *
1659
+ * @param {Object}
1660
+ * @param {Object.<string, ExternalModule>} externalModules An object of external modules from
1661
+ * which to build a set of audiences
1662
+ *
1663
+ * @returns {Object.<string, Audience>}
1664
+ * @throws {Error}
1665
+ *
1666
+ * @private
1667
+ */
1668
+ _getExternalAudiences(_ref3) {
1669
+ let externalModules = _ref3.externalModules;
1670
+ cov_1n1bb4mnsz().f[6]++;
1671
+ cov_1n1bb4mnsz().s[31]++;
1672
+ return Object.keys(externalModules).reduce((memo, key) => {
1673
+ cov_1n1bb4mnsz().f[7]++;
1674
+ const clientId = (cov_1n1bb4mnsz().s[32]++, externalModules[key].clientId);
1675
+ const host = (cov_1n1bb4mnsz().s[33]++, externalModules[key].host);
1676
+ const hasClientId = (cov_1n1bb4mnsz().s[34]++, (cov_1n1bb4mnsz().b[13][0]++, !!clientId) || (cov_1n1bb4mnsz().b[13][1]++, clientId === null));
1677
+ const hasHost = (cov_1n1bb4mnsz().s[35]++, (cov_1n1bb4mnsz().b[14][0]++, !!host) || (cov_1n1bb4mnsz().b[14][1]++, host === null));
1678
+ cov_1n1bb4mnsz().s[36]++;
1679
+ if (!((cov_1n1bb4mnsz().b[16][0]++, hasClientId) && (cov_1n1bb4mnsz().b[16][1]++, hasHost))) {
1680
+ cov_1n1bb4mnsz().b[15][0]++;
1681
+ cov_1n1bb4mnsz().s[37]++;
1682
+ throw new Error('External modules must contain `clientId` and `host` properties');
1683
+ } else {
1684
+ cov_1n1bb4mnsz().b[15][1]++;
1685
+ }
1686
+ cov_1n1bb4mnsz().s[38]++;
1687
+ memo[key] = {
1688
+ clientId,
1689
+ host
1690
+ };
1691
+ cov_1n1bb4mnsz().s[39]++;
1692
+ return memo;
1693
+ }, {});
1694
+ }
315
1695
 
316
- export default Config;
1696
+ /**
1697
+ * Reconciles the main environment with custom environments to build up audiences for
1698
+ * internal modules.
1699
+ *
1700
+ * @param {Object.<string, Environments>} audiences All possible audiences/environments for
1701
+ * internal modules
1702
+ * @param {Object.<string, CustomAudience>} customModuleConfigs Any custom configurations for
1703
+ * internal modules
1704
+ * @param {string} env The base environment for any non-overridden modules
1705
+ *
1706
+ * @returns {Object.<string, Audience>}
1707
+ *
1708
+ * @private
1709
+ */
1710
+ _getInternalAudiences(_ref4) {
1711
+ let audiences = _ref4.audiences,
1712
+ customModuleConfigs = _ref4.customModuleConfigs,
1713
+ env = _ref4.env;
1714
+ cov_1n1bb4mnsz().f[8]++;
1715
+ cov_1n1bb4mnsz().s[40]++;
1716
+ return Object.keys(audiences).reduce((memo, key) => {
1717
+ cov_1n1bb4mnsz().f[9]++;
1718
+ const customModuleConfig = (cov_1n1bb4mnsz().s[41]++, customModuleConfigs[key]);
1719
+ const moduleAudiences = (cov_1n1bb4mnsz().s[42]++, audiences[key]);
1720
+ cov_1n1bb4mnsz().s[43]++;
1721
+ if (customModuleConfig) {
1722
+ cov_1n1bb4mnsz().b[17][0]++;
1723
+ cov_1n1bb4mnsz().s[44]++;
1724
+ memo[key] = this._getAudienceFromCustomConfig(customModuleConfig, moduleAudiences);
1725
+ } else {
1726
+ cov_1n1bb4mnsz().b[17][1]++;
1727
+ cov_1n1bb4mnsz().s[45]++;
1728
+ memo[key] = moduleAudiences[env];
1729
+ }
1730
+ cov_1n1bb4mnsz().s[46]++;
1731
+ return memo;
1732
+ }, {});
1733
+ }
1734
+ }
1735
+ var _default = exports.default = Config;
317
1736
  //# sourceMappingURL=index.js.map