@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,11 +1,2844 @@
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 axios from 'axios';
6
-
7
- import { toCamelCase, toSnakeCase } from '../utils/objects';
8
-
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ require("core-js/modules/es.array.index-of.js");
8
+ require("core-js/modules/es.promise.js");
9
+ var _axios = _interopRequireDefault(require("axios"));
10
+ var _objects = _interopRequireDefault(require("../utils/objects"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function cov_2h1wdje5oy() {
13
+ var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/coordinator/users.js";
14
+ var hash = "a4ef338f33a4aee99179e97c157edeb78fdcdb4a";
15
+ var global = new Function("return this")();
16
+ var gcv = "__coverage__";
17
+ var coverageData = {
18
+ path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/coordinator/users.js",
19
+ statementMap: {
20
+ "0": {
21
+ start: {
22
+ line: 69,
23
+ column: 4
24
+ },
25
+ end: {
26
+ line: 69,
27
+ column: 28
28
+ }
29
+ },
30
+ "1": {
31
+ start: {
32
+ line: 70,
33
+ column: 4
34
+ },
35
+ end: {
36
+ line: 70,
37
+ column: 40
38
+ }
39
+ },
40
+ "2": {
41
+ start: {
42
+ line: 71,
43
+ column: 4
44
+ },
45
+ end: {
46
+ line: 71,
47
+ column: 40
48
+ }
49
+ },
50
+ "3": {
51
+ start: {
52
+ line: 72,
53
+ column: 4
54
+ },
55
+ end: {
56
+ line: 72,
57
+ column: 28
58
+ }
59
+ },
60
+ "4": {
61
+ start: {
62
+ line: 73,
63
+ column: 4
64
+ },
65
+ end: {
66
+ line: 73,
67
+ column: 20
68
+ }
69
+ },
70
+ "5": {
71
+ start: {
72
+ line: 74,
73
+ column: 4
74
+ },
75
+ end: {
76
+ line: 74,
77
+ column: 42
78
+ }
79
+ },
80
+ "6": {
81
+ start: {
82
+ line: 78,
83
+ column: 4
84
+ },
85
+ end: {
86
+ line: 87,
87
+ column: 5
88
+ }
89
+ },
90
+ "7": {
91
+ start: {
92
+ line: 80,
93
+ column: 8
94
+ },
95
+ end: {
96
+ line: 80,
97
+ column: 52
98
+ }
99
+ },
100
+ "8": {
101
+ start: {
102
+ line: 83,
103
+ column: 8
104
+ },
105
+ end: {
106
+ line: 83,
107
+ column: 29
108
+ }
109
+ },
110
+ "9": {
111
+ start: {
112
+ line: 86,
113
+ column: 8
114
+ },
115
+ end: {
116
+ line: 86,
117
+ column: 52
118
+ }
119
+ },
120
+ "10": {
121
+ start: {
122
+ line: 119,
123
+ column: 4
124
+ },
125
+ end: {
126
+ line: 123,
127
+ column: 5
128
+ }
129
+ },
130
+ "11": {
131
+ start: {
132
+ line: 120,
133
+ column: 6
134
+ },
135
+ end: {
136
+ line: 122,
137
+ column: 8
138
+ }
139
+ },
140
+ "12": {
141
+ start: {
142
+ line: 125,
143
+ column: 27
144
+ },
145
+ end: {
146
+ line: 125,
147
+ column: 61
148
+ }
149
+ },
150
+ "13": {
151
+ start: {
152
+ line: 127,
153
+ column: 4
154
+ },
155
+ end: {
156
+ line: 135,
157
+ column: 5
158
+ }
159
+ },
160
+ "14": {
161
+ start: {
162
+ line: 127,
163
+ column: 17
164
+ },
165
+ end: {
166
+ line: 127,
167
+ column: 18
168
+ }
169
+ },
170
+ "15": {
171
+ start: {
172
+ line: 128,
173
+ column: 20
174
+ },
175
+ end: {
176
+ line: 128,
177
+ column: 37
178
+ }
179
+ },
180
+ "16": {
181
+ start: {
182
+ line: 130,
183
+ column: 6
184
+ },
185
+ end: {
186
+ line: 134,
187
+ column: 7
188
+ }
189
+ },
190
+ "17": {
191
+ start: {
192
+ line: 131,
193
+ column: 8
194
+ },
195
+ end: {
196
+ line: 133,
197
+ column: 10
198
+ }
199
+ },
200
+ "18": {
201
+ start: {
202
+ line: 138,
203
+ column: 4
204
+ },
205
+ end: {
206
+ line: 141,
207
+ column: 6
208
+ }
209
+ },
210
+ "19": {
211
+ start: {
212
+ line: 164,
213
+ column: 4
214
+ },
215
+ end: {
216
+ line: 168,
217
+ column: 5
218
+ }
219
+ },
220
+ "20": {
221
+ start: {
222
+ line: 165,
223
+ column: 6
224
+ },
225
+ end: {
226
+ line: 167,
227
+ column: 8
228
+ }
229
+ },
230
+ "21": {
231
+ start: {
232
+ line: 170,
233
+ column: 4
234
+ },
235
+ end: {
236
+ line: 176,
237
+ column: 5
238
+ }
239
+ },
240
+ "22": {
241
+ start: {
242
+ line: 171,
243
+ column: 6
244
+ },
245
+ end: {
246
+ line: 175,
247
+ column: 8
248
+ }
249
+ },
250
+ "23": {
251
+ start: {
252
+ line: 178,
253
+ column: 4
254
+ },
255
+ end: {
256
+ line: 182,
257
+ column: 61
258
+ }
259
+ },
260
+ "24": {
261
+ start: {
262
+ line: 182,
263
+ column: 26
264
+ },
265
+ end: {
266
+ line: 182,
267
+ column: 59
268
+ }
269
+ },
270
+ "25": {
271
+ start: {
272
+ line: 205,
273
+ column: 4
274
+ },
275
+ end: {
276
+ line: 209,
277
+ column: 5
278
+ }
279
+ },
280
+ "26": {
281
+ start: {
282
+ line: 206,
283
+ column: 6
284
+ },
285
+ end: {
286
+ line: 208,
287
+ column: 8
288
+ }
289
+ },
290
+ "27": {
291
+ start: {
292
+ line: 211,
293
+ column: 4
294
+ },
295
+ end: {
296
+ line: 215,
297
+ column: 5
298
+ }
299
+ },
300
+ "28": {
301
+ start: {
302
+ line: 212,
303
+ column: 6
304
+ },
305
+ end: {
306
+ line: 214,
307
+ column: 8
308
+ }
309
+ },
310
+ "29": {
311
+ start: {
312
+ line: 217,
313
+ column: 4
314
+ },
315
+ end: {
316
+ line: 219,
317
+ column: 61
318
+ }
319
+ },
320
+ "30": {
321
+ start: {
322
+ line: 219,
323
+ column: 26
324
+ },
325
+ end: {
326
+ line: 219,
327
+ column: 59
328
+ }
329
+ },
330
+ "31": {
331
+ start: {
332
+ line: 243,
333
+ column: 4
334
+ },
335
+ end: {
336
+ line: 249,
337
+ column: 5
338
+ }
339
+ },
340
+ "32": {
341
+ start: {
342
+ line: 244,
343
+ column: 6
344
+ },
345
+ end: {
346
+ line: 248,
347
+ column: 8
348
+ }
349
+ },
350
+ "33": {
351
+ start: {
352
+ line: 251,
353
+ column: 4
354
+ },
355
+ end: {
356
+ line: 257,
357
+ column: 5
358
+ }
359
+ },
360
+ "34": {
361
+ start: {
362
+ line: 252,
363
+ column: 6
364
+ },
365
+ end: {
366
+ line: 256,
367
+ column: 8
368
+ }
369
+ },
370
+ "35": {
371
+ start: {
372
+ line: 259,
373
+ column: 4
374
+ },
375
+ end: {
376
+ line: 265,
377
+ column: 5
378
+ }
379
+ },
380
+ "36": {
381
+ start: {
382
+ line: 260,
383
+ column: 6
384
+ },
385
+ end: {
386
+ line: 264,
387
+ column: 8
388
+ }
389
+ },
390
+ "37": {
391
+ start: {
392
+ line: 267,
393
+ column: 4
394
+ },
395
+ end: {
396
+ line: 274,
397
+ column: 61
398
+ }
399
+ },
400
+ "38": {
401
+ start: {
402
+ line: 274,
403
+ column: 26
404
+ },
405
+ end: {
406
+ line: 274,
407
+ column: 59
408
+ }
409
+ },
410
+ "39": {
411
+ start: {
412
+ line: 296,
413
+ column: 4
414
+ },
415
+ end: {
416
+ line: 300,
417
+ column: 5
418
+ }
419
+ },
420
+ "40": {
421
+ start: {
422
+ line: 297,
423
+ column: 6
424
+ },
425
+ end: {
426
+ line: 299,
427
+ column: 8
428
+ }
429
+ },
430
+ "41": {
431
+ start: {
432
+ line: 302,
433
+ column: 4
434
+ },
435
+ end: {
436
+ line: 304,
437
+ column: 53
438
+ }
439
+ },
440
+ "42": {
441
+ start: {
442
+ line: 304,
443
+ column: 22
444
+ },
445
+ end: {
446
+ line: 304,
447
+ column: 51
448
+ }
449
+ },
450
+ "43": {
451
+ start: {
452
+ line: 327,
453
+ column: 4
454
+ },
455
+ end: {
456
+ line: 331,
457
+ column: 5
458
+ }
459
+ },
460
+ "44": {
461
+ start: {
462
+ line: 328,
463
+ column: 6
464
+ },
465
+ end: {
466
+ line: 330,
467
+ column: 63
468
+ }
469
+ },
470
+ "45": {
471
+ start: {
472
+ line: 330,
473
+ column: 28
474
+ },
475
+ end: {
476
+ line: 330,
477
+ column: 61
478
+ }
479
+ },
480
+ "46": {
481
+ start: {
482
+ line: 333,
483
+ column: 4
484
+ },
485
+ end: {
486
+ line: 339,
487
+ column: 5
488
+ }
489
+ },
490
+ "47": {
491
+ start: {
492
+ line: 334,
493
+ column: 6
494
+ },
495
+ end: {
496
+ line: 338,
497
+ column: 8
498
+ }
499
+ },
500
+ "48": {
501
+ start: {
502
+ line: 341,
503
+ column: 4
504
+ },
505
+ end: {
506
+ line: 345,
507
+ column: 61
508
+ }
509
+ },
510
+ "49": {
511
+ start: {
512
+ line: 345,
513
+ column: 26
514
+ },
515
+ end: {
516
+ line: 345,
517
+ column: 59
518
+ }
519
+ },
520
+ "50": {
521
+ start: {
522
+ line: 384,
523
+ column: 4
524
+ },
525
+ end: {
526
+ line: 400,
527
+ column: 5
528
+ }
529
+ },
530
+ "51": {
531
+ start: {
532
+ line: 385,
533
+ column: 29
534
+ },
535
+ end: {
536
+ line: 385,
537
+ column: 78
538
+ }
539
+ },
540
+ "52": {
541
+ start: {
542
+ line: 387,
543
+ column: 6
544
+ },
545
+ end: {
546
+ line: 395,
547
+ column: 7
548
+ }
549
+ },
550
+ "53": {
551
+ start: {
552
+ line: 387,
553
+ column: 19
554
+ },
555
+ end: {
556
+ line: 387,
557
+ column: 20
558
+ }
559
+ },
560
+ "54": {
561
+ start: {
562
+ line: 388,
563
+ column: 22
564
+ },
565
+ end: {
566
+ line: 388,
567
+ column: 39
568
+ }
569
+ },
570
+ "55": {
571
+ start: {
572
+ line: 390,
573
+ column: 8
574
+ },
575
+ end: {
576
+ line: 394,
577
+ column: 9
578
+ }
579
+ },
580
+ "56": {
581
+ start: {
582
+ line: 391,
583
+ column: 10
584
+ },
585
+ end: {
586
+ line: 393,
587
+ column: 12
588
+ }
589
+ },
590
+ "57": {
591
+ start: {
592
+ line: 397,
593
+ column: 6
594
+ },
595
+ end: {
596
+ line: 399,
597
+ column: 63
598
+ }
599
+ },
600
+ "58": {
601
+ start: {
602
+ line: 399,
603
+ column: 28
604
+ },
605
+ end: {
606
+ line: 399,
607
+ column: 61
608
+ }
609
+ },
610
+ "59": {
611
+ start: {
612
+ line: 402,
613
+ column: 4
614
+ },
615
+ end: {
616
+ line: 406,
617
+ column: 5
618
+ }
619
+ },
620
+ "60": {
621
+ start: {
622
+ line: 403,
623
+ column: 6
624
+ },
625
+ end: {
626
+ line: 405,
627
+ column: 8
628
+ }
629
+ },
630
+ "61": {
631
+ start: {
632
+ line: 408,
633
+ column: 27
634
+ },
635
+ end: {
636
+ line: 408,
637
+ column: 76
638
+ }
639
+ },
640
+ "62": {
641
+ start: {
642
+ line: 410,
643
+ column: 4
644
+ },
645
+ end: {
646
+ line: 418,
647
+ column: 5
648
+ }
649
+ },
650
+ "63": {
651
+ start: {
652
+ line: 410,
653
+ column: 17
654
+ },
655
+ end: {
656
+ line: 410,
657
+ column: 18
658
+ }
659
+ },
660
+ "64": {
661
+ start: {
662
+ line: 411,
663
+ column: 20
664
+ },
665
+ end: {
666
+ line: 411,
667
+ column: 37
668
+ }
669
+ },
670
+ "65": {
671
+ start: {
672
+ line: 413,
673
+ column: 6
674
+ },
675
+ end: {
676
+ line: 417,
677
+ column: 7
678
+ }
679
+ },
680
+ "66": {
681
+ start: {
682
+ line: 414,
683
+ column: 8
684
+ },
685
+ end: {
686
+ line: 416,
687
+ column: 10
688
+ }
689
+ },
690
+ "67": {
691
+ start: {
692
+ line: 420,
693
+ column: 4
694
+ },
695
+ end: {
696
+ line: 425,
697
+ column: 61
698
+ }
699
+ },
700
+ "68": {
701
+ start: {
702
+ line: 425,
703
+ column: 26
704
+ },
705
+ end: {
706
+ line: 425,
707
+ column: 59
708
+ }
709
+ },
710
+ "69": {
711
+ start: {
712
+ line: 448,
713
+ column: 4
714
+ },
715
+ end: {
716
+ line: 458,
717
+ column: 5
718
+ }
719
+ },
720
+ "70": {
721
+ start: {
722
+ line: 449,
723
+ column: 6
724
+ },
725
+ end: {
726
+ line: 455,
727
+ column: 7
728
+ }
729
+ },
730
+ "71": {
731
+ start: {
732
+ line: 450,
733
+ column: 8
734
+ },
735
+ end: {
736
+ line: 454,
737
+ column: 10
738
+ }
739
+ },
740
+ "72": {
741
+ start: {
742
+ line: 457,
743
+ column: 6
744
+ },
745
+ end: {
746
+ line: 457,
747
+ column: 75
748
+ }
749
+ },
750
+ "73": {
751
+ start: {
752
+ line: 460,
753
+ column: 4
754
+ },
755
+ end: {
756
+ line: 466,
757
+ column: 5
758
+ }
759
+ },
760
+ "74": {
761
+ start: {
762
+ line: 461,
763
+ column: 6
764
+ },
765
+ end: {
766
+ line: 465,
767
+ column: 8
768
+ }
769
+ },
770
+ "75": {
771
+ start: {
772
+ line: 468,
773
+ column: 4
774
+ },
775
+ end: {
776
+ line: 474,
777
+ column: 5
778
+ }
779
+ },
780
+ "76": {
781
+ start: {
782
+ line: 469,
783
+ column: 6
784
+ },
785
+ end: {
786
+ line: 473,
787
+ column: 8
788
+ }
789
+ },
790
+ "77": {
791
+ start: {
792
+ line: 476,
793
+ column: 4
794
+ },
795
+ end: {
796
+ line: 480,
797
+ column: 6
798
+ }
799
+ },
800
+ "78": {
801
+ start: {
802
+ line: 502,
803
+ column: 4
804
+ },
805
+ end: {
806
+ line: 508,
807
+ column: 5
808
+ }
809
+ },
810
+ "79": {
811
+ start: {
812
+ line: 503,
813
+ column: 6
814
+ },
815
+ end: {
816
+ line: 507,
817
+ column: 8
818
+ }
819
+ },
820
+ "80": {
821
+ start: {
822
+ line: 510,
823
+ column: 4
824
+ },
825
+ end: {
826
+ line: 516,
827
+ column: 5
828
+ }
829
+ },
830
+ "81": {
831
+ start: {
832
+ line: 511,
833
+ column: 6
834
+ },
835
+ end: {
836
+ line: 515,
837
+ column: 8
838
+ }
839
+ },
840
+ "82": {
841
+ start: {
842
+ line: 518,
843
+ column: 4
844
+ },
845
+ end: {
846
+ line: 520,
847
+ column: 6
848
+ }
849
+ },
850
+ "83": {
851
+ start: {
852
+ line: 542,
853
+ column: 4
854
+ },
855
+ end: {
856
+ line: 546,
857
+ column: 5
858
+ }
859
+ },
860
+ "84": {
861
+ start: {
862
+ line: 543,
863
+ column: 6
864
+ },
865
+ end: {
866
+ line: 545,
867
+ column: 8
868
+ }
869
+ },
870
+ "85": {
871
+ start: {
872
+ line: 548,
873
+ column: 4
874
+ },
875
+ end: {
876
+ line: 552,
877
+ column: 5
878
+ }
879
+ },
880
+ "86": {
881
+ start: {
882
+ line: 549,
883
+ column: 6
884
+ },
885
+ end: {
886
+ line: 551,
887
+ column: 8
888
+ }
889
+ },
890
+ "87": {
891
+ start: {
892
+ line: 554,
893
+ column: 4
894
+ },
895
+ end: {
896
+ line: 556,
897
+ column: 6
898
+ }
899
+ },
900
+ "88": {
901
+ start: {
902
+ line: 578,
903
+ column: 4
904
+ },
905
+ end: {
906
+ line: 584,
907
+ column: 5
908
+ }
909
+ },
910
+ "89": {
911
+ start: {
912
+ line: 579,
913
+ column: 6
914
+ },
915
+ end: {
916
+ line: 583,
917
+ column: 8
918
+ }
919
+ },
920
+ "90": {
921
+ start: {
922
+ line: 586,
923
+ column: 4
924
+ },
925
+ end: {
926
+ line: 592,
927
+ column: 5
928
+ }
929
+ },
930
+ "91": {
931
+ start: {
932
+ line: 587,
933
+ column: 6
934
+ },
935
+ end: {
936
+ line: 591,
937
+ column: 8
938
+ }
939
+ },
940
+ "92": {
941
+ start: {
942
+ line: 594,
943
+ column: 4
944
+ },
945
+ end: {
946
+ line: 596,
947
+ column: 6
948
+ }
949
+ },
950
+ "93": {
951
+ start: {
952
+ line: 617,
953
+ column: 4
954
+ },
955
+ end: {
956
+ line: 621,
957
+ column: 5
958
+ }
959
+ },
960
+ "94": {
961
+ start: {
962
+ line: 618,
963
+ column: 6
964
+ },
965
+ end: {
966
+ line: 620,
967
+ column: 8
968
+ }
969
+ },
970
+ "95": {
971
+ start: {
972
+ line: 623,
973
+ column: 4
974
+ },
975
+ end: {
976
+ line: 625,
977
+ column: 6
978
+ }
979
+ }
980
+ },
981
+ fnMap: {
982
+ "0": {
983
+ name: "(anonymous_0)",
984
+ decl: {
985
+ start: {
986
+ line: 61,
987
+ column: 2
988
+ },
989
+ end: {
990
+ line: 61,
991
+ column: 3
992
+ }
993
+ },
994
+ loc: {
995
+ start: {
996
+ line: 68,
997
+ column: 4
998
+ },
999
+ end: {
1000
+ line: 75,
1001
+ column: 3
1002
+ }
1003
+ },
1004
+ line: 68
1005
+ },
1006
+ "1": {
1007
+ name: "(anonymous_1)",
1008
+ decl: {
1009
+ start: {
1010
+ line: 77,
1011
+ column: 2
1012
+ },
1013
+ end: {
1014
+ line: 77,
1015
+ column: 3
1016
+ }
1017
+ },
1018
+ loc: {
1019
+ start: {
1020
+ line: 77,
1021
+ column: 20
1022
+ },
1023
+ end: {
1024
+ line: 88,
1025
+ column: 3
1026
+ }
1027
+ },
1028
+ line: 77
1029
+ },
1030
+ "2": {
1031
+ name: "(anonymous_2)",
1032
+ decl: {
1033
+ start: {
1034
+ line: 118,
1035
+ column: 2
1036
+ },
1037
+ end: {
1038
+ line: 118,
1039
+ column: 3
1040
+ }
1041
+ },
1042
+ loc: {
1043
+ start: {
1044
+ line: 118,
1045
+ column: 30
1046
+ },
1047
+ end: {
1048
+ line: 142,
1049
+ column: 3
1050
+ }
1051
+ },
1052
+ line: 118
1053
+ },
1054
+ "3": {
1055
+ name: "(anonymous_3)",
1056
+ decl: {
1057
+ start: {
1058
+ line: 163,
1059
+ column: 2
1060
+ },
1061
+ end: {
1062
+ line: 163,
1063
+ column: 3
1064
+ }
1065
+ },
1066
+ loc: {
1067
+ start: {
1068
+ line: 163,
1069
+ column: 40
1070
+ },
1071
+ end: {
1072
+ line: 183,
1073
+ column: 3
1074
+ }
1075
+ },
1076
+ line: 163
1077
+ },
1078
+ "4": {
1079
+ name: "(anonymous_4)",
1080
+ decl: {
1081
+ start: {
1082
+ line: 182,
1083
+ column: 12
1084
+ },
1085
+ end: {
1086
+ line: 182,
1087
+ column: 13
1088
+ }
1089
+ },
1090
+ loc: {
1091
+ start: {
1092
+ line: 182,
1093
+ column: 26
1094
+ },
1095
+ end: {
1096
+ line: 182,
1097
+ column: 59
1098
+ }
1099
+ },
1100
+ line: 182
1101
+ },
1102
+ "5": {
1103
+ name: "(anonymous_5)",
1104
+ decl: {
1105
+ start: {
1106
+ line: 204,
1107
+ column: 2
1108
+ },
1109
+ end: {
1110
+ line: 204,
1111
+ column: 3
1112
+ }
1113
+ },
1114
+ loc: {
1115
+ start: {
1116
+ line: 204,
1117
+ column: 26
1118
+ },
1119
+ end: {
1120
+ line: 220,
1121
+ column: 3
1122
+ }
1123
+ },
1124
+ line: 204
1125
+ },
1126
+ "6": {
1127
+ name: "(anonymous_6)",
1128
+ decl: {
1129
+ start: {
1130
+ line: 219,
1131
+ column: 12
1132
+ },
1133
+ end: {
1134
+ line: 219,
1135
+ column: 13
1136
+ }
1137
+ },
1138
+ loc: {
1139
+ start: {
1140
+ line: 219,
1141
+ column: 26
1142
+ },
1143
+ end: {
1144
+ line: 219,
1145
+ column: 59
1146
+ }
1147
+ },
1148
+ line: 219
1149
+ },
1150
+ "7": {
1151
+ name: "(anonymous_7)",
1152
+ decl: {
1153
+ start: {
1154
+ line: 242,
1155
+ column: 2
1156
+ },
1157
+ end: {
1158
+ line: 242,
1159
+ column: 3
1160
+ }
1161
+ },
1162
+ loc: {
1163
+ start: {
1164
+ line: 242,
1165
+ column: 66
1166
+ },
1167
+ end: {
1168
+ line: 275,
1169
+ column: 3
1170
+ }
1171
+ },
1172
+ line: 242
1173
+ },
1174
+ "8": {
1175
+ name: "(anonymous_8)",
1176
+ decl: {
1177
+ start: {
1178
+ line: 274,
1179
+ column: 12
1180
+ },
1181
+ end: {
1182
+ line: 274,
1183
+ column: 13
1184
+ }
1185
+ },
1186
+ loc: {
1187
+ start: {
1188
+ line: 274,
1189
+ column: 26
1190
+ },
1191
+ end: {
1192
+ line: 274,
1193
+ column: 59
1194
+ }
1195
+ },
1196
+ line: 274
1197
+ },
1198
+ "9": {
1199
+ name: "(anonymous_9)",
1200
+ decl: {
1201
+ start: {
1202
+ line: 295,
1203
+ column: 2
1204
+ },
1205
+ end: {
1206
+ line: 295,
1207
+ column: 3
1208
+ }
1209
+ },
1210
+ loc: {
1211
+ start: {
1212
+ line: 295,
1213
+ column: 14
1214
+ },
1215
+ end: {
1216
+ line: 305,
1217
+ column: 3
1218
+ }
1219
+ },
1220
+ line: 295
1221
+ },
1222
+ "10": {
1223
+ name: "(anonymous_10)",
1224
+ decl: {
1225
+ start: {
1226
+ line: 304,
1227
+ column: 12
1228
+ },
1229
+ end: {
1230
+ line: 304,
1231
+ column: 13
1232
+ }
1233
+ },
1234
+ loc: {
1235
+ start: {
1236
+ line: 304,
1237
+ column: 22
1238
+ },
1239
+ end: {
1240
+ line: 304,
1241
+ column: 51
1242
+ }
1243
+ },
1244
+ line: 304
1245
+ },
1246
+ "11": {
1247
+ name: "(anonymous_11)",
1248
+ decl: {
1249
+ start: {
1250
+ line: 326,
1251
+ column: 2
1252
+ },
1253
+ end: {
1254
+ line: 326,
1255
+ column: 3
1256
+ }
1257
+ },
1258
+ loc: {
1259
+ start: {
1260
+ line: 326,
1261
+ column: 38
1262
+ },
1263
+ end: {
1264
+ line: 346,
1265
+ column: 3
1266
+ }
1267
+ },
1268
+ line: 326
1269
+ },
1270
+ "12": {
1271
+ name: "(anonymous_12)",
1272
+ decl: {
1273
+ start: {
1274
+ line: 330,
1275
+ column: 14
1276
+ },
1277
+ end: {
1278
+ line: 330,
1279
+ column: 15
1280
+ }
1281
+ },
1282
+ loc: {
1283
+ start: {
1284
+ line: 330,
1285
+ column: 28
1286
+ },
1287
+ end: {
1288
+ line: 330,
1289
+ column: 61
1290
+ }
1291
+ },
1292
+ line: 330
1293
+ },
1294
+ "13": {
1295
+ name: "(anonymous_13)",
1296
+ decl: {
1297
+ start: {
1298
+ line: 345,
1299
+ column: 12
1300
+ },
1301
+ end: {
1302
+ line: 345,
1303
+ column: 13
1304
+ }
1305
+ },
1306
+ loc: {
1307
+ start: {
1308
+ line: 345,
1309
+ column: 26
1310
+ },
1311
+ end: {
1312
+ line: 345,
1313
+ column: 59
1314
+ }
1315
+ },
1316
+ line: 345
1317
+ },
1318
+ "14": {
1319
+ name: "(anonymous_14)",
1320
+ decl: {
1321
+ start: {
1322
+ line: 383,
1323
+ column: 2
1324
+ },
1325
+ end: {
1326
+ line: 383,
1327
+ column: 3
1328
+ }
1329
+ },
1330
+ loc: {
1331
+ start: {
1332
+ line: 383,
1333
+ column: 36
1334
+ },
1335
+ end: {
1336
+ line: 426,
1337
+ column: 3
1338
+ }
1339
+ },
1340
+ line: 383
1341
+ },
1342
+ "15": {
1343
+ name: "(anonymous_15)",
1344
+ decl: {
1345
+ start: {
1346
+ line: 399,
1347
+ column: 14
1348
+ },
1349
+ end: {
1350
+ line: 399,
1351
+ column: 15
1352
+ }
1353
+ },
1354
+ loc: {
1355
+ start: {
1356
+ line: 399,
1357
+ column: 28
1358
+ },
1359
+ end: {
1360
+ line: 399,
1361
+ column: 61
1362
+ }
1363
+ },
1364
+ line: 399
1365
+ },
1366
+ "16": {
1367
+ name: "(anonymous_16)",
1368
+ decl: {
1369
+ start: {
1370
+ line: 425,
1371
+ column: 12
1372
+ },
1373
+ end: {
1374
+ line: 425,
1375
+ column: 13
1376
+ }
1377
+ },
1378
+ loc: {
1379
+ start: {
1380
+ line: 425,
1381
+ column: 26
1382
+ },
1383
+ end: {
1384
+ line: 425,
1385
+ column: 59
1386
+ }
1387
+ },
1388
+ line: 425
1389
+ },
1390
+ "17": {
1391
+ name: "(anonymous_17)",
1392
+ decl: {
1393
+ start: {
1394
+ line: 447,
1395
+ column: 2
1396
+ },
1397
+ end: {
1398
+ line: 447,
1399
+ column: 3
1400
+ }
1401
+ },
1402
+ loc: {
1403
+ start: {
1404
+ line: 447,
1405
+ column: 33
1406
+ },
1407
+ end: {
1408
+ line: 481,
1409
+ column: 3
1410
+ }
1411
+ },
1412
+ line: 447
1413
+ },
1414
+ "18": {
1415
+ name: "(anonymous_18)",
1416
+ decl: {
1417
+ start: {
1418
+ line: 501,
1419
+ column: 2
1420
+ },
1421
+ end: {
1422
+ line: 501,
1423
+ column: 3
1424
+ }
1425
+ },
1426
+ loc: {
1427
+ start: {
1428
+ line: 501,
1429
+ column: 43
1430
+ },
1431
+ end: {
1432
+ line: 521,
1433
+ column: 3
1434
+ }
1435
+ },
1436
+ line: 501
1437
+ },
1438
+ "19": {
1439
+ name: "(anonymous_19)",
1440
+ decl: {
1441
+ start: {
1442
+ line: 541,
1443
+ column: 2
1444
+ },
1445
+ end: {
1446
+ line: 541,
1447
+ column: 3
1448
+ }
1449
+ },
1450
+ loc: {
1451
+ start: {
1452
+ line: 541,
1453
+ column: 29
1454
+ },
1455
+ end: {
1456
+ line: 557,
1457
+ column: 3
1458
+ }
1459
+ },
1460
+ line: 541
1461
+ },
1462
+ "20": {
1463
+ name: "(anonymous_20)",
1464
+ decl: {
1465
+ start: {
1466
+ line: 577,
1467
+ column: 2
1468
+ },
1469
+ end: {
1470
+ line: 577,
1471
+ column: 3
1472
+ }
1473
+ },
1474
+ loc: {
1475
+ start: {
1476
+ line: 577,
1477
+ column: 57
1478
+ },
1479
+ end: {
1480
+ line: 597,
1481
+ column: 3
1482
+ }
1483
+ },
1484
+ line: 577
1485
+ },
1486
+ "21": {
1487
+ name: "(anonymous_21)",
1488
+ decl: {
1489
+ start: {
1490
+ line: 616,
1491
+ column: 2
1492
+ },
1493
+ end: {
1494
+ line: 616,
1495
+ column: 3
1496
+ }
1497
+ },
1498
+ loc: {
1499
+ start: {
1500
+ line: 616,
1501
+ column: 15
1502
+ },
1503
+ end: {
1504
+ line: 626,
1505
+ column: 3
1506
+ }
1507
+ },
1508
+ line: 616
1509
+ }
1510
+ },
1511
+ branchMap: {
1512
+ "0": {
1513
+ loc: {
1514
+ start: {
1515
+ line: 65,
1516
+ column: 4
1517
+ },
1518
+ end: {
1519
+ line: 65,
1520
+ column: 24
1521
+ }
1522
+ },
1523
+ type: "default-arg",
1524
+ locations: [{
1525
+ start: {
1526
+ line: 65,
1527
+ column: 20
1528
+ },
1529
+ end: {
1530
+ line: 65,
1531
+ column: 24
1532
+ }
1533
+ }],
1534
+ line: 65
1535
+ },
1536
+ "1": {
1537
+ loc: {
1538
+ start: {
1539
+ line: 66,
1540
+ column: 4
1541
+ },
1542
+ end: {
1543
+ line: 66,
1544
+ column: 24
1545
+ }
1546
+ },
1547
+ type: "default-arg",
1548
+ locations: [{
1549
+ start: {
1550
+ line: 66,
1551
+ column: 20
1552
+ },
1553
+ end: {
1554
+ line: 66,
1555
+ column: 24
1556
+ }
1557
+ }],
1558
+ line: 66
1559
+ },
1560
+ "2": {
1561
+ loc: {
1562
+ start: {
1563
+ line: 67,
1564
+ column: 4
1565
+ },
1566
+ end: {
1567
+ line: 67,
1568
+ column: 25
1569
+ }
1570
+ },
1571
+ type: "default-arg",
1572
+ locations: [{
1573
+ start: {
1574
+ line: 67,
1575
+ column: 21
1576
+ },
1577
+ end: {
1578
+ line: 67,
1579
+ column: 25
1580
+ }
1581
+ }],
1582
+ line: 67
1583
+ },
1584
+ "3": {
1585
+ loc: {
1586
+ start: {
1587
+ line: 78,
1588
+ column: 4
1589
+ },
1590
+ end: {
1591
+ line: 87,
1592
+ column: 5
1593
+ }
1594
+ },
1595
+ type: "switch",
1596
+ locations: [{
1597
+ start: {
1598
+ line: 79,
1599
+ column: 6
1600
+ },
1601
+ end: {
1602
+ line: 80,
1603
+ column: 52
1604
+ }
1605
+ }, {
1606
+ start: {
1607
+ line: 82,
1608
+ column: 6
1609
+ },
1610
+ end: {
1611
+ line: 83,
1612
+ column: 29
1613
+ }
1614
+ }, {
1615
+ start: {
1616
+ line: 85,
1617
+ column: 6
1618
+ },
1619
+ end: {
1620
+ line: 86,
1621
+ column: 52
1622
+ }
1623
+ }],
1624
+ line: 78
1625
+ },
1626
+ "4": {
1627
+ loc: {
1628
+ start: {
1629
+ line: 80,
1630
+ column: 15
1631
+ },
1632
+ end: {
1633
+ line: 80,
1634
+ column: 51
1635
+ }
1636
+ },
1637
+ type: "binary-expr",
1638
+ locations: [{
1639
+ start: {
1640
+ line: 80,
1641
+ column: 15
1642
+ },
1643
+ end: {
1644
+ line: 80,
1645
+ column: 34
1646
+ }
1647
+ }, {
1648
+ start: {
1649
+ line: 80,
1650
+ column: 38
1651
+ },
1652
+ end: {
1653
+ line: 80,
1654
+ column: 51
1655
+ }
1656
+ }],
1657
+ line: 80
1658
+ },
1659
+ "5": {
1660
+ loc: {
1661
+ start: {
1662
+ line: 86,
1663
+ column: 15
1664
+ },
1665
+ end: {
1666
+ line: 86,
1667
+ column: 51
1668
+ }
1669
+ },
1670
+ type: "binary-expr",
1671
+ locations: [{
1672
+ start: {
1673
+ line: 86,
1674
+ column: 15
1675
+ },
1676
+ end: {
1677
+ line: 86,
1678
+ column: 34
1679
+ }
1680
+ }, {
1681
+ start: {
1682
+ line: 86,
1683
+ column: 38
1684
+ },
1685
+ end: {
1686
+ line: 86,
1687
+ column: 51
1688
+ }
1689
+ }],
1690
+ line: 86
1691
+ },
1692
+ "6": {
1693
+ loc: {
1694
+ start: {
1695
+ line: 118,
1696
+ column: 19
1697
+ },
1698
+ end: {
1699
+ line: 118,
1700
+ column: 28
1701
+ }
1702
+ },
1703
+ type: "default-arg",
1704
+ locations: [{
1705
+ start: {
1706
+ line: 118,
1707
+ column: 26
1708
+ },
1709
+ end: {
1710
+ line: 118,
1711
+ column: 28
1712
+ }
1713
+ }],
1714
+ line: 118
1715
+ },
1716
+ "7": {
1717
+ loc: {
1718
+ start: {
1719
+ line: 119,
1720
+ column: 4
1721
+ },
1722
+ end: {
1723
+ line: 123,
1724
+ column: 5
1725
+ }
1726
+ },
1727
+ type: "if",
1728
+ locations: [{
1729
+ start: {
1730
+ line: 119,
1731
+ column: 4
1732
+ },
1733
+ end: {
1734
+ line: 123,
1735
+ column: 5
1736
+ }
1737
+ }, {
1738
+ start: {
1739
+ line: undefined,
1740
+ column: undefined
1741
+ },
1742
+ end: {
1743
+ line: undefined,
1744
+ column: undefined
1745
+ }
1746
+ }],
1747
+ line: 119
1748
+ },
1749
+ "8": {
1750
+ loc: {
1751
+ start: {
1752
+ line: 130,
1753
+ column: 6
1754
+ },
1755
+ end: {
1756
+ line: 134,
1757
+ column: 7
1758
+ }
1759
+ },
1760
+ type: "if",
1761
+ locations: [{
1762
+ start: {
1763
+ line: 130,
1764
+ column: 6
1765
+ },
1766
+ end: {
1767
+ line: 134,
1768
+ column: 7
1769
+ }
1770
+ }, {
1771
+ start: {
1772
+ line: undefined,
1773
+ column: undefined
1774
+ },
1775
+ end: {
1776
+ line: undefined,
1777
+ column: undefined
1778
+ }
1779
+ }],
1780
+ line: 130
1781
+ },
1782
+ "9": {
1783
+ loc: {
1784
+ start: {
1785
+ line: 164,
1786
+ column: 4
1787
+ },
1788
+ end: {
1789
+ line: 168,
1790
+ column: 5
1791
+ }
1792
+ },
1793
+ type: "if",
1794
+ locations: [{
1795
+ start: {
1796
+ line: 164,
1797
+ column: 4
1798
+ },
1799
+ end: {
1800
+ line: 168,
1801
+ column: 5
1802
+ }
1803
+ }, {
1804
+ start: {
1805
+ line: undefined,
1806
+ column: undefined
1807
+ },
1808
+ end: {
1809
+ line: undefined,
1810
+ column: undefined
1811
+ }
1812
+ }],
1813
+ line: 164
1814
+ },
1815
+ "10": {
1816
+ loc: {
1817
+ start: {
1818
+ line: 170,
1819
+ column: 4
1820
+ },
1821
+ end: {
1822
+ line: 176,
1823
+ column: 5
1824
+ }
1825
+ },
1826
+ type: "if",
1827
+ locations: [{
1828
+ start: {
1829
+ line: 170,
1830
+ column: 4
1831
+ },
1832
+ end: {
1833
+ line: 176,
1834
+ column: 5
1835
+ }
1836
+ }, {
1837
+ start: {
1838
+ line: undefined,
1839
+ column: undefined
1840
+ },
1841
+ end: {
1842
+ line: undefined,
1843
+ column: undefined
1844
+ }
1845
+ }],
1846
+ line: 170
1847
+ },
1848
+ "11": {
1849
+ loc: {
1850
+ start: {
1851
+ line: 205,
1852
+ column: 4
1853
+ },
1854
+ end: {
1855
+ line: 209,
1856
+ column: 5
1857
+ }
1858
+ },
1859
+ type: "if",
1860
+ locations: [{
1861
+ start: {
1862
+ line: 205,
1863
+ column: 4
1864
+ },
1865
+ end: {
1866
+ line: 209,
1867
+ column: 5
1868
+ }
1869
+ }, {
1870
+ start: {
1871
+ line: undefined,
1872
+ column: undefined
1873
+ },
1874
+ end: {
1875
+ line: undefined,
1876
+ column: undefined
1877
+ }
1878
+ }],
1879
+ line: 205
1880
+ },
1881
+ "12": {
1882
+ loc: {
1883
+ start: {
1884
+ line: 211,
1885
+ column: 4
1886
+ },
1887
+ end: {
1888
+ line: 215,
1889
+ column: 5
1890
+ }
1891
+ },
1892
+ type: "if",
1893
+ locations: [{
1894
+ start: {
1895
+ line: 211,
1896
+ column: 4
1897
+ },
1898
+ end: {
1899
+ line: 215,
1900
+ column: 5
1901
+ }
1902
+ }, {
1903
+ start: {
1904
+ line: undefined,
1905
+ column: undefined
1906
+ },
1907
+ end: {
1908
+ line: undefined,
1909
+ column: undefined
1910
+ }
1911
+ }],
1912
+ line: 211
1913
+ },
1914
+ "13": {
1915
+ loc: {
1916
+ start: {
1917
+ line: 243,
1918
+ column: 4
1919
+ },
1920
+ end: {
1921
+ line: 249,
1922
+ column: 5
1923
+ }
1924
+ },
1925
+ type: "if",
1926
+ locations: [{
1927
+ start: {
1928
+ line: 243,
1929
+ column: 4
1930
+ },
1931
+ end: {
1932
+ line: 249,
1933
+ column: 5
1934
+ }
1935
+ }, {
1936
+ start: {
1937
+ line: undefined,
1938
+ column: undefined
1939
+ },
1940
+ end: {
1941
+ line: undefined,
1942
+ column: undefined
1943
+ }
1944
+ }],
1945
+ line: 243
1946
+ },
1947
+ "14": {
1948
+ loc: {
1949
+ start: {
1950
+ line: 251,
1951
+ column: 4
1952
+ },
1953
+ end: {
1954
+ line: 257,
1955
+ column: 5
1956
+ }
1957
+ },
1958
+ type: "if",
1959
+ locations: [{
1960
+ start: {
1961
+ line: 251,
1962
+ column: 4
1963
+ },
1964
+ end: {
1965
+ line: 257,
1966
+ column: 5
1967
+ }
1968
+ }, {
1969
+ start: {
1970
+ line: undefined,
1971
+ column: undefined
1972
+ },
1973
+ end: {
1974
+ line: undefined,
1975
+ column: undefined
1976
+ }
1977
+ }],
1978
+ line: 251
1979
+ },
1980
+ "15": {
1981
+ loc: {
1982
+ start: {
1983
+ line: 259,
1984
+ column: 4
1985
+ },
1986
+ end: {
1987
+ line: 265,
1988
+ column: 5
1989
+ }
1990
+ },
1991
+ type: "if",
1992
+ locations: [{
1993
+ start: {
1994
+ line: 259,
1995
+ column: 4
1996
+ },
1997
+ end: {
1998
+ line: 265,
1999
+ column: 5
2000
+ }
2001
+ }, {
2002
+ start: {
2003
+ line: undefined,
2004
+ column: undefined
2005
+ },
2006
+ end: {
2007
+ line: undefined,
2008
+ column: undefined
2009
+ }
2010
+ }],
2011
+ line: 259
2012
+ },
2013
+ "16": {
2014
+ loc: {
2015
+ start: {
2016
+ line: 296,
2017
+ column: 4
2018
+ },
2019
+ end: {
2020
+ line: 300,
2021
+ column: 5
2022
+ }
2023
+ },
2024
+ type: "if",
2025
+ locations: [{
2026
+ start: {
2027
+ line: 296,
2028
+ column: 4
2029
+ },
2030
+ end: {
2031
+ line: 300,
2032
+ column: 5
2033
+ }
2034
+ }, {
2035
+ start: {
2036
+ line: undefined,
2037
+ column: undefined
2038
+ },
2039
+ end: {
2040
+ line: undefined,
2041
+ column: undefined
2042
+ }
2043
+ }],
2044
+ line: 296
2045
+ },
2046
+ "17": {
2047
+ loc: {
2048
+ start: {
2049
+ line: 327,
2050
+ column: 4
2051
+ },
2052
+ end: {
2053
+ line: 331,
2054
+ column: 5
2055
+ }
2056
+ },
2057
+ type: "if",
2058
+ locations: [{
2059
+ start: {
2060
+ line: 327,
2061
+ column: 4
2062
+ },
2063
+ end: {
2064
+ line: 331,
2065
+ column: 5
2066
+ }
2067
+ }, {
2068
+ start: {
2069
+ line: undefined,
2070
+ column: undefined
2071
+ },
2072
+ end: {
2073
+ line: undefined,
2074
+ column: undefined
2075
+ }
2076
+ }],
2077
+ line: 327
2078
+ },
2079
+ "18": {
2080
+ loc: {
2081
+ start: {
2082
+ line: 327,
2083
+ column: 8
2084
+ },
2085
+ end: {
2086
+ line: 327,
2087
+ column: 47
2088
+ }
2089
+ },
2090
+ type: "binary-expr",
2091
+ locations: [{
2092
+ start: {
2093
+ line: 327,
2094
+ column: 8
2095
+ },
2096
+ end: {
2097
+ line: 327,
2098
+ column: 23
2099
+ }
2100
+ }, {
2101
+ start: {
2102
+ line: 327,
2103
+ column: 27
2104
+ },
2105
+ end: {
2106
+ line: 327,
2107
+ column: 47
2108
+ }
2109
+ }],
2110
+ line: 327
2111
+ },
2112
+ "19": {
2113
+ loc: {
2114
+ start: {
2115
+ line: 333,
2116
+ column: 4
2117
+ },
2118
+ end: {
2119
+ line: 339,
2120
+ column: 5
2121
+ }
2122
+ },
2123
+ type: "if",
2124
+ locations: [{
2125
+ start: {
2126
+ line: 333,
2127
+ column: 4
2128
+ },
2129
+ end: {
2130
+ line: 339,
2131
+ column: 5
2132
+ }
2133
+ }, {
2134
+ start: {
2135
+ line: undefined,
2136
+ column: undefined
2137
+ },
2138
+ end: {
2139
+ line: undefined,
2140
+ column: undefined
2141
+ }
2142
+ }],
2143
+ line: 333
2144
+ },
2145
+ "20": {
2146
+ loc: {
2147
+ start: {
2148
+ line: 383,
2149
+ column: 25
2150
+ },
2151
+ end: {
2152
+ line: 383,
2153
+ column: 34
2154
+ }
2155
+ },
2156
+ type: "default-arg",
2157
+ locations: [{
2158
+ start: {
2159
+ line: 383,
2160
+ column: 32
2161
+ },
2162
+ end: {
2163
+ line: 383,
2164
+ column: 34
2165
+ }
2166
+ }],
2167
+ line: 383
2168
+ },
2169
+ "21": {
2170
+ loc: {
2171
+ start: {
2172
+ line: 384,
2173
+ column: 4
2174
+ },
2175
+ end: {
2176
+ line: 400,
2177
+ column: 5
2178
+ }
2179
+ },
2180
+ type: "if",
2181
+ locations: [{
2182
+ start: {
2183
+ line: 384,
2184
+ column: 4
2185
+ },
2186
+ end: {
2187
+ line: 400,
2188
+ column: 5
2189
+ }
2190
+ }, {
2191
+ start: {
2192
+ line: undefined,
2193
+ column: undefined
2194
+ },
2195
+ end: {
2196
+ line: undefined,
2197
+ column: undefined
2198
+ }
2199
+ }],
2200
+ line: 384
2201
+ },
2202
+ "22": {
2203
+ loc: {
2204
+ start: {
2205
+ line: 390,
2206
+ column: 8
2207
+ },
2208
+ end: {
2209
+ line: 394,
2210
+ column: 9
2211
+ }
2212
+ },
2213
+ type: "if",
2214
+ locations: [{
2215
+ start: {
2216
+ line: 390,
2217
+ column: 8
2218
+ },
2219
+ end: {
2220
+ line: 394,
2221
+ column: 9
2222
+ }
2223
+ }, {
2224
+ start: {
2225
+ line: undefined,
2226
+ column: undefined
2227
+ },
2228
+ end: {
2229
+ line: undefined,
2230
+ column: undefined
2231
+ }
2232
+ }],
2233
+ line: 390
2234
+ },
2235
+ "23": {
2236
+ loc: {
2237
+ start: {
2238
+ line: 402,
2239
+ column: 4
2240
+ },
2241
+ end: {
2242
+ line: 406,
2243
+ column: 5
2244
+ }
2245
+ },
2246
+ type: "if",
2247
+ locations: [{
2248
+ start: {
2249
+ line: 402,
2250
+ column: 4
2251
+ },
2252
+ end: {
2253
+ line: 406,
2254
+ column: 5
2255
+ }
2256
+ }, {
2257
+ start: {
2258
+ line: undefined,
2259
+ column: undefined
2260
+ },
2261
+ end: {
2262
+ line: undefined,
2263
+ column: undefined
2264
+ }
2265
+ }],
2266
+ line: 402
2267
+ },
2268
+ "24": {
2269
+ loc: {
2270
+ start: {
2271
+ line: 413,
2272
+ column: 6
2273
+ },
2274
+ end: {
2275
+ line: 417,
2276
+ column: 7
2277
+ }
2278
+ },
2279
+ type: "if",
2280
+ locations: [{
2281
+ start: {
2282
+ line: 413,
2283
+ column: 6
2284
+ },
2285
+ end: {
2286
+ line: 417,
2287
+ column: 7
2288
+ }
2289
+ }, {
2290
+ start: {
2291
+ line: undefined,
2292
+ column: undefined
2293
+ },
2294
+ end: {
2295
+ line: undefined,
2296
+ column: undefined
2297
+ }
2298
+ }],
2299
+ line: 413
2300
+ },
2301
+ "25": {
2302
+ loc: {
2303
+ start: {
2304
+ line: 448,
2305
+ column: 4
2306
+ },
2307
+ end: {
2308
+ line: 458,
2309
+ column: 5
2310
+ }
2311
+ },
2312
+ type: "if",
2313
+ locations: [{
2314
+ start: {
2315
+ line: 448,
2316
+ column: 4
2317
+ },
2318
+ end: {
2319
+ line: 458,
2320
+ column: 5
2321
+ }
2322
+ }, {
2323
+ start: {
2324
+ line: undefined,
2325
+ column: undefined
2326
+ },
2327
+ end: {
2328
+ line: undefined,
2329
+ column: undefined
2330
+ }
2331
+ }],
2332
+ line: 448
2333
+ },
2334
+ "26": {
2335
+ loc: {
2336
+ start: {
2337
+ line: 449,
2338
+ column: 6
2339
+ },
2340
+ end: {
2341
+ line: 455,
2342
+ column: 7
2343
+ }
2344
+ },
2345
+ type: "if",
2346
+ locations: [{
2347
+ start: {
2348
+ line: 449,
2349
+ column: 6
2350
+ },
2351
+ end: {
2352
+ line: 455,
2353
+ column: 7
2354
+ }
2355
+ }, {
2356
+ start: {
2357
+ line: undefined,
2358
+ column: undefined
2359
+ },
2360
+ end: {
2361
+ line: undefined,
2362
+ column: undefined
2363
+ }
2364
+ }],
2365
+ line: 449
2366
+ },
2367
+ "27": {
2368
+ loc: {
2369
+ start: {
2370
+ line: 460,
2371
+ column: 4
2372
+ },
2373
+ end: {
2374
+ line: 466,
2375
+ column: 5
2376
+ }
2377
+ },
2378
+ type: "if",
2379
+ locations: [{
2380
+ start: {
2381
+ line: 460,
2382
+ column: 4
2383
+ },
2384
+ end: {
2385
+ line: 466,
2386
+ column: 5
2387
+ }
2388
+ }, {
2389
+ start: {
2390
+ line: undefined,
2391
+ column: undefined
2392
+ },
2393
+ end: {
2394
+ line: undefined,
2395
+ column: undefined
2396
+ }
2397
+ }],
2398
+ line: 460
2399
+ },
2400
+ "28": {
2401
+ loc: {
2402
+ start: {
2403
+ line: 468,
2404
+ column: 4
2405
+ },
2406
+ end: {
2407
+ line: 474,
2408
+ column: 5
2409
+ }
2410
+ },
2411
+ type: "if",
2412
+ locations: [{
2413
+ start: {
2414
+ line: 468,
2415
+ column: 4
2416
+ },
2417
+ end: {
2418
+ line: 474,
2419
+ column: 5
2420
+ }
2421
+ }, {
2422
+ start: {
2423
+ line: undefined,
2424
+ column: undefined
2425
+ },
2426
+ end: {
2427
+ line: undefined,
2428
+ column: undefined
2429
+ }
2430
+ }],
2431
+ line: 468
2432
+ },
2433
+ "29": {
2434
+ loc: {
2435
+ start: {
2436
+ line: 502,
2437
+ column: 4
2438
+ },
2439
+ end: {
2440
+ line: 508,
2441
+ column: 5
2442
+ }
2443
+ },
2444
+ type: "if",
2445
+ locations: [{
2446
+ start: {
2447
+ line: 502,
2448
+ column: 4
2449
+ },
2450
+ end: {
2451
+ line: 508,
2452
+ column: 5
2453
+ }
2454
+ }, {
2455
+ start: {
2456
+ line: undefined,
2457
+ column: undefined
2458
+ },
2459
+ end: {
2460
+ line: undefined,
2461
+ column: undefined
2462
+ }
2463
+ }],
2464
+ line: 502
2465
+ },
2466
+ "30": {
2467
+ loc: {
2468
+ start: {
2469
+ line: 510,
2470
+ column: 4
2471
+ },
2472
+ end: {
2473
+ line: 516,
2474
+ column: 5
2475
+ }
2476
+ },
2477
+ type: "if",
2478
+ locations: [{
2479
+ start: {
2480
+ line: 510,
2481
+ column: 4
2482
+ },
2483
+ end: {
2484
+ line: 516,
2485
+ column: 5
2486
+ }
2487
+ }, {
2488
+ start: {
2489
+ line: undefined,
2490
+ column: undefined
2491
+ },
2492
+ end: {
2493
+ line: undefined,
2494
+ column: undefined
2495
+ }
2496
+ }],
2497
+ line: 510
2498
+ },
2499
+ "31": {
2500
+ loc: {
2501
+ start: {
2502
+ line: 542,
2503
+ column: 4
2504
+ },
2505
+ end: {
2506
+ line: 546,
2507
+ column: 5
2508
+ }
2509
+ },
2510
+ type: "if",
2511
+ locations: [{
2512
+ start: {
2513
+ line: 542,
2514
+ column: 4
2515
+ },
2516
+ end: {
2517
+ line: 546,
2518
+ column: 5
2519
+ }
2520
+ }, {
2521
+ start: {
2522
+ line: undefined,
2523
+ column: undefined
2524
+ },
2525
+ end: {
2526
+ line: undefined,
2527
+ column: undefined
2528
+ }
2529
+ }],
2530
+ line: 542
2531
+ },
2532
+ "32": {
2533
+ loc: {
2534
+ start: {
2535
+ line: 548,
2536
+ column: 4
2537
+ },
2538
+ end: {
2539
+ line: 552,
2540
+ column: 5
2541
+ }
2542
+ },
2543
+ type: "if",
2544
+ locations: [{
2545
+ start: {
2546
+ line: 548,
2547
+ column: 4
2548
+ },
2549
+ end: {
2550
+ line: 552,
2551
+ column: 5
2552
+ }
2553
+ }, {
2554
+ start: {
2555
+ line: undefined,
2556
+ column: undefined
2557
+ },
2558
+ end: {
2559
+ line: undefined,
2560
+ column: undefined
2561
+ }
2562
+ }],
2563
+ line: 548
2564
+ },
2565
+ "33": {
2566
+ loc: {
2567
+ start: {
2568
+ line: 578,
2569
+ column: 4
2570
+ },
2571
+ end: {
2572
+ line: 584,
2573
+ column: 5
2574
+ }
2575
+ },
2576
+ type: "if",
2577
+ locations: [{
2578
+ start: {
2579
+ line: 578,
2580
+ column: 4
2581
+ },
2582
+ end: {
2583
+ line: 584,
2584
+ column: 5
2585
+ }
2586
+ }, {
2587
+ start: {
2588
+ line: undefined,
2589
+ column: undefined
2590
+ },
2591
+ end: {
2592
+ line: undefined,
2593
+ column: undefined
2594
+ }
2595
+ }],
2596
+ line: 578
2597
+ },
2598
+ "34": {
2599
+ loc: {
2600
+ start: {
2601
+ line: 586,
2602
+ column: 4
2603
+ },
2604
+ end: {
2605
+ line: 592,
2606
+ column: 5
2607
+ }
2608
+ },
2609
+ type: "if",
2610
+ locations: [{
2611
+ start: {
2612
+ line: 586,
2613
+ column: 4
2614
+ },
2615
+ end: {
2616
+ line: 592,
2617
+ column: 5
2618
+ }
2619
+ }, {
2620
+ start: {
2621
+ line: undefined,
2622
+ column: undefined
2623
+ },
2624
+ end: {
2625
+ line: undefined,
2626
+ column: undefined
2627
+ }
2628
+ }],
2629
+ line: 586
2630
+ },
2631
+ "35": {
2632
+ loc: {
2633
+ start: {
2634
+ line: 617,
2635
+ column: 4
2636
+ },
2637
+ end: {
2638
+ line: 621,
2639
+ column: 5
2640
+ }
2641
+ },
2642
+ type: "if",
2643
+ locations: [{
2644
+ start: {
2645
+ line: 617,
2646
+ column: 4
2647
+ },
2648
+ end: {
2649
+ line: 621,
2650
+ column: 5
2651
+ }
2652
+ }, {
2653
+ start: {
2654
+ line: undefined,
2655
+ column: undefined
2656
+ },
2657
+ end: {
2658
+ line: undefined,
2659
+ column: undefined
2660
+ }
2661
+ }],
2662
+ line: 617
2663
+ }
2664
+ },
2665
+ s: {
2666
+ "0": 0,
2667
+ "1": 0,
2668
+ "2": 0,
2669
+ "3": 0,
2670
+ "4": 0,
2671
+ "5": 0,
2672
+ "6": 0,
2673
+ "7": 0,
2674
+ "8": 0,
2675
+ "9": 0,
2676
+ "10": 0,
2677
+ "11": 0,
2678
+ "12": 0,
2679
+ "13": 0,
2680
+ "14": 0,
2681
+ "15": 0,
2682
+ "16": 0,
2683
+ "17": 0,
2684
+ "18": 0,
2685
+ "19": 0,
2686
+ "20": 0,
2687
+ "21": 0,
2688
+ "22": 0,
2689
+ "23": 0,
2690
+ "24": 0,
2691
+ "25": 0,
2692
+ "26": 0,
2693
+ "27": 0,
2694
+ "28": 0,
2695
+ "29": 0,
2696
+ "30": 0,
2697
+ "31": 0,
2698
+ "32": 0,
2699
+ "33": 0,
2700
+ "34": 0,
2701
+ "35": 0,
2702
+ "36": 0,
2703
+ "37": 0,
2704
+ "38": 0,
2705
+ "39": 0,
2706
+ "40": 0,
2707
+ "41": 0,
2708
+ "42": 0,
2709
+ "43": 0,
2710
+ "44": 0,
2711
+ "45": 0,
2712
+ "46": 0,
2713
+ "47": 0,
2714
+ "48": 0,
2715
+ "49": 0,
2716
+ "50": 0,
2717
+ "51": 0,
2718
+ "52": 0,
2719
+ "53": 0,
2720
+ "54": 0,
2721
+ "55": 0,
2722
+ "56": 0,
2723
+ "57": 0,
2724
+ "58": 0,
2725
+ "59": 0,
2726
+ "60": 0,
2727
+ "61": 0,
2728
+ "62": 0,
2729
+ "63": 0,
2730
+ "64": 0,
2731
+ "65": 0,
2732
+ "66": 0,
2733
+ "67": 0,
2734
+ "68": 0,
2735
+ "69": 0,
2736
+ "70": 0,
2737
+ "71": 0,
2738
+ "72": 0,
2739
+ "73": 0,
2740
+ "74": 0,
2741
+ "75": 0,
2742
+ "76": 0,
2743
+ "77": 0,
2744
+ "78": 0,
2745
+ "79": 0,
2746
+ "80": 0,
2747
+ "81": 0,
2748
+ "82": 0,
2749
+ "83": 0,
2750
+ "84": 0,
2751
+ "85": 0,
2752
+ "86": 0,
2753
+ "87": 0,
2754
+ "88": 0,
2755
+ "89": 0,
2756
+ "90": 0,
2757
+ "91": 0,
2758
+ "92": 0,
2759
+ "93": 0,
2760
+ "94": 0,
2761
+ "95": 0
2762
+ },
2763
+ f: {
2764
+ "0": 0,
2765
+ "1": 0,
2766
+ "2": 0,
2767
+ "3": 0,
2768
+ "4": 0,
2769
+ "5": 0,
2770
+ "6": 0,
2771
+ "7": 0,
2772
+ "8": 0,
2773
+ "9": 0,
2774
+ "10": 0,
2775
+ "11": 0,
2776
+ "12": 0,
2777
+ "13": 0,
2778
+ "14": 0,
2779
+ "15": 0,
2780
+ "16": 0,
2781
+ "17": 0,
2782
+ "18": 0,
2783
+ "19": 0,
2784
+ "20": 0,
2785
+ "21": 0
2786
+ },
2787
+ b: {
2788
+ "0": [0],
2789
+ "1": [0],
2790
+ "2": [0],
2791
+ "3": [0, 0, 0],
2792
+ "4": [0, 0],
2793
+ "5": [0, 0],
2794
+ "6": [0],
2795
+ "7": [0, 0],
2796
+ "8": [0, 0],
2797
+ "9": [0, 0],
2798
+ "10": [0, 0],
2799
+ "11": [0, 0],
2800
+ "12": [0, 0],
2801
+ "13": [0, 0],
2802
+ "14": [0, 0],
2803
+ "15": [0, 0],
2804
+ "16": [0, 0],
2805
+ "17": [0, 0],
2806
+ "18": [0, 0],
2807
+ "19": [0, 0],
2808
+ "20": [0],
2809
+ "21": [0, 0],
2810
+ "22": [0, 0],
2811
+ "23": [0, 0],
2812
+ "24": [0, 0],
2813
+ "25": [0, 0],
2814
+ "26": [0, 0],
2815
+ "27": [0, 0],
2816
+ "28": [0, 0],
2817
+ "29": [0, 0],
2818
+ "30": [0, 0],
2819
+ "31": [0, 0],
2820
+ "32": [0, 0],
2821
+ "33": [0, 0],
2822
+ "34": [0, 0],
2823
+ "35": [0, 0]
2824
+ },
2825
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
2826
+ hash: "a4ef338f33a4aee99179e97c157edeb78fdcdb4a"
2827
+ };
2828
+ var coverage = global[gcv] || (global[gcv] = {});
2829
+ if (!coverage[path] || coverage[path].hash !== hash) {
2830
+ coverage[path] = coverageData;
2831
+ }
2832
+ var actualCoverage = coverage[path];
2833
+ {
2834
+ // @ts-ignore
2835
+ cov_2h1wdje5oy = function () {
2836
+ return actualCoverage;
2837
+ };
2838
+ }
2839
+ return actualCoverage;
2840
+ }
2841
+ cov_2h1wdje5oy();
9
2842
  /**
10
2843
  * @typedef {Object} ContxtUser
11
2844
  * @property {string} createdAt ISO 8601 Extended Format date/time string
@@ -53,8 +2886,7 @@ import { toCamelCase, toSnakeCase } from '../utils/objects';
53
2886
  *
54
2887
  * @typicalname contxtSdk.coordinator.users
55
2888
  */
56
-
57
- var Users = function () {
2889
+ class Users {
58
2890
  /**
59
2891
  * @param {Object} sdk An instance of the SDK so the module can communicate with other modules
60
2892
  * @param {Object} request An instance of the request module tied to this module's audience.
@@ -63,520 +2895,631 @@ var Users = function () {
63
2895
  * @param {string} [legacyBaseUrl] The legacy base URL provided by the parent module
64
2896
  * @param {string} [organizationId] The organization ID to be used in tenant url requests
65
2897
  */
66
- function Users(sdk, request, baseUrl) {
67
- var tenantBaseUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
68
- var legacyBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
69
- var organizationId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
70
-
71
- _classCallCheck(this, Users);
72
-
2898
+ constructor(sdk, request, baseUrl) {
2899
+ let tenantBaseUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (cov_2h1wdje5oy().b[0][0]++, null);
2900
+ let legacyBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : (cov_2h1wdje5oy().b[1][0]++, null);
2901
+ let organizationId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : (cov_2h1wdje5oy().b[2][0]++, null);
2902
+ cov_2h1wdje5oy().f[0]++;
2903
+ cov_2h1wdje5oy().s[0]++;
73
2904
  this._baseUrl = baseUrl;
2905
+ cov_2h1wdje5oy().s[1]++;
74
2906
  this._tenantBaseUrl = tenantBaseUrl;
2907
+ cov_2h1wdje5oy().s[2]++;
75
2908
  this._legacyBaseUrl = legacyBaseUrl;
2909
+ cov_2h1wdje5oy().s[3]++;
76
2910
  this._request = request;
2911
+ cov_2h1wdje5oy().s[4]++;
77
2912
  this._sdk = sdk;
2913
+ cov_2h1wdje5oy().s[5]++;
78
2914
  this._organizationId = organizationId;
79
2915
  }
80
-
81
- _createClass(Users, [{
82
- key: '_getBaseUrl',
83
- value: function _getBaseUrl(type) {
84
- switch (type) {
85
- case 'legacy':
86
- return this._legacyBaseUrl || this._baseUrl;
87
-
88
- case 'access':
89
- return this._baseUrl;
90
-
91
- default:
92
- return this._tenantBaseUrl || this._baseUrl;
93
- }
2916
+ _getBaseUrl(type) {
2917
+ cov_2h1wdje5oy().f[1]++;
2918
+ cov_2h1wdje5oy().s[6]++;
2919
+ switch (type) {
2920
+ case 'legacy':
2921
+ cov_2h1wdje5oy().b[3][0]++;
2922
+ cov_2h1wdje5oy().s[7]++;
2923
+ return (cov_2h1wdje5oy().b[4][0]++, this._legacyBaseUrl) || (cov_2h1wdje5oy().b[4][1]++, this._baseUrl);
2924
+ case 'access':
2925
+ cov_2h1wdje5oy().b[3][1]++;
2926
+ cov_2h1wdje5oy().s[8]++;
2927
+ return this._baseUrl;
2928
+ default:
2929
+ cov_2h1wdje5oy().b[3][2]++;
2930
+ cov_2h1wdje5oy().s[9]++;
2931
+ return (cov_2h1wdje5oy().b[5][0]++, this._tenantBaseUrl) || (cov_2h1wdje5oy().b[5][1]++, this._baseUrl);
94
2932
  }
2933
+ }
95
2934
 
96
- /**
97
- * Activates a new user
98
- *
99
- * API Endpoint: '/users/:userId/activate'
100
- * Method: POST
101
- *
102
- * Note: Only valid for web users using auth0WebAuth session type
103
- *
104
- * @param {string} userId The ID of the user to activate
105
- * @param {Object} user
106
- * @param {string} user.email The email address of the user
107
- * @param {string} user.password The password to set for the user
108
- * @param {string} user.userToken The JWT token provided by the invite link
109
- *
110
- * @returns {Promise}
111
- * @fulfill {undefined}
112
- * @reject {Error}
113
- *
114
- * @example
115
- * contxtSdk.coordinator.users
116
- * .activate('7bb79bdf-7492-45c2-8640-2dde63535827', {
117
- * email: 'bob.sagat56@gmail.com',
118
- * password: 'ds32jX32jaMM1Nr',
119
- * userToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
120
- * })
121
- * .then(() => console.log("User Activated"))
122
- * .catch((err) => console.log(err));
123
- */
124
-
125
- }, {
126
- key: 'activate',
127
- value: function activate(userId) {
128
- var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
129
-
130
- if (!userId) {
131
- return Promise.reject(new Error('A user ID is required for activating a user'));
132
- }
133
-
134
- var requiredFields = ['email', 'password', 'userToken'];
135
-
136
- for (var i = 0; requiredFields.length > i; i++) {
137
- var field = requiredFields[i];
138
-
139
- if (!user[field]) {
140
- return Promise.reject(new Error('A ' + field + ' is required to activate a user.'));
141
- }
142
- }
143
-
144
- // Uses axios directly instead of this.request to bypass authorization interceptors
145
- return axios.post(this._getBaseUrl('access') + '/users/' + userId + '/activate', toSnakeCase(user));
2935
+ /**
2936
+ * Activates a new user
2937
+ *
2938
+ * API Endpoint: '/users/:userId/activate'
2939
+ * Method: POST
2940
+ *
2941
+ * Note: Only valid for web users using auth0WebAuth session type
2942
+ *
2943
+ * @param {string} userId The ID of the user to activate
2944
+ * @param {Object} user
2945
+ * @param {string} user.email The email address of the user
2946
+ * @param {string} user.password The password to set for the user
2947
+ * @param {string} user.userToken The JWT token provided by the invite link
2948
+ *
2949
+ * @returns {Promise}
2950
+ * @fulfill {undefined}
2951
+ * @reject {Error}
2952
+ *
2953
+ * @example
2954
+ * contxtSdk.coordinator.users
2955
+ * .activate('7bb79bdf-7492-45c2-8640-2dde63535827', {
2956
+ * email: 'bob.sagat56@gmail.com',
2957
+ * password: 'ds32jX32jaMM1Nr',
2958
+ * userToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
2959
+ * })
2960
+ * .then(() => console.log("User Activated"))
2961
+ * .catch((err) => console.log(err));
2962
+ */
2963
+ activate(userId) {
2964
+ let user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_2h1wdje5oy().b[6][0]++, {});
2965
+ cov_2h1wdje5oy().f[2]++;
2966
+ cov_2h1wdje5oy().s[10]++;
2967
+ if (!userId) {
2968
+ cov_2h1wdje5oy().b[7][0]++;
2969
+ cov_2h1wdje5oy().s[11]++;
2970
+ return Promise.reject(new Error('A user ID is required for activating a user'));
2971
+ } else {
2972
+ cov_2h1wdje5oy().b[7][1]++;
146
2973
  }
147
-
148
- /**
149
- * Adds a application to a user
150
- *
151
- * API Endpoint: '/users/:userId/applications/:applicationId'
152
- * Method: GET
153
- *
154
- * @param {string} userId The ID of the user
155
- * @param {string} applicationId The ID of the application
156
- *
157
- * @returns {Promise}
158
- * @fulfill {ContxtUserApplication} The newly created user application
159
- * @reject {Error}
160
- *
161
- * @example
162
- * contxtSdk.coordinator.users
163
- * .addApplication('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
164
- * .then((userApplication) => console.log(userApplication))
165
- * .catch((err) => console.log(err));
166
- */
167
-
168
- }, {
169
- key: 'addApplication',
170
- value: function addApplication(userId, applicationId) {
171
- if (!userId) {
172
- return Promise.reject(new Error('A user ID is required for adding a application to a user'));
2974
+ const requiredFields = (cov_2h1wdje5oy().s[12]++, ['email', 'password', 'userToken']);
2975
+ cov_2h1wdje5oy().s[13]++;
2976
+ for (let i = (cov_2h1wdje5oy().s[14]++, 0); requiredFields.length > i; i++) {
2977
+ const field = (cov_2h1wdje5oy().s[15]++, requiredFields[i]);
2978
+ cov_2h1wdje5oy().s[16]++;
2979
+ if (!user[field]) {
2980
+ cov_2h1wdje5oy().b[8][0]++;
2981
+ cov_2h1wdje5oy().s[17]++;
2982
+ return Promise.reject(new Error(`A ${field} is required to activate a user.`));
2983
+ } else {
2984
+ cov_2h1wdje5oy().b[8][1]++;
173
2985
  }
174
-
175
- if (!applicationId) {
176
- return Promise.reject(new Error('An application ID is required for adding a application to a user'));
177
- }
178
-
179
- return this._request.post(this._getBaseUrl() + '/users/' + userId + '/applications/' + applicationId).then(function (response) {
180
- return toCamelCase(response);
181
- });
182
2986
  }
183
2987
 
184
- /**
185
- * Adds a role to a user
186
- *
187
- * API Endpoint: '/users/:userId/roles/:roleId'
188
- * Method: POST
189
- *
190
- * @param {string} userId The ID of the user
191
- * @param {string} roleId The ID of the role
192
- *
193
- * @returns {Promise}
194
- * @fulfill {ContxtUserRole} The newly created user role
195
- * @reject {Error}
196
- *
197
- * @example
198
- * contxtSdk.coordinator.users
199
- * .addRole('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
200
- * .then((userRole) => console.log(userRole))
201
- * .catch((err) => console.log(err));
202
- */
203
-
204
- }, {
205
- key: 'addRole',
206
- value: function addRole(userId, roleId) {
207
- if (!userId) {
208
- return Promise.reject(new Error('A user ID is required for adding a role to a user'));
209
- }
210
-
211
- if (!roleId) {
212
- return Promise.reject(new Error('A role ID is required for adding a role to a user'));
213
- }
2988
+ // Uses axios directly instead of this.request to bypass authorization interceptors
2989
+ cov_2h1wdje5oy().s[18]++;
2990
+ return _axios.default.post(`${this._getBaseUrl('access')}/users/${userId}/activate`, _objects.default.toSnakeCase(user));
2991
+ }
214
2992
 
215
- return this._request.post(this._getBaseUrl() + '/users/' + userId + '/roles/' + roleId).then(function (response) {
216
- return toCamelCase(response);
217
- });
2993
+ /**
2994
+ * Adds a application to a user
2995
+ *
2996
+ * API Endpoint: '/users/:userId/applications/:applicationId'
2997
+ * Method: GET
2998
+ *
2999
+ * @param {string} userId The ID of the user
3000
+ * @param {string} applicationId The ID of the application
3001
+ *
3002
+ * @returns {Promise}
3003
+ * @fulfill {ContxtUserApplication} The newly created user application
3004
+ * @reject {Error}
3005
+ *
3006
+ * @example
3007
+ * contxtSdk.coordinator.users
3008
+ * .addApplication('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3009
+ * .then((userApplication) => console.log(userApplication))
3010
+ * .catch((err) => console.log(err));
3011
+ */
3012
+ addApplication(userId, applicationId) {
3013
+ cov_2h1wdje5oy().f[3]++;
3014
+ cov_2h1wdje5oy().s[19]++;
3015
+ if (!userId) {
3016
+ cov_2h1wdje5oy().b[9][0]++;
3017
+ cov_2h1wdje5oy().s[20]++;
3018
+ return Promise.reject(new Error('A user ID is required for adding a application to a user'));
3019
+ } else {
3020
+ cov_2h1wdje5oy().b[9][1]++;
218
3021
  }
219
-
220
- /**
221
- * Adds a project environment to a user
222
- *
223
- * API Endpoint: '/users/:userId/project_environments/:projectEnvironmentSlug
224
- * Method: POST
225
- *
226
- * @param {string} userId The ID of the user
227
- * @param {string} projectEnvironmentSlug The slug of the project environment
228
- * @param {'reader' | 'admin'} accessType The level of access for the user
229
- *
230
- * @returns {Promise}
231
- * @fulfill {ContxtUserProjectEnvironment} The newly created user project environment
232
- * @reject {Error}
233
- *
234
- * @example
235
- * contxtSdk.coordinator.users
236
- * .addProjectEnvironment('36b8421a-cc4a-4204-b839-1397374fb16b', 'project-environment-slug', 'admin')
237
- * .then((userProject) => console.log(userProject))
238
- * .catch((err) => console.log(err));
239
- */
240
-
241
- }, {
242
- key: 'addProjectEnvironment',
243
- value: function addProjectEnvironment(userId, projectEnvironmentId, accessType) {
244
- if (!userId) {
245
- return Promise.reject(new Error('A user ID is required for adding a project environment to a user'));
246
- }
247
-
248
- if (!projectEnvironmentId) {
249
- return Promise.reject(new Error('A project environment slug is required for adding a project environment to a user.'));
250
- }
251
-
252
- if (['reader', 'admin'].indexOf(accessType) === -1) {
253
- return Promise.reject(new Error('An access type of "reader" or "admin" is required for adding a project environment to a user'));
254
- }
255
-
256
- return this._request.post(this._getBaseUrl() + '/users/' + userId + '/project_environments/' + projectEnvironmentId, {
257
- access_type: accessType
258
- }).then(function (response) {
259
- return toCamelCase(response);
260
- });
3022
+ cov_2h1wdje5oy().s[21]++;
3023
+ if (!applicationId) {
3024
+ cov_2h1wdje5oy().b[10][0]++;
3025
+ cov_2h1wdje5oy().s[22]++;
3026
+ return Promise.reject(new Error('An application ID is required for adding a application to a user'));
3027
+ } else {
3028
+ cov_2h1wdje5oy().b[10][1]++;
261
3029
  }
3030
+ cov_2h1wdje5oy().s[23]++;
3031
+ return this._request.post(`${this._getBaseUrl()}/users/${userId}/applications/${applicationId}`).then(response => {
3032
+ cov_2h1wdje5oy().f[4]++;
3033
+ cov_2h1wdje5oy().s[24]++;
3034
+ return _objects.default.toCamelCase(response);
3035
+ });
3036
+ }
262
3037
 
263
- /**
264
- * Gets information about a contxt user
265
- *
266
- * API Endpoint: '/users/:userId'
267
- * Method: GET
268
- *
269
- * @param {string} userId The ID of the user
270
- *
271
- * @returns {Promise}
272
- * @fulfill {ContxtUser} Information about a contxt user
273
- * @reject {Error}
274
- *
275
- * @example
276
- * contxtSdk.coordinator.users
277
- * .get('auth0|12345')
278
- * .then((user) => console.log(user))
279
- * .catch((err) => console.log(err));
280
- */
281
-
282
- }, {
283
- key: 'get',
284
- value: function get(userId) {
285
- if (!userId) {
286
- return Promise.reject(new Error('A user ID is required for getting information about a user'));
287
- }
288
-
289
- return this._request.get(this._getBaseUrl('access') + '/users/' + userId).then(function (user) {
290
- return toCamelCase(user);
291
- });
3038
+ /**
3039
+ * Adds a role to a user
3040
+ *
3041
+ * API Endpoint: '/users/:userId/roles/:roleId'
3042
+ * Method: POST
3043
+ *
3044
+ * @param {string} userId The ID of the user
3045
+ * @param {string} roleId The ID of the role
3046
+ *
3047
+ * @returns {Promise}
3048
+ * @fulfill {ContxtUserRole} The newly created user role
3049
+ * @reject {Error}
3050
+ *
3051
+ * @example
3052
+ * contxtSdk.coordinator.users
3053
+ * .addRole('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3054
+ * .then((userRole) => console.log(userRole))
3055
+ * .catch((err) => console.log(err));
3056
+ */
3057
+ addRole(userId, roleId) {
3058
+ cov_2h1wdje5oy().f[5]++;
3059
+ cov_2h1wdje5oy().s[25]++;
3060
+ if (!userId) {
3061
+ cov_2h1wdje5oy().b[11][0]++;
3062
+ cov_2h1wdje5oy().s[26]++;
3063
+ return Promise.reject(new Error('A user ID is required for adding a role to a user'));
3064
+ } else {
3065
+ cov_2h1wdje5oy().b[11][1]++;
292
3066
  }
3067
+ cov_2h1wdje5oy().s[27]++;
3068
+ if (!roleId) {
3069
+ cov_2h1wdje5oy().b[12][0]++;
3070
+ cov_2h1wdje5oy().s[28]++;
3071
+ return Promise.reject(new Error('A role ID is required for adding a role to a user'));
3072
+ } else {
3073
+ cov_2h1wdje5oy().b[12][1]++;
3074
+ }
3075
+ cov_2h1wdje5oy().s[29]++;
3076
+ return this._request.post(`${this._getBaseUrl()}/users/${userId}/roles/${roleId}`).then(response => {
3077
+ cov_2h1wdje5oy().f[6]++;
3078
+ cov_2h1wdje5oy().s[30]++;
3079
+ return _objects.default.toCamelCase(response);
3080
+ });
3081
+ }
293
3082
 
294
- /**
295
- * Gets a list of users for a contxt organization
296
- *
297
- * Legacy API Endpoint: '/organizations/:organizationId/users'
298
- * API Endpoint: '/users'
299
- * Method: GET
300
- *
301
- * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
302
- *
303
- * @returns {Promise}
304
- * @fulfill {ContxtUser[]} List of users for a contxt organization
305
- * @reject {Error}
306
- *
307
- * @example
308
- * contxtSdk.coordinator.users
309
- * .getByOrganizationId('36b8421a-cc4a-4204-b839-1397374fb16b')
310
- * .then((orgUsers) => console.log(orgUsers))
311
- * .catch((err) => console.log(err));
312
- */
313
-
314
- }, {
315
- key: 'getByOrganizationId',
316
- value: function getByOrganizationId(organizationId) {
317
- if (this._organizationId) {
318
- return this._request.get(this._getBaseUrl() + '/users').then(function (orgUsers) {
319
- return toCamelCase(orgUsers);
320
- });
321
- }
3083
+ /**
3084
+ * Adds a project environment to a user
3085
+ *
3086
+ * API Endpoint: '/users/:userId/project_environments/:projectEnvironmentSlug
3087
+ * Method: POST
3088
+ *
3089
+ * @param {string} userId The ID of the user
3090
+ * @param {string} projectEnvironmentSlug The slug of the project environment
3091
+ * @param {'reader' | 'admin'} accessType The level of access for the user
3092
+ *
3093
+ * @returns {Promise}
3094
+ * @fulfill {ContxtUserProjectEnvironment} The newly created user project environment
3095
+ * @reject {Error}
3096
+ *
3097
+ * @example
3098
+ * contxtSdk.coordinator.users
3099
+ * .addProjectEnvironment('36b8421a-cc4a-4204-b839-1397374fb16b', 'project-environment-slug', 'admin')
3100
+ * .then((userProject) => console.log(userProject))
3101
+ * .catch((err) => console.log(err));
3102
+ */
3103
+ addProjectEnvironment(userId, projectEnvironmentId, accessType) {
3104
+ cov_2h1wdje5oy().f[7]++;
3105
+ cov_2h1wdje5oy().s[31]++;
3106
+ if (!userId) {
3107
+ cov_2h1wdje5oy().b[13][0]++;
3108
+ cov_2h1wdje5oy().s[32]++;
3109
+ return Promise.reject(new Error('A user ID is required for adding a project environment to a user'));
3110
+ } else {
3111
+ cov_2h1wdje5oy().b[13][1]++;
3112
+ }
3113
+ cov_2h1wdje5oy().s[33]++;
3114
+ if (!projectEnvironmentId) {
3115
+ cov_2h1wdje5oy().b[14][0]++;
3116
+ cov_2h1wdje5oy().s[34]++;
3117
+ return Promise.reject(new Error('A project environment slug is required for adding a project environment to a user.'));
3118
+ } else {
3119
+ cov_2h1wdje5oy().b[14][1]++;
3120
+ }
3121
+ cov_2h1wdje5oy().s[35]++;
3122
+ if (['reader', 'admin'].indexOf(accessType) === -1) {
3123
+ cov_2h1wdje5oy().b[15][0]++;
3124
+ cov_2h1wdje5oy().s[36]++;
3125
+ return Promise.reject(new Error('An access type of "reader" or "admin" is required for adding a project environment to a user'));
3126
+ } else {
3127
+ cov_2h1wdje5oy().b[15][1]++;
3128
+ }
3129
+ cov_2h1wdje5oy().s[37]++;
3130
+ return this._request.post(`${this._getBaseUrl()}/users/${userId}/project_environments/${projectEnvironmentId}`, {
3131
+ access_type: accessType
3132
+ }).then(response => {
3133
+ cov_2h1wdje5oy().f[8]++;
3134
+ cov_2h1wdje5oy().s[38]++;
3135
+ return _objects.default.toCamelCase(response);
3136
+ });
3137
+ }
322
3138
 
323
- if (!organizationId) {
324
- return Promise.reject(new Error('An organization ID is required for getting a list of users for an organization'));
325
- }
3139
+ /**
3140
+ * Gets information about a contxt user
3141
+ *
3142
+ * API Endpoint: '/users/:userId'
3143
+ * Method: GET
3144
+ *
3145
+ * @param {string} userId The ID of the user
3146
+ *
3147
+ * @returns {Promise}
3148
+ * @fulfill {ContxtUser} Information about a contxt user
3149
+ * @reject {Error}
3150
+ *
3151
+ * @example
3152
+ * contxtSdk.coordinator.users
3153
+ * .get('auth0|12345')
3154
+ * .then((user) => console.log(user))
3155
+ * .catch((err) => console.log(err));
3156
+ */
3157
+ get(userId) {
3158
+ cov_2h1wdje5oy().f[9]++;
3159
+ cov_2h1wdje5oy().s[39]++;
3160
+ if (!userId) {
3161
+ cov_2h1wdje5oy().b[16][0]++;
3162
+ cov_2h1wdje5oy().s[40]++;
3163
+ return Promise.reject(new Error('A user ID is required for getting information about a user'));
3164
+ } else {
3165
+ cov_2h1wdje5oy().b[16][1]++;
3166
+ }
3167
+ cov_2h1wdje5oy().s[41]++;
3168
+ return this._request.get(`${this._getBaseUrl('access')}/users/${userId}`).then(user => {
3169
+ cov_2h1wdje5oy().f[10]++;
3170
+ cov_2h1wdje5oy().s[42]++;
3171
+ return _objects.default.toCamelCase(user);
3172
+ });
3173
+ }
326
3174
 
327
- return this._request.get(this._getBaseUrl('legacy') + '/organizations/' + organizationId + '/users').then(function (orgUsers) {
328
- return toCamelCase(orgUsers);
3175
+ /**
3176
+ * Gets a list of users for a contxt organization
3177
+ *
3178
+ * Legacy API Endpoint: '/organizations/:organizationId/users'
3179
+ * API Endpoint: '/users'
3180
+ * Method: GET
3181
+ *
3182
+ * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
3183
+ *
3184
+ * @returns {Promise}
3185
+ * @fulfill {ContxtUser[]} List of users for a contxt organization
3186
+ * @reject {Error}
3187
+ *
3188
+ * @example
3189
+ * contxtSdk.coordinator.users
3190
+ * .getByOrganizationId('36b8421a-cc4a-4204-b839-1397374fb16b')
3191
+ * .then((orgUsers) => console.log(orgUsers))
3192
+ * .catch((err) => console.log(err));
3193
+ */
3194
+ getByOrganizationId(organizationId) {
3195
+ cov_2h1wdje5oy().f[11]++;
3196
+ cov_2h1wdje5oy().s[43]++;
3197
+ if ((cov_2h1wdje5oy().b[18][0]++, !organizationId) && (cov_2h1wdje5oy().b[18][1]++, this._organizationId)) {
3198
+ cov_2h1wdje5oy().b[17][0]++;
3199
+ cov_2h1wdje5oy().s[44]++;
3200
+ return this._request.get(`${this._getBaseUrl()}/users`).then(orgUsers => {
3201
+ cov_2h1wdje5oy().f[12]++;
3202
+ cov_2h1wdje5oy().s[45]++;
3203
+ return _objects.default.toCamelCase(orgUsers);
329
3204
  });
3205
+ } else {
3206
+ cov_2h1wdje5oy().b[17][1]++;
330
3207
  }
3208
+ cov_2h1wdje5oy().s[46]++;
3209
+ if (!organizationId) {
3210
+ cov_2h1wdje5oy().b[19][0]++;
3211
+ cov_2h1wdje5oy().s[47]++;
3212
+ return Promise.reject(new Error('An organization ID is required for getting a list of users for an organization'));
3213
+ } else {
3214
+ cov_2h1wdje5oy().b[19][1]++;
3215
+ }
3216
+ cov_2h1wdje5oy().s[48]++;
3217
+ return this._request.get(`${this._getBaseUrl('legacy')}/organizations/${organizationId}/users`).then(orgUsers => {
3218
+ cov_2h1wdje5oy().f[13]++;
3219
+ cov_2h1wdje5oy().s[49]++;
3220
+ return _objects.default.toCamelCase(orgUsers);
3221
+ });
3222
+ }
331
3223
 
332
- /**
333
- * Creates a new contxt user, adds them to an organization, and
334
- * sends them an email invite link to do final account setup.
335
- *
336
- * Legacy API Endpoint: '/organizations/:organizationId/users'
337
- * API Endpoint: '/users'
338
- * Method: POST
339
- *
340
- * Note: Only valid for web users using auth0WebAuth session type
341
- *
342
- * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
343
- * @param {Object} user
344
- * @param {string} user.email The email address of the new user
345
- * @param {string} user.firstName The first name of the new user
346
- * @param {string} user.lastName The last name of the new user
347
- * @param {string} user.redirectUrl The url that the user will be redirected
348
- * to after using the invite email link. Typically this is an /activate
349
- * endpoint that accepts url query params userToken and userId and uses them
350
- * to do final activation on the user's account.
351
- *
352
- * @returns {Promise}
353
- * @fulfill {ContxtUser} The new user
354
- * @reject {Error}
355
- *
356
- * @example
357
- * contxtSdk.coordinator.users
358
- * .invite('fdf01507-a26a-4dfe-89a2-bc91861169b8', {
359
- * email: 'bob.sagat56@gmail.com',
360
- * firstName: 'Bob',
361
- * lastName: 'Sagat',
362
- * redirectUrl: 'https://contxt.ndustrial.io/activate'
363
- * })
364
- * .then((newUser) => console.log(newUser))
365
- * .catch((err) => console.log(err));
366
- */
367
-
368
- }, {
369
- key: 'invite',
370
- value: function invite(organizationId) {
371
- var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
372
-
373
- if (this._organizationId) {
374
- var _requiredFields = ['email', 'firstName', 'lastName', 'redirectUrl'];
375
-
376
- for (var i = 0; _requiredFields.length > i; i++) {
377
- var field = _requiredFields[i];
378
-
379
- if (!user[field]) {
380
- return Promise.reject(new Error('A ' + field + ' is required to create a new user.'));
381
- }
382
- }
383
-
384
- return this._request.post(this._getBaseUrl() + '/users', toSnakeCase(user)).then(function (response) {
385
- return toCamelCase(response);
386
- });
387
- }
388
-
389
- if (!organizationId) {
390
- return Promise.reject(new Error('An organization ID is required for inviting a new user'));
391
- }
392
-
393
- var requiredFields = ['email', 'firstName', 'lastName', 'redirectUrl'];
394
-
395
- for (var _i = 0; requiredFields.length > _i; _i++) {
396
- var _field = requiredFields[_i];
397
-
398
- if (!user[_field]) {
399
- return Promise.reject(new Error('A ' + _field + ' is required to create a new user.'));
3224
+ /**
3225
+ * Creates a new contxt user, adds them to an organization, and
3226
+ * sends them an email invite link to do final account setup.
3227
+ *
3228
+ * Legacy API Endpoint: '/organizations/:organizationId/users'
3229
+ * API Endpoint: '/users'
3230
+ * Method: POST
3231
+ *
3232
+ * Note: Only valid for web users using auth0WebAuth session type
3233
+ *
3234
+ * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
3235
+ * @param {Object} user
3236
+ * @param {string} user.email The email address of the new user
3237
+ * @param {string} user.firstName The first name of the new user
3238
+ * @param {string} user.lastName The last name of the new user
3239
+ * @param {string} user.redirectUrl The url that the user will be redirected
3240
+ * to after using the invite email link. Typically this is an /activate
3241
+ * endpoint that accepts url query params userToken and userId and uses them
3242
+ * to do final activation on the user's account.
3243
+ *
3244
+ * @returns {Promise}
3245
+ * @fulfill {ContxtUser} The new user
3246
+ * @reject {Error}
3247
+ *
3248
+ * @example
3249
+ * contxtSdk.coordinator.users
3250
+ * .invite('fdf01507-a26a-4dfe-89a2-bc91861169b8', {
3251
+ * email: 'bob.sagat56@gmail.com',
3252
+ * firstName: 'Bob',
3253
+ * lastName: 'Sagat',
3254
+ * redirectUrl: 'https://contxt.ndustrial.io/activate'
3255
+ * })
3256
+ * .then((newUser) => console.log(newUser))
3257
+ * .catch((err) => console.log(err));
3258
+ */
3259
+ invite(organizationId) {
3260
+ let user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_2h1wdje5oy().b[20][0]++, {});
3261
+ cov_2h1wdje5oy().f[14]++;
3262
+ cov_2h1wdje5oy().s[50]++;
3263
+ if (this._organizationId) {
3264
+ cov_2h1wdje5oy().b[21][0]++;
3265
+ const requiredFields = (cov_2h1wdje5oy().s[51]++, ['email', 'firstName', 'lastName', 'redirectUrl']);
3266
+ cov_2h1wdje5oy().s[52]++;
3267
+ for (let i = (cov_2h1wdje5oy().s[53]++, 0); requiredFields.length > i; i++) {
3268
+ const field = (cov_2h1wdje5oy().s[54]++, requiredFields[i]);
3269
+ cov_2h1wdje5oy().s[55]++;
3270
+ if (!user[field]) {
3271
+ cov_2h1wdje5oy().b[22][0]++;
3272
+ cov_2h1wdje5oy().s[56]++;
3273
+ return Promise.reject(new Error(`A ${field} is required to create a new user.`));
3274
+ } else {
3275
+ cov_2h1wdje5oy().b[22][1]++;
400
3276
  }
401
3277
  }
402
-
403
- return this._request.post(this._getBaseUrl('legacy') + '/organizations/' + organizationId + '/users', toSnakeCase(user)).then(function (response) {
404
- return toCamelCase(response);
3278
+ cov_2h1wdje5oy().s[57]++;
3279
+ return this._request.post(`${this._getBaseUrl()}/users`, _objects.default.toSnakeCase(user)).then(response => {
3280
+ cov_2h1wdje5oy().f[15]++;
3281
+ cov_2h1wdje5oy().s[58]++;
3282
+ return _objects.default.toCamelCase(response);
405
3283
  });
3284
+ } else {
3285
+ cov_2h1wdje5oy().b[21][1]++;
406
3286
  }
407
-
408
- /**
409
- * Removes a user from an organization
410
- *
411
- * Legacy API Endpoint: '/organizations/:organizationId/users/:userId'
412
- * API Endpoint: '/users/:userId'
413
- * Method: DELETE
414
- *
415
- * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
416
- * @param {string} userId The ID of the user
417
- *
418
- * @returns {Promise}
419
- * @fulfill {undefined}
420
- * @reject {Error}
421
- *
422
- * @example
423
- * contxtSdk.coordinator.users
424
- * .remove('ed2e8e24-79ef-4404-bf5f-995ef31b2298', '4a577e87-7437-4342-b183-00c18ec26d52')
425
- * .catch((err) => console.log(err));
426
- */
427
-
428
- }, {
429
- key: 'remove',
430
- value: function remove(organizationId, userId) {
431
- if (this._organizationId) {
432
- if (!userId) {
433
- return Promise.reject(new Error('A user ID is required for removing a user from an organization'));
434
- }
435
-
436
- return this._request.delete(this._getBaseUrl() + '/users/' + userId);
437
- }
438
-
439
- if (!organizationId) {
440
- return Promise.reject(new Error('An organization ID is required for removing a user from an organization'));
3287
+ cov_2h1wdje5oy().s[59]++;
3288
+ if (!organizationId) {
3289
+ cov_2h1wdje5oy().b[23][0]++;
3290
+ cov_2h1wdje5oy().s[60]++;
3291
+ return Promise.reject(new Error('An organization ID is required for inviting a new user'));
3292
+ } else {
3293
+ cov_2h1wdje5oy().b[23][1]++;
3294
+ }
3295
+ const requiredFields = (cov_2h1wdje5oy().s[61]++, ['email', 'firstName', 'lastName', 'redirectUrl']);
3296
+ cov_2h1wdje5oy().s[62]++;
3297
+ for (let i = (cov_2h1wdje5oy().s[63]++, 0); requiredFields.length > i; i++) {
3298
+ const field = (cov_2h1wdje5oy().s[64]++, requiredFields[i]);
3299
+ cov_2h1wdje5oy().s[65]++;
3300
+ if (!user[field]) {
3301
+ cov_2h1wdje5oy().b[24][0]++;
3302
+ cov_2h1wdje5oy().s[66]++;
3303
+ return Promise.reject(new Error(`A ${field} is required to create a new user.`));
3304
+ } else {
3305
+ cov_2h1wdje5oy().b[24][1]++;
441
3306
  }
3307
+ }
3308
+ cov_2h1wdje5oy().s[67]++;
3309
+ return this._request.post(`${this._getBaseUrl('legacy')}/organizations/${organizationId}/users`, _objects.default.toSnakeCase(user)).then(response => {
3310
+ cov_2h1wdje5oy().f[16]++;
3311
+ cov_2h1wdje5oy().s[68]++;
3312
+ return _objects.default.toCamelCase(response);
3313
+ });
3314
+ }
442
3315
 
3316
+ /**
3317
+ * Removes a user from an organization
3318
+ *
3319
+ * Legacy API Endpoint: '/organizations/:organizationId/users/:userId'
3320
+ * API Endpoint: '/users/:userId'
3321
+ * Method: DELETE
3322
+ *
3323
+ * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
3324
+ * @param {string} userId The ID of the user
3325
+ *
3326
+ * @returns {Promise}
3327
+ * @fulfill {undefined}
3328
+ * @reject {Error}
3329
+ *
3330
+ * @example
3331
+ * contxtSdk.coordinator.users
3332
+ * .remove('ed2e8e24-79ef-4404-bf5f-995ef31b2298', '4a577e87-7437-4342-b183-00c18ec26d52')
3333
+ * .catch((err) => console.log(err));
3334
+ */
3335
+ remove(organizationId, userId) {
3336
+ cov_2h1wdje5oy().f[17]++;
3337
+ cov_2h1wdje5oy().s[69]++;
3338
+ if (this._organizationId) {
3339
+ cov_2h1wdje5oy().b[25][0]++;
3340
+ cov_2h1wdje5oy().s[70]++;
443
3341
  if (!userId) {
3342
+ cov_2h1wdje5oy().b[26][0]++;
3343
+ cov_2h1wdje5oy().s[71]++;
444
3344
  return Promise.reject(new Error('A user ID is required for removing a user from an organization'));
3345
+ } else {
3346
+ cov_2h1wdje5oy().b[26][1]++;
445
3347
  }
446
-
447
- return this._request.delete(this._getBaseUrl('legacy') + '/organizations/' + organizationId + '/users/' + userId);
3348
+ cov_2h1wdje5oy().s[72]++;
3349
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}`);
3350
+ } else {
3351
+ cov_2h1wdje5oy().b[25][1]++;
448
3352
  }
449
-
450
- /**
451
- * Removes a application from a user
452
- *
453
- * API Endpoint: '/users/:userId/applications/:applicationId'
454
- * Method: DELETE
455
- *
456
- * @param {string} userId The ID of the user
457
- * @param {string} applicationId The ID of the application
458
- *
459
- * @returns {Promise}
460
- * @fulfill {undefined}
461
- * @reject {Error}
462
- *
463
- * @example
464
- * contxtSdk.coordinator.users
465
- * .removeApplication('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
466
- * .catch((err) => console.log(err));
467
- */
468
-
469
- }, {
470
- key: 'removeApplication',
471
- value: function removeApplication(userId, applicationId) {
472
- if (!userId) {
473
- return Promise.reject(new Error('A user ID is required for removing a application from a user'));
474
- }
475
-
476
- if (!applicationId) {
477
- return Promise.reject(new Error('An application ID is required for removing a application from a user'));
478
- }
479
-
480
- return this._request.delete(this._getBaseUrl() + '/users/' + userId + '/applications/' + applicationId);
3353
+ cov_2h1wdje5oy().s[73]++;
3354
+ if (!organizationId) {
3355
+ cov_2h1wdje5oy().b[27][0]++;
3356
+ cov_2h1wdje5oy().s[74]++;
3357
+ return Promise.reject(new Error('An organization ID is required for removing a user from an organization'));
3358
+ } else {
3359
+ cov_2h1wdje5oy().b[27][1]++;
481
3360
  }
482
-
483
- /**
484
- * Removes a role from a user
485
- *
486
- * API Endpoint: '/users/:userId/roles/:roleId'
487
- * Method: DELETE
488
- *
489
- * @param {string} userId The ID of the user
490
- * @param {string} roleId The ID of the role
491
- *
492
- * @returns {Promise}
493
- * @fulfill {undefined}
494
- * @reject {Error}
495
- *
496
- * @example
497
- * contxtSdk.coordinator.users
498
- * .removeRole('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
499
- * .catch((err) => console.log(err));
500
- */
501
-
502
- }, {
503
- key: 'removeRole',
504
- value: function removeRole(userId, roleId) {
505
- if (!userId) {
506
- return Promise.reject(new Error('A user ID is required for removing a role from a user'));
507
- }
508
-
509
- if (!roleId) {
510
- return Promise.reject(new Error('A role ID is required for removing a role from a user'));
511
- }
512
-
513
- return this._request.delete(this._getBaseUrl() + '/users/' + userId + '/roles/' + roleId);
3361
+ cov_2h1wdje5oy().s[75]++;
3362
+ if (!userId) {
3363
+ cov_2h1wdje5oy().b[28][0]++;
3364
+ cov_2h1wdje5oy().s[76]++;
3365
+ return Promise.reject(new Error('A user ID is required for removing a user from an organization'));
3366
+ } else {
3367
+ cov_2h1wdje5oy().b[28][1]++;
514
3368
  }
3369
+ cov_2h1wdje5oy().s[77]++;
3370
+ return this._request.delete(`${this._getBaseUrl('legacy')}/organizations/${organizationId}/users/${userId}`);
3371
+ }
515
3372
 
516
- /**
517
- * Removes a project environment from a user
518
- *
519
- * API Endpoint: 'users/:userId/project_environments/:projectEnvironmentSlug
520
- * Method: DELETE
521
- *
522
- * @param {string} userId The ID of the user
523
- * @param {string} projectEnvironmentSlug The slug of the project environment
524
- *
525
- * @returns {Promise}
526
- * @fulfill {undefined}
527
- * @reject {Error}
528
- *
529
- * @example
530
- * contxtSdk.coordinator.users
531
- * .removeProjectEnvironment('36b8421a-cc4a-4204-b839-1397374fb16b', 'project-environment-slug')
532
- * .catch((err) => console.log(err));
533
- */
534
-
535
- }, {
536
- key: 'removeProjectEnvironment',
537
- value: function removeProjectEnvironment(userId, projectEnvironmentId) {
538
- if (!userId) {
539
- return Promise.reject(new Error('A user ID is required for removing a project environment from a user'));
540
- }
541
-
542
- if (!projectEnvironmentId) {
543
- return Promise.reject(new Error('A project environment slug is required for removing a project environment from a user.'));
544
- }
545
-
546
- return this._request.delete(this._getBaseUrl() + '/users/' + userId + '/project_environments/' + projectEnvironmentId);
3373
+ /**
3374
+ * Removes a application from a user
3375
+ *
3376
+ * API Endpoint: '/users/:userId/applications/:applicationId'
3377
+ * Method: DELETE
3378
+ *
3379
+ * @param {string} userId The ID of the user
3380
+ * @param {string} applicationId The ID of the application
3381
+ *
3382
+ * @returns {Promise}
3383
+ * @fulfill {undefined}
3384
+ * @reject {Error}
3385
+ *
3386
+ * @example
3387
+ * contxtSdk.coordinator.users
3388
+ * .removeApplication('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3389
+ * .catch((err) => console.log(err));
3390
+ */
3391
+ removeApplication(userId, applicationId) {
3392
+ cov_2h1wdje5oy().f[18]++;
3393
+ cov_2h1wdje5oy().s[78]++;
3394
+ if (!userId) {
3395
+ cov_2h1wdje5oy().b[29][0]++;
3396
+ cov_2h1wdje5oy().s[79]++;
3397
+ return Promise.reject(new Error('A user ID is required for removing a application from a user'));
3398
+ } else {
3399
+ cov_2h1wdje5oy().b[29][1]++;
547
3400
  }
3401
+ cov_2h1wdje5oy().s[80]++;
3402
+ if (!applicationId) {
3403
+ cov_2h1wdje5oy().b[30][0]++;
3404
+ cov_2h1wdje5oy().s[81]++;
3405
+ return Promise.reject(new Error('An application ID is required for removing a application from a user'));
3406
+ } else {
3407
+ cov_2h1wdje5oy().b[30][1]++;
3408
+ }
3409
+ cov_2h1wdje5oy().s[82]++;
3410
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}/applications/${applicationId}`);
3411
+ }
548
3412
 
549
- /**
550
- * Syncs the user's roles and application access with the external auth provider
551
- *
552
- * API Endpoint: '/users/:userId/sync'
553
- * Method: GET
554
- *
555
- * @param {string} userId The ID of the user
556
- *
557
- * @returns {Promise}
558
- * @fulfill {undefined}
559
- * @reject {Error}
560
- *
561
- * @example
562
- * contxtSdk.coordinator.users
563
- * .sync('36b8421a-cc4a-4204-b839-1397374fb16b')
564
- * .catch((err) => console.log(err));
565
- */
566
-
567
- }, {
568
- key: 'sync',
569
- value: function sync(userId) {
570
- if (!userId) {
571
- return Promise.reject(new Error('A user ID is required for syncing user permissions'));
572
- }
573
-
574
- return this._request.get(this._getBaseUrl('access') + '/users/' + userId + '/sync');
3413
+ /**
3414
+ * Removes a role from a user
3415
+ *
3416
+ * API Endpoint: '/users/:userId/roles/:roleId'
3417
+ * Method: DELETE
3418
+ *
3419
+ * @param {string} userId The ID of the user
3420
+ * @param {string} roleId The ID of the role
3421
+ *
3422
+ * @returns {Promise}
3423
+ * @fulfill {undefined}
3424
+ * @reject {Error}
3425
+ *
3426
+ * @example
3427
+ * contxtSdk.coordinator.users
3428
+ * .removeRole('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3429
+ * .catch((err) => console.log(err));
3430
+ */
3431
+ removeRole(userId, roleId) {
3432
+ cov_2h1wdje5oy().f[19]++;
3433
+ cov_2h1wdje5oy().s[83]++;
3434
+ if (!userId) {
3435
+ cov_2h1wdje5oy().b[31][0]++;
3436
+ cov_2h1wdje5oy().s[84]++;
3437
+ return Promise.reject(new Error('A user ID is required for removing a role from a user'));
3438
+ } else {
3439
+ cov_2h1wdje5oy().b[31][1]++;
3440
+ }
3441
+ cov_2h1wdje5oy().s[85]++;
3442
+ if (!roleId) {
3443
+ cov_2h1wdje5oy().b[32][0]++;
3444
+ cov_2h1wdje5oy().s[86]++;
3445
+ return Promise.reject(new Error('A role ID is required for removing a role from a user'));
3446
+ } else {
3447
+ cov_2h1wdje5oy().b[32][1]++;
575
3448
  }
576
- }]);
3449
+ cov_2h1wdje5oy().s[87]++;
3450
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}/roles/${roleId}`);
3451
+ }
577
3452
 
578
- return Users;
579
- }();
3453
+ /**
3454
+ * Removes a project environment from a user
3455
+ *
3456
+ * API Endpoint: 'users/:userId/project_environments/:projectEnvironmentSlug
3457
+ * Method: DELETE
3458
+ *
3459
+ * @param {string} userId The ID of the user
3460
+ * @param {string} projectEnvironmentSlug The slug of the project environment
3461
+ *
3462
+ * @returns {Promise}
3463
+ * @fulfill {undefined}
3464
+ * @reject {Error}
3465
+ *
3466
+ * @example
3467
+ * contxtSdk.coordinator.users
3468
+ * .removeProjectEnvironment('36b8421a-cc4a-4204-b839-1397374fb16b', 'project-environment-slug')
3469
+ * .catch((err) => console.log(err));
3470
+ */
3471
+ removeProjectEnvironment(userId, projectEnvironmentId) {
3472
+ cov_2h1wdje5oy().f[20]++;
3473
+ cov_2h1wdje5oy().s[88]++;
3474
+ if (!userId) {
3475
+ cov_2h1wdje5oy().b[33][0]++;
3476
+ cov_2h1wdje5oy().s[89]++;
3477
+ return Promise.reject(new Error('A user ID is required for removing a project environment from a user'));
3478
+ } else {
3479
+ cov_2h1wdje5oy().b[33][1]++;
3480
+ }
3481
+ cov_2h1wdje5oy().s[90]++;
3482
+ if (!projectEnvironmentId) {
3483
+ cov_2h1wdje5oy().b[34][0]++;
3484
+ cov_2h1wdje5oy().s[91]++;
3485
+ return Promise.reject(new Error('A project environment slug is required for removing a project environment from a user.'));
3486
+ } else {
3487
+ cov_2h1wdje5oy().b[34][1]++;
3488
+ }
3489
+ cov_2h1wdje5oy().s[92]++;
3490
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}/project_environments/${projectEnvironmentId}`);
3491
+ }
580
3492
 
581
- export default Users;
3493
+ /**
3494
+ * Syncs the user's roles and application access with the external auth provider
3495
+ *
3496
+ * API Endpoint: '/users/:userId/sync'
3497
+ * Method: GET
3498
+ *
3499
+ * @param {string} userId The ID of the user
3500
+ *
3501
+ * @returns {Promise}
3502
+ * @fulfill {undefined}
3503
+ * @reject {Error}
3504
+ *
3505
+ * @example
3506
+ * contxtSdk.coordinator.users
3507
+ * .sync('36b8421a-cc4a-4204-b839-1397374fb16b')
3508
+ * .catch((err) => console.log(err));
3509
+ */
3510
+ sync(userId) {
3511
+ cov_2h1wdje5oy().f[21]++;
3512
+ cov_2h1wdje5oy().s[93]++;
3513
+ if (!userId) {
3514
+ cov_2h1wdje5oy().b[35][0]++;
3515
+ cov_2h1wdje5oy().s[94]++;
3516
+ return Promise.reject(new Error('A user ID is required for syncing user permissions'));
3517
+ } else {
3518
+ cov_2h1wdje5oy().b[35][1]++;
3519
+ }
3520
+ cov_2h1wdje5oy().s[95]++;
3521
+ return this._request.get(`${this._getBaseUrl('access')}/users/${userId}/sync`);
3522
+ }
3523
+ }
3524
+ var _default = exports.default = Users;
582
3525
  //# sourceMappingURL=users.js.map