@sonoransoftware/sonoran.js 1.0.19 → 1.0.20
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/.eslintrc.js +10 -10
- package/.github/workflows/npm-publish.yml +34 -34
- package/.prettierrc.js +6 -6
- package/dist/builders/cad/DispatchCall.d.ts +92 -92
- package/dist/builders/cad/DispatchCall.js +144 -144
- package/dist/builders/cad/index.d.ts +1 -1
- package/dist/builders/cad/index.js +17 -17
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +19 -19
- package/dist/constants.d.ts +230 -230
- package/dist/constants.js +27 -27
- package/dist/errors/LibraryErrors.d.ts +19 -19
- package/dist/errors/LibraryErrors.js +47 -47
- package/dist/errors/Messages.d.ts +1 -1
- package/dist/errors/Messages.js +8 -8
- package/dist/errors/index.d.ts +2 -2
- package/dist/errors/index.js +18 -18
- package/dist/index.d.ts +4 -4
- package/dist/index.js +24 -24
- package/dist/instance/Instance.d.ts +24 -24
- package/dist/instance/Instance.js +139 -139
- package/dist/instance/instance.types.d.ts +17 -17
- package/dist/instance/instance.types.js +2 -2
- package/dist/libs/rest/src/index.d.ts +6 -6
- package/dist/libs/rest/src/index.js +22 -22
- package/dist/libs/rest/src/lib/REST.d.ts +101 -101
- package/dist/libs/rest/src/lib/REST.js +136 -129
- package/dist/libs/rest/src/lib/RequestManager.d.ts +59 -59
- package/dist/libs/rest/src/lib/RequestManager.js +191 -191
- package/dist/libs/rest/src/lib/errors/APIError.d.ts +9 -9
- package/dist/libs/rest/src/lib/errors/APIError.js +17 -17
- package/dist/libs/rest/src/lib/errors/HTTPError.d.ts +17 -17
- package/dist/libs/rest/src/lib/errors/HTTPError.js +23 -23
- package/dist/libs/rest/src/lib/errors/RateLimitError.d.ts +13 -13
- package/dist/libs/rest/src/lib/errors/RateLimitError.js +19 -19
- package/dist/libs/rest/src/lib/errors/index.d.ts +4 -4
- package/dist/libs/rest/src/lib/errors/index.js +20 -20
- package/dist/libs/rest/src/lib/handlers/IHandler.d.ts +7 -7
- package/dist/libs/rest/src/lib/handlers/IHandler.js +2 -2
- package/dist/libs/rest/src/lib/handlers/SequentialHandler.d.ts +45 -45
- package/dist/libs/rest/src/lib/handlers/SequentialHandler.js +143 -143
- package/dist/libs/rest/src/lib/utils/constants.d.ts +533 -527
- package/dist/libs/rest/src/lib/utils/constants.js +463 -455
- package/dist/libs/rest/src/lib/utils/utils.d.ts +1 -1
- package/dist/libs/rest/src/lib/utils/utils.js +22 -22
- package/dist/managers/BaseManager.d.ts +14 -14
- package/dist/managers/BaseManager.js +18 -18
- package/dist/managers/CADActiveUnitsManager.d.ts +15 -15
- package/dist/managers/CADActiveUnitsManager.js +38 -38
- package/dist/managers/CADManager.d.ts +29 -29
- package/dist/managers/CADManager.js +86 -86
- package/dist/managers/CADServerManager.d.ts +8 -8
- package/dist/managers/CADServerManager.js +28 -28
- package/dist/managers/CMSManager.d.ts +101 -101
- package/dist/managers/CMSManager.js +266 -266
- package/dist/managers/CMSServerManager.d.ts +8 -8
- package/dist/managers/CMSServerManager.js +34 -34
- package/dist/managers/CacheManager.d.ts +10 -10
- package/dist/managers/CacheManager.js +36 -36
- package/dist/managers/DataManager.d.ts +31 -31
- package/dist/managers/DataManager.js +58 -58
- package/dist/structures/Base.d.ts +9 -9
- package/dist/structures/Base.js +24 -24
- package/dist/structures/CADActiveUnit.d.ts +47 -47
- package/dist/structures/CADActiveUnit.js +66 -66
- package/dist/structures/CADServer.d.ts +26 -26
- package/dist/structures/CADServer.js +15 -15
- package/dist/structures/CMSServer.d.ts +18 -18
- package/dist/structures/CMSServer.js +12 -12
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +17 -17
- package/dist/utils/utils.d.ts +13 -13
- package/dist/utils/utils.js +79 -79
- package/docs/CAD-Methods-and-Usage.md +58 -58
- package/docs/CMS-Methods-and-Usage.md +211 -211
- package/docs/REST-Methods-and-Usage.md +46 -46
- package/package.json +48 -48
- package/readme.md +53 -53
- package/src/constants.ts +248 -248
- package/src/instance/Instance.ts +121 -121
- package/src/instance/instance.types.ts +17 -17
- package/src/libs/rest/src/lib/REST.ts +241 -234
- package/src/libs/rest/src/lib/RequestManager.ts +260 -260
- package/src/libs/rest/src/lib/handlers/SequentialHandler.ts +160 -160
- package/src/libs/rest/src/lib/utils/constants.ts +1012 -997
- package/src/managers/CADManager.ts +63 -63
- package/src/managers/CMSManager.ts +226 -226
- package/src/managers/CMSServerManager.ts +32 -32
- package/tsconfig.json +71 -71
package/readme.md
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
# Sonoran.js
|
|
2
|
-
Sonoran.js is a library that allows you to interact with the [Sonoran CAD](https://sonorancad.com/) and [Sonoran CMS](https://sonorancms.com/) API. Based off of and utilizes several Discord.js library techniques for ease of use.
|
|
3
|
-
|
|
4
|
-
## Example Instance Setup
|
|
5
|
-
|
|
6
|
-
Utilizing both Sonoran CMS & Sonoran CAD
|
|
7
|
-
```js
|
|
8
|
-
const Sonoran = require('sonoran.js');
|
|
9
|
-
const instance = Sonoran.instance({
|
|
10
|
-
cadCommunityId: 'mycommunity',
|
|
11
|
-
cadApiKey: 'DF58F1E-FD8A-44C5-BA',
|
|
12
|
-
cmsCommunityId: 'mycommunity',
|
|
13
|
-
cmsApiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf'
|
|
14
|
-
});
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Utilizing just Sonoran CMS or Sonoran CAD
|
|
18
|
-
```js
|
|
19
|
-
const Sonoran = require('sonoran.js');
|
|
20
|
-
const instance = Sonoran.instance({
|
|
21
|
-
communityId: 'mycommunity',
|
|
22
|
-
apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',
|
|
23
|
-
product: Sonoran.productEnums.CMS
|
|
24
|
-
});
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Example Method Usage
|
|
28
|
-
```js
|
|
29
|
-
const Sonoran = require('sonoran.js');
|
|
30
|
-
const instance = Sonoran.instance({
|
|
31
|
-
communityId: 'mycommunity',
|
|
32
|
-
apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',
|
|
33
|
-
product: Sonoran.productEnums.CMS,
|
|
34
|
-
serverId: 2 // Optional - The default server id for both CAD & CMS is 1
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// This will verify the whitelist of the given API ID or account ID for server id 2 as specified above
|
|
38
|
-
instance.cms.verifyWhitelist('459798465498798432');
|
|
39
|
-
// OR
|
|
40
|
-
// This will verify the whitelist of the given API ID for server id 1 since I specified that
|
|
41
|
-
instance.cms.verifyWhitelist({
|
|
42
|
-
apiId: '459798465498798432',
|
|
43
|
-
serverId: 1
|
|
44
|
-
});
|
|
45
|
-
// OR
|
|
46
|
-
// This will verify the whitelist of the given account ID for server id 1 since I specified that
|
|
47
|
-
instance.cms.verifyWhitelist({
|
|
48
|
-
accId: 'd5663516-ee35-11e9-9714-5600023b2434',
|
|
49
|
-
serverId: 1
|
|
50
|
-
});
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Further Documentation
|
|
1
|
+
# Sonoran.js
|
|
2
|
+
Sonoran.js is a library that allows you to interact with the [Sonoran CAD](https://sonorancad.com/) and [Sonoran CMS](https://sonorancms.com/) API. Based off of and utilizes several Discord.js library techniques for ease of use.
|
|
3
|
+
|
|
4
|
+
## Example Instance Setup
|
|
5
|
+
|
|
6
|
+
Utilizing both Sonoran CMS & Sonoran CAD
|
|
7
|
+
```js
|
|
8
|
+
const Sonoran = require('sonoran.js');
|
|
9
|
+
const instance = Sonoran.instance({
|
|
10
|
+
cadCommunityId: 'mycommunity',
|
|
11
|
+
cadApiKey: 'DF58F1E-FD8A-44C5-BA',
|
|
12
|
+
cmsCommunityId: 'mycommunity',
|
|
13
|
+
cmsApiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf'
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Utilizing just Sonoran CMS or Sonoran CAD
|
|
18
|
+
```js
|
|
19
|
+
const Sonoran = require('sonoran.js');
|
|
20
|
+
const instance = Sonoran.instance({
|
|
21
|
+
communityId: 'mycommunity',
|
|
22
|
+
apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',
|
|
23
|
+
product: Sonoran.productEnums.CMS
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example Method Usage
|
|
28
|
+
```js
|
|
29
|
+
const Sonoran = require('sonoran.js');
|
|
30
|
+
const instance = Sonoran.instance({
|
|
31
|
+
communityId: 'mycommunity',
|
|
32
|
+
apiKey: 'e6ba9d68-ca7a-4e59-a9e2-93e275b4e0bf',
|
|
33
|
+
product: Sonoran.productEnums.CMS,
|
|
34
|
+
serverId: 2 // Optional - The default server id for both CAD & CMS is 1
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// This will verify the whitelist of the given API ID or account ID for server id 2 as specified above
|
|
38
|
+
instance.cms.verifyWhitelist('459798465498798432');
|
|
39
|
+
// OR
|
|
40
|
+
// This will verify the whitelist of the given API ID for server id 1 since I specified that
|
|
41
|
+
instance.cms.verifyWhitelist({
|
|
42
|
+
apiId: '459798465498798432',
|
|
43
|
+
serverId: 1
|
|
44
|
+
});
|
|
45
|
+
// OR
|
|
46
|
+
// This will verify the whitelist of the given account ID for server id 1 since I specified that
|
|
47
|
+
instance.cms.verifyWhitelist({
|
|
48
|
+
accId: 'd5663516-ee35-11e9-9714-5600023b2434',
|
|
49
|
+
serverId: 1
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Further Documentation
|
|
54
54
|
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
|
@@ -1,249 +1,249 @@
|
|
|
1
|
-
import { Collection } from '@discordjs/collection';
|
|
2
|
-
import { CADDispatchOriginEnums, CADDispatchStatusEnums } from './libs/rest/src';
|
|
3
|
-
import { DataManager } from './managers/DataManager';
|
|
4
|
-
import { CADActiveUnitsManager } from './managers/CADActiveUnitsManager';
|
|
5
|
-
import { CADActiveUnit } from './structures/CADActiveUnit';
|
|
6
|
-
|
|
7
|
-
export enum productEnums {
|
|
8
|
-
CAD,
|
|
9
|
-
CMS
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface CADNewDispatchBuilderOptions {
|
|
13
|
-
serverId?: number;
|
|
14
|
-
origin?: CADDispatchOriginEnums;
|
|
15
|
-
status?: CADDispatchStatusEnums;
|
|
16
|
-
priority?: 1 | 2 | 3;
|
|
17
|
-
block?: string;
|
|
18
|
-
address?: string;
|
|
19
|
-
postal?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
code?: string;
|
|
22
|
-
primary?: number;
|
|
23
|
-
trackPrimary?: boolean;
|
|
24
|
-
description?: string;
|
|
25
|
-
metaData?: Record<string, string>;
|
|
26
|
-
units?: string[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type Constructable<T> = abstract new (...args: any[]) => T;
|
|
30
|
-
|
|
31
|
-
export interface Caches {
|
|
32
|
-
CADActiveUnitsManager: [manager: typeof CADActiveUnitsManager, holds: CADActiveUnit];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export type CacheConstructors = {
|
|
36
|
-
[K in keyof Caches]: Caches[K][0] & { name: K };
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export type CacheFactory = (
|
|
40
|
-
manager: CacheConstructors[keyof Caches],
|
|
41
|
-
holds: Caches[typeof manager['name']][1],
|
|
42
|
-
) => typeof manager['prototype'] extends DataManager<infer K, infer V, any> ? Collection<K, V> : never;
|
|
43
|
-
|
|
44
|
-
export interface CADActiveUnitFetchOptions {
|
|
45
|
-
id?: number | number[];
|
|
46
|
-
accId?: string | string[];
|
|
47
|
-
apiId?: string | string[];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export enum CADSubscriptionVersionEnum {
|
|
51
|
-
FREE = 0,
|
|
52
|
-
STARTER = 1,
|
|
53
|
-
STANDARD = 2,
|
|
54
|
-
PLUS = 3,
|
|
55
|
-
PRO = 4,
|
|
56
|
-
ONE = 6
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export enum CMSSubscriptionVersionEnum {
|
|
60
|
-
FREE = 0,
|
|
61
|
-
STARTER = 1,
|
|
62
|
-
STANDARD = 2,
|
|
63
|
-
PLUS = 3,
|
|
64
|
-
PRO = 4,
|
|
65
|
-
ONE = 6
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export type Mutable<T> = {
|
|
69
|
-
-readonly [k in keyof T]: T[k];
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export interface CMSVerifyWhitelistPromiseResult {
|
|
73
|
-
success: boolean;
|
|
74
|
-
reason?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface CMSGetFullWhitelistPromiseResult {
|
|
78
|
-
success: boolean;
|
|
79
|
-
reason?: string;
|
|
80
|
-
data?: {
|
|
81
|
-
name: string;
|
|
82
|
-
apiIds: string[];
|
|
83
|
-
}[];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface CMSGetAccountRanksPromiseResult {
|
|
87
|
-
success: boolean;
|
|
88
|
-
reason?: string;
|
|
89
|
-
data?: string[];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface CMSGetComAccountPromiseResult {
|
|
93
|
-
success: boolean;
|
|
94
|
-
reason?: string;
|
|
95
|
-
data?: {
|
|
96
|
-
accId: string;
|
|
97
|
-
sysStatus: boolean;
|
|
98
|
-
comStatus: boolean;
|
|
99
|
-
joinDate: string;
|
|
100
|
-
lastLogin: string;
|
|
101
|
-
owner: boolean;
|
|
102
|
-
banned: boolean;
|
|
103
|
-
activeApiIds: string[];
|
|
104
|
-
primaryIdentifier: string;
|
|
105
|
-
secondaryIdentifiers: {
|
|
106
|
-
identifiers: { id: string; label: string; }[];
|
|
107
|
-
}
|
|
108
|
-
primaryRank: string;
|
|
109
|
-
secondaryRanks: string[];
|
|
110
|
-
primaryDepartment: string;
|
|
111
|
-
secondaryDepartments: string[];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export const uuidRegex = /[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/i;
|
|
116
|
-
|
|
117
|
-
export interface CMSClockInOutPromiseResult {
|
|
118
|
-
success: boolean;
|
|
119
|
-
reason?: string;
|
|
120
|
-
clockedIn?: boolean;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface CMSClockInOutParams {
|
|
124
|
-
accId?: string;
|
|
125
|
-
apiId?: string;
|
|
126
|
-
forceClockIn?: boolean;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface CMSCheckComApiIdPromiseResult {
|
|
130
|
-
success: boolean;
|
|
131
|
-
reason?: string;
|
|
132
|
-
username?: string;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface CMSGetDepartmentsPromiseResult {
|
|
136
|
-
success: boolean;
|
|
137
|
-
reason?: string;
|
|
138
|
-
data?: CMSDepartment[];
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface CMSSetAccountRanksPromiseResult {
|
|
142
|
-
success: boolean;
|
|
143
|
-
reason?: string;
|
|
144
|
-
data?: {
|
|
145
|
-
accId: string;
|
|
146
|
-
sysStatus: boolean;
|
|
147
|
-
comStatus: boolean;
|
|
148
|
-
joinDate: string;
|
|
149
|
-
lastLogin: string;
|
|
150
|
-
owner: boolean;
|
|
151
|
-
banned: boolean;
|
|
152
|
-
activeApiIds: string[];
|
|
153
|
-
primaryIdentifier: string;
|
|
154
|
-
secondaryIdentifiers: {
|
|
155
|
-
identifiers: { id: string; label: string; }[];
|
|
156
|
-
}
|
|
157
|
-
primaryRank: string;
|
|
158
|
-
secondaryRanks: string[];
|
|
159
|
-
primaryDepartment: string;
|
|
160
|
-
secondaryDepartments: string[];
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export interface CMSSetAccountRanksChangesObject {
|
|
165
|
-
set?: {
|
|
166
|
-
primary?: string | null;
|
|
167
|
-
secondary?: string[];
|
|
168
|
-
}
|
|
169
|
-
add: string[];
|
|
170
|
-
remove: string[];
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface CMSDepartment {
|
|
174
|
-
uuid: string;
|
|
175
|
-
label: string;
|
|
176
|
-
labelTwo: string;
|
|
177
|
-
ranks: {
|
|
178
|
-
id: string;
|
|
179
|
-
label: string;
|
|
180
|
-
primaryOnly: boolean;
|
|
181
|
-
secondaryOnly: boolean;
|
|
182
|
-
}[];
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface CADGetAccountPromiseResult {
|
|
186
|
-
success: boolean;
|
|
187
|
-
reason?: string;
|
|
188
|
-
data?: {
|
|
189
|
-
uuid: string;
|
|
190
|
-
username: string;
|
|
191
|
-
status: number;
|
|
192
|
-
joined: string;
|
|
193
|
-
lastLogin: string;
|
|
194
|
-
permissions: {
|
|
195
|
-
civilian: boolean;
|
|
196
|
-
lawyer: boolean;
|
|
197
|
-
dmv: boolean;
|
|
198
|
-
police: boolean;
|
|
199
|
-
fire: boolean;
|
|
200
|
-
ems: boolean;
|
|
201
|
-
dispatch: boolean;
|
|
202
|
-
admin: boolean;
|
|
203
|
-
polRecAdd: boolean;
|
|
204
|
-
polRecEdit: boolean;
|
|
205
|
-
polRecRemove: boolean;
|
|
206
|
-
polSuper: boolean;
|
|
207
|
-
polEditUnit: boolean;
|
|
208
|
-
polEditOtherUnit: boolean;
|
|
209
|
-
selfDispatch: boolean;
|
|
210
|
-
liveMap: boolean;
|
|
211
|
-
medRecAdd: boolean;
|
|
212
|
-
medRecEdit: boolean;
|
|
213
|
-
medRecRemove: boolean;
|
|
214
|
-
medSuper: boolean;
|
|
215
|
-
fireRecAdd: boolean;
|
|
216
|
-
fireRecEdit: boolean;
|
|
217
|
-
fireRecRemove: boolean;
|
|
218
|
-
fireSuper: boolean;
|
|
219
|
-
dmvRecAdd: boolean;
|
|
220
|
-
dmvRecEdit: boolean;
|
|
221
|
-
dmvRecRemove: boolean;
|
|
222
|
-
dmvSuper: boolean;
|
|
223
|
-
modifyStreetSigns: boolean;
|
|
224
|
-
lawRecAdd: boolean;
|
|
225
|
-
lawRecEdit: boolean;
|
|
226
|
-
lawRecRemove: boolean;
|
|
227
|
-
lawSuper: boolean;
|
|
228
|
-
adminAccounts: boolean;
|
|
229
|
-
adminPermissionKeys: boolean;
|
|
230
|
-
adminCustomization: boolean;
|
|
231
|
-
adminDepartments: boolean;
|
|
232
|
-
adminTenCodes: boolean;
|
|
233
|
-
adminPenalCodes: boolean;
|
|
234
|
-
adminInGameIntegration: boolean;
|
|
235
|
-
adminDiscordIntegration: boolean;
|
|
236
|
-
adminLimits: boolean;
|
|
237
|
-
adminLogs: boolean;
|
|
238
|
-
},
|
|
239
|
-
apiIds: string[];
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export interface clockInOutRequest {
|
|
244
|
-
id: number;
|
|
245
|
-
notes: any[];
|
|
246
|
-
endTime: string;
|
|
247
|
-
completed: boolean;
|
|
248
|
-
startTime: string;
|
|
1
|
+
import { Collection } from '@discordjs/collection';
|
|
2
|
+
import { CADDispatchOriginEnums, CADDispatchStatusEnums } from './libs/rest/src';
|
|
3
|
+
import { DataManager } from './managers/DataManager';
|
|
4
|
+
import { CADActiveUnitsManager } from './managers/CADActiveUnitsManager';
|
|
5
|
+
import { CADActiveUnit } from './structures/CADActiveUnit';
|
|
6
|
+
|
|
7
|
+
export enum productEnums {
|
|
8
|
+
CAD,
|
|
9
|
+
CMS
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CADNewDispatchBuilderOptions {
|
|
13
|
+
serverId?: number;
|
|
14
|
+
origin?: CADDispatchOriginEnums;
|
|
15
|
+
status?: CADDispatchStatusEnums;
|
|
16
|
+
priority?: 1 | 2 | 3;
|
|
17
|
+
block?: string;
|
|
18
|
+
address?: string;
|
|
19
|
+
postal?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
primary?: number;
|
|
23
|
+
trackPrimary?: boolean;
|
|
24
|
+
description?: string;
|
|
25
|
+
metaData?: Record<string, string>;
|
|
26
|
+
units?: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type Constructable<T> = abstract new (...args: any[]) => T;
|
|
30
|
+
|
|
31
|
+
export interface Caches {
|
|
32
|
+
CADActiveUnitsManager: [manager: typeof CADActiveUnitsManager, holds: CADActiveUnit];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type CacheConstructors = {
|
|
36
|
+
[K in keyof Caches]: Caches[K][0] & { name: K };
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type CacheFactory = (
|
|
40
|
+
manager: CacheConstructors[keyof Caches],
|
|
41
|
+
holds: Caches[typeof manager['name']][1],
|
|
42
|
+
) => typeof manager['prototype'] extends DataManager<infer K, infer V, any> ? Collection<K, V> : never;
|
|
43
|
+
|
|
44
|
+
export interface CADActiveUnitFetchOptions {
|
|
45
|
+
id?: number | number[];
|
|
46
|
+
accId?: string | string[];
|
|
47
|
+
apiId?: string | string[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export enum CADSubscriptionVersionEnum {
|
|
51
|
+
FREE = 0,
|
|
52
|
+
STARTER = 1,
|
|
53
|
+
STANDARD = 2,
|
|
54
|
+
PLUS = 3,
|
|
55
|
+
PRO = 4,
|
|
56
|
+
ONE = 6
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export enum CMSSubscriptionVersionEnum {
|
|
60
|
+
FREE = 0,
|
|
61
|
+
STARTER = 1,
|
|
62
|
+
STANDARD = 2,
|
|
63
|
+
PLUS = 3,
|
|
64
|
+
PRO = 4,
|
|
65
|
+
ONE = 6
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type Mutable<T> = {
|
|
69
|
+
-readonly [k in keyof T]: T[k];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export interface CMSVerifyWhitelistPromiseResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
reason?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CMSGetFullWhitelistPromiseResult {
|
|
78
|
+
success: boolean;
|
|
79
|
+
reason?: string;
|
|
80
|
+
data?: {
|
|
81
|
+
name: string;
|
|
82
|
+
apiIds: string[];
|
|
83
|
+
}[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface CMSGetAccountRanksPromiseResult {
|
|
87
|
+
success: boolean;
|
|
88
|
+
reason?: string;
|
|
89
|
+
data?: string[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface CMSGetComAccountPromiseResult {
|
|
93
|
+
success: boolean;
|
|
94
|
+
reason?: string;
|
|
95
|
+
data?: {
|
|
96
|
+
accId: string;
|
|
97
|
+
sysStatus: boolean;
|
|
98
|
+
comStatus: boolean;
|
|
99
|
+
joinDate: string;
|
|
100
|
+
lastLogin: string;
|
|
101
|
+
owner: boolean;
|
|
102
|
+
banned: boolean;
|
|
103
|
+
activeApiIds: string[];
|
|
104
|
+
primaryIdentifier: string;
|
|
105
|
+
secondaryIdentifiers: {
|
|
106
|
+
identifiers: { id: string; label: string; }[];
|
|
107
|
+
}
|
|
108
|
+
primaryRank: string;
|
|
109
|
+
secondaryRanks: string[];
|
|
110
|
+
primaryDepartment: string;
|
|
111
|
+
secondaryDepartments: string[];
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const uuidRegex = /[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/i;
|
|
116
|
+
|
|
117
|
+
export interface CMSClockInOutPromiseResult {
|
|
118
|
+
success: boolean;
|
|
119
|
+
reason?: string;
|
|
120
|
+
clockedIn?: boolean;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface CMSClockInOutParams {
|
|
124
|
+
accId?: string;
|
|
125
|
+
apiId?: string;
|
|
126
|
+
forceClockIn?: boolean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface CMSCheckComApiIdPromiseResult {
|
|
130
|
+
success: boolean;
|
|
131
|
+
reason?: string;
|
|
132
|
+
username?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface CMSGetDepartmentsPromiseResult {
|
|
136
|
+
success: boolean;
|
|
137
|
+
reason?: string;
|
|
138
|
+
data?: CMSDepartment[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface CMSSetAccountRanksPromiseResult {
|
|
142
|
+
success: boolean;
|
|
143
|
+
reason?: string;
|
|
144
|
+
data?: {
|
|
145
|
+
accId: string;
|
|
146
|
+
sysStatus: boolean;
|
|
147
|
+
comStatus: boolean;
|
|
148
|
+
joinDate: string;
|
|
149
|
+
lastLogin: string;
|
|
150
|
+
owner: boolean;
|
|
151
|
+
banned: boolean;
|
|
152
|
+
activeApiIds: string[];
|
|
153
|
+
primaryIdentifier: string;
|
|
154
|
+
secondaryIdentifiers: {
|
|
155
|
+
identifiers: { id: string; label: string; }[];
|
|
156
|
+
}
|
|
157
|
+
primaryRank: string;
|
|
158
|
+
secondaryRanks: string[];
|
|
159
|
+
primaryDepartment: string;
|
|
160
|
+
secondaryDepartments: string[];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface CMSSetAccountRanksChangesObject {
|
|
165
|
+
set?: {
|
|
166
|
+
primary?: string | null;
|
|
167
|
+
secondary?: string[];
|
|
168
|
+
}
|
|
169
|
+
add: string[];
|
|
170
|
+
remove: string[];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface CMSDepartment {
|
|
174
|
+
uuid: string;
|
|
175
|
+
label: string;
|
|
176
|
+
labelTwo: string;
|
|
177
|
+
ranks: {
|
|
178
|
+
id: string;
|
|
179
|
+
label: string;
|
|
180
|
+
primaryOnly: boolean;
|
|
181
|
+
secondaryOnly: boolean;
|
|
182
|
+
}[];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface CADGetAccountPromiseResult {
|
|
186
|
+
success: boolean;
|
|
187
|
+
reason?: string;
|
|
188
|
+
data?: {
|
|
189
|
+
uuid: string;
|
|
190
|
+
username: string;
|
|
191
|
+
status: number;
|
|
192
|
+
joined: string;
|
|
193
|
+
lastLogin: string;
|
|
194
|
+
permissions: {
|
|
195
|
+
civilian: boolean;
|
|
196
|
+
lawyer: boolean;
|
|
197
|
+
dmv: boolean;
|
|
198
|
+
police: boolean;
|
|
199
|
+
fire: boolean;
|
|
200
|
+
ems: boolean;
|
|
201
|
+
dispatch: boolean;
|
|
202
|
+
admin: boolean;
|
|
203
|
+
polRecAdd: boolean;
|
|
204
|
+
polRecEdit: boolean;
|
|
205
|
+
polRecRemove: boolean;
|
|
206
|
+
polSuper: boolean;
|
|
207
|
+
polEditUnit: boolean;
|
|
208
|
+
polEditOtherUnit: boolean;
|
|
209
|
+
selfDispatch: boolean;
|
|
210
|
+
liveMap: boolean;
|
|
211
|
+
medRecAdd: boolean;
|
|
212
|
+
medRecEdit: boolean;
|
|
213
|
+
medRecRemove: boolean;
|
|
214
|
+
medSuper: boolean;
|
|
215
|
+
fireRecAdd: boolean;
|
|
216
|
+
fireRecEdit: boolean;
|
|
217
|
+
fireRecRemove: boolean;
|
|
218
|
+
fireSuper: boolean;
|
|
219
|
+
dmvRecAdd: boolean;
|
|
220
|
+
dmvRecEdit: boolean;
|
|
221
|
+
dmvRecRemove: boolean;
|
|
222
|
+
dmvSuper: boolean;
|
|
223
|
+
modifyStreetSigns: boolean;
|
|
224
|
+
lawRecAdd: boolean;
|
|
225
|
+
lawRecEdit: boolean;
|
|
226
|
+
lawRecRemove: boolean;
|
|
227
|
+
lawSuper: boolean;
|
|
228
|
+
adminAccounts: boolean;
|
|
229
|
+
adminPermissionKeys: boolean;
|
|
230
|
+
adminCustomization: boolean;
|
|
231
|
+
adminDepartments: boolean;
|
|
232
|
+
adminTenCodes: boolean;
|
|
233
|
+
adminPenalCodes: boolean;
|
|
234
|
+
adminInGameIntegration: boolean;
|
|
235
|
+
adminDiscordIntegration: boolean;
|
|
236
|
+
adminLimits: boolean;
|
|
237
|
+
adminLogs: boolean;
|
|
238
|
+
},
|
|
239
|
+
apiIds: string[];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface clockInOutRequest {
|
|
244
|
+
id: number;
|
|
245
|
+
notes: any[];
|
|
246
|
+
endTime: string;
|
|
247
|
+
completed: boolean;
|
|
248
|
+
startTime: string;
|
|
249
249
|
}
|