tabletcommand-backend-models 5.17.17 → 5.17.18
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CADStatusMapModule = void 0;
|
|
4
|
-
const _ = require("lodash");
|
|
5
4
|
const helpers_1 = require("../helpers");
|
|
6
5
|
async function CADStatusMapModule(mongoose) {
|
|
7
6
|
const Schema = mongoose.Schema;
|
|
@@ -19,14 +18,6 @@ async function CADStatusMapModule(mongoose) {
|
|
|
19
18
|
_id: false,
|
|
20
19
|
id: false,
|
|
21
20
|
});
|
|
22
|
-
// Using hook instead of default values,
|
|
23
|
-
// so we keep the db value if no value was sent by the API/CAD
|
|
24
|
-
ToStatusIdSchema.pre("save", function (next) {
|
|
25
|
-
if (_.isUndefined(this.userEnabled) || _.isNull(this.userEnabled)) {
|
|
26
|
-
this.userEnabled = false;
|
|
27
|
-
}
|
|
28
|
-
next();
|
|
29
|
-
});
|
|
30
21
|
// Update static items (keep in sync with the lib/cad-status-map/updateDocument!)
|
|
31
22
|
const modelSchema = (0, helpers_1.createSchema)(Schema, {
|
|
32
23
|
departmentId: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cad-status-map.js","sourceRoot":"","sources":["../../src/models/cad-status-map.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"cad-status-map.js","sourceRoot":"","sources":["../../src/models/cad-status-map.ts"],"names":[],"mappings":";;;AAAA,wCAQoB;AAEb,KAAK,UAAU,kBAAkB,CAAC,QAAwB;IAC/D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAE/B,MAAM,gBAAgB,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QAC5C,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,IAAI;YACd,GAAG,EAAE,CAAC;SACP;QACD,WAAW,EAAE;YACX,IAAI,EAAE,OAAO;SACd;KACF,EAAE;QACD,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,KAAK;KACV,CAAC,CAAC;IAEH,iFAAiF;IACjF,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;SACZ;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;YACV,GAAG,EAAE,CAAC;SACP;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,IAAI;YACd,GAAG,EAAE,CAAC;SACP;QACD,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,gBAAgB,CAAC;YACxB,QAAQ,EAAE,IAAI;SACf;KACF,EAAE;QACD,UAAU,EAAE,wBAAwB;KACrC,CAAC,CAAC;IACH,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAEpC,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAC5D,CAAC;AAnDD,gDAmDC;AAID,kBAAe,kBAA0F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cad-status-map.d.ts","sourceRoot":"","sources":["../../src/models/cad-status-map.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cad-status-map.d.ts","sourceRoot":"","sources":["../../src/models/cad-status-map.ts"],"names":[],"mappings":";AAAA,OAAO,EAIL,8BAA8B,EAC9B,+BAA+B,EAC/B,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;GAmDhE;AAED,MAAM,WAAW,YAAa,SAAQ,8BAA8B,CAAC,OAAO,kBAAkB,CAAC;CAAI;AACnG,MAAM,WAAW,iBAAkB,SAAQ,+BAA+B,CAAC,YAAY,CAAC;CAAI;;AAC5F,wBAA0G"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _ from "lodash";
|
|
2
1
|
import {
|
|
3
2
|
createModel,
|
|
4
3
|
createSchema,
|
|
@@ -7,7 +6,6 @@ import {
|
|
|
7
6
|
ModelTypeFromTypeSchemaFunction,
|
|
8
7
|
MongooseModule,
|
|
9
8
|
ReplaceModelReturnType,
|
|
10
|
-
TypedDocument,
|
|
11
9
|
} from "../helpers";
|
|
12
10
|
|
|
13
11
|
export async function CADStatusMapModule(mongoose: MongooseModule) {
|
|
@@ -28,15 +26,6 @@ export async function CADStatusMapModule(mongoose: MongooseModule) {
|
|
|
28
26
|
id: false,
|
|
29
27
|
});
|
|
30
28
|
|
|
31
|
-
// Using hook instead of default values,
|
|
32
|
-
// so we keep the db value if no value was sent by the API/CAD
|
|
33
|
-
ToStatusIdSchema.pre("save", function(this: TypedDocument<typeof ToStatusIdSchema>, next) {
|
|
34
|
-
if (_.isUndefined(this.userEnabled) || _.isNull(this.userEnabled)) {
|
|
35
|
-
this.userEnabled = false;
|
|
36
|
-
}
|
|
37
|
-
next();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
29
|
// Update static items (keep in sync with the lib/cad-status-map/updateDocument!)
|
|
41
30
|
const modelSchema = createSchema(Schema, {
|
|
42
31
|
departmentId: {
|
package/src/models/location.ts
CHANGED
|
@@ -168,12 +168,6 @@ export async function LocationModule(mongoose: MongooseModule) {
|
|
|
168
168
|
modified: 1,
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
modelSchema.index({
|
|
172
|
-
locationGeoJSON: "2dsphere",
|
|
173
|
-
shared: 1,
|
|
174
|
-
departmentId: 1,
|
|
175
|
-
modified: 1,
|
|
176
|
-
});
|
|
177
171
|
modelSchema.plugin(mongooseLeanVirtuals);
|
|
178
172
|
modelSchema.set("autoIndex", false);
|
|
179
173
|
return createModel(mongoose, "Location", modelSchema);
|