@akanjs/nest 0.0.10 → 0.0.11
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/package.json +2 -1
- package/src/databaseClient.d.ts +5 -0
- package/src/databaseClient.js +51 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/nest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"@nestjs/common": "10.4.15",
|
|
18
18
|
"@nestjs/core": "10.4.15",
|
|
19
19
|
"@nestjs/graphql": "12.2.2",
|
|
20
|
+
"@nestjs/mongoose": "10.1.0",
|
|
20
21
|
"@nestjs/passport": "10.0.3",
|
|
21
22
|
"@nestjs/platform-express": "10.4.15",
|
|
22
23
|
"@nestjs/platform-socket.io": "10.4.15",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
19
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
20
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
|
+
if (decorator = decorators[i])
|
|
22
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23
|
+
if (kind && result)
|
|
24
|
+
__defProp(target, key, result);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
var databaseClient_exports = {};
|
|
28
|
+
__export(databaseClient_exports, {
|
|
29
|
+
DatabaseClient: () => DatabaseClient
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(databaseClient_exports);
|
|
32
|
+
var import_common = require("@akanjs/common");
|
|
33
|
+
var import_common2 = require("@nestjs/common");
|
|
34
|
+
var import_mongoose = require("@nestjs/mongoose");
|
|
35
|
+
let DatabaseClient = class {
|
|
36
|
+
connection;
|
|
37
|
+
getModel(modelName) {
|
|
38
|
+
const model = this.connection.models[(0, import_common.capitalize)(modelName)];
|
|
39
|
+
return model;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__decorateClass([
|
|
43
|
+
(0, import_mongoose.InjectConnection)()
|
|
44
|
+
], DatabaseClient.prototype, "connection", 2);
|
|
45
|
+
DatabaseClient = __decorateClass([
|
|
46
|
+
(0, import_common2.Injectable)()
|
|
47
|
+
], DatabaseClient);
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
DatabaseClient
|
|
51
|
+
});
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -50,6 +50,7 @@ __reExport(src_exports, require("./generateSecrets"), module.exports);
|
|
|
50
50
|
__reExport(src_exports, require("./mongoose"), module.exports);
|
|
51
51
|
__reExport(src_exports, require("./searchClient"), module.exports);
|
|
52
52
|
__reExport(src_exports, require("./cacheClient"), module.exports);
|
|
53
|
+
__reExport(src_exports, require("./databaseClient"), module.exports);
|
|
53
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
54
55
|
0 && (module.exports = {
|
|
55
56
|
Exporter,
|
|
@@ -68,5 +69,6 @@ __reExport(src_exports, require("./cacheClient"), module.exports);
|
|
|
68
69
|
...require("./generateSecrets"),
|
|
69
70
|
...require("./mongoose"),
|
|
70
71
|
...require("./searchClient"),
|
|
71
|
-
...require("./cacheClient")
|
|
72
|
+
...require("./cacheClient"),
|
|
73
|
+
...require("./databaseClient")
|
|
72
74
|
});
|