@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,15 +1,526 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
- 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; }; }();
8
-
9
- var _objects = require('../utils/objects');
10
-
11
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
-
6
+ exports.default = void 0;
7
+ require("core-js/modules/es.promise.js");
8
+ var _objects = _interopRequireDefault(require("../utils/objects"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function cov_l8otr7ot0() {
11
+ var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/coordinator/consent.js";
12
+ var hash = "51667afe4718df933582fb85fa433039d7c23c54";
13
+ var global = new Function("return this")();
14
+ var gcv = "__coverage__";
15
+ var coverageData = {
16
+ path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/coordinator/consent.js",
17
+ statementMap: {
18
+ "0": {
19
+ start: {
20
+ line: 62,
21
+ column: 4
22
+ },
23
+ end: {
24
+ line: 62,
25
+ column: 28
26
+ }
27
+ },
28
+ "1": {
29
+ start: {
30
+ line: 63,
31
+ column: 4
32
+ },
33
+ end: {
34
+ line: 63,
35
+ column: 28
36
+ }
37
+ },
38
+ "2": {
39
+ start: {
40
+ line: 64,
41
+ column: 4
42
+ },
43
+ end: {
44
+ line: 64,
45
+ column: 20
46
+ }
47
+ },
48
+ "3": {
49
+ start: {
50
+ line: 65,
51
+ column: 4
52
+ },
53
+ end: {
54
+ line: 65,
55
+ column: 42
56
+ }
57
+ },
58
+ "4": {
59
+ start: {
60
+ line: 90,
61
+ column: 4
62
+ },
63
+ end: {
64
+ line: 94,
65
+ column: 5
66
+ }
67
+ },
68
+ "5": {
69
+ start: {
70
+ line: 91,
71
+ column: 6
72
+ },
73
+ end: {
74
+ line: 93,
75
+ column: 8
76
+ }
77
+ },
78
+ "6": {
79
+ start: {
80
+ line: 96,
81
+ column: 4
82
+ },
83
+ end: {
84
+ line: 106,
85
+ column: 7
86
+ }
87
+ },
88
+ "7": {
89
+ start: {
90
+ line: 97,
91
+ column: 6
92
+ },
93
+ end: {
94
+ line: 99,
95
+ column: 7
96
+ }
97
+ },
98
+ "8": {
99
+ start: {
100
+ line: 98,
101
+ column: 8
102
+ },
103
+ end: {
104
+ line: 98,
105
+ column: 74
106
+ }
107
+ },
108
+ "9": {
109
+ start: {
110
+ line: 101,
111
+ column: 6
112
+ },
113
+ end: {
114
+ line: 105,
115
+ column: 71
116
+ }
117
+ },
118
+ "10": {
119
+ start: {
120
+ line: 105,
121
+ column: 32
122
+ },
123
+ end: {
124
+ line: 105,
125
+ column: 69
126
+ }
127
+ },
128
+ "11": {
129
+ start: {
130
+ line: 130,
131
+ column: 4
132
+ },
133
+ end: {
134
+ line: 140,
135
+ column: 7
136
+ }
137
+ },
138
+ "12": {
139
+ start: {
140
+ line: 131,
141
+ column: 6
142
+ },
143
+ end: {
144
+ line: 133,
145
+ column: 7
146
+ }
147
+ },
148
+ "13": {
149
+ start: {
150
+ line: 132,
151
+ column: 8
152
+ },
153
+ end: {
154
+ line: 132,
155
+ column: 74
156
+ }
157
+ },
158
+ "14": {
159
+ start: {
160
+ line: 135,
161
+ column: 6
162
+ },
163
+ end: {
164
+ line: 139,
165
+ column: 83
166
+ }
167
+ },
168
+ "15": {
169
+ start: {
170
+ line: 139,
171
+ column: 38
172
+ },
173
+ end: {
174
+ line: 139,
175
+ column: 81
176
+ }
177
+ }
178
+ },
179
+ fnMap: {
180
+ "0": {
181
+ name: "(anonymous_0)",
182
+ decl: {
183
+ start: {
184
+ line: 61,
185
+ column: 2
186
+ },
187
+ end: {
188
+ line: 61,
189
+ column: 3
190
+ }
191
+ },
192
+ loc: {
193
+ start: {
194
+ line: 61,
195
+ column: 60
196
+ },
197
+ end: {
198
+ line: 66,
199
+ column: 3
200
+ }
201
+ },
202
+ line: 61
203
+ },
204
+ "1": {
205
+ name: "(anonymous_1)",
206
+ decl: {
207
+ start: {
208
+ line: 89,
209
+ column: 2
210
+ },
211
+ end: {
212
+ line: 89,
213
+ column: 3
214
+ }
215
+ },
216
+ loc: {
217
+ start: {
218
+ line: 89,
219
+ column: 20
220
+ },
221
+ end: {
222
+ line: 107,
223
+ column: 3
224
+ }
225
+ },
226
+ line: 89
227
+ },
228
+ "2": {
229
+ name: "(anonymous_2)",
230
+ decl: {
231
+ start: {
232
+ line: 96,
233
+ column: 55
234
+ },
235
+ end: {
236
+ line: 96,
237
+ column: 56
238
+ }
239
+ },
240
+ loc: {
241
+ start: {
242
+ line: 96,
243
+ column: 72
244
+ },
245
+ end: {
246
+ line: 106,
247
+ column: 5
248
+ }
249
+ },
250
+ line: 96
251
+ },
252
+ "3": {
253
+ name: "(anonymous_3)",
254
+ decl: {
255
+ start: {
256
+ line: 105,
257
+ column: 14
258
+ },
259
+ end: {
260
+ line: 105,
261
+ column: 15
262
+ }
263
+ },
264
+ loc: {
265
+ start: {
266
+ line: 105,
267
+ column: 32
268
+ },
269
+ end: {
270
+ line: 105,
271
+ column: 69
272
+ }
273
+ },
274
+ line: 105
275
+ },
276
+ "4": {
277
+ name: "(anonymous_4)",
278
+ decl: {
279
+ start: {
280
+ line: 129,
281
+ column: 2
282
+ },
283
+ end: {
284
+ line: 129,
285
+ column: 3
286
+ }
287
+ },
288
+ loc: {
289
+ start: {
290
+ line: 129,
291
+ column: 29
292
+ },
293
+ end: {
294
+ line: 141,
295
+ column: 3
296
+ }
297
+ },
298
+ line: 129
299
+ },
300
+ "5": {
301
+ name: "(anonymous_5)",
302
+ decl: {
303
+ start: {
304
+ line: 130,
305
+ column: 55
306
+ },
307
+ end: {
308
+ line: 130,
309
+ column: 56
310
+ }
311
+ },
312
+ loc: {
313
+ start: {
314
+ line: 130,
315
+ column: 72
316
+ },
317
+ end: {
318
+ line: 140,
319
+ column: 5
320
+ }
321
+ },
322
+ line: 130
323
+ },
324
+ "6": {
325
+ name: "(anonymous_6)",
326
+ decl: {
327
+ start: {
328
+ line: 139,
329
+ column: 14
330
+ },
331
+ end: {
332
+ line: 139,
333
+ column: 15
334
+ }
335
+ },
336
+ loc: {
337
+ start: {
338
+ line: 139,
339
+ column: 38
340
+ },
341
+ end: {
342
+ line: 139,
343
+ column: 81
344
+ }
345
+ },
346
+ line: 139
347
+ }
348
+ },
349
+ branchMap: {
350
+ "0": {
351
+ loc: {
352
+ start: {
353
+ line: 61,
354
+ column: 37
355
+ },
356
+ end: {
357
+ line: 61,
358
+ column: 58
359
+ }
360
+ },
361
+ type: "default-arg",
362
+ locations: [{
363
+ start: {
364
+ line: 61,
365
+ column: 54
366
+ },
367
+ end: {
368
+ line: 61,
369
+ column: 58
370
+ }
371
+ }],
372
+ line: 61
373
+ },
374
+ "1": {
375
+ loc: {
376
+ start: {
377
+ line: 90,
378
+ column: 4
379
+ },
380
+ end: {
381
+ line: 94,
382
+ column: 5
383
+ }
384
+ },
385
+ type: "if",
386
+ locations: [{
387
+ start: {
388
+ line: 90,
389
+ column: 4
390
+ },
391
+ end: {
392
+ line: 94,
393
+ column: 5
394
+ }
395
+ }, {
396
+ start: {
397
+ line: undefined,
398
+ column: undefined
399
+ },
400
+ end: {
401
+ line: undefined,
402
+ column: undefined
403
+ }
404
+ }],
405
+ line: 90
406
+ },
407
+ "2": {
408
+ loc: {
409
+ start: {
410
+ line: 97,
411
+ column: 6
412
+ },
413
+ end: {
414
+ line: 99,
415
+ column: 7
416
+ }
417
+ },
418
+ type: "if",
419
+ locations: [{
420
+ start: {
421
+ line: 97,
422
+ column: 6
423
+ },
424
+ end: {
425
+ line: 99,
426
+ column: 7
427
+ }
428
+ }, {
429
+ start: {
430
+ line: undefined,
431
+ column: undefined
432
+ },
433
+ end: {
434
+ line: undefined,
435
+ column: undefined
436
+ }
437
+ }],
438
+ line: 97
439
+ },
440
+ "3": {
441
+ loc: {
442
+ start: {
443
+ line: 131,
444
+ column: 6
445
+ },
446
+ end: {
447
+ line: 133,
448
+ column: 7
449
+ }
450
+ },
451
+ type: "if",
452
+ locations: [{
453
+ start: {
454
+ line: 131,
455
+ column: 6
456
+ },
457
+ end: {
458
+ line: 133,
459
+ column: 7
460
+ }
461
+ }, {
462
+ start: {
463
+ line: undefined,
464
+ column: undefined
465
+ },
466
+ end: {
467
+ line: undefined,
468
+ column: undefined
469
+ }
470
+ }],
471
+ line: 131
472
+ }
473
+ },
474
+ s: {
475
+ "0": 0,
476
+ "1": 0,
477
+ "2": 0,
478
+ "3": 0,
479
+ "4": 0,
480
+ "5": 0,
481
+ "6": 0,
482
+ "7": 0,
483
+ "8": 0,
484
+ "9": 0,
485
+ "10": 0,
486
+ "11": 0,
487
+ "12": 0,
488
+ "13": 0,
489
+ "14": 0,
490
+ "15": 0
491
+ },
492
+ f: {
493
+ "0": 0,
494
+ "1": 0,
495
+ "2": 0,
496
+ "3": 0,
497
+ "4": 0,
498
+ "5": 0,
499
+ "6": 0
500
+ },
501
+ b: {
502
+ "0": [0],
503
+ "1": [0, 0],
504
+ "2": [0, 0],
505
+ "3": [0, 0]
506
+ },
507
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
508
+ hash: "51667afe4718df933582fb85fa433039d7c23c54"
509
+ };
510
+ var coverage = global[gcv] || (global[gcv] = {});
511
+ if (!coverage[path] || coverage[path].hash !== hash) {
512
+ coverage[path] = coverageData;
513
+ }
514
+ var actualCoverage = coverage[path];
515
+ {
516
+ // @ts-ignore
517
+ cov_l8otr7ot0 = function () {
518
+ return actualCoverage;
519
+ };
520
+ }
521
+ return actualCoverage;
522
+ }
523
+ cov_l8otr7ot0();
13
524
  /**
14
525
  * @typedef {Object} ContxtApplicationConsent
15
526
  * @param {string} clientId
@@ -61,21 +572,23 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
61
572
  *
62
573
  * @typicalname contxtSdk.coordinator.consent
63
574
  */
64
- var Consent = function () {
575
+ class Consent {
65
576
  /**
66
577
  * @param {Object} sdk An instance of the SDK so the module can communicate with other modules
67
578
  * @param {Object} request An instance of the request module tied to this module's audience.
68
579
  * @param {string} baseUrl The base URL provided by the parent module
69
580
  * @param {string} [organizationId] The organization ID to be used in tenant url requests
70
581
  */
71
- function Consent(sdk, request, baseUrl) {
72
- var organizationId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
73
-
74
- _classCallCheck(this, Consent);
75
-
582
+ constructor(sdk, request, baseUrl) {
583
+ let organizationId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (cov_l8otr7ot0().b[0][0]++, null);
584
+ cov_l8otr7ot0().f[0]++;
585
+ cov_l8otr7ot0().s[0]++;
76
586
  this._baseUrl = baseUrl;
587
+ cov_l8otr7ot0().s[1]++;
77
588
  this._request = request;
589
+ cov_l8otr7ot0().s[2]++;
78
590
  this._sdk = sdk;
591
+ cov_l8otr7ot0().s[3]++;
79
592
  this._organizationId = organizationId;
80
593
  }
81
594
 
@@ -100,72 +613,81 @@ var Consent = function () {
100
613
  * .then((userApproval) => console.log(userApproval))
101
614
  * .catch((err) => console.log(err));
102
615
  */
103
-
104
-
105
- _createClass(Consent, [{
106
- key: 'accept',
107
- value: function accept(consentId) {
108
- var _this = this;
109
-
110
- if (!consentId) {
111
- return Promise.reject(new Error('A consent ID is required for accepting consent'));
616
+ accept(consentId) {
617
+ cov_l8otr7ot0().f[1]++;
618
+ cov_l8otr7ot0().s[4]++;
619
+ if (!consentId) {
620
+ cov_l8otr7ot0().b[1][0]++;
621
+ cov_l8otr7ot0().s[5]++;
622
+ return Promise.reject(new Error('A consent ID is required for accepting consent'));
623
+ } else {
624
+ cov_l8otr7ot0().b[1][1]++;
625
+ }
626
+ cov_l8otr7ot0().s[6]++;
627
+ return this._sdk.auth.getCurrentAccessToken().then(accessToken => {
628
+ cov_l8otr7ot0().f[2]++;
629
+ cov_l8otr7ot0().s[7]++;
630
+ if (!accessToken) {
631
+ cov_l8otr7ot0().b[2][0]++;
632
+ cov_l8otr7ot0().s[8]++;
633
+ return Promise.reject(new Error('A valid JWT token is required'));
634
+ } else {
635
+ cov_l8otr7ot0().b[2][1]++;
112
636
  }
113
-
114
- return this._sdk.auth.getCurrentAccessToken().then(function (accessToken) {
115
- if (!accessToken) {
116
- return Promise.reject(new Error('A valid JWT token is required'));
117
- }
118
-
119
- return _this._request.post(_this._baseUrl + '/consents/' + consentId + '/accept', {
120
- access_token: accessToken
121
- }).then(function (userApproval) {
122
- return (0, _objects.toCamelCase)(userApproval);
123
- });
637
+ cov_l8otr7ot0().s[9]++;
638
+ return this._request.post(`${this._baseUrl}/consents/${consentId}/accept`, {
639
+ access_token: accessToken
640
+ }).then(userApproval => {
641
+ cov_l8otr7ot0().f[3]++;
642
+ cov_l8otr7ot0().s[10]++;
643
+ return _objects.default.toCamelCase(userApproval);
124
644
  });
125
- }
126
-
127
- /**
128
- * Gets the current application version's consent forms. The current
129
- * access_token will be used to derive which application is being consented to.
130
- *
131
- *
132
- * API Endpoint: '/applications/consent'
133
- * Method: POST
134
- *
135
- * Note: Only valid for web users using auth0WebAuth session type
136
- *
137
- * @returns {Promise}
138
- * @fulfill {ContxtApplicationConsent}
139
- * @reject {Error}
140
- *
141
- * @example
142
- * contxtSdk.coordinator.consent
143
- * .getForCurrentApplication()
144
- * .then((applicationConsent) => console.log(applicationConsent))
145
- * .catch((err) => console.log(err));
146
- */
147
-
148
- }, {
149
- key: 'getForCurrentApplication',
150
- value: function getForCurrentApplication() {
151
- var _this2 = this;
152
-
153
- return this._sdk.auth.getCurrentAccessToken().then(function (accessToken) {
154
- if (!accessToken) {
155
- return Promise.reject(new Error('A valid JWT token is required'));
156
- }
645
+ });
646
+ }
157
647
 
158
- return _this2._request.post(_this2._baseUrl + '/applications/consent', {
159
- access_token: accessToken
160
- }).then(function (applicationConsent) {
161
- return (0, _objects.toCamelCase)(applicationConsent);
162
- });
648
+ /**
649
+ * Gets the current application version's consent forms. The current
650
+ * access_token will be used to derive which application is being consented to.
651
+ *
652
+ *
653
+ * API Endpoint: '/applications/consent'
654
+ * Method: POST
655
+ *
656
+ * Note: Only valid for web users using auth0WebAuth session type
657
+ *
658
+ * @returns {Promise}
659
+ * @fulfill {ContxtApplicationConsent}
660
+ * @reject {Error}
661
+ *
662
+ * @example
663
+ * contxtSdk.coordinator.consent
664
+ * .getForCurrentApplication()
665
+ * .then((applicationConsent) => console.log(applicationConsent))
666
+ * .catch((err) => console.log(err));
667
+ */
668
+ getForCurrentApplication() {
669
+ cov_l8otr7ot0().f[4]++;
670
+ cov_l8otr7ot0().s[11]++;
671
+ return this._sdk.auth.getCurrentAccessToken().then(accessToken => {
672
+ cov_l8otr7ot0().f[5]++;
673
+ cov_l8otr7ot0().s[12]++;
674
+ if (!accessToken) {
675
+ cov_l8otr7ot0().b[3][0]++;
676
+ cov_l8otr7ot0().s[13]++;
677
+ return Promise.reject(new Error('A valid JWT token is required'));
678
+ } else {
679
+ cov_l8otr7ot0().b[3][1]++;
680
+ }
681
+ cov_l8otr7ot0().s[14]++;
682
+ return this._request.post(`${this._baseUrl}/applications/consent`, {
683
+ access_token: accessToken
684
+ }).then(applicationConsent => {
685
+ cov_l8otr7ot0().f[6]++;
686
+ cov_l8otr7ot0().s[15]++;
687
+ return _objects.default.toCamelCase(applicationConsent);
163
688
  });
164
- }
165
- }]);
166
-
167
- return Consent;
168
- }();
169
-
170
- exports.default = Consent;
689
+ });
690
+ }
691
+ }
692
+ var _default = exports.default = Consent;
171
693
  //# sourceMappingURL=consent.js.map