tabletcommand-backend-models 7.4.61 → 7.4.63
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/.claude/settings.local.json +9 -0
- package/build/constants.js +12 -1
- package/build/constants.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/models/checklist-item.js +9 -1
- package/build/models/checklist-item.js.map +1 -1
- package/build/models/department.js +13 -0
- package/build/models/department.js.map +1 -1
- package/build/models/esri.js +1 -1
- package/build/models/esri.js.map +1 -1
- package/build/models/managed-incident.js +12 -0
- package/build/models/managed-incident.js.map +1 -1
- package/build/models/schema/firemapper-auth.js +43 -4
- package/build/models/schema/firemapper-auth.js.map +1 -1
- package/build/models/user.js +4 -0
- package/build/models/user.js.map +1 -1
- package/build/test/checklist-item.js +2 -0
- package/build/test/checklist-item.js.map +1 -1
- package/build/test/department.js +88 -63
- package/build/test/department.js.map +1 -1
- package/build/test/mock.js +105 -64
- package/build/test/mock.js.map +1 -1
- package/build/test/user.js +1 -0
- package/build/test/user.js.map +1 -1
- package/cspell.json +1 -0
- package/definitions/constants.d.ts +10 -0
- package/definitions/constants.d.ts.map +1 -1
- package/definitions/index.d.ts +1 -1
- package/definitions/index.d.ts.map +1 -1
- package/definitions/models/checklist-item.d.ts.map +1 -1
- package/definitions/models/department.d.ts +2 -12
- package/definitions/models/department.d.ts.map +1 -1
- package/definitions/models/esri.d.ts.map +1 -1
- package/definitions/models/managed-incident.d.ts.map +1 -1
- package/definitions/models/schema/firemapper-auth.d.ts +11 -2
- package/definitions/models/schema/firemapper-auth.d.ts.map +1 -1
- package/definitions/models/user.d.ts.map +1 -1
- package/definitions/test/mock.d.ts +5 -0
- package/definitions/test/mock.d.ts.map +1 -1
- package/definitions/types/checklist.d.ts +2 -0
- package/definitions/types/checklist.d.ts.map +1 -1
- package/definitions/types/department.d.ts +4 -4
- package/definitions/types/department.d.ts.map +1 -1
- package/definitions/types/firemapper-auth.d.ts +6 -0
- package/definitions/types/firemapper-auth.d.ts.map +1 -1
- package/definitions/types/managed-incident.d.ts +3 -0
- package/definitions/types/managed-incident.d.ts.map +1 -1
- package/definitions/types/user.d.ts +1 -0
- package/definitions/types/user.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +11 -0
- package/src/index.ts +1 -0
- package/src/models/checklist-item.ts +9 -1
- package/src/models/department.ts +15 -1
- package/src/models/esri.ts +4 -2
- package/src/models/managed-incident.ts +12 -0
- package/src/models/schema/firemapper-auth.ts +50 -5
- package/src/models/user.ts +5 -0
- package/src/test/checklist-item.ts +2 -0
- package/src/test/department.ts +77 -52
- package/src/test/mock.ts +105 -64
- package/src/test/user.ts +1 -0
- package/src/types/checklist.ts +2 -0
- package/src/types/department.ts +4 -4
- package/src/types/firemapper-auth.ts +10 -0
- package/src/types/managed-incident.ts +3 -0
- package/src/types/user.ts +1 -0
|
@@ -59,7 +59,15 @@ export function ChecklistItemSchema(mongoose: MongooseModule) {
|
|
|
59
59
|
description: {
|
|
60
60
|
type: String,
|
|
61
61
|
default: ""
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
|
+
neris_benchmark: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "",
|
|
66
|
+
},
|
|
67
|
+
send_to_cad: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
63
71
|
}, {
|
|
64
72
|
autoIndex: false,
|
|
65
73
|
});
|
package/src/models/department.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import ColorModule from "./schema/color";
|
|
16
16
|
import { ReportNumberSchema } from "./schema/common-incident";
|
|
17
17
|
import { GeoPolygonSchema } from "./schema/geojson";
|
|
18
|
+
import { FireMapperAuthV2Schema } from "./schema/firemapper-auth";
|
|
18
19
|
import PubNubTokenSchema from "./schema/pubnub-token";
|
|
19
20
|
import { WebhookSchema } from "./schema/webhook";
|
|
20
21
|
import { WSFeedSchema } from "./schema/ws-feed";
|
|
@@ -143,7 +144,7 @@ export const IntterraFieldsDefault = [
|
|
|
143
144
|
|
|
144
145
|
// If any of the following fields are updated/added/deleted,
|
|
145
146
|
// make sure to update the database records, before/after release (script/query)
|
|
146
|
-
export const FireMapperConfigurationDefault = {
|
|
147
|
+
export const FireMapperConfigurationDefault: FireMapperConfigurationType = {
|
|
147
148
|
enabled: false,
|
|
148
149
|
layerRefreshInterval: 15,
|
|
149
150
|
proLicenseCount: 0,
|
|
@@ -175,6 +176,12 @@ export const FireMapperConfigurationDefault = {
|
|
|
175
176
|
},
|
|
176
177
|
],
|
|
177
178
|
staticLayer: [],
|
|
179
|
+
auth: {
|
|
180
|
+
username: "",
|
|
181
|
+
apiKeyManagement: undefined,
|
|
182
|
+
apiKeyReadOnly: undefined,
|
|
183
|
+
licenseCode: undefined
|
|
184
|
+
}
|
|
178
185
|
};
|
|
179
186
|
|
|
180
187
|
export const LicensingDefault = {
|
|
@@ -544,6 +551,7 @@ export default async function DepartmentModule(mongoose: MongooseModule) {
|
|
|
544
551
|
const { Schema } = mongoose;
|
|
545
552
|
|
|
546
553
|
const Color = ColorModule(mongoose);
|
|
554
|
+
const FireMapperAuth = FireMapperAuthV2Schema(mongoose);
|
|
547
555
|
const GeoPolygon = GeoPolygonSchema(mongoose);
|
|
548
556
|
const PubNubToken = PubNubTokenSchema(mongoose);
|
|
549
557
|
const ReportNumber = ReportNumberSchema(mongoose);
|
|
@@ -1412,6 +1420,12 @@ export default async function DepartmentModule(mongoose: MongooseModule) {
|
|
|
1412
1420
|
type: [FireMapperOutline],
|
|
1413
1421
|
default: [],
|
|
1414
1422
|
},
|
|
1423
|
+
|
|
1424
|
+
// Auth
|
|
1425
|
+
auth: {
|
|
1426
|
+
type: FireMapperAuth,
|
|
1427
|
+
default: {},
|
|
1428
|
+
},
|
|
1415
1429
|
}, {
|
|
1416
1430
|
_id: false,
|
|
1417
1431
|
id: false,
|
package/src/models/esri.ts
CHANGED
|
@@ -6,7 +6,9 @@ import {
|
|
|
6
6
|
import EsriAuthModule from "./schema/esri-auth";
|
|
7
7
|
import EsriErrorModule from "./schema/esri-error";
|
|
8
8
|
import EsriMapModule from "./schema/esri-map";
|
|
9
|
-
import
|
|
9
|
+
import {
|
|
10
|
+
FireMapperAuthSchema,
|
|
11
|
+
} from "./schema/firemapper-auth";
|
|
10
12
|
import { EsriType, MapPropertiesType } from "../types/esri";
|
|
11
13
|
|
|
12
14
|
export interface Esri extends EsriType { }
|
|
@@ -16,7 +18,7 @@ export function EsriSchema(mongoose: MongooseModule) {
|
|
|
16
18
|
const EsriAuth = EsriAuthModule(mongoose);
|
|
17
19
|
const EsriError = EsriErrorModule(mongoose);
|
|
18
20
|
const EsriMap = EsriMapModule(mongoose);
|
|
19
|
-
const FireMapperAuth =
|
|
21
|
+
const FireMapperAuth = FireMapperAuthSchema(mongoose);
|
|
20
22
|
|
|
21
23
|
const MapProperties = new Schema<MapPropertiesType>({
|
|
22
24
|
// ArcGIS Item id
|
|
@@ -342,6 +342,18 @@ export default async function ManagedIncidentModule(mongoose: MongooseModule) {
|
|
|
342
342
|
id: {
|
|
343
343
|
type: String,
|
|
344
344
|
},
|
|
345
|
+
neris_benchmark: {
|
|
346
|
+
type: String,
|
|
347
|
+
default: "",
|
|
348
|
+
},
|
|
349
|
+
send_to_cad: {
|
|
350
|
+
type: Boolean,
|
|
351
|
+
default: false,
|
|
352
|
+
},
|
|
353
|
+
checked_at: {
|
|
354
|
+
type: String,
|
|
355
|
+
default: "",
|
|
356
|
+
},
|
|
345
357
|
}, {
|
|
346
358
|
_id: false,
|
|
347
359
|
id: false,
|
|
@@ -2,12 +2,15 @@ import {
|
|
|
2
2
|
MongooseModule,
|
|
3
3
|
} from "../../helpers";
|
|
4
4
|
import { EncryptedDataType } from "../../types/common";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
FireMapperAuthType,
|
|
7
|
+
FireMapperAuthV2Type,
|
|
8
|
+
} from "../../types/firemapper-auth";
|
|
6
9
|
|
|
7
|
-
export
|
|
10
|
+
export function FireMapperAuthSchema(mongoose: MongooseModule) {
|
|
8
11
|
const { Schema } = mongoose;
|
|
9
12
|
|
|
10
|
-
const
|
|
13
|
+
const EncryptedData = new Schema<EncryptedDataType>({
|
|
11
14
|
iv: {
|
|
12
15
|
type: String,
|
|
13
16
|
default: "",
|
|
@@ -27,11 +30,53 @@ export default function FireMapperAuthSchema(mongoose: MongooseModule) {
|
|
|
27
30
|
default: "",
|
|
28
31
|
},
|
|
29
32
|
encrypted: {
|
|
30
|
-
type:
|
|
33
|
+
type: EncryptedData,
|
|
31
34
|
default: null,
|
|
32
35
|
},
|
|
33
36
|
encryptedAccessCode: {
|
|
34
|
-
type:
|
|
37
|
+
type: EncryptedData,
|
|
38
|
+
default: null,
|
|
39
|
+
},
|
|
40
|
+
}, {
|
|
41
|
+
_id: false,
|
|
42
|
+
id: false,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return FireMapperAuth;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function FireMapperAuthV2Schema(mongoose: MongooseModule) {
|
|
49
|
+
const { Schema } = mongoose;
|
|
50
|
+
|
|
51
|
+
const EncryptedData = new Schema<EncryptedDataType>({
|
|
52
|
+
iv: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "",
|
|
55
|
+
},
|
|
56
|
+
encryptedData: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "",
|
|
59
|
+
},
|
|
60
|
+
}, {
|
|
61
|
+
_id: false,
|
|
62
|
+
id: false,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const FireMapperAuth = new Schema<FireMapperAuthV2Type>({
|
|
66
|
+
username: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "",
|
|
69
|
+
},
|
|
70
|
+
apiKeyReadOnly: {
|
|
71
|
+
type: EncryptedData,
|
|
72
|
+
default: null,
|
|
73
|
+
},
|
|
74
|
+
apiKeyManagement: {
|
|
75
|
+
type: EncryptedData,
|
|
76
|
+
default: null,
|
|
77
|
+
},
|
|
78
|
+
licenseCode: {
|
|
79
|
+
type: EncryptedData,
|
|
35
80
|
default: null,
|
|
36
81
|
},
|
|
37
82
|
}, {
|
package/src/models/user.ts
CHANGED
|
@@ -36,6 +36,8 @@ describe("ChecklistItem", function() {
|
|
|
36
36
|
assert.equal(testItem.api_checklist_id, sut.api_checklist_id);
|
|
37
37
|
assert.equal(testItem.checklist_uuid, sut.checklist_uuid);
|
|
38
38
|
assert.equal(testItem.description, sut.description);
|
|
39
|
+
assert.equal(sut.neris_benchmark, "");
|
|
40
|
+
assert.equal(sut.send_to_cad, false);
|
|
39
41
|
const expectedDate = new Date().valueOf() / 1000.0;
|
|
40
42
|
const timeDelta = expectedDate - sut.modified_unix_date;
|
|
41
43
|
assert.isTrue(timeDelta < 1);
|
package/src/test/department.ts
CHANGED
|
@@ -39,56 +39,22 @@ describe("Department", function() {
|
|
|
39
39
|
await models.Department.findOne({ _id: testItem._id }).lean();
|
|
40
40
|
assert.isNotNull(sut._id);
|
|
41
41
|
assert.isNotNull(sut.id);
|
|
42
|
-
assert.equal(sut.department, testItem.department);
|
|
43
42
|
assert.equal(sut.addressDetails.city, testItem.addressDetails?.city);
|
|
44
43
|
assert.isTrue(sut.active);
|
|
45
|
-
assert.equal(sut.
|
|
46
|
-
assert.equal(sut.partialApiKey, testItem.partialApiKey);
|
|
47
|
-
assert.isTrue(sut.personnelStaffingEnabled);
|
|
48
|
-
assert.isTrue(sut.rtsEnabled);
|
|
49
|
-
assert.equal(sut.rtsChannelPrefix, testItem.rtsChannelPrefix);
|
|
50
|
-
assert.equal(sut.pubNubV3.token, testItem.pubNubV3?.token);
|
|
51
|
-
assert.equal(sut.pubNubV3.expireAt.toISOString(), testItem.pubNubV3?.expireAt.toISOString());
|
|
52
|
-
assert.equal(sut.pubNubV3.runAt.toISOString(), testItem.pubNubV3?.runAt.toISOString());
|
|
53
|
-
assert.equal(sut.pubNubV3.env, testItem.pubNubV3?.env);
|
|
54
|
-
assert.equal(sut.signupKey, testItem.signupKey);
|
|
55
|
-
assert.equal(sut.incidentTypes.length, 1);
|
|
44
|
+
assert.equal(sut.accountType, testItem.accountType);
|
|
56
45
|
assert.equal(sut.agencyIds.length, 1);
|
|
57
46
|
if (testItem.agencyIds?.length) {
|
|
58
47
|
assert.equal(sut.agencyIds[0], testItem.agencyIds[0]);
|
|
59
48
|
} else {
|
|
60
49
|
assert.equal(testItem.agencyIds?.length, 1);
|
|
61
50
|
}
|
|
62
|
-
assert.equal(sut.
|
|
63
|
-
if (testItem.incidentTypes?.length) {
|
|
64
|
-
assert.equal(sut.incidentTypes[0]?.name, testItem.incidentTypes[0]?.name);
|
|
65
|
-
} else {
|
|
66
|
-
assert.equal(testItem.incidentTypes?.length, 1);
|
|
67
|
-
}
|
|
68
|
-
assert.isFalse(sut.shareLocationPhones);
|
|
69
|
-
assert.isTrue(sut.shareLocationTablets);
|
|
51
|
+
assert.equal(sut.apikey, testItem.apikey);
|
|
70
52
|
assert.isFalse(sut.cadOneWayVehiclesEnabled);
|
|
71
53
|
assert.isFalse(sut.cadGetLocationEnabled);
|
|
72
|
-
assert.
|
|
73
|
-
|
|
74
|
-
assert.
|
|
75
|
-
assert.equal(
|
|
76
|
-
assert.equal(sut.accountType, testItem.accountType);
|
|
77
|
-
assert.equal(sut.timeZone, testItem.timeZone);
|
|
78
|
-
assert.equal(sut.firstArrivingEnabled, testItem.firstArrivingEnabled);
|
|
79
|
-
assert.equal(sut.simpleSense.token, testItem.simpleSense?.token);
|
|
80
|
-
assert.equal(sut.firstArriving.token, testItem.firstArriving?.token);
|
|
81
|
-
assert.equal(sut.simpleSenseEnabled, testItem.simpleSenseEnabled);
|
|
82
|
-
assert.equal(sut.webDisclaimer.message, testItem.webDisclaimer?.message);
|
|
83
|
-
assert.equal(sut.webDisclaimer.enabled, testItem.webDisclaimer?.enabled);
|
|
84
|
-
assert.equal(JSON.stringify(sut.licensing), JSON.stringify(testItem.licensing));
|
|
85
|
-
assert.equal(sut.externalNotificationsEnabled, testItem.externalNotificationsEnabled);
|
|
86
|
-
assert.equal(sut.notificationEmails.length, testItem.notificationEmails?.length);
|
|
87
|
-
assert.equal(sut.restrictedComments.callTypesAllowed.length, testItem.restrictedComments?.callTypesAllowed.length);
|
|
88
|
-
assert.equal(sut.restrictedComments.statusesAllowed.length, testItem.restrictedComments?.statusesAllowed.length);
|
|
89
|
-
assert.equal(sut.restrictedComments.restrictedFields.length, testItem.restrictedComments?.restrictedFields.length);
|
|
90
|
-
assert.equal(sut.restrictedComments.restrictedMessage, testItem.restrictedComments?.restrictedMessage);
|
|
91
|
-
assert.equal(sut.restrictedComments.enabled, testItem.restrictedComments?.enabled);
|
|
54
|
+
assert.equal(sut.callerLocation.enabled, testItem.callerLocation?.enabled);
|
|
55
|
+
const callerResolver = sut.callerLocation.resolvers.find(() => true);
|
|
56
|
+
assert.isObject(callerResolver);
|
|
57
|
+
assert.equal(callerResolver?.type, m.AccountCallerType.Dummy);
|
|
92
58
|
if (testItem.customButtons?.length) {
|
|
93
59
|
assert.equal(sut.customButtons[0]?.name, testItem.customButtons[0]?.name);
|
|
94
60
|
assert.equal(sut.customButtons[0]?.url, testItem.customButtons[0]?.url);
|
|
@@ -100,15 +66,72 @@ describe("Department", function() {
|
|
|
100
66
|
} else {
|
|
101
67
|
assert.equal(testItem.customButtons?.length, 1);
|
|
102
68
|
}
|
|
103
|
-
assert.equal(sut.
|
|
104
|
-
assert.equal(
|
|
105
|
-
assert.
|
|
69
|
+
assert.equal(sut.department, testItem.department);
|
|
70
|
+
assert.equal(sut.externalNotificationsEnabled, testItem.externalNotificationsEnabled);
|
|
71
|
+
assert.isTrue(sut.fireMapper.enabled);
|
|
72
|
+
assert.equal(sut.fireMapper?.auth?.username, testItem.fireMapper?.auth?.username);
|
|
73
|
+
assert.equal(sut.fireMapper?.auth?.apiKeyManagement?.encryptedData, testItem.fireMapper?.auth?.apiKeyManagement?.encryptedData);
|
|
74
|
+
assert.equal(sut.fireMapper?.auth?.apiKeyManagement?.iv, testItem.fireMapper?.auth?.apiKeyManagement?.iv);
|
|
75
|
+
assert.equal(sut.fireMapper?.auth?.apiKeyReadOnly?.encryptedData, testItem.fireMapper?.auth?.apiKeyReadOnly?.encryptedData);
|
|
76
|
+
assert.equal(sut.fireMapper?.auth?.apiKeyReadOnly?.iv, testItem.fireMapper?.auth?.apiKeyReadOnly?.iv);
|
|
77
|
+
assert.equal(sut.fireMapper?.auth?.licenseCode?.encryptedData, testItem.fireMapper?.auth?.licenseCode?.encryptedData);
|
|
78
|
+
assert.equal(sut.fireMapper?.auth?.licenseCode?.iv, testItem.fireMapper?.auth?.licenseCode?.iv);
|
|
79
|
+
assert.equal(sut.fireMapper.layerRefreshInterval, testItem.fireMapper?.layerRefreshInterval);
|
|
80
|
+
assert.equal(sut.fireMapper?.layer?.length, 1);
|
|
81
|
+
const fmLayer = sut.fireMapper?.layer?.find(() => true);
|
|
82
|
+
assert.isObject(fmLayer);
|
|
83
|
+
assert.equal(fmLayer?.name, "abc");
|
|
84
|
+
assert.equal(fmLayer?.pathname, "/a/b/c");
|
|
85
|
+
assert.equal(sut.fireMapper.proLicenseCount, testItem.fireMapper?.proLicenseCount);
|
|
86
|
+
assert.equal(sut.fireMapper?.staticLayer?.length, 1);
|
|
87
|
+
const stLayer = sut.fireMapper?.staticLayer?.find(() => true);
|
|
88
|
+
assert.isObject(stLayer);
|
|
89
|
+
assert.equal(stLayer?.uuid, "u1");
|
|
90
|
+
const stLayer1 = stLayer?.layer?.find(() => true);
|
|
91
|
+
assert.isObject(stLayer1);
|
|
92
|
+
assert.equal(stLayer1?.name, "sa");
|
|
93
|
+
assert.equal(stLayer1?.pathname, "s/a/b");
|
|
94
|
+
assert.equal(sut.firstArrivingEnabled, testItem.firstArrivingEnabled);
|
|
95
|
+
assert.equal(sut.firstArriving.token, testItem.firstArriving?.token);
|
|
96
|
+
assert.equal(sut.incidentTypes.length, 1);
|
|
97
|
+
if (testItem.incidentTypes?.length) {
|
|
98
|
+
assert.equal(sut.incidentTypes[0]?.name, testItem.incidentTypes[0]?.name);
|
|
99
|
+
} else {
|
|
100
|
+
assert.equal(testItem.incidentTypes?.length, 1);
|
|
101
|
+
}
|
|
102
|
+
assert.equal(JSON.stringify(sut.licensing), JSON.stringify(testItem.licensing));
|
|
103
|
+
assert.equal(sut.notificationEmails.length, testItem.notificationEmails?.length);
|
|
104
|
+
assert.isTrue(sut.mowsEnabled);
|
|
106
105
|
assert.equal(sut.orientationMarkerColor.text, testItem.orientationMarkerColor?.text);
|
|
107
106
|
assert.equal(sut.orientationMarkerColor.background, testItem.orientationMarkerColor?.background);
|
|
108
|
-
assert.equal(sut.
|
|
109
|
-
|
|
110
|
-
assert.
|
|
111
|
-
assert.equal(
|
|
107
|
+
assert.equal(sut.partialApiKey, testItem.partialApiKey);
|
|
108
|
+
assert.isTrue(sut.personnelStaffingEnabled);
|
|
109
|
+
assert.equal(sut.pubNubV3.token, testItem.pubNubV3?.token);
|
|
110
|
+
assert.equal(sut.pubNubV3.expireAt.toISOString(), testItem.pubNubV3?.expireAt.toISOString());
|
|
111
|
+
assert.equal(sut.pubNubV3.runAt.toISOString(), testItem.pubNubV3?.runAt.toISOString());
|
|
112
|
+
assert.equal(sut.pubNubV3.env, testItem.pubNubV3?.env);
|
|
113
|
+
assert.equal(sut.restrictedComments.callTypesAllowed.length, testItem.restrictedComments?.callTypesAllowed.length);
|
|
114
|
+
assert.equal(sut.restrictedComments.statusesAllowed.length, testItem.restrictedComments?.statusesAllowed.length);
|
|
115
|
+
assert.equal(sut.restrictedComments.restrictedFields.length, testItem.restrictedComments?.restrictedFields.length);
|
|
116
|
+
assert.equal(sut.restrictedComments.restrictedMessage, testItem.restrictedComments?.restrictedMessage);
|
|
117
|
+
assert.equal(sut.restrictedComments.enabled, testItem.restrictedComments?.enabled);
|
|
118
|
+
assert.equal(sut.reportOdometer, "status");
|
|
119
|
+
assert.equal(sut.reportNumberEnabled, testItem.reportNumberEnabled);
|
|
120
|
+
assert.isTrue(sut.rtsEnabled);
|
|
121
|
+
assert.equal(sut.rtsChannelPrefix, testItem.rtsChannelPrefix);
|
|
122
|
+
assert.equal(sut.safetyPriorityKeywords.length, 3);
|
|
123
|
+
assert.equal(JSON.stringify(sut.samsara), JSON.stringify(testItem.samsara));
|
|
124
|
+
assert.equal(sut.signupKey, testItem.signupKey);
|
|
125
|
+
assert.isFalse(sut.shareLocationPhones);
|
|
126
|
+
assert.isTrue(sut.shareLocationTablets);
|
|
127
|
+
assert.isTrue(sut.shareAVL.enabled);
|
|
128
|
+
assert.equal(sut.shareAVL.opAreaCode, testItem.shareAVL?.opAreaCode);
|
|
129
|
+
assert.equal(sut.shareAVL.opAreaName, testItem.shareAVL?.opAreaName);
|
|
130
|
+
assert.equal(sut.simpleSense.token, testItem.simpleSense?.token);
|
|
131
|
+
assert.equal(sut.simpleSenseEnabled, testItem.simpleSenseEnabled);
|
|
132
|
+
assert.equal(sut.timeZone, testItem.timeZone);
|
|
133
|
+
assert.equal(sut.webDisclaimer.message, testItem.webDisclaimer?.message);
|
|
134
|
+
assert.equal(sut.webDisclaimer.enabled, testItem.webDisclaimer?.enabled);
|
|
112
135
|
});
|
|
113
136
|
|
|
114
137
|
it("saves SOAP forwarding connection properties", async function() {
|
|
@@ -141,10 +164,12 @@ describe("Department", function() {
|
|
|
141
164
|
}
|
|
142
165
|
};
|
|
143
166
|
|
|
144
|
-
const testItemWithForwarding
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
167
|
+
const testItemWithForwarding: Partial<m.Department> = {
|
|
168
|
+
...testItem,
|
|
169
|
+
forwarding: {
|
|
170
|
+
enabled: true,
|
|
171
|
+
connections: [soapConnection]
|
|
172
|
+
}
|
|
148
173
|
};
|
|
149
174
|
|
|
150
175
|
const item = new models.Department(testItemWithForwarding);
|
|
@@ -162,7 +187,7 @@ describe("Department", function() {
|
|
|
162
187
|
assert.equal(connection.customHeaders.get("SOAPAction"), "SubmitIncident");
|
|
163
188
|
});
|
|
164
189
|
|
|
165
|
-
it("saves
|
|
190
|
+
it("saves shareIncident.rulesV2", async function() {
|
|
166
191
|
const item = new models.Department(testItem);
|
|
167
192
|
const sut = await item.save();
|
|
168
193
|
assert.deepEqual(sut.shareIncident.rulesV2, []);
|
package/src/test/mock.ts
CHANGED
|
@@ -325,6 +325,8 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
|
325
325
|
description: "Testing Description",
|
|
326
326
|
modified_date: "",
|
|
327
327
|
modified_unix_date: retrieveCurrentUnixTime(),
|
|
328
|
+
neris_benchmark: "",
|
|
329
|
+
send_to_cad: false,
|
|
328
330
|
};
|
|
329
331
|
|
|
330
332
|
const checklist = {
|
|
@@ -700,7 +702,8 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
|
700
702
|
|
|
701
703
|
const department: Partial<Department> = {
|
|
702
704
|
_id: new mongoose.Types.ObjectId(),
|
|
703
|
-
|
|
705
|
+
accountType: "production",
|
|
706
|
+
active: true,
|
|
704
707
|
addressDetails: {
|
|
705
708
|
city: "San Francisco",
|
|
706
709
|
address: "",
|
|
@@ -708,50 +711,86 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
|
708
711
|
zipCode: "",
|
|
709
712
|
country: "",
|
|
710
713
|
},
|
|
711
|
-
active: true,
|
|
712
|
-
apikey: "abcd",
|
|
713
|
-
partialApiKey: "ab",
|
|
714
|
-
personnelStaffingEnabled: true,
|
|
715
|
-
rtsEnabled: true,
|
|
716
|
-
rtsChannelPrefix: "CH_TEST",
|
|
717
|
-
pubNubV3: {
|
|
718
|
-
token: "CH_AUTH_TOKEN",
|
|
719
|
-
expireAt: new Date("2021-09-10T23:25:02.196Z"),
|
|
720
|
-
runAt: new Date("2021-09-10T08:25:02.196Z"),
|
|
721
|
-
env: "qa",
|
|
722
|
-
},
|
|
723
714
|
agencyIds: [
|
|
724
715
|
new mongoose.Types.ObjectId(agency._id)
|
|
725
716
|
],
|
|
726
|
-
|
|
727
|
-
incidentTypes: [{
|
|
728
|
-
name: "Type",
|
|
729
|
-
value: "type",
|
|
730
|
-
allowPartialMatch: true,
|
|
731
|
-
callTypeDescription: [],
|
|
732
|
-
callType: [],
|
|
733
|
-
}],
|
|
734
|
-
shareLocationPhones: false,
|
|
735
|
-
shareLocationTablets: true,
|
|
717
|
+
apikey: "abcd",
|
|
736
718
|
cadOneWayVehiclesEnabled: false,
|
|
737
|
-
|
|
738
|
-
shareAVL: {
|
|
719
|
+
callerLocation: {
|
|
739
720
|
enabled: true,
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
721
|
+
resolvers: [
|
|
722
|
+
{
|
|
723
|
+
type: AccountCallerType.Dummy,
|
|
724
|
+
opts: {},
|
|
725
|
+
}
|
|
726
|
+
]
|
|
727
|
+
},
|
|
728
|
+
customButtons: [
|
|
729
|
+
{
|
|
730
|
+
name: "Button Custom",
|
|
731
|
+
url: "",
|
|
732
|
+
order: 1,
|
|
733
|
+
allowExternal: false,
|
|
734
|
+
defaultExternal: false,
|
|
735
|
+
allowFloating: false,
|
|
736
|
+
color: {
|
|
737
|
+
background: "#512e5f",
|
|
738
|
+
text: "#F8F9F9"
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
],
|
|
742
|
+
department: "Test Department",
|
|
743
|
+
externalNotificationsEnabled: true,
|
|
744
|
+
fireMapper: {
|
|
745
|
+
enabled: true,
|
|
746
|
+
auth: {
|
|
747
|
+
username: "fm-user",
|
|
748
|
+
apiKeyManagement: {
|
|
749
|
+
iv: "iv-mgm",
|
|
750
|
+
encryptedData: "encrypted-nt",
|
|
751
|
+
},
|
|
752
|
+
apiKeyReadOnly: {
|
|
753
|
+
iv: "iv-read-only",
|
|
754
|
+
encryptedData: "encrypted-read-only",
|
|
755
|
+
},
|
|
756
|
+
licenseCode: {
|
|
757
|
+
iv: "iv-license",
|
|
758
|
+
encryptedData: "encrypted-license",
|
|
759
|
+
},
|
|
760
|
+
},
|
|
761
|
+
host: "",
|
|
762
|
+
layer: [
|
|
763
|
+
{
|
|
764
|
+
pathname: "/a/b/c",
|
|
765
|
+
name: "abc",
|
|
766
|
+
},
|
|
767
|
+
],
|
|
768
|
+
layerRefreshInterval: 10,
|
|
769
|
+
proLicenseCount: 20,
|
|
770
|
+
staticLayer: [
|
|
771
|
+
{
|
|
772
|
+
uuid: "u1",
|
|
773
|
+
layer: [
|
|
774
|
+
{
|
|
775
|
+
name: "sa",
|
|
776
|
+
pathname: "s/a/b",
|
|
777
|
+
}
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
],
|
|
743
781
|
},
|
|
744
|
-
accountType: "production",
|
|
745
|
-
timeZone: "America/Los_Angeles",
|
|
746
782
|
firstArrivingEnabled: true,
|
|
747
783
|
firstArriving: {
|
|
748
784
|
token: "123",
|
|
749
785
|
apiUrl: "",
|
|
750
786
|
},
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
787
|
+
incidentTypes: [{
|
|
788
|
+
name: "Type",
|
|
789
|
+
value: "type",
|
|
790
|
+
allowPartialMatch: true,
|
|
791
|
+
callTypeDescription: [],
|
|
792
|
+
callType: [],
|
|
793
|
+
}],
|
|
755
794
|
licensing: {
|
|
756
795
|
tcPro2Way: 0,
|
|
757
796
|
tcPro1Way: 0,
|
|
@@ -761,16 +800,21 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
|
761
800
|
sendToCAD: 0,
|
|
762
801
|
tcStreams: 0,
|
|
763
802
|
},
|
|
764
|
-
|
|
765
|
-
message: "test",
|
|
766
|
-
enabled: true
|
|
767
|
-
},
|
|
803
|
+
mowsEnabled: true,
|
|
768
804
|
notificationEmails: ["test@test.com"],
|
|
769
|
-
externalNotificationsEnabled: true,
|
|
770
805
|
orientationMarkerColor: {
|
|
771
806
|
text: "a",
|
|
772
807
|
background: "b",
|
|
773
808
|
},
|
|
809
|
+
partialApiKey: "ab",
|
|
810
|
+
personnelStaffingEnabled: true,
|
|
811
|
+
pubNubV3: {
|
|
812
|
+
token: "CH_AUTH_TOKEN",
|
|
813
|
+
expireAt: new Date("2021-09-10T23:25:02.196Z"),
|
|
814
|
+
runAt: new Date("2021-09-10T08:25:02.196Z"),
|
|
815
|
+
env: "qa",
|
|
816
|
+
},
|
|
817
|
+
reportNumberEnabled: true,
|
|
774
818
|
restrictedComments: {
|
|
775
819
|
enabled: false,
|
|
776
820
|
callTypesAllowed: [],
|
|
@@ -778,35 +822,31 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
|
778
822
|
restrictedFields: [],
|
|
779
823
|
restrictedMessage: "Restricted Message"
|
|
780
824
|
},
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
name: "Button Custom",
|
|
784
|
-
url: "",
|
|
785
|
-
order: 1,
|
|
786
|
-
allowExternal: false,
|
|
787
|
-
defaultExternal: false,
|
|
788
|
-
allowFloating: false,
|
|
789
|
-
color: {
|
|
790
|
-
background: "#512e5f",
|
|
791
|
-
text: "#F8F9F9"
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
],
|
|
795
|
-
reportNumberEnabled: true,
|
|
825
|
+
rtsEnabled: true,
|
|
826
|
+
rtsChannelPrefix: "CH_TEST",
|
|
796
827
|
samsara: {
|
|
797
828
|
enabled: false,
|
|
798
829
|
token: "",
|
|
799
830
|
},
|
|
800
|
-
|
|
801
|
-
callerLocation: {
|
|
831
|
+
shareAVL: {
|
|
802
832
|
enabled: true,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
833
|
+
opAreaCode: "DAL",
|
|
834
|
+
opAreaName: "Delta Operations",
|
|
835
|
+
fadeZoomLevel: 1,
|
|
836
|
+
},
|
|
837
|
+
shareLocationPhones: false,
|
|
838
|
+
shareLocationTablets: true,
|
|
839
|
+
signupKey: "A1B2",
|
|
840
|
+
simpleSenseEnabled: true,
|
|
841
|
+
simpleSense: {
|
|
842
|
+
token: "123"
|
|
843
|
+
},
|
|
844
|
+
reportOdometer: "status",
|
|
845
|
+
timeZone: "America/Los_Angeles",
|
|
846
|
+
webDisclaimer: {
|
|
847
|
+
message: "test",
|
|
848
|
+
enabled: true
|
|
849
|
+
},
|
|
810
850
|
};
|
|
811
851
|
|
|
812
852
|
const esriMap = {
|
|
@@ -1335,7 +1375,8 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
|
1335
1375
|
defaultCenter: [1, 1],
|
|
1336
1376
|
defaultMap: "Default"
|
|
1337
1377
|
},
|
|
1338
|
-
restrictedCommentsEnabled: true
|
|
1378
|
+
restrictedCommentsEnabled: true,
|
|
1379
|
+
canBlockIncidents: true
|
|
1339
1380
|
};
|
|
1340
1381
|
|
|
1341
1382
|
const userRegistration = {
|
package/src/test/user.ts
CHANGED
package/src/types/checklist.ts
CHANGED
package/src/types/department.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Types } from "mongoose";
|
|
2
2
|
import { ColorSchemaType } from "./color";
|
|
3
|
-
import {
|
|
3
|
+
import { FireMapperAuthV2Type } from "./firemapper-auth";
|
|
4
4
|
import { PubNubTokenSchemaType } from "./pubnub-token";
|
|
5
5
|
import {
|
|
6
6
|
AccountCallerType,
|
|
@@ -310,12 +310,12 @@ export interface USFTConfigurationType {
|
|
|
310
310
|
|
|
311
311
|
export interface FireMapperConfigurationType {
|
|
312
312
|
enabled: boolean,
|
|
313
|
-
|
|
314
|
-
proLicenseCount: number,
|
|
313
|
+
auth: FireMapperAuthV2Type,
|
|
315
314
|
host: string,
|
|
316
315
|
layer: FireMapperLayerType[],
|
|
316
|
+
layerRefreshInterval: number,
|
|
317
|
+
proLicenseCount: number,
|
|
317
318
|
staticLayer: FireMapperOutlineType[],
|
|
318
|
-
auth: FireMapperAuthType,
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
export interface LicensingType {
|
|
@@ -5,3 +5,13 @@ export interface FireMapperAuthType {
|
|
|
5
5
|
encrypted: EncryptedDataType,
|
|
6
6
|
encryptedAccessCode: EncryptedDataType,
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
export interface FireMapperAuthV2Type {
|
|
10
|
+
username: string,
|
|
11
|
+
// used by backend to create FM incidents
|
|
12
|
+
apiKeyManagement: EncryptedDataType | undefined,
|
|
13
|
+
// used by the iOS maps, and backend to check if map is active
|
|
14
|
+
apiKeyReadOnly: EncryptedDataType | undefined,
|
|
15
|
+
// used by the iOS link to
|
|
16
|
+
licenseCode: EncryptedDataType | undefined,
|
|
17
|
+
}
|
package/src/types/user.ts
CHANGED