@sonoransoftware/sonoran.js 1.0.67 → 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builders/cad/DispatchCall.d.ts +5 -0
- package/dist/builders/cad/DispatchCall.js +8 -0
- package/dist/constants.d.ts +20 -0
- package/dist/index.d.ts +1 -1
- package/dist/libs/rest/src/lib/REST.js +10 -0
- package/dist/libs/rest/src/lib/utils/constants.d.ts +11 -1
- package/dist/managers/CADManager.d.ts +4 -3
- package/dist/managers/CADManager.js +12 -7
- package/package.json +1 -1
- package/readme.md +1 -1
- package/src/builders/cad/DispatchCall.ts +9 -0
- package/src/constants.ts +21 -0
- package/src/index.ts +1 -0
- package/src/libs/rest/src/lib/REST.ts +10 -0
- package/src/libs/rest/src/lib/utils/constants.ts +12 -1
- package/src/managers/CADManager.ts +15 -5
|
@@ -70,6 +70,11 @@ export declare class DispatchCallBuilder {
|
|
|
70
70
|
* @param metaData Dictionary of metadata to store with a dispatch call, can be used later on
|
|
71
71
|
*/
|
|
72
72
|
setMetadata(metaData: Record<string, string>): this;
|
|
73
|
+
/**
|
|
74
|
+
* Sets the auto-delete timer for this dispatch call
|
|
75
|
+
* @param deleteAfterMinutes Minutes until the dispatch call is deleted
|
|
76
|
+
*/
|
|
77
|
+
setDeleteAfterMinutes(deleteAfterMinutes: number): this;
|
|
73
78
|
/**
|
|
74
79
|
* Sets specified units for this dispatch call
|
|
75
80
|
* @param units Units to be removed from a call
|
|
@@ -108,6 +108,14 @@ class DispatchCallBuilder {
|
|
|
108
108
|
this.data.metaData = metaData;
|
|
109
109
|
return this;
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Sets the auto-delete timer for this dispatch call
|
|
113
|
+
* @param deleteAfterMinutes Minutes until the dispatch call is deleted
|
|
114
|
+
*/
|
|
115
|
+
setDeleteAfterMinutes(deleteAfterMinutes) {
|
|
116
|
+
this.data.deleteAfterMinutes = deleteAfterMinutes;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
111
119
|
/**
|
|
112
120
|
* Sets specified units for this dispatch call
|
|
113
121
|
* @param units Units to be removed from a call
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Collection } from '@discordjs/collection';
|
|
2
2
|
import { CADDispatchOriginEnums, CADDispatchStatusEnums } from './libs/rest/src';
|
|
3
|
+
import type { CADDispatchNoteStruct } from './libs/rest/src';
|
|
3
4
|
import { DataManager } from './managers/DataManager';
|
|
4
5
|
import { CADActiveUnitsManager } from './managers/CADActiveUnitsManager';
|
|
5
6
|
import { CADActiveUnit } from './structures/CADActiveUnit';
|
|
@@ -23,6 +24,25 @@ export interface CADNewDispatchBuilderOptions {
|
|
|
23
24
|
description?: string;
|
|
24
25
|
metaData?: Record<string, string>;
|
|
25
26
|
units?: string[];
|
|
27
|
+
deleteAfterMinutes?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface CADDispatchCallStruct {
|
|
30
|
+
callId: number;
|
|
31
|
+
origin: CADDispatchOriginEnums;
|
|
32
|
+
status: CADDispatchStatusEnums;
|
|
33
|
+
priority: 1 | 2 | 3;
|
|
34
|
+
block: string;
|
|
35
|
+
address: string;
|
|
36
|
+
postal: string;
|
|
37
|
+
title: string;
|
|
38
|
+
code: string;
|
|
39
|
+
primary: number;
|
|
40
|
+
trackPrimary: boolean;
|
|
41
|
+
description: string;
|
|
42
|
+
notes: CADDispatchNoteStruct[];
|
|
43
|
+
idents: number[];
|
|
44
|
+
metaData: Record<string, string>;
|
|
45
|
+
updated: string;
|
|
26
46
|
}
|
|
27
47
|
export type Constructable<T> = abstract new (...args: any[]) => T;
|
|
28
48
|
export interface Caches {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './instance/Instance';
|
|
2
2
|
export * from './builders';
|
|
3
3
|
export * from './libs/rest/src';
|
|
4
|
-
export { productEnums, CADNewDispatchBuilderOptions, CADSubscriptionVersionEnum, CMSSubscriptionVersionEnum, RadioSubscriptionLevel, RadioSetUserChannelsOptions, RadioChannel, RadioChannelGroup, RadioConnectedUser, RadioSpeakerLocation, RadioGetCommunityChannelsPromiseResult, RadioGetConnectedUsersPromiseResult, RadioGetConnectedUserPromiseResult, RadioSetUserChannelsPromiseResult, RadioSetUserDisplayNamePromiseResult, RadioGetServerSubscriptionFromIpPromiseResult, RadioSetServerIpPromiseResult, RadioSetInGameSpeakerLocationsPromiseResult, CADSetClockTimePromiseResult, CADJoinCommunityPromiseResult, CADLeaveCommunityPromiseResult, CADStandardResponse, CMSProfileField, CMSGetCurrentClockInPromiseResult, CMSAccountsPage, CMSAccountSummary, CMSGetAccountsPromiseResult, CMSGetProfileFieldsPromiseResult, CMSProfileFieldUpdate, CMSEditAccountProfileFieldsPromiseResult, CMSRsvpPromiseResult, CMSChangeFormStagePromiseResult, CMSSetGameServerStruct, CMSSetGameServersPromiseResult, CMSExecuteRankPromotionResult, CMSTriggerPromotionFlowPayload, CMSPromotionFlow, CMSTriggerPromotionFlowsPromiseResult, CMSGetPromotionFlowsPromiseResult, CMSCustomLogType, CMSGetCustomLogTypesPromiseResult, CMSGetFormSubmissionsPromiseResult, CMSERLCGetOnlinePlayersPromiseResult, CMSERLCGetPlayerQueuePromiseResult, CMSERLCAddNewRecordPromiseResult, CMSERLCExecuteCommandPayload, CMSERLCExecuteCommandPromiseResult, CMSERLCTeamsLockPromiseResult, CMSERLCTeamsUnlockPromiseResult } from './constants';
|
|
4
|
+
export { productEnums, CADNewDispatchBuilderOptions, CADDispatchCallStruct, CADSubscriptionVersionEnum, CMSSubscriptionVersionEnum, RadioSubscriptionLevel, RadioSetUserChannelsOptions, RadioChannel, RadioChannelGroup, RadioConnectedUser, RadioSpeakerLocation, RadioGetCommunityChannelsPromiseResult, RadioGetConnectedUsersPromiseResult, RadioGetConnectedUserPromiseResult, RadioSetUserChannelsPromiseResult, RadioSetUserDisplayNamePromiseResult, RadioGetServerSubscriptionFromIpPromiseResult, RadioSetServerIpPromiseResult, RadioSetInGameSpeakerLocationsPromiseResult, CADSetClockTimePromiseResult, CADJoinCommunityPromiseResult, CADLeaveCommunityPromiseResult, CADStandardResponse, CMSProfileField, CMSGetCurrentClockInPromiseResult, CMSAccountsPage, CMSAccountSummary, CMSGetAccountsPromiseResult, CMSGetProfileFieldsPromiseResult, CMSProfileFieldUpdate, CMSEditAccountProfileFieldsPromiseResult, CMSRsvpPromiseResult, CMSChangeFormStagePromiseResult, CMSSetGameServerStruct, CMSSetGameServersPromiseResult, CMSExecuteRankPromotionResult, CMSTriggerPromotionFlowPayload, CMSPromotionFlow, CMSTriggerPromotionFlowsPromiseResult, CMSGetPromotionFlowsPromiseResult, CMSCustomLogType, CMSGetCustomLogTypesPromiseResult, CMSGetFormSubmissionsPromiseResult, CMSERLCGetOnlinePlayersPromiseResult, CMSERLCGetPlayerQueuePromiseResult, CMSERLCAddNewRecordPromiseResult, CMSERLCExecuteCommandPayload, CMSERLCExecuteCommandPromiseResult, CMSERLCTeamsLockPromiseResult, CMSERLCTeamsUnlockPromiseResult } from './constants';
|
|
@@ -238,6 +238,16 @@ class REST extends events_1.EventEmitter {
|
|
|
238
238
|
label: args[3]
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
+
case 'REMOVE_911': {
|
|
242
|
+
const payload = args[0];
|
|
243
|
+
if (payload && typeof payload === 'object' && !Array.isArray(payload)) {
|
|
244
|
+
return payload;
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
serverId: args[0],
|
|
248
|
+
callId: args[1]
|
|
249
|
+
};
|
|
250
|
+
}
|
|
241
251
|
case 'CLOSE_CALL': {
|
|
242
252
|
const payload = args[0];
|
|
243
253
|
if (payload && typeof payload === 'object' && !Array.isArray(payload)) {
|
|
@@ -250,6 +250,10 @@ export interface CADAddCallNoteStruct {
|
|
|
250
250
|
note: string;
|
|
251
251
|
label?: string;
|
|
252
252
|
}
|
|
253
|
+
export interface CADRemove911Struct {
|
|
254
|
+
serverId: number;
|
|
255
|
+
callId: number;
|
|
256
|
+
}
|
|
253
257
|
export interface CADGetActiveUnitsStruct {
|
|
254
258
|
serverId?: number;
|
|
255
259
|
onlyUnits?: boolean;
|
|
@@ -307,6 +311,7 @@ interface CADNewDispatchBaseStruct {
|
|
|
307
311
|
description: string;
|
|
308
312
|
notes: CADDispatchNoteStruct[];
|
|
309
313
|
metaData: Record<string, string>;
|
|
314
|
+
deleteAfterMinutes?: number;
|
|
310
315
|
}
|
|
311
316
|
export type CADNewDispatchStruct = (CADNewDispatchBaseStruct & {
|
|
312
317
|
units: string[];
|
|
@@ -421,7 +426,12 @@ export interface RESTTypedAPIDataStructs {
|
|
|
421
426
|
ADD_BLIP: [data: CADAddBlipStruct[]];
|
|
422
427
|
MODIFY_BLIP: [data: CADModifyBlipStruct[]];
|
|
423
428
|
REMOVE_BLIP: [id: number];
|
|
424
|
-
REMOVE_911: [
|
|
429
|
+
REMOVE_911: [
|
|
430
|
+
serverId: number,
|
|
431
|
+
callId: number
|
|
432
|
+
] | [
|
|
433
|
+
data: CADRemove911Struct
|
|
434
|
+
];
|
|
425
435
|
GET_CALLS: [data: CADGetCallsStruct];
|
|
426
436
|
GET_MY_CALL: [data: CADGetMyCallStruct];
|
|
427
437
|
GET_ACTIVE_UNITS: [data: CADGetActiveUnitsStruct];
|
|
@@ -1,7 +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, CADSendDraftStruct, CADLookupByIntStruct, CADLookupStruct, CADModifyAccountPermsStruct, CADKickBanUserStruct, CADSetPostalStruct, CADModifyIdentifierStruct, CADIdentsToGroupStruct, CADAddBlipStruct, CADModifyBlipStruct, CADGetCallsStruct, CADGetMyCallStruct, CADAddCallNoteStruct, CADGetActiveUnitsStruct, CADNewDispatchStruct, CADAttachUnitsStruct, CADDetachUnitsStruct, CADStreetSignStruct, CADUnitLocationStruct, CADUnitPanicStruct } from '../libs/rest/src';
|
|
4
|
+
import type { CADPenalCodeStruct, CADSetAPIIDStruct, CADNewEditRecordOptionOneStruct, CADNewEditRecordOptionTwoStruct, CADSendDraftStruct, CADLookupByIntStruct, CADLookupStruct, CADModifyAccountPermsStruct, CADKickBanUserStruct, CADSetPostalStruct, CADModifyIdentifierStruct, CADIdentsToGroupStruct, CADAddBlipStruct, CADModifyBlipStruct, CADGetCallsStruct, CADGetMyCallStruct, CADAddCallNoteStruct, CADRemove911Struct, CADGetActiveUnitsStruct, CADNewDispatchStruct, CADAttachUnitsStruct, CADDetachUnitsStruct, CADStreetSignStruct, CADUnitLocationStruct, CADUnitPanicStruct } from '../libs/rest/src';
|
|
5
5
|
import { BaseManager } from './BaseManager';
|
|
6
6
|
import * as globalTypes from '../constants';
|
|
7
7
|
import { CADServerManager } from './CADServerManager';
|
|
@@ -207,7 +207,8 @@ export declare class CADManager extends BaseManager {
|
|
|
207
207
|
/**
|
|
208
208
|
* Removes a 911 call by its identifier.
|
|
209
209
|
*/
|
|
210
|
-
remove911Call(callId: number): Promise<globalTypes.CADStandardResponse>;
|
|
210
|
+
remove911Call(serverId: number, callId: number): Promise<globalTypes.CADStandardResponse>;
|
|
211
|
+
remove911Call(params: CADRemove911Struct): Promise<globalTypes.CADStandardResponse>;
|
|
211
212
|
/**
|
|
212
213
|
* Retrieves dispatch calls with optional pagination.
|
|
213
214
|
*/
|
|
@@ -227,7 +228,7 @@ export declare class CADManager extends BaseManager {
|
|
|
227
228
|
/**
|
|
228
229
|
* Creates a new dispatch call.
|
|
229
230
|
*/
|
|
230
|
-
createDispatch(data: CADNewDispatchStruct): Promise<globalTypes.CADStandardResponse
|
|
231
|
+
createDispatch(data: CADNewDispatchStruct): Promise<globalTypes.CADStandardResponse<globalTypes.CADDispatchCallStruct>>;
|
|
231
232
|
/**
|
|
232
233
|
* Attaches units to an existing dispatch call.
|
|
233
234
|
*/
|
|
@@ -535,14 +535,19 @@ class CADManager extends BaseManager_1.BaseManager {
|
|
|
535
535
|
}
|
|
536
536
|
return this.executeCadRequest('911_CALL', serverId, isEmergency, caller, location, description, metaData);
|
|
537
537
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
538
|
+
async remove911Call(serverIdOrParams, callId) {
|
|
539
|
+
let payload;
|
|
540
|
+
if (serverIdOrParams && typeof serverIdOrParams === 'object') {
|
|
541
|
+
payload = { ...serverIdOrParams };
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
payload = { serverId: serverIdOrParams, callId: callId };
|
|
545
|
+
}
|
|
546
|
+
const { serverId, callId: resolvedCallId } = payload;
|
|
547
|
+
if (!Number.isInteger(serverId) || !Number.isInteger(resolvedCallId)) {
|
|
548
|
+
throw new Error('serverId and callId must be integers when removing a 911 call.');
|
|
544
549
|
}
|
|
545
|
-
return this.executeCadRequest('REMOVE_911', callId);
|
|
550
|
+
return this.executeCadRequest('REMOVE_911', { serverId, callId: resolvedCallId });
|
|
546
551
|
}
|
|
547
552
|
/**
|
|
548
553
|
* Retrieves dispatch calls with optional pagination.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonoransoftware/sonoran.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.69",
|
|
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
|
@@ -130,7 +130,7 @@ await instance.cad.setUnitPanic({ identIds: [101, 102], isPanic: true });
|
|
|
130
130
|
- **`updateStreetSign(serverId, signData)`**
|
|
131
131
|
|
|
132
132
|
### Calls & Dispatch
|
|
133
|
-
- **`create911Call(details)`** / **`remove911Call(callId)`**
|
|
133
|
+
- **`create911Call(details)`** / **`remove911Call(serverId, callId)`**
|
|
134
134
|
- **`getCalls(options)`**
|
|
135
135
|
- **`getMyCall({ account })`**
|
|
136
136
|
- **`createDispatch(data)`** - accepts either `units` (API IDs) or `accounts` (account UUIDs) as arrays.
|
|
@@ -123,6 +123,15 @@ export class DispatchCallBuilder {
|
|
|
123
123
|
return this;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Sets the auto-delete timer for this dispatch call
|
|
128
|
+
* @param deleteAfterMinutes Minutes until the dispatch call is deleted
|
|
129
|
+
*/
|
|
130
|
+
public setDeleteAfterMinutes(deleteAfterMinutes: number): this {
|
|
131
|
+
this.data.deleteAfterMinutes = deleteAfterMinutes;
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
|
|
126
135
|
/**
|
|
127
136
|
* Sets specified units for this dispatch call
|
|
128
137
|
* @param units Units to be removed from a call
|
package/src/constants.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Collection } from '@discordjs/collection';
|
|
2
2
|
import { CADDispatchOriginEnums, CADDispatchStatusEnums } from './libs/rest/src';
|
|
3
|
+
import type { CADDispatchNoteStruct } from './libs/rest/src';
|
|
3
4
|
import { DataManager } from './managers/DataManager';
|
|
4
5
|
import { CADActiveUnitsManager } from './managers/CADActiveUnitsManager';
|
|
5
6
|
import { CADActiveUnit } from './structures/CADActiveUnit';
|
|
@@ -25,6 +26,26 @@ export interface CADNewDispatchBuilderOptions {
|
|
|
25
26
|
description?: string;
|
|
26
27
|
metaData?: Record<string, string>;
|
|
27
28
|
units?: string[];
|
|
29
|
+
deleteAfterMinutes?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface CADDispatchCallStruct {
|
|
33
|
+
callId: number;
|
|
34
|
+
origin: CADDispatchOriginEnums;
|
|
35
|
+
status: CADDispatchStatusEnums;
|
|
36
|
+
priority: 1 | 2 | 3;
|
|
37
|
+
block: string;
|
|
38
|
+
address: string;
|
|
39
|
+
postal: string;
|
|
40
|
+
title: string;
|
|
41
|
+
code: string;
|
|
42
|
+
primary: number;
|
|
43
|
+
trackPrimary: boolean;
|
|
44
|
+
description: string;
|
|
45
|
+
notes: CADDispatchNoteStruct[];
|
|
46
|
+
idents: number[];
|
|
47
|
+
metaData: Record<string, string>;
|
|
48
|
+
updated: string;
|
|
28
49
|
}
|
|
29
50
|
|
|
30
51
|
export type Constructable<T> = abstract new (...args: any[]) => T;
|
package/src/index.ts
CHANGED
|
@@ -342,6 +342,16 @@ export class REST extends EventEmitter {
|
|
|
342
342
|
label: args[3]
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
|
+
case 'REMOVE_911': {
|
|
346
|
+
const payload = args[0];
|
|
347
|
+
if (payload && typeof payload === 'object' && !Array.isArray(payload)) {
|
|
348
|
+
return payload;
|
|
349
|
+
}
|
|
350
|
+
return {
|
|
351
|
+
serverId: args[0],
|
|
352
|
+
callId: args[1]
|
|
353
|
+
};
|
|
354
|
+
}
|
|
345
355
|
case 'CLOSE_CALL': {
|
|
346
356
|
const payload = args[0];
|
|
347
357
|
if (payload && typeof payload === 'object' && !Array.isArray(payload)) {
|
|
@@ -956,6 +956,11 @@ export interface CADAddCallNoteStruct {
|
|
|
956
956
|
label?: string;
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
+
export interface CADRemove911Struct {
|
|
960
|
+
serverId: number;
|
|
961
|
+
callId: number;
|
|
962
|
+
}
|
|
963
|
+
|
|
959
964
|
export interface CADGetActiveUnitsStruct {
|
|
960
965
|
serverId?: number;
|
|
961
966
|
onlyUnits?: boolean;
|
|
@@ -1020,6 +1025,7 @@ interface CADNewDispatchBaseStruct {
|
|
|
1020
1025
|
description: string;
|
|
1021
1026
|
notes: CADDispatchNoteStruct[];
|
|
1022
1027
|
metaData: Record<string, string>;
|
|
1028
|
+
deleteAfterMinutes?: number;
|
|
1023
1029
|
}
|
|
1024
1030
|
|
|
1025
1031
|
export type CADNewDispatchStruct =
|
|
@@ -1134,7 +1140,12 @@ export interface RESTTypedAPIDataStructs {
|
|
|
1134
1140
|
ADD_BLIP: [data: CADAddBlipStruct[]];
|
|
1135
1141
|
MODIFY_BLIP: [data: CADModifyBlipStruct[]];
|
|
1136
1142
|
REMOVE_BLIP: [id: number];
|
|
1137
|
-
REMOVE_911: [
|
|
1143
|
+
REMOVE_911: [
|
|
1144
|
+
serverId: number,
|
|
1145
|
+
callId: number
|
|
1146
|
+
] | [
|
|
1147
|
+
data: CADRemove911Struct
|
|
1148
|
+
];
|
|
1138
1149
|
GET_CALLS: [data: CADGetCallsStruct];
|
|
1139
1150
|
GET_MY_CALL: [data: CADGetMyCallStruct];
|
|
1140
1151
|
GET_ACTIVE_UNITS: [data: CADGetActiveUnitsStruct];
|
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
CADGetCallsStruct,
|
|
21
21
|
CADGetMyCallStruct,
|
|
22
22
|
CADAddCallNoteStruct,
|
|
23
|
+
CADRemove911Struct,
|
|
23
24
|
CADGetActiveUnitsStruct,
|
|
24
25
|
CADNewDispatchStruct,
|
|
25
26
|
CADAttachUnitsStruct,
|
|
@@ -587,11 +588,20 @@ export class CADManager extends BaseManager {
|
|
|
587
588
|
/**
|
|
588
589
|
* Removes a 911 call by its identifier.
|
|
589
590
|
*/
|
|
590
|
-
public async remove911Call(callId: number): Promise<globalTypes.CADStandardResponse
|
|
591
|
-
|
|
592
|
-
|
|
591
|
+
public async remove911Call(serverId: number, callId: number): Promise<globalTypes.CADStandardResponse>;
|
|
592
|
+
public async remove911Call(params: CADRemove911Struct): Promise<globalTypes.CADStandardResponse>;
|
|
593
|
+
public async remove911Call(serverIdOrParams: number | CADRemove911Struct, callId?: number): Promise<globalTypes.CADStandardResponse> {
|
|
594
|
+
let payload: CADRemove911Struct;
|
|
595
|
+
if (serverIdOrParams && typeof serverIdOrParams === 'object') {
|
|
596
|
+
payload = { ...serverIdOrParams };
|
|
597
|
+
} else {
|
|
598
|
+
payload = { serverId: serverIdOrParams as number, callId: callId as number };
|
|
599
|
+
}
|
|
600
|
+
const { serverId, callId: resolvedCallId } = payload;
|
|
601
|
+
if (!Number.isInteger(serverId) || !Number.isInteger(resolvedCallId)) {
|
|
602
|
+
throw new Error('serverId and callId must be integers when removing a 911 call.');
|
|
593
603
|
}
|
|
594
|
-
return this.executeCadRequest('REMOVE_911', callId);
|
|
604
|
+
return this.executeCadRequest('REMOVE_911', { serverId, callId: resolvedCallId });
|
|
595
605
|
}
|
|
596
606
|
|
|
597
607
|
/**
|
|
@@ -634,7 +644,7 @@ export class CADManager extends BaseManager {
|
|
|
634
644
|
/**
|
|
635
645
|
* Creates a new dispatch call.
|
|
636
646
|
*/
|
|
637
|
-
public async createDispatch(data: CADNewDispatchStruct): Promise<globalTypes.CADStandardResponse
|
|
647
|
+
public async createDispatch(data: CADNewDispatchStruct): Promise<globalTypes.CADStandardResponse<globalTypes.CADDispatchCallStruct>> {
|
|
638
648
|
const hasUnits = Array.isArray(data.units);
|
|
639
649
|
const hasAccounts = Array.isArray(data.accounts);
|
|
640
650
|
const payload: CADNewDispatchStruct = {
|