@supabase/lite 0.9.0 → 0.9.1-next.2

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.
Files changed (64) hide show
  1. package/FEATURES.md +176 -0
  2. package/LIMITATIONS.md +9 -6
  3. package/PATTERNS.md +66 -6
  4. package/README.md +16 -8
  5. package/STATUS.md +33 -20
  6. package/dist/{Connection-ZWTDByQ5.d.ts → Connection-f_d5HhQ0.d.ts} +301 -293
  7. package/dist/cli/index.js +127 -124
  8. package/dist/cli/lib.d.ts +1 -12
  9. package/dist/cli/lib.js +44 -39
  10. package/dist/db/fallback.d.ts +1 -1
  11. package/dist/db/postgres/PostgresConnection.js +18 -18
  12. package/dist/db/postgres/pglite/PgliteConnection.js +17 -17
  13. package/dist/index.d.ts +116 -40
  14. package/dist/index.js +181 -73
  15. package/dist/static/.vite/manifest.json +34 -2
  16. package/dist/static/assets/InterVariable-Dx4kXJAl.woff2 +0 -0
  17. package/dist/static/assets/InterVariable-Italic-DpCbqKDY.woff2 +0 -0
  18. package/dist/static/assets/SourceCodePro-Variable-BP8Zz55n.woff2 +0 -0
  19. package/dist/static/assets/SourceCodePro-Variable-Italic-eALmlzX7.woff2 +0 -0
  20. package/dist/static/assets/main-BY4iigay.css +1 -0
  21. package/dist/static/assets/main-BnQ-v4V9.js +199 -0
  22. package/dist/static/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2 +0 -0
  23. package/dist/static/assets/manrope-latin-wght-normal-DHIcAJRg.woff2 +0 -0
  24. package/dist/vite/index.d.ts +627 -31
  25. package/dist/vite/index.js +2 -2
  26. package/docs/auth/email.mdx +214 -0
  27. package/docs/auth/not-supported.mdx +57 -0
  28. package/docs/auth/overview.mdx +52 -0
  29. package/docs/auth/supported-flows.mdx +120 -0
  30. package/docs/cli/overview.mdx +112 -0
  31. package/docs/cli/telemetry.mdx +34 -0
  32. package/docs/compatibility.mdx +115 -0
  33. package/docs/database/backends.mdx +118 -0
  34. package/docs/database/data-api.mdx +90 -0
  35. package/docs/database/functions-triggers.mdx +93 -0
  36. package/docs/database/migrations.mdx +95 -0
  37. package/docs/database/overview.mdx +66 -0
  38. package/docs/database/postgres-sqlite-translation.mdx +130 -0
  39. package/docs/database/rls.mdx +161 -0
  40. package/docs/database/schemas.mdx +58 -0
  41. package/docs/index.mdx +49 -0
  42. package/docs/integrations/embedded.mdx +100 -0
  43. package/docs/integrations/frameworks.mdx +83 -0
  44. package/docs/integrations/vite.mdx +87 -0
  45. package/docs/llms.txt +52 -0
  46. package/docs/other/edge-functions.mdx +34 -0
  47. package/docs/other/realtime.mdx +22 -0
  48. package/docs/quickstart.mdx +150 -0
  49. package/docs/running.mdx +127 -0
  50. package/docs/storage/adapters.mdx +75 -0
  51. package/docs/storage/limitations.mdx +21 -0
  52. package/docs/storage/overview.mdx +88 -0
  53. package/docs/upgrade.mdx +108 -0
  54. package/package.json +5 -1
  55. package/skills/supalite/SKILL.md +6 -4
  56. package/dist/static/assets/main-1bwWb_1q.js +0 -40996
  57. package/dist/static/assets/main-BDsRycsc.css +0 -4045
  58. package/dist/static/fonts/CustomFont-Black.woff2 +0 -0
  59. package/dist/static/fonts/CustomFont-BlackItalic.woff2 +0 -0
  60. package/dist/static/fonts/CustomFont-Bold.woff2 +0 -0
  61. package/dist/static/fonts/CustomFont-BoldItalic.woff2 +0 -0
  62. package/dist/static/fonts/CustomFont-Book.woff2 +0 -0
  63. package/dist/static/fonts/CustomFont-BookItalic.woff2 +0 -0
  64. package/dist/static/fonts/CustomFont-Medium.woff2 +0 -0
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _supabase_supabase_js from '@supabase/supabase-js';
2
2
  import { SupabaseClientOptions } from '@supabase/supabase-js';
3
3
  import { D as DefaultSchema, S as Schema } from './index-DKO3OQpz.js';
4
- import { Connection, ConnectionMigrator, MaybePromise as MaybePromise$1, SchemaDiffResult, PlanStep, PlanResult, IConnectionConfig, Dialect as Dialect$2, IntrospectResult as IntrospectResult$1, TransactionOptions } from '@supabase/lite';
4
+ import { Connection as Connection$1, ConnectionMigrator, MaybePromise as MaybePromise$1, SchemaDiffResult, PlanStep, PlanResult, IConnectionConfig, Dialect as Dialect$1, IntrospectResult as IntrospectResult$1, TransactionOptions } from '@supabase/lite';
5
5
  import * as hono_hono_base from 'hono/hono-base';
6
6
  import * as hono_utils_http_status from 'hono/utils/http-status';
7
7
  import * as hono_utils_types from 'hono/utils/types';
@@ -10,8 +10,8 @@ import * as hono from 'hono';
10
10
  import { Context, MiddlewareHandler } from 'hono';
11
11
  import { Kysely, KyselyPlugin } from 'kysely';
12
12
  import { ReadableStream as ReadableStream$1 } from 'node:stream/web';
13
- import { a as CacheDriver, b as CacheSetOptions, W as Where, c as IntrospectResult, M as MigrateScope, A as AnyAST, V as VarsContext, T as TransactionOptions$1, C as Connection$1 } from './Connection-ZWTDByQ5.js';
14
- export { d as AST, e as ASTType, f as AggregateFunction, B as BaseAST, g as BodyResult, h as CheckConstraintInfo, i as ColumnDef, j as ColumnDiff, k as ColumnInfo, l as ColumnRef, m as CommentInfo, n as ConnectionContextOptions, o as ConnectionMigrator, p as CustomTypesInfo, D as DataLossError, q as DataLossWarning, r as DeleteAST, s as Dialect, t as DiffResult, E as EmbedDef, u as EmbedTransform, v as ExplainOptions, F as FiltersResult, w as ForeignKeyDiff, x as ForeignKeyInfo, y as FunctionInfo, H as HeadersResult, I as IConnectionConfig, z as IndexDiff, G as IndexInfo, J as InsertAST, K as IntrospectOptions, L as JoinDef, N as JoinMap, O as Meta, P as MigrationError, Q as OrderEntry, R as PlanResult, S as PlanStep, U as PlanStepType, X as PreferToken, Y as PrimaryKeyInfo, Z as Qb, _ as QbDelete, $ as QbInsert, a0 as QbSelect, a1 as QbUpdate, a2 as QueryAST, a3 as QueryParamsResult, a4 as RelationNotFoundError, a5 as RouteResult, a6 as RpcAST, a7 as RpcResult, a8 as SchemaDiffResult, a9 as SelectEntry, aa as SelectResult, ab as TableDiff, ac as TableInfo, ad as TextSearchValue, ae as TransformsResult, af as TranslatorConfig, ag as TriggerInfo, ah as UniqueConstraintInfo, ai as UpdateAST, aj as UpsertAST, ak as UpsertResult, al as ViewInfo, am as ViewOptionsMetadata, an as WhereValue, ao as isRef } from './Connection-ZWTDByQ5.js';
13
+ import { a as CacheDriver, b as CacheSetOptions, C as Connection, W as Where, c as IntrospectResult, M as MigrateScope, A as AnyAST, V as VarsContext, T as TransactionOptions$1 } from './Connection-f_d5HhQ0.js';
14
+ export { d as AST, e as ASTType, f as AggregateFunction, B as BaseAST, g as BodyResult, h as CheckConstraintInfo, i as ColumnDef, j as ColumnDiff, k as ColumnInfo, l as ColumnRef, m as CommentInfo, n as ConnectionContextOptions, o as ConnectionMigrator, p as CustomTypesInfo, D as DataLossError, q as DataLossWarning, r as DeleteAST, s as Dialect, t as DiffResult, E as EmbedDef, u as EmbedTransform, v as ExplainOptions, F as FiltersResult, w as ForeignKeyDiff, x as ForeignKeyInfo, y as FunctionInfo, H as HeadersResult, I as IConnectionConfig, z as IndexDiff, G as IndexInfo, J as InsertAST, K as IntrospectOptions, L as JoinDef, N as JoinMap, O as Meta, P as MigrationError, Q as OrderEntry, R as PlanResult, S as PlanStep, U as PlanStepType, X as PreferToken, Y as PrimaryKeyInfo, Z as Qb, _ as QbDelete, $ as QbInsert, a0 as QbSelect, a1 as QbUpdate, a2 as QueryAST, a3 as QueryParamsResult, a4 as RelationNotFoundError, a5 as RouteResult, a6 as RpcAST, a7 as RpcResult, a8 as SchemaDiffResult, a9 as SelectEntry, aa as SelectResult, ab as TableDiff, ac as TableInfo, ad as TextSearchValue, ae as TransformsResult, af as TranslatorConfig, ag as TriggerInfo, ah as UniqueConstraintInfo, ai as UpdateAST, aj as UpsertAST, ak as UpsertResult, al as ViewInfo, am as ViewOptionsMetadata, an as WhereValue, ao as isRef } from './Connection-f_d5HhQ0.js';
15
15
  import { ParseResult } from 'libpg-query';
16
16
  import { DeparserOptions } from 'pgsql-deparser';
17
17
  import 'jsonv-ts';
@@ -198,7 +198,7 @@ interface EmailTemplateConfig {
198
198
  content_path?: string;
199
199
  }
200
200
 
201
- type Dialect$1 = "postgres" | "sqlite";
201
+ type Dialect = "postgres" | "sqlite";
202
202
  /** Bound `Connection#runInTransaction` — see db/Connection.ts for why this
203
203
  * indirection exists (DO storage has no BEGIN/COMMIT over kysely). */
204
204
  type TransactionRunner = <T>(fn: (trx: Kysely<any>) => Promise<T>) => Promise<T>;
@@ -207,7 +207,7 @@ declare class AuthRepository {
207
207
  private dialect;
208
208
  private runInTransaction;
209
209
  private schema;
210
- constructor(db: Kysely<any>, dialect: Dialect$1, runInTransaction?: TransactionRunner);
210
+ constructor(db: Kysely<any>, dialect: Dialect, runInTransaction?: TransactionRunner);
211
211
  private bool;
212
212
  /**
213
213
  * Runs `fn` inside a database transaction, handing it a repository bound to
@@ -706,7 +706,7 @@ interface StorageAdapter<Options extends StorageAdapterOptions = StorageAdapterO
706
706
  uploadObject(bucketName: string, key: string, version: string | undefined, body: CrossReadableStream | Buffer | Uint8Array, contentType: string, cacheControl: string): Promise<ObjectMetadata>;
707
707
  deleteObject(bucket: string, key: string, version: string | undefined): Promise<void>;
708
708
  deleteObjects(bucket: string, prefixes: string[]): Promise<void>;
709
- copyObject(bucket: string, source: string, version: string | undefined, destination: string, destinationVersion: string | undefined): Promise<Pick<ObjectMetadata, "httpStatusCode" | "eTag" | "lastModified">>;
709
+ copyObject(sourceBucket: string, source: string, version: string | undefined, destinationBucket: string, destination: string, destinationVersion: string | undefined): Promise<Pick<ObjectMetadata, "httpStatusCode" | "eTag" | "lastModified">>;
710
710
  headObject(bucket: string, key: string, version: string | undefined): Promise<ObjectMetadata>;
711
711
  privateAssetUrl(bucket: string, key: string, version: string | undefined): Promise<string>;
712
712
  }
@@ -746,7 +746,6 @@ interface TransformationAdapter<Options extends TransformationAdapterOptions = T
746
746
  transformFromUrl?(url: string, options: TransformOptions): Promise<TransformResult>;
747
747
  }
748
748
 
749
- type Dialect = "postgres" | "sqlite";
750
749
  interface Bucket {
751
750
  id: string;
752
751
  name: string;
@@ -782,10 +781,10 @@ interface ListObjectsOptions {
782
781
  search?: string;
783
782
  }
784
783
  declare class StorageRepository {
784
+ private schema;
785
785
  private db;
786
786
  private dialect;
787
- private schema;
788
- constructor(db: Kysely<any>, dialect: Dialect);
787
+ constructor(connection: Connection);
789
788
  private table;
790
789
  private insertInto;
791
790
  private update;
@@ -815,20 +814,22 @@ declare class StorageRepository {
815
814
  name: string;
816
815
  owner?: string | null;
817
816
  owner_id?: string | null;
818
- metadata?: Record<string, unknown>;
819
- user_metadata?: Record<string, unknown>;
817
+ metadata?: Record<string, unknown> | null;
818
+ user_metadata?: Record<string, unknown> | null;
820
819
  version?: string | null;
821
820
  }): Promise<StorageObject>;
822
821
  findObjectById(id: string): Promise<StorageObject | null>;
823
822
  findObjectByPath(bucketId: string, name: string): Promise<StorageObject | null>;
824
823
  listObjects(bucketId: string, prefix?: string, options?: ListObjectsOptions): Promise<StorageObject[]>;
825
824
  updateObject(id: string, updates: Partial<{
825
+ bucket_id: string;
826
826
  name: string;
827
- metadata: Record<string, unknown>;
828
- user_metadata: Record<string, unknown>;
827
+ metadata: Record<string, unknown> | null;
828
+ user_metadata: Record<string, unknown> | null;
829
829
  version: string | null;
830
830
  owner: string | null;
831
831
  owner_id: string | null;
832
+ updated_at: string;
832
833
  }>): Promise<StorageObject | null>;
833
834
  deleteObject(id: string): Promise<void>;
834
835
  deleteObjectsByBucket(bucketId: string): Promise<string[]>;
@@ -838,6 +839,13 @@ declare class StorageRepository {
838
839
  private parseObjectRow;
839
840
  }
840
841
 
842
+ type StorageRole = string;
843
+ interface StorageRequestAuth {
844
+ role: StorageRole;
845
+ sub: string | null;
846
+ jwt: Record<string, unknown> | null;
847
+ }
848
+
841
849
  interface StorageServiceConfig {
842
850
  jwtSecret: string;
843
851
  fileSizeLimit?: number;
@@ -856,8 +864,12 @@ declare class StorageService {
856
864
  private config;
857
865
  private options;
858
866
  private transformationAdapter?;
867
+ private connection?;
859
868
  private initialized;
860
- constructor(repo: StorageRepository, adapter: StorageAdapter, config: StorageServiceConfig, options?: StorageServiceOptions, transformationAdapter?: TransformationAdapter | undefined);
869
+ private access;
870
+ constructor(repo: StorageRepository, adapter: StorageAdapter, config: StorageServiceConfig, options?: StorageServiceOptions, transformationAdapter?: TransformationAdapter | undefined, connection?: Connection | undefined);
871
+ setRequestAuth(auth: StorageRequestAuth, operation?: string): void;
872
+ get requestAuth(): StorageRequestAuth;
861
873
  init(): Promise<void>;
862
874
  createBucket(params: {
863
875
  id: string;
@@ -868,6 +880,7 @@ declare class StorageService {
868
880
  owner?: string | null;
869
881
  }): Promise<Bucket>;
870
882
  getBucket(id: string): Promise<Bucket>;
883
+ getBucketBypass(id: string): Promise<Bucket>;
871
884
  listBuckets(): Promise<Bucket[]>;
872
885
  updateBucket(id: string, updates: {
873
886
  public?: boolean;
@@ -882,32 +895,34 @@ declare class StorageService {
882
895
  contentLength?: number;
883
896
  upsert?: boolean;
884
897
  metadata?: Record<string, unknown>;
885
- owner?: string | null;
886
898
  }): Promise<StorageObject>;
899
+ private uploadInternal;
887
900
  download(bucketId: string, path: string, options?: {
888
901
  transform?: TransformOptions;
889
902
  }): Promise<{
890
903
  body: CrossReadableStream | Blob | Buffer | Uint8Array;
891
904
  metadata: ObjectMetadata;
892
905
  }>;
906
+ private downloadBypass;
907
+ private downloadObject;
893
908
  update(bucketId: string, path: string, body: ReadableStream | Buffer | Uint8Array, options?: {
894
909
  contentType?: string;
895
910
  cacheControl?: string;
896
911
  contentLength?: number;
897
912
  metadata?: Record<string, unknown>;
898
913
  upsert?: boolean;
899
- owner?: string | null;
900
914
  }): Promise<StorageObject>;
901
915
  remove(bucketId: string, paths: string[]): Promise<StorageObject[]>;
902
916
  list(bucketId: string, prefix?: string, options?: ListObjectsOptions): Promise<StorageObject[]>;
903
- move(bucketId: string, fromPath: string, toPath: string): Promise<void>;
904
- copy(bucketId: string, fromPath: string, toPath: string): Promise<{
917
+ move(bucketId: string, fromPath: string, toPath: string, destinationBucketId?: string): Promise<void>;
918
+ copy(bucketId: string, fromPath: string, toPath: string, destinationBucketId?: string, upsert?: boolean): Promise<{
905
919
  key: string;
906
920
  }>;
907
921
  info(bucketId: string, path: string): Promise<StorageObject & {
908
922
  httpMetadata: ObjectMetadata;
909
923
  }>;
910
924
  exists(bucketId: string, path: string): Promise<boolean>;
925
+ private assertBucketRetrievable;
911
926
  createSignedUrl(bucketId: string, path: string, expiresIn: number): Promise<{
912
927
  signedUrl: string;
913
928
  }>;
@@ -916,7 +931,10 @@ declare class StorageService {
916
931
  signedUrl: string;
917
932
  error: string | null;
918
933
  }[]>;
919
- createSignedUploadUrl(bucketId: string, path: string): Promise<{
934
+ createSignedUploadUrl(bucketId: string, path: string, upsert?: boolean, options?: {
935
+ metadata?: Record<string, unknown>;
936
+ userMetadata?: Record<string, unknown>;
937
+ }): Promise<{
920
938
  signedUrl: string;
921
939
  token: string;
922
940
  path: string;
@@ -925,11 +943,34 @@ declare class StorageService {
925
943
  bucket: string;
926
944
  path: string;
927
945
  intent: "download" | "upload";
946
+ owner: string | null;
947
+ upsert: boolean;
948
+ }>;
949
+ downloadSigned(bucketId: string, path: string, options?: {
950
+ transform?: TransformOptions;
951
+ }): Promise<{
952
+ body: CrossReadableStream | Blob | Buffer | Uint8Array;
953
+ metadata: ObjectMetadata;
928
954
  }>;
955
+ uploadSigned(bucketId: string, path: string, body: ReadableStream | Buffer | Uint8Array, options: {
956
+ contentType?: string;
957
+ cacheControl?: string;
958
+ contentLength?: number;
959
+ upsert?: boolean;
960
+ metadata?: Record<string, unknown>;
961
+ owner: string | null;
962
+ }): Promise<StorageObject>;
929
963
  private signStorageToken;
964
+ private uploadPermissionValues;
965
+ private databaseErrorCode;
930
966
  }
931
967
 
968
+ /** Trusted socket metadata supplied by an adapter that owns the listener. */
969
+ type AppRequestContext = {
970
+ peerAddress: string | null;
971
+ };
932
972
  type HonoContext = {
973
+ Bindings: AppRequestContext;
933
974
  Variables: {
934
975
  app: App;
935
976
  authService: AuthService;
@@ -1565,7 +1606,18 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1565
1606
  status: hono_utils_http_status.StatusCode;
1566
1607
  };
1567
1608
  };
1568
- }, "/rest/v1"> | hono_types.MergeSchemaPath<hono_types.BlankSchema | hono_types.MergeSchemaPath<{
1609
+ }, "/rest/v1"> | hono_types.MergeSchemaPath<(hono_types.BlankSchema | hono_types.MergeSchemaPath<{
1610
+ "/status": {
1611
+ $get: {
1612
+ input: {};
1613
+ output: {
1614
+ status: string;
1615
+ };
1616
+ outputFormat: "json";
1617
+ status: 200;
1618
+ };
1619
+ };
1620
+ } & {
1569
1621
  "/object/public/:bucketId/*": {
1570
1622
  $get: {
1571
1623
  input: {
@@ -1791,6 +1843,7 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1791
1843
  input: {
1792
1844
  json: {
1793
1845
  [x: string]: unknown;
1846
+ destinationBucket?: string | undefined;
1794
1847
  bucketId: string;
1795
1848
  sourceKey: string;
1796
1849
  destinationKey: string;
@@ -1809,6 +1862,7 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
1809
1862
  input: {
1810
1863
  json: {
1811
1864
  [x: string]: unknown;
1865
+ destinationBucket?: string | undefined;
1812
1866
  bucketId: string;
1813
1867
  sourceKey: string;
1814
1868
  destinationKey: string;
@@ -2023,7 +2077,20 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
2023
2077
  status: 404;
2024
2078
  };
2025
2079
  };
2026
- }, "/">, "/storage/v1"> | hono_types.MergeSchemaPath<{
2080
+ }, "/">) & {
2081
+ "*": {
2082
+ $all: {
2083
+ input: {};
2084
+ output: {
2085
+ message: string;
2086
+ error: string;
2087
+ statusCode: number;
2088
+ };
2089
+ outputFormat: "json";
2090
+ status: 404;
2091
+ };
2092
+ };
2093
+ }, "/storage/v1"> | hono_types.MergeSchemaPath<{
2027
2094
  "/ping": {
2028
2095
  $get: {
2029
2096
  input: {};
@@ -2096,6 +2163,7 @@ declare function createServer(app: App, options?: ServerOptions): hono_hono_base
2096
2163
  unique: boolean;
2097
2164
  columns: string[];
2098
2165
  schema: string;
2166
+ sql?: string | undefined;
2099
2167
  }[];
2100
2168
  foreign_keys: {
2101
2169
  table: string;
@@ -2212,7 +2280,7 @@ declare class Policy {
2212
2280
  }
2213
2281
 
2214
2282
  interface IAppConfig extends DefaultSchema {
2215
- connection: Connection | Promise<Connection>;
2283
+ connection: Connection$1 | Promise<Connection$1>;
2216
2284
  rls?: {
2217
2285
  tables: string[];
2218
2286
  policies: Policy[];
@@ -2237,7 +2305,7 @@ interface SystemOptions {
2237
2305
  schemaReconciliation?: "additive" | "full";
2238
2306
  }
2239
2307
  interface DefaultAppConfig extends IAppConfig {
2240
- connection: Connection;
2308
+ connection: Connection$1;
2241
2309
  options?: {
2242
2310
  defaults?: true;
2243
2311
  server?: ServerOptions;
@@ -2245,7 +2313,7 @@ interface DefaultAppConfig extends IAppConfig {
2245
2313
  system?: SystemOptions;
2246
2314
  };
2247
2315
  }
2248
- declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config extends IAppConfig ? Config["connection"] extends Connection ? Config["connection"] : Config["connection"] extends Promise<Connection> ? Awaited<Config["connection"]> : Connection : never> {
2316
+ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config extends IAppConfig ? Config["connection"] extends Connection$1 ? Config["connection"] : Config["connection"] extends Promise<Connection$1> ? Awaited<Config["connection"]> : Connection$1 : never> {
2249
2317
  #private;
2250
2318
  private readonly _connection;
2251
2319
  private readonly _rls;
@@ -2280,6 +2348,7 @@ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config ex
2280
2348
  ensureSystemSchema(opts?: {
2281
2349
  force?: boolean;
2282
2350
  }): Promise<void>;
2351
+ hasEnabledSystemBaseSchema(): boolean;
2283
2352
  isValidConfig(config: Schema | DefaultSchema | IAppConfig): boolean;
2284
2353
  getClient<SchemaName extends string = "public">(options?: SupabaseClientOptions<SchemaName> & {
2285
2354
  apikey?: string;
@@ -2330,7 +2399,7 @@ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config ex
2330
2399
  }>;
2331
2400
  } ? Omit<any, "__InternalSupabase">[SchemaName] : never, any>;
2332
2401
  isLocalRequest(request: Request): boolean;
2333
- fetch: (request: Request) => Promise<Response>;
2402
+ fetch: (request: Request, context?: AppRequestContext) => Promise<Response>;
2334
2403
  getInfoJson(): {
2335
2404
  connection: object;
2336
2405
  config: Config;
@@ -2616,16 +2685,16 @@ interface PersistedDeparseInfo {
2616
2685
  comments?: CollectedComment[];
2617
2686
  }
2618
2687
  type SqlitePostgresTranslationResult = Pick<DeparsePostgresDdlResult, "ddl"> & Partial<DeparsePostgresDdlResult>;
2619
- declare abstract class SqliteConnection<Driver = unknown, DB = any, Config extends ISqliteConnectionConfig = ISqliteConnectionConfig> extends Connection<Driver, DB, Config> {
2688
+ declare abstract class SqliteConnection<Driver = unknown, DB = any, Config extends ISqliteConnectionConfig = ISqliteConnectionConfig> extends Connection$1<Driver, DB, Config> {
2620
2689
  #private;
2621
- dialect: Dialect$2;
2690
+ dialect: Dialect$1;
2622
2691
  deserializeRow(row: Record<string, unknown>): Record<string, unknown>;
2623
2692
  constructor(config?: Config);
2624
2693
  /**
2625
2694
  * `opts.strict`: rethrow instead of swallowing a parse failure (default:
2626
2695
  * fail-soft, returning `{}`). The constructor path stays fail-soft — a
2627
- * malformed `App({rls})` config shouldn't crash boot. The deparse-cache
2628
- * restore path (`deparse-cache.ts`) uses `strict: true`: a partially
2696
+ * malformed `App({rls})` config shouldn't crash boot. The runtime metadata
2697
+ * cache restore path uses `strict: true`: a partially
2629
2698
  * corrupt blob (e.g. a valid outer `rls` shape but a broken nested
2630
2699
  * `schema` entry) must NOT silently degrade to "restored with whatever
2631
2700
  * parsed" — that's indistinguishable from "restored with full RLS
@@ -2650,7 +2719,9 @@ declare abstract class SqliteConnection<Driver = unknown, DB = any, Config exten
2650
2719
  static serializeDeparseInfo(info: Partial<SqlitePostgresDeparseInfo> | undefined | null): PersistedDeparseInfo;
2651
2720
  updateDeparseInfo(details: NonNullable<ISqliteConnectionConfig["translation"]>["deparse"]): void;
2652
2721
  protected withSqlitePlugins(add_plugins?: KyselyPlugin[]): KyselyPlugin[];
2653
- translateDdl(ddl: string): Promise<SqlitePostgresTranslationResult>;
2722
+ translateDdl(ddl: string, opts?: {
2723
+ strict?: boolean;
2724
+ }): Promise<SqlitePostgresTranslationResult>;
2654
2725
  introspect(options?: {
2655
2726
  useCache?: boolean;
2656
2727
  postprocess?: boolean;
@@ -2701,7 +2772,7 @@ declare abstract class SqliteConnection<Driver = unknown, DB = any, Config exten
2701
2772
  onPostgrestAST(ast: AnyAST, vars?: VarsContext): Promise<AnyAST>;
2702
2773
  /**
2703
2774
  * Tables known to have RLS enabled in the APPLIED state of this database,
2704
- * without any deparse metadata: the migration history replayed in applied
2775
+ * without any runtime metadata: the migration history replayed in applied
2705
2776
  * order (`rlsEnabledTables`). Empty when ddlDialect isn't postgres or the
2706
2777
  * history isn't readable.
2707
2778
  */
@@ -2759,7 +2830,7 @@ interface MigrationHistoryRow {
2759
2830
  * - `sqlite`: bare sqlite driver — flat `migrations` + `seed_files` tables.
2760
2831
  */
2761
2832
  type HistoryVariant = "pg" | "pg-flat" | "sqlite";
2762
- declare function historyVariant(connection: Connection$1): HistoryVariant;
2833
+ declare function historyVariant(connection: Connection): HistoryVariant;
2763
2834
  /**
2764
2835
  * Idempotent raw-pg DDL for the migration-history system schema, parallel to
2765
2836
  * `getAuthSchemaSql` / `getStorageSchemaSql`. Fed into the system-schema module
@@ -2776,13 +2847,13 @@ declare function getMigrationHistorySchemaSql(variant: HistoryVariant): string;
2776
2847
  * columns on any pre-existing table, THEN create the unique index (which
2777
2848
  * references `idempotency_key`).
2778
2849
  */
2779
- declare function ensureHistoryTable(connection: Connection$1): Promise<void>;
2780
- declare function appliedVersions(connection: Connection$1): Promise<string[]>;
2781
- declare function recordVersion(connection: Connection$1, row: MigrationHistoryRow): Promise<void>;
2782
- declare function removeVersion(connection: Connection$1, version: string): Promise<void>;
2783
- declare function listHistory(connection: Connection$1): Promise<MigrationHistoryRow[]>;
2784
- declare function getVersion(connection: Connection$1, version: string): Promise<MigrationHistoryRow | null>;
2785
- declare function removeVersionsGte(connection: Connection$1, version: string): Promise<void>;
2850
+ declare function ensureHistoryTable(connection: Connection): Promise<void>;
2851
+ declare function appliedVersions(connection: Connection): Promise<string[]>;
2852
+ declare function recordVersion(connection: Connection, row: MigrationHistoryRow): Promise<void>;
2853
+ declare function removeVersion(connection: Connection, version: string): Promise<void>;
2854
+ declare function listHistory(connection: Connection): Promise<MigrationHistoryRow[]>;
2855
+ declare function getVersion(connection: Connection, version: string): Promise<MigrationHistoryRow | null>;
2856
+ declare function removeVersionsGte(connection: Connection, version: string): Promise<void>;
2786
2857
 
2787
2858
  type Primitive = string | number | boolean;
2788
2859
  declare function isPrimitive(value: any): value is Primitive;
@@ -2904,6 +2975,11 @@ declare function parseBigInt(value: BigInt | number): number;
2904
2975
 
2905
2976
  declare function uuid(): string;
2906
2977
 
2978
+ /** True only for IP addresses the OS routes over the local loopback interface. */
2979
+ declare function isLoopbackAddress(address: string): boolean;
2980
+ /** Hostnames that are unambiguously local without a DNS lookup. */
2981
+ declare function isLoopbackHostname(hostname: string): boolean;
2982
+
2907
2983
  declare function getAuthSchemaSql(clean?: boolean): string;
2908
2984
 
2909
2985
  declare const SUPABASE_AUTH_HELPERS_SQL = "\nCREATE SCHEMA IF NOT EXISTS auth;\n\nCREATE OR REPLACE FUNCTION auth.uid() RETURNS UUID AS $$\n SELECT NULLIF(current_setting('request.jwt.claim.sub', true), '')::uuid;\n$$ LANGUAGE SQL STABLE;\n\nCREATE OR REPLACE FUNCTION auth.role() RETURNS TEXT AS $$\n SELECT NULLIF(current_setting('request.jwt.claim.role', true), '');\n$$ LANGUAGE SQL STABLE;\n\nCREATE OR REPLACE FUNCTION auth.email() RETURNS TEXT AS $$\n SELECT NULLIF(current_setting('request.jwt.claim.email', true), '');\n$$ LANGUAGE SQL STABLE;\n\nCREATE OR REPLACE FUNCTION auth.jwt() RETURNS JSONB AS $$\n SELECT COALESCE(\n NULLIF(current_setting('request.jwt.claims', true), ''),\n '{}'\n )::jsonb;\n$$ LANGUAGE SQL STABLE;\n";
@@ -2931,4 +3007,4 @@ declare function isExperimentalEnabled(name: ExperimentalFeature): boolean;
2931
3007
  declare function setExperimental(name: ExperimentalFeature, enabled: boolean): void;
2932
3008
  declare function listEnabledExperimentals(): ExperimentalFeature[];
2933
3009
 
2934
- export { AnyAST, type ApiKeyResolver, type ApiKeyType, App, type AppDrivers, type AppDriversConfig, AwsSesEmailDriver, type AwsSesEmailDriverOptions, type BooleanLike, CacheDriver, CacheSetOptions, CloudConnection, CloudflareKvCacheDriver, type CloudflareKvCacheDriverOptions, Connection$1 as Connection, ConsoleEmailDriver, type ConsoleEmailDriverOptions, type DefaultAppConfig, type EmailDriver, type EmailMessage, type ExperimentalFeature, type GeneratedApiKey, type HistoryVariant, type HonoContext, type IAppConfig, type ICloudConnectionConfig, type ISqliteConnectionConfig, InMemoryEmailDriver, type InMemoryEmailDriverOptions, InMemoryLruCacheDriver, type InMemoryLruCacheDriverOptions, IntrospectResult, InvalidPostgresToSQLiteTranslation, type MatchPattern, type MaybePromise, MigrateScope, type MigrationHistoryRow, NoopSmsDriver, type NoopSmsDriverOptions, type PartialAppDrivers, type PersistedDeparseInfo, Policy, type PolicyCommand, type PolicyData, type PolicyRole, type Primitive, type RedisCacheClient, RedisCacheDriver, type RedisCacheDriverOptions, ResendEmailDriver, type ResendEmailDriverOptions, type ResolvedKey, SELF_HOSTED_PROJECT_REF, SUPABASE_AUTH_HELPERS_SQL, Schema, SendmailEmailDriver, type SendmailEmailDriverOptions, type ServerOptions, type SmsDriver, type SmsMessage, type SmtpAddress, type SmtpCreateTransport, SmtpEmailDriver, type SmtpEmailDriverOptions, type SmtpTransporter, SqliteConnection, type SqlitePostgresDeparseInfo, type SqlitePostgresTranslationResult, type StoredEmailMessage, TransactionOptions$1 as TransactionOptions, UnableToCreateRuntimeConnection, VarsContext, Where, apiKeyType, appliedVersions, assertSmtpSupportedRuntime, buildSmtpMail, buildSmtpTransportOptions, checkPasswordStrength, cleanSql, cloud, createAppDrivers, ensureHistoryTable, ensureVar, filterSearchParams, formatSendmailMessage, fuzzyMatch, generateApiKey, getAuthSchemaSql, getMigrationHistorySchemaSql, getPath, getStatementsArray, getStorageSchemaSql, getVersion, hashApiKey, historyVariant, invariant, isBooleanLike, isBun, isEmail, isEqual, isExperimentalEnabled, isNode, isObject, isPlainObject, isPrimitive, isString, isWorkerd, jsonStringify, listEnabledExperimentals, listHistory, measureTime, mergeObject, mergeObjectWith, normalizeDefault, normalizeSql, normalizeString, normalizeType, objectDiff, omit, params, parseBigInt, patternMatch, pick, pipe, pipeEach, quote, randomString, recordVersion, removeVersion, removeVersionsGte, replacePlaceholders, requireAuth, resolveAuth, setExperimental, setPath, slugify, snakeToPascalWithSpaces, splitSqlStatements, studioRouteHandler, tableStructuralItems, threw, threwAsync, translatePostgresDdl, truncate, trySync, ucFirst, ucFirstAll, uuid };
3010
+ export { AnyAST, type ApiKeyResolver, type ApiKeyType, App, type AppDrivers, type AppDriversConfig, type AppRequestContext, AwsSesEmailDriver, type AwsSesEmailDriverOptions, type BooleanLike, CacheDriver, CacheSetOptions, CloudConnection, CloudflareKvCacheDriver, type CloudflareKvCacheDriverOptions, Connection, ConsoleEmailDriver, type ConsoleEmailDriverOptions, type DefaultAppConfig, type EmailDriver, type EmailMessage, type ExperimentalFeature, type GeneratedApiKey, type HistoryVariant, type HonoContext, type IAppConfig, type ICloudConnectionConfig, type ISqliteConnectionConfig, InMemoryEmailDriver, type InMemoryEmailDriverOptions, InMemoryLruCacheDriver, type InMemoryLruCacheDriverOptions, IntrospectResult, InvalidPostgresToSQLiteTranslation, type MatchPattern, type MaybePromise, MigrateScope, type MigrationHistoryRow, NoopSmsDriver, type NoopSmsDriverOptions, type PartialAppDrivers, type PersistedDeparseInfo, Policy, type PolicyCommand, type PolicyData, type PolicyRole, type Primitive, type RedisCacheClient, RedisCacheDriver, type RedisCacheDriverOptions, ResendEmailDriver, type ResendEmailDriverOptions, type ResolvedKey, SELF_HOSTED_PROJECT_REF, SUPABASE_AUTH_HELPERS_SQL, Schema, SendmailEmailDriver, type SendmailEmailDriverOptions, type ServerOptions, type SmsDriver, type SmsMessage, type SmtpAddress, type SmtpCreateTransport, SmtpEmailDriver, type SmtpEmailDriverOptions, type SmtpTransporter, SqliteConnection, type SqlitePostgresDeparseInfo, type SqlitePostgresTranslationResult, type StoredEmailMessage, TransactionOptions$1 as TransactionOptions, UnableToCreateRuntimeConnection, VarsContext, Where, apiKeyType, appliedVersions, assertSmtpSupportedRuntime, buildSmtpMail, buildSmtpTransportOptions, checkPasswordStrength, cleanSql, cloud, createAppDrivers, ensureHistoryTable, ensureVar, filterSearchParams, formatSendmailMessage, fuzzyMatch, generateApiKey, getAuthSchemaSql, getMigrationHistorySchemaSql, getPath, getStatementsArray, getStorageSchemaSql, getVersion, hashApiKey, historyVariant, invariant, isBooleanLike, isBun, isEmail, isEqual, isExperimentalEnabled, isLoopbackAddress, isLoopbackHostname, isNode, isObject, isPlainObject, isPrimitive, isString, isWorkerd, jsonStringify, listEnabledExperimentals, listHistory, measureTime, mergeObject, mergeObjectWith, normalizeDefault, normalizeSql, normalizeString, normalizeType, objectDiff, omit, params, parseBigInt, patternMatch, pick, pipe, pipeEach, quote, randomString, recordVersion, removeVersion, removeVersionsGte, replacePlaceholders, requireAuth, resolveAuth, setExperimental, setPath, slugify, snakeToPascalWithSpaces, splitSqlStatements, studioRouteHandler, tableStructuralItems, threw, threwAsync, translatePostgresDdl, truncate, trySync, ucFirst, ucFirstAll, uuid };