@supabase/supabase-js 2.58.0 → 2.71.2-canary.1

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 (73) hide show
  1. package/README.md +1 -1
  2. package/package.json +24 -28
  3. package/src/SupabaseClient.ts +11 -13
  4. package/src/index.ts +2 -2
  5. package/src/lib/helpers.ts +1 -26
  6. package/src/lib/types.ts +1 -9
  7. package/src/lib/version.ts +1 -1
  8. package/LICENSE +0 -21
  9. package/dist/main/SupabaseClient.d.ts +0 -131
  10. package/dist/main/SupabaseClient.d.ts.map +0 -1
  11. package/dist/main/SupabaseClient.js +0 -228
  12. package/dist/main/SupabaseClient.js.map +0 -1
  13. package/dist/main/index.d.ts +0 -24
  14. package/dist/main/index.d.ts.map +0 -1
  15. package/dist/main/index.js +0 -68
  16. package/dist/main/index.js.map +0 -1
  17. package/dist/main/lib/SupabaseAuthClient.d.ts +0 -6
  18. package/dist/main/lib/SupabaseAuthClient.d.ts.map +0 -1
  19. package/dist/main/lib/SupabaseAuthClient.js +0 -11
  20. package/dist/main/lib/SupabaseAuthClient.js.map +0 -1
  21. package/dist/main/lib/constants.d.ts +0 -16
  22. package/dist/main/lib/constants.d.ts.map +0 -1
  23. package/dist/main/lib/constants.js +0 -33
  24. package/dist/main/lib/constants.js.map +0 -1
  25. package/dist/main/lib/fetch.d.ts +0 -6
  26. package/dist/main/lib/fetch.d.ts.map +0 -1
  27. package/dist/main/lib/fetch.js +0 -76
  28. package/dist/main/lib/fetch.js.map +0 -1
  29. package/dist/main/lib/helpers.d.ts +0 -14
  30. package/dist/main/lib/helpers.d.ts.map +0 -1
  31. package/dist/main/lib/helpers.js +0 -71
  32. package/dist/main/lib/helpers.js.map +0 -1
  33. package/dist/main/lib/types.d.ts +0 -125
  34. package/dist/main/lib/types.d.ts.map +0 -1
  35. package/dist/main/lib/types.js +0 -3
  36. package/dist/main/lib/types.js.map +0 -1
  37. package/dist/main/lib/version.d.ts +0 -2
  38. package/dist/main/lib/version.d.ts.map +0 -1
  39. package/dist/main/lib/version.js +0 -5
  40. package/dist/main/lib/version.js.map +0 -1
  41. package/dist/module/SupabaseClient.d.ts +0 -131
  42. package/dist/module/SupabaseClient.d.ts.map +0 -1
  43. package/dist/module/SupabaseClient.js +0 -225
  44. package/dist/module/SupabaseClient.js.map +0 -1
  45. package/dist/module/index.d.ts +0 -24
  46. package/dist/module/index.d.ts.map +0 -1
  47. package/dist/module/index.js +0 -40
  48. package/dist/module/index.js.map +0 -1
  49. package/dist/module/lib/SupabaseAuthClient.d.ts +0 -6
  50. package/dist/module/lib/SupabaseAuthClient.d.ts.map +0 -1
  51. package/dist/module/lib/SupabaseAuthClient.js +0 -7
  52. package/dist/module/lib/SupabaseAuthClient.js.map +0 -1
  53. package/dist/module/lib/constants.d.ts +0 -16
  54. package/dist/module/lib/constants.d.ts.map +0 -1
  55. package/dist/module/lib/constants.js +0 -30
  56. package/dist/module/lib/constants.js.map +0 -1
  57. package/dist/module/lib/fetch.d.ts +0 -6
  58. package/dist/module/lib/fetch.d.ts.map +0 -1
  59. package/dist/module/lib/fetch.js +0 -47
  60. package/dist/module/lib/fetch.js.map +0 -1
  61. package/dist/module/lib/helpers.d.ts +0 -14
  62. package/dist/module/lib/helpers.d.ts.map +0 -1
  63. package/dist/module/lib/helpers.js +0 -63
  64. package/dist/module/lib/helpers.js.map +0 -1
  65. package/dist/module/lib/types.d.ts +0 -125
  66. package/dist/module/lib/types.d.ts.map +0 -1
  67. package/dist/module/lib/types.js +0 -2
  68. package/dist/module/lib/types.js.map +0 -1
  69. package/dist/module/lib/version.d.ts +0 -2
  70. package/dist/module/lib/version.d.ts.map +0 -1
  71. package/dist/module/lib/version.js +0 -2
  72. package/dist/module/lib/version.js.map +0 -1
  73. package/dist/umd/supabase.js +0 -1
@@ -1,125 +0,0 @@
1
- import { AuthClient } from '@supabase/auth-js';
2
- import { RealtimeClientOptions } from '@supabase/realtime-js';
3
- import { PostgrestError } from '@supabase/postgrest-js';
4
- import type { StorageClientOptions } from '@supabase/storage-js';
5
- declare type AuthClientOptions = ConstructorParameters<typeof AuthClient>[0];
6
- export interface SupabaseAuthClientOptions extends AuthClientOptions {
7
- }
8
- export declare type Fetch = typeof fetch;
9
- export declare type SupabaseClientOptions<SchemaName> = {
10
- /**
11
- * The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`.
12
- */
13
- db?: {
14
- schema?: SchemaName;
15
- };
16
- auth?: {
17
- /**
18
- * Automatically refreshes the token for logged-in users. Defaults to true.
19
- */
20
- autoRefreshToken?: boolean;
21
- /**
22
- * Optional key name used for storing tokens in local storage.
23
- */
24
- storageKey?: string;
25
- /**
26
- * Whether to persist a logged-in session to storage. Defaults to true.
27
- */
28
- persistSession?: boolean;
29
- /**
30
- * Detect a session from the URL. Used for OAuth login callbacks. Defaults to true.
31
- */
32
- detectSessionInUrl?: boolean;
33
- /**
34
- * A storage provider. Used to store the logged-in session.
35
- */
36
- storage?: SupabaseAuthClientOptions['storage'];
37
- /**
38
- * A storage provider to store the user profile separately from the session.
39
- * Useful when you need to store the session information in cookies,
40
- * without bloating the data with the redundant user object.
41
- *
42
- * @experimental
43
- */
44
- userStorage?: SupabaseAuthClientOptions['userStorage'];
45
- /**
46
- * OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications.
47
- */
48
- flowType?: SupabaseAuthClientOptions['flowType'];
49
- /**
50
- * If debug messages for authentication client are emitted. Can be used to inspect the behavior of the library.
51
- */
52
- debug?: SupabaseAuthClientOptions['debug'];
53
- /**
54
- * Provide your own locking mechanism based on the environment. By default no locking is done at this time.
55
- *
56
- * @experimental
57
- */
58
- lock?: SupabaseAuthClientOptions['lock'];
59
- };
60
- /**
61
- * Options passed to the realtime-js instance
62
- */
63
- realtime?: RealtimeClientOptions;
64
- storage?: StorageClientOptions;
65
- global?: {
66
- /**
67
- * A custom `fetch` implementation.
68
- */
69
- fetch?: Fetch;
70
- /**
71
- * Optional headers for initializing the client.
72
- */
73
- headers?: Record<string, string>;
74
- };
75
- /**
76
- * Optional function for using a third-party authentication system with
77
- * Supabase. The function should return an access token or ID token (JWT) by
78
- * obtaining it from the third-party auth client library. Note that this
79
- * function may be called concurrently and many times. Use memoization and
80
- * locking techniques if this is not supported by the client libraries.
81
- *
82
- * When set, the `auth` namespace of the Supabase client cannot be used.
83
- * Create another client if you wish to use Supabase Auth and third-party
84
- * authentications concurrently in the same application.
85
- */
86
- accessToken?: () => Promise<string | null>;
87
- };
88
- export declare type GenericRelationship = {
89
- foreignKeyName: string;
90
- columns: string[];
91
- isOneToOne?: boolean;
92
- referencedRelation: string;
93
- referencedColumns: string[];
94
- };
95
- export declare type GenericTable = {
96
- Row: Record<string, unknown>;
97
- Insert: Record<string, unknown>;
98
- Update: Record<string, unknown>;
99
- Relationships: GenericRelationship[];
100
- };
101
- export declare type GenericUpdatableView = GenericTable;
102
- export declare type GenericNonUpdatableView = {
103
- Row: Record<string, unknown>;
104
- Relationships: GenericRelationship[];
105
- };
106
- export declare type GenericView = GenericUpdatableView | GenericNonUpdatableView;
107
- export declare type GenericFunction = {
108
- Args: Record<string, unknown>;
109
- Returns: unknown;
110
- };
111
- export declare type GenericSchema = {
112
- Tables: Record<string, GenericTable>;
113
- Views: Record<string, GenericView>;
114
- Functions: Record<string, GenericFunction>;
115
- };
116
- /**
117
- * Helper types for query results.
118
- */
119
- export declare type QueryResult<T> = T extends PromiseLike<infer U> ? U : never;
120
- export declare type QueryData<T> = T extends PromiseLike<{
121
- data: infer U;
122
- }> ? Exclude<U, null> : never;
123
- export declare type QueryError = PostgrestError;
124
- export {};
125
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D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,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AACvE,oBAAY,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAA;AAC9F,oBAAY,UAAU,GAAG,cAAc,CAAA"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export declare const version = "2.58.0";
2
- //# sourceMappingURL=version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,oBAAoB,CAAA"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.version = void 0;
4
- exports.version = '2.58.0';
5
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,iBAAiB,CAAA"}
@@ -1,131 +0,0 @@
1
- import { FunctionsClient } from '@supabase/functions-js';
2
- import { PostgrestClient, PostgrestFilterBuilder, PostgrestQueryBuilder } from '@supabase/postgrest-js';
3
- import { RealtimeChannel, RealtimeChannelOptions, RealtimeClient } from '@supabase/realtime-js';
4
- import { StorageClient as SupabaseStorageClient } from '@supabase/storage-js';
5
- import { SupabaseAuthClient } from './lib/SupabaseAuthClient';
6
- import { Fetch, GenericSchema, SupabaseClientOptions } from './lib/types';
7
- /**
8
- * Supabase Client.
9
- *
10
- * An isomorphic Javascript client for interacting with Postgres.
11
- */
12
- export default class SupabaseClient<Database = any, SchemaNameOrClientOptions extends (string & keyof Omit<Database, '__InternalSupabase'>) | {
13
- PostgrestVersion: string;
14
- } = 'public' extends keyof Omit<Database, '__InternalSupabase'> ? 'public' : string & keyof Omit<Database, '__InternalSupabase'>, SchemaName extends string & keyof Omit<Database, '__InternalSupabase'> = SchemaNameOrClientOptions extends string & keyof Omit<Database, '__InternalSupabase'> ? SchemaNameOrClientOptions : 'public' extends keyof Omit<Database, '__InternalSupabase'> ? 'public' : string & keyof Omit<Omit<Database, '__InternalSupabase'>, '__InternalSupabase'>, Schema extends Omit<Database, '__InternalSupabase'>[SchemaName] extends GenericSchema ? Omit<Database, '__InternalSupabase'>[SchemaName] : never = Omit<Database, '__InternalSupabase'>[SchemaName] extends GenericSchema ? Omit<Database, '__InternalSupabase'>[SchemaName] : never, ClientOptions extends {
15
- PostgrestVersion: string;
16
- } = SchemaNameOrClientOptions extends string & keyof Omit<Database, '__InternalSupabase'> ? Database extends {
17
- __InternalSupabase: {
18
- PostgrestVersion: string;
19
- };
20
- } ? Database['__InternalSupabase'] : {
21
- PostgrestVersion: '12';
22
- } : SchemaNameOrClientOptions extends {
23
- PostgrestVersion: string;
24
- } ? SchemaNameOrClientOptions : never> {
25
- protected supabaseUrl: string;
26
- protected supabaseKey: string;
27
- /**
28
- * Supabase Auth allows you to create and manage user sessions for access to data that is secured by access policies.
29
- */
30
- auth: SupabaseAuthClient;
31
- realtime: RealtimeClient;
32
- /**
33
- * Supabase Storage allows you to manage user-generated content, such as photos or videos.
34
- */
35
- storage: SupabaseStorageClient;
36
- protected realtimeUrl: URL;
37
- protected authUrl: URL;
38
- protected storageUrl: URL;
39
- protected functionsUrl: URL;
40
- protected rest: PostgrestClient<Database, ClientOptions, SchemaName>;
41
- protected storageKey: string;
42
- protected fetch?: Fetch;
43
- protected changedAccessToken?: string;
44
- protected accessToken?: () => Promise<string | null>;
45
- protected headers: Record<string, string>;
46
- /**
47
- * Create a new client for use in the browser.
48
- * @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.
49
- * @param supabaseKey The unique Supabase Key which is supplied when you create a new project in your project dashboard.
50
- * @param options.db.schema You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.
51
- * @param options.auth.autoRefreshToken Set to "true" if you want to automatically refresh the token before expiring.
52
- * @param options.auth.persistSession Set to "true" if you want to automatically save the user session into local storage.
53
- * @param options.auth.detectSessionInUrl Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.
54
- * @param options.realtime Options passed along to realtime-js constructor.
55
- * @param options.storage Options passed along to the storage-js constructor.
56
- * @param options.global.fetch A custom fetch implementation.
57
- * @param options.global.headers Any additional headers to send with each network request.
58
- */
59
- constructor(supabaseUrl: string, supabaseKey: string, options?: SupabaseClientOptions<SchemaName>);
60
- /**
61
- * Supabase Functions allows you to deploy and invoke edge functions.
62
- */
63
- get functions(): FunctionsClient;
64
- from<TableName extends string & keyof Schema['Tables'], Table extends Schema['Tables'][TableName]>(relation: TableName): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>;
65
- from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(relation: ViewName): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName>;
66
- /**
67
- * Select a schema to query or perform an function (rpc) call.
68
- *
69
- * The schema needs to be on the list of exposed schemas inside Supabase.
70
- *
71
- * @param schema - The schema to query
72
- */
73
- schema<DynamicSchema extends string & keyof Omit<Database, '__InternalSupabase'>>(schema: DynamicSchema): PostgrestClient<Database, ClientOptions, DynamicSchema, Database[DynamicSchema] extends GenericSchema ? Database[DynamicSchema] : any>;
74
- /**
75
- * Perform a function call.
76
- *
77
- * @param fn - The function name to call
78
- * @param args - The arguments to pass to the function call
79
- * @param options - Named parameters
80
- * @param options.head - When set to `true`, `data` will not be returned.
81
- * Useful if you only need the count.
82
- * @param options.get - When set to `true`, the function will be called with
83
- * read-only access mode.
84
- * @param options.count - Count algorithm to use to count rows returned by the
85
- * function. Only applicable for [set-returning
86
- * functions](https://www.postgresql.org/docs/current/functions-srf.html).
87
- *
88
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
89
- * hood.
90
- *
91
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
92
- * statistics under the hood.
93
- *
94
- * `"estimated"`: Uses exact count for low numbers and planned count for high
95
- * numbers.
96
- */
97
- rpc<FnName extends string & keyof Schema['Functions'], Fn extends Schema['Functions'][FnName]>(fn: FnName, args?: Fn['Args'], options?: {
98
- head?: boolean;
99
- get?: boolean;
100
- count?: 'exact' | 'planned' | 'estimated';
101
- }): PostgrestFilterBuilder<ClientOptions, Schema, Fn['Returns'] extends any[] ? Fn['Returns'][number] extends Record<string, unknown> ? Fn['Returns'][number] : never : never, Fn['Returns'], FnName, null, 'RPC'>;
102
- /**
103
- * Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.
104
- *
105
- * @param {string} name - The name of the Realtime channel.
106
- * @param {Object} opts - The options to pass to the Realtime channel.
107
- *
108
- */
109
- channel(name: string, opts?: RealtimeChannelOptions): RealtimeChannel;
110
- /**
111
- * Returns all Realtime channels.
112
- */
113
- getChannels(): RealtimeChannel[];
114
- /**
115
- * Unsubscribes and removes Realtime channel from Realtime client.
116
- *
117
- * @param {RealtimeChannel} channel - The name of the Realtime channel.
118
- *
119
- */
120
- removeChannel(channel: RealtimeChannel): Promise<'ok' | 'timed out' | 'error'>;
121
- /**
122
- * Unsubscribes and removes all Realtime channels from Realtime client.
123
- */
124
- removeAllChannels(): Promise<('ok' | 'timed out' | 'error')[]>;
125
- private _getAccessToken;
126
- private _initSupabaseAuthClient;
127
- private _initRealtimeClient;
128
- private _listenForAuthEvents;
129
- private _handleTokenChanged;
130
- }
131
- //# sourceMappingURL=SupabaseClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupabaseClient.d.ts","sourceRoot":"","sources":["../../src/SupabaseClient.ts"],"names":[],"mappings":"AAAA,OAA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B,OAAO,GAAE;QACP,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,GAAG,CAAC,EAAE,OAAO,CAAA;QACb,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAA;KACrC,GACL,sBAAsB,CACvB,aAAa,EACb,MAAM,EACN,EAAE,CAAC,SAAS,CAAC,SAAS,GAAG,EAAE,GACvB,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnD,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GACrB,KAAK,GACP,KAAK,EACT,EAAE,CAAC,SAAS,CAAC,EACb,MAAM,EACN,IAAI,EACJ,KAAK,CACN;IAID;;;;;;OAMG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,sBAAuC,GAAG,eAAe;IAIrF;;OAEG;IACH,WAAW,IAAI,eAAe,EAAE;IAIhC;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,GAAG,WAAW,GAAG,OAAO,CAAC;IAI9E;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,CAAC,IAAI,GAAG,WAAW,GAAG,OAAO,CAAC,EAAE,CAAC;YAIhD,eAAe;IAU7B,OAAO,CAAC,uBAAuB;IAwC/B,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,mBAAmB;CAiB5B"}
@@ -1,225 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { FunctionsClient } from '@supabase/functions-js';
11
- import { PostgrestClient, } from '@supabase/postgrest-js';
12
- import { RealtimeClient, } from '@supabase/realtime-js';
13
- import { StorageClient as SupabaseStorageClient } from '@supabase/storage-js';
14
- import { DEFAULT_GLOBAL_OPTIONS, DEFAULT_DB_OPTIONS, DEFAULT_AUTH_OPTIONS, DEFAULT_REALTIME_OPTIONS, } from './lib/constants';
15
- import { fetchWithAuth } from './lib/fetch';
16
- import { applySettingDefaults, validateSupabaseUrl } from './lib/helpers';
17
- import { SupabaseAuthClient } from './lib/SupabaseAuthClient';
18
- /**
19
- * Supabase Client.
20
- *
21
- * An isomorphic Javascript client for interacting with Postgres.
22
- */
23
- export default class SupabaseClient {
24
- /**
25
- * Create a new client for use in the browser.
26
- * @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.
27
- * @param supabaseKey The unique Supabase Key which is supplied when you create a new project in your project dashboard.
28
- * @param options.db.schema You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.
29
- * @param options.auth.autoRefreshToken Set to "true" if you want to automatically refresh the token before expiring.
30
- * @param options.auth.persistSession Set to "true" if you want to automatically save the user session into local storage.
31
- * @param options.auth.detectSessionInUrl Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.
32
- * @param options.realtime Options passed along to realtime-js constructor.
33
- * @param options.storage Options passed along to the storage-js constructor.
34
- * @param options.global.fetch A custom fetch implementation.
35
- * @param options.global.headers Any additional headers to send with each network request.
36
- */
37
- constructor(supabaseUrl, supabaseKey, options) {
38
- var _a, _b, _c;
39
- this.supabaseUrl = supabaseUrl;
40
- this.supabaseKey = supabaseKey;
41
- const baseUrl = validateSupabaseUrl(supabaseUrl);
42
- if (!supabaseKey)
43
- throw new Error('supabaseKey is required.');
44
- this.realtimeUrl = new URL('realtime/v1', baseUrl);
45
- this.realtimeUrl.protocol = this.realtimeUrl.protocol.replace('http', 'ws');
46
- this.authUrl = new URL('auth/v1', baseUrl);
47
- this.storageUrl = new URL('storage/v1', baseUrl);
48
- this.functionsUrl = new URL('functions/v1', baseUrl);
49
- // default storage key uses the supabase project ref as a namespace
50
- const defaultStorageKey = `sb-${baseUrl.hostname.split('.')[0]}-auth-token`;
51
- const DEFAULTS = {
52
- db: DEFAULT_DB_OPTIONS,
53
- realtime: DEFAULT_REALTIME_OPTIONS,
54
- auth: Object.assign(Object.assign({}, DEFAULT_AUTH_OPTIONS), { storageKey: defaultStorageKey }),
55
- global: DEFAULT_GLOBAL_OPTIONS,
56
- };
57
- const settings = applySettingDefaults(options !== null && options !== void 0 ? options : {}, DEFAULTS);
58
- this.storageKey = (_a = settings.auth.storageKey) !== null && _a !== void 0 ? _a : '';
59
- this.headers = (_b = settings.global.headers) !== null && _b !== void 0 ? _b : {};
60
- if (!settings.accessToken) {
61
- this.auth = this._initSupabaseAuthClient((_c = settings.auth) !== null && _c !== void 0 ? _c : {}, this.headers, settings.global.fetch);
62
- }
63
- else {
64
- this.accessToken = settings.accessToken;
65
- this.auth = new Proxy({}, {
66
- get: (_, prop) => {
67
- throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(prop)} is not possible`);
68
- },
69
- });
70
- }
71
- this.fetch = fetchWithAuth(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch);
72
- this.realtime = this._initRealtimeClient(Object.assign({ headers: this.headers, accessToken: this._getAccessToken.bind(this) }, settings.realtime));
73
- this.rest = new PostgrestClient(new URL('rest/v1', baseUrl).href, {
74
- headers: this.headers,
75
- schema: settings.db.schema,
76
- fetch: this.fetch,
77
- });
78
- this.storage = new SupabaseStorageClient(this.storageUrl.href, this.headers, this.fetch, options === null || options === void 0 ? void 0 : options.storage);
79
- if (!settings.accessToken) {
80
- this._listenForAuthEvents();
81
- }
82
- }
83
- /**
84
- * Supabase Functions allows you to deploy and invoke edge functions.
85
- */
86
- get functions() {
87
- return new FunctionsClient(this.functionsUrl.href, {
88
- headers: this.headers,
89
- customFetch: this.fetch,
90
- });
91
- }
92
- /**
93
- * Perform a query on a table or a view.
94
- *
95
- * @param relation - The table or view name to query
96
- */
97
- from(relation) {
98
- return this.rest.from(relation);
99
- }
100
- // NOTE: signatures must be kept in sync with PostgrestClient.schema
101
- /**
102
- * Select a schema to query or perform an function (rpc) call.
103
- *
104
- * The schema needs to be on the list of exposed schemas inside Supabase.
105
- *
106
- * @param schema - The schema to query
107
- */
108
- schema(schema) {
109
- return this.rest.schema(schema);
110
- }
111
- // NOTE: signatures must be kept in sync with PostgrestClient.rpc
112
- /**
113
- * Perform a function call.
114
- *
115
- * @param fn - The function name to call
116
- * @param args - The arguments to pass to the function call
117
- * @param options - Named parameters
118
- * @param options.head - When set to `true`, `data` will not be returned.
119
- * Useful if you only need the count.
120
- * @param options.get - When set to `true`, the function will be called with
121
- * read-only access mode.
122
- * @param options.count - Count algorithm to use to count rows returned by the
123
- * function. Only applicable for [set-returning
124
- * functions](https://www.postgresql.org/docs/current/functions-srf.html).
125
- *
126
- * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
127
- * hood.
128
- *
129
- * `"planned"`: Approximated but fast count algorithm. Uses the Postgres
130
- * statistics under the hood.
131
- *
132
- * `"estimated"`: Uses exact count for low numbers and planned count for high
133
- * numbers.
134
- */
135
- rpc(fn, args = {}, options = {}) {
136
- return this.rest.rpc(fn, args, options);
137
- }
138
- /**
139
- * Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.
140
- *
141
- * @param {string} name - The name of the Realtime channel.
142
- * @param {Object} opts - The options to pass to the Realtime channel.
143
- *
144
- */
145
- channel(name, opts = { config: {} }) {
146
- return this.realtime.channel(name, opts);
147
- }
148
- /**
149
- * Returns all Realtime channels.
150
- */
151
- getChannels() {
152
- return this.realtime.getChannels();
153
- }
154
- /**
155
- * Unsubscribes and removes Realtime channel from Realtime client.
156
- *
157
- * @param {RealtimeChannel} channel - The name of the Realtime channel.
158
- *
159
- */
160
- removeChannel(channel) {
161
- return this.realtime.removeChannel(channel);
162
- }
163
- /**
164
- * Unsubscribes and removes all Realtime channels from Realtime client.
165
- */
166
- removeAllChannels() {
167
- return this.realtime.removeAllChannels();
168
- }
169
- _getAccessToken() {
170
- var _a, _b;
171
- return __awaiter(this, void 0, void 0, function* () {
172
- if (this.accessToken) {
173
- return yield this.accessToken();
174
- }
175
- const { data } = yield this.auth.getSession();
176
- return (_b = (_a = data.session) === null || _a === void 0 ? void 0 : _a.access_token) !== null && _b !== void 0 ? _b : this.supabaseKey;
177
- });
178
- }
179
- _initSupabaseAuthClient({ autoRefreshToken, persistSession, detectSessionInUrl, storage, userStorage, storageKey, flowType, lock, debug, }, headers, fetch) {
180
- const authHeaders = {
181
- Authorization: `Bearer ${this.supabaseKey}`,
182
- apikey: `${this.supabaseKey}`,
183
- };
184
- return new SupabaseAuthClient({
185
- url: this.authUrl.href,
186
- headers: Object.assign(Object.assign({}, authHeaders), headers),
187
- storageKey: storageKey,
188
- autoRefreshToken,
189
- persistSession,
190
- detectSessionInUrl,
191
- storage,
192
- userStorage,
193
- flowType,
194
- lock,
195
- debug,
196
- fetch,
197
- // auth checks if there is a custom authorizaiton header using this flag
198
- // so it knows whether to return an error when getUser is called with no session
199
- hasCustomAuthorizationHeader: Object.keys(this.headers).some((key) => key.toLowerCase() === 'authorization'),
200
- });
201
- }
202
- _initRealtimeClient(options) {
203
- return new RealtimeClient(this.realtimeUrl.href, Object.assign(Object.assign({}, options), { params: Object.assign({ apikey: this.supabaseKey }, options === null || options === void 0 ? void 0 : options.params) }));
204
- }
205
- _listenForAuthEvents() {
206
- let data = this.auth.onAuthStateChange((event, session) => {
207
- this._handleTokenChanged(event, 'CLIENT', session === null || session === void 0 ? void 0 : session.access_token);
208
- });
209
- return data;
210
- }
211
- _handleTokenChanged(event, source, token) {
212
- if ((event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') &&
213
- this.changedAccessToken !== token) {
214
- this.changedAccessToken = token;
215
- this.realtime.setAuth(token);
216
- }
217
- else if (event === 'SIGNED_OUT') {
218
- this.realtime.setAuth();
219
- if (source == 'STORAGE')
220
- this.auth.signOut();
221
- this.changedAccessToken = undefined;
222
- }
223
- }
224
- }
225
- //# sourceMappingURL=SupabaseClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupabaseClient.js","sourceRoot":"","sources":["../../src/SupabaseClient.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EACL,eAAe,GAGhB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAGL,cAAc,GAEf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC7E,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAG7D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IAuDjC;;;;;;;;;;;;OAYG;IACH,YACY,WAAmB,EACnB,WAAmB,EAC7B,OAA2C;;QAFjC,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAQ;QAG7B,MAAM,OAAO,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAA;QAChD,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAE7D,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;QAClD,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC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AAA;QAClE,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEO,mBAAmB,CACzB,KAAsB,EACtB,MAA4B,EAC5B,KAAc;QAEd,IACE,CAAC,KAAK,KAAK,iBAAiB,IAAI,KAAK,KAAK,WAAW,CAAC;YACtD,IAAI,CAAC,kBAAkB,KAAK,KAAK,EACjC;YACA,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAA;YAC/B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;SAC7B;aAAM,IAAI,KAAK,KAAK,YAAY,EAAE;YACjC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAA;YACvB,IAAI,MAAM,IAAI,SAAS;gBAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;YAC5C,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAA;SACpC;IACH,CAAC;CACF"}
@@ -1,24 +0,0 @@
1
- import SupabaseClient from './SupabaseClient';
2
- import type { SupabaseClientOptions } from './lib/types';
3
- export * from '@supabase/auth-js';
4
- export type { User as AuthUser, Session as AuthSession } from '@supabase/auth-js';
5
- export { type PostgrestResponse, type PostgrestSingleResponse, type PostgrestMaybeSingleResponse, PostgrestError, } from '@supabase/postgrest-js';
6
- export { FunctionsHttpError, FunctionsFetchError, FunctionsRelayError, FunctionsError, type FunctionInvokeOptions, FunctionRegion, } from '@supabase/functions-js';
7
- export * from '@supabase/realtime-js';
8
- export { default as SupabaseClient } from './SupabaseClient';
9
- export type { SupabaseClientOptions, QueryResult, QueryData, QueryError } from './lib/types';
10
- /**
11
- * Creates a new Supabase Client.
12
- */
13
- export declare const createClient: <Database = any, SchemaNameOrClientOptions extends (string & Exclude<keyof Database, "__InternalSupabase">) | {
14
- PostgrestVersion: string;
15
- } = "public" extends Exclude<keyof Database, "__InternalSupabase"> ? "public" : string & Exclude<keyof Database, "__InternalSupabase">, SchemaName extends string & Exclude<keyof Database, "__InternalSupabase"> = SchemaNameOrClientOptions extends string & Exclude<keyof Database, "__InternalSupabase"> ? SchemaNameOrClientOptions : "public" extends Exclude<keyof Database, "__InternalSupabase"> ? "public" : string & Exclude<Exclude<keyof Database, "__InternalSupabase">, "__InternalSupabase">>(supabaseUrl: string, supabaseKey: string, options?: SupabaseClientOptions<SchemaName> | undefined) => SupabaseClient<Database, SchemaNameOrClientOptions, SchemaName, Omit<Database, "__InternalSupabase">[SchemaName] extends import("./lib/types").GenericSchema ? Omit<Database, "__InternalSupabase">[SchemaName] : never, SchemaNameOrClientOptions extends string & Exclude<keyof Database, "__InternalSupabase"> ? Database extends {
16
- __InternalSupabase: {
17
- PostgrestVersion: string;
18
- };
19
- } ? Database["__InternalSupabase"] : {
20
- PostgrestVersion: "12";
21
- } : SchemaNameOrClientOptions extends {
22
- PostgrestVersion: string;
23
- } ? SchemaNameOrClientOptions : never>;
24
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD,cAAc,mBAAmB,CAAA;AACjC,YAAY,EAAE,IAAI,IAAI,QAAQ,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACjF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,cAAc,GACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,KAAK,qBAAqB,EAC1B,cAAc,GACf,MAAM,wBAAwB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5D,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE5F;;GAEG;AACH,eAAO,MAAM,YAAY;sBAIC,MAAM;2fAWjB,MAAM,eACN,MAAM;;;;;;;;sCAQpB,CAAA"}
@@ -1,40 +0,0 @@
1
- import SupabaseClient from './SupabaseClient';
2
- export * from '@supabase/auth-js';
3
- export { PostgrestError, } from '@supabase/postgrest-js';
4
- export { FunctionsHttpError, FunctionsFetchError, FunctionsRelayError, FunctionsError, FunctionRegion, } from '@supabase/functions-js';
5
- export * from '@supabase/realtime-js';
6
- export { default as SupabaseClient } from './SupabaseClient';
7
- /**
8
- * Creates a new Supabase Client.
9
- */
10
- export const createClient = (supabaseUrl, supabaseKey, options) => {
11
- return new SupabaseClient(supabaseUrl, supabaseKey, options);
12
- };
13
- // Check for Node.js <= 18 deprecation
14
- function shouldShowDeprecationWarning() {
15
- // Skip in browser environments
16
- if (typeof window !== 'undefined') {
17
- return false;
18
- }
19
- // Skip if process is not available (e.g., Edge Runtime)
20
- if (typeof process === 'undefined') {
21
- return false;
22
- }
23
- // Use dynamic property access to avoid Next.js Edge Runtime static analysis warnings
24
- const processVersion = process['version'];
25
- if (processVersion === undefined || processVersion === null) {
26
- return false;
27
- }
28
- const versionMatch = processVersion.match(/^v(\d+)\./);
29
- if (!versionMatch) {
30
- return false;
31
- }
32
- const majorVersion = parseInt(versionMatch[1], 10);
33
- return majorVersion <= 18;
34
- }
35
- if (shouldShowDeprecationWarning()) {
36
- console.warn(`⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +
37
- `Please upgrade to Node.js 20 or later. ` +
38
- `For more information, visit: https://github.com/orgs/supabase/discussions/37217`);
39
- }
40
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAG7C,cAAc,mBAAmB,CAAA;AAE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Options } from './types';
3
- export declare class SupabaseAuthClient extends AuthClient {
4
- constructor(options: SupabaseAuthClientOptions);
5
- }
6
- //# sourceMappingURL=SupabaseAuthClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupabaseAuthClient.d.ts","sourceRoot":"","sources":["../../../src/lib/SupabaseAuthClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAEnD,qBAAa,kBAAmB,SAAQ,UAAU;gBACpC,OAAO,EAAE,yBAAyB;CAG/C"}
@@ -1,7 +0,0 @@
1
- import { AuthClient } from '@supabase/auth-js';
2
- export class SupabaseAuthClient extends AuthClient {
3
- constructor(options) {
4
- super(options);
5
- }
6
- }
7
- //# sourceMappingURL=SupabaseAuthClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupabaseAuthClient.js","sourceRoot":"","sources":["../../../src/lib/SupabaseAuthClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG9C,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAChD,YAAY,OAAkC;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;CACF"}