@fluojs/prisma 1.0.0-beta.3 → 1.0.0-beta.5

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 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.forName('users', { client: usersPrisma });
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'))
@@ -114,6 +114,8 @@ await this.prisma.transaction(async () => {
114
114
  });
115
115
  ```
116
116
 
117
+ 이미 활성 트랜잭션 컨텍스트가 있는 상태에서 `transaction()`을 호출하면 `PrismaService`는 중첩 Prisma 트랜잭션을 새로 열지 않고 활성 트랜잭션 클라이언트를 재사용합니다. 중첩 호출에는 isolation level 같은 트랜잭션 옵션을 전달하면 안 됩니다. 활성 컨텍스트에서 옵션을 제공하면 ambient transaction을 재사용하는 동안 호출자의 의도를 조용히 버리지 않도록 예외로 거부합니다.
118
+
117
119
  ### 자동 요청 트랜잭션
118
120
 
119
121
  컨트롤러나 메서드에 `PrismaTransactionInterceptor`를 적용하면 전체 요청을 자동으로 트랜잭션으로 감쌉니다.
@@ -176,7 +178,6 @@ defineModule(ManualPrismaModule, {
176
178
  ### `PrismaModule`
177
179
 
178
180
  - `PrismaModule.forRoot(options)` / `PrismaModule.forRootAsync(options)`
179
- - `PrismaModule.forName(name, options)` / `PrismaModule.forNameAsync(name, options)`
180
181
  - `forRoot(...)`와 `forRootAsync(...)`도 이름 있는/scoped 등록을 위해 `name`을 받을 수 있습니다.
181
182
  - `forRootAsync(...)`는 client와 transaction 설정을 factory에서 반환하는 DI-aware Prisma 옵션을 받습니다. 모듈 identity와 visibility가 factory 실행 전에 결정되도록 `name` 또는 `global`은 최상위 async 등록 옵션에 전달하세요.
182
183
  - `forRootAsync(...)`는 애플리케이션 컨테이너마다 옵션을 한 번 resolve하여, 별도 bootstrap 사이에서 클라이언트 라이프사이클과 요청 트랜잭션 격리를 보존합니다.
@@ -189,14 +190,19 @@ defineModule(ManualPrismaModule, {
189
190
  - `current(): TClient | PrismaTransactionClient<TClient>`
190
191
  - 현재 컨텍스트에 맞는 트랜잭션 클라이언트 또는 루트 클라이언트를 반환합니다.
191
192
  - `transaction(fn, options?): Promise<T>`
192
- - 대화형 트랜잭션 내에서 함수를 실행합니다.
193
+ - 대화형 트랜잭션 내에서 함수를 실행합니다. 이미 트랜잭션 컨텍스트가 활성화되어 있으면 callback은 그 컨텍스트를 재사용하며, 새 Prisma 트랜잭션 경계가 열리지 않기 때문에 중첩 트랜잭션 옵션은 거부됩니다.
193
194
  - `requestTransaction(fn, signal?, options?): Promise<T>`
194
- - HTTP 요청 라이프사이클에 특화된 트랜잭션 경계를 실행합니다. Abort를 인식하고, shutdown 중에는 disconnect 전에 열린 요청 트랜잭션을 drain하며, Prisma client가 `signal` 옵션을 거부하면 해당 옵션 없이 재시도합니다.
195
+ - HTTP 요청 라이프사이클에 특화된 트랜잭션 경계를 실행합니다. Abort를 인식하고, shutdown 중에는 disconnect 전에 열린 요청 트랜잭션을 drain하며, Prisma client가 `signal` 옵션을 거부하면 해당 옵션 없이 재시도합니다. `transaction()`과 마찬가지로 중첩 호출은 활성 트랜잭션 컨텍스트를 재사용하고, 트랜잭션 설정을 조용히 무시하지 않도록 중첩 옵션을 거부합니다.
195
196
 
196
197
  ### `PRISMA_CLIENT` (Token)
197
198
 
198
199
  원시 `PrismaClient` 인스턴스를 위한 주입 토큰입니다.
199
200
 
201
+ ### `PRISMA_OPTIONS` (Token)
202
+
203
+ `PrismaService`가 소비하는 공개 런타임 옵션을 위한 주입 토큰이며, 현재 형태는 `{ strictTransactions: boolean }`입니다.
204
+ 이는 등록 identity, client ownership, visibility metadata까지 담는 패키지 내부 정규화 모듈 옵션 토큰보다 의도적으로 좁은 표면이며, 그 내부 토큰은 공개 API가 아닙니다.
205
+
200
206
  ### 플랫폼 status
201
207
 
202
208
  - `createPrismaPlatformStatusSnapshot(input)`: Prisma readiness, health, ownership, ALS 기반 transaction context를 보고하는 persistence platform status snapshot을 생성합니다.
@@ -208,6 +214,7 @@ defineModule(ManualPrismaModule, {
208
214
  - `getPrismaServiceToken(name?)`
209
215
 
210
216
  이 헬퍼들은 `name`이 없으면 기본 이름 없는 토큰을 반환하고, `name`이 있으면 해당 등록 전용 토큰을 반환합니다.
217
+ 이 헬퍼가 이름 있는 등록을 대상으로 삼는 공개 방법이며, 정규화 모듈 옵션 토큰 같은 내부 구현 토큰은 의도적으로 export하지 않습니다.
211
218
 
212
219
  ### 관련 export 타입
213
220
 
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.forName('users', { client: usersPrisma });
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'))
@@ -114,6 +114,8 @@ await this.prisma.transaction(async () => {
114
114
  });
115
115
  ```
116
116
 
117
+ When `transaction()` is called while a transaction context is already active, `PrismaService` reuses the active transaction client instead of opening a nested Prisma transaction. Nested calls must not pass transaction options such as isolation levels; providing options in an active context is rejected so the package does not silently drop caller intent while reusing the ambient transaction.
118
+
117
119
  ### Automatic Request Transactions
118
120
 
119
121
  Apply the `PrismaTransactionInterceptor` to a controller or method to wrap the entire request in a transaction automatically.
@@ -176,7 +178,6 @@ defineModule(ManualPrismaModule, {
176
178
  ### `PrismaModule`
177
179
 
178
180
  - `PrismaModule.forRoot(options)` / `PrismaModule.forRootAsync(options)`
179
- - `PrismaModule.forName(name, options)` / `PrismaModule.forNameAsync(name, options)`
180
181
  - `forRoot(...)` and `forRootAsync(...)` also accept `name` for named/scoped registrations.
181
182
  - `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
183
  - `forRootAsync(...)` resolves options once per application container, preserving client lifecycle and request transaction isolation across separate bootstraps.
@@ -189,14 +190,20 @@ defineModule(ManualPrismaModule, {
189
190
  - `current(): TClient | PrismaTransactionClient<TClient>`
190
191
  - Returns the ambient transaction client or the root client.
191
192
  - `transaction(fn, options?): Promise<T>`
192
- - Runs a function within an interactive transaction.
193
+ - Runs a function within an interactive transaction. If a transaction context is already active, the callback reuses that context; nested transaction options are rejected because no new Prisma transaction boundary is opened.
193
194
  - `requestTransaction(fn, signal?, options?): Promise<T>`
194
- - Specialized transaction boundary for HTTP request lifecycles. It is abort-aware, drains during shutdown before disconnect, and retries without `signal` when a Prisma client rejects that option.
195
+ - Specialized transaction boundary for HTTP request lifecycles. It is abort-aware, drains during shutdown before disconnect, and retries without `signal` when a Prisma client rejects that option. Like `transaction()`, nested calls reuse the active transaction context and reject nested options to avoid silently ignoring transaction settings.
195
196
 
196
197
  ### `PRISMA_CLIENT` (Token)
197
198
 
198
199
  Injectable token for the raw `PrismaClient` instance.
199
200
 
201
+ ### `PRISMA_OPTIONS` (Token)
202
+
203
+ Injectable token for the public runtime options consumed by `PrismaService`, currently `{ strictTransactions: boolean }`.
204
+ This is intentionally narrower than the package's internal normalized module-options token, which also carries registration
205
+ identity, client ownership, and visibility metadata and is not part of the public API.
206
+
200
207
  ### Platform status
201
208
 
202
209
  - `createPrismaPlatformStatusSnapshot(input)`: Creates a persistence platform status snapshot that reports Prisma readiness, health, ownership, and ALS-backed transaction context.
@@ -208,6 +215,8 @@ Injectable token for the raw `PrismaClient` instance.
208
215
  - `getPrismaServiceToken(name?)`
209
216
 
210
217
  These helpers return the default unnamed token when `name` is omitted and a registration-specific token when `name` is provided.
218
+ They are the public way to target named registrations; internal implementation tokens such as the normalized module-options
219
+ token are deliberately not exported.
211
220
 
212
221
  ### Related exported types
213
222
 
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
  *
@@ -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,EAC7B,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAapB,KAAK,wBAAwB,CAC3B,OAAO,SAAS,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EACzE,kBAAkB,EAClB,mBAAmB,IACjB,kBAAkB,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC,GAAG;IACvH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA8KF;;GAEG;AACH,qBAAa,YAAY;IACvB;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CACZ,OAAO,SAAS,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EACzE,kBAAkB,GAAG,4BAA4B,CAAC,OAAO,CAAC,EAC1D,mBAAmB,GAAG,6BAA6B,CAAC,OAAO,CAAC,EAE5D,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,EAAE,MAAM,CAAC,GAC3F,UAAU;IAOb;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,OAAO,SAAS,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,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mBAAmB,IACjB,kBAAkB,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC,GAAG;IACvH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA8KF;;GAEG;AACH,qBAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CACZ,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,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
  *
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAK3E,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAKpB,UAAU,oBAAoB;IAC5B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAcD;;;;;;GAMG;AACH,qBACa,aAAa,CACxB,OAAO,SAAS,gBAAgB,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EACzE,kBAAkB,GAAG,4BAA4B,CAAC,OAAO,CAAC,EAC1D,mBAAmB,GAAG,6BAA6B,CAAC,OAAO,CAAC,CAE5D,YAAW,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,EAAE,YAAY,EAAE,qBAAqB;IAQpH,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAPjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA+C;IAC5E,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAuC;IACjF,OAAO,CAAC,6BAA6B,CAA4C;IACjF,OAAO,CAAC,cAAc,CAAgE;gBAGnE,MAAM,EAAE,OAAO,EACf,cAAc,GAAE,oBAAoD;IAGvF;;;;;;;;;OASG;IACH,OAA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async requestTransaction(fn, signal, options) {
141
141
  const abortContext = createRequestAbortContext(signal);
142
142
  const active = this.trackActiveRequestTransaction(abortContext.controller);
143
- const transactionPromise = this.runWithTransactionClient(() => raceWithAbort(fn, abortContext.signal), (callback, transactionOptions) => this.runRequestTransactionWithAbortSignal(callback, abortContext.signal, transactionOptions), options);
144
143
  try {
145
- return await transactionPromise;
144
+ return await this.runWithTransactionClient(() => raceWithAbort(fn, abortContext.signal), (callback, transactionOptions) => this.runRequestTransactionWithAbortSignal(callback, abortContext.signal, transactionOptions), options);
146
145
  } finally {
147
146
  abortContext.cleanup();
148
147
  this.untrackActiveRequestTransaction(active);
package/dist/tokens.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Token } from '@fluojs/core';
2
2
  /** Dependency-injection token for the raw Prisma client handle. */
3
3
  export declare const PRISMA_CLIENT: unique symbol;
4
- /** Dependency-injection token for normalized Prisma runtime options. */
4
+ /** Dependency-injection token for public Prisma runtime options, such as strict transaction mode. */
5
5
  export declare const PRISMA_OPTIONS: unique symbol;
6
6
  /**
7
7
  * Returns the DI token for the raw Prisma client bound to a registration name.
@@ -11,7 +11,10 @@ export declare const PRISMA_OPTIONS: unique symbol;
11
11
  */
12
12
  export declare function getPrismaClientToken(name?: string): Token;
13
13
  /**
14
- * Returns the DI token for normalized Prisma module options bound to a registration name.
14
+ * Returns the DI token for the public Prisma runtime options bound to a registration name.
15
+ *
16
+ * This token resolves the `PRISMA_OPTIONS` public surface consumed by `PrismaService`.
17
+ * Normalized module options remain internal implementation details.
15
18
  *
16
19
  * @param name Optional registration name. Omit it to target the default unnamed Prisma registration.
17
20
  * @returns The token that resolves the matching Prisma runtime options.
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,mEAAmE;AACnE,eAAO,MAAM,aAAa,eAAmC,CAAC;AAC9D,wEAAwE;AACxE,eAAO,MAAM,cAAc,eAAoC,CAAC;AAgBhE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAMzD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAM1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAM1D"}
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,mEAAmE;AACnE,eAAO,MAAM,aAAa,eAAmC,CAAC;AAC9D,qGAAqG;AACrG,eAAO,MAAM,cAAc,eAAoC,CAAC;AAgBhE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAMzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAM1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAM1D"}
package/dist/tokens.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /** Dependency-injection token for the raw Prisma client handle. */
2
2
  export const PRISMA_CLIENT = Symbol.for('fluo.prisma.client');
3
- /** Dependency-injection token for normalized Prisma runtime options. */
3
+ /** Dependency-injection token for public Prisma runtime options, such as strict transaction mode. */
4
4
  export const PRISMA_OPTIONS = Symbol.for('fluo.prisma.options');
5
5
  function normalizePrismaRegistrationName(name) {
6
6
  if (name === undefined) {
@@ -25,7 +25,10 @@ export function getPrismaClientToken(name) {
25
25
  }
26
26
 
27
27
  /**
28
- * Returns the DI token for normalized Prisma module options bound to a registration name.
28
+ * Returns the DI token for the public Prisma runtime options bound to a registration name.
29
+ *
30
+ * This token resolves the `PRISMA_OPTIONS` public surface consumed by `PrismaService`.
31
+ * Normalized module options remain internal implementation details.
29
32
  *
30
33
  * @param name Optional registration name. Omit it to target the default unnamed Prisma registration.
31
34
  * @returns The token that resolves the matching Prisma runtime options.
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "transaction",
10
10
  "als"
11
11
  ],
12
- "version": "1.0.0-beta.3",
12
+ "version": "1.0.0-beta.5",
13
13
  "private": false,
14
14
  "license": "MIT",
15
15
  "repository": {
@@ -36,11 +36,11 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@fluojs/core": "^1.0.0-beta.4",
40
- "@fluojs/validation": "^1.0.0-beta.3",
39
+ "@fluojs/core": "^1.0.0-beta.5",
40
+ "@fluojs/validation": "^1.0.0-beta.4",
41
41
  "@fluojs/http": "^1.0.0-beta.10",
42
- "@fluojs/di": "^1.0.0-beta.6",
43
- "@fluojs/runtime": "^1.0.0-beta.11"
42
+ "@fluojs/di": "^1.0.0-beta.7",
43
+ "@fluojs/runtime": "^1.0.0-beta.12"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@prisma/client": ">=5.0.0"