@fluojs/prisma 1.0.0-beta.3 → 1.0.0-beta.4
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.ko.md +1 -2
- package/README.md +1 -2
- package/dist/module.d.ts +0 -16
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +0 -28
- package/package.json +4 -4
package/README.ko.md
CHANGED
|
@@ -83,7 +83,7 @@ export class UserRepository {
|
|
|
83
83
|
import { Inject } from '@fluojs/core';
|
|
84
84
|
import { PrismaModule, PrismaService, getPrismaServiceToken } from '@fluojs/prisma';
|
|
85
85
|
|
|
86
|
-
const usersPrismaModule = PrismaModule.
|
|
86
|
+
const usersPrismaModule = PrismaModule.forRoot({ name: 'users', client: usersPrisma });
|
|
87
87
|
const analyticsPrismaModule = PrismaModule.forRoot({ name: 'analytics', client: analyticsPrisma });
|
|
88
88
|
|
|
89
89
|
@Inject(getPrismaServiceToken('users'), getPrismaServiceToken('analytics'))
|
|
@@ -176,7 +176,6 @@ defineModule(ManualPrismaModule, {
|
|
|
176
176
|
### `PrismaModule`
|
|
177
177
|
|
|
178
178
|
- `PrismaModule.forRoot(options)` / `PrismaModule.forRootAsync(options)`
|
|
179
|
-
- `PrismaModule.forName(name, options)` / `PrismaModule.forNameAsync(name, options)`
|
|
180
179
|
- `forRoot(...)`와 `forRootAsync(...)`도 이름 있는/scoped 등록을 위해 `name`을 받을 수 있습니다.
|
|
181
180
|
- `forRootAsync(...)`는 client와 transaction 설정을 factory에서 반환하는 DI-aware Prisma 옵션을 받습니다. 모듈 identity와 visibility가 factory 실행 전에 결정되도록 `name` 또는 `global`은 최상위 async 등록 옵션에 전달하세요.
|
|
182
181
|
- `forRootAsync(...)`는 애플리케이션 컨테이너마다 옵션을 한 번 resolve하여, 별도 bootstrap 사이에서 클라이언트 라이프사이클과 요청 트랜잭션 격리를 보존합니다.
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ When one application container needs more than one Prisma client, register each
|
|
|
83
83
|
import { Inject } from '@fluojs/core';
|
|
84
84
|
import { PrismaModule, PrismaService, getPrismaServiceToken } from '@fluojs/prisma';
|
|
85
85
|
|
|
86
|
-
const usersPrismaModule = PrismaModule.
|
|
86
|
+
const usersPrismaModule = PrismaModule.forRoot({ name: 'users', client: usersPrisma });
|
|
87
87
|
const analyticsPrismaModule = PrismaModule.forRoot({ name: 'analytics', client: analyticsPrisma });
|
|
88
88
|
|
|
89
89
|
@Inject(getPrismaServiceToken('users'), getPrismaServiceToken('analytics'))
|
|
@@ -176,7 +176,6 @@ defineModule(ManualPrismaModule, {
|
|
|
176
176
|
### `PrismaModule`
|
|
177
177
|
|
|
178
178
|
- `PrismaModule.forRoot(options)` / `PrismaModule.forRootAsync(options)`
|
|
179
|
-
- `PrismaModule.forName(name, options)` / `PrismaModule.forNameAsync(name, options)`
|
|
180
179
|
- `forRoot(...)` and `forRootAsync(...)` also accept `name` for named/scoped registrations.
|
|
181
180
|
- `forRootAsync(...)` accepts DI-aware Prisma options whose factory returns the client and transaction settings; pass `name` or `global` on the top-level async registration so module identity and visibility are decided before the factory runs.
|
|
182
181
|
- `forRootAsync(...)` resolves options once per application container, preserving client lifecycle and request transaction isolation across separate bootstraps.
|
package/dist/module.d.ts
CHANGED
|
@@ -9,14 +9,6 @@ type PrismaAsyncModuleOptions<TClient extends PrismaClientLike<TTransactionClien
|
|
|
9
9
|
* Runtime module entrypoint for Prisma lifecycle and transaction wiring.
|
|
10
10
|
*/
|
|
11
11
|
export declare class PrismaModule {
|
|
12
|
-
/**
|
|
13
|
-
* Registers Prisma providers from static options under an explicit name.
|
|
14
|
-
*
|
|
15
|
-
* @param name Registration name used to generate isolated Prisma DI tokens.
|
|
16
|
-
* @param options Prisma module options with client handle and strict transaction mode.
|
|
17
|
-
* @returns A module definition that exports the named Prisma tokens.
|
|
18
|
-
*/
|
|
19
|
-
static forName<TClient extends PrismaClientLike<TTransactionClient, TTransactionOptions>, TTransactionClient = InferPrismaTransactionClient<TClient>, TTransactionOptions = InferPrismaTransactionOptions<TClient>>(name: string, options: Omit<PrismaModuleOptions<TClient, TTransactionClient, TTransactionOptions>, 'name'>): ModuleType;
|
|
20
12
|
/**
|
|
21
13
|
* Registers Prisma providers from static options.
|
|
22
14
|
*
|
|
@@ -24,14 +16,6 @@ export declare class PrismaModule {
|
|
|
24
16
|
* @returns A module definition that exports `PrismaService` and `PrismaTransactionInterceptor`.
|
|
25
17
|
*/
|
|
26
18
|
static forRoot<TClient extends PrismaClientLike<TTransactionClient, TTransactionOptions>, TTransactionClient = InferPrismaTransactionClient<TClient>, TTransactionOptions = InferPrismaTransactionOptions<TClient>>(options: PrismaModuleOptions<TClient, TTransactionClient, TTransactionOptions>): ModuleType;
|
|
27
|
-
/**
|
|
28
|
-
* Registers Prisma providers from an async DI factory under an explicit name.
|
|
29
|
-
*
|
|
30
|
-
* @param name Registration name used to generate isolated Prisma DI tokens.
|
|
31
|
-
* @param options Async module options that resolve Prisma client/module configuration.
|
|
32
|
-
* @returns A module definition that resolves async options once per application container.
|
|
33
|
-
*/
|
|
34
|
-
static forNameAsync<TClient extends PrismaClientLike<TTransactionClient, TTransactionOptions>, TTransactionClient = InferPrismaTransactionClient<TClient>, TTransactionOptions = InferPrismaTransactionOptions<TClient>>(name: string, options: AsyncModuleOptions<Omit<PrismaModuleOptions<TClient, TTransactionClient, TTransactionOptions>, 'global' | 'name'>>): ModuleType;
|
|
35
19
|
/**
|
|
36
20
|
* Registers Prisma providers from an async DI factory.
|
|
37
21
|
*
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,kBAAkB,EAAc,MAAM,cAAc,CAAC;AAE3E,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAShE,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7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BAA6B,CAAC,OAAO,CAAC,EAE5D,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,GAC7E,UAAU;IAIb;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,OAAO,SAAS,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EACzE,kBAAkB,GAAG,4BAA4B,CAAC,OAAO,CAAC,EAC1D,mBAAmB,GAAG,6BAA6B,CAAC,OAAO,CAAC,EAE5D,OAAO,EAAE,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,GAClF,UAAU;CAGd"}
|
package/dist/module.js
CHANGED
|
@@ -102,20 +102,6 @@ function buildPrismaModuleAsync(options) {
|
|
|
102
102
|
* Runtime module entrypoint for Prisma lifecycle and transaction wiring.
|
|
103
103
|
*/
|
|
104
104
|
export class PrismaModule {
|
|
105
|
-
/**
|
|
106
|
-
* Registers Prisma providers from static options under an explicit name.
|
|
107
|
-
*
|
|
108
|
-
* @param name Registration name used to generate isolated Prisma DI tokens.
|
|
109
|
-
* @param options Prisma module options with client handle and strict transaction mode.
|
|
110
|
-
* @returns A module definition that exports the named Prisma tokens.
|
|
111
|
-
*/
|
|
112
|
-
static forName(name, options) {
|
|
113
|
-
return buildPrismaModule({
|
|
114
|
-
...options,
|
|
115
|
-
name
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
105
|
/**
|
|
120
106
|
* Registers Prisma providers from static options.
|
|
121
107
|
*
|
|
@@ -126,20 +112,6 @@ export class PrismaModule {
|
|
|
126
112
|
return buildPrismaModule(options);
|
|
127
113
|
}
|
|
128
114
|
|
|
129
|
-
/**
|
|
130
|
-
* Registers Prisma providers from an async DI factory under an explicit name.
|
|
131
|
-
*
|
|
132
|
-
* @param name Registration name used to generate isolated Prisma DI tokens.
|
|
133
|
-
* @param options Async module options that resolve Prisma client/module configuration.
|
|
134
|
-
* @returns A module definition that resolves async options once per application container.
|
|
135
|
-
*/
|
|
136
|
-
static forNameAsync(name, options) {
|
|
137
|
-
return buildPrismaModuleAsync({
|
|
138
|
-
...options,
|
|
139
|
-
name
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
|
|
143
115
|
/**
|
|
144
116
|
* Registers Prisma providers from an async DI factory.
|
|
145
117
|
*
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"transaction",
|
|
10
10
|
"als"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.0-beta.
|
|
12
|
+
"version": "1.0.0-beta.4",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@fluojs/core": "^1.0.0-beta.4",
|
|
40
|
-
"@fluojs/validation": "^1.0.0-beta.3",
|
|
41
40
|
"@fluojs/http": "^1.0.0-beta.10",
|
|
42
|
-
"@fluojs/
|
|
43
|
-
"@fluojs/runtime": "^1.0.0-beta.11"
|
|
41
|
+
"@fluojs/validation": "^1.0.0-beta.3",
|
|
42
|
+
"@fluojs/runtime": "^1.0.0-beta.11",
|
|
43
|
+
"@fluojs/di": "^1.0.0-beta.6"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@prisma/client": ">=5.0.0"
|