@ndustrial/contxt-sdk 5.5.7 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +3393 -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 +3389 -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 +31 -35
  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 +12 -12
  202. package/src/coordinator/users.spec.js +1 -1
  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,2810 @@
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 = "0043c71e40841994c041d938885fbb722855b9bc";
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: 333,
2083
+ column: 4
2084
+ },
2085
+ end: {
2086
+ line: 339,
2087
+ column: 5
2088
+ }
2089
+ },
2090
+ type: "if",
2091
+ locations: [{
2092
+ start: {
2093
+ line: 333,
2094
+ column: 4
2095
+ },
2096
+ end: {
2097
+ line: 339,
2098
+ column: 5
2099
+ }
2100
+ }, {
2101
+ start: {
2102
+ line: undefined,
2103
+ column: undefined
2104
+ },
2105
+ end: {
2106
+ line: undefined,
2107
+ column: undefined
2108
+ }
2109
+ }],
2110
+ line: 333
2111
+ },
2112
+ "19": {
2113
+ loc: {
2114
+ start: {
2115
+ line: 383,
2116
+ column: 25
2117
+ },
2118
+ end: {
2119
+ line: 383,
2120
+ column: 34
2121
+ }
2122
+ },
2123
+ type: "default-arg",
2124
+ locations: [{
2125
+ start: {
2126
+ line: 383,
2127
+ column: 32
2128
+ },
2129
+ end: {
2130
+ line: 383,
2131
+ column: 34
2132
+ }
2133
+ }],
2134
+ line: 383
2135
+ },
2136
+ "20": {
2137
+ loc: {
2138
+ start: {
2139
+ line: 384,
2140
+ column: 4
2141
+ },
2142
+ end: {
2143
+ line: 400,
2144
+ column: 5
2145
+ }
2146
+ },
2147
+ type: "if",
2148
+ locations: [{
2149
+ start: {
2150
+ line: 384,
2151
+ column: 4
2152
+ },
2153
+ end: {
2154
+ line: 400,
2155
+ column: 5
2156
+ }
2157
+ }, {
2158
+ start: {
2159
+ line: undefined,
2160
+ column: undefined
2161
+ },
2162
+ end: {
2163
+ line: undefined,
2164
+ column: undefined
2165
+ }
2166
+ }],
2167
+ line: 384
2168
+ },
2169
+ "21": {
2170
+ loc: {
2171
+ start: {
2172
+ line: 390,
2173
+ column: 8
2174
+ },
2175
+ end: {
2176
+ line: 394,
2177
+ column: 9
2178
+ }
2179
+ },
2180
+ type: "if",
2181
+ locations: [{
2182
+ start: {
2183
+ line: 390,
2184
+ column: 8
2185
+ },
2186
+ end: {
2187
+ line: 394,
2188
+ column: 9
2189
+ }
2190
+ }, {
2191
+ start: {
2192
+ line: undefined,
2193
+ column: undefined
2194
+ },
2195
+ end: {
2196
+ line: undefined,
2197
+ column: undefined
2198
+ }
2199
+ }],
2200
+ line: 390
2201
+ },
2202
+ "22": {
2203
+ loc: {
2204
+ start: {
2205
+ line: 402,
2206
+ column: 4
2207
+ },
2208
+ end: {
2209
+ line: 406,
2210
+ column: 5
2211
+ }
2212
+ },
2213
+ type: "if",
2214
+ locations: [{
2215
+ start: {
2216
+ line: 402,
2217
+ column: 4
2218
+ },
2219
+ end: {
2220
+ line: 406,
2221
+ column: 5
2222
+ }
2223
+ }, {
2224
+ start: {
2225
+ line: undefined,
2226
+ column: undefined
2227
+ },
2228
+ end: {
2229
+ line: undefined,
2230
+ column: undefined
2231
+ }
2232
+ }],
2233
+ line: 402
2234
+ },
2235
+ "23": {
2236
+ loc: {
2237
+ start: {
2238
+ line: 413,
2239
+ column: 6
2240
+ },
2241
+ end: {
2242
+ line: 417,
2243
+ column: 7
2244
+ }
2245
+ },
2246
+ type: "if",
2247
+ locations: [{
2248
+ start: {
2249
+ line: 413,
2250
+ column: 6
2251
+ },
2252
+ end: {
2253
+ line: 417,
2254
+ column: 7
2255
+ }
2256
+ }, {
2257
+ start: {
2258
+ line: undefined,
2259
+ column: undefined
2260
+ },
2261
+ end: {
2262
+ line: undefined,
2263
+ column: undefined
2264
+ }
2265
+ }],
2266
+ line: 413
2267
+ },
2268
+ "24": {
2269
+ loc: {
2270
+ start: {
2271
+ line: 448,
2272
+ column: 4
2273
+ },
2274
+ end: {
2275
+ line: 458,
2276
+ column: 5
2277
+ }
2278
+ },
2279
+ type: "if",
2280
+ locations: [{
2281
+ start: {
2282
+ line: 448,
2283
+ column: 4
2284
+ },
2285
+ end: {
2286
+ line: 458,
2287
+ column: 5
2288
+ }
2289
+ }, {
2290
+ start: {
2291
+ line: undefined,
2292
+ column: undefined
2293
+ },
2294
+ end: {
2295
+ line: undefined,
2296
+ column: undefined
2297
+ }
2298
+ }],
2299
+ line: 448
2300
+ },
2301
+ "25": {
2302
+ loc: {
2303
+ start: {
2304
+ line: 449,
2305
+ column: 6
2306
+ },
2307
+ end: {
2308
+ line: 455,
2309
+ column: 7
2310
+ }
2311
+ },
2312
+ type: "if",
2313
+ locations: [{
2314
+ start: {
2315
+ line: 449,
2316
+ column: 6
2317
+ },
2318
+ end: {
2319
+ line: 455,
2320
+ column: 7
2321
+ }
2322
+ }, {
2323
+ start: {
2324
+ line: undefined,
2325
+ column: undefined
2326
+ },
2327
+ end: {
2328
+ line: undefined,
2329
+ column: undefined
2330
+ }
2331
+ }],
2332
+ line: 449
2333
+ },
2334
+ "26": {
2335
+ loc: {
2336
+ start: {
2337
+ line: 460,
2338
+ column: 4
2339
+ },
2340
+ end: {
2341
+ line: 466,
2342
+ column: 5
2343
+ }
2344
+ },
2345
+ type: "if",
2346
+ locations: [{
2347
+ start: {
2348
+ line: 460,
2349
+ column: 4
2350
+ },
2351
+ end: {
2352
+ line: 466,
2353
+ column: 5
2354
+ }
2355
+ }, {
2356
+ start: {
2357
+ line: undefined,
2358
+ column: undefined
2359
+ },
2360
+ end: {
2361
+ line: undefined,
2362
+ column: undefined
2363
+ }
2364
+ }],
2365
+ line: 460
2366
+ },
2367
+ "27": {
2368
+ loc: {
2369
+ start: {
2370
+ line: 468,
2371
+ column: 4
2372
+ },
2373
+ end: {
2374
+ line: 474,
2375
+ column: 5
2376
+ }
2377
+ },
2378
+ type: "if",
2379
+ locations: [{
2380
+ start: {
2381
+ line: 468,
2382
+ column: 4
2383
+ },
2384
+ end: {
2385
+ line: 474,
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: 468
2399
+ },
2400
+ "28": {
2401
+ loc: {
2402
+ start: {
2403
+ line: 502,
2404
+ column: 4
2405
+ },
2406
+ end: {
2407
+ line: 508,
2408
+ column: 5
2409
+ }
2410
+ },
2411
+ type: "if",
2412
+ locations: [{
2413
+ start: {
2414
+ line: 502,
2415
+ column: 4
2416
+ },
2417
+ end: {
2418
+ line: 508,
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: 502
2432
+ },
2433
+ "29": {
2434
+ loc: {
2435
+ start: {
2436
+ line: 510,
2437
+ column: 4
2438
+ },
2439
+ end: {
2440
+ line: 516,
2441
+ column: 5
2442
+ }
2443
+ },
2444
+ type: "if",
2445
+ locations: [{
2446
+ start: {
2447
+ line: 510,
2448
+ column: 4
2449
+ },
2450
+ end: {
2451
+ line: 516,
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: 510
2465
+ },
2466
+ "30": {
2467
+ loc: {
2468
+ start: {
2469
+ line: 542,
2470
+ column: 4
2471
+ },
2472
+ end: {
2473
+ line: 546,
2474
+ column: 5
2475
+ }
2476
+ },
2477
+ type: "if",
2478
+ locations: [{
2479
+ start: {
2480
+ line: 542,
2481
+ column: 4
2482
+ },
2483
+ end: {
2484
+ line: 546,
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: 542
2498
+ },
2499
+ "31": {
2500
+ loc: {
2501
+ start: {
2502
+ line: 548,
2503
+ column: 4
2504
+ },
2505
+ end: {
2506
+ line: 552,
2507
+ column: 5
2508
+ }
2509
+ },
2510
+ type: "if",
2511
+ locations: [{
2512
+ start: {
2513
+ line: 548,
2514
+ column: 4
2515
+ },
2516
+ end: {
2517
+ line: 552,
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: 548
2531
+ },
2532
+ "32": {
2533
+ loc: {
2534
+ start: {
2535
+ line: 578,
2536
+ column: 4
2537
+ },
2538
+ end: {
2539
+ line: 584,
2540
+ column: 5
2541
+ }
2542
+ },
2543
+ type: "if",
2544
+ locations: [{
2545
+ start: {
2546
+ line: 578,
2547
+ column: 4
2548
+ },
2549
+ end: {
2550
+ line: 584,
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: 578
2564
+ },
2565
+ "33": {
2566
+ loc: {
2567
+ start: {
2568
+ line: 586,
2569
+ column: 4
2570
+ },
2571
+ end: {
2572
+ line: 592,
2573
+ column: 5
2574
+ }
2575
+ },
2576
+ type: "if",
2577
+ locations: [{
2578
+ start: {
2579
+ line: 586,
2580
+ column: 4
2581
+ },
2582
+ end: {
2583
+ line: 592,
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: 586
2597
+ },
2598
+ "34": {
2599
+ loc: {
2600
+ start: {
2601
+ line: 617,
2602
+ column: 4
2603
+ },
2604
+ end: {
2605
+ line: 621,
2606
+ column: 5
2607
+ }
2608
+ },
2609
+ type: "if",
2610
+ locations: [{
2611
+ start: {
2612
+ line: 617,
2613
+ column: 4
2614
+ },
2615
+ end: {
2616
+ line: 621,
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: 617
2630
+ }
2631
+ },
2632
+ s: {
2633
+ "0": 0,
2634
+ "1": 0,
2635
+ "2": 0,
2636
+ "3": 0,
2637
+ "4": 0,
2638
+ "5": 0,
2639
+ "6": 0,
2640
+ "7": 0,
2641
+ "8": 0,
2642
+ "9": 0,
2643
+ "10": 0,
2644
+ "11": 0,
2645
+ "12": 0,
2646
+ "13": 0,
2647
+ "14": 0,
2648
+ "15": 0,
2649
+ "16": 0,
2650
+ "17": 0,
2651
+ "18": 0,
2652
+ "19": 0,
2653
+ "20": 0,
2654
+ "21": 0,
2655
+ "22": 0,
2656
+ "23": 0,
2657
+ "24": 0,
2658
+ "25": 0,
2659
+ "26": 0,
2660
+ "27": 0,
2661
+ "28": 0,
2662
+ "29": 0,
2663
+ "30": 0,
2664
+ "31": 0,
2665
+ "32": 0,
2666
+ "33": 0,
2667
+ "34": 0,
2668
+ "35": 0,
2669
+ "36": 0,
2670
+ "37": 0,
2671
+ "38": 0,
2672
+ "39": 0,
2673
+ "40": 0,
2674
+ "41": 0,
2675
+ "42": 0,
2676
+ "43": 0,
2677
+ "44": 0,
2678
+ "45": 0,
2679
+ "46": 0,
2680
+ "47": 0,
2681
+ "48": 0,
2682
+ "49": 0,
2683
+ "50": 0,
2684
+ "51": 0,
2685
+ "52": 0,
2686
+ "53": 0,
2687
+ "54": 0,
2688
+ "55": 0,
2689
+ "56": 0,
2690
+ "57": 0,
2691
+ "58": 0,
2692
+ "59": 0,
2693
+ "60": 0,
2694
+ "61": 0,
2695
+ "62": 0,
2696
+ "63": 0,
2697
+ "64": 0,
2698
+ "65": 0,
2699
+ "66": 0,
2700
+ "67": 0,
2701
+ "68": 0,
2702
+ "69": 0,
2703
+ "70": 0,
2704
+ "71": 0,
2705
+ "72": 0,
2706
+ "73": 0,
2707
+ "74": 0,
2708
+ "75": 0,
2709
+ "76": 0,
2710
+ "77": 0,
2711
+ "78": 0,
2712
+ "79": 0,
2713
+ "80": 0,
2714
+ "81": 0,
2715
+ "82": 0,
2716
+ "83": 0,
2717
+ "84": 0,
2718
+ "85": 0,
2719
+ "86": 0,
2720
+ "87": 0,
2721
+ "88": 0,
2722
+ "89": 0,
2723
+ "90": 0,
2724
+ "91": 0,
2725
+ "92": 0,
2726
+ "93": 0,
2727
+ "94": 0,
2728
+ "95": 0
2729
+ },
2730
+ f: {
2731
+ "0": 0,
2732
+ "1": 0,
2733
+ "2": 0,
2734
+ "3": 0,
2735
+ "4": 0,
2736
+ "5": 0,
2737
+ "6": 0,
2738
+ "7": 0,
2739
+ "8": 0,
2740
+ "9": 0,
2741
+ "10": 0,
2742
+ "11": 0,
2743
+ "12": 0,
2744
+ "13": 0,
2745
+ "14": 0,
2746
+ "15": 0,
2747
+ "16": 0,
2748
+ "17": 0,
2749
+ "18": 0,
2750
+ "19": 0,
2751
+ "20": 0,
2752
+ "21": 0
2753
+ },
2754
+ b: {
2755
+ "0": [0],
2756
+ "1": [0],
2757
+ "2": [0],
2758
+ "3": [0, 0, 0],
2759
+ "4": [0, 0],
2760
+ "5": [0, 0],
2761
+ "6": [0],
2762
+ "7": [0, 0],
2763
+ "8": [0, 0],
2764
+ "9": [0, 0],
2765
+ "10": [0, 0],
2766
+ "11": [0, 0],
2767
+ "12": [0, 0],
2768
+ "13": [0, 0],
2769
+ "14": [0, 0],
2770
+ "15": [0, 0],
2771
+ "16": [0, 0],
2772
+ "17": [0, 0],
2773
+ "18": [0, 0],
2774
+ "19": [0],
2775
+ "20": [0, 0],
2776
+ "21": [0, 0],
2777
+ "22": [0, 0],
2778
+ "23": [0, 0],
2779
+ "24": [0, 0],
2780
+ "25": [0, 0],
2781
+ "26": [0, 0],
2782
+ "27": [0, 0],
2783
+ "28": [0, 0],
2784
+ "29": [0, 0],
2785
+ "30": [0, 0],
2786
+ "31": [0, 0],
2787
+ "32": [0, 0],
2788
+ "33": [0, 0],
2789
+ "34": [0, 0]
2790
+ },
2791
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
2792
+ hash: "0043c71e40841994c041d938885fbb722855b9bc"
2793
+ };
2794
+ var coverage = global[gcv] || (global[gcv] = {});
2795
+ if (!coverage[path] || coverage[path].hash !== hash) {
2796
+ coverage[path] = coverageData;
2797
+ }
2798
+ var actualCoverage = coverage[path];
2799
+ {
2800
+ // @ts-ignore
2801
+ cov_2h1wdje5oy = function () {
2802
+ return actualCoverage;
2803
+ };
2804
+ }
2805
+ return actualCoverage;
2806
+ }
2807
+ cov_2h1wdje5oy();
9
2808
  /**
10
2809
  * @typedef {Object} ContxtUser
11
2810
  * @property {string} createdAt ISO 8601 Extended Format date/time string
@@ -53,8 +2852,7 @@ import { toCamelCase, toSnakeCase } from '../utils/objects';
53
2852
  *
54
2853
  * @typicalname contxtSdk.coordinator.users
55
2854
  */
56
-
57
- var Users = function () {
2855
+ class Users {
58
2856
  /**
59
2857
  * @param {Object} sdk An instance of the SDK so the module can communicate with other modules
60
2858
  * @param {Object} request An instance of the request module tied to this module's audience.
@@ -63,520 +2861,631 @@ var Users = function () {
63
2861
  * @param {string} [legacyBaseUrl] The legacy base URL provided by the parent module
64
2862
  * @param {string} [organizationId] The organization ID to be used in tenant url requests
65
2863
  */
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
-
2864
+ constructor(sdk, request, baseUrl) {
2865
+ let tenantBaseUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (cov_2h1wdje5oy().b[0][0]++, null);
2866
+ let legacyBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : (cov_2h1wdje5oy().b[1][0]++, null);
2867
+ let organizationId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : (cov_2h1wdje5oy().b[2][0]++, null);
2868
+ cov_2h1wdje5oy().f[0]++;
2869
+ cov_2h1wdje5oy().s[0]++;
73
2870
  this._baseUrl = baseUrl;
2871
+ cov_2h1wdje5oy().s[1]++;
74
2872
  this._tenantBaseUrl = tenantBaseUrl;
2873
+ cov_2h1wdje5oy().s[2]++;
75
2874
  this._legacyBaseUrl = legacyBaseUrl;
2875
+ cov_2h1wdje5oy().s[3]++;
76
2876
  this._request = request;
2877
+ cov_2h1wdje5oy().s[4]++;
77
2878
  this._sdk = sdk;
2879
+ cov_2h1wdje5oy().s[5]++;
78
2880
  this._organizationId = organizationId;
79
2881
  }
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
- }
2882
+ _getBaseUrl(type) {
2883
+ cov_2h1wdje5oy().f[1]++;
2884
+ cov_2h1wdje5oy().s[6]++;
2885
+ switch (type) {
2886
+ case 'legacy':
2887
+ cov_2h1wdje5oy().b[3][0]++;
2888
+ cov_2h1wdje5oy().s[7]++;
2889
+ return (cov_2h1wdje5oy().b[4][0]++, this._legacyBaseUrl) || (cov_2h1wdje5oy().b[4][1]++, this._baseUrl);
2890
+ case 'access':
2891
+ cov_2h1wdje5oy().b[3][1]++;
2892
+ cov_2h1wdje5oy().s[8]++;
2893
+ return this._baseUrl;
2894
+ default:
2895
+ cov_2h1wdje5oy().b[3][2]++;
2896
+ cov_2h1wdje5oy().s[9]++;
2897
+ return (cov_2h1wdje5oy().b[5][0]++, this._tenantBaseUrl) || (cov_2h1wdje5oy().b[5][1]++, this._baseUrl);
94
2898
  }
2899
+ }
95
2900
 
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));
2901
+ /**
2902
+ * Activates a new user
2903
+ *
2904
+ * API Endpoint: '/users/:userId/activate'
2905
+ * Method: POST
2906
+ *
2907
+ * Note: Only valid for web users using auth0WebAuth session type
2908
+ *
2909
+ * @param {string} userId The ID of the user to activate
2910
+ * @param {Object} user
2911
+ * @param {string} user.email The email address of the user
2912
+ * @param {string} user.password The password to set for the user
2913
+ * @param {string} user.userToken The JWT token provided by the invite link
2914
+ *
2915
+ * @returns {Promise}
2916
+ * @fulfill {undefined}
2917
+ * @reject {Error}
2918
+ *
2919
+ * @example
2920
+ * contxtSdk.coordinator.users
2921
+ * .activate('7bb79bdf-7492-45c2-8640-2dde63535827', {
2922
+ * email: 'bob.sagat56@gmail.com',
2923
+ * password: 'ds32jX32jaMM1Nr',
2924
+ * userToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
2925
+ * })
2926
+ * .then(() => console.log("User Activated"))
2927
+ * .catch((err) => console.log(err));
2928
+ */
2929
+ activate(userId) {
2930
+ let user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_2h1wdje5oy().b[6][0]++, {});
2931
+ cov_2h1wdje5oy().f[2]++;
2932
+ cov_2h1wdje5oy().s[10]++;
2933
+ if (!userId) {
2934
+ cov_2h1wdje5oy().b[7][0]++;
2935
+ cov_2h1wdje5oy().s[11]++;
2936
+ return Promise.reject(new Error('A user ID is required for activating a user'));
2937
+ } else {
2938
+ cov_2h1wdje5oy().b[7][1]++;
146
2939
  }
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'));
173
- }
174
-
175
- if (!applicationId) {
176
- return Promise.reject(new Error('An application ID is required for adding a application to a user'));
2940
+ const requiredFields = (cov_2h1wdje5oy().s[12]++, ['email', 'password', 'userToken']);
2941
+ cov_2h1wdje5oy().s[13]++;
2942
+ for (let i = (cov_2h1wdje5oy().s[14]++, 0); requiredFields.length > i; i++) {
2943
+ const field = (cov_2h1wdje5oy().s[15]++, requiredFields[i]);
2944
+ cov_2h1wdje5oy().s[16]++;
2945
+ if (!user[field]) {
2946
+ cov_2h1wdje5oy().b[8][0]++;
2947
+ cov_2h1wdje5oy().s[17]++;
2948
+ return Promise.reject(new Error(`A ${field} is required to activate a user.`));
2949
+ } else {
2950
+ cov_2h1wdje5oy().b[8][1]++;
177
2951
  }
178
-
179
- return this._request.post(this._getBaseUrl() + '/users/' + userId + '/applications/' + applicationId).then(function (response) {
180
- return toCamelCase(response);
181
- });
182
2952
  }
183
2953
 
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
- }
2954
+ // Uses axios directly instead of this.request to bypass authorization interceptors
2955
+ cov_2h1wdje5oy().s[18]++;
2956
+ return _axios.default.post(`${this._getBaseUrl('access')}/users/${userId}/activate`, _objects.default.toSnakeCase(user));
2957
+ }
214
2958
 
215
- return this._request.post(this._getBaseUrl() + '/users/' + userId + '/roles/' + roleId).then(function (response) {
216
- return toCamelCase(response);
217
- });
2959
+ /**
2960
+ * Adds a application to a user
2961
+ *
2962
+ * API Endpoint: '/users/:userId/applications/:applicationId'
2963
+ * Method: GET
2964
+ *
2965
+ * @param {string} userId The ID of the user
2966
+ * @param {string} applicationId The ID of the application
2967
+ *
2968
+ * @returns {Promise}
2969
+ * @fulfill {ContxtUserApplication} The newly created user application
2970
+ * @reject {Error}
2971
+ *
2972
+ * @example
2973
+ * contxtSdk.coordinator.users
2974
+ * .addApplication('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
2975
+ * .then((userApplication) => console.log(userApplication))
2976
+ * .catch((err) => console.log(err));
2977
+ */
2978
+ addApplication(userId, applicationId) {
2979
+ cov_2h1wdje5oy().f[3]++;
2980
+ cov_2h1wdje5oy().s[19]++;
2981
+ if (!userId) {
2982
+ cov_2h1wdje5oy().b[9][0]++;
2983
+ cov_2h1wdje5oy().s[20]++;
2984
+ return Promise.reject(new Error('A user ID is required for adding a application to a user'));
2985
+ } else {
2986
+ cov_2h1wdje5oy().b[9][1]++;
218
2987
  }
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
- });
2988
+ cov_2h1wdje5oy().s[21]++;
2989
+ if (!applicationId) {
2990
+ cov_2h1wdje5oy().b[10][0]++;
2991
+ cov_2h1wdje5oy().s[22]++;
2992
+ return Promise.reject(new Error('An application ID is required for adding a application to a user'));
2993
+ } else {
2994
+ cov_2h1wdje5oy().b[10][1]++;
261
2995
  }
2996
+ cov_2h1wdje5oy().s[23]++;
2997
+ return this._request.post(`${this._getBaseUrl()}/users/${userId}/applications/${applicationId}`).then(response => {
2998
+ cov_2h1wdje5oy().f[4]++;
2999
+ cov_2h1wdje5oy().s[24]++;
3000
+ return _objects.default.toCamelCase(response);
3001
+ });
3002
+ }
262
3003
 
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
- });
3004
+ /**
3005
+ * Adds a role to a user
3006
+ *
3007
+ * API Endpoint: '/users/:userId/roles/:roleId'
3008
+ * Method: POST
3009
+ *
3010
+ * @param {string} userId The ID of the user
3011
+ * @param {string} roleId The ID of the role
3012
+ *
3013
+ * @returns {Promise}
3014
+ * @fulfill {ContxtUserRole} The newly created user role
3015
+ * @reject {Error}
3016
+ *
3017
+ * @example
3018
+ * contxtSdk.coordinator.users
3019
+ * .addRole('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3020
+ * .then((userRole) => console.log(userRole))
3021
+ * .catch((err) => console.log(err));
3022
+ */
3023
+ addRole(userId, roleId) {
3024
+ cov_2h1wdje5oy().f[5]++;
3025
+ cov_2h1wdje5oy().s[25]++;
3026
+ if (!userId) {
3027
+ cov_2h1wdje5oy().b[11][0]++;
3028
+ cov_2h1wdje5oy().s[26]++;
3029
+ return Promise.reject(new Error('A user ID is required for adding a role to a user'));
3030
+ } else {
3031
+ cov_2h1wdje5oy().b[11][1]++;
292
3032
  }
3033
+ cov_2h1wdje5oy().s[27]++;
3034
+ if (!roleId) {
3035
+ cov_2h1wdje5oy().b[12][0]++;
3036
+ cov_2h1wdje5oy().s[28]++;
3037
+ return Promise.reject(new Error('A role ID is required for adding a role to a user'));
3038
+ } else {
3039
+ cov_2h1wdje5oy().b[12][1]++;
3040
+ }
3041
+ cov_2h1wdje5oy().s[29]++;
3042
+ return this._request.post(`${this._getBaseUrl()}/users/${userId}/roles/${roleId}`).then(response => {
3043
+ cov_2h1wdje5oy().f[6]++;
3044
+ cov_2h1wdje5oy().s[30]++;
3045
+ return _objects.default.toCamelCase(response);
3046
+ });
3047
+ }
293
3048
 
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
- }
3049
+ /**
3050
+ * Adds a project environment to a user
3051
+ *
3052
+ * API Endpoint: '/users/:userId/project_environments/:projectEnvironmentSlug
3053
+ * Method: POST
3054
+ *
3055
+ * @param {string} userId The ID of the user
3056
+ * @param {string} projectEnvironmentSlug The slug of the project environment
3057
+ * @param {'reader' | 'admin'} accessType The level of access for the user
3058
+ *
3059
+ * @returns {Promise}
3060
+ * @fulfill {ContxtUserProjectEnvironment} The newly created user project environment
3061
+ * @reject {Error}
3062
+ *
3063
+ * @example
3064
+ * contxtSdk.coordinator.users
3065
+ * .addProjectEnvironment('36b8421a-cc4a-4204-b839-1397374fb16b', 'project-environment-slug', 'admin')
3066
+ * .then((userProject) => console.log(userProject))
3067
+ * .catch((err) => console.log(err));
3068
+ */
3069
+ addProjectEnvironment(userId, projectEnvironmentId, accessType) {
3070
+ cov_2h1wdje5oy().f[7]++;
3071
+ cov_2h1wdje5oy().s[31]++;
3072
+ if (!userId) {
3073
+ cov_2h1wdje5oy().b[13][0]++;
3074
+ cov_2h1wdje5oy().s[32]++;
3075
+ return Promise.reject(new Error('A user ID is required for adding a project environment to a user'));
3076
+ } else {
3077
+ cov_2h1wdje5oy().b[13][1]++;
3078
+ }
3079
+ cov_2h1wdje5oy().s[33]++;
3080
+ if (!projectEnvironmentId) {
3081
+ cov_2h1wdje5oy().b[14][0]++;
3082
+ cov_2h1wdje5oy().s[34]++;
3083
+ return Promise.reject(new Error('A project environment slug is required for adding a project environment to a user.'));
3084
+ } else {
3085
+ cov_2h1wdje5oy().b[14][1]++;
3086
+ }
3087
+ cov_2h1wdje5oy().s[35]++;
3088
+ if (['reader', 'admin'].indexOf(accessType) === -1) {
3089
+ cov_2h1wdje5oy().b[15][0]++;
3090
+ cov_2h1wdje5oy().s[36]++;
3091
+ return Promise.reject(new Error('An access type of "reader" or "admin" is required for adding a project environment to a user'));
3092
+ } else {
3093
+ cov_2h1wdje5oy().b[15][1]++;
3094
+ }
3095
+ cov_2h1wdje5oy().s[37]++;
3096
+ return this._request.post(`${this._getBaseUrl()}/users/${userId}/project_environments/${projectEnvironmentId}`, {
3097
+ access_type: accessType
3098
+ }).then(response => {
3099
+ cov_2h1wdje5oy().f[8]++;
3100
+ cov_2h1wdje5oy().s[38]++;
3101
+ return _objects.default.toCamelCase(response);
3102
+ });
3103
+ }
322
3104
 
323
- if (!organizationId) {
324
- return Promise.reject(new Error('An organization ID is required for getting a list of users for an organization'));
325
- }
3105
+ /**
3106
+ * Gets information about a contxt user
3107
+ *
3108
+ * API Endpoint: '/users/:userId'
3109
+ * Method: GET
3110
+ *
3111
+ * @param {string} userId The ID of the user
3112
+ *
3113
+ * @returns {Promise}
3114
+ * @fulfill {ContxtUser} Information about a contxt user
3115
+ * @reject {Error}
3116
+ *
3117
+ * @example
3118
+ * contxtSdk.coordinator.users
3119
+ * .get('auth0|12345')
3120
+ * .then((user) => console.log(user))
3121
+ * .catch((err) => console.log(err));
3122
+ */
3123
+ get(userId) {
3124
+ cov_2h1wdje5oy().f[9]++;
3125
+ cov_2h1wdje5oy().s[39]++;
3126
+ if (!userId) {
3127
+ cov_2h1wdje5oy().b[16][0]++;
3128
+ cov_2h1wdje5oy().s[40]++;
3129
+ return Promise.reject(new Error('A user ID is required for getting information about a user'));
3130
+ } else {
3131
+ cov_2h1wdje5oy().b[16][1]++;
3132
+ }
3133
+ cov_2h1wdje5oy().s[41]++;
3134
+ return this._request.get(`${this._getBaseUrl('access')}/users/${userId}`).then(user => {
3135
+ cov_2h1wdje5oy().f[10]++;
3136
+ cov_2h1wdje5oy().s[42]++;
3137
+ return _objects.default.toCamelCase(user);
3138
+ });
3139
+ }
326
3140
 
327
- return this._request.get(this._getBaseUrl('legacy') + '/organizations/' + organizationId + '/users').then(function (orgUsers) {
328
- return toCamelCase(orgUsers);
3141
+ /**
3142
+ * Gets a list of users for a contxt organization
3143
+ *
3144
+ * Legacy API Endpoint: '/organizations/:organizationId/users'
3145
+ * API Endpoint: '/users'
3146
+ * Method: GET
3147
+ *
3148
+ * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
3149
+ *
3150
+ * @returns {Promise}
3151
+ * @fulfill {ContxtUser[]} List of users for a contxt organization
3152
+ * @reject {Error}
3153
+ *
3154
+ * @example
3155
+ * contxtSdk.coordinator.users
3156
+ * .getByOrganizationId('36b8421a-cc4a-4204-b839-1397374fb16b')
3157
+ * .then((orgUsers) => console.log(orgUsers))
3158
+ * .catch((err) => console.log(err));
3159
+ */
3160
+ getByOrganizationId(organizationId) {
3161
+ cov_2h1wdje5oy().f[11]++;
3162
+ cov_2h1wdje5oy().s[43]++;
3163
+ if (this._organizationId) {
3164
+ cov_2h1wdje5oy().b[17][0]++;
3165
+ cov_2h1wdje5oy().s[44]++;
3166
+ return this._request.get(`${this._getBaseUrl()}/users`).then(orgUsers => {
3167
+ cov_2h1wdje5oy().f[12]++;
3168
+ cov_2h1wdje5oy().s[45]++;
3169
+ return _objects.default.toCamelCase(orgUsers);
329
3170
  });
3171
+ } else {
3172
+ cov_2h1wdje5oy().b[17][1]++;
330
3173
  }
3174
+ cov_2h1wdje5oy().s[46]++;
3175
+ if (!organizationId) {
3176
+ cov_2h1wdje5oy().b[18][0]++;
3177
+ cov_2h1wdje5oy().s[47]++;
3178
+ return Promise.reject(new Error('An organization ID is required for getting a list of users for an organization'));
3179
+ } else {
3180
+ cov_2h1wdje5oy().b[18][1]++;
3181
+ }
3182
+ cov_2h1wdje5oy().s[48]++;
3183
+ return this._request.get(`${this._getBaseUrl('legacy')}/organizations/${organizationId}/users`).then(orgUsers => {
3184
+ cov_2h1wdje5oy().f[13]++;
3185
+ cov_2h1wdje5oy().s[49]++;
3186
+ return _objects.default.toCamelCase(orgUsers);
3187
+ });
3188
+ }
331
3189
 
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.'));
3190
+ /**
3191
+ * Creates a new contxt user, adds them to an organization, and
3192
+ * sends them an email invite link to do final account setup.
3193
+ *
3194
+ * Legacy API Endpoint: '/organizations/:organizationId/users'
3195
+ * API Endpoint: '/users'
3196
+ * Method: POST
3197
+ *
3198
+ * Note: Only valid for web users using auth0WebAuth session type
3199
+ *
3200
+ * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
3201
+ * @param {Object} user
3202
+ * @param {string} user.email The email address of the new user
3203
+ * @param {string} user.firstName The first name of the new user
3204
+ * @param {string} user.lastName The last name of the new user
3205
+ * @param {string} user.redirectUrl The url that the user will be redirected
3206
+ * to after using the invite email link. Typically this is an /activate
3207
+ * endpoint that accepts url query params userToken and userId and uses them
3208
+ * to do final activation on the user's account.
3209
+ *
3210
+ * @returns {Promise}
3211
+ * @fulfill {ContxtUser} The new user
3212
+ * @reject {Error}
3213
+ *
3214
+ * @example
3215
+ * contxtSdk.coordinator.users
3216
+ * .invite('fdf01507-a26a-4dfe-89a2-bc91861169b8', {
3217
+ * email: 'bob.sagat56@gmail.com',
3218
+ * firstName: 'Bob',
3219
+ * lastName: 'Sagat',
3220
+ * redirectUrl: 'https://contxt.ndustrial.io/activate'
3221
+ * })
3222
+ * .then((newUser) => console.log(newUser))
3223
+ * .catch((err) => console.log(err));
3224
+ */
3225
+ invite(organizationId) {
3226
+ let user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (cov_2h1wdje5oy().b[19][0]++, {});
3227
+ cov_2h1wdje5oy().f[14]++;
3228
+ cov_2h1wdje5oy().s[50]++;
3229
+ if (this._organizationId) {
3230
+ cov_2h1wdje5oy().b[20][0]++;
3231
+ const requiredFields = (cov_2h1wdje5oy().s[51]++, ['email', 'firstName', 'lastName', 'redirectUrl']);
3232
+ cov_2h1wdje5oy().s[52]++;
3233
+ for (let i = (cov_2h1wdje5oy().s[53]++, 0); requiredFields.length > i; i++) {
3234
+ const field = (cov_2h1wdje5oy().s[54]++, requiredFields[i]);
3235
+ cov_2h1wdje5oy().s[55]++;
3236
+ if (!user[field]) {
3237
+ cov_2h1wdje5oy().b[21][0]++;
3238
+ cov_2h1wdje5oy().s[56]++;
3239
+ return Promise.reject(new Error(`A ${field} is required to create a new user.`));
3240
+ } else {
3241
+ cov_2h1wdje5oy().b[21][1]++;
400
3242
  }
401
3243
  }
402
-
403
- return this._request.post(this._getBaseUrl('legacy') + '/organizations/' + organizationId + '/users', toSnakeCase(user)).then(function (response) {
404
- return toCamelCase(response);
3244
+ cov_2h1wdje5oy().s[57]++;
3245
+ return this._request.post(`${this._getBaseUrl()}/users`, _objects.default.toSnakeCase(user)).then(response => {
3246
+ cov_2h1wdje5oy().f[15]++;
3247
+ cov_2h1wdje5oy().s[58]++;
3248
+ return _objects.default.toCamelCase(response);
405
3249
  });
3250
+ } else {
3251
+ cov_2h1wdje5oy().b[20][1]++;
406
3252
  }
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'));
3253
+ cov_2h1wdje5oy().s[59]++;
3254
+ if (!organizationId) {
3255
+ cov_2h1wdje5oy().b[22][0]++;
3256
+ cov_2h1wdje5oy().s[60]++;
3257
+ return Promise.reject(new Error('An organization ID is required for inviting a new user'));
3258
+ } else {
3259
+ cov_2h1wdje5oy().b[22][1]++;
3260
+ }
3261
+ const requiredFields = (cov_2h1wdje5oy().s[61]++, ['email', 'firstName', 'lastName', 'redirectUrl']);
3262
+ cov_2h1wdje5oy().s[62]++;
3263
+ for (let i = (cov_2h1wdje5oy().s[63]++, 0); requiredFields.length > i; i++) {
3264
+ const field = (cov_2h1wdje5oy().s[64]++, requiredFields[i]);
3265
+ cov_2h1wdje5oy().s[65]++;
3266
+ if (!user[field]) {
3267
+ cov_2h1wdje5oy().b[23][0]++;
3268
+ cov_2h1wdje5oy().s[66]++;
3269
+ return Promise.reject(new Error(`A ${field} is required to create a new user.`));
3270
+ } else {
3271
+ cov_2h1wdje5oy().b[23][1]++;
441
3272
  }
3273
+ }
3274
+ cov_2h1wdje5oy().s[67]++;
3275
+ return this._request.post(`${this._getBaseUrl('legacy')}/organizations/${organizationId}/users`, _objects.default.toSnakeCase(user)).then(response => {
3276
+ cov_2h1wdje5oy().f[16]++;
3277
+ cov_2h1wdje5oy().s[68]++;
3278
+ return _objects.default.toCamelCase(response);
3279
+ });
3280
+ }
442
3281
 
3282
+ /**
3283
+ * Removes a user from an organization
3284
+ *
3285
+ * Legacy API Endpoint: '/organizations/:organizationId/users/:userId'
3286
+ * API Endpoint: '/users/:userId'
3287
+ * Method: DELETE
3288
+ *
3289
+ * @param {string} organizationId The ID of the organization, optional when using the tenant API and an organization ID has been set
3290
+ * @param {string} userId The ID of the user
3291
+ *
3292
+ * @returns {Promise}
3293
+ * @fulfill {undefined}
3294
+ * @reject {Error}
3295
+ *
3296
+ * @example
3297
+ * contxtSdk.coordinator.users
3298
+ * .remove('ed2e8e24-79ef-4404-bf5f-995ef31b2298', '4a577e87-7437-4342-b183-00c18ec26d52')
3299
+ * .catch((err) => console.log(err));
3300
+ */
3301
+ remove(organizationId, userId) {
3302
+ cov_2h1wdje5oy().f[17]++;
3303
+ cov_2h1wdje5oy().s[69]++;
3304
+ if (this._organizationId) {
3305
+ cov_2h1wdje5oy().b[24][0]++;
3306
+ cov_2h1wdje5oy().s[70]++;
443
3307
  if (!userId) {
3308
+ cov_2h1wdje5oy().b[25][0]++;
3309
+ cov_2h1wdje5oy().s[71]++;
444
3310
  return Promise.reject(new Error('A user ID is required for removing a user from an organization'));
3311
+ } else {
3312
+ cov_2h1wdje5oy().b[25][1]++;
445
3313
  }
446
-
447
- return this._request.delete(this._getBaseUrl('legacy') + '/organizations/' + organizationId + '/users/' + userId);
3314
+ cov_2h1wdje5oy().s[72]++;
3315
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}`);
3316
+ } else {
3317
+ cov_2h1wdje5oy().b[24][1]++;
448
3318
  }
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);
3319
+ cov_2h1wdje5oy().s[73]++;
3320
+ if (!organizationId) {
3321
+ cov_2h1wdje5oy().b[26][0]++;
3322
+ cov_2h1wdje5oy().s[74]++;
3323
+ return Promise.reject(new Error('An organization ID is required for removing a user from an organization'));
3324
+ } else {
3325
+ cov_2h1wdje5oy().b[26][1]++;
481
3326
  }
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);
3327
+ cov_2h1wdje5oy().s[75]++;
3328
+ if (!userId) {
3329
+ cov_2h1wdje5oy().b[27][0]++;
3330
+ cov_2h1wdje5oy().s[76]++;
3331
+ return Promise.reject(new Error('A user ID is required for removing a user from an organization'));
3332
+ } else {
3333
+ cov_2h1wdje5oy().b[27][1]++;
514
3334
  }
3335
+ cov_2h1wdje5oy().s[77]++;
3336
+ return this._request.delete(`${this._getBaseUrl('legacy')}/organizations/${organizationId}/users/${userId}`);
3337
+ }
515
3338
 
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);
3339
+ /**
3340
+ * Removes a application from a user
3341
+ *
3342
+ * API Endpoint: '/users/:userId/applications/:applicationId'
3343
+ * Method: DELETE
3344
+ *
3345
+ * @param {string} userId The ID of the user
3346
+ * @param {string} applicationId The ID of the application
3347
+ *
3348
+ * @returns {Promise}
3349
+ * @fulfill {undefined}
3350
+ * @reject {Error}
3351
+ *
3352
+ * @example
3353
+ * contxtSdk.coordinator.users
3354
+ * .removeApplication('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3355
+ * .catch((err) => console.log(err));
3356
+ */
3357
+ removeApplication(userId, applicationId) {
3358
+ cov_2h1wdje5oy().f[18]++;
3359
+ cov_2h1wdje5oy().s[78]++;
3360
+ if (!userId) {
3361
+ cov_2h1wdje5oy().b[28][0]++;
3362
+ cov_2h1wdje5oy().s[79]++;
3363
+ return Promise.reject(new Error('A user ID is required for removing a application from a user'));
3364
+ } else {
3365
+ cov_2h1wdje5oy().b[28][1]++;
547
3366
  }
3367
+ cov_2h1wdje5oy().s[80]++;
3368
+ if (!applicationId) {
3369
+ cov_2h1wdje5oy().b[29][0]++;
3370
+ cov_2h1wdje5oy().s[81]++;
3371
+ return Promise.reject(new Error('An application ID is required for removing a application from a user'));
3372
+ } else {
3373
+ cov_2h1wdje5oy().b[29][1]++;
3374
+ }
3375
+ cov_2h1wdje5oy().s[82]++;
3376
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}/applications/${applicationId}`);
3377
+ }
548
3378
 
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');
3379
+ /**
3380
+ * Removes a role from a user
3381
+ *
3382
+ * API Endpoint: '/users/:userId/roles/:roleId'
3383
+ * Method: DELETE
3384
+ *
3385
+ * @param {string} userId The ID of the user
3386
+ * @param {string} roleId The ID of the role
3387
+ *
3388
+ * @returns {Promise}
3389
+ * @fulfill {undefined}
3390
+ * @reject {Error}
3391
+ *
3392
+ * @example
3393
+ * contxtSdk.coordinator.users
3394
+ * .removeRole('36b8421a-cc4a-4204-b839-1397374fb16b', '007ca9ee-ece7-4931-9d11-9b4fd97d4d58')
3395
+ * .catch((err) => console.log(err));
3396
+ */
3397
+ removeRole(userId, roleId) {
3398
+ cov_2h1wdje5oy().f[19]++;
3399
+ cov_2h1wdje5oy().s[83]++;
3400
+ if (!userId) {
3401
+ cov_2h1wdje5oy().b[30][0]++;
3402
+ cov_2h1wdje5oy().s[84]++;
3403
+ return Promise.reject(new Error('A user ID is required for removing a role from a user'));
3404
+ } else {
3405
+ cov_2h1wdje5oy().b[30][1]++;
3406
+ }
3407
+ cov_2h1wdje5oy().s[85]++;
3408
+ if (!roleId) {
3409
+ cov_2h1wdje5oy().b[31][0]++;
3410
+ cov_2h1wdje5oy().s[86]++;
3411
+ return Promise.reject(new Error('A role ID is required for removing a role from a user'));
3412
+ } else {
3413
+ cov_2h1wdje5oy().b[31][1]++;
575
3414
  }
576
- }]);
3415
+ cov_2h1wdje5oy().s[87]++;
3416
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}/roles/${roleId}`);
3417
+ }
577
3418
 
578
- return Users;
579
- }();
3419
+ /**
3420
+ * Removes a project environment from a user
3421
+ *
3422
+ * API Endpoint: 'users/:userId/project_environments/:projectEnvironmentSlug
3423
+ * Method: DELETE
3424
+ *
3425
+ * @param {string} userId The ID of the user
3426
+ * @param {string} projectEnvironmentSlug The slug of the project environment
3427
+ *
3428
+ * @returns {Promise}
3429
+ * @fulfill {undefined}
3430
+ * @reject {Error}
3431
+ *
3432
+ * @example
3433
+ * contxtSdk.coordinator.users
3434
+ * .removeProjectEnvironment('36b8421a-cc4a-4204-b839-1397374fb16b', 'project-environment-slug')
3435
+ * .catch((err) => console.log(err));
3436
+ */
3437
+ removeProjectEnvironment(userId, projectEnvironmentId) {
3438
+ cov_2h1wdje5oy().f[20]++;
3439
+ cov_2h1wdje5oy().s[88]++;
3440
+ if (!userId) {
3441
+ cov_2h1wdje5oy().b[32][0]++;
3442
+ cov_2h1wdje5oy().s[89]++;
3443
+ return Promise.reject(new Error('A user ID is required for removing a project environment from a user'));
3444
+ } else {
3445
+ cov_2h1wdje5oy().b[32][1]++;
3446
+ }
3447
+ cov_2h1wdje5oy().s[90]++;
3448
+ if (!projectEnvironmentId) {
3449
+ cov_2h1wdje5oy().b[33][0]++;
3450
+ cov_2h1wdje5oy().s[91]++;
3451
+ return Promise.reject(new Error('A project environment slug is required for removing a project environment from a user.'));
3452
+ } else {
3453
+ cov_2h1wdje5oy().b[33][1]++;
3454
+ }
3455
+ cov_2h1wdje5oy().s[92]++;
3456
+ return this._request.delete(`${this._getBaseUrl()}/users/${userId}/project_environments/${projectEnvironmentId}`);
3457
+ }
580
3458
 
581
- export default Users;
3459
+ /**
3460
+ * Syncs the user's roles and application access with the external auth provider
3461
+ *
3462
+ * API Endpoint: '/users/:userId/sync'
3463
+ * Method: GET
3464
+ *
3465
+ * @param {string} userId The ID of the user
3466
+ *
3467
+ * @returns {Promise}
3468
+ * @fulfill {undefined}
3469
+ * @reject {Error}
3470
+ *
3471
+ * @example
3472
+ * contxtSdk.coordinator.users
3473
+ * .sync('36b8421a-cc4a-4204-b839-1397374fb16b')
3474
+ * .catch((err) => console.log(err));
3475
+ */
3476
+ sync(userId) {
3477
+ cov_2h1wdje5oy().f[21]++;
3478
+ cov_2h1wdje5oy().s[93]++;
3479
+ if (!userId) {
3480
+ cov_2h1wdje5oy().b[34][0]++;
3481
+ cov_2h1wdje5oy().s[94]++;
3482
+ return Promise.reject(new Error('A user ID is required for syncing user permissions'));
3483
+ } else {
3484
+ cov_2h1wdje5oy().b[34][1]++;
3485
+ }
3486
+ cov_2h1wdje5oy().s[95]++;
3487
+ return this._request.get(`${this._getBaseUrl('access')}/users/${userId}/sync`);
3488
+ }
3489
+ }
3490
+ var _default = exports.default = Users;
582
3491
  //# sourceMappingURL=users.js.map