tabletcommand-backend-models 5.36.25 → 5.37.0

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.
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PersonnelKnownModule = exports.PersonnelKnownSchema = void 0;
4
+ const uuid = require("uuid");
5
+ const helpers_1 = require("../helpers");
6
+ function PersonnelKnownSchema(mongoose) {
7
+ const { Schema, Types } = mongoose;
8
+ const Radio = (0, helpers_1.createSchema)(Schema, {
9
+ radioName: {
10
+ type: String,
11
+ },
12
+ active: {
13
+ type: Boolean,
14
+ default: true,
15
+ },
16
+ }, {
17
+ _id: false,
18
+ id: false,
19
+ });
20
+ const modelSchema = (0, helpers_1.createSchema)(Schema, {
21
+ _id: {
22
+ type: Types.ObjectId,
23
+ auto: true,
24
+ },
25
+ PersonnelID: {
26
+ type: String,
27
+ required: true,
28
+ },
29
+ PersonnelName: {
30
+ type: String,
31
+ required: true,
32
+ },
33
+ PersonnelRank: {
34
+ type: String,
35
+ default: ""
36
+ },
37
+ PersonnelWorkCode: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ departmentId: {
42
+ type: String,
43
+ },
44
+ uuid: {
45
+ type: String,
46
+ default: uuid.v4,
47
+ },
48
+ radios: {
49
+ type: [Radio],
50
+ default: [],
51
+ },
52
+ active: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
56
+ // Clarify if we'd like to link personnel
57
+ // to TC agencies or external agencies
58
+ jurisdiction: {
59
+ type: String,
60
+ default: ""
61
+ },
62
+ agencyId: {
63
+ type: Types.ObjectId,
64
+ ref: "Agency",
65
+ default: null,
66
+ },
67
+ }, {
68
+ collection: "massive_personnel_known",
69
+ timestamps: true,
70
+ autoIndex: false,
71
+ });
72
+ return modelSchema;
73
+ }
74
+ exports.PersonnelKnownSchema = PersonnelKnownSchema;
75
+ async function PersonnelKnownModule(mongoose) {
76
+ const modelSchema = PersonnelKnownSchema(mongoose);
77
+ return (0, helpers_1.createModel)(mongoose, "PersonnelKnown", modelSchema);
78
+ }
79
+ exports.PersonnelKnownModule = PersonnelKnownModule;
80
+ exports.default = PersonnelKnownModule;
81
+ //# sourceMappingURL=personnel-known.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personnel-known.js","sourceRoot":"","sources":["../../src/models/personnel-known.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAE7B,wCAOoB;AAEpB,SAAgB,oBAAoB,CAAC,QAAwB;IAC3D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,KAAK,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACjC,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;SACb;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,IAAI;SACd;KACF,EAAE;QACD,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,KAAK;KACV,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,GAAG,EAAE;YACH,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,IAAI;SACX;QACD,WAAW,EAAE;YACX,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QAED,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;SACb;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,IAAI,CAAC,EAAE;SACjB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,KAAK,CAAC;YACb,OAAO,EAAE,EAAE;SACZ;QAED,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;QACD,0CAA0C;QAC1C,sCAAsC;QACtC,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,GAAG,EAAE,QAAQ;YACb,OAAO,EAAE,IAAI;SACd;KACF,EAAE;QACD,UAAU,EAAE,yBAAyB;QACrC,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;KACjB,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC;AAxED,oDAwEC;AAEM,KAAK,UAAU,oBAAoB,CAAC,QAAwB;IACjE,MAAM,WAAW,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACnD,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;AAC9D,CAAC;AAHD,oDAGC;AAID,kBAAe,oBAAgG,CAAC"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PersonnelRosterModule = exports.PersonnelRosterSchema = void 0;
4
+ const helpers_1 = require("../helpers");
5
+ function PersonnelRosterSchema(mongoose) {
6
+ const { Schema, Types } = mongoose;
7
+ const modelSchema = (0, helpers_1.createSchema)(Schema, {
8
+ _id: {
9
+ type: Types.ObjectId,
10
+ auto: true,
11
+ },
12
+ PersonnelID: {
13
+ type: String,
14
+ required: true,
15
+ },
16
+ PersonnelName: {
17
+ type: String,
18
+ required: true,
19
+ },
20
+ PersonnelRank: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ PersonnelWorkCode: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ PersonnelUUID: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ departmentId: {
33
+ type: String,
34
+ },
35
+ action: {
36
+ type: String,
37
+ default: "add", // The options are "add", "remove"
38
+ },
39
+ radioName: {
40
+ type: String,
41
+ default: "",
42
+ },
43
+ shiftStart: {
44
+ type: Date,
45
+ default: helpers_1.currentDate,
46
+ },
47
+ shiftEnd: {
48
+ type: Date,
49
+ default: helpers_1.currentDate,
50
+ },
51
+ active: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ }, {
56
+ collection: "massive_personnel_roster",
57
+ autoIndex: false,
58
+ timestamps: true,
59
+ });
60
+ return modelSchema;
61
+ }
62
+ exports.PersonnelRosterSchema = PersonnelRosterSchema;
63
+ async function PersonnelRosterModule(mongoose) {
64
+ const modelSchema = PersonnelRosterSchema(mongoose);
65
+ return (0, helpers_1.createModel)(mongoose, "PersonnelRoster", modelSchema);
66
+ }
67
+ exports.PersonnelRosterModule = PersonnelRosterModule;
68
+ exports.default = PersonnelRosterModule;
69
+ //# sourceMappingURL=personnel-roster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personnel-roster.js","sourceRoot":"","sources":["../../src/models/personnel-roster.ts"],"names":[],"mappings":";;;AAAA,wCAQoB;AAEpB,SAAgB,qBAAqB,CAAC,QAAwB;IAC5D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,GAAG,EAAE;YACH,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,IAAI;SACX;QACD,WAAW,EAAE;YACX,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QAED,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;SACb;QAED,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,KAAK,EAAE,kCAAkC;SACnD;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QAED,UAAU,EAAE;YACV,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QAED,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;KACF,EAAE;QACD,UAAU,EAAE,0BAA0B;QACtC,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC;AA9DD,sDA8DC;AAEM,KAAK,UAAU,qBAAqB,CAAC,QAAwB;IAClE,MAAM,WAAW,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACpD,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;AAC/D,CAAC;AAHD,sDAGC;AAID,kBAAe,qBAAmG,CAAC"}
@@ -22,6 +22,10 @@ async function RateLimitModule(mongoose) {
22
22
  type: Number,
23
23
  default: 0,
24
24
  },
25
+ remoteAddress: {
26
+ type: String,
27
+ default: "",
28
+ },
25
29
  }, {
26
30
  collection: "massive_rate_limit",
27
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../../src/models/rate-limit.ts"],"names":[],"mappings":";;;AAAA,wCAQoB;AAEb,KAAK,UAAU,eAAe,CAAC,QAAwB;IAC5D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,GAAG,EAAE;YACH,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,IAAI;SACX;QACD,QAAQ,EAAE,MAAM;QAChB,kBAAkB,EAAE;YAClB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;SACX;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;SACX;KACF,EAAE;QACD,UAAU,EAAE,oBAAoB;KACjC,CAAC,CAAC;IACH,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAEpC,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACzD,CAAC;AA3BD,0CA2BC;AAID,kBAAe,eAAiF,CAAC"}
1
+ {"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../../src/models/rate-limit.ts"],"names":[],"mappings":";;;AAAA,wCAQoB;AAEb,KAAK,UAAU,eAAe,CAAC,QAAwB;IAC5D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,GAAG,EAAE;YACH,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,IAAI;SACX;QACD,QAAQ,EAAE,MAAM;QAChB,kBAAkB,EAAE;YAClB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;SACX;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;SACX;QACD,aAAa,EAAE;YACb,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;KACF,EAAE;QACD,UAAU,EAAE,oBAAoB;KACjC,CAAC,CAAC;IACH,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAEpC,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACzD,CAAC;AA/BD,0CA+BC;AAID,kBAAe,eAAiF,CAAC"}
@@ -0,0 +1,93 @@
1
+ /// <reference types="mongoose" />
2
+ import * as uuid from "uuid";
3
+ import { MongooseModule, ItemTypeFromTypeSchemaFunction, ModelTypeFromTypeSchemaFunction, ReplaceModelReturnType } from "../helpers";
4
+ export declare function PersonnelKnownSchema(mongoose: MongooseModule): import("mongoose").Schema<any> & {
5
+ _interface: import("../helpers").MongooseInterface<{
6
+ _id: {
7
+ type: import("mongoose").Types.ObjectIdConstructor;
8
+ auto: boolean;
9
+ };
10
+ PersonnelID: {
11
+ type: StringConstructor;
12
+ required: boolean;
13
+ };
14
+ PersonnelName: {
15
+ type: StringConstructor;
16
+ required: boolean;
17
+ };
18
+ PersonnelRank: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ PersonnelWorkCode: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ departmentId: {
27
+ type: StringConstructor;
28
+ };
29
+ uuid: {
30
+ type: StringConstructor;
31
+ default: (<T extends ArrayLike<number>>(options: uuid.V4Options | null | undefined, buffer: T, offset?: number | undefined) => T) & ((options?: uuid.V4Options | undefined) => string);
32
+ };
33
+ radios: {
34
+ type: (import("mongoose").Schema<any> & {
35
+ _interface: import("../helpers").MongooseInterface<{
36
+ radioName: {
37
+ type: StringConstructor;
38
+ };
39
+ active: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
43
+ }>;
44
+ _methods: unknown;
45
+ })[];
46
+ default: never[];
47
+ };
48
+ active: {
49
+ type: BooleanConstructor;
50
+ default: boolean;
51
+ };
52
+ jurisdiction: {
53
+ type: StringConstructor;
54
+ default: string;
55
+ };
56
+ agencyId: {
57
+ type: import("mongoose").Types.ObjectIdConstructor;
58
+ ref: string;
59
+ default: null;
60
+ };
61
+ }>;
62
+ _methods: unknown;
63
+ };
64
+ export declare function PersonnelKnownModule(mongoose: MongooseModule): Promise<import("mongoose").Model<import("mongoose").Document & Record<string, unknown> & {
65
+ _id: import("mongoose").Types.ObjectId;
66
+ PersonnelID: string;
67
+ PersonnelName: string;
68
+ PersonnelRank: string;
69
+ PersonnelWorkCode: string;
70
+ departmentId: string;
71
+ uuid: string;
72
+ radios: import("../helpers").MongooseInterface<{
73
+ radioName: {
74
+ type: StringConstructor;
75
+ };
76
+ active: {
77
+ type: BooleanConstructor;
78
+ default: boolean;
79
+ };
80
+ }>[];
81
+ active: boolean;
82
+ jurisdiction: string;
83
+ agencyId: import("mongoose").Types.ObjectId;
84
+ }, {}> & {
85
+ __methods?: unknown;
86
+ }>;
87
+ export interface PersonnelKnown extends ItemTypeFromTypeSchemaFunction<typeof PersonnelKnownModule> {
88
+ }
89
+ export interface PersonnelKnownModel extends ModelTypeFromTypeSchemaFunction<PersonnelKnown> {
90
+ }
91
+ declare const _default: ReplaceModelReturnType<typeof PersonnelKnownModule, PersonnelKnownModel>;
92
+ export default _default;
93
+ //# sourceMappingURL=personnel-known.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personnel-known.d.ts","sourceRoot":"","sources":["../../src/models/personnel-known.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAGL,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwE5D;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;GAGlE;AAED,MAAM,WAAW,cAAe,SAAQ,8BAA8B,CAAC,OAAO,oBAAoB,CAAC;CAAI;AACvG,MAAM,WAAW,mBAAoB,SAAQ,+BAA+B,CAAC,cAAc,CAAC;CAAI;;AAChG,wBAAgH"}
@@ -0,0 +1,77 @@
1
+ /// <reference types="mongoose" />
2
+ import { MongooseModule, ItemTypeFromTypeSchemaFunction, ModelTypeFromTypeSchemaFunction, ReplaceModelReturnType, currentDate } from "../helpers";
3
+ export declare function PersonnelRosterSchema(mongoose: MongooseModule): import("mongoose").Schema<any> & {
4
+ _interface: import("../helpers").MongooseInterface<{
5
+ _id: {
6
+ type: import("mongoose").Types.ObjectIdConstructor;
7
+ auto: boolean;
8
+ };
9
+ PersonnelID: {
10
+ type: StringConstructor;
11
+ required: boolean;
12
+ };
13
+ PersonnelName: {
14
+ type: StringConstructor;
15
+ required: boolean;
16
+ };
17
+ PersonnelRank: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ PersonnelWorkCode: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ PersonnelUUID: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ departmentId: {
30
+ type: StringConstructor;
31
+ };
32
+ action: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ radioName: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ shiftStart: {
41
+ type: DateConstructor;
42
+ default: typeof currentDate;
43
+ };
44
+ shiftEnd: {
45
+ type: DateConstructor;
46
+ default: typeof currentDate;
47
+ };
48
+ active: {
49
+ type: BooleanConstructor;
50
+ default: boolean;
51
+ };
52
+ }>;
53
+ _methods: unknown;
54
+ };
55
+ export declare function PersonnelRosterModule(mongoose: MongooseModule): Promise<import("mongoose").Model<import("mongoose").Document & Record<string, unknown> & {
56
+ _id: import("mongoose").Types.ObjectId;
57
+ PersonnelID: string;
58
+ PersonnelName: string;
59
+ PersonnelRank: string;
60
+ PersonnelWorkCode: string;
61
+ PersonnelUUID: string;
62
+ departmentId: string;
63
+ action: string;
64
+ radioName: string;
65
+ shiftStart: string;
66
+ shiftEnd: string;
67
+ active: boolean;
68
+ }, {}> & {
69
+ __methods?: unknown;
70
+ }>;
71
+ export interface PersonnelRoster extends ItemTypeFromTypeSchemaFunction<typeof PersonnelRosterModule> {
72
+ }
73
+ export interface PersonnelRosterModel extends ModelTypeFromTypeSchemaFunction<PersonnelRoster> {
74
+ }
75
+ declare const _default: ReplaceModelReturnType<typeof PersonnelRosterModule, PersonnelRosterModel>;
76
+ export default _default;
77
+ //# sourceMappingURL=personnel-roster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personnel-roster.d.ts","sourceRoot":"","sources":["../../src/models/personnel-roster.ts"],"names":[],"mappings":";AAAA,OAAO,EAGL,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACtB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8D7D;AAED,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;GAGnE;AAED,MAAM,WAAW,eAAgB,SAAQ,8BAA8B,CAAC,OAAO,qBAAqB,CAAC;CAAI;AACzG,MAAM,WAAW,oBAAqB,SAAQ,+BAA+B,CAAC,eAAe,CAAC;CAAI;;AAClG,wBAAmH"}
@@ -6,6 +6,7 @@ export declare function RateLimitModule(mongoose: MongooseModule): Promise<impor
6
6
  modified_unix_date: number;
7
7
  modified: string;
8
8
  count: number;
9
+ remoteAddress: string;
9
10
  }, {}> & {
10
11
  __methods?: unknown;
11
12
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../src/models/rate-limit.ts"],"names":[],"mappings":";AAAA,OAAO,EAIL,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,wBAAsB,eAAe,CAAC,QAAQ,EAAE,cAAc;;;;;;;;GA2B7D;AAED,MAAM,WAAW,SAAU,SAAQ,8BAA8B,CAAC,OAAO,eAAe,CAAC;CAAI;AAC7F,MAAM,WAAW,cAAe,SAAQ,+BAA+B,CAAC,SAAS,CAAC;CAAI;;AACtF,wBAAiG"}
1
+ {"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../src/models/rate-limit.ts"],"names":[],"mappings":";AAAA,OAAO,EAIL,cAAc,EACd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,wBAAsB,eAAe,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;GA+B7D;AAED,MAAM,WAAW,SAAU,SAAQ,8BAA8B,CAAC,OAAO,eAAe,CAAC;CAAI;AAC7F,MAAM,WAAW,cAAe,SAAQ,+BAA+B,CAAC,SAAS,CAAC;CAAI;;AACtF,wBAAiG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabletcommand-backend-models",
3
- "version": "5.36.25",
3
+ "version": "5.37.0",
4
4
  "description": "Tablet Command Backend Models",
5
5
  "scripts": {
6
6
  "build": "gulp build",
@@ -0,0 +1,93 @@
1
+ import * as uuid from "uuid";
2
+
3
+ import {
4
+ createSchema,
5
+ createModel,
6
+ MongooseModule,
7
+ ItemTypeFromTypeSchemaFunction,
8
+ ModelTypeFromTypeSchemaFunction,
9
+ ReplaceModelReturnType,
10
+ } from "../helpers";
11
+
12
+ export function PersonnelKnownSchema(mongoose: MongooseModule) {
13
+ const { Schema, Types } = mongoose;
14
+
15
+ const Radio = createSchema(Schema, {
16
+ radioName: {
17
+ type: String,
18
+ },
19
+ active: {
20
+ type: Boolean,
21
+ default: true,
22
+ },
23
+ }, {
24
+ _id: false,
25
+ id: false,
26
+ });
27
+
28
+ const modelSchema = createSchema(Schema, {
29
+ _id: {
30
+ type: Types.ObjectId,
31
+ auto: true,
32
+ },
33
+ PersonnelID: {
34
+ type: String,
35
+ required: true,
36
+ },
37
+ PersonnelName: {
38
+ type: String,
39
+ required: true,
40
+ },
41
+ PersonnelRank: {
42
+ type: String,
43
+ default: ""
44
+ },
45
+ PersonnelWorkCode: {
46
+ type: String,
47
+ default: ""
48
+ },
49
+
50
+ departmentId: {
51
+ type: String,
52
+ },
53
+ uuid: {
54
+ type: String,
55
+ default: uuid.v4,
56
+ },
57
+ radios: {
58
+ type: [Radio],
59
+ default: [],
60
+ },
61
+
62
+ active: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ // Clarify if we'd like to link personnel
67
+ // to TC agencies or external agencies
68
+ jurisdiction: {
69
+ type: String,
70
+ default: ""
71
+ },
72
+ agencyId: {
73
+ type: Types.ObjectId,
74
+ ref: "Agency",
75
+ default: null,
76
+ },
77
+ }, {
78
+ collection: "massive_personnel_known",
79
+ timestamps: true,
80
+ autoIndex: false,
81
+ });
82
+
83
+ return modelSchema;
84
+ }
85
+
86
+ export async function PersonnelKnownModule(mongoose: MongooseModule) {
87
+ const modelSchema = PersonnelKnownSchema(mongoose);
88
+ return createModel(mongoose, "PersonnelKnown", modelSchema);
89
+ }
90
+
91
+ export interface PersonnelKnown extends ItemTypeFromTypeSchemaFunction<typeof PersonnelKnownModule> { }
92
+ export interface PersonnelKnownModel extends ModelTypeFromTypeSchemaFunction<PersonnelKnown> { }
93
+ export default PersonnelKnownModule as ReplaceModelReturnType<typeof PersonnelKnownModule, PersonnelKnownModel>;
@@ -0,0 +1,82 @@
1
+ import {
2
+ createSchema,
3
+ createModel,
4
+ MongooseModule,
5
+ ItemTypeFromTypeSchemaFunction,
6
+ ModelTypeFromTypeSchemaFunction,
7
+ ReplaceModelReturnType,
8
+ currentDate,
9
+ } from "../helpers";
10
+
11
+ export function PersonnelRosterSchema(mongoose: MongooseModule) {
12
+ const { Schema, Types } = mongoose;
13
+
14
+ const modelSchema = createSchema(Schema, {
15
+ _id: {
16
+ type: Types.ObjectId,
17
+ auto: true,
18
+ },
19
+ PersonnelID: {
20
+ type: String,
21
+ required: true,
22
+ },
23
+ PersonnelName: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ PersonnelRank: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ PersonnelWorkCode: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ PersonnelUUID: {
36
+ type: String,
37
+ default: ""
38
+ },
39
+
40
+ departmentId: {
41
+ type: String,
42
+ },
43
+
44
+ action: {
45
+ type: String,
46
+ default: "add", // The options are "add", "remove"
47
+ },
48
+ radioName: {
49
+ type: String,
50
+ default: "",
51
+ },
52
+
53
+ shiftStart: {
54
+ type: Date,
55
+ default: currentDate,
56
+ },
57
+ shiftEnd: {
58
+ type: Date,
59
+ default: currentDate,
60
+ },
61
+
62
+ active: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ }, {
67
+ collection: "massive_personnel_roster",
68
+ autoIndex: false,
69
+ timestamps: true,
70
+ });
71
+
72
+ return modelSchema;
73
+ }
74
+
75
+ export async function PersonnelRosterModule(mongoose: MongooseModule) {
76
+ const modelSchema = PersonnelRosterSchema(mongoose);
77
+ return createModel(mongoose, "PersonnelRoster", modelSchema);
78
+ }
79
+
80
+ export interface PersonnelRoster extends ItemTypeFromTypeSchemaFunction<typeof PersonnelRosterModule> { }
81
+ export interface PersonnelRosterModel extends ModelTypeFromTypeSchemaFunction<PersonnelRoster> { }
82
+ export default PersonnelRosterModule as ReplaceModelReturnType<typeof PersonnelRosterModule, PersonnelRosterModel>;
@@ -29,6 +29,10 @@ export async function RateLimitModule(mongoose: MongooseModule) {
29
29
  type: Number,
30
30
  default: 0,
31
31
  },
32
+ remoteAddress: {
33
+ type: String,
34
+ default: "",
35
+ },
32
36
  }, {
33
37
  collection: "massive_rate_limit",
34
38
  });