@prisma-next/extension-supabase 0.14.0-dev.45 → 0.14.0-dev.46
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/{contract-YENJX2-V.mjs → contract-DriSoHb7.mjs} +165 -69
- package/dist/contract-DriSoHb7.mjs.map +1 -0
- package/dist/pack.mjs +1 -1
- package/dist/runtime.d.mts +131 -6
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +6 -3
- package/dist/runtime.mjs.map +1 -1
- package/dist/test/utils.d.mts +4 -2
- package/dist/test/utils.d.mts.map +1 -1
- package/dist/test/utils.mjs +26 -2
- package/dist/test/utils.mjs.map +1 -1
- package/package.json +27 -27
- package/src/contract/contract.d.ts +99 -1
- package/src/contract/contract.json +113 -1
- package/src/contract/contract.prisma +16 -0
- package/src/exports/runtime.ts +1 -0
- package/src/runtime/supabase.ts +11 -0
- package/dist/contract-YENJX2-V.mjs.map +0 -1
|
@@ -24,6 +24,22 @@ namespace auth {
|
|
|
24
24
|
|
|
25
25
|
@@map("identities")
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
native_enum AalLevel {
|
|
29
|
+
aal1 = "aal1"
|
|
30
|
+
aal2 = "aal2"
|
|
31
|
+
aal3 = "aal3"
|
|
32
|
+
@@map("aal_level")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
model AuthSession {
|
|
36
|
+
id Uuid @id
|
|
37
|
+
user_id Uuid
|
|
38
|
+
aal pg.enum(AalLevel)?
|
|
39
|
+
created_at Timestamptz
|
|
40
|
+
|
|
41
|
+
@@map("sessions")
|
|
42
|
+
}
|
|
27
43
|
}
|
|
28
44
|
|
|
29
45
|
namespace storage {
|
package/src/exports/runtime.ts
CHANGED
package/src/runtime/supabase.ts
CHANGED
|
@@ -6,6 +6,10 @@ import type {
|
|
|
6
6
|
AsyncIterableResult,
|
|
7
7
|
RuntimeExecuteOptions,
|
|
8
8
|
} from '@prisma-next/framework-components/runtime';
|
|
9
|
+
import {
|
|
10
|
+
buildNamespacedNativeEnums,
|
|
11
|
+
type NamespacedNativeEnums,
|
|
12
|
+
} from '@prisma-next/postgres/runtime';
|
|
9
13
|
import { sql } from '@prisma-next/sql-builder/runtime';
|
|
10
14
|
import type { Db } from '@prisma-next/sql-builder/types';
|
|
11
15
|
import type { SqlStorage } from '@prisma-next/sql-contract/types';
|
|
@@ -86,6 +90,7 @@ export interface RoleBoundDb<TContract extends Contract<SqlStorage>> {
|
|
|
86
90
|
export interface SupabaseInternalDb {
|
|
87
91
|
readonly sql: Db<SupabaseExtensionContract>;
|
|
88
92
|
readonly orm: OrmClient<SupabaseExtensionContract>;
|
|
93
|
+
readonly nativeEnums: NamespacedNativeEnums<SupabaseExtensionContract>;
|
|
89
94
|
execute<Row>(
|
|
90
95
|
plan: (SqlExecutionPlan<Row> | SqlQueryPlan<Row>) & { readonly _row?: Row },
|
|
91
96
|
options?: RuntimeExecuteOptions,
|
|
@@ -356,6 +361,11 @@ export default async function supabase<TContract extends Contract<SqlStorage>>(
|
|
|
356
361
|
...ifDefined('middleware', options.middleware),
|
|
357
362
|
});
|
|
358
363
|
|
|
364
|
+
const extNativeEnums = blindCast<
|
|
365
|
+
NamespacedNativeEnums<SupabaseExtensionContract>,
|
|
366
|
+
'buildNamespacedNativeEnums returns the namespace-keyed accessor map this contract types'
|
|
367
|
+
>(Object.freeze(buildNamespacedNativeEnums(extContract.storage)));
|
|
368
|
+
|
|
359
369
|
const supabaseInternal: SupabaseInternalDb = {
|
|
360
370
|
sql: sql<SupabaseExtensionContract>({ context: extContext, rawCodecInferer }),
|
|
361
371
|
orm: orm({
|
|
@@ -367,6 +377,7 @@ export default async function supabase<TContract extends Contract<SqlStorage>>(
|
|
|
367
377
|
},
|
|
368
378
|
context: extContext,
|
|
369
379
|
}),
|
|
380
|
+
nativeEnums: extNativeEnums,
|
|
370
381
|
execute<Row>(
|
|
371
382
|
plan: (SqlExecutionPlan<Row> | SqlQueryPlan<Row>) & { readonly _row?: Row },
|
|
372
383
|
execOptions?: RuntimeExecuteOptions,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract-YENJX2-V.mjs","names":[],"sources":["../package.json","../src/contract/contract.json"],"sourcesContent":["",""],"mappings":""}
|