@ai-matrx/data 0.22.0 → 0.22.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.
package/dist/db.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MaybeSingleResponse } from './index.cjs';
2
- export { a as AuthCookie, b as AuthCookieOptions, A as AuthCookieValue, C as CreateAuthCookieArgs, D as DEFAULT_AUTH_COOKIE_NAME, R as ReconciledAuthCookies, c as createAuthCookie, p as parseCookieHeader } from './auth-cookie-BpgVyFw9.cjs';
2
+ export { a as AuthCookie, b as AuthCookieOptions, A as AuthCookieValue, C as CreateAuthCookieArgs, D as DEFAULT_AUTH_COOKIE_NAME, R as ReconciledAuthCookies, c as createAuthCookie, p as parseCookieHeader } from './auth-cookie-D4QjVz7W.cjs';
3
3
  export { uniqueChannelTopic } from '@ai-matrx/realtime';
4
4
  import { PostgrestError } from '@supabase/supabase-js';
5
5
  import './credentials-B-rePKU7.cjs';
package/dist/db.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MaybeSingleResponse } from './index.js';
2
- export { a as AuthCookie, b as AuthCookieOptions, A as AuthCookieValue, C as CreateAuthCookieArgs, D as DEFAULT_AUTH_COOKIE_NAME, R as ReconciledAuthCookies, c as createAuthCookie, p as parseCookieHeader } from './auth-cookie-BpgVyFw9.js';
2
+ export { a as AuthCookie, b as AuthCookieOptions, A as AuthCookieValue, C as CreateAuthCookieArgs, D as DEFAULT_AUTH_COOKIE_NAME, R as ReconciledAuthCookies, c as createAuthCookie, p as parseCookieHeader } from './auth-cookie-D4QjVz7W.js';
3
3
  export { uniqueChannelTopic } from '@ai-matrx/realtime';
4
4
  import { PostgrestError } from '@supabase/supabase-js';
5
5
  import './credentials-B-rePKU7.js';
package/dist/db.js CHANGED
@@ -312,9 +312,12 @@ function createAuthCookie(args) {
312
312
  const legacyCookieName = args.legacyCookieName;
313
313
  const apex = args.apexDomain.toLowerCase();
314
314
  const optionsForHost = (host) => {
315
- const hostname = (host ?? "").split(":")[0]?.toLowerCase() ?? "";
315
+ const normalized = (host ?? "").toLowerCase();
316
+ const hostname = normalized.startsWith("[") ? normalized.slice(1, normalized.indexOf("]")) : normalized === "::1" ? normalized : normalized.split(":")[0] ?? "";
317
+ const loopback = hostname === "localhost" || hostname.endsWith(".localhost") || hostname === "::1" || /^127(?:\.(?:0|[1-9]\d{0,2})){3}$/.test(hostname) && hostname.split(".").every((part) => Number(part) <= 255);
318
+ const secure = !loopback;
316
319
  const onApex = hostname === apex || hostname.endsWith(`.${apex}`);
317
- return onApex ? { name: cookieName, domain: `.${apex}` } : { name: cookieName };
320
+ return onApex ? { name: cookieName, domain: `.${apex}`, secure } : { name: cookieName, secure };
318
321
  };
319
322
  const isCurrentCookie = (name) => belongsToStorageKey(name, cookieName);
320
323
  const isAuthCookie = (name) => isCurrentCookie(name) || legacyCookieName !== void 0 && (name === legacyCookieName || name.startsWith(`${legacyCookieName}.`));