@stingerloom/orm 0.1.2 → 0.2.1
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/README.md +139 -30
- package/dist/core/EntityManager.d.ts +2 -0
- package/dist/core/EntityManager.d.ts.map +1 -1
- package/dist/core/EntityManager.js +35 -0
- package/dist/core/EntityManager.js.map +1 -1
- package/dist/core/generators/SchemaGenerator.d.ts.map +1 -1
- package/dist/core/generators/SchemaGenerator.js +4 -0
- package/dist/core/generators/SchemaGenerator.js.map +1 -1
- package/dist/decorators/Column.d.ts +1 -1
- package/dist/decorators/Column.d.ts.map +1 -1
- package/dist/decorators/Column.js.map +1 -1
- package/dist/decorators/CreateTimestamp.d.ts +3 -0
- package/dist/decorators/CreateTimestamp.d.ts.map +1 -0
- package/dist/decorators/CreateTimestamp.js +16 -0
- package/dist/decorators/CreateTimestamp.js.map +1 -0
- package/dist/decorators/UpdateTimestamp.d.ts +3 -0
- package/dist/decorators/UpdateTimestamp.d.ts.map +1 -0
- package/dist/decorators/UpdateTimestamp.js +16 -0
- package/dist/decorators/UpdateTimestamp.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.d.ts.map +1 -1
- package/dist/decorators/index.js +2 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/dialects/mysql/MySqlDriver.d.ts.map +1 -1
- package/dist/dialects/mysql/MySqlDriver.js +2 -0
- package/dist/dialects/mysql/MySqlDriver.js.map +1 -1
- package/dist/dialects/postgres/PostgresDriver.d.ts.map +1 -1
- package/dist/dialects/postgres/PostgresDriver.js +2 -0
- package/dist/dialects/postgres/PostgresDriver.js.map +1 -1
- package/dist/dialects/sqlite/SqliteDriver.d.ts.map +1 -1
- package/dist/dialects/sqlite/SqliteDriver.js +1 -0
- package/dist/dialects/sqlite/SqliteDriver.js.map +1 -1
- package/dist/integration/nestjs/index.d.ts +5 -0
- package/dist/integration/nestjs/index.d.ts.map +1 -0
- package/dist/integration/nestjs/index.js +16 -0
- package/dist/integration/nestjs/index.js.map +1 -0
- package/dist/integration/nestjs/inject-repository.decorator.d.ts +3 -0
- package/dist/integration/nestjs/inject-repository.decorator.d.ts.map +1 -0
- package/dist/integration/nestjs/inject-repository.decorator.js +10 -0
- package/dist/integration/nestjs/inject-repository.decorator.js.map +1 -0
- package/dist/integration/nestjs/stingerloom-orm-core.module.d.ts +6 -0
- package/dist/integration/nestjs/stingerloom-orm-core.module.d.ts.map +1 -0
- package/dist/integration/nestjs/stingerloom-orm-core.module.js +35 -0
- package/dist/integration/nestjs/stingerloom-orm-core.module.js.map +1 -0
- package/dist/integration/nestjs/stingerloom-orm.module.d.ts +11 -0
- package/dist/integration/nestjs/stingerloom-orm.module.d.ts.map +1 -0
- package/dist/integration/nestjs/stingerloom-orm.module.js +58 -0
- package/dist/integration/nestjs/stingerloom-orm.module.js.map +1 -0
- package/dist/integration/nestjs/stingerloom-orm.service.d.ts +18 -0
- package/dist/integration/nestjs/stingerloom-orm.service.d.ts.map +1 -0
- package/dist/integration/nestjs/stingerloom-orm.service.js +70 -0
- package/dist/integration/nestjs/stingerloom-orm.service.js.map +1 -0
- package/dist/metadata/MetadataContext.d.ts.map +1 -1
- package/dist/metadata/MetadataContext.js +3 -1
- package/dist/metadata/MetadataContext.js.map +1 -1
- package/package.json +29 -13
|
@@ -12,7 +12,9 @@ class MetadataContext {
|
|
|
12
12
|
return store?.tenantId ?? "public";
|
|
13
13
|
}
|
|
14
14
|
static isActive() {
|
|
15
|
-
|
|
15
|
+
const store = this.storage.getStore();
|
|
16
|
+
const isActive = store !== undefined;
|
|
17
|
+
return isActive;
|
|
16
18
|
}
|
|
17
19
|
static reset() {
|
|
18
20
|
this.storage = new async_hooks_1.AsyncLocalStorage();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetadataContext.js","sourceRoot":"","sources":["../../src/metadata/MetadataContext.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAuBhD,MAAa,eAAe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6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stingerloom/orm",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A standalone, framework-agnostic TypeScript ORM that can be used with any Node.js framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"require": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./nestjs": {
|
|
13
|
+
"types": "./dist/integration/nestjs/index.d.ts",
|
|
14
|
+
"require": "./dist/integration/nestjs/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"typesVersions": {
|
|
18
|
+
"*": {
|
|
19
|
+
"nestjs": [
|
|
20
|
+
"dist/integration/nestjs/index.d.ts"
|
|
21
|
+
]
|
|
11
22
|
}
|
|
12
23
|
},
|
|
13
24
|
"files": [
|
|
@@ -32,21 +43,18 @@
|
|
|
32
43
|
"multi-tenancy",
|
|
33
44
|
"stingerloom"
|
|
34
45
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "rimraf dist && tsc",
|
|
37
|
-
"prepublishOnly": "pnpm run build",
|
|
38
|
-
"test": "jest"
|
|
39
|
-
},
|
|
40
46
|
"dependencies": {
|
|
41
47
|
"class-transformer": "^0.5.1",
|
|
42
48
|
"sql-template-tag": "^4.0.0",
|
|
43
49
|
"typedi": "^0.10.0"
|
|
44
50
|
},
|
|
45
51
|
"peerDependencies": {
|
|
46
|
-
"
|
|
52
|
+
"@nestjs/common": ">=8.0.0",
|
|
53
|
+
"@nestjs/core": ">=8.0.0",
|
|
54
|
+
"better-sqlite3": ">=9.0.0",
|
|
47
55
|
"mysql2": "^3.0.0",
|
|
48
56
|
"pg": "^8.0.0",
|
|
49
|
-
"
|
|
57
|
+
"reflect-metadata": ">=0.1.0"
|
|
50
58
|
},
|
|
51
59
|
"peerDependenciesMeta": {
|
|
52
60
|
"mysql2": {
|
|
@@ -57,9 +65,17 @@
|
|
|
57
65
|
},
|
|
58
66
|
"better-sqlite3": {
|
|
59
67
|
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"@nestjs/common": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"@nestjs/core": {
|
|
73
|
+
"optional": true
|
|
60
74
|
}
|
|
61
75
|
},
|
|
62
76
|
"devDependencies": {
|
|
77
|
+
"@nestjs/common": "^10.4.22",
|
|
78
|
+
"@nestjs/core": "^10.4.22",
|
|
63
79
|
"@types/better-sqlite3": "^7.6.13",
|
|
64
80
|
"@types/jest": "^29.5.4",
|
|
65
81
|
"@types/node": "^20.4.8",
|
|
@@ -70,6 +86,7 @@
|
|
|
70
86
|
"pg": "^8.18.0",
|
|
71
87
|
"reflect-metadata": "^0.2.2",
|
|
72
88
|
"rimraf": "^6.1.2",
|
|
89
|
+
"rxjs": "^7.8.2",
|
|
73
90
|
"ts-jest": "^29.1.1",
|
|
74
91
|
"typescript": "^5.6.2"
|
|
75
92
|
},
|
|
@@ -84,9 +101,8 @@
|
|
|
84
101
|
"publishConfig": {
|
|
85
102
|
"access": "public"
|
|
86
103
|
},
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
]
|
|
104
|
+
"scripts": {
|
|
105
|
+
"build": "rimraf dist && tsc",
|
|
106
|
+
"test": "jest"
|
|
91
107
|
}
|
|
92
|
-
}
|
|
108
|
+
}
|