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.
Files changed (68) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/build/constants.js +12 -1
  3. package/build/constants.js.map +1 -1
  4. package/build/index.js +2 -1
  5. package/build/index.js.map +1 -1
  6. package/build/models/checklist-item.js +9 -1
  7. package/build/models/checklist-item.js.map +1 -1
  8. package/build/models/department.js +13 -0
  9. package/build/models/department.js.map +1 -1
  10. package/build/models/esri.js +1 -1
  11. package/build/models/esri.js.map +1 -1
  12. package/build/models/managed-incident.js +12 -0
  13. package/build/models/managed-incident.js.map +1 -1
  14. package/build/models/schema/firemapper-auth.js +43 -4
  15. package/build/models/schema/firemapper-auth.js.map +1 -1
  16. package/build/models/user.js +4 -0
  17. package/build/models/user.js.map +1 -1
  18. package/build/test/checklist-item.js +2 -0
  19. package/build/test/checklist-item.js.map +1 -1
  20. package/build/test/department.js +88 -63
  21. package/build/test/department.js.map +1 -1
  22. package/build/test/mock.js +105 -64
  23. package/build/test/mock.js.map +1 -1
  24. package/build/test/user.js +1 -0
  25. package/build/test/user.js.map +1 -1
  26. package/cspell.json +1 -0
  27. package/definitions/constants.d.ts +10 -0
  28. package/definitions/constants.d.ts.map +1 -1
  29. package/definitions/index.d.ts +1 -1
  30. package/definitions/index.d.ts.map +1 -1
  31. package/definitions/models/checklist-item.d.ts.map +1 -1
  32. package/definitions/models/department.d.ts +2 -12
  33. package/definitions/models/department.d.ts.map +1 -1
  34. package/definitions/models/esri.d.ts.map +1 -1
  35. package/definitions/models/managed-incident.d.ts.map +1 -1
  36. package/definitions/models/schema/firemapper-auth.d.ts +11 -2
  37. package/definitions/models/schema/firemapper-auth.d.ts.map +1 -1
  38. package/definitions/models/user.d.ts.map +1 -1
  39. package/definitions/test/mock.d.ts +5 -0
  40. package/definitions/test/mock.d.ts.map +1 -1
  41. package/definitions/types/checklist.d.ts +2 -0
  42. package/definitions/types/checklist.d.ts.map +1 -1
  43. package/definitions/types/department.d.ts +4 -4
  44. package/definitions/types/department.d.ts.map +1 -1
  45. package/definitions/types/firemapper-auth.d.ts +6 -0
  46. package/definitions/types/firemapper-auth.d.ts.map +1 -1
  47. package/definitions/types/managed-incident.d.ts +3 -0
  48. package/definitions/types/managed-incident.d.ts.map +1 -1
  49. package/definitions/types/user.d.ts +1 -0
  50. package/definitions/types/user.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/src/constants.ts +11 -0
  53. package/src/index.ts +1 -0
  54. package/src/models/checklist-item.ts +9 -1
  55. package/src/models/department.ts +15 -1
  56. package/src/models/esri.ts +4 -2
  57. package/src/models/managed-incident.ts +12 -0
  58. package/src/models/schema/firemapper-auth.ts +50 -5
  59. package/src/models/user.ts +5 -0
  60. package/src/test/checklist-item.ts +2 -0
  61. package/src/test/department.ts +77 -52
  62. package/src/test/mock.ts +105 -64
  63. package/src/test/user.ts +1 -0
  64. package/src/types/checklist.ts +2 -0
  65. package/src/types/department.ts +4 -4
  66. package/src/types/firemapper-auth.ts +10 -0
  67. package/src/types/managed-incident.ts +3 -0
  68. 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
  });
@@ -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,
@@ -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 FireMapperAuthModule from "./schema/firemapper-auth";
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 = FireMapperAuthModule(mongoose);
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 { FireMapperAuthType } from "../../types/firemapper-auth";
5
+ import {
6
+ FireMapperAuthType,
7
+ FireMapperAuthV2Type,
8
+ } from "../../types/firemapper-auth";
6
9
 
7
- export default function FireMapperAuthSchema(mongoose: MongooseModule) {
10
+ export function FireMapperAuthSchema(mongoose: MongooseModule) {
8
11
  const { Schema } = mongoose;
9
12
 
10
- const FireMapperEncrypted = new Schema<EncryptedDataType>({
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: FireMapperEncrypted,
33
+ type: EncryptedData,
31
34
  default: null,
32
35
  },
33
36
  encryptedAccessCode: {
34
- type: FireMapperEncrypted,
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
  }, {
@@ -120,6 +120,11 @@ export function UserSchema(mongoose: MongooseModule) {
120
120
  default: false,
121
121
  },
122
122
 
123
+ canBlockIncidents: {
124
+ type: Boolean,
125
+ default: false,
126
+ },
127
+
123
128
  beaconEnabled: {
124
129
  type: Boolean,
125
130
  default: false,
@@ -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);
@@ -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.apikey, testItem.apikey);
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.safetyPriorityKeywords.length, 3);
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.isTrue(sut.mowsEnabled);
73
- assert.isTrue(sut.shareAVL.enabled);
74
- assert.equal(sut.shareAVL.opAreaCode, testItem.shareAVL?.opAreaCode);
75
- assert.equal(sut.shareAVL.opAreaName, testItem.shareAVL?.opAreaName);
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.reportNumberEnabled, testItem.reportNumberEnabled);
104
- assert.equal(JSON.stringify(sut.samsara), JSON.stringify(testItem.samsara));
105
- assert.equal(sut.reportOdometer, "status");
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.callerLocation.enabled, testItem.callerLocation?.enabled);
109
- const callerResolver = sut.callerLocation.resolvers.find(() => true);
110
- assert.isObject(callerResolver);
111
- assert.equal(callerResolver?.type, m.AccountCallerType.Dummy);
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 = testItem as m.Department;
145
- testItemWithForwarding.forwarding = {
146
- enabled: true,
147
- connections: [soapConnection]
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 rules v2", async function() {
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
- department: "Test Department",
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
- signupKey: "A1B2",
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
- mowsEnabled: true,
738
- shareAVL: {
719
+ callerLocation: {
739
720
  enabled: true,
740
- opAreaCode: "DAL",
741
- opAreaName: "Delta Operations",
742
- fadeZoomLevel: 1,
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
- simpleSenseEnabled: true,
752
- simpleSense: {
753
- token: "123"
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
- webDisclaimer: {
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
- customButtons: [
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
- reportOdometer: "status",
801
- callerLocation: {
831
+ shareAVL: {
802
832
  enabled: true,
803
- resolvers: [
804
- {
805
- type: AccountCallerType.Dummy,
806
- opts: {},
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
@@ -47,5 +47,6 @@ describe("User", function() {
47
47
  assert.equal(item.webMapSettings.defaultCenter[1], 1);
48
48
  assert.equal(item.webMapSettings.defaultMap, "Default");
49
49
  assert.equal(item.restrictedCommentsEnabled, true);
50
+ assert.isTrue(sut.canBlockIncidents);
50
51
  });
51
52
  });
@@ -32,4 +32,6 @@ export interface ChecklistItemType {
32
32
  active: boolean,
33
33
  name: string,
34
34
  description: string,
35
+ neris_benchmark: string,
36
+ send_to_cad: boolean,
35
37
  }
@@ -1,6 +1,6 @@
1
1
  import { Types } from "mongoose";
2
2
  import { ColorSchemaType } from "./color";
3
- import { FireMapperAuthType } from "./firemapper-auth";
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
- layerRefreshInterval: number,
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
+ }
@@ -93,6 +93,9 @@ export interface IncidentChecklistItemType {
93
93
  checklist_uuid: string,
94
94
  description: string,
95
95
  id: string,
96
+ neris_benchmark: string,
97
+ send_to_cad: boolean,
98
+ checked_at: string,
96
99
  }
97
100
 
98
101
  export interface IncidentChecklistType {
package/src/types/user.ts CHANGED
@@ -100,6 +100,7 @@ export interface UserType {
100
100
  beacons: string[],
101
101
  cadSimulatorAccess: boolean,
102
102
  canAddRemoveVehicle: boolean,
103
+ canBlockIncidents: boolean,
103
104
  canCreateShareIncidentCode: boolean,
104
105
  departmentId: string,
105
106
  email: string,