@sonoransoftware/sonoran.js 1.0.33 → 1.0.35
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/.github/workflows/auto-pr-on-branch-push.yml +89 -0
- package/.github/workflows/codex_instructions.md +24 -0
- package/.github/workflows/push-pr-nudge-codex.yml +50 -0
- package/dist/constants.d.ts +205 -1
- package/dist/constants.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/instance/Instance.d.ts +6 -0
- package/dist/instance/Instance.js +27 -0
- package/dist/instance/instance.types.d.ts +3 -0
- package/dist/libs/rest/src/lib/REST.d.ts +2 -1
- package/dist/libs/rest/src/lib/REST.js +113 -0
- package/dist/libs/rest/src/lib/RequestManager.d.ts +2 -0
- package/dist/libs/rest/src/lib/RequestManager.js +201 -0
- package/dist/libs/rest/src/lib/errors/RateLimitError.js +19 -1
- package/dist/libs/rest/src/lib/utils/constants.d.ts +105 -22
- package/dist/libs/rest/src/lib/utils/constants.js +112 -2
- package/dist/managers/CADManager.d.ts +28 -0
- package/dist/managers/CADManager.js +90 -0
- package/dist/managers/CMSManager.d.ts +60 -0
- package/dist/managers/CMSManager.js +156 -0
- package/dist/managers/CMSServerManager.d.ts +3 -0
- package/dist/managers/CMSServerManager.js +36 -2
- package/dist/managers/RadioManager.d.ts +55 -0
- package/dist/managers/RadioManager.js +224 -0
- package/package.json +1 -1
- package/readme.md +170 -0
- package/src/constants.ts +239 -2
- package/src/index.ts +35 -1
- package/src/instance/Instance.ts +30 -1
- package/src/instance/instance.types.ts +4 -1
- package/src/libs/rest/src/lib/REST.ts +112 -1
- package/src/libs/rest/src/lib/RequestManager.ts +221 -10
- package/src/libs/rest/src/lib/errors/RateLimitError.ts +20 -2
- package/src/libs/rest/src/lib/utils/constants.ts +215 -25
- package/src/managers/CADManager.ts +86 -1
- package/src/managers/CMSManager.ts +142 -1
- package/src/managers/CMSServerManager.ts +39 -6
- package/src/managers/RadioManager.ts +187 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.RadioManager = void 0;
|
|
27
|
+
const src_1 = require("../libs/rest/src");
|
|
28
|
+
const BaseManager_1 = require("./BaseManager");
|
|
29
|
+
const globalTypes = __importStar(require("../constants"));
|
|
30
|
+
/**
|
|
31
|
+
* Manages all Sonoran Radio API interactions.
|
|
32
|
+
*/
|
|
33
|
+
class RadioManager extends BaseManager_1.BaseManager {
|
|
34
|
+
constructor(instance) {
|
|
35
|
+
super(instance);
|
|
36
|
+
this.ready = false;
|
|
37
|
+
this.failReason = null;
|
|
38
|
+
this.rest = new src_1.REST(instance, this, globalTypes.productEnums.RADIO, src_1.DefaultRadioRestOptions);
|
|
39
|
+
void this.buildManager(instance);
|
|
40
|
+
}
|
|
41
|
+
async buildManager(instance) {
|
|
42
|
+
const mutableThis = this;
|
|
43
|
+
try {
|
|
44
|
+
mutableThis.ready = true;
|
|
45
|
+
instance.isRadioSuccessful = true;
|
|
46
|
+
instance.emit('RADIO_SETUP_SUCCESSFUL');
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
mutableThis.failReason = err;
|
|
50
|
+
instance.emit('RADIO_SETUP_UNSUCCESSFUL', err);
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves the configured community channel groups and channels.
|
|
56
|
+
*/
|
|
57
|
+
async getCommunityChannels() {
|
|
58
|
+
return new Promise(async (resolve, reject) => {
|
|
59
|
+
var _a;
|
|
60
|
+
try {
|
|
61
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_GET_COMMUNITY_CHANNELS'));
|
|
62
|
+
resolve({ success: true, data: response });
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
if (err instanceof src_1.APIError) {
|
|
66
|
+
resolve({ success: false, reason: err.response });
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
reject(err);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves all connected users for the community.
|
|
76
|
+
*/
|
|
77
|
+
async getConnectedUsers() {
|
|
78
|
+
return new Promise(async (resolve, reject) => {
|
|
79
|
+
var _a;
|
|
80
|
+
try {
|
|
81
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_GET_CONNECTED_USERS'));
|
|
82
|
+
resolve({ success: true, data: response });
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
if (err instanceof src_1.APIError) {
|
|
86
|
+
resolve({ success: false, reason: err.response });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
reject(err);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Retrieves a specific connected user by room id and identity.
|
|
96
|
+
* @param {number} roomId Multi-server room id.
|
|
97
|
+
* @param {string} identity User account UUID.
|
|
98
|
+
*/
|
|
99
|
+
async getConnectedUser(roomId, identity) {
|
|
100
|
+
return new Promise(async (resolve, reject) => {
|
|
101
|
+
var _a;
|
|
102
|
+
try {
|
|
103
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_GET_CONNECTED_USER', roomId, identity));
|
|
104
|
+
resolve({ success: true, data: response });
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
if (err instanceof src_1.APIError) {
|
|
108
|
+
resolve({ success: false, reason: err.response });
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
reject(err);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Updates a user's transmit and scanned channel configuration.
|
|
118
|
+
* @param {string} identity The user's UUID.
|
|
119
|
+
* @param {RadioSetUserChannelsOptions} options Transmit and scan channel configuration.
|
|
120
|
+
*/
|
|
121
|
+
async setUserChannels(identity, options = {}) {
|
|
122
|
+
return new Promise(async (resolve, reject) => {
|
|
123
|
+
var _a, _b;
|
|
124
|
+
try {
|
|
125
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_SET_USER_CHANNELS', identity, options));
|
|
126
|
+
resolve({ success: true, result: (_b = response === null || response === void 0 ? void 0 : response.result) !== null && _b !== void 0 ? _b : response });
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
if (err instanceof src_1.APIError) {
|
|
130
|
+
resolve({ success: false, reason: err.response });
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
reject(err);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Updates a user's display name.
|
|
140
|
+
* @param {string} accId The user's account UUID.
|
|
141
|
+
* @param {string} displayName The new display name.
|
|
142
|
+
*/
|
|
143
|
+
async setUserDisplayName(accId, displayName) {
|
|
144
|
+
return new Promise(async (resolve, reject) => {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
try {
|
|
147
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_SET_USER_DISPLAY_NAME', accId, displayName));
|
|
148
|
+
resolve({ success: true, result: (_b = response === null || response === void 0 ? void 0 : response.result) !== null && _b !== void 0 ? _b : response });
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
if (err instanceof src_1.APIError) {
|
|
152
|
+
resolve({ success: false, reason: err.response });
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
reject(err);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Retrieves the community subscription level determined by the calling server's IP.
|
|
162
|
+
*/
|
|
163
|
+
async getServerSubscriptionFromIp() {
|
|
164
|
+
return new Promise(async (resolve, reject) => {
|
|
165
|
+
var _a;
|
|
166
|
+
try {
|
|
167
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_GET_SERVER_SUBSCRIPTION_FROM_IP'));
|
|
168
|
+
resolve({ success: true, data: response });
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
if (err instanceof src_1.APIError) {
|
|
172
|
+
resolve({ success: false, reason: err.response });
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
reject(err);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Sets the push event URL for the community.
|
|
182
|
+
* @param {string} pushUrl The server push URL.
|
|
183
|
+
*/
|
|
184
|
+
async setServerIp(pushUrl) {
|
|
185
|
+
return new Promise(async (resolve, reject) => {
|
|
186
|
+
var _a, _b;
|
|
187
|
+
try {
|
|
188
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_SET_SERVER_IP', pushUrl));
|
|
189
|
+
resolve({ success: true, result: (_b = response === null || response === void 0 ? void 0 : response.result) !== null && _b !== void 0 ? _b : response });
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
if (err instanceof src_1.APIError) {
|
|
193
|
+
resolve({ success: false, reason: err.response });
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
reject(err);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Sets the available in-game speaker locations for tone dispatching.
|
|
203
|
+
* @param {RadioSpeakerLocation[]} locations Collection of speaker locations.
|
|
204
|
+
* @param {string} [token] Optional bearer token for authorization. Defaults to the community API key.
|
|
205
|
+
*/
|
|
206
|
+
async setInGameSpeakerLocations(locations, token) {
|
|
207
|
+
return new Promise(async (resolve, reject) => {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
try {
|
|
210
|
+
const response = await ((_a = this.rest) === null || _a === void 0 ? void 0 : _a.request('RADIO_SET_IN_GAME_SPEAKER_LOCATIONS', locations, token));
|
|
211
|
+
resolve({ success: true, result: (_b = response === null || response === void 0 ? void 0 : response.result) !== null && _b !== void 0 ? _b : response });
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
if (err instanceof src_1.APIError) {
|
|
215
|
+
resolve({ success: false, reason: err.response });
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
reject(err);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
exports.RadioManager = RadioManager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonoransoftware/sonoran.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
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/readme.md
CHANGED
|
@@ -64,6 +64,36 @@ const params = {
|
|
|
64
64
|
const account = await instance.cad.getAccount(params);
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
### setClockTime
|
|
68
|
+
Synchronizes the CAD clock with your in-game time.
|
|
69
|
+
#### Argument `params`
|
|
70
|
+
##### Type: `object` `{ serverId: number, currentUtc: string, currentGame: string, secondsPerHour: number }`
|
|
71
|
+
```js
|
|
72
|
+
await instance.cad.setClockTime({
|
|
73
|
+
serverId: 1,
|
|
74
|
+
currentUtc: new Date().toISOString(),
|
|
75
|
+
currentGame: '2025-07-04T18:00:00Z',
|
|
76
|
+
secondsPerHour: 60
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### joinCommunity
|
|
81
|
+
Adds one or more accounts to the community using an internal key.
|
|
82
|
+
```js
|
|
83
|
+
await instance.cad.joinCommunity('internal-key', [
|
|
84
|
+
{ account: '1234567890' },
|
|
85
|
+
'0987654321'
|
|
86
|
+
]);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### leaveCommunity
|
|
90
|
+
Removes one or more accounts from the community using an internal key.
|
|
91
|
+
```js
|
|
92
|
+
await instance.cad.leaveCommunity('internal-key', [
|
|
93
|
+
{ account: '1234567890' }
|
|
94
|
+
]);
|
|
95
|
+
```
|
|
96
|
+
|
|
67
97
|
## CMS Functions
|
|
68
98
|
### verifyWhitelist(obj)
|
|
69
99
|
Verifies that a user is whitelisted in the specified server.
|
|
@@ -176,5 +206,145 @@ const params = {
|
|
|
176
206
|
const setRanks = await instance.cms.setAccountRanks(params, undefined, undefined, undefined, '12345678', undefined);
|
|
177
207
|
```
|
|
178
208
|
|
|
209
|
+
### setAccountName(apiId, username, accId, discord, uniqueId, newName)
|
|
210
|
+
Sets the display name used in CMS for an account.
|
|
211
|
+
```js
|
|
212
|
+
await instance.cms.setAccountName(undefined, undefined, 'account-uuid', undefined, undefined, 'New Display Name');
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### cmsBanAccount(params)
|
|
216
|
+
Adds a ban flag to the targeted account.
|
|
217
|
+
```js
|
|
218
|
+
await instance.cms.cmsBanAccount({ apiId: '1234' });
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### cmsKickAccount(params)
|
|
222
|
+
Performs a CMS kick request for the targeted account.
|
|
223
|
+
```js
|
|
224
|
+
await instance.cms.cmsKickAccount({ discord: '1234567890' });
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### forceSync(params)
|
|
228
|
+
Manually triggers a CMS force-sync for the targeted identifiers.
|
|
229
|
+
```js
|
|
230
|
+
await instance.cms.forceSync({ username: 'SomeUser' });
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### getCurrentClockIn(params)
|
|
234
|
+
Fetches the current clock-in entry for the account if one exists.
|
|
235
|
+
```js
|
|
236
|
+
const currentEntry = await instance.cms.getCurrentClockIn({ apiId: '1234' });
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### getAccounts(options)
|
|
240
|
+
Retrieves CMS accounts with optional pagination and status filters.
|
|
241
|
+
```js
|
|
242
|
+
const accounts = await instance.cms.getAccounts({ take: 50, banned: false });
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### getProfileFields()
|
|
246
|
+
Returns profile field definitions configured for the community.
|
|
247
|
+
```js
|
|
248
|
+
const profileFields = await instance.cms.getProfileFields();
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### rsvp(eventId, params)
|
|
252
|
+
Toggles RSVP for an event for the provided account identifiers.
|
|
253
|
+
```js
|
|
254
|
+
await instance.cms.rsvp('event-id', { accId: 'account-uuid' });
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### getFormSubmissions(templateId, options)
|
|
258
|
+
Retrieves form submissions with optional pagination.
|
|
259
|
+
```js
|
|
260
|
+
const submissions = await instance.cms.getFormSubmissions(42, { skip: 0, take: 25 });
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### editAccountProfileFields(params)
|
|
264
|
+
Updates profile fields for an account.
|
|
265
|
+
```js
|
|
266
|
+
await instance.cms.editAccountProfileFields({
|
|
267
|
+
accId: 'account-uuid',
|
|
268
|
+
profileFields: [
|
|
269
|
+
{ fieldId: 10, value: 'Value' }
|
|
270
|
+
]
|
|
271
|
+
});
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### erlcGetOnlinePlayers(robloxJoinCode)
|
|
275
|
+
Returns the current ERLC player list for the join code.
|
|
276
|
+
```js
|
|
277
|
+
const players = await instance.cms.erlcGetOnlinePlayers('join-code');
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### erlcGetPlayerQueue(robloxJoinCode)
|
|
281
|
+
Returns the current ERLC player queue count for the join code.
|
|
282
|
+
```js
|
|
283
|
+
const queue = await instance.cms.erlcGetPlayerQueue('join-code');
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### erlcAddNewRecord(data)
|
|
287
|
+
Adds a moderation record for a player in ERLC.
|
|
288
|
+
```js
|
|
289
|
+
await instance.cms.erlcAddNewRecord({
|
|
290
|
+
robloxJoinCode: 'join-code',
|
|
291
|
+
executerDiscordId: '1234567890',
|
|
292
|
+
type: 'Warning',
|
|
293
|
+
reason: 'Reckless driving'
|
|
294
|
+
});
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Radio Functions
|
|
298
|
+
### getCommunityChannels()
|
|
299
|
+
Retrieves configured community channel groups and channels.
|
|
300
|
+
```js
|
|
301
|
+
const channels = await instance.radio.getCommunityChannels();
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### getConnectedUsers()
|
|
305
|
+
Lists all connected radio users in the community.
|
|
306
|
+
```js
|
|
307
|
+
const users = await instance.radio.getConnectedUsers();
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### getConnectedUser(roomId, identity)
|
|
311
|
+
Fetches a specific connected radio user by room and identity.
|
|
312
|
+
```js
|
|
313
|
+
const user = await instance.radio.getConnectedUser(1, 'account-uuid');
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### setUserChannels(identity, options)
|
|
317
|
+
Updates a user's transmit or scan channels.
|
|
318
|
+
```js
|
|
319
|
+
await instance.radio.setUserChannels('account-uuid', { transmit: 12, scan: [10, 11, 12] });
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### setUserDisplayName(accId, displayName)
|
|
323
|
+
Sets the user's radio display name.
|
|
324
|
+
```js
|
|
325
|
+
await instance.radio.setUserDisplayName('account-uuid', 'Dispatch 101');
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### getServerSubscriptionFromIp()
|
|
329
|
+
Resolves the community's subscription level for the calling server IP.
|
|
330
|
+
```js
|
|
331
|
+
const subscription = await instance.radio.getServerSubscriptionFromIp();
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### setServerIp(pushUrl)
|
|
335
|
+
Registers the push event URL for radio webhooks.
|
|
336
|
+
```js
|
|
337
|
+
await instance.radio.setServerIp('https://example.com/sonoran-radio');
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### setInGameSpeakerLocations(locations, token?)
|
|
341
|
+
Publishes available in-game speaker locations for tone routing.
|
|
342
|
+
```js
|
|
343
|
+
await instance.radio.setInGameSpeakerLocations(
|
|
344
|
+
[{ name: 'Station 1', x: 123.4, y: 567.8, z: 90.1 }],
|
|
345
|
+
'optional-bearer-token'
|
|
346
|
+
);
|
|
347
|
+
```
|
|
348
|
+
|
|
179
349
|
## Further Documentation
|
|
180
350
|
More documentation for Sonoran CAD specific methods and usage can be found [here](/docs/CAD-Methods-and-Usage.md), Sonoran CMS specific methods and usage can be found [here](/docs/CMS-Methods-and-Usage.md), and usage information for the REST class [here](/docs/REST-Methods-and-Usage.md).
|
package/src/constants.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { CADActiveUnit } from './structures/CADActiveUnit';
|
|
|
6
6
|
|
|
7
7
|
export enum productEnums {
|
|
8
8
|
CAD,
|
|
9
|
-
CMS
|
|
9
|
+
CMS,
|
|
10
|
+
RADIO
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface CADNewDispatchBuilderOptions {
|
|
@@ -252,6 +253,31 @@ export interface CMSSetAccountNamePromiseResult {
|
|
|
252
253
|
reason?: string;
|
|
253
254
|
}
|
|
254
255
|
|
|
256
|
+
export interface CADSetClockTimePromiseResult {
|
|
257
|
+
success: boolean;
|
|
258
|
+
reason?: string;
|
|
259
|
+
data?: unknown;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface CADJoinCommunityPromiseResult {
|
|
263
|
+
success: boolean;
|
|
264
|
+
reason?: string;
|
|
265
|
+
data?: unknown;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface CADLeaveCommunityPromiseResult {
|
|
269
|
+
success: boolean;
|
|
270
|
+
reason?: string;
|
|
271
|
+
data?: unknown;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface CMSProfileField {
|
|
275
|
+
id: string;
|
|
276
|
+
type: string;
|
|
277
|
+
label: string;
|
|
278
|
+
options: unknown;
|
|
279
|
+
}
|
|
280
|
+
|
|
255
281
|
export interface CMSKickAccountPromiseResult {
|
|
256
282
|
success: boolean;
|
|
257
283
|
reason?: string;
|
|
@@ -267,6 +293,84 @@ export interface CMSForceSyncPromiseResult {
|
|
|
267
293
|
reason?: string;
|
|
268
294
|
}
|
|
269
295
|
|
|
296
|
+
export interface CMSGetCurrentClockInPromiseResult {
|
|
297
|
+
success: boolean;
|
|
298
|
+
reason?: string;
|
|
299
|
+
data?: clockInOutRequest | null;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface CMSAccountSummary {
|
|
303
|
+
accId: string;
|
|
304
|
+
accName: string;
|
|
305
|
+
activeApiIds: string[];
|
|
306
|
+
discordId?: string;
|
|
307
|
+
sysStatus: boolean;
|
|
308
|
+
comStatus: boolean;
|
|
309
|
+
archived: boolean;
|
|
310
|
+
banned: boolean;
|
|
311
|
+
[key: string]: unknown;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface CMSAccountsPage {
|
|
315
|
+
total: number;
|
|
316
|
+
skip: number;
|
|
317
|
+
take: number;
|
|
318
|
+
accounts: CMSAccountSummary[];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export interface CMSGetAccountsPromiseResult {
|
|
322
|
+
success: boolean;
|
|
323
|
+
reason?: string;
|
|
324
|
+
data?: CMSAccountsPage;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface CMSGetProfileFieldsPromiseResult {
|
|
328
|
+
success: boolean;
|
|
329
|
+
reason?: string;
|
|
330
|
+
data?: CMSProfileField[];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export interface CMSProfileFieldUpdate {
|
|
334
|
+
id: string;
|
|
335
|
+
value: unknown;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface CMSEditAccountProfileFieldsPromiseResult {
|
|
339
|
+
success: boolean;
|
|
340
|
+
reason?: string;
|
|
341
|
+
data?: CMSProfileFieldUpdate[];
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface CMSRsvpPromiseResult {
|
|
345
|
+
success: boolean;
|
|
346
|
+
reason?: string;
|
|
347
|
+
status?: string;
|
|
348
|
+
data?: unknown;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface CMSSetGameServerStruct {
|
|
352
|
+
id?: number;
|
|
353
|
+
name: string;
|
|
354
|
+
description?: string;
|
|
355
|
+
ip?: string;
|
|
356
|
+
port?: string;
|
|
357
|
+
allowedRanks?: string[];
|
|
358
|
+
blockedRanks?: string[];
|
|
359
|
+
[key: string]: unknown;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface CMSSetGameServersPromiseResult {
|
|
363
|
+
success: boolean;
|
|
364
|
+
reason?: string;
|
|
365
|
+
data?: CMSSetGameServerStruct[];
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export interface CMSGetFormSubmissionsPromiseResult<T = unknown> {
|
|
369
|
+
success: boolean;
|
|
370
|
+
reason?: string;
|
|
371
|
+
data?: T[];
|
|
372
|
+
}
|
|
373
|
+
|
|
270
374
|
export interface CMSERLCGetOnlinePlayersPromiseResult {
|
|
271
375
|
success: boolean;
|
|
272
376
|
reason?: string;
|
|
@@ -278,8 +382,141 @@ export interface CMSERLCGetOnlinePlayersPromiseResult {
|
|
|
278
382
|
}[];
|
|
279
383
|
}
|
|
280
384
|
|
|
385
|
+
export interface CMSERLCGetPlayerQueuePromiseResult {
|
|
386
|
+
success: boolean;
|
|
387
|
+
reason?: string;
|
|
388
|
+
data?: number;
|
|
389
|
+
}
|
|
390
|
+
|
|
281
391
|
export interface CMSERLCAddNewRecordPromiseResult {
|
|
282
392
|
success: boolean;
|
|
283
393
|
reason?: string;
|
|
284
394
|
logId?: string;
|
|
285
|
-
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export interface RadioChannelGroup {
|
|
398
|
+
id: number;
|
|
399
|
+
name: string;
|
|
400
|
+
orderIndex: number;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export interface RadioChannel {
|
|
404
|
+
id: number;
|
|
405
|
+
groupId: number;
|
|
406
|
+
displayName: string;
|
|
407
|
+
recvFreqMajor: number;
|
|
408
|
+
recvFreqMinor: number;
|
|
409
|
+
xmitFreqMajor: number;
|
|
410
|
+
xmitFreqMinor: number;
|
|
411
|
+
repeatsXmit: boolean;
|
|
412
|
+
status: boolean;
|
|
413
|
+
orderIndex: number;
|
|
414
|
+
talkoverProtection: boolean;
|
|
415
|
+
[key: string]: unknown;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export interface RadioConnectedUserMetadataScanList {
|
|
419
|
+
id: number;
|
|
420
|
+
name: string;
|
|
421
|
+
channelIds: number[];
|
|
422
|
+
[key: string]: unknown;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export interface RadioConnectedUserMetadataState {
|
|
426
|
+
primaryChId?: number;
|
|
427
|
+
scannedChIds?: number[];
|
|
428
|
+
scanLists?: RadioConnectedUserMetadataScanList[];
|
|
429
|
+
spec?: number;
|
|
430
|
+
[key: string]: unknown;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface RadioConnectedUserMetadata {
|
|
434
|
+
sonrad?: boolean;
|
|
435
|
+
state?: RadioConnectedUserMetadataState;
|
|
436
|
+
[key: string]: unknown;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export interface RadioConnectedUser {
|
|
440
|
+
identity: string;
|
|
441
|
+
name: string;
|
|
442
|
+
roomId?: number;
|
|
443
|
+
metadata: RadioConnectedUserMetadata;
|
|
444
|
+
[key: string]: unknown;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface RadioSpeakerLocation {
|
|
448
|
+
label: string;
|
|
449
|
+
id: string;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export interface RadioSetUserChannelsOptions {
|
|
453
|
+
transmit?: number;
|
|
454
|
+
scan?: number[];
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export type RadioSubscriptionLevel = 0 | 1 | 2;
|
|
458
|
+
|
|
459
|
+
export interface RadioGetCommunityChannelsPromiseResult {
|
|
460
|
+
success: boolean;
|
|
461
|
+
reason?: string;
|
|
462
|
+
data?: {
|
|
463
|
+
result: string;
|
|
464
|
+
groups: RadioChannelGroup[];
|
|
465
|
+
channels: RadioChannel[];
|
|
466
|
+
[key: string]: unknown;
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
export interface RadioGetConnectedUsersPromiseResult {
|
|
471
|
+
success: boolean;
|
|
472
|
+
reason?: string;
|
|
473
|
+
data?: {
|
|
474
|
+
result: string;
|
|
475
|
+
connectedUsers: RadioConnectedUser[];
|
|
476
|
+
[key: string]: unknown;
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface RadioGetConnectedUserPromiseResult {
|
|
481
|
+
success: boolean;
|
|
482
|
+
reason?: string;
|
|
483
|
+
data?: {
|
|
484
|
+
result: string;
|
|
485
|
+
data: RadioConnectedUser;
|
|
486
|
+
[key: string]: unknown;
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export interface RadioSetUserChannelsPromiseResult {
|
|
491
|
+
success: boolean;
|
|
492
|
+
reason?: string;
|
|
493
|
+
result?: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface RadioSetUserDisplayNamePromiseResult {
|
|
497
|
+
success: boolean;
|
|
498
|
+
reason?: string;
|
|
499
|
+
result?: string;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export interface RadioGetServerSubscriptionFromIpPromiseResult {
|
|
503
|
+
success: boolean;
|
|
504
|
+
reason?: string;
|
|
505
|
+
data?: {
|
|
506
|
+
result: string;
|
|
507
|
+
subscription: RadioSubscriptionLevel;
|
|
508
|
+
[key: string]: unknown;
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export interface RadioSetServerIpPromiseResult {
|
|
513
|
+
success: boolean;
|
|
514
|
+
reason?: string;
|
|
515
|
+
result?: string;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export interface RadioSetInGameSpeakerLocationsPromiseResult {
|
|
519
|
+
success: boolean;
|
|
520
|
+
reason?: string;
|
|
521
|
+
result?: string;
|
|
522
|
+
}
|