@sonoransoftware/sonoran.js 1.0.32 → 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.
@@ -243,3 +243,23 @@ export interface CMSForceSyncPromiseResult {
243
243
  success: boolean;
244
244
  reason?: string;
245
245
  }
246
+ export interface CMSERLCGetOnlinePlayersPromiseResult {
247
+ success: boolean;
248
+ reason?: string;
249
+ data?: {
250
+ Player: string;
251
+ Permission: string;
252
+ Callsingn?: string;
253
+ Team?: string;
254
+ }[];
255
+ }
256
+ export interface CMSERLCGetPlayerQueuePromiseResult {
257
+ success: boolean;
258
+ reason?: string;
259
+ data?: number;
260
+ }
261
+ export interface CMSERLCAddNewRecordPromiseResult {
262
+ success: boolean;
263
+ reason?: string;
264
+ logId?: string;
265
+ }
@@ -195,6 +195,27 @@ class REST extends events_1.EventEmitter {
195
195
  uniqueId: args[4],
196
196
  };
197
197
  }
198
+ case 'ERLC_GET_ONLINE_PLAYERS': {
199
+ return {
200
+ robloxJoinCode: args[0]
201
+ };
202
+ }
203
+ case 'ERLC_GET_PLAYER_QUEUE': {
204
+ return {
205
+ robloxJoinCode: args[0]
206
+ };
207
+ }
208
+ case 'ERLC_ADD_NEW_RECORD': {
209
+ return {
210
+ robloxJoinCode: args[0],
211
+ executerDiscordId: args[1],
212
+ type: args[2],
213
+ reason: args[3],
214
+ playerDiscordId: args[4],
215
+ playerRobloxId: args[5],
216
+ points: args[6],
217
+ };
218
+ }
198
219
  default: {
199
220
  return args;
200
221
  }
@@ -34,8 +34,9 @@ export declare const ServersCMSAPITypes: APITypeData[];
34
34
  export declare const EventsCMSAPITypes: APITypeData[];
35
35
  export declare const FormsCMSAPITypes: APITypeData[];
36
36
  export declare const CommunitiesCMSAPITypes: APITypeData[];
37
+ export declare const ERLCMSAPITypes: APITypeData[];
37
38
  export declare const AllAPITypes: AllAPITypeData[];
38
- 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';
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";
39
40
  export interface CMSServerAPIStruct {
40
41
  id: number;
41
42
  name: string;
@@ -489,6 +490,21 @@ export interface RESTTypedAPIDataStructs {
489
490
  discord: string | undefined,
490
491
  uniqueId: string | undefined
491
492
  ];
493
+ ERLC_GET_ONLINE_PLAYERS: [
494
+ robloxJoinCode: string
495
+ ];
496
+ ERLC_GET_PLAYER_QUEUE: [
497
+ robloxJoinCode: string
498
+ ];
499
+ ERLC_ADD_NEW_RECORD: [
500
+ robloxJoinCode: string,
501
+ executerDiscordId: string | number,
502
+ type: string,
503
+ reason: string,
504
+ playerDiscordId?: string | number,
505
+ playerRobloxId?: string | number,
506
+ points?: number
507
+ ];
492
508
  }
493
509
  export type PossibleRequestData = undefined | {
494
510
  data: CADPenalCodeStruct[] | CADSetAPIIDStruct | CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct | CADLookupByIntStruct | CADLookupStruct | CADModifyAccountPermsStruct | CADKickBanUserStruct | CADSetPostalStruct[] | CADModifyIdentifierStruct | CADAddBlipStruct[] | CADModifyBlipStruct[] | CADGetCallsStruct | CADGetActiveUnitsStruct | CADNewDispatchStruct;
@@ -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.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.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;
4
4
  const constants_1 = require("../../../../../constants");
5
5
  exports.DefaultUserAgent = 'Sonoran.js NPM Module';
6
6
  exports.DefaultCADRestOptions = {
@@ -427,6 +427,26 @@ exports.CommunitiesCMSAPITypes = [
427
427
  minVersion: 0
428
428
  },
429
429
  ];
430
+ exports.ERLCMSAPITypes = [
431
+ {
432
+ type: "ERLC_GET_ONLINE_PLAYERS",
433
+ path: "erlc/get_online_players",
434
+ method: "POST",
435
+ minVersion: 0
436
+ },
437
+ {
438
+ type: "ERLC_GET_PLAYER_QUEUE",
439
+ path: "erlc/get_player_queue",
440
+ method: "POST",
441
+ minVersion: 0
442
+ },
443
+ {
444
+ type: "ERLC_ADD_NEW_RECORD",
445
+ path: "erlc/add_new_record",
446
+ method: "POST",
447
+ minVersion: 0
448
+ }
449
+ ];
430
450
  function formatForAll(array, product) {
431
451
  return array.map((val) => {
432
452
  return {
@@ -435,7 +455,7 @@ function formatForAll(array, product) {
435
455
  };
436
456
  });
437
457
  }
438
- 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)];
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)];
439
459
  var CADRecordTypeEnums;
440
460
  (function (CADRecordTypeEnums) {
441
461
  CADRecordTypeEnums[CADRecordTypeEnums["Warrant"] = 2] = "Warrant";
@@ -170,4 +170,37 @@ export declare class CMSManager extends BaseManager {
170
170
  discordId?: string;
171
171
  uniqueId?: string;
172
172
  }): Promise<globalTypes.CMSForceSyncPromiseResult>;
173
+ /**
174
+ * Gets a list of online ERLC players for the given roblox join code.
175
+ * @param {string} robloxJoinCode The roblox join code to get the online players for.
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
+ */
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>;
185
+ /**
186
+ * Adds a new ERLC record for a player.
187
+ * @param {Object} data The object that contains critical data to add a new ERLC record.
188
+ * @param {string} data.robloxJoinCode The roblox join code to add the record to.
189
+ * @param {string|number} data.executerDiscordId The discord ID of the person executing the record addition.
190
+ * @param {string} data.type The type of record being added (e.g., "Warning", "Infraction").
191
+ * @param {string} data.reason The reason for the record being added.
192
+ * @param {string|number} [data.playerDiscordId] (Optional) The discord ID of the player receiving the record.
193
+ * @param {string|number} [data.playerRobloxId] (Optional) The roblox ID of the player receiving the record.
194
+ * @param {number} [data.points] (Optional) The points associated with the record being added.
195
+ * @return {Promise} Promise object represents if the request was successful with reason for failure if needed.
196
+ * */
197
+ erlcAddNewRecord(data: {
198
+ robloxJoinCode: string;
199
+ executerDiscordId: string | number;
200
+ type: string;
201
+ reason: string;
202
+ playerDiscordId?: string | number;
203
+ playerRobloxId?: string | number;
204
+ points?: number;
205
+ }): Promise<globalTypes.CMSERLCAddNewRecordPromiseResult>;
173
206
  }
@@ -373,5 +373,78 @@ class CMSManager extends BaseManager_1.BaseManager {
373
373
  }
374
374
  });
375
375
  }
376
+ /**
377
+ * Gets a list of online ERLC players for the given roblox join code.
378
+ * @param {string} robloxJoinCode The roblox join code to get the online players for.
379
+ * @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the list of online players if successful.
380
+ */
381
+ async erlcGetOnlinePlayers(robloxJoinCode) {
382
+ return new Promise(async (resolve, reject) => {
383
+ var _a;
384
+ try {
385
+ const erlcGetOnlinePlayersRequest = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('ERLC_GET_ONLINE_PLAYERS', robloxJoinCode));
386
+ resolve({ success: true, data: erlcGetOnlinePlayersRequest });
387
+ }
388
+ catch (err) {
389
+ if (err instanceof src_1.APIError) {
390
+ resolve({ success: false, reason: err.response });
391
+ }
392
+ else {
393
+ reject(err);
394
+ }
395
+ }
396
+ });
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
+ }
420
+ /**
421
+ * Adds a new ERLC record for a player.
422
+ * @param {Object} data The object that contains critical data to add a new ERLC record.
423
+ * @param {string} data.robloxJoinCode The roblox join code to add the record to.
424
+ * @param {string|number} data.executerDiscordId The discord ID of the person executing the record addition.
425
+ * @param {string} data.type The type of record being added (e.g., "Warning", "Infraction").
426
+ * @param {string} data.reason The reason for the record being added.
427
+ * @param {string|number} [data.playerDiscordId] (Optional) The discord ID of the player receiving the record.
428
+ * @param {string|number} [data.playerRobloxId] (Optional) The roblox ID of the player receiving the record.
429
+ * @param {number} [data.points] (Optional) The points associated with the record being added.
430
+ * @return {Promise} Promise object represents if the request was successful with reason for failure if needed.
431
+ * */
432
+ async erlcAddNewRecord(data) {
433
+ return new Promise(async (resolve, reject) => {
434
+ var _a;
435
+ try {
436
+ const erlcAddNewRecordRequest = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('ERLC_ADD_NEW_RECORD', data.robloxJoinCode, data.executerDiscordId, data.type, data.reason, data.playerDiscordId, data.playerRobloxId, data.points));
437
+ resolve({ success: true, reason: erlcAddNewRecordRequest });
438
+ }
439
+ catch (err) {
440
+ if (err instanceof src_1.APIError) {
441
+ resolve({ success: false, reason: err.response });
442
+ }
443
+ else {
444
+ reject(err);
445
+ }
446
+ }
447
+ });
448
+ }
376
449
  }
377
450
  exports.CMSManager = CMSManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonoransoftware/sonoran.js",
3
- "version": "1.0.32",
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
@@ -265,4 +265,27 @@ export interface CMSBanAccountPromiseResult {
265
265
  export interface CMSForceSyncPromiseResult {
266
266
  success: boolean;
267
267
  reason?: string;
268
- }
268
+ }
269
+
270
+ export interface CMSERLCGetOnlinePlayersPromiseResult {
271
+ success: boolean;
272
+ reason?: string;
273
+ data?: {
274
+ Player: string;
275
+ Permission: string;
276
+ Callsingn?: string;
277
+ Team?: string;
278
+ }[];
279
+ }
280
+
281
+ export interface CMSERLCGetPlayerQueuePromiseResult {
282
+ success: boolean;
283
+ reason?: string;
284
+ data?: number;
285
+ }
286
+
287
+ export interface CMSERLCAddNewRecordPromiseResult {
288
+ success: boolean;
289
+ reason?: string;
290
+ logId?: string;
291
+ }
@@ -301,6 +301,27 @@ export class REST extends EventEmitter {
301
301
  uniqueId: args[4],
302
302
  }
303
303
  }
304
+ case 'ERLC_GET_ONLINE_PLAYERS': {
305
+ return {
306
+ robloxJoinCode: args[0]
307
+ }
308
+ }
309
+ case 'ERLC_GET_PLAYER_QUEUE': {
310
+ return {
311
+ robloxJoinCode: args[0]
312
+ }
313
+ }
314
+ case 'ERLC_ADD_NEW_RECORD': {
315
+ return {
316
+ robloxJoinCode: args[0],
317
+ executerDiscordId: args[1],
318
+ type: args[2],
319
+ reason: args[3],
320
+ playerDiscordId: args[4],
321
+ playerRobloxId: args[5],
322
+ points: args[6],
323
+ }
324
+ }
304
325
  default: {
305
326
  return args;
306
327
  }
@@ -463,6 +463,27 @@ export const CommunitiesCMSAPITypes: APITypeData[] = [
463
463
  },
464
464
  ];
465
465
 
466
+ export const ERLCMSAPITypes: APITypeData[] = [
467
+ {
468
+ type: "ERLC_GET_ONLINE_PLAYERS",
469
+ path: "erlc/get_online_players",
470
+ method: "POST",
471
+ minVersion: 0
472
+ },
473
+ {
474
+ type: "ERLC_GET_PLAYER_QUEUE",
475
+ path: "erlc/get_player_queue",
476
+ method: "POST",
477
+ minVersion: 0
478
+ },
479
+ {
480
+ type: "ERLC_ADD_NEW_RECORD",
481
+ path: "erlc/add_new_record",
482
+ method: "POST",
483
+ minVersion: 0
484
+ }
485
+ ];
486
+
466
487
  function formatForAll(array: APITypeData[], product: productEnums): AllAPITypeData[] {
467
488
  return array.map((val) => {
468
489
  return {
@@ -472,9 +493,9 @@ function formatForAll(array: APITypeData[], product: productEnums): AllAPITypeDa
472
493
  });
473
494
  }
474
495
 
475
- 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) ];
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) ];
476
497
 
477
- 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';
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";
478
499
 
479
500
  export interface CMSServerAPIStruct {
480
501
  id: number;
@@ -965,6 +986,22 @@ export interface RESTTypedAPIDataStructs {
965
986
  discord: string | undefined,
966
987
  uniqueId: string | undefined,
967
988
  ]
989
+ // CMS - ERLC
990
+ ERLC_GET_ONLINE_PLAYERS: [
991
+ robloxJoinCode: string
992
+ ]
993
+ ERLC_GET_PLAYER_QUEUE: [
994
+ robloxJoinCode: string
995
+ ]
996
+ ERLC_ADD_NEW_RECORD: [
997
+ robloxJoinCode: string,
998
+ executerDiscordId: string | number,
999
+ type: string,
1000
+ reason: string,
1001
+ playerDiscordId?: string | number,
1002
+ playerRobloxId?: string | number,
1003
+ points?: number,
1004
+ ]
968
1005
  }
969
1006
 
970
1007
  export type PossibleRequestData =
@@ -1092,4 +1129,4 @@ export type PossibleRequestData =
1092
1129
  },
1093
1130
  add?: string[],
1094
1131
  remove?: string[],
1095
- };
1132
+ };
@@ -327,4 +327,71 @@ export class CMSManager extends BaseManager {
327
327
  }
328
328
  });
329
329
  }
330
- }
330
+
331
+ /**
332
+ * Gets a list of online ERLC players for the given roblox join code.
333
+ * @param {string} robloxJoinCode The roblox join code to get the online players for.
334
+ * @returns {Promise} Promise object represents if the request was successful with reason for failure if needed and the list of online players if successful.
335
+ */
336
+ public async erlcGetOnlinePlayers(robloxJoinCode: string): Promise<globalTypes.CMSERLCGetOnlinePlayersPromiseResult> {
337
+ return new Promise(async (resolve, reject) => {
338
+ try {
339
+ const erlcGetOnlinePlayersRequest: any = await this.rest?.request('ERLC_GET_ONLINE_PLAYERS', robloxJoinCode);
340
+ resolve({ success: true, data: erlcGetOnlinePlayersRequest });
341
+ } catch (err) {
342
+ if (err instanceof APIError) {
343
+ resolve({ success: false, reason: err.response });
344
+ } else {
345
+ reject(err);
346
+ }
347
+ }
348
+ });
349
+ }
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
+
371
+ /**
372
+ * Adds a new ERLC record for a player.
373
+ * @param {Object} data The object that contains critical data to add a new ERLC record.
374
+ * @param {string} data.robloxJoinCode The roblox join code to add the record to.
375
+ * @param {string|number} data.executerDiscordId The discord ID of the person executing the record addition.
376
+ * @param {string} data.type The type of record being added (e.g., "Warning", "Infraction").
377
+ * @param {string} data.reason The reason for the record being added.
378
+ * @param {string|number} [data.playerDiscordId] (Optional) The discord ID of the player receiving the record.
379
+ * @param {string|number} [data.playerRobloxId] (Optional) The roblox ID of the player receiving the record.
380
+ * @param {number} [data.points] (Optional) The points associated with the record being added.
381
+ * @return {Promise} Promise object represents if the request was successful with reason for failure if needed.
382
+ * */
383
+ public async erlcAddNewRecord(data: { robloxJoinCode: string, executerDiscordId: string | number, type: string, reason: string, playerDiscordId?: string | number, playerRobloxId?: string | number, points?: number }): Promise<globalTypes.CMSERLCAddNewRecordPromiseResult> {
384
+ return new Promise(async (resolve, reject) => {
385
+ try {
386
+ const erlcAddNewRecordRequest: any = await this.rest?.request('ERLC_ADD_NEW_RECORD', data.robloxJoinCode, data.executerDiscordId, data.type, data.reason, data.playerDiscordId, data.playerRobloxId, data.points);
387
+ resolve({ success: true, reason: erlcAddNewRecordRequest });
388
+ } catch (err) {
389
+ if (err instanceof APIError) {
390
+ resolve({ success: false, reason: err.response });
391
+ } else {
392
+ reject(err);
393
+ }
394
+ }
395
+ });
396
+ }
397
+ }