tabletcommand-backend-models 7.3.32 → 7.3.34

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 (63) hide show
  1. package/build/constants.js +1 -0
  2. package/build/constants.js.map +1 -1
  3. package/build/models/department.js +27 -1
  4. package/build/models/department.js.map +1 -1
  5. package/build/models/incident-filter.js +3 -15
  6. package/build/models/incident-filter.js.map +1 -1
  7. package/build/models/location.js +2 -2
  8. package/build/models/location.js.map +1 -1
  9. package/build/models/schema/cad-incident.js +6 -0
  10. package/build/models/schema/cad-incident.js.map +1 -1
  11. package/build/models/schema/geojson.js +44 -0
  12. package/build/models/schema/geojson.js.map +1 -0
  13. package/build/test/mock.js.map +1 -1
  14. package/build/types/{geojson-point.js → geojson.js} +1 -1
  15. package/build/types/geojson.js.map +1 -0
  16. package/cspell.json +1 -0
  17. package/definitions/constants.d.ts +1 -0
  18. package/definitions/constants.d.ts.map +1 -1
  19. package/definitions/models/department.d.ts +5 -0
  20. package/definitions/models/department.d.ts.map +1 -1
  21. package/definitions/models/incident-filter.d.ts.map +1 -1
  22. package/definitions/models/schema/cad-incident.d.ts.map +1 -1
  23. package/definitions/models/schema/geojson.d.ts +13 -0
  24. package/definitions/models/schema/geojson.d.ts.map +1 -0
  25. package/definitions/test/mock.d.ts +2 -26
  26. package/definitions/test/mock.d.ts.map +1 -1
  27. package/definitions/types/cad-incident.d.ts +2 -0
  28. package/definitions/types/cad-incident.d.ts.map +1 -1
  29. package/definitions/types/common.d.ts +0 -4
  30. package/definitions/types/common.d.ts.map +1 -1
  31. package/definitions/types/department.d.ts +6 -0
  32. package/definitions/types/department.d.ts.map +1 -1
  33. package/definitions/types/geojson.d.ts +9 -0
  34. package/definitions/types/geojson.d.ts.map +1 -0
  35. package/definitions/types/incident-filter.d.ts +1 -1
  36. package/definitions/types/incident-filter.d.ts.map +1 -1
  37. package/definitions/types/location.d.ts +2 -2
  38. package/definitions/types/location.d.ts.map +1 -1
  39. package/gulpfile.js +1 -1
  40. package/package.json +10 -11
  41. package/src/constants.ts +1 -0
  42. package/src/models/department.ts +29 -0
  43. package/src/models/incident-filter.ts +3 -17
  44. package/src/models/location.ts +2 -2
  45. package/src/models/schema/cad-incident.ts +8 -0
  46. package/src/models/schema/geojson.ts +51 -0
  47. package/src/test/mock.ts +2 -1
  48. package/src/types/cad-incident.ts +2 -0
  49. package/src/types/common.ts +0 -5
  50. package/src/types/department.ts +7 -0
  51. package/src/types/geojson.ts +10 -0
  52. package/src/types/incident-filter.ts +1 -1
  53. package/src/types/location.ts +2 -2
  54. package/test.sh +1 -1
  55. package/build/models/schema/geojson-point.js +0 -24
  56. package/build/models/schema/geojson-point.js.map +0 -1
  57. package/build/types/geojson-point.js.map +0 -1
  58. package/definitions/models/schema/geojson-point.d.ts +0 -8
  59. package/definitions/models/schema/geojson-point.d.ts.map +0 -1
  60. package/definitions/types/geojson-point.d.ts +0 -5
  61. package/definitions/types/geojson-point.d.ts.map +0 -1
  62. package/src/models/schema/geojson-point.ts +0 -27
  63. package/src/types/geojson-point.ts +0 -4
@@ -0,0 +1,10 @@
1
+
2
+ export type GeoPoint = {
3
+ type: "Point",
4
+ coordinates: number[]
5
+ };
6
+
7
+ export type GeoPolygon = {
8
+ type: "Polygon",
9
+ coordinates: number[][][],
10
+ };
@@ -2,7 +2,7 @@ import { Types } from "mongoose";
2
2
  import {
3
3
  IncidentFilterKind,
4
4
  } from "../constants";
5
- import { GeoPolygon } from "./common";
5
+ import { GeoPolygon } from "./geojson";
6
6
 
7
7
  export type IncidentFilterOption = {
8
8
  name: string,
@@ -1,6 +1,6 @@
1
1
  import { Types } from "mongoose";
2
- import { GeoJSONPointType } from "./geojson-point";
3
2
  import { ColorSchemaType } from "./color";
3
+ import { GeoPoint } from "./geojson";
4
4
 
5
5
  export interface LocationType {
6
6
  _id: Types.ObjectId,
@@ -18,7 +18,7 @@ export interface LocationType {
18
18
  heading: number,
19
19
  kindType: string,
20
20
  location?: { latitude: number, longitude: number, }; // provided by virtual.location
21
- locationGeoJSON: GeoJSONPointType,
21
+ locationGeoJSON: GeoPoint,
22
22
  modified: Date,
23
23
  movedAt: Date,
24
24
  opAreaCode: string
package/test.sh CHANGED
@@ -23,7 +23,7 @@ nvm use $NODE_VERSION || nvm install $NODE_VERSION
23
23
 
24
24
  npm install
25
25
  echo "--- spelling"
26
- npx cspell
26
+ npx cspell --no-progress
27
27
  echo "--- type coverage"
28
28
  npx type-coverage --detail
29
29
  echo "--- lint"
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = GeoJSONPointSchema;
4
- function GeoJSONPointSchema(mongoose) {
5
- const { Schema } = mongoose;
6
- const GeoJSONPoint = new Schema({
7
- type: {
8
- type: String,
9
- required: true,
10
- enum: ["Point"],
11
- default: "Point",
12
- },
13
- coordinates: {
14
- type: [Number],
15
- required: true,
16
- default: [],
17
- },
18
- }, {
19
- _id: false,
20
- id: false,
21
- });
22
- return GeoJSONPoint;
23
- }
24
- //# sourceMappingURL=geojson-point.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geojson-point.js","sourceRoot":"","sources":["../../../src/models/schema/geojson-point.ts"],"names":[],"mappings":";;AAKA,qCAqBC;AArBD,SAAwB,kBAAkB,CAAC,QAAwB;IACjE,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5B,MAAM,YAAY,GAAG,IAAI,MAAM,CAAmB;QAChD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,CAAC,OAAO,CAAC;YACf,OAAO,EAAE,OAAO;SACjB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ;KACF,EAAE;QACD,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,KAAK;KACV,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"geojson-point.js","sourceRoot":"","sources":["../../src/types/geojson-point.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- import { MongooseModule } from "../../helpers";
2
- import { GeoJSONPointType } from "../../types/geojson-point";
3
- export default function GeoJSONPointSchema(mongoose: MongooseModule): import("mongoose").Schema<GeoJSONPointType, import("mongoose").Model<GeoJSONPointType, any, any, any, import("mongoose").Document<unknown, any, GeoJSONPointType> & GeoJSONPointType & {
4
- _id: import("mongoose").Types.ObjectId;
5
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, GeoJSONPointType, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<GeoJSONPointType>> & import("mongoose").FlatRecord<GeoJSONPointType> & {
6
- _id: import("mongoose").Types.ObjectId;
7
- }>;
8
- //# sourceMappingURL=geojson-point.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geojson-point.d.ts","sourceRoot":"","sources":["../../../src/models/schema/geojson-point.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,QAAQ,EAAE,cAAc;;;;GAqBlE"}
@@ -1,5 +0,0 @@
1
- export interface GeoJSONPointType {
2
- type: string;
3
- coordinates: number[];
4
- }
5
- //# sourceMappingURL=geojson-point.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geojson-point.d.ts","sourceRoot":"","sources":["../../src/types/geojson-point.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB"}
@@ -1,27 +0,0 @@
1
- import {
2
- MongooseModule,
3
- } from "../../helpers";
4
- import { GeoJSONPointType } from "../../types/geojson-point";
5
-
6
- export default function GeoJSONPointSchema(mongoose: MongooseModule) {
7
- const { Schema } = mongoose;
8
-
9
- const GeoJSONPoint = new Schema<GeoJSONPointType>({
10
- type: {
11
- type: String,
12
- required: true,
13
- enum: ["Point"],
14
- default: "Point",
15
- },
16
- coordinates: {
17
- type: [Number],
18
- required: true,
19
- default: [],
20
- },
21
- }, {
22
- _id: false,
23
- id: false,
24
- });
25
-
26
- return GeoJSONPoint;
27
- }
@@ -1,4 +0,0 @@
1
- export interface GeoJSONPointType {
2
- type: string
3
- coordinates: number[]
4
- }