@medrunner/api-client 0.0.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,607 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/api/endpoints/ApiEndpoint.ts
5
+ import axios, { AxiosError } from "axios";
6
+ var ApiEndpoint = class {
7
+ constructor(baseUrl, tokenManager, log, headerProvider) {
8
+ this.baseUrl = baseUrl;
9
+ this.tokenManager = tokenManager;
10
+ this.log = log;
11
+ this.headerProvider = headerProvider;
12
+ }
13
+ endpointUrl() {
14
+ return `${this.baseUrl}/${this.endpoint()}`;
15
+ }
16
+ async headersForRequest(noAuthentication) {
17
+ const config = {
18
+ baseURL: this.baseUrl,
19
+ headers: {}
20
+ };
21
+ if (config.headers !== void 0) {
22
+ if (!noAuthentication) {
23
+ const accessToken = await this.tokenManager.getAccessToken();
24
+ if (accessToken !== void 0) {
25
+ config.headers.Authorization = `Bearer ${accessToken}`;
26
+ }
27
+ }
28
+ if (this.headerProvider !== void 0) {
29
+ for (const header of Object.entries(await this.headerProvider())) {
30
+ config.headers[header[0]] = header[1];
31
+ }
32
+ }
33
+ }
34
+ return config;
35
+ }
36
+ async getRequest(endpoint, queryParams, noAuthentication) {
37
+ return await this.makeRequestWithoutBody(endpoint, "GET", axios.get, queryParams, noAuthentication);
38
+ }
39
+ async postRequest(endpoint, data, noAuthentication) {
40
+ return await this.makeRequestWithBody(endpoint, "POST", axios.post, data, noAuthentication);
41
+ }
42
+ async putRequest(endpoint, data, noAuthentication) {
43
+ return await this.makeRequestWithBody(endpoint, "PUT", axios.put, data, noAuthentication);
44
+ }
45
+ async patchRequest(endpoint, data, noAuthentication) {
46
+ return await this.makeRequestWithBody(endpoint, "PATCH", axios.patch, data, noAuthentication);
47
+ }
48
+ async deleteRequest(endpoint, queryParams, noAuthentication) {
49
+ return await this.makeRequestWithoutBody(endpoint, "DELETE", axios.delete, queryParams, noAuthentication);
50
+ }
51
+ async makeRequestWithBody(endpoint, requestType, axiosRequest, data, noAuthentication) {
52
+ const wrappedRequest = /* @__PURE__ */ __name(async (requestUrl, config) => await axiosRequest(requestUrl, data, config), "wrappedRequest");
53
+ return await this.makeRequest(endpoint, requestType, wrappedRequest, void 0, noAuthentication);
54
+ }
55
+ async makeRequestWithoutBody(endpoint, requestType, axiosRequest, queryParams, noAuthentication) {
56
+ const wrappedRequest = /* @__PURE__ */ __name(async (requestUrl, config) => await axiosRequest(requestUrl, config), "wrappedRequest");
57
+ return await this.makeRequest(endpoint, requestType, wrappedRequest, queryParams, noAuthentication);
58
+ }
59
+ buildUrl(endpoint) {
60
+ const baseUrl = this.endpointUrl();
61
+ if (baseUrl.endsWith("/")) {
62
+ if (endpoint.startsWith("/")) {
63
+ return `${baseUrl}${endpoint.substring(1)}`;
64
+ }
65
+ return `${baseUrl}${endpoint}`;
66
+ }
67
+ if (endpoint.startsWith("/")) {
68
+ return `${baseUrl}${endpoint}`;
69
+ }
70
+ return `${baseUrl}/${endpoint}`;
71
+ }
72
+ async makeRequest(endpoint, requestType, request, queryParams, noAuthentication = false) {
73
+ const requestUrl = this.buildUrl(endpoint);
74
+ this.log?.debug(`sending ${requestType} request to ${requestUrl}`);
75
+ try {
76
+ const config = await this.headersForRequest(noAuthentication);
77
+ if (queryParams !== void 0) {
78
+ config.params = queryParams;
79
+ }
80
+ const result = await request(requestUrl, config);
81
+ return {
82
+ success: true,
83
+ data: result.data
84
+ };
85
+ } catch (e) {
86
+ this.log?.warn(`Error for ${requestType} request to ${requestUrl}: ${e}`);
87
+ return {
88
+ success: false,
89
+ errorMessage: e instanceof AxiosError ? e.response?.data : void 0,
90
+ statusCode: e instanceof AxiosError ? e.response?.status : void 0
91
+ };
92
+ }
93
+ }
94
+ };
95
+ __name(ApiEndpoint, "ApiEndpoint");
96
+
97
+ // src/api/endpoints/auth/AuthEndpoint.ts
98
+ var AuthEndpoint = class extends ApiEndpoint {
99
+ constructor(baseUrl, tokenManager, log, headerProvider) {
100
+ super(baseUrl, tokenManager, log, headerProvider);
101
+ }
102
+ endpoint() {
103
+ return "auth";
104
+ }
105
+ /**
106
+ * Invalidate a refresh token.
107
+ *
108
+ * @param oldToken - Token to be invalidated
109
+ *
110
+ * @virtual
111
+ * */
112
+ async signOut(oldToken) {
113
+ return await this.postRequest("/signOut", oldToken);
114
+ }
115
+ /**
116
+ * Gets all api tokens for the user.
117
+ *
118
+ * */
119
+ async getApiTokens() {
120
+ return await this.getRequest(`/apiTokens`);
121
+ }
122
+ /**
123
+ * Creates an api token.
124
+ *
125
+ * @param newToken - Emergency details for the new emergency
126
+ * @returns The newly-created api token
127
+ *
128
+ * @virtual
129
+ * */
130
+ async createApiToken(newToken) {
131
+ return await this.postRequest("/apiTokens", {
132
+ name: newToken.name,
133
+ expirationDate: newToken.expirationDate?.toISOString()
134
+ });
135
+ }
136
+ /**
137
+ * Delete an api token.
138
+ *
139
+ * @param id - The id of the api token to delete
140
+ *
141
+ * */
142
+ async deleteApiToken(id) {
143
+ return await this.deleteRequest(`/apiTokens/${id}`);
144
+ }
145
+ };
146
+ __name(AuthEndpoint, "AuthEndpoint");
147
+
148
+ // src/api/endpoints/auth/TokenManager.ts
149
+ var TokenManager = class extends ApiEndpoint {
150
+ constructor(config, refreshCallback, log, headerProvider) {
151
+ super(config.baseUrl, null, log, headerProvider);
152
+ this.refreshCallback = refreshCallback;
153
+ this.accessToken = config.accessToken;
154
+ this.refreshToken = config.refreshToken;
155
+ }
156
+ accessToken;
157
+ refreshToken;
158
+ endpoint() {
159
+ return "auth";
160
+ }
161
+ async getAccessToken() {
162
+ if (this.accessToken !== void 0) {
163
+ const exp = TokenManager.getJwtFromAccessToken(this.accessToken).exp;
164
+ if (exp > Date.now() / 1e3 - 60 * 5)
165
+ return this.accessToken;
166
+ }
167
+ if (this.refreshToken === void 0)
168
+ return this.accessToken;
169
+ const tokens = await this.fetchToken(this.refreshToken);
170
+ if (this.refreshCallback !== void 0) {
171
+ await this.refreshCallback(tokens);
172
+ }
173
+ this.accessToken = tokens.accessToken;
174
+ this.refreshToken = tokens.refreshToken;
175
+ return tokens.accessToken;
176
+ }
177
+ async fetchToken(refreshToken) {
178
+ const result = await this.postRequest("/exchange", { refreshToken }, true);
179
+ if (!result.success || result.data === void 0) {
180
+ throw Error(result.statusCode?.toString());
181
+ }
182
+ return result.data;
183
+ }
184
+ static getJwtFromAccessToken(accessToken) {
185
+ return JSON.parse(atob(accessToken.split(".")[1]));
186
+ }
187
+ };
188
+ __name(TokenManager, "TokenManager");
189
+
190
+ // src/api/endpoints/chatMessage/ChatMessageEndpoint.ts
191
+ var ChatMessageEndpoint = class extends ApiEndpoint {
192
+ constructor(baseUrl, tokenManager, log, headerProvider) {
193
+ super(baseUrl, tokenManager, log, headerProvider);
194
+ }
195
+ endpoint() {
196
+ return "chatMessage";
197
+ }
198
+ /**
199
+ * Gets the specified amount of chat messages for a given emergency.
200
+ *
201
+ * @param emergencyId - The emergency for which to fetch the chat history
202
+ * @param limit - The number of emergencies to get
203
+ * @param paginationToken - The number to use for pagination
204
+ * */
205
+ async getHistory(emergencyId, limit, paginationToken) {
206
+ return await this.getRequest(`/${emergencyId}`, { limit, paginationToken });
207
+ }
208
+ /**
209
+ * Sends a new chat message
210
+ *
211
+ * @param message - The message to send
212
+ * @returns The newly-created chat message
213
+ *
214
+ * */
215
+ async sendMessage(message) {
216
+ return await this.postRequest("", message);
217
+ }
218
+ };
219
+ __name(ChatMessageEndpoint, "ChatMessageEndpoint");
220
+
221
+ // src/api/endpoints/client/ClientEndpoint.ts
222
+ var ClientEndpoint = class extends ApiEndpoint {
223
+ constructor(baseUrl, tokenManager, log, headerProvider) {
224
+ super(baseUrl, tokenManager, log, headerProvider);
225
+ }
226
+ endpoint() {
227
+ return "client";
228
+ }
229
+ /**
230
+ * Gets the current client.
231
+ * */
232
+ async get() {
233
+ return await this.getRequest("");
234
+ }
235
+ /**
236
+ * Gets the specified amount of emergencies the client has created.
237
+ * @param limit - The number of emergencies to get
238
+ * @param paginationToken - The number to use for pagination
239
+ * */
240
+ async getHistory(limit, paginationToken) {
241
+ return await this.getRequest("/history", { limit, paginationToken });
242
+ }
243
+ /**
244
+ * Links the current user to a rsiHandle.
245
+ *
246
+ * @param rsiHandle - The RSI handle of the client
247
+ *
248
+ * */
249
+ async linkClient(rsiHandle) {
250
+ return await this.postRequest("/link", { rsiHandle });
251
+ }
252
+ /**
253
+ * Updates the settings of the current user for the Client Portal.
254
+ *
255
+ * @param settings - The object settings to add or update
256
+ * @returns The updated settings object
257
+ *
258
+ * */
259
+ async setSettings(settings) {
260
+ return await this.patchRequest("/settings/clientPortal", settings);
261
+ }
262
+ };
263
+ __name(ClientEndpoint, "ClientEndpoint");
264
+
265
+ // src/api/endpoints/emergency/EmergencyEndpoint.ts
266
+ var EmergencyEndpoint = class extends ApiEndpoint {
267
+ constructor(baseUrl, tokenManager, log, headerProvider) {
268
+ super(baseUrl, tokenManager, log, headerProvider);
269
+ }
270
+ endpoint() {
271
+ return "emergency";
272
+ }
273
+ /**
274
+ * Gets an emergency by id.
275
+ *
276
+ * @param id - The id of the emergency to retrieve
277
+ * */
278
+ async getEmergency(id) {
279
+ return await this.getRequest(`/${id}`);
280
+ }
281
+ /**
282
+ * Bulk fetches emergencies by id.
283
+ *
284
+ * @param ids - a list of emergencies to retrieve
285
+ * */
286
+ async getEmergencies(ids) {
287
+ return await this.getRequest(`/bulk?id=${ids.join("&id=")}`);
288
+ }
289
+ /**
290
+ * Creates a new emergency.
291
+ *
292
+ * @param newEmergency - Emergency details for the new emergency
293
+ * @returns The newly-created emergency
294
+ *
295
+ * @virtual
296
+ * */
297
+ async createEmergency(newEmergency) {
298
+ return await this.postRequest("create", newEmergency);
299
+ }
300
+ /**
301
+ * Cancels an existing emergency.
302
+ *
303
+ * @remarks
304
+ * Emergency must still be in the {@link MissionStatus.RECEIVED} state in order to be canceled.
305
+ *
306
+ * @param id - The id of the emergency to cancel
307
+ * @param reason - The reason the emergency was canceled
308
+ * */
309
+ async cancelEmergencyWithReason(id, reason) {
310
+ return await this.postRequest(`/${id}/cancelWithReason`, {
311
+ reason
312
+ });
313
+ }
314
+ /**
315
+ * Allows the client to rate their emergency.
316
+ *
317
+ * @param id - The id of the emergency to rate
318
+ * @param rating - The rating to give the services provided
319
+ * @param remarks - Additional remarks provided by the client
320
+ *
321
+ * @internal
322
+ * */
323
+ async rateServices(id, rating, remarks) {
324
+ return await this.postRequest(`/${id}/rate/`, {
325
+ rating,
326
+ remarks
327
+ });
328
+ }
329
+ /**
330
+ * Fetches additional details about the responding team for an alert.
331
+ *
332
+ * @param id - The id of the emergency to get team details about
333
+ * */
334
+ async teamDetails(id) {
335
+ return await this.getRequest(`/${id}/teamDetails`);
336
+ }
337
+ /**
338
+ * Gets a tree of valid locations from which an emergency may be submitted.
339
+ * */
340
+ async emergencyLocations() {
341
+ return await this.getRequest("/meta/locations");
342
+ }
343
+ };
344
+ __name(EmergencyEndpoint, "EmergencyEndpoint");
345
+
346
+ // src/api/endpoints/staff/StaffEndpoint.ts
347
+ var StaffEndpoint = class extends ApiEndpoint {
348
+ constructor(baseUrl, tokenManager, log, headerProvider) {
349
+ super(baseUrl, tokenManager, log, headerProvider);
350
+ }
351
+ endpoint() {
352
+ return "staff";
353
+ }
354
+ /**
355
+ * Gets detailed information about medals.
356
+ * */
357
+ async medalsInformation() {
358
+ return await this.getRequest("/meta/medals");
359
+ }
360
+ };
361
+ __name(StaffEndpoint, "StaffEndpoint");
362
+
363
+ // src/api/endpoints/websocket/WebsocketManager.ts
364
+ import { HubConnectionBuilder, LogLevel } from "@microsoft/signalr";
365
+ var WebsocketManager = class {
366
+ constructor(baseUrl, tokenManager) {
367
+ this.baseUrl = baseUrl;
368
+ this.tokenManager = tokenManager;
369
+ }
370
+ tokenManager;
371
+ async establishConnection() {
372
+ return new HubConnectionBuilder().withAutomaticReconnect({
373
+ nextRetryDelayInMilliseconds: (retryContext) => retryContext.previousRetryCount > 5 ? null : 2e3
374
+ }).withUrl(`${this.baseUrl}/hub/emergency`, {
375
+ accessTokenFactory: async () => await this.tokenManager.getAccessToken() ?? ""
376
+ }).configureLogging(LogLevel.None).build();
377
+ }
378
+ };
379
+ __name(WebsocketManager, "WebsocketManager");
380
+
381
+ // src/api/endpoints/websocket/WebsocketEndpoint.ts
382
+ var WebsocketEndpoint = class extends ApiEndpoint {
383
+ constructor(baseUrl, tokenManager, log, headerProvider) {
384
+ super(baseUrl, tokenManager, log, headerProvider);
385
+ }
386
+ websocketManager = new WebsocketManager(this.baseUrl, this.tokenManager);
387
+ endpoint() {
388
+ return "websocket";
389
+ }
390
+ /**
391
+ * Gets realtime updates.
392
+ *
393
+ * */
394
+ async initialize() {
395
+ if (this.websocketManager === void 0) {
396
+ throw new Error("WebsocketManager is undefined");
397
+ }
398
+ return await this.websocketManager.establishConnection();
399
+ }
400
+ };
401
+ __name(WebsocketEndpoint, "WebsocketEndpoint");
402
+
403
+ // src/api/MedrunnerApiClient.ts
404
+ var MedrunnerApiClient = class {
405
+ constructor(emergency, client, staff, chatMessage, auth, websocket) {
406
+ this.emergency = emergency;
407
+ this.client = client;
408
+ this.staff = staff;
409
+ this.chatMessage = chatMessage;
410
+ this.auth = auth;
411
+ this.websocket = websocket;
412
+ }
413
+ /**
414
+ * Constructs a new API client.
415
+ *
416
+ * @param config - The API configuration
417
+ * @param refreshCallback - a callback function called whenever a refresh token exchange is performed
418
+ * @param log - A logger which logs request details
419
+ * */
420
+ static buildClient(config, refreshCallback, log) {
421
+ const tokenManager = new TokenManager(config, refreshCallback, log);
422
+ return new MedrunnerApiClient(
423
+ new EmergencyEndpoint(config.baseUrl, tokenManager, log),
424
+ new ClientEndpoint(config.baseUrl, tokenManager, log),
425
+ new StaffEndpoint(config.baseUrl, tokenManager, log),
426
+ new ChatMessageEndpoint(config.baseUrl, tokenManager, log),
427
+ new AuthEndpoint(config.baseUrl, tokenManager, log),
428
+ new WebsocketEndpoint(config.baseUrl, tokenManager, log)
429
+ );
430
+ }
431
+ };
432
+ __name(MedrunnerApiClient, "MedrunnerApiClient");
433
+
434
+ // src/api/endpoints/emergency/response/LocationDetail.ts
435
+ var LocationType = /* @__PURE__ */ ((LocationType2) => {
436
+ LocationType2[LocationType2["UNKNOWN"] = 0] = "UNKNOWN";
437
+ LocationType2[LocationType2["SYSTEM"] = 1] = "SYSTEM";
438
+ LocationType2[LocationType2["PLANET"] = 2] = "PLANET";
439
+ LocationType2[LocationType2["MOON"] = 3] = "MOON";
440
+ return LocationType2;
441
+ })(LocationType || {});
442
+
443
+ // src/models/CancellationReason.ts
444
+ var CancellationReason = /* @__PURE__ */ ((CancellationReason2) => {
445
+ CancellationReason2[CancellationReason2["NONE"] = 0] = "NONE";
446
+ CancellationReason2[CancellationReason2["OTHER"] = 1] = "OTHER";
447
+ CancellationReason2[CancellationReason2["SUCCUMBED_TO_WOUNDS"] = 2] = "SUCCUMBED_TO_WOUNDS";
448
+ CancellationReason2[CancellationReason2["SERVER_ERROR"] = 3] = "SERVER_ERROR";
449
+ CancellationReason2[CancellationReason2["RESPAWNED"] = 4] = "RESPAWNED";
450
+ CancellationReason2[CancellationReason2["RESCUED"] = 5] = "RESCUED";
451
+ return CancellationReason2;
452
+ })(CancellationReason || {});
453
+
454
+ // src/models/Class.ts
455
+ var Class = /* @__PURE__ */ ((Class2) => {
456
+ Class2[Class2["NONE"] = 0] = "NONE";
457
+ Class2[Class2["MEDIC"] = 1] = "MEDIC";
458
+ Class2[Class2["SECURITY"] = 2] = "SECURITY";
459
+ Class2[Class2["PILOT"] = 3] = "PILOT";
460
+ Class2[Class2["LEAD"] = 4] = "LEAD";
461
+ Class2[Class2["DISPATCH"] = 5] = "DISPATCH";
462
+ Class2[Class2["DISPATCH_LEAD"] = 6] = "DISPATCH_LEAD";
463
+ Class2[Class2["DISPATCH_TRAINEE"] = 7] = "DISPATCH_TRAINEE";
464
+ Class2[Class2["DISPATCH_OBSERVER"] = 8] = "DISPATCH_OBSERVER";
465
+ Class2[Class2["QRF"] = 9] = "QRF";
466
+ Class2[Class2["LOGISTICS"] = 10] = "LOGISTICS";
467
+ return Class2;
468
+ })(Class || {});
469
+
470
+ // src/models/Emergency.ts
471
+ var MissionServices = /* @__PURE__ */ ((MissionServices2) => {
472
+ MissionServices2[MissionServices2["NONE"] = 0] = "NONE";
473
+ MissionServices2[MissionServices2["PVE"] = 1] = "PVE";
474
+ MissionServices2[MissionServices2["PVP"] = 2] = "PVP";
475
+ MissionServices2[MissionServices2["REVIVED_HEALED"] = 4] = "REVIVED_HEALED";
476
+ MissionServices2[MissionServices2["HEALED_IN_SHIP"] = 8] = "HEALED_IN_SHIP";
477
+ MissionServices2[MissionServices2["EXTRACT_SAFE_ZONE"] = 16] = "EXTRACT_SAFE_ZONE";
478
+ return MissionServices2;
479
+ })(MissionServices || {});
480
+ var Origin = /* @__PURE__ */ ((Origin2) => {
481
+ Origin2[Origin2["UNKNOWN"] = 0] = "UNKNOWN";
482
+ Origin2[Origin2["REPORT"] = 1] = "REPORT";
483
+ Origin2[Origin2["BEACON"] = 2] = "BEACON";
484
+ Origin2[Origin2["EVALUATION"] = 3] = "EVALUATION";
485
+ return Origin2;
486
+ })(Origin || {});
487
+ var SubmissionSource = /* @__PURE__ */ ((SubmissionSource2) => {
488
+ SubmissionSource2[SubmissionSource2["UNKNOWN"] = 0] = "UNKNOWN";
489
+ SubmissionSource2[SubmissionSource2["API"] = 1] = "API";
490
+ SubmissionSource2[SubmissionSource2["BOT"] = 2] = "BOT";
491
+ return SubmissionSource2;
492
+ })(SubmissionSource || {});
493
+
494
+ // src/models/MissionStatus.ts
495
+ var MissionStatus = /* @__PURE__ */ ((MissionStatus2) => {
496
+ MissionStatus2[MissionStatus2["CREATED"] = 0] = "CREATED";
497
+ MissionStatus2[MissionStatus2["RECEIVED"] = 1] = "RECEIVED";
498
+ MissionStatus2[MissionStatus2["IN_PROGRESS"] = 2] = "IN_PROGRESS";
499
+ MissionStatus2[MissionStatus2["SUCCESS"] = 3] = "SUCCESS";
500
+ MissionStatus2[MissionStatus2["FAILED"] = 4] = "FAILED";
501
+ MissionStatus2[MissionStatus2["NO_CONTACT"] = 5] = "NO_CONTACT";
502
+ MissionStatus2[MissionStatus2["CANCELED"] = 6] = "CANCELED";
503
+ MissionStatus2[MissionStatus2["REFUSED"] = 7] = "REFUSED";
504
+ MissionStatus2[MissionStatus2["ABORTED"] = 8] = "ABORTED";
505
+ MissionStatus2[MissionStatus2["SERVER_ERROR"] = 9] = "SERVER_ERROR";
506
+ return MissionStatus2;
507
+ })(MissionStatus || {});
508
+
509
+ // src/models/Person.ts
510
+ var UserRoles = /* @__PURE__ */ ((UserRoles2) => {
511
+ UserRoles2[UserRoles2["CLIENT"] = 1] = "CLIENT";
512
+ UserRoles2[UserRoles2["STAFF"] = 2] = "STAFF";
513
+ UserRoles2[UserRoles2["DEVELOPER"] = 524288] = "DEVELOPER";
514
+ UserRoles2[UserRoles2["BOT"] = 1048576] = "BOT";
515
+ return UserRoles2;
516
+ })(UserRoles || {});
517
+ var PersonType = /* @__PURE__ */ ((PersonType2) => {
518
+ PersonType2[PersonType2["CLIENT"] = 0] = "CLIENT";
519
+ PersonType2[PersonType2["STAFF"] = 1] = "STAFF";
520
+ PersonType2[PersonType2["BOT"] = 2] = "BOT";
521
+ return PersonType2;
522
+ })(PersonType || {});
523
+ var AccountDeactivationReason = /* @__PURE__ */ ((AccountDeactivationReason2) => {
524
+ AccountDeactivationReason2[AccountDeactivationReason2["NONE"] = 0] = "NONE";
525
+ AccountDeactivationReason2[AccountDeactivationReason2["CLIENT_DRIVEN_DELETION"] = 1] = "CLIENT_DRIVEN_DELETION";
526
+ AccountDeactivationReason2[AccountDeactivationReason2["TERMINATED"] = 2] = "TERMINATED";
527
+ AccountDeactivationReason2[AccountDeactivationReason2["BLOCKED"] = 3] = "BLOCKED";
528
+ return AccountDeactivationReason2;
529
+ })(AccountDeactivationReason || {});
530
+
531
+ // src/models/Level.ts
532
+ var Level = /* @__PURE__ */ ((Level2) => {
533
+ Level2[Level2["None"] = 0] = "None";
534
+ Level2[Level2["Tier1Section1"] = 101] = "Tier1Section1";
535
+ Level2[Level2["Tier1Section2"] = 102] = "Tier1Section2";
536
+ Level2[Level2["Tier1Section3"] = 103] = "Tier1Section3";
537
+ Level2[Level2["Tier2Section1"] = 201] = "Tier2Section1";
538
+ Level2[Level2["Tier2Section2"] = 202] = "Tier2Section2";
539
+ Level2[Level2["Tier2Section3"] = 203] = "Tier2Section3";
540
+ Level2[Level2["Tier3Section1"] = 301] = "Tier3Section1";
541
+ Level2[Level2["Tier3Section2"] = 302] = "Tier3Section2";
542
+ Level2[Level2["Tier3Section3"] = 303] = "Tier3Section3";
543
+ Level2[Level2["Tier4Section1"] = 401] = "Tier4Section1";
544
+ Level2[Level2["Tier4Section2"] = 402] = "Tier4Section2";
545
+ Level2[Level2["Tier4Section3"] = 403] = "Tier4Section3";
546
+ Level2[Level2["Tier5Section1"] = 501] = "Tier5Section1";
547
+ Level2[Level2["Tier5Section2"] = 502] = "Tier5Section2";
548
+ Level2[Level2["Tier5Section3"] = 503] = "Tier5Section3";
549
+ Level2[Level2["Tier6Section1"] = 601] = "Tier6Section1";
550
+ Level2[Level2["Tier6Section2"] = 602] = "Tier6Section2";
551
+ Level2[Level2["Tier6Section3"] = 603] = "Tier6Section3";
552
+ Level2[Level2["Tier7Section1"] = 701] = "Tier7Section1";
553
+ Level2[Level2["Tier7Section2"] = 702] = "Tier7Section2";
554
+ Level2[Level2["Tier7Section3"] = 703] = "Tier7Section3";
555
+ Level2[Level2["Tier8Section1"] = 801] = "Tier8Section1";
556
+ Level2[Level2["Tier8Section2"] = 802] = "Tier8Section2";
557
+ Level2[Level2["Tier8Section3"] = 803] = "Tier8Section3";
558
+ Level2[Level2["Tier9Section1"] = 901] = "Tier9Section1";
559
+ Level2[Level2["Tier9Section2"] = 902] = "Tier9Section2";
560
+ Level2[Level2["Tier9Section3"] = 903] = "Tier9Section3";
561
+ Level2[Level2["Tier10Section1"] = 1001] = "Tier10Section1";
562
+ Level2[Level2["Tier10Section2"] = 1002] = "Tier10Section2";
563
+ Level2[Level2["Tier10Section3"] = 1003] = "Tier10Section3";
564
+ return Level2;
565
+ })(Level || {});
566
+
567
+ // src/models/ResponseRating.ts
568
+ var ResponseRating = /* @__PURE__ */ ((ResponseRating2) => {
569
+ ResponseRating2[ResponseRating2["NONE"] = 0] = "NONE";
570
+ ResponseRating2[ResponseRating2["GOOD"] = 1] = "GOOD";
571
+ ResponseRating2[ResponseRating2["BAD"] = 2] = "BAD";
572
+ return ResponseRating2;
573
+ })(ResponseRating || {});
574
+
575
+ // src/models/ThreatLevel.ts
576
+ var ThreatLevel = /* @__PURE__ */ ((ThreatLevel2) => {
577
+ ThreatLevel2[ThreatLevel2["UNKNOWN"] = 0] = "UNKNOWN";
578
+ ThreatLevel2[ThreatLevel2["LOW"] = 1] = "LOW";
579
+ ThreatLevel2[ThreatLevel2["MEDIUM"] = 2] = "MEDIUM";
580
+ ThreatLevel2[ThreatLevel2["HIGH"] = 3] = "HIGH";
581
+ return ThreatLevel2;
582
+ })(ThreatLevel || {});
583
+ export {
584
+ AccountDeactivationReason,
585
+ ApiEndpoint,
586
+ AuthEndpoint,
587
+ CancellationReason,
588
+ ChatMessageEndpoint,
589
+ Class,
590
+ ClientEndpoint,
591
+ EmergencyEndpoint,
592
+ Level,
593
+ LocationType,
594
+ MedrunnerApiClient,
595
+ MissionServices,
596
+ MissionStatus,
597
+ Origin,
598
+ PersonType,
599
+ ResponseRating,
600
+ StaffEndpoint,
601
+ SubmissionSource,
602
+ ThreatLevel,
603
+ TokenManager,
604
+ UserRoles,
605
+ WebsocketEndpoint
606
+ };
607
+ //# sourceMappingURL=index.mjs.map