@prisma-next/extension-supabase 0.14.0-dev.44 → 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.
@@ -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 {
@@ -2,6 +2,7 @@ import { supabaseRuntimeDescriptor } from '../runtime/descriptor';
2
2
 
3
3
  export default supabaseRuntimeDescriptor;
4
4
 
5
+ export type { SupabaseExtensionContract } from '../runtime/ext-contract-type';
5
6
  export type {
6
7
  RoleBoundDb,
7
8
  ServiceRoleDb,
@@ -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-nOWbxjsx.mjs","names":[],"sources":["../package.json","../src/contract/contract.json"],"sourcesContent":["",""],"mappings":""}