1/5/1404
This commit is contained in:
+233
@@ -0,0 +1,233 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const functions_js_1 = require("@supabase/functions-js");
|
||||
const postgrest_js_1 = require("@supabase/postgrest-js");
|
||||
const realtime_js_1 = require("@supabase/realtime-js");
|
||||
const storage_js_1 = require("@supabase/storage-js");
|
||||
const constants_1 = require("./lib/constants");
|
||||
const fetch_1 = require("./lib/fetch");
|
||||
const helpers_1 = require("./lib/helpers");
|
||||
const SupabaseAuthClient_1 = require("./lib/SupabaseAuthClient");
|
||||
/**
|
||||
* Supabase Client.
|
||||
*
|
||||
* An isomorphic Javascript client for interacting with Postgres.
|
||||
*/
|
||||
class SupabaseClient {
|
||||
/**
|
||||
* Create a new client for use in the browser.
|
||||
* @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.
|
||||
* @param supabaseKey The unique Supabase Key which is supplied when you create a new project in your project dashboard.
|
||||
* @param options.db.schema You can switch in between schemas. The schema needs to be on the list of exposed schemas inside Supabase.
|
||||
* @param options.auth.autoRefreshToken Set to "true" if you want to automatically refresh the token before expiring.
|
||||
* @param options.auth.persistSession Set to "true" if you want to automatically save the user session into local storage.
|
||||
* @param options.auth.detectSessionInUrl Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.
|
||||
* @param options.realtime Options passed along to realtime-js constructor.
|
||||
* @param options.global.fetch A custom fetch implementation.
|
||||
* @param options.global.headers Any additional headers to send with each network request.
|
||||
*/
|
||||
constructor(supabaseUrl, supabaseKey, options) {
|
||||
var _a, _b, _c;
|
||||
this.supabaseUrl = supabaseUrl;
|
||||
this.supabaseKey = supabaseKey;
|
||||
if (!supabaseUrl)
|
||||
throw new Error('supabaseUrl is required.');
|
||||
if (!supabaseKey)
|
||||
throw new Error('supabaseKey is required.');
|
||||
const _supabaseUrl = (0, helpers_1.ensureTrailingSlash)(supabaseUrl);
|
||||
const baseUrl = new URL(_supabaseUrl);
|
||||
this.realtimeUrl = new URL('realtime/v1', baseUrl);
|
||||
this.realtimeUrl.protocol = this.realtimeUrl.protocol.replace('http', 'ws');
|
||||
this.authUrl = new URL('auth/v1', baseUrl);
|
||||
this.storageUrl = new URL('storage/v1', baseUrl);
|
||||
this.functionsUrl = new URL('functions/v1', baseUrl);
|
||||
// default storage key uses the supabase project ref as a namespace
|
||||
const defaultStorageKey = `sb-${baseUrl.hostname.split('.')[0]}-auth-token`;
|
||||
const DEFAULTS = {
|
||||
db: constants_1.DEFAULT_DB_OPTIONS,
|
||||
realtime: constants_1.DEFAULT_REALTIME_OPTIONS,
|
||||
auth: Object.assign(Object.assign({}, constants_1.DEFAULT_AUTH_OPTIONS), { storageKey: defaultStorageKey }),
|
||||
global: constants_1.DEFAULT_GLOBAL_OPTIONS,
|
||||
};
|
||||
const settings = (0, helpers_1.applySettingDefaults)(options !== null && options !== void 0 ? options : {}, DEFAULTS);
|
||||
this.storageKey = (_a = settings.auth.storageKey) !== null && _a !== void 0 ? _a : '';
|
||||
this.headers = (_b = settings.global.headers) !== null && _b !== void 0 ? _b : {};
|
||||
if (!settings.accessToken) {
|
||||
this.auth = this._initSupabaseAuthClient((_c = settings.auth) !== null && _c !== void 0 ? _c : {}, this.headers, settings.global.fetch);
|
||||
}
|
||||
else {
|
||||
this.accessToken = settings.accessToken;
|
||||
this.auth = new Proxy({}, {
|
||||
get: (_, prop) => {
|
||||
throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(prop)} is not possible`);
|
||||
},
|
||||
});
|
||||
}
|
||||
this.fetch = (0, fetch_1.fetchWithAuth)(supabaseKey, this._getAccessToken.bind(this), settings.global.fetch);
|
||||
this.realtime = this._initRealtimeClient(Object.assign({ headers: this.headers, accessToken: this._getAccessToken.bind(this) }, settings.realtime));
|
||||
this.rest = new postgrest_js_1.PostgrestClient(new URL('rest/v1', baseUrl).href, {
|
||||
headers: this.headers,
|
||||
schema: settings.db.schema,
|
||||
fetch: this.fetch,
|
||||
});
|
||||
if (!settings.accessToken) {
|
||||
this._listenForAuthEvents();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Supabase Functions allows you to deploy and invoke edge functions.
|
||||
*/
|
||||
get functions() {
|
||||
return new functions_js_1.FunctionsClient(this.functionsUrl.href, {
|
||||
headers: this.headers,
|
||||
customFetch: this.fetch,
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Supabase Storage allows you to manage user-generated content, such as photos or videos.
|
||||
*/
|
||||
get storage() {
|
||||
return new storage_js_1.StorageClient(this.storageUrl.href, this.headers, this.fetch);
|
||||
}
|
||||
/**
|
||||
* Perform a query on a table or a view.
|
||||
*
|
||||
* @param relation - The table or view name to query
|
||||
*/
|
||||
from(relation) {
|
||||
return this.rest.from(relation);
|
||||
}
|
||||
// NOTE: signatures must be kept in sync with PostgrestClient.schema
|
||||
/**
|
||||
* Select a schema to query or perform an function (rpc) call.
|
||||
*
|
||||
* The schema needs to be on the list of exposed schemas inside Supabase.
|
||||
*
|
||||
* @param schema - The schema to query
|
||||
*/
|
||||
schema(schema) {
|
||||
return this.rest.schema(schema);
|
||||
}
|
||||
// NOTE: signatures must be kept in sync with PostgrestClient.rpc
|
||||
/**
|
||||
* Perform a function call.
|
||||
*
|
||||
* @param fn - The function name to call
|
||||
* @param args - The arguments to pass to the function call
|
||||
* @param options - Named parameters
|
||||
* @param options.head - When set to `true`, `data` will not be returned.
|
||||
* Useful if you only need the count.
|
||||
* @param options.get - When set to `true`, the function will be called with
|
||||
* read-only access mode.
|
||||
* @param options.count - Count algorithm to use to count rows returned by the
|
||||
* function. Only applicable for [set-returning
|
||||
* functions](https://www.postgresql.org/docs/current/functions-srf.html).
|
||||
*
|
||||
* `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
|
||||
* hood.
|
||||
*
|
||||
* `"planned"`: Approximated but fast count algorithm. Uses the Postgres
|
||||
* statistics under the hood.
|
||||
*
|
||||
* `"estimated"`: Uses exact count for low numbers and planned count for high
|
||||
* numbers.
|
||||
*/
|
||||
rpc(fn, args = {}, options = {}) {
|
||||
return this.rest.rpc(fn, args, options);
|
||||
}
|
||||
/**
|
||||
* Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.
|
||||
*
|
||||
* @param {string} name - The name of the Realtime channel.
|
||||
* @param {Object} opts - The options to pass to the Realtime channel.
|
||||
*
|
||||
*/
|
||||
channel(name, opts = { config: {} }) {
|
||||
return this.realtime.channel(name, opts);
|
||||
}
|
||||
/**
|
||||
* Returns all Realtime channels.
|
||||
*/
|
||||
getChannels() {
|
||||
return this.realtime.getChannels();
|
||||
}
|
||||
/**
|
||||
* Unsubscribes and removes Realtime channel from Realtime client.
|
||||
*
|
||||
* @param {RealtimeChannel} channel - The name of the Realtime channel.
|
||||
*
|
||||
*/
|
||||
removeChannel(channel) {
|
||||
return this.realtime.removeChannel(channel);
|
||||
}
|
||||
/**
|
||||
* Unsubscribes and removes all Realtime channels from Realtime client.
|
||||
*/
|
||||
removeAllChannels() {
|
||||
return this.realtime.removeAllChannels();
|
||||
}
|
||||
_getAccessToken() {
|
||||
var _a, _b;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (this.accessToken) {
|
||||
return yield this.accessToken();
|
||||
}
|
||||
const { data } = yield this.auth.getSession();
|
||||
return (_b = (_a = data.session) === null || _a === void 0 ? void 0 : _a.access_token) !== null && _b !== void 0 ? _b : null;
|
||||
});
|
||||
}
|
||||
_initSupabaseAuthClient({ autoRefreshToken, persistSession, detectSessionInUrl, storage, storageKey, flowType, lock, debug, }, headers, fetch) {
|
||||
const authHeaders = {
|
||||
Authorization: `Bearer ${this.supabaseKey}`,
|
||||
apikey: `${this.supabaseKey}`,
|
||||
};
|
||||
return new SupabaseAuthClient_1.SupabaseAuthClient({
|
||||
url: this.authUrl.href,
|
||||
headers: Object.assign(Object.assign({}, authHeaders), headers),
|
||||
storageKey: storageKey,
|
||||
autoRefreshToken,
|
||||
persistSession,
|
||||
detectSessionInUrl,
|
||||
storage,
|
||||
flowType,
|
||||
lock,
|
||||
debug,
|
||||
fetch,
|
||||
// auth checks if there is a custom authorizaiton header using this flag
|
||||
// so it knows whether to return an error when getUser is called with no session
|
||||
hasCustomAuthorizationHeader: 'Authorization' in this.headers,
|
||||
});
|
||||
}
|
||||
_initRealtimeClient(options) {
|
||||
return new realtime_js_1.RealtimeClient(this.realtimeUrl.href, Object.assign(Object.assign({}, options), { params: Object.assign({ apikey: this.supabaseKey }, options === null || options === void 0 ? void 0 : options.params) }));
|
||||
}
|
||||
_listenForAuthEvents() {
|
||||
let data = this.auth.onAuthStateChange((event, session) => {
|
||||
this._handleTokenChanged(event, 'CLIENT', session === null || session === void 0 ? void 0 : session.access_token);
|
||||
});
|
||||
return data;
|
||||
}
|
||||
_handleTokenChanged(event, source, token) {
|
||||
if ((event === 'TOKEN_REFRESHED' || event === 'SIGNED_IN') &&
|
||||
this.changedAccessToken !== token) {
|
||||
this.changedAccessToken = token;
|
||||
}
|
||||
else if (event === 'SIGNED_OUT') {
|
||||
this.realtime.setAuth();
|
||||
if (source == 'STORAGE')
|
||||
this.auth.signOut();
|
||||
this.changedAccessToken = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.default = SupabaseClient;
|
||||
//# sourceMappingURL=SupabaseClient.js.map
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createClient = exports.SupabaseClient = exports.FunctionRegion = exports.FunctionsError = exports.FunctionsRelayError = exports.FunctionsFetchError = exports.FunctionsHttpError = exports.PostgrestError = void 0;
|
||||
const SupabaseClient_1 = __importDefault(require("./SupabaseClient"));
|
||||
__exportStar(require("@supabase/auth-js"), exports);
|
||||
var postgrest_js_1 = require("@supabase/postgrest-js");
|
||||
Object.defineProperty(exports, "PostgrestError", { enumerable: true, get: function () { return postgrest_js_1.PostgrestError; } });
|
||||
var functions_js_1 = require("@supabase/functions-js");
|
||||
Object.defineProperty(exports, "FunctionsHttpError", { enumerable: true, get: function () { return functions_js_1.FunctionsHttpError; } });
|
||||
Object.defineProperty(exports, "FunctionsFetchError", { enumerable: true, get: function () { return functions_js_1.FunctionsFetchError; } });
|
||||
Object.defineProperty(exports, "FunctionsRelayError", { enumerable: true, get: function () { return functions_js_1.FunctionsRelayError; } });
|
||||
Object.defineProperty(exports, "FunctionsError", { enumerable: true, get: function () { return functions_js_1.FunctionsError; } });
|
||||
Object.defineProperty(exports, "FunctionRegion", { enumerable: true, get: function () { return functions_js_1.FunctionRegion; } });
|
||||
__exportStar(require("@supabase/realtime-js"), exports);
|
||||
var SupabaseClient_2 = require("./SupabaseClient");
|
||||
Object.defineProperty(exports, "SupabaseClient", { enumerable: true, get: function () { return __importDefault(SupabaseClient_2).default; } });
|
||||
/**
|
||||
* Creates a new Supabase Client.
|
||||
*/
|
||||
const createClient = (supabaseUrl, supabaseKey, options) => {
|
||||
return new SupabaseClient_1.default(supabaseUrl, supabaseKey, options);
|
||||
};
|
||||
exports.createClient = createClient;
|
||||
//# sourceMappingURL=index.js.map
|
||||
Generated
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SupabaseAuthClient = void 0;
|
||||
const auth_js_1 = require("@supabase/auth-js");
|
||||
class SupabaseAuthClient extends auth_js_1.AuthClient {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
}
|
||||
}
|
||||
exports.SupabaseAuthClient = SupabaseAuthClient;
|
||||
//# sourceMappingURL=SupabaseAuthClient.js.map
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DEFAULT_REALTIME_OPTIONS = exports.DEFAULT_AUTH_OPTIONS = exports.DEFAULT_DB_OPTIONS = exports.DEFAULT_GLOBAL_OPTIONS = exports.DEFAULT_HEADERS = void 0;
|
||||
const version_1 = require("./version");
|
||||
let JS_ENV = '';
|
||||
// @ts-ignore
|
||||
if (typeof Deno !== 'undefined') {
|
||||
JS_ENV = 'deno';
|
||||
}
|
||||
else if (typeof document !== 'undefined') {
|
||||
JS_ENV = 'web';
|
||||
}
|
||||
else if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
||||
JS_ENV = 'react-native';
|
||||
}
|
||||
else {
|
||||
JS_ENV = 'node';
|
||||
}
|
||||
exports.DEFAULT_HEADERS = { 'X-Client-Info': `supabase-js-${JS_ENV}/${version_1.version}` };
|
||||
exports.DEFAULT_GLOBAL_OPTIONS = {
|
||||
headers: exports.DEFAULT_HEADERS,
|
||||
};
|
||||
exports.DEFAULT_DB_OPTIONS = {
|
||||
schema: 'public',
|
||||
};
|
||||
exports.DEFAULT_AUTH_OPTIONS = {
|
||||
autoRefreshToken: true,
|
||||
persistSession: true,
|
||||
detectSessionInUrl: true,
|
||||
flowType: 'implicit',
|
||||
};
|
||||
exports.DEFAULT_REALTIME_OPTIONS = {};
|
||||
//# sourceMappingURL=constants.js.map
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fetchWithAuth = exports.resolveHeadersConstructor = exports.resolveFetch = void 0;
|
||||
// @ts-ignore
|
||||
const node_fetch_1 = __importStar(require("@supabase/node-fetch"));
|
||||
const resolveFetch = (customFetch) => {
|
||||
let _fetch;
|
||||
if (customFetch) {
|
||||
_fetch = customFetch;
|
||||
}
|
||||
else if (typeof fetch === 'undefined') {
|
||||
_fetch = node_fetch_1.default;
|
||||
}
|
||||
else {
|
||||
_fetch = fetch;
|
||||
}
|
||||
return (...args) => _fetch(...args);
|
||||
};
|
||||
exports.resolveFetch = resolveFetch;
|
||||
const resolveHeadersConstructor = () => {
|
||||
if (typeof Headers === 'undefined') {
|
||||
return node_fetch_1.Headers;
|
||||
}
|
||||
return Headers;
|
||||
};
|
||||
exports.resolveHeadersConstructor = resolveHeadersConstructor;
|
||||
const fetchWithAuth = (supabaseKey, getAccessToken, customFetch) => {
|
||||
const fetch = (0, exports.resolveFetch)(customFetch);
|
||||
const HeadersConstructor = (0, exports.resolveHeadersConstructor)();
|
||||
return (input, init) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
var _a;
|
||||
const accessToken = (_a = (yield getAccessToken())) !== null && _a !== void 0 ? _a : supabaseKey;
|
||||
let headers = new HeadersConstructor(init === null || init === void 0 ? void 0 : init.headers);
|
||||
if (!headers.has('apikey')) {
|
||||
headers.set('apikey', supabaseKey);
|
||||
}
|
||||
if (!headers.has('Authorization')) {
|
||||
headers.set('Authorization', `Bearer ${accessToken}`);
|
||||
}
|
||||
return fetch(input, Object.assign(Object.assign({}, init), { headers }));
|
||||
});
|
||||
};
|
||||
exports.fetchWithAuth = fetchWithAuth;
|
||||
//# sourceMappingURL=fetch.js.map
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.applySettingDefaults = exports.isBrowser = exports.ensureTrailingSlash = exports.uuid = void 0;
|
||||
function uuid() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
exports.uuid = uuid;
|
||||
function ensureTrailingSlash(url) {
|
||||
return url.endsWith('/') ? url : url + '/';
|
||||
}
|
||||
exports.ensureTrailingSlash = ensureTrailingSlash;
|
||||
const isBrowser = () => typeof window !== 'undefined';
|
||||
exports.isBrowser = isBrowser;
|
||||
function applySettingDefaults(options, defaults) {
|
||||
var _a, _b;
|
||||
const { db: dbOptions, auth: authOptions, realtime: realtimeOptions, global: globalOptions, } = options;
|
||||
const { db: DEFAULT_DB_OPTIONS, auth: DEFAULT_AUTH_OPTIONS, realtime: DEFAULT_REALTIME_OPTIONS, global: DEFAULT_GLOBAL_OPTIONS, } = defaults;
|
||||
const result = {
|
||||
db: Object.assign(Object.assign({}, DEFAULT_DB_OPTIONS), dbOptions),
|
||||
auth: Object.assign(Object.assign({}, DEFAULT_AUTH_OPTIONS), authOptions),
|
||||
realtime: Object.assign(Object.assign({}, DEFAULT_REALTIME_OPTIONS), realtimeOptions),
|
||||
global: Object.assign(Object.assign(Object.assign({}, DEFAULT_GLOBAL_OPTIONS), globalOptions), { headers: Object.assign(Object.assign({}, ((_a = DEFAULT_GLOBAL_OPTIONS === null || DEFAULT_GLOBAL_OPTIONS === void 0 ? void 0 : DEFAULT_GLOBAL_OPTIONS.headers) !== null && _a !== void 0 ? _a : {})), ((_b = globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.headers) !== null && _b !== void 0 ? _b : {})) }),
|
||||
accessToken: () => __awaiter(this, void 0, void 0, function* () { return ''; }),
|
||||
};
|
||||
if (options.accessToken) {
|
||||
result.accessToken = options.accessToken;
|
||||
}
|
||||
else {
|
||||
// hack around Required<>
|
||||
delete result.accessToken;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.applySettingDefaults = applySettingDefaults;
|
||||
//# sourceMappingURL=helpers.js.map
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = '2.49.8';
|
||||
//# sourceMappingURL=version.js.map
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"name": "@supabase/supabase-js",
|
||||
"version": "2.49.8",
|
||||
"description": "Isomorphic Javascript client for Supabase",
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"typescript",
|
||||
"supabase"
|
||||
],
|
||||
"homepage": "https://github.com/supabase/supabase-js",
|
||||
"bugs": "https://github.com/supabase/supabase-js/issues",
|
||||
"license": "MIT",
|
||||
"author": "Supabase",
|
||||
"files": [
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"main": "dist/main/index.js",
|
||||
"module": "dist/module/index.js",
|
||||
"types": "dist/module/index.d.ts",
|
||||
"sideEffects": false,
|
||||
"repository": "supabase/supabase-js",
|
||||
"scripts": {
|
||||
"clean": "rimraf dist docs/v2",
|
||||
"format": "prettier --write \"{src,test}/**/*.ts\"",
|
||||
"build": "run-s clean format build:*",
|
||||
"build:main": "tsc -p tsconfig.json",
|
||||
"build:module": "tsc -p tsconfig.module.json",
|
||||
"build:umd": "webpack",
|
||||
"types-generate": "dts-gen -m '@supabase/supabase-js' -s",
|
||||
"test": "run-s test:types test:run",
|
||||
"test:run": "jest --runInBand",
|
||||
"test:coverage": "jest --runInBand --coverage",
|
||||
"test:db": "cd infra/db && docker-compose down && docker-compose up -d && sleep 5",
|
||||
"test:watch": "jest --watch --verbose false --silent false",
|
||||
"test:clean": "cd infra/db && docker-compose down",
|
||||
"test:types": "run-s build:module && tsd --files test/*.test-d.ts",
|
||||
"docs": "typedoc --entryPoints src/index.ts --out docs/v2 --includes src/**/*.ts",
|
||||
"docs:json": "typedoc --entryPoints src/index.ts --includes src/**/*.ts --json docs/v2/spec.json --excludeExternals",
|
||||
"serve:coverage": "npm run test:coverage && serve test/coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@supabase/auth-js": "2.69.1",
|
||||
"@supabase/functions-js": "2.4.4",
|
||||
"@supabase/node-fetch": "2.6.15",
|
||||
"@supabase/postgrest-js": "1.19.4",
|
||||
"@supabase/realtime-js": "2.11.2",
|
||||
"@supabase/storage-js": "2.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sebbo2002/semantic-release-jsr": "^1.0.0",
|
||||
"@types/jest": "^29.2.5",
|
||||
"husky": "^4.3.0",
|
||||
"jest": "^29.3.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.5.1",
|
||||
"pretty-quick": "^3.1.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"semantic-release-plugin-update-version-in-files": "^1.1.0",
|
||||
"serve": "^14.2.1",
|
||||
"ts-jest": "^29.0.5",
|
||||
"ts-loader": "^8.0.11",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsd": "^0.30.4",
|
||||
"typedoc": "^0.22.16",
|
||||
"typescript": "^4.5.5",
|
||||
"webpack": "^5.69.1",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "pretty-quick --staged"
|
||||
}
|
||||
},
|
||||
"jsdelivr": "dist/umd/supabase.js",
|
||||
"unpkg": "dist/umd/supabase.js"
|
||||
}
|
||||
Reference in New Issue
Block a user