@supabase/supabase-js 2.114.0 → 2.115.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/supabase-js",
3
- "version": "2.114.0",
3
+ "version": "2.115.0",
4
4
  "description": "Isomorphic Javascript SDK for Supabase",
5
5
  "keywords": [
6
6
  "javascript",
@@ -77,11 +77,11 @@
77
77
  "directory": "packages/core/supabase-js"
78
78
  },
79
79
  "dependencies": {
80
- "@supabase/auth-js": "2.114.0",
81
- "@supabase/postgrest-js": "2.114.0",
82
- "@supabase/realtime-js": "2.114.0",
83
- "@supabase/storage-js": "2.114.0",
84
- "@supabase/functions-js": "2.114.0"
80
+ "@supabase/auth-js": "2.115.0",
81
+ "@supabase/postgrest-js": "2.115.0",
82
+ "@supabase/storage-js": "2.115.0",
83
+ "@supabase/realtime-js": "2.115.0",
84
+ "@supabase/functions-js": "2.115.0"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@opentelemetry/api": ">=1.0.0"
@@ -3,7 +3,9 @@ import { FunctionsClient } from '@supabase/functions-js'
3
3
  import {
4
4
  PostgrestClient,
5
5
  type PostgrestFilterBuilder,
6
+ type PostgrestOpenApiSpec,
6
7
  type PostgrestQueryBuilder,
8
+ type PostgrestSingleResponse,
7
9
  } from '@supabase/postgrest-js'
8
10
  import {
9
11
  type RealtimeChannel,
@@ -461,6 +463,25 @@ export default class SupabaseClient<
461
463
  return this.rest.schema<DynamicSchema>(schema)
462
464
  }
463
465
 
466
+ // NOTE: signatures must be kept in sync with PostgrestClient.getOpenApiSpec
467
+ /**
468
+ * Fetch the OpenAPI description PostgREST publishes for this client's schema.
469
+ *
470
+ * The document lists only the tables, views and functions the caller's role
471
+ * holds privileges on. The request carries the same `apikey` and
472
+ * `Authorization` headers as every other query, so the description is scoped
473
+ * to the signed-in user. Call `.schema()` first to describe a schema other
474
+ * than the client default.
475
+ *
476
+ * @example
477
+ * ```ts
478
+ * const { data, error } = await supabase.getOpenApiSpec()
479
+ * ```
480
+ */
481
+ getOpenApiSpec(): Promise<PostgrestSingleResponse<PostgrestOpenApiSpec>> {
482
+ return this.rest.getOpenApiSpec()
483
+ }
484
+
464
485
  // NOTE: signatures must be kept in sync with PostgrestClient.rpc
465
486
  /**
466
487
  * Perform a function call.
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export type {
7
7
  PostgrestResponse,
8
8
  PostgrestSingleResponse,
9
9
  PostgrestMaybeSingleResponse,
10
+ PostgrestOpenApiSpec,
10
11
  PostgrestBuilder,
11
12
  PostgrestFilterBuilder,
12
13
  PostgrestTransformBuilder,
package/src/lib/types.ts CHANGED
@@ -108,6 +108,8 @@ export interface TracePropagationOptions {
108
108
  export type SupabaseClientOptions<SchemaName> = {
109
109
  /**
110
110
  * The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`.
111
+ *
112
+ * With generated `Database` types, this type-checks against schemas other than `public` only when the schema name is also passed as the second generic to `createClient`, e.g. `createClient<Database, 'myschema'>(url, key, { db: { schema: 'myschema' } })`. `supabase.schema('myschema').from(...)` infers its schema per call and needs no second generic.
111
113
  */
112
114
  db?: {
113
115
  schema?: SchemaName
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.114.0'
7
+ export const version = '2.115.0'