@tsed/mongoose 8.0.0-alpha.5 → 8.0.0-alpha.7
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/lib/esm/MongooseModule.js.map +1 -1
- package/lib/esm/decorators/dynamicRef.js +1 -1
- package/lib/esm/decorators/dynamicRef.js.map +1 -1
- package/lib/esm/decorators/indexed.js.map +1 -1
- package/lib/esm/decorators/model.js.map +1 -1
- package/lib/esm/decorators/mongoosePlugin.js.map +1 -1
- package/lib/esm/decorators/numberDecimal.js +1 -1
- package/lib/esm/decorators/numberDecimal.js.map +1 -1
- package/lib/esm/decorators/objectID.js.map +1 -1
- package/lib/esm/decorators/postHook.js.map +1 -1
- package/lib/esm/decorators/preHook.js.map +1 -1
- package/lib/esm/decorators/ref.js.map +1 -1
- package/lib/esm/decorators/schema.js.map +1 -1
- package/lib/esm/decorators/versionKey.js.map +1 -1
- package/lib/esm/decorators/virtualRef.js.map +1 -1
- package/lib/esm/services/MongooseConnections.js +1 -1
- package/lib/esm/services/MongooseConnections.js.map +1 -1
- package/lib/esm/services/MongooseService.js.map +1 -1
- package/lib/esm/utils/createModel.js.map +1 -1
- package/lib/esm/utils/createSchema.js.map +1 -1
- package/lib/esm/utils/resolveRefType.js.map +1 -1
- package/lib/esm/utils/schemaOptions.js.map +1 -1
- package/lib/types/decorators/indexed.d.ts +24 -0
- package/lib/types/decorators/mongoosePlugin.d.ts +24 -0
- package/lib/types/decorators/numberDecimal.d.ts +24 -0
- package/lib/types/decorators/objectID.d.ts +24 -0
- package/lib/types/decorators/schema.d.ts +24 -0
- package/lib/types/interfaces/MongooseConnectionOptions.d.ts +24 -0
- package/lib/types/interfaces/MongooseDocument.d.ts +24 -0
- package/lib/types/interfaces/MongooseModel.d.ts +24 -0
- package/lib/types/interfaces/MongooseSchemaOptions.d.ts +24 -0
- package/lib/types/services/MongooseService.d.ts +24 -0
- package/lib/types/utils/createModel.d.ts +24 -0
- package/lib/types/utils/createSchema.d.ts +24 -0
- package/lib/types/utils/schemaOptions.d.ts +24 -0
- package/package.json +19 -20
- package/vitest.config.mts +4 -4
- package/lib/cjs/MongooseModule.js +0 -36
- package/lib/cjs/MongooseModule.js.map +0 -1
- package/lib/cjs/constants/constants.js +0 -24
- package/lib/cjs/constants/constants.js.map +0 -1
- package/lib/cjs/decorators/auto.js +0 -28
- package/lib/cjs/decorators/auto.js.map +0 -1
- package/lib/cjs/decorators/discriminatorKey.js +0 -6
- package/lib/cjs/decorators/discriminatorKey.js.map +0 -1
- package/lib/cjs/decorators/dynamicRef.js +0 -65
- package/lib/cjs/decorators/dynamicRef.js.map +0 -1
- package/lib/cjs/decorators/excludeIndexes.js +0 -28
- package/lib/cjs/decorators/excludeIndexes.js.map +0 -1
- package/lib/cjs/decorators/expires.js +0 -28
- package/lib/cjs/decorators/expires.js.map +0 -1
- package/lib/cjs/decorators/immutable.js +0 -30
- package/lib/cjs/decorators/immutable.js.map +0 -1
- package/lib/cjs/decorators/indexed.js +0 -26
- package/lib/cjs/decorators/indexed.js.map +0 -1
- package/lib/cjs/decorators/lowercase.js +0 -28
- package/lib/cjs/decorators/lowercase.js.map +0 -1
- package/lib/cjs/decorators/model.js +0 -69
- package/lib/cjs/decorators/model.js.map +0 -1
- package/lib/cjs/decorators/mongooseIndex.js +0 -39
- package/lib/cjs/decorators/mongooseIndex.js.map +0 -1
- package/lib/cjs/decorators/mongooseIndexes.js +0 -39
- package/lib/cjs/decorators/mongooseIndexes.js.map +0 -1
- package/lib/cjs/decorators/mongoosePlugin.js +0 -22
- package/lib/cjs/decorators/mongoosePlugin.js.map +0 -1
- package/lib/cjs/decorators/numberDecimal.js +0 -78
- package/lib/cjs/decorators/numberDecimal.js.map +0 -1
- package/lib/cjs/decorators/objectID.js +0 -32
- package/lib/cjs/decorators/objectID.js.map +0 -1
- package/lib/cjs/decorators/postHook.js +0 -26
- package/lib/cjs/decorators/postHook.js.map +0 -1
- package/lib/cjs/decorators/preHook.js +0 -71
- package/lib/cjs/decorators/preHook.js.map +0 -1
- package/lib/cjs/decorators/ref.js +0 -84
- package/lib/cjs/decorators/ref.js.map +0 -1
- package/lib/cjs/decorators/schema.js +0 -32
- package/lib/cjs/decorators/schema.js.map +0 -1
- package/lib/cjs/decorators/schemaIgnore.js +0 -27
- package/lib/cjs/decorators/schemaIgnore.js.map +0 -1
- package/lib/cjs/decorators/select.js +0 -28
- package/lib/cjs/decorators/select.js.map +0 -1
- package/lib/cjs/decorators/sparse.js +0 -30
- package/lib/cjs/decorators/sparse.js.map +0 -1
- package/lib/cjs/decorators/text.js +0 -29
- package/lib/cjs/decorators/text.js.map +0 -1
- package/lib/cjs/decorators/trim.js +0 -27
- package/lib/cjs/decorators/trim.js.map +0 -1
- package/lib/cjs/decorators/unique.js +0 -27
- package/lib/cjs/decorators/unique.js.map +0 -1
- package/lib/cjs/decorators/uppercase.js +0 -28
- package/lib/cjs/decorators/uppercase.js.map +0 -1
- package/lib/cjs/decorators/versionKey.js +0 -12
- package/lib/cjs/decorators/versionKey.js.map +0 -1
- package/lib/cjs/decorators/virtualRef.js +0 -38
- package/lib/cjs/decorators/virtualRef.js.map +0 -1
- package/lib/cjs/index.js +0 -51
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/interfaces/MongooseConnectionOptions.js +0 -3
- package/lib/cjs/interfaces/MongooseConnectionOptions.js.map +0 -1
- package/lib/cjs/interfaces/MongooseDocument.js +0 -3
- package/lib/cjs/interfaces/MongooseDocument.js.map +0 -1
- package/lib/cjs/interfaces/MongooseModel.js +0 -3
- package/lib/cjs/interfaces/MongooseModel.js.map +0 -1
- package/lib/cjs/interfaces/MongooseModelOptions.js +0 -3
- package/lib/cjs/interfaces/MongooseModelOptions.js.map +0 -1
- package/lib/cjs/interfaces/MongooseSchemaOptions.js +0 -3
- package/lib/cjs/interfaces/MongooseSchemaOptions.js.map +0 -1
- package/lib/cjs/interfaces/MongooseSchemaTypes.js +0 -10
- package/lib/cjs/interfaces/MongooseSchemaTypes.js.map +0 -1
- package/lib/cjs/interfaces/MongooseVirtualRefOptions.js +0 -3
- package/lib/cjs/interfaces/MongooseVirtualRefOptions.js.map +0 -1
- package/lib/cjs/interfaces/interfaces.js +0 -3
- package/lib/cjs/interfaces/interfaces.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/registries/MongooseModels.js +0 -5
- package/lib/cjs/registries/MongooseModels.js.map +0 -1
- package/lib/cjs/services/MongooseConnections.js +0 -47
- package/lib/cjs/services/MongooseConnections.js.map +0 -1
- package/lib/cjs/services/MongooseService.js +0 -78
- package/lib/cjs/services/MongooseService.js.map +0 -1
- package/lib/cjs/utils/createModel.js +0 -44
- package/lib/cjs/utils/createModel.js.map +0 -1
- package/lib/cjs/utils/createSchema.js +0 -161
- package/lib/cjs/utils/createSchema.js.map +0 -1
- package/lib/cjs/utils/resolveRefType.js +0 -19
- package/lib/cjs/utils/resolveRefType.js.map +0 -1
- package/lib/cjs/utils/schemaOptions.js +0 -60
- package/lib/cjs/utils/schemaOptions.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/MongooseModule.d.ts +0 -13
- package/lib/types-esm/constants/constants.d.ts +0 -20
- package/lib/types-esm/decorators/auto.d.ts +0 -20
- package/lib/types-esm/decorators/discriminatorKey.d.ts +0 -1
- package/lib/types-esm/decorators/dynamicRef.d.ts +0 -35
- package/lib/types-esm/decorators/excludeIndexes.d.ts +0 -20
- package/lib/types-esm/decorators/expires.d.ts +0 -20
- package/lib/types-esm/decorators/immutable.d.ts +0 -22
- package/lib/types-esm/decorators/indexed.d.ts +0 -19
- package/lib/types-esm/decorators/lowercase.d.ts +0 -20
- package/lib/types-esm/decorators/model.d.ts +0 -39
- package/lib/types-esm/decorators/mongooseIndex.d.ts +0 -27
- package/lib/types-esm/decorators/mongooseIndexes.d.ts +0 -32
- package/lib/types-esm/decorators/mongoosePlugin.d.ts +0 -11
- package/lib/types-esm/decorators/numberDecimal.d.ts +0 -32
- package/lib/types-esm/decorators/objectID.d.ts +0 -19
- package/lib/types-esm/decorators/postHook.d.ts +0 -48
- package/lib/types-esm/decorators/preHook.d.ts +0 -49
- package/lib/types-esm/decorators/ref.d.ts +0 -38
- package/lib/types-esm/decorators/schema.d.ts +0 -54
- package/lib/types-esm/decorators/schemaIgnore.d.ts +0 -19
- package/lib/types-esm/decorators/select.d.ts +0 -20
- package/lib/types-esm/decorators/sparse.d.ts +0 -22
- package/lib/types-esm/decorators/text.d.ts +0 -21
- package/lib/types-esm/decorators/trim.d.ts +0 -19
- package/lib/types-esm/decorators/unique.d.ts +0 -19
- package/lib/types-esm/decorators/uppercase.d.ts +0 -20
- package/lib/types-esm/decorators/versionKey.d.ts +0 -1
- package/lib/types-esm/decorators/virtualRef.d.ts +0 -26
- package/lib/types-esm/index.d.ts +0 -47
- package/lib/types-esm/interfaces/MongooseConnectionOptions.d.ts +0 -9
- package/lib/types-esm/interfaces/MongooseDocument.d.ts +0 -2
- package/lib/types-esm/interfaces/MongooseModel.d.ts +0 -8
- package/lib/types-esm/interfaces/MongooseModelOptions.d.ts +0 -7
- package/lib/types-esm/interfaces/MongooseSchemaOptions.d.ts +0 -36
- package/lib/types-esm/interfaces/MongooseSchemaTypes.d.ts +0 -5
- package/lib/types-esm/interfaces/MongooseVirtualRefOptions.d.ts +0 -9
- package/lib/types-esm/interfaces/interfaces.d.ts +0 -8
- package/lib/types-esm/registries/MongooseModels.d.ts +0 -2
- package/lib/types-esm/services/MongooseConnections.d.ts +0 -9
- package/lib/types-esm/services/MongooseService.d.ts +0 -25
- package/lib/types-esm/utils/createModel.d.ts +0 -18
- package/lib/types-esm/utils/createSchema.d.ts +0 -28
- package/lib/types-esm/utils/resolveRefType.d.ts +0 -5
- package/lib/types-esm/utils/schemaOptions.d.ts +0 -14
package/lib/cjs/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @file Automatically generated by @tsed/barrels.
|
|
6
|
-
*/
|
|
7
|
-
tslib_1.__exportStar(require("./constants/constants.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./decorators/auto.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./decorators/discriminatorKey.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./decorators/dynamicRef.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./decorators/excludeIndexes.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./decorators/expires.js"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./decorators/immutable.js"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./decorators/indexed.js"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./decorators/lowercase.js"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./decorators/model.js"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./decorators/mongooseIndex.js"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./decorators/mongooseIndexes.js"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./decorators/mongoosePlugin.js"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./decorators/numberDecimal.js"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./decorators/objectID.js"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./decorators/postHook.js"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./decorators/preHook.js"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./decorators/ref.js"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./decorators/schema.js"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./decorators/schemaIgnore.js"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./decorators/select.js"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./decorators/sparse.js"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./decorators/text.js"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./decorators/trim.js"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./decorators/unique.js"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./decorators/uppercase.js"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./decorators/versionKey.js"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./decorators/virtualRef.js"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./interfaces/interfaces.js"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./interfaces/MongooseConnectionOptions.js"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./interfaces/MongooseDocument.js"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./interfaces/MongooseModel.js"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./interfaces/MongooseModelOptions.js"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./interfaces/MongooseSchemaOptions.js"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./interfaces/MongooseSchemaTypes.js"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./interfaces/MongooseVirtualRefOptions.js"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./MongooseModule.js"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./registries/MongooseModels.js"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./services/MongooseConnections.js"), exports);
|
|
46
|
-
tslib_1.__exportStar(require("./services/MongooseService.js"), exports);
|
|
47
|
-
tslib_1.__exportStar(require("./utils/createModel.js"), exports);
|
|
48
|
-
tslib_1.__exportStar(require("./utils/createSchema.js"), exports);
|
|
49
|
-
tslib_1.__exportStar(require("./utils/resolveRefType.js"), exports);
|
|
50
|
-
tslib_1.__exportStar(require("./utils/schemaOptions.js"), exports);
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAyC;AACzC,+DAAqC;AACrC,2EAAiD;AACjD,qEAA2C;AAC3C,yEAA+C;AAC/C,kEAAwC;AACxC,oEAA0C;AAC1C,kEAAwC;AACxC,oEAA0C;AAC1C,gEAAsC;AACtC,wEAA8C;AAC9C,0EAAgD;AAChD,yEAA+C;AAC/C,wEAA8C;AAC9C,mEAAyC;AACzC,mEAAyC;AACzC,kEAAwC;AACxC,8DAAoC;AACpC,iEAAuC;AACvC,uEAA6C;AAC7C,iEAAuC;AACvC,iEAAuC;AACvC,+DAAqC;AACrC,+DAAqC;AACrC,iEAAuC;AACvC,oEAA0C;AAC1C,qEAA2C;AAC3C,qEAA2C;AAC3C,qEAA2C;AAC3C,oFAA0D;AAC1D,2EAAiD;AACjD,wEAA8C;AAC9C,+EAAqD;AACrD,gFAAsD;AACtD,8EAAoD;AACpD,oFAA0D;AAC1D,8DAAoC;AACpC,yEAA+C;AAC/C,4EAAkD;AAClD,wEAA8C;AAC9C,iEAAuC;AACvC,kEAAwC;AACxC,oEAA0C;AAC1C,mEAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseConnectionOptions.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseConnectionOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseDocument.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseDocument.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseModel.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseModel.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseModelOptions.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseModelOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseSchemaOptions.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseSchemaOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MongooseSchemaTypes = void 0;
|
|
4
|
-
var MongooseSchemaTypes;
|
|
5
|
-
(function (MongooseSchemaTypes) {
|
|
6
|
-
MongooseSchemaTypes["OBJECT_ID"] = "ObjectId";
|
|
7
|
-
MongooseSchemaTypes["STRING"] = "String";
|
|
8
|
-
MongooseSchemaTypes["NUMBER"] = "Number";
|
|
9
|
-
})(MongooseSchemaTypes = exports.MongooseSchemaTypes || (exports.MongooseSchemaTypes = {}));
|
|
10
|
-
//# sourceMappingURL=MongooseSchemaTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseSchemaTypes.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseSchemaTypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,6CAAsB,CAAA;IACtB,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;AACnB,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseVirtualRefOptions.js","sourceRoot":"","sources":["../../../src/interfaces/MongooseVirtualRefOptions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/interfaces.ts"],"names":[],"mappings":""}
|
package/lib/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseModels.js","sourceRoot":"","sources":["../../../src/registries/MongooseModels.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAsB,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MONGOOSE_CONNECTIONS = void 0;
|
|
4
|
-
const di_1 = require("@tsed/di");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const MongooseService_js_1 = require("../services/MongooseService.js");
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
// tslint:disable-next-line:variable-name
|
|
11
|
-
exports.MONGOOSE_CONNECTIONS = Symbol.for("MONGOOSE_CONNECTIONS");
|
|
12
|
-
function mapOptions(options) {
|
|
13
|
-
if (!options) {
|
|
14
|
-
return [];
|
|
15
|
-
}
|
|
16
|
-
if (!(0, core_1.isArray)(options)) {
|
|
17
|
-
const { url, connectionOptions } = options || {};
|
|
18
|
-
return [
|
|
19
|
-
{
|
|
20
|
-
id: "default",
|
|
21
|
-
url,
|
|
22
|
-
connectionOptions
|
|
23
|
-
}
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
return options.map((settings) => {
|
|
27
|
-
return {
|
|
28
|
-
...settings,
|
|
29
|
-
connectionOptions: settings.connectionOptions
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
(0, di_1.registerProvider)({
|
|
34
|
-
provide: exports.MONGOOSE_CONNECTIONS,
|
|
35
|
-
injectable: false,
|
|
36
|
-
deps: [di_1.Configuration, MongooseService_js_1.MongooseService],
|
|
37
|
-
async useAsyncFactory(configuration, mongooseService) {
|
|
38
|
-
const settings = mapOptions(configuration.get("mongoose"));
|
|
39
|
-
let isDefault = true;
|
|
40
|
-
for (const current of settings) {
|
|
41
|
-
await mongooseService.connect(current.id, current.url, current.connectionOptions || {}, isDefault);
|
|
42
|
-
isDefault = false;
|
|
43
|
-
}
|
|
44
|
-
return mongooseService;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=MongooseConnections.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
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C;SACnB;QAED,OAAO,eAAe,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MongooseService = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const di_1 = require("@tsed/di");
|
|
6
|
-
const logger_1 = require("@tsed/logger");
|
|
7
|
-
const mongoose_1 = tslib_1.__importDefault(require("mongoose"));
|
|
8
|
-
// istanbul ignore next
|
|
9
|
-
function asPromise(c) {
|
|
10
|
-
return c && c.asPromise ? c.asPromise() : c;
|
|
11
|
-
}
|
|
12
|
-
let MongooseService = class MongooseService {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.connections = new Map();
|
|
15
|
-
this.defaultConnection = "default";
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @returns {Promise<"mongoose".Connection>}
|
|
20
|
-
*/
|
|
21
|
-
async connect(id, url, connectionOptions, isDefault = false) {
|
|
22
|
-
if (this.has(id)) {
|
|
23
|
-
return this.get(id);
|
|
24
|
-
}
|
|
25
|
-
this.logger.info(`Connect to mongo database: ${id}`);
|
|
26
|
-
this.logger.debug(`Url: ${url}`);
|
|
27
|
-
this.logger.debug(`options: ${JSON.stringify(connectionOptions)}`);
|
|
28
|
-
try {
|
|
29
|
-
const connection = await asPromise(mongoose_1.default.createConnection(url, connectionOptions));
|
|
30
|
-
this.connections.set(id, connection);
|
|
31
|
-
if (id === "default" || isDefault) {
|
|
32
|
-
this.defaultConnection = id;
|
|
33
|
-
}
|
|
34
|
-
return connection;
|
|
35
|
-
}
|
|
36
|
-
catch (er) {
|
|
37
|
-
/* istanbul ignore next */
|
|
38
|
-
this.logger.error({
|
|
39
|
-
event: "MONGO_CONNECTION_ERROR",
|
|
40
|
-
error_name: er.name,
|
|
41
|
-
message: er.message,
|
|
42
|
-
stack: er.stack
|
|
43
|
-
});
|
|
44
|
-
/* istanbul ignore next */
|
|
45
|
-
process.exit();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @returns {"mongoose".Connection}
|
|
51
|
-
*/
|
|
52
|
-
get(id) {
|
|
53
|
-
return this.connections.get(id || this.defaultConnection);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @param {string} id
|
|
58
|
-
* @returns {boolean}
|
|
59
|
-
*/
|
|
60
|
-
has(id) {
|
|
61
|
-
return this.connections.has(id || this.defaultConnection);
|
|
62
|
-
}
|
|
63
|
-
async closeConnections() {
|
|
64
|
-
for (const [id, connection] of this.connections.entries()) {
|
|
65
|
-
await connection.close();
|
|
66
|
-
this.connections.delete(id);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
tslib_1.__decorate([
|
|
71
|
-
(0, di_1.Inject)(),
|
|
72
|
-
tslib_1.__metadata("design:type", logger_1.Logger)
|
|
73
|
-
], MongooseService.prototype, "logger", void 0);
|
|
74
|
-
MongooseService = tslib_1.__decorate([
|
|
75
|
-
(0, di_1.Injectable)()
|
|
76
|
-
], MongooseService);
|
|
77
|
-
exports.MongooseService = MongooseService;
|
|
78
|
-
//# sourceMappingURL=MongooseService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MongooseService.js","sourceRoot":"","sources":["../../../src/services/MongooseService.ts"],"names":[],"mappings":";;;;AAAA,iCAA4C;AAC5C,yCAAoC;AACpC,gEAAgC;AAGhC,uBAAuB;AACvB,SAAS,SAAS,CAAC,CAAM;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QACI,gBAAW,GAAqC,IAAI,GAAG,EAAE,CAA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AAE,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,EAAW;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,KAAK,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE;YACzD,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SAC7B;IACH,CAAC;CACF,CAAA;AA7DC;IAAC,IAAA,WAAM,GAAE;sCACD,eAAM;+CAAC;AALJ,eAAe;IAD3B,IAAA,eAAU,GAAE;GACA,eAAe,CAiE3B;AAjEY,0CAAe"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createModel = exports.getModelToken = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const schema_1 = require("@tsed/schema");
|
|
7
|
-
const mongoose_1 = tslib_1.__importDefault(require("mongoose"));
|
|
8
|
-
const constants_js_1 = require("../constants/constants.js");
|
|
9
|
-
const MongooseModels_js_1 = require("../registries/MongooseModels.js");
|
|
10
|
-
const createSchema_js_1 = require("./createSchema.js");
|
|
11
|
-
function getModelToken(target, options) {
|
|
12
|
-
const { collectionName, token } = (0, createSchema_js_1.getSchemaToken)(target, options);
|
|
13
|
-
core_1.Store.from(target).set(constants_js_1.MONGOOSE_MODEL_NAME, collectionName);
|
|
14
|
-
MongooseModels_js_1.MongooseModels.set(collectionName, target);
|
|
15
|
-
return { token, collectionName };
|
|
16
|
-
}
|
|
17
|
-
exports.getModelToken = getModelToken;
|
|
18
|
-
/**
|
|
19
|
-
* Create an instance of mongoose.model from a class.
|
|
20
|
-
*
|
|
21
|
-
* @param {Type<any>} target Class attached to the schema and model.
|
|
22
|
-
* @param {"mongoose".Schema} schema Schema that will be attached to the model.
|
|
23
|
-
* @param name model name
|
|
24
|
-
* @param collection (optional, induced from model name)
|
|
25
|
-
* @param overwriteModels
|
|
26
|
-
* @param connection
|
|
27
|
-
* @returns {Model<T extends Document>}
|
|
28
|
-
*/
|
|
29
|
-
function createModel(target, schema, name = (0, core_1.nameOf)(target), collection, overwriteModels, connection) {
|
|
30
|
-
const entity = schema_1.JsonEntityStore.from(target);
|
|
31
|
-
if (entity.isDiscriminatorChild) {
|
|
32
|
-
const discriminatorName = entity.discriminatorAncestor.schema.discriminator().getDefaultValue(target);
|
|
33
|
-
const ancestorModel = entity.discriminatorAncestor.get(constants_js_1.MONGOOSE_MODEL);
|
|
34
|
-
// check if discriminator is already registered on model before creating it
|
|
35
|
-
return ancestorModel.discriminators?.[discriminatorName] || ancestorModel.discriminator(discriminatorName, schema);
|
|
36
|
-
}
|
|
37
|
-
const opts = overwriteModels ? { overwriteModels } : undefined;
|
|
38
|
-
const c = connection || mongoose_1.default;
|
|
39
|
-
const model = c.model(name, schema, collection, opts);
|
|
40
|
-
core_1.Store.from(target).set(constants_js_1.MONGOOSE_MODEL, model);
|
|
41
|
-
return model;
|
|
42
|
-
}
|
|
43
|
-
exports.createModel = createModel;
|
|
44
|
-
//# sourceMappingURL=createModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createModel.js","sourceRoot":"","sources":["../../../src/utils/createModel.ts"],"names":[],"mappings":";;;;AAAA,qCAA+C;AAC/C,yCAA6C;AAC7C,gEAA8C;AAC9C,4DAA8E;AAC9E,uEAA+D;AAC/D,uDAAiD;AAEjD,SAAgB,aAAa,CAAC,MAAiB,EAAE,OAAY;IAC3D,MAAM,EAAC,cAAc,EAAE,KAAK,EAAC,GAAG,IAAA,gCAAc,EA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C;AAzBD,kCAyBC"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSchemaTypeOptions = exports.buildMongooseSchema = exports.getSchemaToken = exports.getSchema = exports.createSchema = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const json_mapper_1 = require("@tsed/json-mapper");
|
|
7
|
-
const schema_1 = require("@tsed/schema");
|
|
8
|
-
const change_case_1 = require("change-case");
|
|
9
|
-
const mongoose_1 = tslib_1.__importDefault(require("mongoose"));
|
|
10
|
-
const constants_js_1 = require("../constants/constants.js");
|
|
11
|
-
const resolveRefType_js_1 = require("./resolveRefType.js");
|
|
12
|
-
const schemaOptions_js_1 = require("./schemaOptions.js");
|
|
13
|
-
/**
|
|
14
|
-
* @ignore
|
|
15
|
-
*/
|
|
16
|
-
function setUpSchema({ schema, virtuals }, options) {
|
|
17
|
-
const mongooseSchema = new mongoose_1.default.Schema(schema, options);
|
|
18
|
-
for (const [key, options] of virtuals.entries()) {
|
|
19
|
-
mongooseSchema.virtual(key, options);
|
|
20
|
-
}
|
|
21
|
-
return mongooseSchema;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @ignore
|
|
25
|
-
*/
|
|
26
|
-
function isVirtualRef(target) {
|
|
27
|
-
return !!(target.ref && target.localField && target.foreignField);
|
|
28
|
-
}
|
|
29
|
-
function hasVersionField(schema, versionKey) {
|
|
30
|
-
// Check if versioning was disabled explicitly
|
|
31
|
-
if (!versionKey)
|
|
32
|
-
return false;
|
|
33
|
-
// Check for alternative version field in schema
|
|
34
|
-
return versionKey in schema.paths;
|
|
35
|
-
}
|
|
36
|
-
function createSchema(target, options = {}) {
|
|
37
|
-
const entity = schema_1.JsonEntityStore.from(target);
|
|
38
|
-
const schemaOptionsFromStore = entity.store.get(constants_js_1.MONGOOSE_SCHEMA_OPTIONS) || {};
|
|
39
|
-
options.schemaOptions = { ...options.schemaOptions, ...schemaOptionsFromStore };
|
|
40
|
-
if (entity.schema.isDiscriminator) {
|
|
41
|
-
options.schemaOptions.discriminatorKey = entity.schema.discriminator().propertyName;
|
|
42
|
-
}
|
|
43
|
-
const schema = setUpSchema(buildMongooseSchema(target), options.schemaOptions);
|
|
44
|
-
(0, schemaOptions_js_1.schemaOptions)(target, options);
|
|
45
|
-
const outputVersionKey = hasVersionField(schema, options.schemaOptions?.versionKey);
|
|
46
|
-
schema.methods.toClass = function toClass() {
|
|
47
|
-
return (0, json_mapper_1.deserialize)(this.toObject({
|
|
48
|
-
virtuals: true,
|
|
49
|
-
versionKey: outputVersionKey,
|
|
50
|
-
flattenMaps: true
|
|
51
|
-
}), {
|
|
52
|
-
type: target,
|
|
53
|
-
useAlias: false,
|
|
54
|
-
additionalProperties: true,
|
|
55
|
-
disabledUnsecureConstructor: false,
|
|
56
|
-
groups: false
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
schema.methods.toJSON = function toJSON(options) {
|
|
60
|
-
return (0, json_mapper_1.serialize)(this.toClass(), options);
|
|
61
|
-
};
|
|
62
|
-
schema.loadClass(target);
|
|
63
|
-
core_1.Store.from(target).set(constants_js_1.MONGOOSE_SCHEMA, schema);
|
|
64
|
-
return schema;
|
|
65
|
-
}
|
|
66
|
-
exports.createSchema = createSchema;
|
|
67
|
-
/**
|
|
68
|
-
* Get a schema already created. If the schema doesn't exists in registry, it'll be created.
|
|
69
|
-
* @param target
|
|
70
|
-
* @param options
|
|
71
|
-
*/
|
|
72
|
-
function getSchema(target, options = {}) {
|
|
73
|
-
const store = core_1.Store.from(target);
|
|
74
|
-
if (!store.has(constants_js_1.MONGOOSE_SCHEMA)) {
|
|
75
|
-
createSchema(target, options);
|
|
76
|
-
}
|
|
77
|
-
return store.get(constants_js_1.MONGOOSE_SCHEMA);
|
|
78
|
-
}
|
|
79
|
-
exports.getSchema = getSchema;
|
|
80
|
-
function getSchemaToken(target, options) {
|
|
81
|
-
const collectionName = options.name || (0, core_1.nameOf)(target);
|
|
82
|
-
const token = Symbol.for((0, change_case_1.pascalCase)(`${collectionName}Schema`));
|
|
83
|
-
return { token, collectionName };
|
|
84
|
-
}
|
|
85
|
-
exports.getSchemaToken = getSchemaToken;
|
|
86
|
-
/**
|
|
87
|
-
* @ignore
|
|
88
|
-
*/
|
|
89
|
-
function buildMongooseSchema(target) {
|
|
90
|
-
const properties = (0, schema_1.getProperties)(target, { withIgnoredProps: true, mongoose: true, groups: false });
|
|
91
|
-
const schema = { schema: {}, virtuals: new Map() };
|
|
92
|
-
properties.forEach((propertyMetadata, key) => {
|
|
93
|
-
// Keeping the Mongoose Schema separate, so it can overwrite everything once schema has been built.
|
|
94
|
-
const schemaTypeOptions = propertyMetadata.store.get(constants_js_1.MONGOOSE_SCHEMA) || {};
|
|
95
|
-
if (schemaTypeOptions.schemaIgnore || propertyMetadata.isDiscriminatorKey() || propertyMetadata.isGetterOnly()) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (schemaTypeOptions.ref) {
|
|
99
|
-
schemaTypeOptions.ref = (0, resolveRefType_js_1.resolveRefType)(schemaTypeOptions.ref);
|
|
100
|
-
}
|
|
101
|
-
if (isVirtualRef(schemaTypeOptions)) {
|
|
102
|
-
schema.virtuals.set(key, schemaTypeOptions);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
schema.schema[key] = createSchemaTypeOptions(propertyMetadata);
|
|
106
|
-
});
|
|
107
|
-
return schema;
|
|
108
|
-
}
|
|
109
|
-
exports.buildMongooseSchema = buildMongooseSchema;
|
|
110
|
-
/**
|
|
111
|
-
* @ignore
|
|
112
|
-
*/
|
|
113
|
-
function createSchemaTypeOptions(propEntity) {
|
|
114
|
-
const key = propEntity.propertyKey;
|
|
115
|
-
const rawMongooseSchema = propEntity.store.get(constants_js_1.MONGOOSE_SCHEMA) || {};
|
|
116
|
-
let schemaTypeOptions = {
|
|
117
|
-
required: propEntity.required
|
|
118
|
-
? function () {
|
|
119
|
-
return propEntity.isRequired(this[key]);
|
|
120
|
-
}
|
|
121
|
-
: false
|
|
122
|
-
};
|
|
123
|
-
if (!propEntity.isClass) {
|
|
124
|
-
const jsonSchema = propEntity.itemSchema.toJSON();
|
|
125
|
-
const { minimum: min, maximum: max, minLength: minlength, maxLength: maxlength } = jsonSchema;
|
|
126
|
-
let match = jsonSchema.pattern;
|
|
127
|
-
if (match) {
|
|
128
|
-
match = new RegExp(match);
|
|
129
|
-
}
|
|
130
|
-
schemaTypeOptions = {
|
|
131
|
-
...schemaTypeOptions,
|
|
132
|
-
type: propEntity.type,
|
|
133
|
-
match: match,
|
|
134
|
-
min,
|
|
135
|
-
max,
|
|
136
|
-
minlength,
|
|
137
|
-
maxlength,
|
|
138
|
-
enum: /*jsonSchema["enum"] instanceof JsonSchema ? jsonSchema["enum"].toJSON().enum :*/ jsonSchema["enum"],
|
|
139
|
-
default: jsonSchema["default"]
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
else if (!rawMongooseSchema.ref) {
|
|
143
|
-
// References are handled by the final merge
|
|
144
|
-
schemaTypeOptions = { ...schemaTypeOptions, type: getSchema(propEntity.type) };
|
|
145
|
-
}
|
|
146
|
-
schemaTypeOptions = (0, core_1.cleanObject)({ ...schemaTypeOptions, ...rawMongooseSchema });
|
|
147
|
-
if (propEntity.isCollection) {
|
|
148
|
-
if (propEntity.isArray) {
|
|
149
|
-
return [schemaTypeOptions];
|
|
150
|
-
}
|
|
151
|
-
// Can be a Map or a Set;
|
|
152
|
-
// Mongoose implements only Map;
|
|
153
|
-
if (propEntity.collectionType !== Map) {
|
|
154
|
-
throw new Error(`Invalid collection type. ${(0, core_1.nameOf)(propEntity.collectionType)} is not supported.`);
|
|
155
|
-
}
|
|
156
|
-
return { type: Map, of: schemaTypeOptions };
|
|
157
|
-
}
|
|
158
|
-
return schemaTypeOptions;
|
|
159
|
-
}
|
|
160
|
-
exports.createSchemaTypeOptions = createSchemaTypeOptions;
|
|
161
|
-
//# sourceMappingURL=createSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSchema.js","sourceRoot":"","sources":["../../../src/utils/createSchema.ts"],"names":[],"mappings":";;;;AAAA,qCAA4D;AAC5D,mDAAyD;AACzD,yCAAwE;AACxE,6CAAuC;AACvC,gEAA8F;AAC9F,4DAAmF;AAGnF,2DAAmD;AACnD,yDAAiD;AAOjD;;GAEG;AACH,SAAS,WAAW,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAyB,EAAE,OAAuB;IACtF,MAAM,cAAc,GAAG,IAAI,kBAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;QAC/C,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACtC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,MAA0C;IAC9D,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,eAAe,CAAC,MAAuB,EAAE,UAA6B;IAC7E,8CAA8C;IAC9C,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAE9B,gDAAgD;IAChD,OAAQ,UAAqB,IAAI,MAAM,CAAC,KAAK,CAAC;AAChD,CAAC;AAED,SAAgB,YAAY,CAAC,MAAiB,EAAE,UAAiC,EAAE;IACjF,MAAM,MAAM,GAAG,wBAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,sCAAuB,CAAC,IAAI,EAAE,CAAC;IAC/E,OAAO,CAAC,aAAa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AAI;YACrB,KAAK,EAAE,KAAe;YACtB,GAAG;YACH,GAAG;YACH,SAAS;YACT,SAAS;YACT,IAAI,EAAE,iFAAiF,CAAC,UAAU,CAAC,MAAM,CAAC;YAC1G,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC;SAC/B,CAAC;KACH;SAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE;QACjC,4CAA4C;QAC5C,iBAAiB,GAAG,EAAC,GAAG,iBAAiB,EAAE,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAQ,EAAC,CAAC;KACrF;IAED,iBAAiB,GAAG,IAAA,kBAAW,EAAC,EAAC,GAAG,iBAAiB,EAAE,GAAG,iBAAiB,EAAC,CAAC,CAAC;IAE9E,IAAI,UAAU,CAAC,YAAY,EAAE;QAC3B,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,OAAO,CAAC,iBAAiB,CAAC,CAAC;SAC5B;QACD,yBAAyB;QACzB,gCAAgC;QAChC,IAAI,UAAU,CAAC,cAAc,KAAK,GAAG,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAA,aAAM,EAAC,UAAU,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;SACpG;QAED,OAAO,EAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,iBAAiB,EAAoC,CAAC;KAC9E;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AArDD,0DAqDC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveRefType = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const constants_js_1 = require("../constants/constants.js");
|
|
6
|
-
/**
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
function resolveRefType(type) {
|
|
10
|
-
if ((0, core_1.isString)(type)) {
|
|
11
|
-
return type;
|
|
12
|
-
}
|
|
13
|
-
if (!(0, core_1.isClass)(type)) {
|
|
14
|
-
type = type();
|
|
15
|
-
}
|
|
16
|
-
return core_1.Store.from(type).get(constants_js_1.MONGOOSE_MODEL_NAME) || (0, core_1.nameOf)(type);
|
|
17
|
-
}
|
|
18
|
-
exports.resolveRefType = resolveRefType;
|
|
19
|
-
//# sourceMappingURL=resolveRefType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRefType.js","sourceRoot":"","sources":["../../../src/utils/resolveRefType.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,4DAA8D;AAE9D;;GAEG;AACH,SAAgB,cAAc,CAAC,IAA4C;IACzE,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,CAAC,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;QAClB,IAAI,GAAI,IAAY,EAAE,CAAC;KACxB;IAED,OAAO,YAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,kCAAmB,CAAC,IAAI,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAVD,wCAUC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applySchemaOptions = exports.buildPreHook = exports.schemaOptions = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
const constants_js_1 = require("../constants/constants.js");
|
|
6
|
-
/**
|
|
7
|
-
* @ignore
|
|
8
|
-
*/
|
|
9
|
-
function schemaOptions(target, options) {
|
|
10
|
-
const store = core_1.Store.from(target);
|
|
11
|
-
if (!store.has(constants_js_1.MONGOOSE_SCHEMA_OPTIONS)) {
|
|
12
|
-
store.set(constants_js_1.MONGOOSE_SCHEMA_OPTIONS, {});
|
|
13
|
-
}
|
|
14
|
-
if (options) {
|
|
15
|
-
store.set(constants_js_1.MONGOOSE_SCHEMA_OPTIONS, (0, core_1.deepMerge)(store.get(constants_js_1.MONGOOSE_SCHEMA_OPTIONS), options));
|
|
16
|
-
}
|
|
17
|
-
return store.get(constants_js_1.MONGOOSE_SCHEMA_OPTIONS);
|
|
18
|
-
}
|
|
19
|
-
exports.schemaOptions = schemaOptions;
|
|
20
|
-
function mapHookArgs(hook) {
|
|
21
|
-
return [hook.method, hook.options || hook.fn, hook.options ? hook.fn : undefined].filter(Boolean);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @ignore
|
|
25
|
-
*/
|
|
26
|
-
function buildPreHook(fn) {
|
|
27
|
-
return fn.length === 1
|
|
28
|
-
? function () {
|
|
29
|
-
return fn(this);
|
|
30
|
-
}
|
|
31
|
-
: function (next) {
|
|
32
|
-
return fn(this, next);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
exports.buildPreHook = buildPreHook;
|
|
36
|
-
/**
|
|
37
|
-
* @ignore
|
|
38
|
-
*/
|
|
39
|
-
function applySchemaOptions(schema, options) {
|
|
40
|
-
if (options.plugins) {
|
|
41
|
-
options.plugins.forEach((item) => schema.plugin(item.plugin, item.options));
|
|
42
|
-
}
|
|
43
|
-
if (options.indexes) {
|
|
44
|
-
options.indexes.forEach((item) => schema.index(item.fields, item.options));
|
|
45
|
-
}
|
|
46
|
-
if (options.pre) {
|
|
47
|
-
options.pre.forEach((item) => {
|
|
48
|
-
item = {
|
|
49
|
-
...item,
|
|
50
|
-
fn: buildPreHook(item.fn)
|
|
51
|
-
};
|
|
52
|
-
schema.pre(...mapHookArgs(item));
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (options.post) {
|
|
56
|
-
options.post.forEach((item) => schema.post(...mapHookArgs(item)));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.applySchemaOptions = applySchemaOptions;
|
|
60
|
-
//# sourceMappingURL=schemaOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-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,OAAO,EAAE;QACnB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;KAC7E;IAED,IAAI,OAAO,CAAC,OAAO,EAAE;QACnB,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;KAC5E;IAED,IAAI,OAAO,CAAC,GAAG,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC3B,IAAI,GAAG;gBACL,GAAG,IAAI;gBACP,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;aAC1B,CAAC;YAED,MAAM,CAAC,GAAW,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;KACJ;IAED,IAAI,OAAO,CAAC,IAAI,EAAE;QAChB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAE,MAAM,CAAC,IAAY,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAC5E;AACH,CAAC;AAvBD,gDAuBC"}
|
package/lib/esm/package.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Configuration, OnInit } from "@tsed/di";
|
|
2
|
-
import { OnDestroy } from "@tsed/di";
|
|
3
|
-
import { MongooseService } from "./services/MongooseService.js";
|
|
4
|
-
/**
|
|
5
|
-
* @ignore
|
|
6
|
-
*/
|
|
7
|
-
export declare class MongooseModule implements OnDestroy, OnInit {
|
|
8
|
-
private mongooseService;
|
|
9
|
-
private settings;
|
|
10
|
-
constructor(mongooseService: MongooseService, settings: Configuration);
|
|
11
|
-
$onInit(): void | Promise<any>;
|
|
12
|
-
$onDestroy(): Promise<any> | void;
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @type {string}
|
|
4
|
-
*/
|
|
5
|
-
export declare const MONGOOSE_SCHEMA = "tsed:mongoose:schema";
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @type {string}
|
|
9
|
-
*/
|
|
10
|
-
export declare const MONGOOSE_SCHEMA_OPTIONS = "tsed:mongoose:schema:options";
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
export declare const MONGOOSE_MODEL = "tsed:mongoose:model";
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @type {string}
|
|
19
|
-
*/
|
|
20
|
-
export declare const MONGOOSE_MODEL_NAME = "tsed:mongoose:model:name";
|