nuxt4, and some changes on packages
This commit is contained in:
+3
-7
@@ -32,6 +32,7 @@ class SupabaseClient {
|
||||
* @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.storage Options passed along to the storage-js constructor.
|
||||
* @param options.global.fetch A custom fetch implementation.
|
||||
* @param options.global.headers Any additional headers to send with each network request.
|
||||
*/
|
||||
@@ -79,6 +80,7 @@ class SupabaseClient {
|
||||
schema: settings.db.schema,
|
||||
fetch: this.fetch,
|
||||
});
|
||||
this.storage = new storage_js_1.StorageClient(this.storageUrl.href, this.headers, this.fetch, options === null || options === void 0 ? void 0 : options.storage);
|
||||
if (!settings.accessToken) {
|
||||
this._listenForAuthEvents();
|
||||
}
|
||||
@@ -92,12 +94,6 @@ class SupabaseClient {
|
||||
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.
|
||||
*
|
||||
@@ -182,7 +178,7 @@ class SupabaseClient {
|
||||
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;
|
||||
return (_b = (_a = data.session) === null || _a === void 0 ? void 0 : _a.access_token) !== null && _b !== void 0 ? _b : this.supabaseKey;
|
||||
});
|
||||
}
|
||||
_initSupabaseAuthClient({ autoRefreshToken, persistSession, detectSessionInUrl, storage, storageKey, flowType, lock, debug, }, headers, fetch) {
|
||||
|
||||
+27
@@ -38,4 +38,31 @@ const createClient = (supabaseUrl, supabaseKey, options) => {
|
||||
return new SupabaseClient_1.default(supabaseUrl, supabaseKey, options);
|
||||
};
|
||||
exports.createClient = createClient;
|
||||
// Check for Node.js <= 18 deprecation
|
||||
function shouldShowDeprecationWarning() {
|
||||
// Skip in browser environments
|
||||
if (typeof window !== 'undefined') {
|
||||
return false;
|
||||
}
|
||||
// Skip if process is not available (e.g., Edge Runtime)
|
||||
if (typeof process === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
// Use dynamic property access to avoid Next.js Edge Runtime static analysis warnings
|
||||
const processVersion = process['version'];
|
||||
if (processVersion === undefined || processVersion === null) {
|
||||
return false;
|
||||
}
|
||||
const versionMatch = processVersion.match(/^v(\d+)\./);
|
||||
if (!versionMatch) {
|
||||
return false;
|
||||
}
|
||||
const majorVersion = parseInt(versionMatch[1], 10);
|
||||
return majorVersion <= 18;
|
||||
}
|
||||
if (shouldShowDeprecationWarning()) {
|
||||
console.warn(`⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. ` +
|
||||
`Please upgrade to Node.js 20 or later. ` +
|
||||
`For more information, visit: https://github.com/orgs/supabase/discussions/37217`);
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -31,6 +31,7 @@ function applySettingDefaults(options, defaults) {
|
||||
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),
|
||||
storage: {},
|
||||
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 ''; }),
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = void 0;
|
||||
exports.version = '2.49.8';
|
||||
exports.version = '2.55.0';
|
||||
//# sourceMappingURL=version.js.map
|
||||
Reference in New Issue
Block a user