autosolutions-os 0.2.5 → 0.3.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.
package/dist/session.js CHANGED
@@ -107,7 +107,10 @@ function clearCookieChunks(key) {
107
107
  }
108
108
  }
109
109
  function readSignedOut(jar, key) {
110
- const raw = jar.get(signedOutName(key));
110
+ return parseSignedOutNote(jar.get(signedOutName(key)));
111
+ }
112
+ /** The sign-out note's value, read. autosolutions-os/federation reads it too, so the rule lives here once. */
113
+ export function parseSignedOutNote(raw) {
111
114
  if (raw === undefined || raw === "")
112
115
  return null;
113
116
  const [watermark = "", sessions = ""] = raw.split("|");
@@ -124,7 +127,7 @@ function writeSignedOut(key, expiresAt, sessionIds) {
124
127
  document.cookie = `${signedOutName(key)}=${value}; Domain=.${PARENT_DOMAIN}; Path=/; Max-Age=${MAX_AGE}; SameSite=Lax; Secure`;
125
128
  }
126
129
  /** A copy the sign-out ended: it expires no later than the sign-out's watermark, or it is one of the sessions it ended (a refresh of that session expires later). */
127
- function signedOutCopy(copy, note) {
130
+ export function signedOutCopy(copy, note) {
128
131
  if (note === null)
129
132
  return false;
130
133
  return copy.expiresAt <= note.expiresAt || (copy.sessionId !== null && note.sessions.includes(copy.sessionId));
@@ -142,7 +145,7 @@ function sessionIdOf(accessToken) {
142
145
  return null;
143
146
  }
144
147
  }
145
- function parseCopy(raw) {
148
+ export function parseCopy(raw) {
146
149
  if (!raw)
147
150
  return null;
148
151
  try {
@@ -543,3 +546,7 @@ function signOutEverywhere(auth, key, page) {
543
546
  export function sharedSessionCookieName(projectRef) {
544
547
  return storageKey(projectRef);
545
548
  }
549
+ /** The name of the note an explicit sign-out leaves, for code that follows the core from outside it (autosolutions-os/federation). */
550
+ export function signedOutCookieName(projectRef) {
551
+ return signedOutName(storageKey(projectRef));
552
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autosolutions-os",
3
- "version": "0.2.5",
3
+ "version": "0.3.1",
4
4
  "description": "One sign-in, one company switcher, one app grid. What every AutoSolutions app imports instead of copying.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -11,6 +11,7 @@
11
11
  "./server": { "types": "./dist/server.d.ts", "import": "./dist/server.js" },
12
12
  "./nav": { "types": "./dist/nav.d.ts", "import": "./dist/nav.js" },
13
13
  "./frame": { "types": "./dist/frame.d.ts", "import": "./dist/frame.js" },
14
+ "./federation": { "types": "./dist/federation.d.ts", "import": "./dist/federation.js" },
14
15
  "./chrome.css": "./dist/chrome.css"
15
16
  },
16
17
  "files": ["dist", "CHANGELOG.md"],
@@ -21,7 +22,7 @@
21
22
  },
22
23
  "peerDependencies": {
23
24
  "@supabase/supabase-js": ">=2.40.0",
24
- "autosolutions-design-system": ">=6.4.0 <7",
25
+ "autosolutions-design-system": ">=6.5.0 <7",
25
26
  "react": ">=18"
26
27
  },
27
28
  "peerDependenciesMeta": {