@sonoransoftware/sonoran.js 1.0.37 → 1.0.38
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/constants.d.ts +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/libs/rest/src/lib/REST.js +7 -0
- package/dist/libs/rest/src/lib/RequestManager.js +4 -0
- package/dist/libs/rest/src/lib/utils/constants.d.ts +5 -2
- package/dist/libs/rest/src/lib/utils/constants.js +6 -0
- package/dist/managers/CMSManager.d.ts +4 -0
- package/dist/managers/CMSManager.js +23 -0
- package/package.json +1 -1
- package/src/constants.ts +13 -0
- package/src/index.ts +6 -1
- package/src/libs/rest/src/lib/REST.ts +7 -0
- package/src/libs/rest/src/lib/RequestManager.ts +4 -0
- package/src/libs/rest/src/lib/utils/constants.ts +11 -2
- package/src/managers/CMSManager.ts +22 -0
package/dist/constants.d.ts
CHANGED
|
@@ -394,6 +394,17 @@ export interface CMSERLCAddNewRecordPromiseResult {
|
|
|
394
394
|
reason?: string;
|
|
395
395
|
logId?: string;
|
|
396
396
|
}
|
|
397
|
+
export interface CMSERLCExecuteCommandPayload {
|
|
398
|
+
type: string;
|
|
399
|
+
args: unknown;
|
|
400
|
+
discordId: string | number;
|
|
401
|
+
includesPlayerNameOrId: boolean;
|
|
402
|
+
}
|
|
403
|
+
export interface CMSERLCExecuteCommandPromiseResult {
|
|
404
|
+
success: boolean;
|
|
405
|
+
reason?: string;
|
|
406
|
+
data?: unknown;
|
|
407
|
+
}
|
|
397
408
|
export interface RadioChannelGroup {
|
|
398
409
|
id: number;
|
|
399
410
|
name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './instance/Instance';
|
|
2
2
|
export * from './builders';
|
|
3
3
|
export * from './libs/rest/src';
|
|
4
|
-
export { productEnums, CADNewDispatchBuilderOptions, CADSubscriptionVersionEnum, CMSSubscriptionVersionEnum, RadioSubscriptionLevel, RadioSetUserChannelsOptions, RadioChannel, RadioChannelGroup, RadioConnectedUser, RadioSpeakerLocation, RadioGetCommunityChannelsPromiseResult, RadioGetConnectedUsersPromiseResult, RadioGetConnectedUserPromiseResult, RadioSetUserChannelsPromiseResult, RadioSetUserDisplayNamePromiseResult, RadioGetServerSubscriptionFromIpPromiseResult, RadioSetServerIpPromiseResult, RadioSetInGameSpeakerLocationsPromiseResult, CADSetClockTimePromiseResult, CADJoinCommunityPromiseResult, CADLeaveCommunityPromiseResult, CADStandardResponse, CMSProfileField, CMSGetCurrentClockInPromiseResult, CMSAccountsPage, CMSAccountSummary, CMSGetAccountsPromiseResult, CMSGetProfileFieldsPromiseResult, CMSProfileFieldUpdate, CMSEditAccountProfileFieldsPromiseResult, CMSRsvpPromiseResult, CMSChangeFormStagePromiseResult, CMSSetGameServerStruct, CMSSetGameServersPromiseResult, CMSExecuteRankPromotionResult, CMSTriggerPromotionFlowPayload, CMSPromotionFlow, CMSTriggerPromotionFlowsPromiseResult, CMSGetPromotionFlowsPromiseResult, CMSGetFormSubmissionsPromiseResult } from './constants';
|
|
4
|
+
export { productEnums, CADNewDispatchBuilderOptions, CADSubscriptionVersionEnum, CMSSubscriptionVersionEnum, RadioSubscriptionLevel, RadioSetUserChannelsOptions, RadioChannel, RadioChannelGroup, RadioConnectedUser, RadioSpeakerLocation, RadioGetCommunityChannelsPromiseResult, RadioGetConnectedUsersPromiseResult, RadioGetConnectedUserPromiseResult, RadioSetUserChannelsPromiseResult, RadioSetUserDisplayNamePromiseResult, RadioGetServerSubscriptionFromIpPromiseResult, RadioSetServerIpPromiseResult, RadioSetInGameSpeakerLocationsPromiseResult, CADSetClockTimePromiseResult, CADJoinCommunityPromiseResult, CADLeaveCommunityPromiseResult, CADStandardResponse, CMSProfileField, CMSGetCurrentClockInPromiseResult, CMSAccountsPage, CMSAccountSummary, CMSGetAccountsPromiseResult, CMSGetProfileFieldsPromiseResult, CMSProfileFieldUpdate, CMSEditAccountProfileFieldsPromiseResult, CMSRsvpPromiseResult, CMSChangeFormStagePromiseResult, CMSSetGameServerStruct, CMSSetGameServersPromiseResult, CMSExecuteRankPromotionResult, CMSTriggerPromotionFlowPayload, CMSPromotionFlow, CMSTriggerPromotionFlowsPromiseResult, CMSGetPromotionFlowsPromiseResult, CMSGetFormSubmissionsPromiseResult, CMSERLCGetOnlinePlayersPromiseResult, CMSERLCGetPlayerQueuePromiseResult, CMSERLCAddNewRecordPromiseResult, CMSERLCExecuteCommandPayload, CMSERLCExecuteCommandPromiseResult } from './constants';
|
|
@@ -300,6 +300,13 @@ class REST extends events_1.EventEmitter {
|
|
|
300
300
|
points: args[6],
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
|
+
case 'ERLC_EXECUTE_COMMAND': {
|
|
304
|
+
const payload = args[0];
|
|
305
|
+
if (!Array.isArray(payload)) {
|
|
306
|
+
throw new Error('ERLC_EXECUTE_COMMAND requires an array of command payloads.');
|
|
307
|
+
}
|
|
308
|
+
return payload;
|
|
309
|
+
}
|
|
303
310
|
case 'RADIO_GET_COMMUNITY_CHANNELS':
|
|
304
311
|
case 'RADIO_GET_CONNECTED_USERS':
|
|
305
312
|
case 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP': {
|
|
@@ -101,6 +101,10 @@ class RequestManager extends events_1.EventEmitter {
|
|
|
101
101
|
apiData.data.data = [];
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
|
+
case 'ERLC_EXECUTE_COMMAND': {
|
|
105
|
+
apiData.data.data = clonedData;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
104
108
|
case 'SET_PENAL_CODES': {
|
|
105
109
|
apiData.data.data = [clonedData[0]];
|
|
106
110
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { productEnums, RadioSetUserChannelsOptions, RadioSpeakerLocation, RadioTonePlayTarget, CMSProfileFieldUpdate, CMSSetGameServerStruct, CMSTriggerPromotionFlowPayload } from '../../../../../constants';
|
|
1
|
+
import { productEnums, RadioSetUserChannelsOptions, RadioSpeakerLocation, RadioTonePlayTarget, CMSProfileFieldUpdate, CMSSetGameServerStruct, CMSTriggerPromotionFlowPayload, CMSERLCExecuteCommandPayload } 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>;
|
|
@@ -38,7 +38,7 @@ export declare const CommunitiesCMSAPITypes: APITypeData[];
|
|
|
38
38
|
export declare const ERLCMSAPITypes: APITypeData[];
|
|
39
39
|
export declare const RadioAPITypes: APITypeData[];
|
|
40
40
|
export declare const AllAPITypes: AllAPITypeData[];
|
|
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' | 'PLAY_TONE';
|
|
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' | 'ERLC_EXECUTE_COMMAND' | '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' | 'PLAY_TONE';
|
|
42
42
|
export interface CMSServerAPIStruct {
|
|
43
43
|
id: number;
|
|
44
44
|
name: string;
|
|
@@ -555,6 +555,9 @@ export interface RESTTypedAPIDataStructs {
|
|
|
555
555
|
playerRobloxId?: string | number,
|
|
556
556
|
points?: number
|
|
557
557
|
];
|
|
558
|
+
ERLC_EXECUTE_COMMAND: [
|
|
559
|
+
commands: CMSERLCExecuteCommandPayload[]
|
|
560
|
+
];
|
|
558
561
|
RADIO_GET_COMMUNITY_CHANNELS: [];
|
|
559
562
|
RADIO_GET_CONNECTED_USERS: [];
|
|
560
563
|
RADIO_GET_CONNECTED_USER: [
|
|
@@ -511,6 +511,12 @@ exports.ERLCMSAPITypes = [
|
|
|
511
511
|
path: "erlc/add_new_record",
|
|
512
512
|
method: "POST",
|
|
513
513
|
minVersion: 0
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
type: "ERLC_EXECUTE_COMMAND",
|
|
517
|
+
path: "erlc/execute_command",
|
|
518
|
+
method: "POST",
|
|
519
|
+
minVersion: 0
|
|
514
520
|
}
|
|
515
521
|
];
|
|
516
522
|
exports.RadioAPITypes = [
|
|
@@ -260,6 +260,10 @@ export declare class CMSManager extends BaseManager {
|
|
|
260
260
|
* @returns {Promise} Promise object indicates success and includes the queue count when successful.
|
|
261
261
|
*/
|
|
262
262
|
erlcGetPlayerQueue(robloxJoinCode: string): Promise<globalTypes.CMSERLCGetPlayerQueuePromiseResult>;
|
|
263
|
+
/**
|
|
264
|
+
* Sends an ERLC command payload to CMS.
|
|
265
|
+
*/
|
|
266
|
+
erlcExecuteCommand(commands: globalTypes.CMSERLCExecuteCommandPayload[]): Promise<globalTypes.CMSERLCExecuteCommandPromiseResult>;
|
|
263
267
|
/**
|
|
264
268
|
* Adds a new ERLC record for a player.
|
|
265
269
|
* @param {Object} data The object that contains critical data to add a new ERLC record.
|
|
@@ -627,6 +627,29 @@ class CMSManager extends BaseManager_1.BaseManager {
|
|
|
627
627
|
}
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
|
+
/**
|
|
631
|
+
* Sends an ERLC command payload to CMS.
|
|
632
|
+
*/
|
|
633
|
+
async erlcExecuteCommand(commands) {
|
|
634
|
+
if (!Array.isArray(commands) || commands.length === 0) {
|
|
635
|
+
throw new Error('ERLC execute command requires at least one command payload.');
|
|
636
|
+
}
|
|
637
|
+
return new Promise(async (resolve, reject) => {
|
|
638
|
+
var _a;
|
|
639
|
+
try {
|
|
640
|
+
const erlcExecuteCommandRequest = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('ERLC_EXECUTE_COMMAND', commands));
|
|
641
|
+
resolve({ success: true, data: erlcExecuteCommandRequest });
|
|
642
|
+
}
|
|
643
|
+
catch (err) {
|
|
644
|
+
if (err instanceof src_1.APIError) {
|
|
645
|
+
resolve({ success: false, reason: err.response });
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
reject(err);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
}
|
|
630
653
|
/**
|
|
631
654
|
* Adds a new ERLC record for a player.
|
|
632
655
|
* @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.
|
|
3
|
+
"version": "1.0.38",
|
|
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
|
@@ -443,6 +443,19 @@ export interface CMSERLCAddNewRecordPromiseResult {
|
|
|
443
443
|
logId?: string;
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
+
export interface CMSERLCExecuteCommandPayload {
|
|
447
|
+
type: string;
|
|
448
|
+
args: unknown;
|
|
449
|
+
discordId: string | number;
|
|
450
|
+
includesPlayerNameOrId: boolean;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export interface CMSERLCExecuteCommandPromiseResult {
|
|
454
|
+
success: boolean;
|
|
455
|
+
reason?: string;
|
|
456
|
+
data?: unknown;
|
|
457
|
+
}
|
|
458
|
+
|
|
446
459
|
export interface RadioChannelGroup {
|
|
447
460
|
id: number;
|
|
448
461
|
name: string;
|
package/src/index.ts
CHANGED
|
@@ -41,5 +41,10 @@ export {
|
|
|
41
41
|
CMSPromotionFlow,
|
|
42
42
|
CMSTriggerPromotionFlowsPromiseResult,
|
|
43
43
|
CMSGetPromotionFlowsPromiseResult,
|
|
44
|
-
CMSGetFormSubmissionsPromiseResult
|
|
44
|
+
CMSGetFormSubmissionsPromiseResult,
|
|
45
|
+
CMSERLCGetOnlinePlayersPromiseResult,
|
|
46
|
+
CMSERLCGetPlayerQueuePromiseResult,
|
|
47
|
+
CMSERLCAddNewRecordPromiseResult,
|
|
48
|
+
CMSERLCExecuteCommandPayload,
|
|
49
|
+
CMSERLCExecuteCommandPromiseResult
|
|
45
50
|
} from './constants';
|
|
@@ -404,6 +404,13 @@ export class REST extends EventEmitter {
|
|
|
404
404
|
points: args[6],
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
+
case 'ERLC_EXECUTE_COMMAND': {
|
|
408
|
+
const payload = args[0];
|
|
409
|
+
if (!Array.isArray(payload)) {
|
|
410
|
+
throw new Error('ERLC_EXECUTE_COMMAND requires an array of command payloads.');
|
|
411
|
+
}
|
|
412
|
+
return payload;
|
|
413
|
+
}
|
|
407
414
|
case 'RADIO_GET_COMMUNITY_CHANNELS':
|
|
408
415
|
case 'RADIO_GET_CONNECTED_USERS':
|
|
409
416
|
case 'RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP': {
|
|
@@ -174,6 +174,10 @@ export class RequestManager extends EventEmitter {
|
|
|
174
174
|
apiData.data.data = [];
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
|
+
case 'ERLC_EXECUTE_COMMAND': {
|
|
178
|
+
apiData.data.data = clonedData;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
177
181
|
case 'SET_PENAL_CODES': {
|
|
178
182
|
apiData.data.data = [clonedData[0]];
|
|
179
183
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { productEnums, RadioSetUserChannelsOptions, RadioSpeakerLocation, RadioTonePlayTarget, CMSProfileFieldUpdate, CMSSetGameServerStruct, CMSTriggerPromotionFlowPayload } from '../../../../../constants';
|
|
1
|
+
import { productEnums, RadioSetUserChannelsOptions, RadioSpeakerLocation, RadioTonePlayTarget, CMSProfileFieldUpdate, CMSSetGameServerStruct, CMSTriggerPromotionFlowPayload, CMSERLCExecuteCommandPayload } from '../../../../../constants';
|
|
2
2
|
import type { RESTOptions } from '../REST';
|
|
3
3
|
|
|
4
4
|
export const DefaultUserAgent = 'Sonoran.js NPM Module';
|
|
@@ -548,6 +548,12 @@ export const ERLCMSAPITypes: APITypeData[] = [
|
|
|
548
548
|
path: "erlc/add_new_record",
|
|
549
549
|
method: "POST",
|
|
550
550
|
minVersion: 0
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
type: "ERLC_EXECUTE_COMMAND",
|
|
554
|
+
path: "erlc/execute_command",
|
|
555
|
+
method: "POST",
|
|
556
|
+
minVersion: 0
|
|
551
557
|
}
|
|
552
558
|
];
|
|
553
559
|
|
|
@@ -619,7 +625,7 @@ function formatForAll(array: APITypeData[], product: productEnums): AllAPITypeDa
|
|
|
619
625
|
|
|
620
626
|
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), ...formatForAll(RadioAPITypes, productEnums.RADIO) ];
|
|
621
627
|
|
|
622
|
-
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' | 'PLAY_TONE';
|
|
628
|
+
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' | 'ERLC_EXECUTE_COMMAND' | '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' | 'PLAY_TONE';
|
|
623
629
|
|
|
624
630
|
export interface CMSServerAPIStruct {
|
|
625
631
|
id: number;
|
|
@@ -1170,6 +1176,9 @@ export interface RESTTypedAPIDataStructs {
|
|
|
1170
1176
|
playerRobloxId?: string | number,
|
|
1171
1177
|
points?: number,
|
|
1172
1178
|
]
|
|
1179
|
+
ERLC_EXECUTE_COMMAND: [
|
|
1180
|
+
commands: CMSERLCExecuteCommandPayload[]
|
|
1181
|
+
]
|
|
1173
1182
|
// Radio
|
|
1174
1183
|
RADIO_GET_COMMUNITY_CHANNELS: [];
|
|
1175
1184
|
RADIO_GET_CONNECTED_USERS: [];
|
|
@@ -562,6 +562,28 @@ export class CMSManager extends BaseManager {
|
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
+
/**
|
|
566
|
+
* Sends an ERLC command payload to CMS.
|
|
567
|
+
*/
|
|
568
|
+
public async erlcExecuteCommand(commands: globalTypes.CMSERLCExecuteCommandPayload[]): Promise<globalTypes.CMSERLCExecuteCommandPromiseResult> {
|
|
569
|
+
if (!Array.isArray(commands) || commands.length === 0) {
|
|
570
|
+
throw new Error('ERLC execute command requires at least one command payload.');
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
return new Promise(async (resolve, reject) => {
|
|
574
|
+
try {
|
|
575
|
+
const erlcExecuteCommandRequest: any = await this.rest?.request('ERLC_EXECUTE_COMMAND', commands);
|
|
576
|
+
resolve({ success: true, data: erlcExecuteCommandRequest });
|
|
577
|
+
} catch (err) {
|
|
578
|
+
if (err instanceof APIError) {
|
|
579
|
+
resolve({ success: false, reason: err.response });
|
|
580
|
+
} else {
|
|
581
|
+
reject(err);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
|
|
565
587
|
/**
|
|
566
588
|
* Adds a new ERLC record for a player.
|
|
567
589
|
* @param {Object} data The object that contains critical data to add a new ERLC record.
|