@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,13 +1,1869 @@
1
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- import has from 'lodash.has';
6
- import isPlainObject from 'lodash.isplainobject';
7
- import { formatEventUpdateToServer } from '../utils/events';
8
- import { toCamelCase, toSnakeCase } from '../utils/objects';
9
- import { formatPaginatedDataFromServer } from '../utils/pagination';
10
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ require("core-js/modules/es.promise.js");
8
+ var _lodash = _interopRequireDefault(require("lodash.has"));
9
+ var _lodash2 = _interopRequireDefault(require("lodash.isplainobject"));
10
+ var _events = _interopRequireDefault(require("../utils/events"));
11
+ var _objects = _interopRequireDefault(require("../utils/objects"));
12
+ var _pagination = _interopRequireDefault(require("../utils/pagination"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function cov_ybav9ac4q() {
15
+ var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/events/index.js";
16
+ var hash = "bf17764e854e449a5904109947329b74027bb094";
17
+ var global = new Function("return this")();
18
+ var gcv = "__coverage__";
19
+ var coverageData = {
20
+ path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/events/index.js",
21
+ statementMap: {
22
+ "0": {
23
+ start: {
24
+ line: 141,
25
+ column: 20
26
+ },
27
+ end: {
28
+ line: 141,
29
+ column: 60
30
+ }
31
+ },
32
+ "1": {
33
+ start: {
34
+ line: 143,
35
+ column: 4
36
+ },
37
+ end: {
38
+ line: 143,
39
+ column: 28
40
+ }
41
+ },
42
+ "2": {
43
+ start: {
44
+ line: 144,
45
+ column: 4
46
+ },
47
+ end: {
48
+ line: 144,
49
+ column: 28
50
+ }
51
+ },
52
+ "3": {
53
+ start: {
54
+ line: 145,
55
+ column: 4
56
+ },
57
+ end: {
58
+ line: 145,
59
+ column: 20
60
+ }
61
+ },
62
+ "4": {
63
+ start: {
64
+ line: 179,
65
+ column: 27
66
+ },
67
+ end: {
68
+ line: 179,
69
+ column: 68
70
+ }
71
+ },
72
+ "5": {
73
+ start: {
74
+ line: 181,
75
+ column: 4
76
+ },
77
+ end: {
78
+ line: 189,
79
+ column: 5
80
+ }
81
+ },
82
+ "6": {
83
+ start: {
84
+ line: 181,
85
+ column: 17
86
+ },
87
+ end: {
88
+ line: 181,
89
+ column: 18
90
+ }
91
+ },
92
+ "7": {
93
+ start: {
94
+ line: 182,
95
+ column: 20
96
+ },
97
+ end: {
98
+ line: 182,
99
+ column: 37
100
+ }
101
+ },
102
+ "8": {
103
+ start: {
104
+ line: 184,
105
+ column: 6
106
+ },
107
+ end: {
108
+ line: 188,
109
+ column: 7
110
+ }
111
+ },
112
+ "9": {
113
+ start: {
114
+ line: 185,
115
+ column: 8
116
+ },
117
+ end: {
118
+ line: 187,
119
+ column: 10
120
+ }
121
+ },
122
+ "10": {
123
+ start: {
124
+ line: 191,
125
+ column: 4
126
+ },
127
+ end: {
128
+ line: 193,
129
+ column: 61
130
+ }
131
+ },
132
+ "11": {
133
+ start: {
134
+ line: 193,
135
+ column: 26
136
+ },
137
+ end: {
138
+ line: 193,
139
+ column: 59
140
+ }
141
+ },
142
+ "12": {
143
+ start: {
144
+ line: 212,
145
+ column: 4
146
+ },
147
+ end: {
148
+ line: 216,
149
+ column: 5
150
+ }
151
+ },
152
+ "13": {
153
+ start: {
154
+ line: 213,
155
+ column: 6
156
+ },
157
+ end: {
158
+ line: 215,
159
+ column: 8
160
+ }
161
+ },
162
+ "14": {
163
+ start: {
164
+ line: 218,
165
+ column: 4
166
+ },
167
+ end: {
168
+ line: 218,
169
+ column: 70
170
+ }
171
+ },
172
+ "15": {
173
+ start: {
174
+ line: 240,
175
+ column: 4
176
+ },
177
+ end: {
178
+ line: 246,
179
+ column: 5
180
+ }
181
+ },
182
+ "16": {
183
+ start: {
184
+ line: 241,
185
+ column: 6
186
+ },
187
+ end: {
188
+ line: 245,
189
+ column: 8
190
+ }
191
+ },
192
+ "17": {
193
+ start: {
194
+ line: 248,
195
+ column: 4
196
+ },
197
+ end: {
198
+ line: 250,
199
+ column: 55
200
+ }
201
+ },
202
+ "18": {
203
+ start: {
204
+ line: 250,
205
+ column: 23
206
+ },
207
+ end: {
208
+ line: 250,
209
+ column: 53
210
+ }
211
+ },
212
+ "19": {
213
+ start: {
214
+ line: 273,
215
+ column: 4
216
+ },
217
+ end: {
218
+ line: 277,
219
+ column: 5
220
+ }
221
+ },
222
+ "20": {
223
+ start: {
224
+ line: 274,
225
+ column: 6
226
+ },
227
+ end: {
228
+ line: 276,
229
+ column: 8
230
+ }
231
+ },
232
+ "21": {
233
+ start: {
234
+ line: 279,
235
+ column: 4
236
+ },
237
+ end: {
238
+ line: 283,
239
+ column: 83
240
+ }
241
+ },
242
+ "22": {
243
+ start: {
244
+ line: 283,
245
+ column: 26
246
+ },
247
+ end: {
248
+ line: 283,
249
+ column: 81
250
+ }
251
+ },
252
+ "23": {
253
+ start: {
254
+ line: 317,
255
+ column: 4
256
+ },
257
+ end: {
258
+ line: 321,
259
+ column: 5
260
+ }
261
+ },
262
+ "24": {
263
+ start: {
264
+ line: 318,
265
+ column: 6
266
+ },
267
+ end: {
268
+ line: 320,
269
+ column: 8
270
+ }
271
+ },
272
+ "25": {
273
+ start: {
274
+ line: 323,
275
+ column: 4
276
+ },
277
+ end: {
278
+ line: 327,
279
+ column: 79
280
+ }
281
+ },
282
+ "26": {
283
+ start: {
284
+ line: 327,
285
+ column: 24
286
+ },
287
+ end: {
288
+ line: 327,
289
+ column: 77
290
+ }
291
+ },
292
+ "27": {
293
+ start: {
294
+ line: 346,
295
+ column: 4
296
+ },
297
+ end: {
298
+ line: 350,
299
+ column: 5
300
+ }
301
+ },
302
+ "28": {
303
+ start: {
304
+ line: 347,
305
+ column: 6
306
+ },
307
+ end: {
308
+ line: 349,
309
+ column: 8
310
+ }
311
+ },
312
+ "29": {
313
+ start: {
314
+ line: 352,
315
+ column: 4
316
+ },
317
+ end: {
318
+ line: 359,
319
+ column: 79
320
+ }
321
+ },
322
+ "30": {
323
+ start: {
324
+ line: 359,
325
+ column: 24
326
+ },
327
+ end: {
328
+ line: 359,
329
+ column: 77
330
+ }
331
+ },
332
+ "31": {
333
+ start: {
334
+ line: 381,
335
+ column: 4
336
+ },
337
+ end: {
338
+ line: 385,
339
+ column: 5
340
+ }
341
+ },
342
+ "32": {
343
+ start: {
344
+ line: 382,
345
+ column: 6
346
+ },
347
+ end: {
348
+ line: 384,
349
+ column: 8
350
+ }
351
+ },
352
+ "33": {
353
+ start: {
354
+ line: 387,
355
+ column: 4
356
+ },
357
+ end: {
358
+ line: 389,
359
+ column: 53
360
+ }
361
+ },
362
+ "34": {
363
+ start: {
364
+ line: 389,
365
+ column: 22
366
+ },
367
+ end: {
368
+ line: 389,
369
+ column: 51
370
+ }
371
+ },
372
+ "35": {
373
+ start: {
374
+ line: 413,
375
+ column: 4
376
+ },
377
+ end: {
378
+ line: 417,
379
+ column: 5
380
+ }
381
+ },
382
+ "36": {
383
+ start: {
384
+ line: 414,
385
+ column: 6
386
+ },
387
+ end: {
388
+ line: 416,
389
+ column: 8
390
+ }
391
+ },
392
+ "37": {
393
+ start: {
394
+ line: 419,
395
+ column: 4
396
+ },
397
+ end: {
398
+ line: 423,
399
+ column: 5
400
+ }
401
+ },
402
+ "38": {
403
+ start: {
404
+ line: 420,
405
+ column: 6
406
+ },
407
+ end: {
408
+ line: 422,
409
+ column: 8
410
+ }
411
+ },
412
+ "39": {
413
+ start: {
414
+ line: 425,
415
+ column: 4
416
+ },
417
+ end: {
418
+ line: 430,
419
+ column: 61
420
+ }
421
+ },
422
+ "40": {
423
+ start: {
424
+ line: 430,
425
+ column: 26
426
+ },
427
+ end: {
428
+ line: 430,
429
+ column: 59
430
+ }
431
+ },
432
+ "41": {
433
+ start: {
434
+ line: 452,
435
+ column: 4
436
+ },
437
+ end: {
438
+ line: 456,
439
+ column: 5
440
+ }
441
+ },
442
+ "42": {
443
+ start: {
444
+ line: 453,
445
+ column: 6
446
+ },
447
+ end: {
448
+ line: 455,
449
+ column: 8
450
+ }
451
+ },
452
+ "43": {
453
+ start: {
454
+ line: 458,
455
+ column: 4
456
+ },
457
+ end: {
458
+ line: 464,
459
+ column: 5
460
+ }
461
+ },
462
+ "44": {
463
+ start: {
464
+ line: 459,
465
+ column: 6
466
+ },
467
+ end: {
468
+ line: 463,
469
+ column: 8
470
+ }
471
+ },
472
+ "45": {
473
+ start: {
474
+ line: 466,
475
+ column: 4
476
+ },
477
+ end: {
478
+ line: 470,
479
+ column: 6
480
+ }
481
+ },
482
+ "46": {
483
+ start: {
484
+ line: 495,
485
+ column: 4
486
+ },
487
+ end: {
488
+ line: 499,
489
+ column: 5
490
+ }
491
+ },
492
+ "47": {
493
+ start: {
494
+ line: 496,
495
+ column: 6
496
+ },
497
+ end: {
498
+ line: 498,
499
+ column: 8
500
+ }
501
+ },
502
+ "48": {
503
+ start: {
504
+ line: 501,
505
+ column: 4
506
+ },
507
+ end: {
508
+ line: 505,
509
+ column: 5
510
+ }
511
+ },
512
+ "49": {
513
+ start: {
514
+ line: 502,
515
+ column: 6
516
+ },
517
+ end: {
518
+ line: 504,
519
+ column: 8
520
+ }
521
+ },
522
+ "50": {
523
+ start: {
524
+ line: 507,
525
+ column: 4
526
+ },
527
+ end: {
528
+ line: 513,
529
+ column: 5
530
+ }
531
+ },
532
+ "51": {
533
+ start: {
534
+ line: 508,
535
+ column: 6
536
+ },
537
+ end: {
538
+ line: 512,
539
+ column: 8
540
+ }
541
+ },
542
+ "52": {
543
+ start: {
544
+ line: 515,
545
+ column: 28
546
+ },
547
+ end: {
548
+ line: 515,
549
+ column: 72
550
+ }
551
+ },
552
+ "53": {
553
+ start: {
554
+ line: 517,
555
+ column: 4
556
+ },
557
+ end: {
558
+ line: 520,
559
+ column: 6
560
+ }
561
+ },
562
+ "54": {
563
+ start: {
564
+ line: 557,
565
+ column: 27
566
+ },
567
+ end: {
568
+ line: 564,
569
+ column: 5
570
+ }
571
+ },
572
+ "55": {
573
+ start: {
574
+ line: 566,
575
+ column: 4
576
+ },
577
+ end: {
578
+ line: 574,
579
+ column: 5
580
+ }
581
+ },
582
+ "56": {
583
+ start: {
584
+ line: 566,
585
+ column: 17
586
+ },
587
+ end: {
588
+ line: 566,
589
+ column: 18
590
+ }
591
+ },
592
+ "57": {
593
+ start: {
594
+ line: 567,
595
+ column: 20
596
+ },
597
+ end: {
598
+ line: 567,
599
+ column: 37
600
+ }
601
+ },
602
+ "58": {
603
+ start: {
604
+ line: 569,
605
+ column: 6
606
+ },
607
+ end: {
608
+ line: 573,
609
+ column: 7
610
+ }
611
+ },
612
+ "59": {
613
+ start: {
614
+ line: 570,
615
+ column: 8
616
+ },
617
+ end: {
618
+ line: 572,
619
+ column: 10
620
+ }
621
+ },
622
+ "60": {
623
+ start: {
624
+ line: 576,
625
+ column: 4
626
+ },
627
+ end: {
628
+ line: 578,
629
+ column: 61
630
+ }
631
+ },
632
+ "61": {
633
+ start: {
634
+ line: 578,
635
+ column: 26
636
+ },
637
+ end: {
638
+ line: 578,
639
+ column: 59
640
+ }
641
+ }
642
+ },
643
+ fnMap: {
644
+ "0": {
645
+ name: "(anonymous_0)",
646
+ decl: {
647
+ start: {
648
+ line: 140,
649
+ column: 2
650
+ },
651
+ end: {
652
+ line: 140,
653
+ column: 3
654
+ }
655
+ },
656
+ loc: {
657
+ start: {
658
+ line: 140,
659
+ column: 28
660
+ },
661
+ end: {
662
+ line: 146,
663
+ column: 3
664
+ }
665
+ },
666
+ line: 140
667
+ },
668
+ "1": {
669
+ name: "(anonymous_1)",
670
+ decl: {
671
+ start: {
672
+ line: 178,
673
+ column: 2
674
+ },
675
+ end: {
676
+ line: 178,
677
+ column: 3
678
+ }
679
+ },
680
+ loc: {
681
+ start: {
682
+ line: 178,
683
+ column: 21
684
+ },
685
+ end: {
686
+ line: 194,
687
+ column: 3
688
+ }
689
+ },
690
+ line: 178
691
+ },
692
+ "2": {
693
+ name: "(anonymous_2)",
694
+ decl: {
695
+ start: {
696
+ line: 193,
697
+ column: 12
698
+ },
699
+ end: {
700
+ line: 193,
701
+ column: 13
702
+ }
703
+ },
704
+ loc: {
705
+ start: {
706
+ line: 193,
707
+ column: 26
708
+ },
709
+ end: {
710
+ line: 193,
711
+ column: 59
712
+ }
713
+ },
714
+ line: 193
715
+ },
716
+ "3": {
717
+ name: "(anonymous_3)",
718
+ decl: {
719
+ start: {
720
+ line: 211,
721
+ column: 2
722
+ },
723
+ end: {
724
+ line: 211,
725
+ column: 3
726
+ }
727
+ },
728
+ loc: {
729
+ start: {
730
+ line: 211,
731
+ column: 18
732
+ },
733
+ end: {
734
+ line: 219,
735
+ column: 3
736
+ }
737
+ },
738
+ line: 211
739
+ },
740
+ "4": {
741
+ name: "(anonymous_4)",
742
+ decl: {
743
+ start: {
744
+ line: 239,
745
+ column: 2
746
+ },
747
+ end: {
748
+ line: 239,
749
+ column: 3
750
+ }
751
+ },
752
+ loc: {
753
+ start: {
754
+ line: 239,
755
+ column: 15
756
+ },
757
+ end: {
758
+ line: 251,
759
+ column: 3
760
+ }
761
+ },
762
+ line: 239
763
+ },
764
+ "5": {
765
+ name: "(anonymous_5)",
766
+ decl: {
767
+ start: {
768
+ line: 250,
769
+ column: 12
770
+ },
771
+ end: {
772
+ line: 250,
773
+ column: 13
774
+ }
775
+ },
776
+ loc: {
777
+ start: {
778
+ line: 250,
779
+ column: 23
780
+ },
781
+ end: {
782
+ line: 250,
783
+ column: 53
784
+ }
785
+ },
786
+ line: 250
787
+ },
788
+ "6": {
789
+ name: "(anonymous_6)",
790
+ decl: {
791
+ start: {
792
+ line: 272,
793
+ column: 2
794
+ },
795
+ end: {
796
+ line: 272,
797
+ column: 3
798
+ }
799
+ },
800
+ loc: {
801
+ start: {
802
+ line: 272,
803
+ column: 55
804
+ },
805
+ end: {
806
+ line: 284,
807
+ column: 3
808
+ }
809
+ },
810
+ line: 272
811
+ },
812
+ "7": {
813
+ name: "(anonymous_7)",
814
+ decl: {
815
+ start: {
816
+ line: 283,
817
+ column: 12
818
+ },
819
+ end: {
820
+ line: 283,
821
+ column: 13
822
+ }
823
+ },
824
+ loc: {
825
+ start: {
826
+ line: 283,
827
+ column: 26
828
+ },
829
+ end: {
830
+ line: 283,
831
+ column: 81
832
+ }
833
+ },
834
+ line: 283
835
+ },
836
+ "8": {
837
+ name: "(anonymous_8)",
838
+ decl: {
839
+ start: {
840
+ line: 316,
841
+ column: 2
842
+ },
843
+ end: {
844
+ line: 316,
845
+ column: 3
846
+ }
847
+ },
848
+ loc: {
849
+ start: {
850
+ line: 316,
851
+ column: 52
852
+ },
853
+ end: {
854
+ line: 328,
855
+ column: 3
856
+ }
857
+ },
858
+ line: 316
859
+ },
860
+ "9": {
861
+ name: "(anonymous_9)",
862
+ decl: {
863
+ start: {
864
+ line: 327,
865
+ column: 12
866
+ },
867
+ end: {
868
+ line: 327,
869
+ column: 13
870
+ }
871
+ },
872
+ loc: {
873
+ start: {
874
+ line: 327,
875
+ column: 24
876
+ },
877
+ end: {
878
+ line: 327,
879
+ column: 77
880
+ }
881
+ },
882
+ line: 327
883
+ },
884
+ "10": {
885
+ name: "(anonymous_10)",
886
+ decl: {
887
+ start: {
888
+ line: 345,
889
+ column: 2
890
+ },
891
+ end: {
892
+ line: 345,
893
+ column: 3
894
+ }
895
+ },
896
+ loc: {
897
+ start: {
898
+ line: 345,
899
+ column: 73
900
+ },
901
+ end: {
902
+ line: 360,
903
+ column: 3
904
+ }
905
+ },
906
+ line: 345
907
+ },
908
+ "11": {
909
+ name: "(anonymous_11)",
910
+ decl: {
911
+ start: {
912
+ line: 359,
913
+ column: 12
914
+ },
915
+ end: {
916
+ line: 359,
917
+ column: 13
918
+ }
919
+ },
920
+ loc: {
921
+ start: {
922
+ line: 359,
923
+ column: 24
924
+ },
925
+ end: {
926
+ line: 359,
927
+ column: 77
928
+ }
929
+ },
930
+ line: 359
931
+ },
932
+ "12": {
933
+ name: "(anonymous_12)",
934
+ decl: {
935
+ start: {
936
+ line: 380,
937
+ column: 2
938
+ },
939
+ end: {
940
+ line: 380,
941
+ column: 3
942
+ }
943
+ },
944
+ loc: {
945
+ start: {
946
+ line: 380,
947
+ column: 22
948
+ },
949
+ end: {
950
+ line: 390,
951
+ column: 3
952
+ }
953
+ },
954
+ line: 380
955
+ },
956
+ "13": {
957
+ name: "(anonymous_13)",
958
+ decl: {
959
+ start: {
960
+ line: 389,
961
+ column: 12
962
+ },
963
+ end: {
964
+ line: 389,
965
+ column: 13
966
+ }
967
+ },
968
+ loc: {
969
+ start: {
970
+ line: 389,
971
+ column: 22
972
+ },
973
+ end: {
974
+ line: 389,
975
+ column: 51
976
+ }
977
+ },
978
+ line: 389
979
+ },
980
+ "14": {
981
+ name: "(anonymous_14)",
982
+ decl: {
983
+ start: {
984
+ line: 412,
985
+ column: 2
986
+ },
987
+ end: {
988
+ line: 412,
989
+ column: 3
990
+ }
991
+ },
992
+ loc: {
993
+ start: {
994
+ line: 412,
995
+ column: 53
996
+ },
997
+ end: {
998
+ line: 431,
999
+ column: 3
1000
+ }
1001
+ },
1002
+ line: 412
1003
+ },
1004
+ "15": {
1005
+ name: "(anonymous_15)",
1006
+ decl: {
1007
+ start: {
1008
+ line: 430,
1009
+ column: 12
1010
+ },
1011
+ end: {
1012
+ line: 430,
1013
+ column: 13
1014
+ }
1015
+ },
1016
+ loc: {
1017
+ start: {
1018
+ line: 430,
1019
+ column: 26
1020
+ },
1021
+ end: {
1022
+ line: 430,
1023
+ column: 59
1024
+ }
1025
+ },
1026
+ line: 430
1027
+ },
1028
+ "16": {
1029
+ name: "(anonymous_16)",
1030
+ decl: {
1031
+ start: {
1032
+ line: 451,
1033
+ column: 2
1034
+ },
1035
+ end: {
1036
+ line: 451,
1037
+ column: 3
1038
+ }
1039
+ },
1040
+ loc: {
1041
+ start: {
1042
+ line: 451,
1043
+ column: 51
1044
+ },
1045
+ end: {
1046
+ line: 471,
1047
+ column: 3
1048
+ }
1049
+ },
1050
+ line: 451
1051
+ },
1052
+ "17": {
1053
+ name: "(anonymous_17)",
1054
+ decl: {
1055
+ start: {
1056
+ line: 494,
1057
+ column: 2
1058
+ },
1059
+ end: {
1060
+ line: 494,
1061
+ column: 3
1062
+ }
1063
+ },
1064
+ loc: {
1065
+ start: {
1066
+ line: 494,
1067
+ column: 26
1068
+ },
1069
+ end: {
1070
+ line: 521,
1071
+ column: 3
1072
+ }
1073
+ },
1074
+ line: 494
1075
+ },
1076
+ "18": {
1077
+ name: "(anonymous_18)",
1078
+ decl: {
1079
+ start: {
1080
+ line: 556,
1081
+ column: 2
1082
+ },
1083
+ end: {
1084
+ line: 556,
1085
+ column: 3
1086
+ }
1087
+ },
1088
+ loc: {
1089
+ start: {
1090
+ line: 556,
1091
+ column: 34
1092
+ },
1093
+ end: {
1094
+ line: 579,
1095
+ column: 3
1096
+ }
1097
+ },
1098
+ line: 556
1099
+ },
1100
+ "19": {
1101
+ name: "(anonymous_19)",
1102
+ decl: {
1103
+ start: {
1104
+ line: 578,
1105
+ column: 12
1106
+ },
1107
+ end: {
1108
+ line: 578,
1109
+ column: 13
1110
+ }
1111
+ },
1112
+ loc: {
1113
+ start: {
1114
+ line: 578,
1115
+ column: 26
1116
+ },
1117
+ end: {
1118
+ line: 578,
1119
+ column: 59
1120
+ }
1121
+ },
1122
+ line: 578
1123
+ }
1124
+ },
1125
+ branchMap: {
1126
+ "0": {
1127
+ loc: {
1128
+ start: {
1129
+ line: 178,
1130
+ column: 9
1131
+ },
1132
+ end: {
1133
+ line: 178,
1134
+ column: 19
1135
+ }
1136
+ },
1137
+ type: "default-arg",
1138
+ locations: [{
1139
+ start: {
1140
+ line: 178,
1141
+ column: 17
1142
+ },
1143
+ end: {
1144
+ line: 178,
1145
+ column: 19
1146
+ }
1147
+ }],
1148
+ line: 178
1149
+ },
1150
+ "1": {
1151
+ loc: {
1152
+ start: {
1153
+ line: 184,
1154
+ column: 6
1155
+ },
1156
+ end: {
1157
+ line: 188,
1158
+ column: 7
1159
+ }
1160
+ },
1161
+ type: "if",
1162
+ locations: [{
1163
+ start: {
1164
+ line: 184,
1165
+ column: 6
1166
+ },
1167
+ end: {
1168
+ line: 188,
1169
+ column: 7
1170
+ }
1171
+ }, {
1172
+ start: {
1173
+ line: undefined,
1174
+ column: undefined
1175
+ },
1176
+ end: {
1177
+ line: undefined,
1178
+ column: undefined
1179
+ }
1180
+ }],
1181
+ line: 184
1182
+ },
1183
+ "2": {
1184
+ loc: {
1185
+ start: {
1186
+ line: 212,
1187
+ column: 4
1188
+ },
1189
+ end: {
1190
+ line: 216,
1191
+ column: 5
1192
+ }
1193
+ },
1194
+ type: "if",
1195
+ locations: [{
1196
+ start: {
1197
+ line: 212,
1198
+ column: 4
1199
+ },
1200
+ end: {
1201
+ line: 216,
1202
+ column: 5
1203
+ }
1204
+ }, {
1205
+ start: {
1206
+ line: undefined,
1207
+ column: undefined
1208
+ },
1209
+ end: {
1210
+ line: undefined,
1211
+ column: undefined
1212
+ }
1213
+ }],
1214
+ line: 212
1215
+ },
1216
+ "3": {
1217
+ loc: {
1218
+ start: {
1219
+ line: 240,
1220
+ column: 4
1221
+ },
1222
+ end: {
1223
+ line: 246,
1224
+ column: 5
1225
+ }
1226
+ },
1227
+ type: "if",
1228
+ locations: [{
1229
+ start: {
1230
+ line: 240,
1231
+ column: 4
1232
+ },
1233
+ end: {
1234
+ line: 246,
1235
+ column: 5
1236
+ }
1237
+ }, {
1238
+ start: {
1239
+ line: undefined,
1240
+ column: undefined
1241
+ },
1242
+ end: {
1243
+ line: undefined,
1244
+ column: undefined
1245
+ }
1246
+ }],
1247
+ line: 240
1248
+ },
1249
+ "4": {
1250
+ loc: {
1251
+ start: {
1252
+ line: 273,
1253
+ column: 4
1254
+ },
1255
+ end: {
1256
+ line: 277,
1257
+ column: 5
1258
+ }
1259
+ },
1260
+ type: "if",
1261
+ locations: [{
1262
+ start: {
1263
+ line: 273,
1264
+ column: 4
1265
+ },
1266
+ end: {
1267
+ line: 277,
1268
+ column: 5
1269
+ }
1270
+ }, {
1271
+ start: {
1272
+ line: undefined,
1273
+ column: undefined
1274
+ },
1275
+ end: {
1276
+ line: undefined,
1277
+ column: undefined
1278
+ }
1279
+ }],
1280
+ line: 273
1281
+ },
1282
+ "5": {
1283
+ loc: {
1284
+ start: {
1285
+ line: 316,
1286
+ column: 33
1287
+ },
1288
+ end: {
1289
+ line: 316,
1290
+ column: 50
1291
+ }
1292
+ },
1293
+ type: "default-arg",
1294
+ locations: [{
1295
+ start: {
1296
+ line: 316,
1297
+ column: 48
1298
+ },
1299
+ end: {
1300
+ line: 316,
1301
+ column: 50
1302
+ }
1303
+ }],
1304
+ line: 316
1305
+ },
1306
+ "6": {
1307
+ loc: {
1308
+ start: {
1309
+ line: 317,
1310
+ column: 4
1311
+ },
1312
+ end: {
1313
+ line: 321,
1314
+ column: 5
1315
+ }
1316
+ },
1317
+ type: "if",
1318
+ locations: [{
1319
+ start: {
1320
+ line: 317,
1321
+ column: 4
1322
+ },
1323
+ end: {
1324
+ line: 321,
1325
+ column: 5
1326
+ }
1327
+ }, {
1328
+ start: {
1329
+ line: undefined,
1330
+ column: undefined
1331
+ },
1332
+ end: {
1333
+ line: undefined,
1334
+ column: undefined
1335
+ }
1336
+ }],
1337
+ line: 317
1338
+ },
1339
+ "7": {
1340
+ loc: {
1341
+ start: {
1342
+ line: 345,
1343
+ column: 45
1344
+ },
1345
+ end: {
1346
+ line: 345,
1347
+ column: 71
1348
+ }
1349
+ },
1350
+ type: "default-arg",
1351
+ locations: [{
1352
+ start: {
1353
+ line: 345,
1354
+ column: 69
1355
+ },
1356
+ end: {
1357
+ line: 345,
1358
+ column: 71
1359
+ }
1360
+ }],
1361
+ line: 345
1362
+ },
1363
+ "8": {
1364
+ loc: {
1365
+ start: {
1366
+ line: 346,
1367
+ column: 4
1368
+ },
1369
+ end: {
1370
+ line: 350,
1371
+ column: 5
1372
+ }
1373
+ },
1374
+ type: "if",
1375
+ locations: [{
1376
+ start: {
1377
+ line: 346,
1378
+ column: 4
1379
+ },
1380
+ end: {
1381
+ line: 350,
1382
+ column: 5
1383
+ }
1384
+ }, {
1385
+ start: {
1386
+ line: undefined,
1387
+ column: undefined
1388
+ },
1389
+ end: {
1390
+ line: undefined,
1391
+ column: undefined
1392
+ }
1393
+ }],
1394
+ line: 346
1395
+ },
1396
+ "9": {
1397
+ loc: {
1398
+ start: {
1399
+ line: 381,
1400
+ column: 4
1401
+ },
1402
+ end: {
1403
+ line: 385,
1404
+ column: 5
1405
+ }
1406
+ },
1407
+ type: "if",
1408
+ locations: [{
1409
+ start: {
1410
+ line: 381,
1411
+ column: 4
1412
+ },
1413
+ end: {
1414
+ line: 385,
1415
+ column: 5
1416
+ }
1417
+ }, {
1418
+ start: {
1419
+ line: undefined,
1420
+ column: undefined
1421
+ },
1422
+ end: {
1423
+ line: undefined,
1424
+ column: undefined
1425
+ }
1426
+ }],
1427
+ line: 381
1428
+ },
1429
+ "10": {
1430
+ loc: {
1431
+ start: {
1432
+ line: 412,
1433
+ column: 33
1434
+ },
1435
+ end: {
1436
+ line: 412,
1437
+ column: 51
1438
+ }
1439
+ },
1440
+ type: "default-arg",
1441
+ locations: [{
1442
+ start: {
1443
+ line: 412,
1444
+ column: 49
1445
+ },
1446
+ end: {
1447
+ line: 412,
1448
+ column: 51
1449
+ }
1450
+ }],
1451
+ line: 412
1452
+ },
1453
+ "11": {
1454
+ loc: {
1455
+ start: {
1456
+ line: 413,
1457
+ column: 4
1458
+ },
1459
+ end: {
1460
+ line: 417,
1461
+ column: 5
1462
+ }
1463
+ },
1464
+ type: "if",
1465
+ locations: [{
1466
+ start: {
1467
+ line: 413,
1468
+ column: 4
1469
+ },
1470
+ end: {
1471
+ line: 417,
1472
+ column: 5
1473
+ }
1474
+ }, {
1475
+ start: {
1476
+ line: undefined,
1477
+ column: undefined
1478
+ },
1479
+ end: {
1480
+ line: undefined,
1481
+ column: undefined
1482
+ }
1483
+ }],
1484
+ line: 413
1485
+ },
1486
+ "12": {
1487
+ loc: {
1488
+ start: {
1489
+ line: 419,
1490
+ column: 4
1491
+ },
1492
+ end: {
1493
+ line: 423,
1494
+ column: 5
1495
+ }
1496
+ },
1497
+ type: "if",
1498
+ locations: [{
1499
+ start: {
1500
+ line: 419,
1501
+ column: 4
1502
+ },
1503
+ end: {
1504
+ line: 423,
1505
+ column: 5
1506
+ }
1507
+ }, {
1508
+ start: {
1509
+ line: undefined,
1510
+ column: undefined
1511
+ },
1512
+ end: {
1513
+ line: undefined,
1514
+ column: undefined
1515
+ }
1516
+ }],
1517
+ line: 419
1518
+ },
1519
+ "13": {
1520
+ loc: {
1521
+ start: {
1522
+ line: 452,
1523
+ column: 4
1524
+ },
1525
+ end: {
1526
+ line: 456,
1527
+ column: 5
1528
+ }
1529
+ },
1530
+ type: "if",
1531
+ locations: [{
1532
+ start: {
1533
+ line: 452,
1534
+ column: 4
1535
+ },
1536
+ end: {
1537
+ line: 456,
1538
+ column: 5
1539
+ }
1540
+ }, {
1541
+ start: {
1542
+ line: undefined,
1543
+ column: undefined
1544
+ },
1545
+ end: {
1546
+ line: undefined,
1547
+ column: undefined
1548
+ }
1549
+ }],
1550
+ line: 452
1551
+ },
1552
+ "14": {
1553
+ loc: {
1554
+ start: {
1555
+ line: 458,
1556
+ column: 4
1557
+ },
1558
+ end: {
1559
+ line: 464,
1560
+ column: 5
1561
+ }
1562
+ },
1563
+ type: "if",
1564
+ locations: [{
1565
+ start: {
1566
+ line: 458,
1567
+ column: 4
1568
+ },
1569
+ end: {
1570
+ line: 464,
1571
+ column: 5
1572
+ }
1573
+ }, {
1574
+ start: {
1575
+ line: undefined,
1576
+ column: undefined
1577
+ },
1578
+ end: {
1579
+ line: undefined,
1580
+ column: undefined
1581
+ }
1582
+ }],
1583
+ line: 458
1584
+ },
1585
+ "15": {
1586
+ loc: {
1587
+ start: {
1588
+ line: 495,
1589
+ column: 4
1590
+ },
1591
+ end: {
1592
+ line: 499,
1593
+ column: 5
1594
+ }
1595
+ },
1596
+ type: "if",
1597
+ locations: [{
1598
+ start: {
1599
+ line: 495,
1600
+ column: 4
1601
+ },
1602
+ end: {
1603
+ line: 499,
1604
+ column: 5
1605
+ }
1606
+ }, {
1607
+ start: {
1608
+ line: undefined,
1609
+ column: undefined
1610
+ },
1611
+ end: {
1612
+ line: undefined,
1613
+ column: undefined
1614
+ }
1615
+ }],
1616
+ line: 495
1617
+ },
1618
+ "16": {
1619
+ loc: {
1620
+ start: {
1621
+ line: 501,
1622
+ column: 4
1623
+ },
1624
+ end: {
1625
+ line: 505,
1626
+ column: 5
1627
+ }
1628
+ },
1629
+ type: "if",
1630
+ locations: [{
1631
+ start: {
1632
+ line: 501,
1633
+ column: 4
1634
+ },
1635
+ end: {
1636
+ line: 505,
1637
+ column: 5
1638
+ }
1639
+ }, {
1640
+ start: {
1641
+ line: undefined,
1642
+ column: undefined
1643
+ },
1644
+ end: {
1645
+ line: undefined,
1646
+ column: undefined
1647
+ }
1648
+ }],
1649
+ line: 501
1650
+ },
1651
+ "17": {
1652
+ loc: {
1653
+ start: {
1654
+ line: 507,
1655
+ column: 4
1656
+ },
1657
+ end: {
1658
+ line: 513,
1659
+ column: 5
1660
+ }
1661
+ },
1662
+ type: "if",
1663
+ locations: [{
1664
+ start: {
1665
+ line: 507,
1666
+ column: 4
1667
+ },
1668
+ end: {
1669
+ line: 513,
1670
+ column: 5
1671
+ }
1672
+ }, {
1673
+ start: {
1674
+ line: undefined,
1675
+ column: undefined
1676
+ },
1677
+ end: {
1678
+ line: undefined,
1679
+ column: undefined
1680
+ }
1681
+ }],
1682
+ line: 507
1683
+ },
1684
+ "18": {
1685
+ loc: {
1686
+ start: {
1687
+ line: 556,
1688
+ column: 18
1689
+ },
1690
+ end: {
1691
+ line: 556,
1692
+ column: 32
1693
+ }
1694
+ },
1695
+ type: "default-arg",
1696
+ locations: [{
1697
+ start: {
1698
+ line: 556,
1699
+ column: 30
1700
+ },
1701
+ end: {
1702
+ line: 556,
1703
+ column: 32
1704
+ }
1705
+ }],
1706
+ line: 556
1707
+ },
1708
+ "19": {
1709
+ loc: {
1710
+ start: {
1711
+ line: 569,
1712
+ column: 6
1713
+ },
1714
+ end: {
1715
+ line: 573,
1716
+ column: 7
1717
+ }
1718
+ },
1719
+ type: "if",
1720
+ locations: [{
1721
+ start: {
1722
+ line: 569,
1723
+ column: 6
1724
+ },
1725
+ end: {
1726
+ line: 573,
1727
+ column: 7
1728
+ }
1729
+ }, {
1730
+ start: {
1731
+ line: undefined,
1732
+ column: undefined
1733
+ },
1734
+ end: {
1735
+ line: undefined,
1736
+ column: undefined
1737
+ }
1738
+ }],
1739
+ line: 569
1740
+ }
1741
+ },
1742
+ s: {
1743
+ "0": 0,
1744
+ "1": 0,
1745
+ "2": 0,
1746
+ "3": 0,
1747
+ "4": 0,
1748
+ "5": 0,
1749
+ "6": 0,
1750
+ "7": 0,
1751
+ "8": 0,
1752
+ "9": 0,
1753
+ "10": 0,
1754
+ "11": 0,
1755
+ "12": 0,
1756
+ "13": 0,
1757
+ "14": 0,
1758
+ "15": 0,
1759
+ "16": 0,
1760
+ "17": 0,
1761
+ "18": 0,
1762
+ "19": 0,
1763
+ "20": 0,
1764
+ "21": 0,
1765
+ "22": 0,
1766
+ "23": 0,
1767
+ "24": 0,
1768
+ "25": 0,
1769
+ "26": 0,
1770
+ "27": 0,
1771
+ "28": 0,
1772
+ "29": 0,
1773
+ "30": 0,
1774
+ "31": 0,
1775
+ "32": 0,
1776
+ "33": 0,
1777
+ "34": 0,
1778
+ "35": 0,
1779
+ "36": 0,
1780
+ "37": 0,
1781
+ "38": 0,
1782
+ "39": 0,
1783
+ "40": 0,
1784
+ "41": 0,
1785
+ "42": 0,
1786
+ "43": 0,
1787
+ "44": 0,
1788
+ "45": 0,
1789
+ "46": 0,
1790
+ "47": 0,
1791
+ "48": 0,
1792
+ "49": 0,
1793
+ "50": 0,
1794
+ "51": 0,
1795
+ "52": 0,
1796
+ "53": 0,
1797
+ "54": 0,
1798
+ "55": 0,
1799
+ "56": 0,
1800
+ "57": 0,
1801
+ "58": 0,
1802
+ "59": 0,
1803
+ "60": 0,
1804
+ "61": 0
1805
+ },
1806
+ f: {
1807
+ "0": 0,
1808
+ "1": 0,
1809
+ "2": 0,
1810
+ "3": 0,
1811
+ "4": 0,
1812
+ "5": 0,
1813
+ "6": 0,
1814
+ "7": 0,
1815
+ "8": 0,
1816
+ "9": 0,
1817
+ "10": 0,
1818
+ "11": 0,
1819
+ "12": 0,
1820
+ "13": 0,
1821
+ "14": 0,
1822
+ "15": 0,
1823
+ "16": 0,
1824
+ "17": 0,
1825
+ "18": 0,
1826
+ "19": 0
1827
+ },
1828
+ b: {
1829
+ "0": [0],
1830
+ "1": [0, 0],
1831
+ "2": [0, 0],
1832
+ "3": [0, 0],
1833
+ "4": [0, 0],
1834
+ "5": [0],
1835
+ "6": [0, 0],
1836
+ "7": [0],
1837
+ "8": [0, 0],
1838
+ "9": [0, 0],
1839
+ "10": [0],
1840
+ "11": [0, 0],
1841
+ "12": [0, 0],
1842
+ "13": [0, 0],
1843
+ "14": [0, 0],
1844
+ "15": [0, 0],
1845
+ "16": [0, 0],
1846
+ "17": [0, 0],
1847
+ "18": [0],
1848
+ "19": [0, 0]
1849
+ },
1850
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
1851
+ hash: "bf17764e854e449a5904109947329b74027bb094"
1852
+ };
1853
+ var coverage = global[gcv] || (global[gcv] = {});
1854
+ if (!coverage[path] || coverage[path].hash !== hash) {
1855
+ coverage[path] = coverageData;
1856
+ }
1857
+ var actualCoverage = coverage[path];
1858
+ {
1859
+ // @ts-ignore
1860
+ cov_ybav9ac4q = function () {
1861
+ return actualCoverage;
1862
+ };
1863
+ }
1864
+ return actualCoverage;
1865
+ }
1866
+ cov_ybav9ac4q();
11
1867
  /**
12
1868
  * @typedef {Object} Event
13
1869
  * @property {boolean} allowOthersToTrigger Whether or not to allow non-owners to trigger the Event
@@ -136,19 +1992,19 @@ import { formatPaginatedDataFromServer } from '../utils/pagination';
136
1992
  *
137
1993
  * @typicalname contxtSdk.events
138
1994
  */
139
-
140
- var Events = function () {
1995
+ class Events {
141
1996
  /**
142
1997
  * @param {Object} sdk An instance of the SDK so the module can communicate with other modules
143
1998
  * @param {Object} request An instance of the request module tied to this module's audience.
144
1999
  */
145
- function Events(sdk, request) {
146
- _classCallCheck(this, Events);
147
-
148
- var baseUrl = sdk.config.audiences.events.host + '/v1';
149
-
2000
+ constructor(sdk, request) {
2001
+ cov_ybav9ac4q().f[0]++;
2002
+ const baseUrl = (cov_ybav9ac4q().s[0]++, `${sdk.config.audiences.events.host}/v1`);
2003
+ cov_ybav9ac4q().s[1]++;
150
2004
  this._baseUrl = baseUrl;
2005
+ cov_ybav9ac4q().s[2]++;
151
2006
  this._request = request;
2007
+ cov_ybav9ac4q().s[3]++;
152
2008
  this._sdk = sdk;
153
2009
  }
154
2010
 
@@ -182,403 +2038,455 @@ var Events = function () {
182
2038
  * .then((event) => console.log(event))
183
2039
  * .catch((err) => console.log(err));
184
2040
  */
185
-
186
-
187
- _createClass(Events, [{
188
- key: 'create',
189
- value: function create() {
190
- var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
191
-
192
- var requiredFields = ['eventTypeId', 'name', 'organizationId'];
193
-
194
- for (var i = 0; i < requiredFields.length; i++) {
195
- var field = requiredFields[i];
196
-
197
- if (!event[field]) {
198
- return Promise.reject(new Error('A ' + field + ' is required to create a new event.'));
199
- }
2041
+ create() {
2042
+ let event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (cov_ybav9ac4q().b[0][0]++, {});
2043
+ cov_ybav9ac4q().f[1]++;
2044
+ const requiredFields = (cov_ybav9ac4q().s[4]++, ['eventTypeId', 'name', 'organizationId']);
2045
+ cov_ybav9ac4q().s[5]++;
2046
+ for (let i = (cov_ybav9ac4q().s[6]++, 0); i < requiredFields.length; i++) {
2047
+ const field = (cov_ybav9ac4q().s[7]++, requiredFields[i]);
2048
+ cov_ybav9ac4q().s[8]++;
2049
+ if (!event[field]) {
2050
+ cov_ybav9ac4q().b[1][0]++;
2051
+ cov_ybav9ac4q().s[9]++;
2052
+ return Promise.reject(new Error(`A ${field} is required to create a new event.`));
2053
+ } else {
2054
+ cov_ybav9ac4q().b[1][1]++;
200
2055
  }
201
-
202
- return this._request.post(this._baseUrl + '/events', toSnakeCase(event)).then(function (response) {
203
- return toCamelCase(response);
204
- });
205
2056
  }
2057
+ cov_ybav9ac4q().s[10]++;
2058
+ return this._request.post(`${this._baseUrl}/events`, _objects.default.toSnakeCase(event)).then(response => {
2059
+ cov_ybav9ac4q().f[2]++;
2060
+ cov_ybav9ac4q().s[11]++;
2061
+ return _objects.default.toCamelCase(response);
2062
+ });
2063
+ }
206
2064
 
207
- /**
208
- * Deletes an event
209
- *
210
- * API Endpoint: '/events/:eventId'
211
- * Method: DELETE
212
- *
213
- * @param {string} eventId The ID of the Event
214
- *
215
- * @returns {Promise}
216
- * @fulfill {undefined}
217
- * @reject {Error}
218
- *
219
- * @example
220
- * contxtSdk.events.delete('875afddd-091c-4385-bc21-0edf38804d27');
221
- */
222
-
223
- }, {
224
- key: 'delete',
225
- value: function _delete(eventId) {
226
- if (!eventId) {
227
- return Promise.reject(new Error('An event ID is required for deleting an event'));
228
- }
229
-
230
- return this._request.delete(this._baseUrl + '/events/' + eventId);
2065
+ /**
2066
+ * Deletes an event
2067
+ *
2068
+ * API Endpoint: '/events/:eventId'
2069
+ * Method: DELETE
2070
+ *
2071
+ * @param {string} eventId The ID of the Event
2072
+ *
2073
+ * @returns {Promise}
2074
+ * @fulfill {undefined}
2075
+ * @reject {Error}
2076
+ *
2077
+ * @example
2078
+ * contxtSdk.events.delete('875afddd-091c-4385-bc21-0edf38804d27');
2079
+ */
2080
+ delete(eventId) {
2081
+ cov_ybav9ac4q().f[3]++;
2082
+ cov_ybav9ac4q().s[12]++;
2083
+ if (!eventId) {
2084
+ cov_ybav9ac4q().b[2][0]++;
2085
+ cov_ybav9ac4q().s[13]++;
2086
+ return Promise.reject(new Error('An event ID is required for deleting an event'));
2087
+ } else {
2088
+ cov_ybav9ac4q().b[2][1]++;
231
2089
  }
2090
+ cov_ybav9ac4q().s[14]++;
2091
+ return this._request.delete(`${this._baseUrl}/events/${eventId}`);
2092
+ }
232
2093
 
233
- /**
234
- * Gets information about an event
235
- *
236
- * API Endpoint: '/events/:eventId'
237
- * Method: GET
238
- *
239
- * @param {string} eventId The ID of the event
240
- *
241
- * @returns {Promise}
242
- * @fulfill {Event} Information about an event
243
- * @reject {Error}
244
- *
245
- * @example
246
- * contxtSdk.events
247
- * .get('875afddd-091c-4385-bc21-0edf38804d27')
248
- * .then((event) => console.log(event))
249
- * .catch((err) => console.log(err));
250
- */
251
-
252
- }, {
253
- key: 'get',
254
- value: function get(eventId) {
255
- if (!eventId) {
256
- return Promise.reject(new Error('An event ID is required for getting information about an event'));
257
- }
258
-
259
- return this._request.get(this._baseUrl + '/events/' + eventId).then(function (event) {
260
- return toCamelCase(event);
261
- });
2094
+ /**
2095
+ * Gets information about an event
2096
+ *
2097
+ * API Endpoint: '/events/:eventId'
2098
+ * Method: GET
2099
+ *
2100
+ * @param {string} eventId The ID of the event
2101
+ *
2102
+ * @returns {Promise}
2103
+ * @fulfill {Event} Information about an event
2104
+ * @reject {Error}
2105
+ *
2106
+ * @example
2107
+ * contxtSdk.events
2108
+ * .get('875afddd-091c-4385-bc21-0edf38804d27')
2109
+ * .then((event) => console.log(event))
2110
+ * .catch((err) => console.log(err));
2111
+ */
2112
+ get(eventId) {
2113
+ cov_ybav9ac4q().f[4]++;
2114
+ cov_ybav9ac4q().s[15]++;
2115
+ if (!eventId) {
2116
+ cov_ybav9ac4q().b[3][0]++;
2117
+ cov_ybav9ac4q().s[16]++;
2118
+ return Promise.reject(new Error('An event ID is required for getting information about an event'));
2119
+ } else {
2120
+ cov_ybav9ac4q().b[3][1]++;
262
2121
  }
2122
+ cov_ybav9ac4q().s[17]++;
2123
+ return this._request.get(`${this._baseUrl}/events/${eventId}`).then(event => {
2124
+ cov_ybav9ac4q().f[5]++;
2125
+ cov_ybav9ac4q().s[18]++;
2126
+ return _objects.default.toCamelCase(event);
2127
+ });
2128
+ }
263
2129
 
264
- /**
265
- * Gets all event types for a client
266
- *
267
- * API Endpoint: '/clients/:clientId/types'
268
- * Method: GET
269
- *
270
- * @param {string} clientId The ID of the client
271
- * @param {PaginationOptions} [paginationOptions]
272
- *
273
- * @returns {Promise}
274
- * @fulfill {EventTypesFromServer} Event types from the server
275
- * @reject {Error}
276
- *
277
- * @example
278
- * contxtSdk.events
279
- * .getEventTypesByClientId('CW4B1Ih6M1nNwwxk0XOKI21MVH04pGUL')
280
- * .then((events) => console.log(events))
281
- * .catch((err) => console.log(err));
282
- */
283
-
284
- }, {
285
- key: 'getEventTypesByClientId',
286
- value: function getEventTypesByClientId(clientId, paginationOptions) {
287
- if (!clientId) {
288
- return Promise.reject(new Error('A client ID is required for getting types'));
289
- }
290
-
291
- return this._request.get(this._baseUrl + '/clients/' + clientId + '/types', {
292
- params: toSnakeCase(paginationOptions)
293
- }).then(function (response) {
294
- return formatPaginatedDataFromServer(response);
295
- });
2130
+ /**
2131
+ * Gets all event types for a client
2132
+ *
2133
+ * API Endpoint: '/clients/:clientId/types'
2134
+ * Method: GET
2135
+ *
2136
+ * @param {string} clientId The ID of the client
2137
+ * @param {PaginationOptions} [paginationOptions]
2138
+ *
2139
+ * @returns {Promise}
2140
+ * @fulfill {EventTypesFromServer} Event types from the server
2141
+ * @reject {Error}
2142
+ *
2143
+ * @example
2144
+ * contxtSdk.events
2145
+ * .getEventTypesByClientId('CW4B1Ih6M1nNwwxk0XOKI21MVH04pGUL')
2146
+ * .then((events) => console.log(events))
2147
+ * .catch((err) => console.log(err));
2148
+ */
2149
+ getEventTypesByClientId(clientId, paginationOptions) {
2150
+ cov_ybav9ac4q().f[6]++;
2151
+ cov_ybav9ac4q().s[19]++;
2152
+ if (!clientId) {
2153
+ cov_ybav9ac4q().b[4][0]++;
2154
+ cov_ybav9ac4q().s[20]++;
2155
+ return Promise.reject(new Error('A client ID is required for getting types'));
2156
+ } else {
2157
+ cov_ybav9ac4q().b[4][1]++;
296
2158
  }
2159
+ cov_ybav9ac4q().s[21]++;
2160
+ return this._request.get(`${this._baseUrl}/clients/${clientId}/types`, {
2161
+ params: _objects.default.toSnakeCase(paginationOptions)
2162
+ }).then(response => {
2163
+ cov_ybav9ac4q().f[7]++;
2164
+ cov_ybav9ac4q().s[22]++;
2165
+ return _pagination.default.formatPaginatedDataFromServer(response);
2166
+ });
2167
+ }
297
2168
 
298
- /**
299
- * Gets all events by type
300
- *
301
- * API Endpoint: '/types/:typeId/events'
302
- * Method: GET
303
- *
304
- * @param {string} eventTypeId The ID of the type
305
- * @param {number} [eventsFilters.facilityId] ID of facility to restrict event types to
306
- * @param {string[]} [eventsFilters.include] List of additional information to be included in the results. Possible options are: 'triggered.latest'
307
- * @param {number} [eventsFilters.limit] Maximum number of records to return per query
308
- * @param {number} [eventsFilters.offset] How many records from the first record to start the query
309
- * @param {boolean} [latest = false] A boolean to determine if we only want to receive the most recent
310
- *
311
- * @returns {Promise}
312
- * @fulfill {EventsFromServer} Event from server
313
- * @reject {Error}
314
- *
315
- * @example
316
- * contxtSdk.events
317
- * .getEventsByTypeId(
318
- * '3e9b572b-6b39-4dd5-a9e5-075095eb0867',
319
- * {
320
- * limit: 10,
321
- * offset: 0,
322
- * include: ['triggered.latest']
323
- * }
324
- * )
325
- * .then((events) => console.log(events))
326
- * .catch((err) => console.log(err));
327
- */
328
-
329
- }, {
330
- key: 'getEventsByTypeId',
331
- value: function getEventsByTypeId(eventTypeId) {
332
- var eventFilters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
333
-
334
- if (!eventTypeId) {
335
- return Promise.reject(new Error('A type ID is required for getting events'));
336
- }
337
-
338
- return this._request.get(this._baseUrl + '/types/' + eventTypeId + '/events', {
339
- params: toSnakeCase(eventFilters)
340
- }).then(function (events) {
341
- return formatPaginatedDataFromServer(events);
342
- });
2169
+ /**
2170
+ * Gets all events by type
2171
+ *
2172
+ * API Endpoint: '/types/:typeId/events'
2173
+ * Method: GET
2174
+ *
2175
+ * @param {string} eventTypeId The ID of the type
2176
+ * @param {number} [eventsFilters.facilityId] ID of facility to restrict event types to
2177
+ * @param {string[]} [eventsFilters.include] List of additional information to be included in the results. Possible options are: 'triggered.latest'
2178
+ * @param {number} [eventsFilters.limit] Maximum number of records to return per query
2179
+ * @param {number} [eventsFilters.offset] How many records from the first record to start the query
2180
+ * @param {boolean} [latest = false] A boolean to determine if we only want to receive the most recent
2181
+ *
2182
+ * @returns {Promise}
2183
+ * @fulfill {EventsFromServer} Event from server
2184
+ * @reject {Error}
2185
+ *
2186
+ * @example
2187
+ * contxtSdk.events
2188
+ * .getEventsByTypeId(
2189
+ * '3e9b572b-6b39-4dd5-a9e5-075095eb0867',
2190
+ * {
2191
+ * limit: 10,
2192
+ * offset: 0,
2193
+ * include: ['triggered.latest']
2194
+ * }
2195
+ * )
2196
+ * .then((events) => console.log(events))
2197
+ * .catch((err) => console.log(err));
2198
+ */
2199
+ getEventsByTypeId(eventTypeId) {
2200
+ let eventFilters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_ybav9ac4q().b[5][0]++, {});
2201
+ cov_ybav9ac4q().f[8]++;
2202
+ cov_ybav9ac4q().s[23]++;
2203
+ if (!eventTypeId) {
2204
+ cov_ybav9ac4q().b[6][0]++;
2205
+ cov_ybav9ac4q().s[24]++;
2206
+ return Promise.reject(new Error('A type ID is required for getting events'));
2207
+ } else {
2208
+ cov_ybav9ac4q().b[6][1]++;
343
2209
  }
2210
+ cov_ybav9ac4q().s[25]++;
2211
+ return this._request.get(`${this._baseUrl}/types/${eventTypeId}/events`, {
2212
+ params: _objects.default.toSnakeCase(eventFilters)
2213
+ }).then(events => {
2214
+ cov_ybav9ac4q().f[9]++;
2215
+ cov_ybav9ac4q().s[26]++;
2216
+ return _pagination.default.formatPaginatedDataFromServer(events);
2217
+ });
2218
+ }
344
2219
 
345
- /**
346
- * Gets a paginated list of triggered events for a given facility.
347
- * @param {Number} facilityId The ID of the facility
348
- * @param {Object} [triggeredEventFilters]
349
- * @param {boolean} [triggeredEventFilters.eventTypeId] Will filter records by a particular event type ID
350
- * @param {number} [triggeredEventFilters.limit] Maximum number of records to return per query
351
- * @param {number} [triggeredEventFilters.offset] How many records from the first record to start the query
352
- * @param {string} [triggeredEventFilters.orderBy] The triggered field to sort the response records by in ascending order
353
- * @param {boolean} [triggeredEventFilters.reverseOrder] If true, results will be sorted in descending order
354
- *
355
- * @returns {Promise}
356
- * @fulfill {TriggeredEventsFromServer} Triggered Events from server
357
- * @reject {Error}
358
- *
359
- */
360
-
361
- }, {
362
- key: 'getTriggeredEventsByFacilityId',
363
- value: function getTriggeredEventsByFacilityId(facilityId) {
364
- var triggeredEventFilters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
365
-
366
- if (!facilityId) {
367
- return Promise.reject(new Error('A facility ID is required for getting triggered events'));
368
- }
369
-
370
- return this._request.get(this._baseUrl + '/facilities/' + facilityId + '/triggered-events', {
371
- params: toSnakeCase(triggeredEventFilters, {
372
- deep: true,
373
- excludeTransform: ['orderBy', 'reverseOrder']
374
- })
375
- }).then(function (events) {
376
- return formatPaginatedDataFromServer(events);
377
- });
2220
+ /**
2221
+ * Gets a paginated list of triggered events for a given facility.
2222
+ * @param {Number} facilityId The ID of the facility
2223
+ * @param {Object} [triggeredEventFilters]
2224
+ * @param {boolean} [triggeredEventFilters.eventTypeId] Will filter records by a particular event type ID
2225
+ * @param {number} [triggeredEventFilters.limit] Maximum number of records to return per query
2226
+ * @param {number} [triggeredEventFilters.offset] How many records from the first record to start the query
2227
+ * @param {string} [triggeredEventFilters.orderBy] The triggered field to sort the response records by in ascending order
2228
+ * @param {boolean} [triggeredEventFilters.reverseOrder] If true, results will be sorted in descending order
2229
+ *
2230
+ * @returns {Promise}
2231
+ * @fulfill {TriggeredEventsFromServer} Triggered Events from server
2232
+ * @reject {Error}
2233
+ *
2234
+ */
2235
+ getTriggeredEventsByFacilityId(facilityId) {
2236
+ let triggeredEventFilters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_ybav9ac4q().b[7][0]++, {});
2237
+ cov_ybav9ac4q().f[10]++;
2238
+ cov_ybav9ac4q().s[27]++;
2239
+ if (!facilityId) {
2240
+ cov_ybav9ac4q().b[8][0]++;
2241
+ cov_ybav9ac4q().s[28]++;
2242
+ return Promise.reject(new Error('A facility ID is required for getting triggered events'));
2243
+ } else {
2244
+ cov_ybav9ac4q().b[8][1]++;
378
2245
  }
2246
+ cov_ybav9ac4q().s[29]++;
2247
+ return this._request.get(`${this._baseUrl}/facilities/${facilityId}/triggered-events`, {
2248
+ params: _objects.default.toSnakeCase(triggeredEventFilters, {
2249
+ deep: true,
2250
+ excludeTransform: ['orderBy', 'reverseOrder']
2251
+ })
2252
+ }).then(events => {
2253
+ cov_ybav9ac4q().f[11]++;
2254
+ cov_ybav9ac4q().s[30]++;
2255
+ return _pagination.default.formatPaginatedDataFromServer(events);
2256
+ });
2257
+ }
379
2258
 
380
- /**
381
- * Gets information about a contxt user with additional information related to event subscriptions
382
- *
383
- * API Endpoint: '/users/:userId'
384
- * Method: GET
385
- *
386
- * @param {string} userId The ID of the user
387
- *
388
- * @returns {Promise}
389
- * @fulfill {EventUser} Information about an event user
390
- * @reject {Error}
391
- *
392
- * @example
393
- * contxtSdk.events
394
- * .getUserInfo('auth0|saklafjheuaiweh')
395
- * .then((user) => console.log(user))
396
- * .catch((err) => console.log(err));
397
- */
398
-
399
- }, {
400
- key: 'getUserInfo',
401
- value: function getUserInfo(userId) {
402
- if (!userId) {
403
- return Promise.reject(new Error('A user ID is required for getting information about a user'));
404
- }
405
-
406
- return this._request.get(this._baseUrl + '/users/' + userId).then(function (user) {
407
- return toCamelCase(user);
408
- });
2259
+ /**
2260
+ * Gets information about a contxt user with additional information related to event subscriptions
2261
+ *
2262
+ * API Endpoint: '/users/:userId'
2263
+ * Method: GET
2264
+ *
2265
+ * @param {string} userId The ID of the user
2266
+ *
2267
+ * @returns {Promise}
2268
+ * @fulfill {EventUser} Information about an event user
2269
+ * @reject {Error}
2270
+ *
2271
+ * @example
2272
+ * contxtSdk.events
2273
+ * .getUserInfo('auth0|saklafjheuaiweh')
2274
+ * .then((user) => console.log(user))
2275
+ * .catch((err) => console.log(err));
2276
+ */
2277
+ getUserInfo(userId) {
2278
+ cov_ybav9ac4q().f[12]++;
2279
+ cov_ybav9ac4q().s[31]++;
2280
+ if (!userId) {
2281
+ cov_ybav9ac4q().b[9][0]++;
2282
+ cov_ybav9ac4q().s[32]++;
2283
+ return Promise.reject(new Error('A user ID is required for getting information about a user'));
2284
+ } else {
2285
+ cov_ybav9ac4q().b[9][1]++;
409
2286
  }
2287
+ cov_ybav9ac4q().s[33]++;
2288
+ return this._request.get(`${this._baseUrl}/users/${userId}`).then(user => {
2289
+ cov_ybav9ac4q().f[13]++;
2290
+ cov_ybav9ac4q().s[34]++;
2291
+ return _objects.default.toCamelCase(user);
2292
+ });
2293
+ }
410
2294
 
411
- /**
412
- * Subscribes an user to an event
413
- *
414
- * API Endpoint: '/users/:userId/events/:event_id'
415
- * Method: POST
416
- *
417
- * @param {string} userId The ID of the user
418
- * @param {string} eventId The ID of the event
419
- * @param {Object} subscribeOpts Optional parameters to provide when subscribing the user
420
- *
421
- * @returns {Promise}
422
- * @fulfill {UserEventSubscription} The newly created user event
423
- * @reject {Error}
424
- *
425
- * @example
426
- * contxtSdk.events
427
- * .subscribeUser('auth0|saklafjheuaiweh', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
428
- * .then((userEvent) => console.log(userEvent))
429
- * .catch((err) => console.log(err));
430
- */
431
-
432
- }, {
433
- key: 'subscribeUser',
434
- value: function subscribeUser(userId, eventId) {
435
- var subscribeOpts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
436
-
437
- if (!userId) {
438
- return Promise.reject(new Error('A user ID is required for subscribing a user to an event'));
439
- }
440
-
441
- if (!eventId) {
442
- return Promise.reject(new Error('An event ID is required for subscribing a user to an event'));
443
- }
444
-
445
- return this._request.post(this._baseUrl + '/users/' + userId + '/events/' + eventId, toSnakeCase(subscribeOpts)).then(function (response) {
446
- return toCamelCase(response);
447
- });
2295
+ /**
2296
+ * Subscribes an user to an event
2297
+ *
2298
+ * API Endpoint: '/users/:userId/events/:event_id'
2299
+ * Method: POST
2300
+ *
2301
+ * @param {string} userId The ID of the user
2302
+ * @param {string} eventId The ID of the event
2303
+ * @param {Object} subscribeOpts Optional parameters to provide when subscribing the user
2304
+ *
2305
+ * @returns {Promise}
2306
+ * @fulfill {UserEventSubscription} The newly created user event
2307
+ * @reject {Error}
2308
+ *
2309
+ * @example
2310
+ * contxtSdk.events
2311
+ * .subscribeUser('auth0|saklafjheuaiweh', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
2312
+ * .then((userEvent) => console.log(userEvent))
2313
+ * .catch((err) => console.log(err));
2314
+ */
2315
+ subscribeUser(userId, eventId) {
2316
+ let subscribeOpts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (cov_ybav9ac4q().b[10][0]++, {});
2317
+ cov_ybav9ac4q().f[14]++;
2318
+ cov_ybav9ac4q().s[35]++;
2319
+ if (!userId) {
2320
+ cov_ybav9ac4q().b[11][0]++;
2321
+ cov_ybav9ac4q().s[36]++;
2322
+ return Promise.reject(new Error('A user ID is required for subscribing a user to an event'));
2323
+ } else {
2324
+ cov_ybav9ac4q().b[11][1]++;
448
2325
  }
449
-
450
- /**
451
- * Removes an event subscription from a user
452
- *
453
- * API Endpoint: '/users/:userId/subscriptions/:user_event_subscription_id'
454
- * Method: DELETE
455
- *
456
- * @param {string} userId The ID of the user
457
- * @param {string} userEventSubscriptionId The ID of the user event subscription
458
- *
459
- * @returns {Promise}
460
- * @fulfill {undefined}
461
- * @reject {Error}
462
- *
463
- * @example
464
- * contxtSdk.events
465
- * .unsubscribeUser('auth0|saklafjheuaiweh', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
466
- * .catch((err) => console.log(err));
467
- */
468
-
469
- }, {
470
- key: 'unsubscribeUser',
471
- value: function unsubscribeUser(userId, userEventSubscriptionId) {
472
- if (!userId) {
473
- return Promise.reject(new Error('A user ID is required to unsubscribe a user from an event'));
474
- }
475
-
476
- if (!userEventSubscriptionId) {
477
- return Promise.reject(new Error('A user event subscription ID is required for unsubscribing a user from an event'));
478
- }
479
-
480
- return this._request.delete(this._baseUrl + '/users/' + userId + '/subscriptions/' + userEventSubscriptionId);
2326
+ cov_ybav9ac4q().s[37]++;
2327
+ if (!eventId) {
2328
+ cov_ybav9ac4q().b[12][0]++;
2329
+ cov_ybav9ac4q().s[38]++;
2330
+ return Promise.reject(new Error('An event ID is required for subscribing a user to an event'));
2331
+ } else {
2332
+ cov_ybav9ac4q().b[12][1]++;
481
2333
  }
2334
+ cov_ybav9ac4q().s[39]++;
2335
+ return this._request.post(`${this._baseUrl}/users/${userId}/events/${eventId}`, _objects.default.toSnakeCase(subscribeOpts)).then(response => {
2336
+ cov_ybav9ac4q().f[15]++;
2337
+ cov_ybav9ac4q().s[40]++;
2338
+ return _objects.default.toCamelCase(response);
2339
+ });
2340
+ }
482
2341
 
483
- /**
484
- * Updates an event
485
- *
486
- * API Endpoint: '/events/:eventId'
487
- * Method: PUT
488
- *
489
- * @param {number} eventId The ID of the event to update
490
- * @param {Object} update An object containing the updated data for the event
491
- * @param {number} [update.facilityId]
492
- * @param {boolean} [update.isPublic]
493
- * @param {string} [update.name]
494
- *
495
- * @returns {Promise}
496
- * @fulfill {undefined}
497
- * @reject {Error}
498
- *
499
- * @example
500
- * contxtSdk.events.update('875afddd-091c-4385-bc21-0edf38804d27', {
501
- * name: 'Sgt. Pepper's Lonely Hearts Club Band Event'
502
- * });
503
- */
504
-
505
- }, {
506
- key: 'update',
507
- value: function update(eventId, _update) {
508
- if (!eventId) {
509
- return Promise.reject(new Error('An event ID is required to update an event.'));
510
- }
511
-
512
- if (!_update) {
513
- return Promise.reject(new Error('An update is required to update an event.'));
514
- }
515
-
516
- if (!isPlainObject(_update)) {
517
- return Promise.reject(new Error('The event update must be a well-formed object with the data you wish to update.'));
518
- }
519
-
520
- var formattedUpdate = formatEventUpdateToServer(_update);
521
-
522
- return this._request.put(this._baseUrl + '/events/' + eventId, formattedUpdate);
2342
+ /**
2343
+ * Removes an event subscription from a user
2344
+ *
2345
+ * API Endpoint: '/users/:userId/subscriptions/:user_event_subscription_id'
2346
+ * Method: DELETE
2347
+ *
2348
+ * @param {string} userId The ID of the user
2349
+ * @param {string} userEventSubscriptionId The ID of the user event subscription
2350
+ *
2351
+ * @returns {Promise}
2352
+ * @fulfill {undefined}
2353
+ * @reject {Error}
2354
+ *
2355
+ * @example
2356
+ * contxtSdk.events
2357
+ * .unsubscribeUser('auth0|saklafjheuaiweh', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
2358
+ * .catch((err) => console.log(err));
2359
+ */
2360
+ unsubscribeUser(userId, userEventSubscriptionId) {
2361
+ cov_ybav9ac4q().f[16]++;
2362
+ cov_ybav9ac4q().s[41]++;
2363
+ if (!userId) {
2364
+ cov_ybav9ac4q().b[13][0]++;
2365
+ cov_ybav9ac4q().s[42]++;
2366
+ return Promise.reject(new Error('A user ID is required to unsubscribe a user from an event'));
2367
+ } else {
2368
+ cov_ybav9ac4q().b[13][1]++;
523
2369
  }
2370
+ cov_ybav9ac4q().s[43]++;
2371
+ if (!userEventSubscriptionId) {
2372
+ cov_ybav9ac4q().b[14][0]++;
2373
+ cov_ybav9ac4q().s[44]++;
2374
+ return Promise.reject(new Error('A user event subscription ID is required for unsubscribing a user from an event'));
2375
+ } else {
2376
+ cov_ybav9ac4q().b[14][1]++;
2377
+ }
2378
+ cov_ybav9ac4q().s[45]++;
2379
+ return this._request.delete(`${this._baseUrl}/users/${userId}/subscriptions/${userEventSubscriptionId}`);
2380
+ }
524
2381
 
525
- /**
526
- * Creates a new event type
527
- *
528
- * API Endpoint: '/types'
529
- * Method: POST
530
- *
531
- * @param {Object} eventType
532
- * @param {string} eventType.name
533
- * @param {string} eventType.description
534
- * @param {number} [eventType.level] Priority level associated with event type
535
- * @param {string} eventType.clientId UUID corresponding with the client
536
- * @param {string} eventType.slug Unique per clientId to identify the event type
537
- * @param {boolean} eventType.isRealtimeEnabled Flag for if the event is real time
538
- * @param {boolean} eventType.isOngoingEvent Flag for if the event is ongoing/updated frequently
539
- *
540
- * @returns {Promise}
541
- * @fulfill {EventType} Information about the new event type
542
- * @reject {Error}
543
- *
544
- * @example
545
- * contxtSdk.events
546
- * .createEventType({
547
- * name: 'Example name',
548
- * description: 'Example description',
549
- * level: 2,
550
- * clientId: 'd47e5699-cc17-4631-a2c5-6cefceb7863d',
551
- * slug: 'example_slug',
552
- * isRealtimeEnabled: false,
553
- * isOngoingEvent: false
554
- * })
555
- * .then((eventType) => console.log(eventType))
556
- * .catch((err) => console.log(err));
557
- */
558
-
559
- }, {
560
- key: 'createEventType',
561
- value: function createEventType() {
562
- var eventType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
563
-
564
- var requiredFields = ['name', 'description', 'clientId', 'slug', 'isRealtimeEnabled', 'isOngoingEvent'];
565
-
566
- for (var i = 0; i < requiredFields.length; i++) {
567
- var field = requiredFields[i];
2382
+ /**
2383
+ * Updates an event
2384
+ *
2385
+ * API Endpoint: '/events/:eventId'
2386
+ * Method: PUT
2387
+ *
2388
+ * @param {number} eventId The ID of the event to update
2389
+ * @param {Object} update An object containing the updated data for the event
2390
+ * @param {number} [update.facilityId]
2391
+ * @param {boolean} [update.isPublic]
2392
+ * @param {string} [update.name]
2393
+ *
2394
+ * @returns {Promise}
2395
+ * @fulfill {undefined}
2396
+ * @reject {Error}
2397
+ *
2398
+ * @example
2399
+ * contxtSdk.events.update('875afddd-091c-4385-bc21-0edf38804d27', {
2400
+ * name: 'Sgt. Pepper's Lonely Hearts Club Band Event'
2401
+ * });
2402
+ */
2403
+ update(eventId, update) {
2404
+ cov_ybav9ac4q().f[17]++;
2405
+ cov_ybav9ac4q().s[46]++;
2406
+ if (!eventId) {
2407
+ cov_ybav9ac4q().b[15][0]++;
2408
+ cov_ybav9ac4q().s[47]++;
2409
+ return Promise.reject(new Error('An event ID is required to update an event.'));
2410
+ } else {
2411
+ cov_ybav9ac4q().b[15][1]++;
2412
+ }
2413
+ cov_ybav9ac4q().s[48]++;
2414
+ if (!update) {
2415
+ cov_ybav9ac4q().b[16][0]++;
2416
+ cov_ybav9ac4q().s[49]++;
2417
+ return Promise.reject(new Error('An update is required to update an event.'));
2418
+ } else {
2419
+ cov_ybav9ac4q().b[16][1]++;
2420
+ }
2421
+ cov_ybav9ac4q().s[50]++;
2422
+ if (!(0, _lodash2.default)(update)) {
2423
+ cov_ybav9ac4q().b[17][0]++;
2424
+ cov_ybav9ac4q().s[51]++;
2425
+ return Promise.reject(new Error('The event update must be a well-formed object with the data you wish to update.'));
2426
+ } else {
2427
+ cov_ybav9ac4q().b[17][1]++;
2428
+ }
2429
+ const formattedUpdate = (cov_ybav9ac4q().s[52]++, _events.default.formatEventUpdateToServer(update));
2430
+ cov_ybav9ac4q().s[53]++;
2431
+ return this._request.put(`${this._baseUrl}/events/${eventId}`, formattedUpdate);
2432
+ }
568
2433
 
569
- if (!has(eventType, field)) {
570
- return Promise.reject(new Error('A ' + field + ' is required to create a new event type.'));
571
- }
2434
+ /**
2435
+ * Creates a new event type
2436
+ *
2437
+ * API Endpoint: '/types'
2438
+ * Method: POST
2439
+ *
2440
+ * @param {Object} eventType
2441
+ * @param {string} eventType.name
2442
+ * @param {string} eventType.description
2443
+ * @param {number} [eventType.level] Priority level associated with event type
2444
+ * @param {string} eventType.clientId UUID corresponding with the client
2445
+ * @param {string} eventType.slug Unique per clientId to identify the event type
2446
+ * @param {boolean} eventType.isRealtimeEnabled Flag for if the event is real time
2447
+ * @param {boolean} eventType.isOngoingEvent Flag for if the event is ongoing/updated frequently
2448
+ *
2449
+ * @returns {Promise}
2450
+ * @fulfill {EventType} Information about the new event type
2451
+ * @reject {Error}
2452
+ *
2453
+ * @example
2454
+ * contxtSdk.events
2455
+ * .createEventType({
2456
+ * name: 'Example name',
2457
+ * description: 'Example description',
2458
+ * level: 2,
2459
+ * clientId: 'd47e5699-cc17-4631-a2c5-6cefceb7863d',
2460
+ * slug: 'example_slug',
2461
+ * isRealtimeEnabled: false,
2462
+ * isOngoingEvent: false
2463
+ * })
2464
+ * .then((eventType) => console.log(eventType))
2465
+ * .catch((err) => console.log(err));
2466
+ */
2467
+ createEventType() {
2468
+ let eventType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (cov_ybav9ac4q().b[18][0]++, {});
2469
+ cov_ybav9ac4q().f[18]++;
2470
+ const requiredFields = (cov_ybav9ac4q().s[54]++, ['name', 'description', 'clientId', 'slug', 'isRealtimeEnabled', 'isOngoingEvent']);
2471
+ cov_ybav9ac4q().s[55]++;
2472
+ for (let i = (cov_ybav9ac4q().s[56]++, 0); i < requiredFields.length; i++) {
2473
+ const field = (cov_ybav9ac4q().s[57]++, requiredFields[i]);
2474
+ cov_ybav9ac4q().s[58]++;
2475
+ if (!(0, _lodash.default)(eventType, field)) {
2476
+ cov_ybav9ac4q().b[19][0]++;
2477
+ cov_ybav9ac4q().s[59]++;
2478
+ return Promise.reject(new Error(`A ${field} is required to create a new event type.`));
2479
+ } else {
2480
+ cov_ybav9ac4q().b[19][1]++;
572
2481
  }
573
-
574
- return this._request.post(this._baseUrl + '/types', toSnakeCase(eventType)).then(function (response) {
575
- return toCamelCase(response);
576
- });
577
2482
  }
578
- }]);
579
-
580
- return Events;
581
- }();
582
-
583
- export default Events;
2483
+ cov_ybav9ac4q().s[60]++;
2484
+ return this._request.post(`${this._baseUrl}/types`, _objects.default.toSnakeCase(eventType)).then(response => {
2485
+ cov_ybav9ac4q().f[19]++;
2486
+ cov_ybav9ac4q().s[61]++;
2487
+ return _objects.default.toCamelCase(response);
2488
+ });
2489
+ }
2490
+ }
2491
+ var _default = exports.default = Events;
584
2492
  //# sourceMappingURL=index.js.map