@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,6 +1,7 @@
1
1
  import { Instance } from '../instance/Instance';
2
2
  import { CADSubscriptionVersionEnum } from '../constants';
3
3
  import { REST } from '../libs/rest/src';
4
+ import type { CADPenalCodeStruct, CADSetAPIIDStruct, CADNewEditRecordOptionOneStruct, CADNewEditRecordOptionTwoStruct, CADLookupByIntStruct, CADLookupStruct, CADModifyAccountPermsStruct, CADKickBanUserStruct, CADSetPostalStruct, CADModifyIdentifierStruct, CADAddBlipStruct, CADModifyBlipStruct, CADGetCallsStruct, CADGetActiveUnitsStruct, CADNewDispatchStruct, CADStreetSignStruct, CADUnitLocationStruct } from '../libs/rest/src';
4
5
  import { BaseManager } from './BaseManager';
5
6
  import * as globalTypes from '../constants';
6
7
  import { CADServerManager } from './CADServerManager';
@@ -15,6 +16,12 @@ export declare class CADManager extends BaseManager {
15
16
  servers: CADServerManager | undefined;
16
17
  constructor(instance: Instance);
17
18
  protected buildManager(instance: Instance): Promise<void>;
19
+ private getRest;
20
+ private executeCadRequest;
21
+ /**
22
+ * Retrieves the community's CAD subscription version.
23
+ */
24
+ getVersion(): Promise<number>;
18
25
  /**
19
26
  * Gets a community account by `accId` or `apiId`.
20
27
  * @param {Object} params The object that contains parameters to get a community account.
@@ -26,4 +33,220 @@ export declare class CADManager extends BaseManager {
26
33
  apiId?: string;
27
34
  username?: string;
28
35
  }): Promise<globalTypes.CADGetAccountPromiseResult>;
36
+ /**
37
+ * Updates the CAD clock to match in-game time.
38
+ */
39
+ setClockTime(data: {
40
+ serverId: number;
41
+ currentUtc: string;
42
+ currentGame: string;
43
+ secondsPerHour: number;
44
+ }): Promise<globalTypes.CADSetClockTimePromiseResult>;
45
+ /**
46
+ * Adds accounts to the community via the join community endpoint.
47
+ * NOTE: This endpoint is intended for internal CMS use and requires an internal key.
48
+ */
49
+ joinCommunity(internalKey: string, accounts: string | {
50
+ account: string;
51
+ } | Array<string | {
52
+ account: string;
53
+ }>): Promise<globalTypes.CADJoinCommunityPromiseResult>;
54
+ /**
55
+ * Removes accounts from the community via the leave community endpoint.
56
+ * NOTE: This endpoint is intended for internal CMS use and requires an internal key.
57
+ */
58
+ leaveCommunity(internalKey: string, accounts: string | {
59
+ account: string;
60
+ } | Array<string | {
61
+ account: string;
62
+ }>): Promise<globalTypes.CADLeaveCommunityPromiseResult>;
63
+ /**
64
+ * Updates the penal code configuration for the community.
65
+ */
66
+ setPenalCodes(codes: CADPenalCodeStruct[]): Promise<globalTypes.CADStandardResponse>;
67
+ /**
68
+ * Assigns API IDs to a community account.
69
+ */
70
+ setAccountApiIds(data: CADSetAPIIDStruct): Promise<globalTypes.CADStandardResponse>;
71
+ /**
72
+ * Retrieves record templates filtered by a specific record type.
73
+ */
74
+ getRecordTemplates(recordTypeId?: number): Promise<globalTypes.CADStandardResponse>;
75
+ /**
76
+ * Creates a new record entry.
77
+ */
78
+ createRecord(data: CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct): Promise<globalTypes.CADStandardResponse>;
79
+ /**
80
+ * Updates an existing record entry.
81
+ */
82
+ updateRecord(data: CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct): Promise<globalTypes.CADStandardResponse>;
83
+ /**
84
+ * Removes a record by its identifier.
85
+ */
86
+ removeRecord(id: number): Promise<globalTypes.CADStandardResponse>;
87
+ /**
88
+ * Performs an internal lookup using the CAD lookup by identifier endpoint.
89
+ */
90
+ lookupByInt(data: CADLookupByIntStruct): Promise<globalTypes.CADStandardResponse>;
91
+ /**
92
+ * Executes a CAD lookup using first/last name, plate, or other values.
93
+ */
94
+ lookupRecords(data: CADLookupStruct): Promise<globalTypes.CADStandardResponse>;
95
+ /**
96
+ * Checks whether the provided API ID exists.
97
+ */
98
+ checkApiId(apiId: string): Promise<globalTypes.CADStandardResponse>;
99
+ /**
100
+ * Applies a permission key to an account.
101
+ */
102
+ applyPermissionKey(apiId: string | undefined, permissionKey: string): Promise<globalTypes.CADStandardResponse>;
103
+ /**
104
+ * Sets account permissions for a CAD user.
105
+ */
106
+ setAccountPermissions(data: CADModifyAccountPermsStruct): Promise<globalTypes.CADStandardResponse>;
107
+ /**
108
+ * Bans or kicks a CAD user.
109
+ */
110
+ banUser(data: CADKickBanUserStruct): Promise<globalTypes.CADStandardResponse>;
111
+ /**
112
+ * Verifies a secret string against CAD configuration.
113
+ */
114
+ verifySecret(secret: string): Promise<globalTypes.CADStandardResponse>;
115
+ /**
116
+ * Authorizes street sign changes for a CAD server.
117
+ */
118
+ authorizeStreetSigns(serverId: number): Promise<globalTypes.CADStandardResponse>;
119
+ /**
120
+ * Replaces the community postal list.
121
+ */
122
+ setPostals(data: CADSetPostalStruct[]): Promise<globalTypes.CADStandardResponse>;
123
+ /**
124
+ * Sends a photo to CAD for the provided API ID.
125
+ */
126
+ sendPhoto(apiId: string | undefined, url: string): Promise<globalTypes.CADStandardResponse>;
127
+ /**
128
+ * Retrieves characters belonging to an API ID.
129
+ */
130
+ getCharacters(apiId: string): Promise<globalTypes.CADStandardResponse>;
131
+ /**
132
+ * Creates a new civilian character.
133
+ */
134
+ createCharacter(data: CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct): Promise<globalTypes.CADStandardResponse>;
135
+ /**
136
+ * Updates an existing civilian character.
137
+ */
138
+ updateCharacter(data: CADNewEditRecordOptionOneStruct | CADNewEditRecordOptionTwoStruct): Promise<globalTypes.CADStandardResponse>;
139
+ /**
140
+ * Removes a civilian character by identifier.
141
+ */
142
+ removeCharacter(id: number): Promise<globalTypes.CADStandardResponse>;
143
+ /**
144
+ * Retrieves identifiers assigned to an API ID.
145
+ */
146
+ getIdentifiers(apiId: string): Promise<globalTypes.CADStandardResponse>;
147
+ /**
148
+ * Modifies identifiers for an account.
149
+ */
150
+ modifyIdentifier(data: CADModifyIdentifierStruct): Promise<globalTypes.CADStandardResponse>;
151
+ /**
152
+ * Sets the active identifier by identifier ID.
153
+ */
154
+ setIdentifier(apiId: string | undefined, identId: number): Promise<globalTypes.CADStandardResponse>;
155
+ /**
156
+ * Toggles panic state for a unit.
157
+ */
158
+ setUnitPanic(apiId: string | undefined, isPanic: boolean): Promise<globalTypes.CADStandardResponse>;
159
+ /**
160
+ * Updates a unit's status.
161
+ */
162
+ setUnitStatus(apiId: string | undefined, status: number, serverId: number): Promise<globalTypes.CADStandardResponse>;
163
+ /**
164
+ * Retrieves live map blips for a CAD server.
165
+ */
166
+ getBlips(serverId: number): Promise<globalTypes.CADStandardResponse>;
167
+ /**
168
+ * Adds blips to the CAD map.
169
+ */
170
+ addBlips(blips: CADAddBlipStruct | CADAddBlipStruct[]): Promise<globalTypes.CADStandardResponse>;
171
+ /**
172
+ * Updates existing CAD map blips.
173
+ */
174
+ updateBlips(blips: CADModifyBlipStruct | CADModifyBlipStruct[]): Promise<globalTypes.CADStandardResponse>;
175
+ /**
176
+ * Removes a CAD map blip.
177
+ */
178
+ removeBlip(id: number): Promise<globalTypes.CADStandardResponse>;
179
+ /**
180
+ * Creates a new 911 call entry.
181
+ */
182
+ create911Call(params: {
183
+ serverId: number;
184
+ isEmergency: boolean;
185
+ caller: string;
186
+ location: string;
187
+ description: string;
188
+ metaData?: Record<string, string>;
189
+ }): Promise<globalTypes.CADStandardResponse>;
190
+ /**
191
+ * Removes a 911 call by its identifier.
192
+ */
193
+ remove911Call(callId: number): Promise<globalTypes.CADStandardResponse>;
194
+ /**
195
+ * Retrieves dispatch calls with optional pagination.
196
+ */
197
+ getCalls(options: CADGetCallsStruct): Promise<globalTypes.CADStandardResponse>;
198
+ /**
199
+ * Retrieves active units for the provided filters.
200
+ */
201
+ getActiveUnits(options: CADGetActiveUnitsStruct): Promise<globalTypes.CADStandardResponse>;
202
+ /**
203
+ * Kicks an active unit from the CAD.
204
+ */
205
+ kickUnit(apiId: string | undefined, reason: string, serverId: number): Promise<globalTypes.CADStandardResponse>;
206
+ /**
207
+ * Creates a new dispatch call.
208
+ */
209
+ createDispatch(data: CADNewDispatchStruct): Promise<globalTypes.CADStandardResponse>;
210
+ /**
211
+ * Attaches units to an existing dispatch call.
212
+ */
213
+ attachUnits(serverId: number, callId: number, units: string[]): Promise<globalTypes.CADStandardResponse>;
214
+ /**
215
+ * Detaches units from dispatch calls.
216
+ */
217
+ detachUnits(serverId: number, units: string[]): Promise<globalTypes.CADStandardResponse>;
218
+ /**
219
+ * Updates the postal code on a call.
220
+ */
221
+ setCallPostal(serverId: number, callId: number, postal: string): Promise<globalTypes.CADStandardResponse>;
222
+ /**
223
+ * Updates a call's primary unit.
224
+ */
225
+ setCallPrimary(serverId: number, callId: number, primary: number, trackPrimary: boolean): Promise<globalTypes.CADStandardResponse>;
226
+ /**
227
+ * Adds a note to an active call.
228
+ */
229
+ addCallNote(serverId: number, callId: number, note: string): Promise<globalTypes.CADStandardResponse>;
230
+ /**
231
+ * Closes a CAD call.
232
+ */
233
+ closeCall(serverId: number, callId: number): Promise<globalTypes.CADStandardResponse>;
234
+ /**
235
+ * Updates live unit locations on the CAD map.
236
+ */
237
+ updateUnitLocations(locations: CADUnitLocationStruct[]): Promise<globalTypes.CADStandardResponse>;
238
+ /**
239
+ * Replaces the street sign configuration for a server.
240
+ */
241
+ setStreetSignConfig(serverId: number, signConfig: CADStreetSignStruct[]): Promise<globalTypes.CADStandardResponse>;
242
+ /**
243
+ * Updates an existing street sign's text.
244
+ */
245
+ updateStreetSign(serverId: number, signData: {
246
+ ids: number[];
247
+ text1: string;
248
+ text2: string;
249
+ text3: string;
250
+ }): Promise<globalTypes.CADStandardResponse>;
251
+ private normalizeAccountEntries;
29
252
  }