tabletcommand-backend-models 7.2.21 → 7.2.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/build/models/schema/common-incident.js +9 -9
- package/build/test/cad-incident.js +9 -9
- package/build/test/mock.js +9 -9
- package/definitions/test/mock.d.ts +9 -9
- package/definitions/types/common-incident.d.ts +9 -9
- package/definitions/types/common-incident.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/models/schema/common-incident.ts +9 -9
- package/src/test/cad-incident.ts +9 -9
- package/src/test/mock.ts +9 -9
- package/src/types/common-incident.ts +12 -10
@@ -36,33 +36,33 @@ function CallerSchema(mongoose) {
|
|
36
36
|
const { Schema } = mongoose;
|
37
37
|
const Item = new Schema({
|
38
38
|
// Should match
|
39
|
-
|
39
|
+
CallerId: {
|
40
40
|
type: String,
|
41
41
|
default: "",
|
42
42
|
},
|
43
|
-
|
43
|
+
Latitude: {
|
44
44
|
type: Number,
|
45
45
|
},
|
46
|
-
|
46
|
+
Longitude: {
|
47
47
|
type: Number,
|
48
48
|
},
|
49
|
-
|
49
|
+
LocationUpdatedAt: {
|
50
50
|
type: Date,
|
51
51
|
},
|
52
52
|
// Somewhat optional
|
53
|
-
|
53
|
+
Altitude: {
|
54
54
|
type: Number,
|
55
55
|
},
|
56
|
-
|
56
|
+
Application: {
|
57
57
|
type: String,
|
58
58
|
},
|
59
|
-
|
59
|
+
Source: {
|
60
60
|
type: String,
|
61
61
|
},
|
62
|
-
|
62
|
+
Address: {
|
63
63
|
type: String,
|
64
64
|
},
|
65
|
-
|
65
|
+
UncertaintyRadius: {
|
66
66
|
type: Number,
|
67
67
|
},
|
68
68
|
}, {
|
@@ -146,15 +146,15 @@ describe("CADIncident", function () {
|
|
146
146
|
chai_1.assert.equal(sut.callers.length, 1);
|
147
147
|
const caller1 = sut.callers.find(() => { return true; });
|
148
148
|
chai_1.assert.isObject(caller1);
|
149
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
150
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
151
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
152
|
-
chai_1.assert.equal((_x = caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
153
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
154
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
155
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
156
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
157
|
-
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.
|
149
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.CallerId, "(123) 456-789");
|
150
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.Latitude, 1.23);
|
151
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.Longitude, -4.56);
|
152
|
+
chai_1.assert.equal((_x = caller1 === null || caller1 === void 0 ? void 0 : caller1.LocationUpdatedAt) === null || _x === void 0 ? void 0 : _x.toISOString(), "2023-09-20T09:14:37.000Z");
|
153
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.Altitude, 123);
|
154
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.Application, "ABC");
|
155
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.Source, "DEF");
|
156
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.Address, "Main St");
|
157
|
+
chai_1.assert.equal(caller1 === null || caller1 === void 0 ? void 0 : caller1.UncertaintyRadius, 400);
|
158
158
|
});
|
159
159
|
it("no virtuals id if _id not present", async function () {
|
160
160
|
var _a, _b;
|
package/build/test/mock.js
CHANGED
@@ -492,15 +492,15 @@ function mockModule(dependencies) {
|
|
492
492
|
],
|
493
493
|
callers: [
|
494
494
|
{
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
495
|
+
CallerId: "(123) 456-789",
|
496
|
+
Latitude: 1.23,
|
497
|
+
Longitude: -4.56,
|
498
|
+
Altitude: 123,
|
499
|
+
Application: "ABC",
|
500
|
+
Source: "DEF",
|
501
|
+
LocationUpdatedAt: new Date("2023-09-20T09:14:37Z"),
|
502
|
+
Address: "Main St",
|
503
|
+
UncertaintyRadius: 400,
|
504
504
|
}
|
505
505
|
],
|
506
506
|
};
|
@@ -269,15 +269,15 @@ export default function mockModule(dependencies: {
|
|
269
269
|
startAt: Date;
|
270
270
|
}[];
|
271
271
|
callers: {
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
272
|
+
CallerId: string;
|
273
|
+
Latitude: number;
|
274
|
+
Longitude: number;
|
275
|
+
Altitude: number;
|
276
|
+
Application: string;
|
277
|
+
Source: string;
|
278
|
+
LocationUpdatedAt: Date;
|
279
|
+
Address: string;
|
280
|
+
UncertaintyRadius: number;
|
281
281
|
}[];
|
282
282
|
};
|
283
283
|
cadIncidentBlock: {
|
@@ -6,15 +6,15 @@ export interface CADPersonSchemaType {
|
|
6
6
|
PersonnelNote: string;
|
7
7
|
}
|
8
8
|
export interface CallerType {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
CallerId: string;
|
10
|
+
Latitude: number;
|
11
|
+
Longitude: number;
|
12
|
+
Altitude: number;
|
13
|
+
Application: string;
|
14
|
+
Source: string;
|
15
|
+
LocationUpdatedAt: Date;
|
16
|
+
Address: string;
|
17
|
+
UncertaintyRadius: number;
|
18
18
|
}
|
19
19
|
export interface RadioChannelSchemaType extends Record<string, unknown> {
|
20
20
|
name: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common-incident.d.ts","sourceRoot":"","sources":["../../src/types/common-incident.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;
|
1
|
+
{"version":3,"file":"common-incident.d.ts","sourceRoot":"","sources":["../../src/types/common-incident.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,kBAAmB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,sBAAuB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,qBAAqB,EAAE,CAAA;CACjC"}
|
package/package.json
CHANGED
@@ -51,34 +51,34 @@ export function CallerSchema(mongoose: MongooseModule) {
|
|
51
51
|
|
52
52
|
const Item = new Schema<CallerType>({
|
53
53
|
// Should match
|
54
|
-
|
54
|
+
CallerId: {
|
55
55
|
type: String,
|
56
56
|
default: "",
|
57
57
|
},
|
58
|
-
|
58
|
+
Latitude: {
|
59
59
|
type: Number,
|
60
60
|
},
|
61
|
-
|
61
|
+
Longitude: {
|
62
62
|
type: Number,
|
63
63
|
},
|
64
|
-
|
64
|
+
LocationUpdatedAt: {
|
65
65
|
type: Date,
|
66
66
|
},
|
67
67
|
|
68
68
|
// Somewhat optional
|
69
|
-
|
69
|
+
Altitude: {
|
70
70
|
type: Number,
|
71
71
|
},
|
72
|
-
|
72
|
+
Application: {
|
73
73
|
type: String,
|
74
74
|
},
|
75
|
-
|
75
|
+
Source: {
|
76
76
|
type: String,
|
77
77
|
},
|
78
|
-
|
78
|
+
Address: {
|
79
79
|
type: String,
|
80
80
|
},
|
81
|
-
|
81
|
+
UncertaintyRadius: {
|
82
82
|
type: Number,
|
83
83
|
},
|
84
84
|
}, {
|
package/src/test/cad-incident.ts
CHANGED
@@ -155,15 +155,15 @@ describe("CADIncident", function() {
|
|
155
155
|
assert.equal(sut.callers.length, 1);
|
156
156
|
const caller1 = sut.callers.find(() => { return true; });
|
157
157
|
assert.isObject(caller1);
|
158
|
-
assert.equal(caller1?.
|
159
|
-
assert.equal(caller1?.
|
160
|
-
assert.equal(caller1?.
|
161
|
-
assert.equal(caller1?.
|
162
|
-
assert.equal(caller1?.
|
163
|
-
assert.equal(caller1?.
|
164
|
-
assert.equal(caller1?.
|
165
|
-
assert.equal(caller1?.
|
166
|
-
assert.equal(caller1?.
|
158
|
+
assert.equal(caller1?.CallerId, "(123) 456-789");
|
159
|
+
assert.equal(caller1?.Latitude, 1.23);
|
160
|
+
assert.equal(caller1?.Longitude, -4.56);
|
161
|
+
assert.equal(caller1?.LocationUpdatedAt?.toISOString(), "2023-09-20T09:14:37.000Z");
|
162
|
+
assert.equal(caller1?.Altitude, 123);
|
163
|
+
assert.equal(caller1?.Application, "ABC");
|
164
|
+
assert.equal(caller1?.Source, "DEF");
|
165
|
+
assert.equal(caller1?.Address, "Main St");
|
166
|
+
assert.equal(caller1?.UncertaintyRadius, 400);
|
167
167
|
});
|
168
168
|
|
169
169
|
it("no virtuals id if _id not present", async function() {
|
package/src/test/mock.ts
CHANGED
@@ -527,15 +527,15 @@ export default function mockModule(dependencies: { mongoose: Mongoose; }) {
|
|
527
527
|
],
|
528
528
|
callers: [
|
529
529
|
{
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
530
|
+
CallerId: "(123) 456-789",
|
531
|
+
Latitude: 1.23,
|
532
|
+
Longitude: -4.56,
|
533
|
+
Altitude: 123,
|
534
|
+
Application: "ABC",
|
535
|
+
Source: "DEF",
|
536
|
+
LocationUpdatedAt: new Date("2023-09-20T09:14:37Z"),
|
537
|
+
Address: "Main St",
|
538
|
+
UncertaintyRadius: 400,
|
539
539
|
}
|
540
540
|
],
|
541
541
|
};
|
@@ -6,17 +6,19 @@ export interface CADPersonSchemaType {
|
|
6
6
|
PersonnelNote: string,
|
7
7
|
}
|
8
8
|
|
9
|
+
// Data possibly sent by CAD,
|
10
|
+
// using same Capitalization
|
9
11
|
export interface CallerType {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
CallerId: string,
|
13
|
+
Latitude: number,
|
14
|
+
Longitude: number,
|
15
|
+
Altitude: number, // meters
|
16
|
+
|
17
|
+
Application: string,
|
18
|
+
Source: string,
|
19
|
+
LocationUpdatedAt: Date, // UTC
|
20
|
+
Address: string,
|
21
|
+
UncertaintyRadius: number, // meters
|
20
22
|
}
|
21
23
|
|
22
24
|
export interface RadioChannelSchemaType extends Record<string, unknown> {
|