@sonoransoftware/sonoran.js 1.0.33 → 1.0.34

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.
@@ -253,6 +253,11 @@ export interface CMSERLCGetOnlinePlayersPromiseResult {
253
253
  Team?: string;
254
254
  }[];
255
255
  }
256
+ export interface CMSERLCGetPlayerQueuePromiseResult {
257
+ success: boolean;
258
+ reason?: string;
259
+ data?: number;
260
+ }
256
261
  export interface CMSERLCAddNewRecordPromiseResult {
257
262
  success: boolean;
258
263
  reason?: string;
@@ -200,6 +200,11 @@ class REST extends events_1.EventEmitter {
200
200
  robloxJoinCode: args[0]
201
201
  };
202
202
  }
203
+ case 'ERLC_GET_PLAYER_QUEUE': {
204
+ return {
205
+ robloxJoinCode: args[0]
206
+ };
207
+ }
203
208
  case 'ERLC_ADD_NEW_RECORD': {
204
209
  return {
205
210
  robloxJoinCode: args[0],
@@ -36,7 +36,7 @@ export declare const FormsCMSAPITypes: APITypeData[];
36
36
  export declare const CommunitiesCMSAPITypes: APITypeData[];
37
37
  export declare const ERLCMSAPITypes: APITypeData[];
38
38
  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_ADD_NEW_RECORD";
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";
40
40
  export interface CMSServerAPIStruct {
41
41
  id: number;
42
42
  name: string;
@@ -493,6 +493,9 @@ export interface RESTTypedAPIDataStructs {
493
493
  ERLC_GET_ONLINE_PLAYERS: [
494
494
  robloxJoinCode: string
495
495
  ];
496
+ ERLC_GET_PLAYER_QUEUE: [
497
+ robloxJoinCode: string
498
+ ];
496
499
  ERLC_ADD_NEW_RECORD: [
497
500
  robloxJoinCode: string,
498
501
  executerDiscordId: string | number,
@@ -434,6 +434,12 @@ exports.ERLCMSAPITypes = [
434
434
  method: "POST",
435
435
  minVersion: 0
436
436
  },
437
+ {
438
+ type: "ERLC_GET_PLAYER_QUEUE",
439
+ path: "erlc/get_player_queue",
440
+ method: "POST",
441
+ minVersion: 0
442
+ },
437
443
  {
438
444
  type: "ERLC_ADD_NEW_RECORD",
439
445
  path: "erlc/add_new_record",
@@ -176,6 +176,12 @@ export declare class CMSManager extends BaseManager {
176
176
  * @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the list of online players if successful.
177
177
  */
178
178
  erlcGetOnlinePlayers(robloxJoinCode: string): Promise<globalTypes.CMSERLCGetOnlinePlayersPromiseResult>;
179
+ /**
180
+ * Gets the current ERLC player queue count for the provided roblox join code.
181
+ * @param {string} robloxJoinCode The roblox join code to get the player queue size for.
182
+ * @returns {Promise} Promise object indicates success and includes the queue count when successful.
183
+ */
184
+ erlcGetPlayerQueue(robloxJoinCode: string): Promise<globalTypes.CMSERLCGetPlayerQueuePromiseResult>;
179
185
  /**
180
186
  * Adds a new ERLC record for a player.
181
187
  * @param {Object} data The object that contains critical data to add a new ERLC record.
@@ -395,6 +395,28 @@ class CMSManager extends BaseManager_1.BaseManager {
395
395
  }
396
396
  });
397
397
  }
398
+ /**
399
+ * Gets the current ERLC player queue count for the provided roblox join code.
400
+ * @param {string} robloxJoinCode The roblox join code to get the player queue size for.
401
+ * @returns {Promise} Promise object indicates success and includes the queue count when successful.
402
+ */
403
+ async erlcGetPlayerQueue(robloxJoinCode) {
404
+ return new Promise(async (resolve, reject) => {
405
+ var _a;
406
+ try {
407
+ const erlcGetPlayerQueueRequest = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('ERLC_GET_PLAYER_QUEUE', robloxJoinCode));
408
+ resolve({ success: true, data: erlcGetPlayerQueueRequest });
409
+ }
410
+ catch (err) {
411
+ if (err instanceof src_1.APIError) {
412
+ resolve({ success: false, reason: err.response });
413
+ }
414
+ else {
415
+ reject(err);
416
+ }
417
+ }
418
+ });
419
+ }
398
420
  /**
399
421
  * Adds a new ERLC record for a player.
400
422
  * @param {Object} data The object that contains critical data to add a new ERLC record.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonoransoftware/sonoran.js",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Sonoran.js is a library that allows you to interact with the Sonoran CAD and Sonoran CMS API. Based off of and utilizes several Discord.js library techniques for ease of use.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -278,8 +278,14 @@ export interface CMSERLCGetOnlinePlayersPromiseResult {
278
278
  }[];
279
279
  }
280
280
 
281
+ export interface CMSERLCGetPlayerQueuePromiseResult {
282
+ success: boolean;
283
+ reason?: string;
284
+ data?: number;
285
+ }
286
+
281
287
  export interface CMSERLCAddNewRecordPromiseResult {
282
288
  success: boolean;
283
289
  reason?: string;
284
290
  logId?: string;
285
- }
291
+ }
@@ -306,6 +306,11 @@ export class REST extends EventEmitter {
306
306
  robloxJoinCode: args[0]
307
307
  }
308
308
  }
309
+ case 'ERLC_GET_PLAYER_QUEUE': {
310
+ return {
311
+ robloxJoinCode: args[0]
312
+ }
313
+ }
309
314
  case 'ERLC_ADD_NEW_RECORD': {
310
315
  return {
311
316
  robloxJoinCode: args[0],
@@ -470,6 +470,12 @@ export const ERLCMSAPITypes: APITypeData[] = [
470
470
  method: "POST",
471
471
  minVersion: 0
472
472
  },
473
+ {
474
+ type: "ERLC_GET_PLAYER_QUEUE",
475
+ path: "erlc/get_player_queue",
476
+ method: "POST",
477
+ minVersion: 0
478
+ },
473
479
  {
474
480
  type: "ERLC_ADD_NEW_RECORD",
475
481
  path: "erlc/add_new_record",
@@ -489,7 +495,7 @@ function formatForAll(array: APITypeData[], product: productEnums): AllAPITypeDa
489
495
 
490
496
  export const AllAPITypes: AllAPITypeData[] = [ ...formatForAll(GeneralCADAPITypes, productEnums.CAD), ...formatForAll(CivilianCADAPITypes, productEnums.CAD), ...formatForAll(EmergencyCADAPITypes, productEnums.CAD), ...formatForAll(GeneralCMSAPITypes, productEnums.CMS), ...formatForAll(ServersCMSAPITypes, productEnums.CMS), ...formatForAll(EventsCMSAPITypes, productEnums.CMS), ...formatForAll(FormsCMSAPITypes, productEnums.CMS), ...formatForAll(CommunitiesCMSAPITypes, productEnums.CMS), ...formatForAll(ERLCMSAPITypes, productEnums.CMS) ];
491
497
 
492
- 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_ADD_NEW_RECORD";
498
+ 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";
493
499
 
494
500
  export interface CMSServerAPIStruct {
495
501
  id: number;
@@ -984,6 +990,9 @@ export interface RESTTypedAPIDataStructs {
984
990
  ERLC_GET_ONLINE_PLAYERS: [
985
991
  robloxJoinCode: string
986
992
  ]
993
+ ERLC_GET_PLAYER_QUEUE: [
994
+ robloxJoinCode: string
995
+ ]
987
996
  ERLC_ADD_NEW_RECORD: [
988
997
  robloxJoinCode: string,
989
998
  executerDiscordId: string | number,
@@ -1120,4 +1129,4 @@ export type PossibleRequestData =
1120
1129
  },
1121
1130
  add?: string[],
1122
1131
  remove?: string[],
1123
- };
1132
+ };
@@ -348,6 +348,26 @@ export class CMSManager extends BaseManager {
348
348
  });
349
349
  }
350
350
 
351
+ /**
352
+ * Gets the current ERLC player queue count for the provided roblox join code.
353
+ * @param {string} robloxJoinCode The roblox join code to get the player queue size for.
354
+ * @returns {Promise} Promise object indicates success and includes the queue count when successful.
355
+ */
356
+ public async erlcGetPlayerQueue(robloxJoinCode: string): Promise<globalTypes.CMSERLCGetPlayerQueuePromiseResult> {
357
+ return new Promise(async (resolve, reject) => {
358
+ try {
359
+ const erlcGetPlayerQueueRequest: any = await this.rest?.request('ERLC_GET_PLAYER_QUEUE', robloxJoinCode);
360
+ resolve({ success: true, data: erlcGetPlayerQueueRequest });
361
+ } catch (err) {
362
+ if (err instanceof APIError) {
363
+ resolve({ success: false, reason: err.response });
364
+ } else {
365
+ reject(err);
366
+ }
367
+ }
368
+ });
369
+ }
370
+
351
371
  /**
352
372
  * Adds a new ERLC record for a player.
353
373
  * @param {Object} data The object that contains critical data to add a new ERLC record.
@@ -374,4 +394,4 @@ export class CMSManager extends BaseManager {
374
394
  }
375
395
  });
376
396
  }
377
- }
397
+ }