@sonoransoftware/sonoran.js 1.0.19 → 1.0.22
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/dist/constants.d.ts
CHANGED
|
@@ -1,230 +1,230 @@
|
|
|
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
|
-
export declare enum productEnums {
|
|
7
|
-
CAD = 0,
|
|
8
|
-
CMS = 1
|
|
9
|
-
}
|
|
10
|
-
export interface CADNewDispatchBuilderOptions {
|
|
11
|
-
serverId?: number;
|
|
12
|
-
origin?: CADDispatchOriginEnums;
|
|
13
|
-
status?: CADDispatchStatusEnums;
|
|
14
|
-
priority?: 1 | 2 | 3;
|
|
15
|
-
block?: string;
|
|
16
|
-
address?: string;
|
|
17
|
-
postal?: string;
|
|
18
|
-
title?: string;
|
|
19
|
-
code?: string;
|
|
20
|
-
primary?: number;
|
|
21
|
-
trackPrimary?: boolean;
|
|
22
|
-
description?: string;
|
|
23
|
-
metaData?: Record<string, string>;
|
|
24
|
-
units?: string[];
|
|
25
|
-
}
|
|
26
|
-
export type Constructable<T> = abstract new (...args: any[]) => T;
|
|
27
|
-
export interface Caches {
|
|
28
|
-
CADActiveUnitsManager: [manager: typeof CADActiveUnitsManager, holds: CADActiveUnit];
|
|
29
|
-
}
|
|
30
|
-
export type CacheConstructors = {
|
|
31
|
-
[K in keyof Caches]: Caches[K][0] & {
|
|
32
|
-
name: K;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export type CacheFactory = (manager: CacheConstructors[keyof Caches], holds: Caches[typeof manager['name']][1]) => typeof manager['prototype'] extends DataManager<infer K, infer V, any> ? Collection<K, V> : never;
|
|
36
|
-
export interface CADActiveUnitFetchOptions {
|
|
37
|
-
id?: number | number[];
|
|
38
|
-
accId?: string | string[];
|
|
39
|
-
apiId?: string | string[];
|
|
40
|
-
}
|
|
41
|
-
export declare enum CADSubscriptionVersionEnum {
|
|
42
|
-
FREE = 0,
|
|
43
|
-
STARTER = 1,
|
|
44
|
-
STANDARD = 2,
|
|
45
|
-
PLUS = 3,
|
|
46
|
-
PRO = 4,
|
|
47
|
-
ONE = 6
|
|
48
|
-
}
|
|
49
|
-
export declare enum CMSSubscriptionVersionEnum {
|
|
50
|
-
FREE = 0,
|
|
51
|
-
STARTER = 1,
|
|
52
|
-
STANDARD = 2,
|
|
53
|
-
PLUS = 3,
|
|
54
|
-
PRO = 4,
|
|
55
|
-
ONE = 6
|
|
56
|
-
}
|
|
57
|
-
export type Mutable<T> = {
|
|
58
|
-
-readonly [k in keyof T]: T[k];
|
|
59
|
-
};
|
|
60
|
-
export interface CMSVerifyWhitelistPromiseResult {
|
|
61
|
-
success: boolean;
|
|
62
|
-
reason?: string;
|
|
63
|
-
}
|
|
64
|
-
export interface CMSGetFullWhitelistPromiseResult {
|
|
65
|
-
success: boolean;
|
|
66
|
-
reason?: string;
|
|
67
|
-
data?: {
|
|
68
|
-
name: string;
|
|
69
|
-
apiIds: string[];
|
|
70
|
-
}[];
|
|
71
|
-
}
|
|
72
|
-
export interface CMSGetAccountRanksPromiseResult {
|
|
73
|
-
success: boolean;
|
|
74
|
-
reason?: string;
|
|
75
|
-
data?: string[];
|
|
76
|
-
}
|
|
77
|
-
export interface CMSGetComAccountPromiseResult {
|
|
78
|
-
success: boolean;
|
|
79
|
-
reason?: string;
|
|
80
|
-
data?: {
|
|
81
|
-
accId: string;
|
|
82
|
-
sysStatus: boolean;
|
|
83
|
-
comStatus: boolean;
|
|
84
|
-
joinDate: string;
|
|
85
|
-
lastLogin: string;
|
|
86
|
-
owner: boolean;
|
|
87
|
-
banned: boolean;
|
|
88
|
-
activeApiIds: string[];
|
|
89
|
-
primaryIdentifier: string;
|
|
90
|
-
secondaryIdentifiers: {
|
|
91
|
-
identifiers: {
|
|
92
|
-
id: string;
|
|
93
|
-
label: string;
|
|
94
|
-
}[];
|
|
95
|
-
};
|
|
96
|
-
primaryRank: string;
|
|
97
|
-
secondaryRanks: string[];
|
|
98
|
-
primaryDepartment: string;
|
|
99
|
-
secondaryDepartments: string[];
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
export declare const uuidRegex: RegExp;
|
|
103
|
-
export interface CMSClockInOutPromiseResult {
|
|
104
|
-
success: boolean;
|
|
105
|
-
reason?: string;
|
|
106
|
-
clockedIn?: boolean;
|
|
107
|
-
}
|
|
108
|
-
export interface CMSClockInOutParams {
|
|
109
|
-
accId?: string;
|
|
110
|
-
apiId?: string;
|
|
111
|
-
forceClockIn?: boolean;
|
|
112
|
-
}
|
|
113
|
-
export interface CMSCheckComApiIdPromiseResult {
|
|
114
|
-
success: boolean;
|
|
115
|
-
reason?: string;
|
|
116
|
-
username?: string;
|
|
117
|
-
}
|
|
118
|
-
export interface CMSGetDepartmentsPromiseResult {
|
|
119
|
-
success: boolean;
|
|
120
|
-
reason?: string;
|
|
121
|
-
data?: CMSDepartment[];
|
|
122
|
-
}
|
|
123
|
-
export interface CMSSetAccountRanksPromiseResult {
|
|
124
|
-
success: boolean;
|
|
125
|
-
reason?: string;
|
|
126
|
-
data?: {
|
|
127
|
-
accId: string;
|
|
128
|
-
sysStatus: boolean;
|
|
129
|
-
comStatus: boolean;
|
|
130
|
-
joinDate: string;
|
|
131
|
-
lastLogin: string;
|
|
132
|
-
owner: boolean;
|
|
133
|
-
banned: boolean;
|
|
134
|
-
activeApiIds: string[];
|
|
135
|
-
primaryIdentifier: string;
|
|
136
|
-
secondaryIdentifiers: {
|
|
137
|
-
identifiers: {
|
|
138
|
-
id: string;
|
|
139
|
-
label: string;
|
|
140
|
-
}[];
|
|
141
|
-
};
|
|
142
|
-
primaryRank: string;
|
|
143
|
-
secondaryRanks: string[];
|
|
144
|
-
primaryDepartment: string;
|
|
145
|
-
secondaryDepartments: string[];
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
export interface CMSSetAccountRanksChangesObject {
|
|
149
|
-
set?: {
|
|
150
|
-
primary?: string | null;
|
|
151
|
-
secondary?: string[];
|
|
152
|
-
};
|
|
153
|
-
add: string[];
|
|
154
|
-
remove: string[];
|
|
155
|
-
}
|
|
156
|
-
export interface CMSDepartment {
|
|
157
|
-
uuid: string;
|
|
158
|
-
label: string;
|
|
159
|
-
labelTwo: string;
|
|
160
|
-
ranks: {
|
|
161
|
-
id: string;
|
|
162
|
-
label: string;
|
|
163
|
-
primaryOnly: boolean;
|
|
164
|
-
secondaryOnly: boolean;
|
|
165
|
-
}[];
|
|
166
|
-
}
|
|
167
|
-
export interface CADGetAccountPromiseResult {
|
|
168
|
-
success: boolean;
|
|
169
|
-
reason?: string;
|
|
170
|
-
data?: {
|
|
171
|
-
uuid: string;
|
|
172
|
-
username: string;
|
|
173
|
-
status: number;
|
|
174
|
-
joined: string;
|
|
175
|
-
lastLogin: string;
|
|
176
|
-
permissions: {
|
|
177
|
-
civilian: boolean;
|
|
178
|
-
lawyer: boolean;
|
|
179
|
-
dmv: boolean;
|
|
180
|
-
police: boolean;
|
|
181
|
-
fire: boolean;
|
|
182
|
-
ems: boolean;
|
|
183
|
-
dispatch: boolean;
|
|
184
|
-
admin: boolean;
|
|
185
|
-
polRecAdd: boolean;
|
|
186
|
-
polRecEdit: boolean;
|
|
187
|
-
polRecRemove: boolean;
|
|
188
|
-
polSuper: boolean;
|
|
189
|
-
polEditUnit: boolean;
|
|
190
|
-
polEditOtherUnit: boolean;
|
|
191
|
-
selfDispatch: boolean;
|
|
192
|
-
liveMap: boolean;
|
|
193
|
-
medRecAdd: boolean;
|
|
194
|
-
medRecEdit: boolean;
|
|
195
|
-
medRecRemove: boolean;
|
|
196
|
-
medSuper: boolean;
|
|
197
|
-
fireRecAdd: boolean;
|
|
198
|
-
fireRecEdit: boolean;
|
|
199
|
-
fireRecRemove: boolean;
|
|
200
|
-
fireSuper: boolean;
|
|
201
|
-
dmvRecAdd: boolean;
|
|
202
|
-
dmvRecEdit: boolean;
|
|
203
|
-
dmvRecRemove: boolean;
|
|
204
|
-
dmvSuper: boolean;
|
|
205
|
-
modifyStreetSigns: boolean;
|
|
206
|
-
lawRecAdd: boolean;
|
|
207
|
-
lawRecEdit: boolean;
|
|
208
|
-
lawRecRemove: boolean;
|
|
209
|
-
lawSuper: boolean;
|
|
210
|
-
adminAccounts: boolean;
|
|
211
|
-
adminPermissionKeys: boolean;
|
|
212
|
-
adminCustomization: boolean;
|
|
213
|
-
adminDepartments: boolean;
|
|
214
|
-
adminTenCodes: boolean;
|
|
215
|
-
adminPenalCodes: boolean;
|
|
216
|
-
adminInGameIntegration: boolean;
|
|
217
|
-
adminDiscordIntegration: boolean;
|
|
218
|
-
adminLimits: boolean;
|
|
219
|
-
adminLogs: boolean;
|
|
220
|
-
};
|
|
221
|
-
apiIds: string[];
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
export interface clockInOutRequest {
|
|
225
|
-
id: number;
|
|
226
|
-
notes: any[];
|
|
227
|
-
endTime: string;
|
|
228
|
-
completed: boolean;
|
|
229
|
-
startTime: string;
|
|
230
|
-
}
|
|
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
|
+
export declare enum productEnums {
|
|
7
|
+
CAD = 0,
|
|
8
|
+
CMS = 1
|
|
9
|
+
}
|
|
10
|
+
export interface CADNewDispatchBuilderOptions {
|
|
11
|
+
serverId?: number;
|
|
12
|
+
origin?: CADDispatchOriginEnums;
|
|
13
|
+
status?: CADDispatchStatusEnums;
|
|
14
|
+
priority?: 1 | 2 | 3;
|
|
15
|
+
block?: string;
|
|
16
|
+
address?: string;
|
|
17
|
+
postal?: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
code?: string;
|
|
20
|
+
primary?: number;
|
|
21
|
+
trackPrimary?: boolean;
|
|
22
|
+
description?: string;
|
|
23
|
+
metaData?: Record<string, string>;
|
|
24
|
+
units?: string[];
|
|
25
|
+
}
|
|
26
|
+
export type Constructable<T> = abstract new (...args: any[]) => T;
|
|
27
|
+
export interface Caches {
|
|
28
|
+
CADActiveUnitsManager: [manager: typeof CADActiveUnitsManager, holds: CADActiveUnit];
|
|
29
|
+
}
|
|
30
|
+
export type CacheConstructors = {
|
|
31
|
+
[K in keyof Caches]: Caches[K][0] & {
|
|
32
|
+
name: K;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type CacheFactory = (manager: CacheConstructors[keyof Caches], holds: Caches[typeof manager['name']][1]) => typeof manager['prototype'] extends DataManager<infer K, infer V, any> ? Collection<K, V> : never;
|
|
36
|
+
export interface CADActiveUnitFetchOptions {
|
|
37
|
+
id?: number | number[];
|
|
38
|
+
accId?: string | string[];
|
|
39
|
+
apiId?: string | string[];
|
|
40
|
+
}
|
|
41
|
+
export declare enum CADSubscriptionVersionEnum {
|
|
42
|
+
FREE = 0,
|
|
43
|
+
STARTER = 1,
|
|
44
|
+
STANDARD = 2,
|
|
45
|
+
PLUS = 3,
|
|
46
|
+
PRO = 4,
|
|
47
|
+
ONE = 6
|
|
48
|
+
}
|
|
49
|
+
export declare enum CMSSubscriptionVersionEnum {
|
|
50
|
+
FREE = 0,
|
|
51
|
+
STARTER = 1,
|
|
52
|
+
STANDARD = 2,
|
|
53
|
+
PLUS = 3,
|
|
54
|
+
PRO = 4,
|
|
55
|
+
ONE = 6
|
|
56
|
+
}
|
|
57
|
+
export type Mutable<T> = {
|
|
58
|
+
-readonly [k in keyof T]: T[k];
|
|
59
|
+
};
|
|
60
|
+
export interface CMSVerifyWhitelistPromiseResult {
|
|
61
|
+
success: boolean;
|
|
62
|
+
reason?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface CMSGetFullWhitelistPromiseResult {
|
|
65
|
+
success: boolean;
|
|
66
|
+
reason?: string;
|
|
67
|
+
data?: {
|
|
68
|
+
name: string;
|
|
69
|
+
apiIds: string[];
|
|
70
|
+
}[];
|
|
71
|
+
}
|
|
72
|
+
export interface CMSGetAccountRanksPromiseResult {
|
|
73
|
+
success: boolean;
|
|
74
|
+
reason?: string;
|
|
75
|
+
data?: string[];
|
|
76
|
+
}
|
|
77
|
+
export interface CMSGetComAccountPromiseResult {
|
|
78
|
+
success: boolean;
|
|
79
|
+
reason?: string;
|
|
80
|
+
data?: {
|
|
81
|
+
accId: string;
|
|
82
|
+
sysStatus: boolean;
|
|
83
|
+
comStatus: boolean;
|
|
84
|
+
joinDate: string;
|
|
85
|
+
lastLogin: string;
|
|
86
|
+
owner: boolean;
|
|
87
|
+
banned: boolean;
|
|
88
|
+
activeApiIds: string[];
|
|
89
|
+
primaryIdentifier: string;
|
|
90
|
+
secondaryIdentifiers: {
|
|
91
|
+
identifiers: {
|
|
92
|
+
id: string;
|
|
93
|
+
label: string;
|
|
94
|
+
}[];
|
|
95
|
+
};
|
|
96
|
+
primaryRank: string;
|
|
97
|
+
secondaryRanks: string[];
|
|
98
|
+
primaryDepartment: string;
|
|
99
|
+
secondaryDepartments: string[];
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export declare const uuidRegex: RegExp;
|
|
103
|
+
export interface CMSClockInOutPromiseResult {
|
|
104
|
+
success: boolean;
|
|
105
|
+
reason?: string;
|
|
106
|
+
clockedIn?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface CMSClockInOutParams {
|
|
109
|
+
accId?: string;
|
|
110
|
+
apiId?: string;
|
|
111
|
+
forceClockIn?: boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface CMSCheckComApiIdPromiseResult {
|
|
114
|
+
success: boolean;
|
|
115
|
+
reason?: string;
|
|
116
|
+
username?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface CMSGetDepartmentsPromiseResult {
|
|
119
|
+
success: boolean;
|
|
120
|
+
reason?: string;
|
|
121
|
+
data?: CMSDepartment[];
|
|
122
|
+
}
|
|
123
|
+
export interface CMSSetAccountRanksPromiseResult {
|
|
124
|
+
success: boolean;
|
|
125
|
+
reason?: string;
|
|
126
|
+
data?: {
|
|
127
|
+
accId: string;
|
|
128
|
+
sysStatus: boolean;
|
|
129
|
+
comStatus: boolean;
|
|
130
|
+
joinDate: string;
|
|
131
|
+
lastLogin: string;
|
|
132
|
+
owner: boolean;
|
|
133
|
+
banned: boolean;
|
|
134
|
+
activeApiIds: string[];
|
|
135
|
+
primaryIdentifier: string;
|
|
136
|
+
secondaryIdentifiers: {
|
|
137
|
+
identifiers: {
|
|
138
|
+
id: string;
|
|
139
|
+
label: string;
|
|
140
|
+
}[];
|
|
141
|
+
};
|
|
142
|
+
primaryRank: string;
|
|
143
|
+
secondaryRanks: string[];
|
|
144
|
+
primaryDepartment: string;
|
|
145
|
+
secondaryDepartments: string[];
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export interface CMSSetAccountRanksChangesObject {
|
|
149
|
+
set?: {
|
|
150
|
+
primary?: string | null;
|
|
151
|
+
secondary?: string[];
|
|
152
|
+
};
|
|
153
|
+
add: string[];
|
|
154
|
+
remove: string[];
|
|
155
|
+
}
|
|
156
|
+
export interface CMSDepartment {
|
|
157
|
+
uuid: string;
|
|
158
|
+
label: string;
|
|
159
|
+
labelTwo: string;
|
|
160
|
+
ranks: {
|
|
161
|
+
id: string;
|
|
162
|
+
label: string;
|
|
163
|
+
primaryOnly: boolean;
|
|
164
|
+
secondaryOnly: boolean;
|
|
165
|
+
}[];
|
|
166
|
+
}
|
|
167
|
+
export interface CADGetAccountPromiseResult {
|
|
168
|
+
success: boolean;
|
|
169
|
+
reason?: string;
|
|
170
|
+
data?: {
|
|
171
|
+
uuid: string;
|
|
172
|
+
username: string;
|
|
173
|
+
status: number;
|
|
174
|
+
joined: string;
|
|
175
|
+
lastLogin: string;
|
|
176
|
+
permissions: {
|
|
177
|
+
civilian: boolean;
|
|
178
|
+
lawyer: boolean;
|
|
179
|
+
dmv: boolean;
|
|
180
|
+
police: boolean;
|
|
181
|
+
fire: boolean;
|
|
182
|
+
ems: boolean;
|
|
183
|
+
dispatch: boolean;
|
|
184
|
+
admin: boolean;
|
|
185
|
+
polRecAdd: boolean;
|
|
186
|
+
polRecEdit: boolean;
|
|
187
|
+
polRecRemove: boolean;
|
|
188
|
+
polSuper: boolean;
|
|
189
|
+
polEditUnit: boolean;
|
|
190
|
+
polEditOtherUnit: boolean;
|
|
191
|
+
selfDispatch: boolean;
|
|
192
|
+
liveMap: boolean;
|
|
193
|
+
medRecAdd: boolean;
|
|
194
|
+
medRecEdit: boolean;
|
|
195
|
+
medRecRemove: boolean;
|
|
196
|
+
medSuper: boolean;
|
|
197
|
+
fireRecAdd: boolean;
|
|
198
|
+
fireRecEdit: boolean;
|
|
199
|
+
fireRecRemove: boolean;
|
|
200
|
+
fireSuper: boolean;
|
|
201
|
+
dmvRecAdd: boolean;
|
|
202
|
+
dmvRecEdit: boolean;
|
|
203
|
+
dmvRecRemove: boolean;
|
|
204
|
+
dmvSuper: boolean;
|
|
205
|
+
modifyStreetSigns: boolean;
|
|
206
|
+
lawRecAdd: boolean;
|
|
207
|
+
lawRecEdit: boolean;
|
|
208
|
+
lawRecRemove: boolean;
|
|
209
|
+
lawSuper: boolean;
|
|
210
|
+
adminAccounts: boolean;
|
|
211
|
+
adminPermissionKeys: boolean;
|
|
212
|
+
adminCustomization: boolean;
|
|
213
|
+
adminDepartments: boolean;
|
|
214
|
+
adminTenCodes: boolean;
|
|
215
|
+
adminPenalCodes: boolean;
|
|
216
|
+
adminInGameIntegration: boolean;
|
|
217
|
+
adminDiscordIntegration: boolean;
|
|
218
|
+
adminLimits: boolean;
|
|
219
|
+
adminLogs: boolean;
|
|
220
|
+
};
|
|
221
|
+
apiIds: string[];
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
export interface clockInOutRequest {
|
|
225
|
+
id: number;
|
|
226
|
+
notes: any[];
|
|
227
|
+
endTime: string;
|
|
228
|
+
completed: boolean;
|
|
229
|
+
startTime: string;
|
|
230
|
+
}
|
package/dist/constants.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uuidRegex = exports.CMSSubscriptionVersionEnum = exports.CADSubscriptionVersionEnum = exports.productEnums = void 0;
|
|
4
|
-
var productEnums;
|
|
5
|
-
(function (productEnums) {
|
|
6
|
-
productEnums[productEnums["CAD"] = 0] = "CAD";
|
|
7
|
-
productEnums[productEnums["CMS"] = 1] = "CMS";
|
|
8
|
-
})(productEnums = exports.productEnums || (exports.productEnums = {}));
|
|
9
|
-
var CADSubscriptionVersionEnum;
|
|
10
|
-
(function (CADSubscriptionVersionEnum) {
|
|
11
|
-
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["FREE"] = 0] = "FREE";
|
|
12
|
-
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["STARTER"] = 1] = "STARTER";
|
|
13
|
-
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["STANDARD"] = 2] = "STANDARD";
|
|
14
|
-
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["PLUS"] = 3] = "PLUS";
|
|
15
|
-
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["PRO"] = 4] = "PRO";
|
|
16
|
-
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["ONE"] = 6] = "ONE";
|
|
17
|
-
})(CADSubscriptionVersionEnum = exports.CADSubscriptionVersionEnum || (exports.CADSubscriptionVersionEnum = {}));
|
|
18
|
-
var CMSSubscriptionVersionEnum;
|
|
19
|
-
(function (CMSSubscriptionVersionEnum) {
|
|
20
|
-
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["FREE"] = 0] = "FREE";
|
|
21
|
-
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["STARTER"] = 1] = "STARTER";
|
|
22
|
-
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["STANDARD"] = 2] = "STANDARD";
|
|
23
|
-
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["PLUS"] = 3] = "PLUS";
|
|
24
|
-
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["PRO"] = 4] = "PRO";
|
|
25
|
-
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["ONE"] = 6] = "ONE";
|
|
26
|
-
})(CMSSubscriptionVersionEnum = exports.CMSSubscriptionVersionEnum || (exports.CMSSubscriptionVersionEnum = {}));
|
|
27
|
-
exports.uuidRegex = /[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/i;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uuidRegex = exports.CMSSubscriptionVersionEnum = exports.CADSubscriptionVersionEnum = exports.productEnums = void 0;
|
|
4
|
+
var productEnums;
|
|
5
|
+
(function (productEnums) {
|
|
6
|
+
productEnums[productEnums["CAD"] = 0] = "CAD";
|
|
7
|
+
productEnums[productEnums["CMS"] = 1] = "CMS";
|
|
8
|
+
})(productEnums = exports.productEnums || (exports.productEnums = {}));
|
|
9
|
+
var CADSubscriptionVersionEnum;
|
|
10
|
+
(function (CADSubscriptionVersionEnum) {
|
|
11
|
+
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["FREE"] = 0] = "FREE";
|
|
12
|
+
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["STARTER"] = 1] = "STARTER";
|
|
13
|
+
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["STANDARD"] = 2] = "STANDARD";
|
|
14
|
+
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["PLUS"] = 3] = "PLUS";
|
|
15
|
+
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["PRO"] = 4] = "PRO";
|
|
16
|
+
CADSubscriptionVersionEnum[CADSubscriptionVersionEnum["ONE"] = 6] = "ONE";
|
|
17
|
+
})(CADSubscriptionVersionEnum = exports.CADSubscriptionVersionEnum || (exports.CADSubscriptionVersionEnum = {}));
|
|
18
|
+
var CMSSubscriptionVersionEnum;
|
|
19
|
+
(function (CMSSubscriptionVersionEnum) {
|
|
20
|
+
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["FREE"] = 0] = "FREE";
|
|
21
|
+
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["STARTER"] = 1] = "STARTER";
|
|
22
|
+
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["STANDARD"] = 2] = "STANDARD";
|
|
23
|
+
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["PLUS"] = 3] = "PLUS";
|
|
24
|
+
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["PRO"] = 4] = "PRO";
|
|
25
|
+
CMSSubscriptionVersionEnum[CMSSubscriptionVersionEnum["ONE"] = 6] = "ONE";
|
|
26
|
+
})(CMSSubscriptionVersionEnum = exports.CMSSubscriptionVersionEnum || (exports.CMSSubscriptionVersionEnum = {}));
|
|
27
|
+
exports.uuidRegex = /[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/i;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare class GenericError extends Error {
|
|
2
|
-
private readonly errCode;
|
|
3
|
-
constructor(key: string, ...args: Array<any>);
|
|
4
|
-
get name(): string;
|
|
5
|
-
get code(): string;
|
|
6
|
-
/**
|
|
7
|
-
* Format the message for an error.
|
|
8
|
-
* @param {string} key Error key
|
|
9
|
-
* @param {Array<any>} args Arguments to pass for util format or as function args
|
|
10
|
-
* @returns {string} Formatted string
|
|
11
|
-
*/
|
|
12
|
-
private static message;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Register an error code and message.
|
|
16
|
-
* @param {string} sym Unique name for the error
|
|
17
|
-
* @param {*} val Value of the error
|
|
18
|
-
*/
|
|
19
|
-
export declare function register(sym: symbol, val: any): void;
|
|
1
|
+
export declare class GenericError extends Error {
|
|
2
|
+
private readonly errCode;
|
|
3
|
+
constructor(key: string, ...args: Array<any>);
|
|
4
|
+
get name(): string;
|
|
5
|
+
get code(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format the message for an error.
|
|
8
|
+
* @param {string} key Error key
|
|
9
|
+
* @param {Array<any>} args Arguments to pass for util format or as function args
|
|
10
|
+
* @returns {string} Formatted string
|
|
11
|
+
*/
|
|
12
|
+
private static message;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Register an error code and message.
|
|
16
|
+
* @param {string} sym Unique name for the error
|
|
17
|
+
* @param {*} val Value of the error
|
|
18
|
+
*/
|
|
19
|
+
export declare function register(sym: symbol, val: any): void;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.register = exports.GenericError = void 0;
|
|
4
|
-
const messages = new Map();
|
|
5
|
-
class GenericError extends Error {
|
|
6
|
-
constructor(key, ...args) {
|
|
7
|
-
super(GenericError.message(key, args));
|
|
8
|
-
this.errCode = key;
|
|
9
|
-
if (Error.captureStackTrace)
|
|
10
|
-
Error.captureStackTrace(this, GenericError);
|
|
11
|
-
}
|
|
12
|
-
get name() {
|
|
13
|
-
return `${super.name} [${this.errCode}]`;
|
|
14
|
-
}
|
|
15
|
-
get code() {
|
|
16
|
-
return this.errCode;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Format the message for an error.
|
|
20
|
-
* @param {string} key Error key
|
|
21
|
-
* @param {Array<any>} args Arguments to pass for util format or as function args
|
|
22
|
-
* @returns {string} Formatted string
|
|
23
|
-
*/
|
|
24
|
-
static message(key, args) {
|
|
25
|
-
if (typeof key !== 'string')
|
|
26
|
-
throw new Error('Error message key must be a string');
|
|
27
|
-
const msg = messages.get(key);
|
|
28
|
-
if (!msg)
|
|
29
|
-
throw new Error(`An invalid error message key was used: ${key}.`);
|
|
30
|
-
if (typeof msg === 'function')
|
|
31
|
-
return msg(...args);
|
|
32
|
-
if (!(args === null || args === void 0 ? void 0 : args.length))
|
|
33
|
-
return msg;
|
|
34
|
-
args.unshift(msg);
|
|
35
|
-
return String(...args);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.GenericError = GenericError;
|
|
39
|
-
/**
|
|
40
|
-
* Register an error code and message.
|
|
41
|
-
* @param {string} sym Unique name for the error
|
|
42
|
-
* @param {*} val Value of the error
|
|
43
|
-
*/
|
|
44
|
-
function register(sym, val) {
|
|
45
|
-
messages.set(sym, typeof val === 'function' ? val : String(val));
|
|
46
|
-
}
|
|
47
|
-
exports.register = register;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.register = exports.GenericError = void 0;
|
|
4
|
+
const messages = new Map();
|
|
5
|
+
class GenericError extends Error {
|
|
6
|
+
constructor(key, ...args) {
|
|
7
|
+
super(GenericError.message(key, args));
|
|
8
|
+
this.errCode = key;
|
|
9
|
+
if (Error.captureStackTrace)
|
|
10
|
+
Error.captureStackTrace(this, GenericError);
|
|
11
|
+
}
|
|
12
|
+
get name() {
|
|
13
|
+
return `${super.name} [${this.errCode}]`;
|
|
14
|
+
}
|
|
15
|
+
get code() {
|
|
16
|
+
return this.errCode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Format the message for an error.
|
|
20
|
+
* @param {string} key Error key
|
|
21
|
+
* @param {Array<any>} args Arguments to pass for util format or as function args
|
|
22
|
+
* @returns {string} Formatted string
|
|
23
|
+
*/
|
|
24
|
+
static message(key, args) {
|
|
25
|
+
if (typeof key !== 'string')
|
|
26
|
+
throw new Error('Error message key must be a string');
|
|
27
|
+
const msg = messages.get(key);
|
|
28
|
+
if (!msg)
|
|
29
|
+
throw new Error(`An invalid error message key was used: ${key}.`);
|
|
30
|
+
if (typeof msg === 'function')
|
|
31
|
+
return msg(...args);
|
|
32
|
+
if (!(args === null || args === void 0 ? void 0 : args.length))
|
|
33
|
+
return msg;
|
|
34
|
+
args.unshift(msg);
|
|
35
|
+
return String(...args);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.GenericError = GenericError;
|
|
39
|
+
/**
|
|
40
|
+
* Register an error code and message.
|
|
41
|
+
* @param {string} sym Unique name for the error
|
|
42
|
+
* @param {*} val Value of the error
|
|
43
|
+
*/
|
|
44
|
+
function register(sym, val) {
|
|
45
|
+
messages.set(sym, typeof val === 'function' ? val : String(val));
|
|
46
|
+
}
|
|
47
|
+
exports.register = register;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/errors/Messages.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const LibraryErrors_1 = require("./LibraryErrors");
|
|
4
|
-
const Messages = {
|
|
5
|
-
NOT_IMPLEMENTED: (what, name) => `Method ${what} not implemented on ${name}.`
|
|
6
|
-
};
|
|
7
|
-
for (const [name, message] of Object.entries(Messages))
|
|
8
|
-
(0, LibraryErrors_1.register)(Symbol(name), message);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const LibraryErrors_1 = require("./LibraryErrors");
|
|
4
|
+
const Messages = {
|
|
5
|
+
NOT_IMPLEMENTED: (what, name) => `Method ${what} not implemented on ${name}.`
|
|
6
|
+
};
|
|
7
|
+
for (const [name, message] of Object.entries(Messages))
|
|
8
|
+
(0, LibraryErrors_1.register)(Symbol(name), message);
|