@tsed/adapters 8.0.0-rc.5 → 8.0.0-rc.6
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,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Inject, Injectable, InjectorService } from "@tsed/di";
|
|
1
|
+
import { constant, inject, injectable } from "@tsed/di";
|
|
3
2
|
import { MemoryAdapter } from "../adapters/MemoryAdapter.js";
|
|
4
|
-
|
|
3
|
+
export class Adapters {
|
|
5
4
|
invokeAdapter(options) {
|
|
6
|
-
const { adapter =
|
|
7
|
-
return
|
|
5
|
+
const { adapter = constant("adapters.Adapter", MemoryAdapter), ...props } = options;
|
|
6
|
+
return inject(adapter, {
|
|
8
7
|
useOpts: props
|
|
9
8
|
});
|
|
10
9
|
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
Inject(),
|
|
14
|
-
__metadata("design:type", InjectorService)
|
|
15
|
-
], Adapters.prototype, "injector", void 0);
|
|
16
|
-
Adapters = __decorate([
|
|
17
|
-
Injectable()
|
|
18
|
-
], Adapters);
|
|
19
|
-
export { Adapters };
|
|
10
|
+
}
|
|
11
|
+
injectable(Adapters);
|
|
20
12
|
//# sourceMappingURL=Adapters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Adapters.js","sourceRoot":"","sources":["../../../src/services/Adapters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Adapters.js","sourceRoot":"","sources":["../../../src/services/Adapters.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAO3D,MAAM,OAAO,QAAQ;IACnB,aAAa,CAAU,OAA6B;QAClD,MAAM,EAAC,OAAO,GAAG,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAAE,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;QAElF,OAAO,MAAM,CAAa,OAAO,EAAE;YACjC,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;IACL,CAAC;CACF;AAED,UAAU,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
|
-
import { InjectorService } from "@tsed/di";
|
|
3
2
|
import { Adapter, AdapterConstructorOptions } from "../domain/Adapter.js";
|
|
4
3
|
export interface AdapterInvokeOptions<Model = any> extends AdapterConstructorOptions<Model> {
|
|
5
4
|
adapter?: Type<Adapter<Model>>;
|
|
6
5
|
}
|
|
7
6
|
export declare class Adapters {
|
|
8
|
-
injector: InjectorService;
|
|
9
7
|
invokeAdapter<T = any>(options: AdapterInvokeOptions): Adapter<T>;
|
|
10
8
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/adapters",
|
|
3
3
|
"description": "Database adapters for Ts.ED",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.0.0-rc.
|
|
5
|
+
"version": "8.0.0-rc.6",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -32,26 +32,26 @@
|
|
|
32
32
|
"uuid": "^10.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@tsed/ajv": "8.0.0-rc.
|
|
36
|
-
"@tsed/barrels": "8.0.0-rc.
|
|
37
|
-
"@tsed/core": "8.0.0-rc.
|
|
38
|
-
"@tsed/di": "8.0.0-rc.
|
|
39
|
-
"@tsed/json-mapper": "8.0.0-rc.
|
|
40
|
-
"@tsed/platform-http": "8.0.0-rc.
|
|
41
|
-
"@tsed/schema": "8.0.0-rc.
|
|
42
|
-
"@tsed/typescript": "8.0.0-rc.
|
|
35
|
+
"@tsed/ajv": "8.0.0-rc.6",
|
|
36
|
+
"@tsed/barrels": "8.0.0-rc.6",
|
|
37
|
+
"@tsed/core": "8.0.0-rc.6",
|
|
38
|
+
"@tsed/di": "8.0.0-rc.6",
|
|
39
|
+
"@tsed/json-mapper": "8.0.0-rc.6",
|
|
40
|
+
"@tsed/platform-http": "8.0.0-rc.6",
|
|
41
|
+
"@tsed/schema": "8.0.0-rc.6",
|
|
42
|
+
"@tsed/typescript": "8.0.0-rc.6",
|
|
43
43
|
"@types/fs-extra": "11.0.4",
|
|
44
44
|
"eslint": "9.12.0",
|
|
45
45
|
"typescript": "5.4.5",
|
|
46
46
|
"vitest": "2.1.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@tsed/ajv": "8.0.0-rc.
|
|
50
|
-
"@tsed/core": "8.0.0-rc.
|
|
51
|
-
"@tsed/di": "8.0.0-rc.
|
|
52
|
-
"@tsed/json-mapper": "8.0.0-rc.
|
|
53
|
-
"@tsed/platform-http": "8.0.0-rc.
|
|
54
|
-
"@tsed/schema": "8.0.0-rc.
|
|
49
|
+
"@tsed/ajv": "8.0.0-rc.6",
|
|
50
|
+
"@tsed/core": "8.0.0-rc.6",
|
|
51
|
+
"@tsed/di": "8.0.0-rc.6",
|
|
52
|
+
"@tsed/json-mapper": "8.0.0-rc.6",
|
|
53
|
+
"@tsed/platform-http": "8.0.0-rc.6",
|
|
54
|
+
"@tsed/schema": "8.0.0-rc.6"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"@tsed/ajv": {
|
package/vitest.config.mts
CHANGED
|
@@ -10,10 +10,10 @@ export default defineConfig(
|
|
|
10
10
|
coverage: {
|
|
11
11
|
...presets.test.coverage,
|
|
12
12
|
thresholds: {
|
|
13
|
-
statements:
|
|
14
|
-
branches:
|
|
15
|
-
functions:
|
|
16
|
-
lines:
|
|
13
|
+
statements: 99.17,
|
|
14
|
+
branches: 98.48,
|
|
15
|
+
functions: 96.66,
|
|
16
|
+
lines: 99.17
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|