@btravstack/prisma 0.13.0 → 0.14.0
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/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/rls.d.cts +5 -6
- package/dist/rls.d.mts +5 -6
- package/package.json +11 -11
package/dist/index.d.cts
CHANGED
|
@@ -50,7 +50,7 @@ type PrismaOptions<C extends PrismaLike> = {
|
|
|
50
50
|
* against this same URL *before the process starts*; an application that
|
|
51
51
|
* migrates itself at boot races every other replica.
|
|
52
52
|
*/
|
|
53
|
-
declare const prismaDatabase: <const N extends string>(name: N) => <C extends PrismaLike>({ client }: PrismaOptions<C>) => Module<HealthChecks | Instrumentations | (PortClassOf<N, C> extends (infer T) ? T extends PortClassOf<N, C> ? T extends import("@btravstack/di").AnyPort ? InstanceType<T> : T extends import("@btravstack/di").AnyProvider ? InstanceType<T["port"]> : never : never : never), import("@btravstack/config").ConfigInvalid, Exclude<Env, HealthChecks | Instrumentations | Observers | import("@btravstack/di").PortInstance<string, C> | import("@btravstack/di").PortInstance<`${N}Config`, {
|
|
53
|
+
export declare const prismaDatabase: <const N extends string>(name: N) => <C extends PrismaLike>({ client }: PrismaOptions<C>) => Module<HealthChecks | Instrumentations | (PortClassOf<N, C> extends (infer T) ? T extends PortClassOf<N, C> ? T extends import("@btravstack/di").AnyPort ? InstanceType<T> : T extends import("@btravstack/di").AnyProvider ? InstanceType<T["port"]> : never : never : never), import("@btravstack/config").ConfigInvalid, Exclude<Env, HealthChecks | Instrumentations | Observers | import("@btravstack/di").PortInstance<string, C> | import("@btravstack/di").PortInstance<`${N}Config`, {
|
|
54
54
|
readonly url: string;
|
|
55
55
|
}>> | Exclude<Logger, HealthChecks | Instrumentations | Observers | import("@btravstack/di").PortInstance<string, C> | import("@btravstack/di").PortInstance<`${N}Config`, {
|
|
56
56
|
readonly url: string;
|
|
@@ -58,4 +58,4 @@ declare const prismaDatabase: <const N extends string>(name: N) => <C extends Pr
|
|
|
58
58
|
readonly port: PortClassOf<N, C>;
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
61
|
-
export {
|
|
61
|
+
export type { PrismaLike, PrismaOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -50,7 +50,7 @@ type PrismaOptions<C extends PrismaLike> = {
|
|
|
50
50
|
* against this same URL *before the process starts*; an application that
|
|
51
51
|
* migrates itself at boot races every other replica.
|
|
52
52
|
*/
|
|
53
|
-
declare const prismaDatabase: <const N extends string>(name: N) => <C extends PrismaLike>({ client }: PrismaOptions<C>) => Module<HealthChecks | Instrumentations | (PortClassOf<N, C> extends (infer T) ? T extends PortClassOf<N, C> ? T extends import("@btravstack/di").AnyPort ? InstanceType<T> : T extends import("@btravstack/di").AnyProvider ? InstanceType<T["port"]> : never : never : never), import("@btravstack/config").ConfigInvalid, Exclude<Env, HealthChecks | Instrumentations | Observers | import("@btravstack/di").PortInstance<string, C> | import("@btravstack/di").PortInstance<`${N}Config`, {
|
|
53
|
+
export declare const prismaDatabase: <const N extends string>(name: N) => <C extends PrismaLike>({ client }: PrismaOptions<C>) => Module<HealthChecks | Instrumentations | (PortClassOf<N, C> extends (infer T) ? T extends PortClassOf<N, C> ? T extends import("@btravstack/di").AnyPort ? InstanceType<T> : T extends import("@btravstack/di").AnyProvider ? InstanceType<T["port"]> : never : never : never), import("@btravstack/config").ConfigInvalid, Exclude<Env, HealthChecks | Instrumentations | Observers | import("@btravstack/di").PortInstance<string, C> | import("@btravstack/di").PortInstance<`${N}Config`, {
|
|
54
54
|
readonly url: string;
|
|
55
55
|
}>> | Exclude<Logger, HealthChecks | Instrumentations | Observers | import("@btravstack/di").PortInstance<string, C> | import("@btravstack/di").PortInstance<`${N}Config`, {
|
|
56
56
|
readonly url: string;
|
|
@@ -58,4 +58,4 @@ declare const prismaDatabase: <const N extends string>(name: N) => <C extends Pr
|
|
|
58
58
|
readonly port: PortClassOf<N, C>;
|
|
59
59
|
};
|
|
60
60
|
//#endregion
|
|
61
|
-
export {
|
|
61
|
+
export type { PrismaLike, PrismaOptions };
|
package/dist/rls.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/rls.d.ts
|
|
2
2
|
/** Options of {@link tenantScoped}. */
|
|
3
|
-
type TenantScopedOptions = {
|
|
3
|
+
export type TenantScopedOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* The PostgreSQL run-time setting the policy reads. Defaults to
|
|
6
6
|
* `app.tenant_id`, matching `current_setting('app.tenant_id', true)`.
|
|
@@ -15,7 +15,7 @@ type TenantScopedOptions = {
|
|
|
15
15
|
* Not `@unthrown/prisma`'s `TransactionClient`, which denies a longer list; an
|
|
16
16
|
* application applying both extensions imports both names.
|
|
17
17
|
*/
|
|
18
|
-
type ScopedTransactionClient<C> = Omit<C, "$connect" | "$disconnect" | "$extends" | "$on" | "$use">;
|
|
18
|
+
export type ScopedTransactionClient<C> = Omit<C, "$connect" | "$disconnect" | "$extends" | "$on" | "$use">;
|
|
19
19
|
/**
|
|
20
20
|
* The `$transaction` a {@link tenantScoped} client exposes: the callback form
|
|
21
21
|
* only, with `this` carrying the extended client through to `tx`.
|
|
@@ -25,7 +25,7 @@ type ScopedTransactionClient<C> = Omit<C, "$connect" | "$disconnect" | "$extends
|
|
|
25
25
|
* generated client, so the receiver is the only place that type can come from.
|
|
26
26
|
* The array form is absent because it cannot be pinned atomically.
|
|
27
27
|
*/
|
|
28
|
-
type ScopedTransaction = <C, R>(this: C, fn: (tx: ScopedTransactionClient<C>) => Promise<R>, options?: {
|
|
28
|
+
export type ScopedTransaction = <C, R>(this: C, fn: (tx: ScopedTransactionClient<C>) => Promise<R>, options?: {
|
|
29
29
|
maxWait?: number;
|
|
30
30
|
timeout?: number;
|
|
31
31
|
isolationLevel?: string;
|
|
@@ -48,8 +48,7 @@ type ScopedTransaction = <C, R>(this: C, fn: (tx: ScopedTransactionClient<C>) =>
|
|
|
48
48
|
* const db = new PrismaClient({ adapter }).$extends(unthrownPrisma).$extends(tenantScoped(tenant));
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
declare const tenantScoped: (tenant: string, options?: TenantScopedOptions) => (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {
|
|
51
|
+
export declare const tenantScoped: (tenant: string, options?: TenantScopedOptions) => (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {
|
|
52
52
|
$transaction: ScopedTransaction;
|
|
53
53
|
}> & import("@prisma/client/runtime/client").DefaultArgs>;
|
|
54
|
-
//#endregion
|
|
55
|
-
export { ScopedTransaction, ScopedTransactionClient, TenantScopedOptions, tenantScoped };
|
|
54
|
+
//#endregion
|
package/dist/rls.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/rls.d.ts
|
|
2
2
|
/** Options of {@link tenantScoped}. */
|
|
3
|
-
type TenantScopedOptions = {
|
|
3
|
+
export type TenantScopedOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* The PostgreSQL run-time setting the policy reads. Defaults to
|
|
6
6
|
* `app.tenant_id`, matching `current_setting('app.tenant_id', true)`.
|
|
@@ -15,7 +15,7 @@ type TenantScopedOptions = {
|
|
|
15
15
|
* Not `@unthrown/prisma`'s `TransactionClient`, which denies a longer list; an
|
|
16
16
|
* application applying both extensions imports both names.
|
|
17
17
|
*/
|
|
18
|
-
type ScopedTransactionClient<C> = Omit<C, "$connect" | "$disconnect" | "$extends" | "$on" | "$use">;
|
|
18
|
+
export type ScopedTransactionClient<C> = Omit<C, "$connect" | "$disconnect" | "$extends" | "$on" | "$use">;
|
|
19
19
|
/**
|
|
20
20
|
* The `$transaction` a {@link tenantScoped} client exposes: the callback form
|
|
21
21
|
* only, with `this` carrying the extended client through to `tx`.
|
|
@@ -25,7 +25,7 @@ type ScopedTransactionClient<C> = Omit<C, "$connect" | "$disconnect" | "$extends
|
|
|
25
25
|
* generated client, so the receiver is the only place that type can come from.
|
|
26
26
|
* The array form is absent because it cannot be pinned atomically.
|
|
27
27
|
*/
|
|
28
|
-
type ScopedTransaction = <C, R>(this: C, fn: (tx: ScopedTransactionClient<C>) => Promise<R>, options?: {
|
|
28
|
+
export type ScopedTransaction = <C, R>(this: C, fn: (tx: ScopedTransactionClient<C>) => Promise<R>, options?: {
|
|
29
29
|
maxWait?: number;
|
|
30
30
|
timeout?: number;
|
|
31
31
|
isolationLevel?: string;
|
|
@@ -48,8 +48,7 @@ type ScopedTransaction = <C, R>(this: C, fn: (tx: ScopedTransactionClient<C>) =>
|
|
|
48
48
|
* const db = new PrismaClient({ adapter }).$extends(unthrownPrisma).$extends(tenantScoped(tenant));
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
declare const tenantScoped: (tenant: string, options?: TenantScopedOptions) => (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {
|
|
51
|
+
export declare const tenantScoped: (tenant: string, options?: TenantScopedOptions) => (client: any) => import("@prisma/client/extension").PrismaClientExtends<import("@prisma/client/runtime/client").InternalArgs<{}, {}, {}, {
|
|
52
52
|
$transaction: ScopedTransaction;
|
|
53
53
|
}> & import("@prisma/client/runtime/client").DefaultArgs>;
|
|
54
|
-
//#endregion
|
|
55
|
-
export { ScopedTransaction, ScopedTransactionClient, TenantScopedOptions, tenantScoped };
|
|
54
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@btravstack/prisma",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "The Prisma starter for @btravstack/core: DATABASE_URL through Config, the Postgres driver adapter, and a client whose pool is the application scope's",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -57,25 +57,25 @@
|
|
|
57
57
|
"@prisma/adapter-pg": "7.10.0",
|
|
58
58
|
"@prisma/client": "7.10.0",
|
|
59
59
|
"@prisma/instrumentation": "7.10.0",
|
|
60
|
-
"@types/node": "26.4.
|
|
61
|
-
"@unthrown/vitest": "5.
|
|
60
|
+
"@types/node": "26.4.1",
|
|
61
|
+
"@unthrown/vitest": "5.8.0",
|
|
62
62
|
"@vitest/coverage-v8": "4.1.11",
|
|
63
|
-
"tsdown": "0.
|
|
63
|
+
"tsdown": "0.23.0",
|
|
64
64
|
"typescript": "7.0.2",
|
|
65
|
-
"unthrown": "5.
|
|
65
|
+
"unthrown": "5.8.0",
|
|
66
66
|
"vitest": "4.1.11",
|
|
67
|
-
"@btravstack/config": "0.
|
|
68
|
-
"@btravstack/core": "0.
|
|
69
|
-
"@btravstack/di": "0.
|
|
67
|
+
"@btravstack/config": "0.14.0",
|
|
68
|
+
"@btravstack/core": "0.14.0",
|
|
69
|
+
"@btravstack/di": "0.14.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@prisma/adapter-pg": "^7.0.0",
|
|
73
73
|
"@prisma/client": "^7.10.0",
|
|
74
74
|
"@prisma/instrumentation": "^7.0.0",
|
|
75
75
|
"unthrown": "^5.0.0",
|
|
76
|
-
"@btravstack/config": "^0.
|
|
77
|
-
"@btravstack/core": "^0.
|
|
78
|
-
"@btravstack/di": "^0.
|
|
76
|
+
"@btravstack/config": "^0.14.0",
|
|
77
|
+
"@btravstack/core": "^0.14.0",
|
|
78
|
+
"@btravstack/di": "^0.14.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependenciesMeta": {
|
|
81
81
|
"@prisma/client": {
|