@sonoransoftware/sonoran.js 1.0.34 → 1.0.36

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 (44) hide show
  1. package/.github/workflows/auto-pr-on-branch-push.yml +89 -0
  2. package/.github/workflows/codex_instructions.md +24 -0
  3. package/.github/workflows/push-pr-nudge-codex.yml +50 -0
  4. package/dist/constants.d.ts +242 -1
  5. package/dist/constants.js +1 -0
  6. package/dist/index.d.ts +1 -1
  7. package/dist/instance/Instance.d.ts +6 -0
  8. package/dist/instance/Instance.js +27 -0
  9. package/dist/instance/instance.types.d.ts +3 -0
  10. package/dist/libs/rest/src/lib/REST.d.ts +2 -1
  11. package/dist/libs/rest/src/lib/REST.js +118 -0
  12. package/dist/libs/rest/src/lib/RequestManager.d.ts +2 -0
  13. package/dist/libs/rest/src/lib/RequestManager.js +209 -0
  14. package/dist/libs/rest/src/lib/errors/RateLimitError.js +19 -1
  15. package/dist/libs/rest/src/lib/utils/constants.d.ts +108 -24
  16. package/dist/libs/rest/src/lib/utils/constants.js +118 -2
  17. package/dist/managers/CADActiveUnitsManager.d.ts +3 -0
  18. package/dist/managers/CADActiveUnitsManager.js +16 -6
  19. package/dist/managers/CADManager.d.ts +223 -0
  20. package/dist/managers/CADManager.js +513 -4
  21. package/dist/managers/CADServerManager.d.ts +11 -0
  22. package/dist/managers/CADServerManager.js +56 -13
  23. package/dist/managers/CMSManager.d.ts +78 -0
  24. package/dist/managers/CMSManager.js +213 -3
  25. package/dist/managers/CMSServerManager.d.ts +8 -0
  26. package/dist/managers/CMSServerManager.js +61 -18
  27. package/dist/managers/RadioManager.d.ts +55 -0
  28. package/dist/managers/RadioManager.js +224 -0
  29. package/package.json +1 -1
  30. package/readme.md +294 -12
  31. package/src/constants.ts +281 -1
  32. package/src/index.ts +42 -1
  33. package/src/instance/Instance.ts +30 -1
  34. package/src/instance/instance.types.ts +4 -1
  35. package/src/libs/rest/src/lib/REST.ts +117 -1
  36. package/src/libs/rest/src/lib/RequestManager.ts +229 -10
  37. package/src/libs/rest/src/lib/errors/RateLimitError.ts +20 -2
  38. package/src/libs/rest/src/lib/utils/constants.ts +223 -26
  39. package/src/managers/CADActiveUnitsManager.ts +19 -6
  40. package/src/managers/CADManager.ts +574 -4
  41. package/src/managers/CADServerManager.ts +59 -15
  42. package/src/managers/CMSManager.ts +196 -2
  43. package/src/managers/CMSServerManager.ts +65 -21
  44. package/src/managers/RadioManager.ts +187 -0
@@ -1,8 +1,9 @@
1
- import { productEnums } from '../../../../../constants';
1
+ import { productEnums, RadioSetUserChannelsOptions, RadioSpeakerLocation, CMSProfileFieldUpdate, CMSSetGameServerStruct, CMSTriggerPromotionFlowPayload } from '../../../../../constants';
2
2
  import type { RESTOptions } from '../REST';
3
3
  export declare const DefaultUserAgent = "Sonoran.js NPM Module";
4
4
  export declare const DefaultCADRestOptions: Required<RESTOptions>;
5
5
  export declare const DefaultCMSRestOptions: Required<RESTOptions>;
6
+ export declare const DefaultRadioRestOptions: Required<RESTOptions>;
6
7
  /**
7
8
  * The events that the REST manager emits
8
9
  */
@@ -35,8 +36,9 @@ export declare const EventsCMSAPITypes: APITypeData[];
35
36
  export declare const FormsCMSAPITypes: APITypeData[];
36
37
  export declare const CommunitiesCMSAPITypes: APITypeData[];
37
38
  export declare const ERLCMSAPITypes: APITypeData[];
39
+ export declare const RadioAPITypes: APITypeData[];
38
40
  export declare const AllAPITypes: AllAPITypeData[];
39
- export type AllAPITypesType = 'GET_SERVERS' | 'SET_SERVERS' | 'GET_VERSION' | 'SET_PENAL_CODES' | 'SET_API_ID' | 'GET_TEMPLATES' | 'NEW_RECORD' | 'EDIT_RECORD' | 'REMOVE_RECORD' | 'LOOKUP_INT' | 'LOOKUP' | 'GET_ACCOUNT' | 'CHECK_APIID' | 'APPLY_PERMISSION_KEY' | 'SET_ACCOUNT_PERMISSIONS' | 'BAN_USER' | 'VERIFY_SECRET' | 'AUTH_STREETSIGNS' | 'SET_POSTALS' | 'SEND_PHOTO' | 'GET_CHARACTERS' | 'NEW_CHARACTER' | 'EDIT_CHARACTER' | 'REMOVE_CHARACTER' | 'GET_IDENTIFIERS' | 'MODIFY_IDENTIFIER' | 'SET_IDENTIFIER' | 'UNIT_PANIC' | 'UNIT_STATUS' | 'GET_BLIPS' | 'ADD_BLIP' | 'MODIFY_BLIP' | 'REMOVE_BLIP' | '911_CALL' | 'REMOVE_911' | 'GET_CALLS' | 'GET_ACTIVE_UNITS' | 'KICK_UNIT' | 'NEW_DISPATCH' | 'ATTACH_UNIT' | 'DETACH_UNIT' | 'SET_CALL_POSTAL' | 'SET_CALL_PRIMARY' | 'ADD_CALL_NOTE' | 'CLOSE_CALL' | 'UNIT_LOCATION' | 'SET_STREETSIGN_CONFIG' | 'UPDATE_STREETSIGN' | 'GET_COM_ACCOUNT' | 'GET_DEPARTMENTS' | 'GET_SUB_VERSION' | 'CHECK_COM_APIID' | 'VERIFY_WHITELIST' | 'CLOCK_IN_OUT' | 'FULL_WHITELIST' | 'GET_ACCOUNT_RANKS' | 'SET_ACCOUNT_RANKS' | 'RSVP' | 'CHANGE_FORM_STAGE' | 'KICK_ACCOUNT' | 'BAN_ACCOUNT' | 'LOOKUP' | 'EDIT_ACC_PROFLIE_FIELDS' | 'SET_ACCOUNT_NAME' | 'FORCE_SYNC' | "ERLC_GET_ONLINE_PLAYERS" | "ERLC_GET_PLAYER_QUEUE" | "ERLC_ADD_NEW_RECORD";
41
+ export type AllAPITypesType = 'GET_SERVERS' | 'SET_SERVERS' | 'GET_VERSION' | 'SET_PENAL_CODES' | 'SET_API_ID' | 'GET_TEMPLATES' | 'NEW_RECORD' | 'EDIT_RECORD' | 'REMOVE_RECORD' | 'LOOKUP_INT' | 'LOOKUP' | 'GET_ACCOUNT' | 'CHECK_APIID' | 'APPLY_PERMISSION_KEY' | 'SET_ACCOUNT_PERMISSIONS' | 'BAN_USER' | 'VERIFY_SECRET' | 'AUTH_STREETSIGNS' | 'SET_POSTALS' | 'SEND_PHOTO' | 'SET_CLOCK' | 'JOIN_COMMUNITY' | 'LEAVE_COMMUNITY' | 'GET_CHARACTERS' | 'NEW_CHARACTER' | 'EDIT_CHARACTER' | 'REMOVE_CHARACTER' | 'GET_IDENTIFIERS' | 'MODIFY_IDENTIFIER' | 'SET_IDENTIFIER' | 'UNIT_PANIC' | 'UNIT_STATUS' | 'GET_BLIPS' | 'ADD_BLIP' | 'MODIFY_BLIP' | 'REMOVE_BLIP' | '911_CALL' | 'REMOVE_911' | 'GET_CALLS' | 'GET_ACTIVE_UNITS' | 'KICK_UNIT' | 'NEW_DISPATCH' | 'ATTACH_UNIT' | 'DETACH_UNIT' | 'SET_CALL_POSTAL' | 'SET_CALL_PRIMARY' | 'ADD_CALL_NOTE' | 'CLOSE_CALL' | 'UNIT_LOCATION' | 'SET_STREETSIGN_CONFIG' | 'UPDATE_STREETSIGN' | 'GET_COM_ACCOUNT' | 'GET_DEPARTMENTS' | 'GET_SUB_VERSION' | 'GET_CURRENT_CLOCK_IN' | 'GET_ACCOUNTS' | 'GET_PROFILE_FIELDS' | 'CHECK_COM_APIID' | 'VERIFY_WHITELIST' | 'CLOCK_IN_OUT' | 'FULL_WHITELIST' | 'GET_ACCOUNT_RANKS' | 'SET_ACCOUNT_RANKS' | 'RSVP' | 'CHANGE_FORM_STAGE' | 'GET_FORM_TEMPLATE_SUBMISSIONS' | 'KICK_ACCOUNT' | 'BAN_ACCOUNT' | 'LOOKUP' | 'EDIT_ACC_PROFLIE_FIELDS' | 'SET_ACCOUNT_NAME' | 'FORCE_SYNC' | 'TRIGGER_PROMOTION_FLOWS' | 'GET_PROMOTION_FLOWS' | 'SET_GAME_SERVERS' | 'ERLC_GET_ONLINE_PLAYERS' | 'ERLC_GET_PLAYER_QUEUE' | 'ERLC_ADD_NEW_RECORD' | 'RADIO_GET_COMMUNITY_CHANNELS' | 'RADIO_GET_CONNECTED_USERS' | 'RADIO_GET_CONNECTED_USER' | 'RADIO_SET_USER_CHANNELS' | 'RADIO_SET_USER_DISPLAY_NAME' | 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP' | 'RADIO_SET_SERVER_IP' | 'RADIO_SET_IN_GAME_SPEAKER_LOCATIONS';
40
42
  export interface CMSServerAPIStruct {
41
43
  id: number;
42
44
  name: string;
@@ -271,10 +273,6 @@ export interface CADUnitLocationStruct {
271
273
  apiId: string;
272
274
  location: string;
273
275
  }
274
- export interface CMSProfileField {
275
- id: string;
276
- value: string;
277
- }
278
276
  export interface RESTTypedAPIDataStructs {
279
277
  GET_SERVERS: [];
280
278
  SET_SERVERS: [
@@ -296,7 +294,7 @@ export interface RESTTypedAPIDataStructs {
296
294
  ];
297
295
  CHECK_APIID: [apiId: string];
298
296
  APPLY_PERMISSION_KEY: [
299
- apiId: string,
297
+ apiId: string | undefined,
300
298
  permissionKey: string
301
299
  ];
302
300
  SET_ACCOUNT_PERMISSIONS: [data: CADModifyAccountPermsStruct];
@@ -305,9 +303,33 @@ export interface RESTTypedAPIDataStructs {
305
303
  AUTH_STREETSIGNS: [serverId: number];
306
304
  SET_POSTALS: [data: CADSetPostalStruct[]];
307
305
  SEND_PHOTO: [
308
- apiId: string,
306
+ apiId: string | undefined,
309
307
  url: string
310
308
  ];
309
+ SET_CLOCK: [
310
+ data: {
311
+ serverId: number;
312
+ currentUtc: string;
313
+ currentGame: string;
314
+ secondsPerHour: number;
315
+ }
316
+ ];
317
+ JOIN_COMMUNITY: [
318
+ payload: {
319
+ internalKey: string;
320
+ accounts: Array<{
321
+ account: string;
322
+ }>;
323
+ }
324
+ ];
325
+ LEAVE_COMMUNITY: [
326
+ payload: {
327
+ internalKey: string;
328
+ accounts: Array<{
329
+ account: string;
330
+ }>;
331
+ }
332
+ ];
311
333
  GET_CHARACTERS: [apiId: string];
312
334
  NEW_CHARACTER: [data: CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct];
313
335
  EDIT_CHARACTER: [data: CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct];
@@ -315,15 +337,15 @@ export interface RESTTypedAPIDataStructs {
315
337
  GET_IDENTIFIERS: [apiId: string];
316
338
  MODIFY_IDENTIFIER: [data: CADModifyIdentifierStruct];
317
339
  SET_IDENTIFIER: [
318
- apiId: string,
340
+ apiId: string | undefined,
319
341
  identId: number
320
342
  ];
321
343
  UNIT_PANIC: [
322
- apiId: string,
344
+ apiId: string | undefined,
323
345
  isPanic: boolean
324
346
  ];
325
347
  UNIT_STATUS: [
326
- apiId: string,
348
+ apiId: string | undefined,
327
349
  status: number,
328
350
  serverId: number
329
351
  ];
@@ -335,7 +357,7 @@ export interface RESTTypedAPIDataStructs {
335
357
  GET_CALLS: [data: CADGetCallsStruct];
336
358
  GET_ACTIVE_UNITS: [data: CADGetActiveUnitsStruct];
337
359
  KICK_UNIT: [
338
- apiId: string,
360
+ apiId: string | undefined,
339
361
  reason: string,
340
362
  serverId: number
341
363
  ];
@@ -369,7 +391,7 @@ export interface RESTTypedAPIDataStructs {
369
391
  serverId: number,
370
392
  callId: number
371
393
  ];
372
- 'CALL_911': [
394
+ '911_CALL': [
373
395
  serverId: number,
374
396
  isEmergency: boolean,
375
397
  caller: string,
@@ -399,6 +421,24 @@ export interface RESTTypedAPIDataStructs {
399
421
  uniqueId?: string
400
422
  ];
401
423
  GET_SUB_VERSION: [];
424
+ GET_CURRENT_CLOCK_IN: [
425
+ apiId?: string,
426
+ username?: string,
427
+ accId?: string,
428
+ discord?: string,
429
+ uniqueId?: string
430
+ ];
431
+ GET_ACCOUNTS: [
432
+ options?: {
433
+ skip?: number;
434
+ take?: number;
435
+ sysStatus?: boolean;
436
+ comStatus?: boolean;
437
+ banned?: boolean;
438
+ archived?: boolean;
439
+ }
440
+ ];
441
+ GET_PROFILE_FIELDS: [];
402
442
  CHECK_COM_APIID: [apiId: string];
403
443
  CLOCK_IN_OUT: [
404
444
  apiId?: string,
@@ -440,7 +480,12 @@ export interface RESTTypedAPIDataStructs {
440
480
  discordId: string | undefined,
441
481
  uniqueId: string | undefined
442
482
  ];
483
+ TRIGGER_PROMOTION_FLOWS: [
484
+ data: CMSTriggerPromotionFlowPayload[]
485
+ ];
486
+ GET_PROMOTION_FLOWS: [];
443
487
  GET_GAME_SERVERS: [];
488
+ SET_GAME_SERVERS: [servers: CMSSetGameServerStruct[]];
444
489
  VERIFY_WHITELIST: [
445
490
  apiId: string | undefined,
446
491
  accId: string | undefined,
@@ -460,22 +505,27 @@ export interface RESTTypedAPIDataStructs {
460
505
  uniqueId: string | undefined
461
506
  ];
462
507
  EDIT_ACC_PROFLIE_FIELDS: [
463
- apiId: string,
464
- username: string,
465
- accId: string,
466
- discord: string,
467
- uniqueId: string,
468
- profileFields: CMSProfileField[]
508
+ apiId: string | undefined,
509
+ username: string | undefined,
510
+ accId: string | undefined,
511
+ discord: string | undefined,
512
+ uniqueId: string | undefined,
513
+ profileFields: CMSProfileFieldUpdate[]
469
514
  ];
470
515
  CHANGE_FORM_STAGE: [
471
- accId: string,
516
+ accId: string | undefined,
472
517
  formId: number,
473
518
  newStageId: string,
474
- apiId: string,
475
- username: string,
476
- discord: string,
519
+ apiId: string | undefined,
520
+ username: string | undefined,
521
+ discord: string | undefined,
477
522
  uniqueId: number
478
523
  ];
524
+ GET_FORM_TEMPLATE_SUBMISSIONS: [
525
+ templateId: number,
526
+ skip?: number,
527
+ take?: number
528
+ ];
479
529
  BAN_ACCOUNT: [
480
530
  apiId: string | undefined,
481
531
  username: string | undefined,
@@ -505,12 +555,41 @@ export interface RESTTypedAPIDataStructs {
505
555
  playerRobloxId?: string | number,
506
556
  points?: number
507
557
  ];
558
+ RADIO_GET_COMMUNITY_CHANNELS: [];
559
+ RADIO_GET_CONNECTED_USERS: [];
560
+ RADIO_GET_CONNECTED_USER: [
561
+ roomId: number,
562
+ identity: string
563
+ ];
564
+ RADIO_SET_USER_CHANNELS: [
565
+ identity: string,
566
+ options?: RadioSetUserChannelsOptions
567
+ ];
568
+ RADIO_SET_USER_DISPLAY_NAME: [
569
+ accId: string | undefined,
570
+ displayName: string
571
+ ];
572
+ RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP: [];
573
+ RADIO_SET_SERVER_IP: [
574
+ pushUrl: string
575
+ ];
576
+ RADIO_SET_IN_GAME_SPEAKER_LOCATIONS: [
577
+ locations: RadioSpeakerLocation[],
578
+ token?: string
579
+ ];
508
580
  }
509
581
  export type PossibleRequestData = undefined | {
510
- data: CADPenalCodeStruct[] | CADSetAPIIDStruct | CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct | CADLookupByIntStruct | CADLookupStruct | CADModifyAccountPermsStruct | CADKickBanUserStruct | CADSetPostalStruct[] | CADModifyIdentifierStruct | CADAddBlipStruct[] | CADModifyBlipStruct[] | CADGetCallsStruct | CADGetActiveUnitsStruct | CADNewDispatchStruct;
582
+ data: CADPenalCodeStruct[] | CADSetAPIIDStruct | CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct | CADLookupByIntStruct | CADLookupStruct | CADModifyAccountPermsStruct | CADKickBanUserStruct | CADSetPostalStruct[] | CADModifyIdentifierStruct | CADAddBlipStruct[] | CADModifyBlipStruct[] | CADGetCallsStruct | CADGetActiveUnitsStruct | CADNewDispatchStruct | CMSTriggerPromotionFlowPayload[];
511
583
  } | {
512
584
  servers: CADServerAPIStruct[];
513
585
  deployMap: boolean;
586
+ } | {
587
+ data: {
588
+ serverId: number;
589
+ currentUtc: string;
590
+ currentGame: string;
591
+ secondsPerHour: number;
592
+ };
514
593
  } | {
515
594
  id: number;
516
595
  } | {
@@ -585,6 +664,11 @@ export type PossibleRequestData = undefined | {
585
664
  text2: string;
586
665
  text3: string;
587
666
  };
667
+ } | {
668
+ internalKey: string;
669
+ accounts: {
670
+ account: string;
671
+ }[];
588
672
  } | {
589
673
  apiId?: string;
590
674
  username?: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CADDispatchStatusEnums = exports.CADDispatchOriginEnums = exports.CADModifyIdentifierActionEnums = exports.CADLookupByIntSearchTypeEnums = exports.CADRecordSectionCategoryEnums = exports.CADRecordTypeEnums = exports.AllAPITypes = exports.ERLCMSAPITypes = exports.CommunitiesCMSAPITypes = exports.FormsCMSAPITypes = exports.EventsCMSAPITypes = exports.ServersCMSAPITypes = exports.GeneralCMSAPITypes = exports.EmergencyCADAPITypes = exports.CivilianCADAPITypes = exports.GeneralCADAPITypes = exports.DefaultCMSRestOptions = exports.DefaultCADRestOptions = exports.DefaultUserAgent = void 0;
3
+ exports.CADDispatchStatusEnums = exports.CADDispatchOriginEnums = exports.CADModifyIdentifierActionEnums = exports.CADLookupByIntSearchTypeEnums = exports.CADRecordSectionCategoryEnums = exports.CADRecordTypeEnums = exports.AllAPITypes = exports.RadioAPITypes = exports.ERLCMSAPITypes = exports.CommunitiesCMSAPITypes = exports.FormsCMSAPITypes = exports.EventsCMSAPITypes = exports.ServersCMSAPITypes = exports.GeneralCMSAPITypes = exports.EmergencyCADAPITypes = exports.CivilianCADAPITypes = exports.GeneralCADAPITypes = exports.DefaultRadioRestOptions = exports.DefaultCMSRestOptions = exports.DefaultCADRestOptions = exports.DefaultUserAgent = void 0;
4
4
  const constants_1 = require("../../../../../constants");
5
5
  exports.DefaultUserAgent = 'Sonoran.js NPM Module';
6
6
  exports.DefaultCADRestOptions = {
@@ -15,6 +15,12 @@ exports.DefaultCMSRestOptions = {
15
15
  headers: {},
16
16
  rejectOnRateLimit: true
17
17
  };
18
+ exports.DefaultRadioRestOptions = {
19
+ agent: {},
20
+ api: 'https://api.sonoranradio.com',
21
+ headers: {},
22
+ rejectOnRateLimit: true
23
+ };
18
24
  exports.GeneralCADAPITypes = [
19
25
  {
20
26
  type: 'GET_SERVERS',
@@ -135,6 +141,24 @@ exports.GeneralCADAPITypes = [
135
141
  path: 'general/send_photo',
136
142
  method: 'POST',
137
143
  minVersion: 4
144
+ },
145
+ {
146
+ type: 'SET_CLOCK',
147
+ path: 'general/set_clock',
148
+ method: 'POST',
149
+ minVersion: 3
150
+ },
151
+ {
152
+ type: 'JOIN_COMMUNITY',
153
+ path: 'sso/community',
154
+ method: 'POST',
155
+ minVersion: 0
156
+ },
157
+ {
158
+ type: 'LEAVE_COMMUNITY',
159
+ path: 'sso/community',
160
+ method: 'POST',
161
+ minVersion: 0
138
162
  }
139
163
  ];
140
164
  exports.CivilianCADAPITypes = [
@@ -316,6 +340,18 @@ exports.GeneralCMSAPITypes = [
316
340
  method: 'POST',
317
341
  minVersion: 3
318
342
  },
343
+ {
344
+ type: 'GET_CURRENT_CLOCK_IN',
345
+ path: 'general/get_current_clock_in',
346
+ method: 'POST',
347
+ minVersion: 0
348
+ },
349
+ {
350
+ type: 'GET_ACCOUNTS',
351
+ path: 'general/get_accounts',
352
+ method: 'POST',
353
+ minVersion: 0
354
+ },
319
355
  {
320
356
  type: 'GET_ACCOUNT_RANKS',
321
357
  path: 'general/get_account_ranks',
@@ -334,6 +370,12 @@ exports.GeneralCMSAPITypes = [
334
370
  method: 'POST',
335
371
  minVersion: 2,
336
372
  },
373
+ {
374
+ type: 'GET_PROFILE_FIELDS',
375
+ path: 'general/get_profile_fields',
376
+ method: 'POST',
377
+ minVersion: 0
378
+ },
337
379
  {
338
380
  type: 'GET_SUB_VERSION',
339
381
  path: 'general/get_sub_version',
@@ -381,6 +423,18 @@ exports.GeneralCMSAPITypes = [
381
423
  path: 'general/force_sync',
382
424
  method: 'POST',
383
425
  minVersion: 0
426
+ },
427
+ {
428
+ type: 'TRIGGER_PROMOTION_FLOWS',
429
+ path: 'general/trigger_promotion_flows',
430
+ method: 'POST',
431
+ minVersion: 0
432
+ },
433
+ {
434
+ type: 'GET_PROMOTION_FLOWS',
435
+ path: 'general/get_promotion_flows',
436
+ method: 'POST',
437
+ minVersion: 0
384
438
  }
385
439
  ];
386
440
  exports.ServersCMSAPITypes = [
@@ -390,6 +444,12 @@ exports.ServersCMSAPITypes = [
390
444
  method: 'POST',
391
445
  minVersion: 2
392
446
  },
447
+ {
448
+ type: 'SET_GAME_SERVERS',
449
+ path: 'servers/set_game_servers',
450
+ method: 'POST',
451
+ minVersion: 2
452
+ },
393
453
  {
394
454
  type: 'VERIFY_WHITELIST',
395
455
  path: 'servers/verify_whitelist',
@@ -417,6 +477,12 @@ exports.FormsCMSAPITypes = [
417
477
  path: 'forms/change/stage',
418
478
  method: 'POST',
419
479
  minVersion: 0
480
+ },
481
+ {
482
+ type: 'GET_FORM_TEMPLATE_SUBMISSIONS',
483
+ path: 'forms/get_template_submissions',
484
+ method: 'POST',
485
+ minVersion: 0
420
486
  }
421
487
  ];
422
488
  exports.CommunitiesCMSAPITypes = [
@@ -447,6 +513,56 @@ exports.ERLCMSAPITypes = [
447
513
  minVersion: 0
448
514
  }
449
515
  ];
516
+ exports.RadioAPITypes = [
517
+ {
518
+ type: 'RADIO_GET_COMMUNITY_CHANNELS',
519
+ path: 'api/radio/get-community-channels',
520
+ method: 'GET',
521
+ minVersion: 0
522
+ },
523
+ {
524
+ type: 'RADIO_GET_CONNECTED_USERS',
525
+ path: 'api/radio/get-connected-users',
526
+ method: 'GET',
527
+ minVersion: 0
528
+ },
529
+ {
530
+ type: 'RADIO_GET_CONNECTED_USER',
531
+ path: 'api/radio/get-connected-user',
532
+ method: 'GET',
533
+ minVersion: 0
534
+ },
535
+ {
536
+ type: 'RADIO_SET_USER_CHANNELS',
537
+ path: 'api/radio/set-user-channels',
538
+ method: 'POST',
539
+ minVersion: 0
540
+ },
541
+ {
542
+ type: 'RADIO_SET_USER_DISPLAY_NAME',
543
+ path: 'api/set-user-display-name',
544
+ method: 'POST',
545
+ minVersion: 0
546
+ },
547
+ {
548
+ type: 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP',
549
+ path: 'radio/check-server-subscription',
550
+ method: 'GET',
551
+ minVersion: 0
552
+ },
553
+ {
554
+ type: 'RADIO_SET_SERVER_IP',
555
+ path: 'radio/set-server-ip',
556
+ method: 'POST',
557
+ minVersion: 0
558
+ },
559
+ {
560
+ type: 'RADIO_SET_IN_GAME_SPEAKER_LOCATIONS',
561
+ path: 'radio/set-server-speakers',
562
+ method: 'POST',
563
+ minVersion: 0
564
+ }
565
+ ];
450
566
  function formatForAll(array, product) {
451
567
  return array.map((val) => {
452
568
  return {
@@ -455,7 +571,7 @@ function formatForAll(array, product) {
455
571
  };
456
572
  });
457
573
  }
458
- exports.AllAPITypes = [...formatForAll(exports.GeneralCADAPITypes, constants_1.productEnums.CAD), ...formatForAll(exports.CivilianCADAPITypes, constants_1.productEnums.CAD), ...formatForAll(exports.EmergencyCADAPITypes, constants_1.productEnums.CAD), ...formatForAll(exports.GeneralCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.ServersCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.EventsCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.FormsCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.CommunitiesCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.ERLCMSAPITypes, constants_1.productEnums.CMS)];
574
+ exports.AllAPITypes = [...formatForAll(exports.GeneralCADAPITypes, constants_1.productEnums.CAD), ...formatForAll(exports.CivilianCADAPITypes, constants_1.productEnums.CAD), ...formatForAll(exports.EmergencyCADAPITypes, constants_1.productEnums.CAD), ...formatForAll(exports.GeneralCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.ServersCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.EventsCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.FormsCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.CommunitiesCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.ERLCMSAPITypes, constants_1.productEnums.CMS), ...formatForAll(exports.RadioAPITypes, constants_1.productEnums.RADIO)];
459
575
  var CADRecordTypeEnums;
460
576
  (function (CADRecordTypeEnums) {
461
577
  CADRecordTypeEnums[CADRecordTypeEnums["Warrant"] = 2] = "Warrant";
@@ -1,4 +1,6 @@
1
1
  import { Instance } from '../instance/Instance';
2
+ import * as globalTypes from '../constants';
3
+ import type { CADGetActiveUnitsStruct } from '../libs/rest/src';
2
4
  import { CADActiveUnit, CADActiveUnitResolvable, CADActiveUnitStruct } from '../structures/CADActiveUnit';
3
5
  import { CacheManager } from './CacheManager';
4
6
  export declare class CADActiveUnitsManager extends CacheManager<number, CADActiveUnit, CADActiveUnitResolvable> {
@@ -7,6 +9,7 @@ export declare class CADActiveUnitsManager extends CacheManager<number, CADActiv
7
9
  constructor(instance: Instance, iterable: Iterable<CADActiveUnitStruct>, serverId: number);
8
10
  _add(data: any, cache?: boolean): any;
9
11
  fetch(): void;
12
+ getActiveUnits(options?: Partial<CADGetActiveUnitsStruct>): Promise<globalTypes.CADStandardResponse>;
10
13
  _fetchSingle({ unit, includeOffline, force }: {
11
14
  unit: CADActiveUnitResolvable;
12
15
  includeOffline: boolean;
@@ -21,18 +21,28 @@ class CADActiveUnitsManager extends CacheManager_1.CacheManager {
21
21
  force: false
22
22
  });
23
23
  }
24
- async _fetchSingle({ unit, includeOffline = false, force = false }) {
24
+ async getActiveUnits(options = {}) {
25
25
  var _a, _b;
26
+ if (!this.instance.cad) {
27
+ throw new Error('CAD manager is not initialized.');
28
+ }
29
+ const payload = {
30
+ serverId: (_a = options.serverId) !== null && _a !== void 0 ? _a : this.serverId,
31
+ includeOffline: (_b = options.includeOffline) !== null && _b !== void 0 ? _b : false,
32
+ onlyUnits: options.onlyUnits,
33
+ limit: options.limit,
34
+ offset: options.offset
35
+ };
36
+ return this.instance.cad.getActiveUnits(payload);
37
+ }
38
+ async _fetchSingle({ unit, includeOffline = false, force = false }) {
26
39
  if (!force) {
27
40
  const existing = this.cache.get(unit);
28
41
  if (existing)
29
42
  return existing;
30
43
  }
31
- const data = await ((_b = (_a = this.instance.cad) === null || _a === void 0 ? void 0 : _a.rest) === null || _b === void 0 ? void 0 : _b.request('GET_ACTIVE_UNITS', {
32
- serverId: this.serverId,
33
- includeOffline
34
- }));
35
- console.log(data);
44
+ const result = await this.getActiveUnits({ includeOffline });
45
+ console.log(result);
36
46
  }
37
47
  }
38
48
  exports.CADActiveUnitsManager = CADActiveUnitsManager;