@withpotter/lib 0.13.0-next.124 → 0.13.0-next.59
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/admin-account-types.d.ts +0 -21
- package/dist/admin-api.d.ts +2 -224
- package/dist/admin-api.js +0 -41
- package/dist/admin-api.js.map +1 -1
- package/dist/admin-case-api.js +4 -1
- package/dist/admin-case-api.js.map +1 -1
- package/dist/admin-pos-api.d.ts +1 -25
- package/dist/admin-pos-api.js +0 -24
- package/dist/admin-pos-api.js.map +1 -1
- package/dist/admin-pos-types.d.ts +0 -43
- package/dist/api/accounts.d.ts +3 -5
- package/dist/api/accounts.js +1 -1
- package/dist/api/accounts.js.map +1 -1
- package/dist/api/analytics.js +3 -1
- package/dist/api/analytics.js.map +1 -1
- package/dist/api/core.d.ts +1 -0
- package/dist/api/core.js +7 -19
- package/dist/api/core.js.map +1 -1
- package/dist/api/potter.js +3 -2
- package/dist/api/potter.js.map +1 -1
- package/dist/api/session-scope.d.ts +2 -2
- package/dist/api/session-scope.js.map +1 -1
- package/dist/api/types/auth.d.ts +1 -7
- package/dist/api/types/auth.js.map +1 -1
- package/dist/api/types/crm.d.ts +0 -2
- package/dist/api/types/templates.d.ts +0 -6
- package/dist/auth-context.d.ts +0 -2
- package/dist/auth-context.js +37 -12
- package/dist/auth-context.js.map +1 -1
- package/dist/mobile-routes.js +2 -4
- package/dist/mobile-routes.js.map +1 -1
- package/dist/plan-price.d.ts +2 -16
- package/dist/plan-price.js +0 -9
- package/dist/plan-price.js.map +1 -1
- package/dist/resolve-enabled-behaviors.d.ts +0 -2
- package/dist/resolve-enabled-behaviors.js +1 -2
- package/dist/resolve-enabled-behaviors.js.map +1 -1
- package/dist/template-types.d.ts +0 -8
- package/dist/timeline-copy.d.ts +1 -1
- package/dist/timeline-copy.js +2 -6
- package/dist/timeline-copy.js.map +1 -1
- package/dist/use-nav-groups.js +5 -5
- package/dist/use-nav-groups.js.map +1 -1
- package/dist/utils.js +4 -4
- package/dist/utils.js.map +1 -1
- package/dist/wallet-format.js +0 -1
- package/dist/wallet-format.js.map +1 -1
- package/package.json +2 -2
- package/dist/__fixtures__/demo-content-server.json +0 -484
- package/dist/admin-earnings-api.d.ts +0 -90
- package/dist/admin-earnings-api.js +0 -15
- package/dist/admin-earnings-api.js.map +0 -1
- package/dist/admin-earnings-model.d.ts +0 -30
- package/dist/admin-earnings-model.js +0 -47
- package/dist/admin-earnings-model.js.map +0 -1
- package/dist/admin-pos-olive.d.ts +0 -44
- package/dist/admin-pos-olive.js +0 -93
- package/dist/admin-pos-olive.js.map +0 -1
- package/dist/api/demo-content.d.ts +0 -104
- package/dist/api/demo-content.js +0 -36
- package/dist/api/demo-content.js.map +0 -1
- package/dist/api/plan-refusal.d.ts +0 -21
- package/dist/api/plan-refusal.js +0 -28
- package/dist/api/plan-refusal.js.map +0 -1
- package/dist/api/session-refresh.d.ts +0 -18
- package/dist/api/session-refresh.js +0 -37
- package/dist/api/session-refresh.js.map +0 -1
- package/dist/demo-content-mock.d.ts +0 -22
- package/dist/demo-content-mock.js +0 -70
- package/dist/demo-content-mock.js.map +0 -1
- package/dist/demo-content-poller.d.ts +0 -33
- package/dist/demo-content-poller.js +0 -80
- package/dist/demo-content-poller.js.map +0 -1
- package/dist/demo-content.d.ts +0 -43
- package/dist/demo-content.js +0 -78
- package/dist/demo-content.js.map +0 -1
- package/dist/stored-token.d.ts +0 -1
- package/dist/stored-token.js +0 -11
- package/dist/stored-token.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/demo-content-poller.ts"],"sourcesContent":["import type { DemoContentStatus } from './api/demo-content';\nimport { isDemoContentBusy, nextPollDelay } from './demo-content';\n\n/**\n * Keeps asking the server how a demo-content job is going until it stops.\n *\n * No React in it, and the clock and the tab are handed in, so a test moves time\n * by hand. The rules:\n *\n * - Asks once straight away, which is also what picks up a job that was\n * running when the page was closed and opened again.\n * - Keeps asking only while the job is running (`applying` or `clearing`).\n * - A hidden tab stops asking and asks once when it is shown again.\n * - Requests never overlap; the next is timed from the end of the last.\n * - A failed ask is not the end of the job: it backs off and tries again, and\n * reports the error without losing the last good answer.\n */\nexport interface DemoPollEnv {\n isVisible: () => boolean;\n onVisibilityChange: (listener: () => void) => () => void;\n setTimer: (run: () => void, ms: number) => unknown;\n clearTimer: (timer: unknown) => void;\n}\n\nexport function browserDemoPollEnv(): DemoPollEnv {\n return {\n isVisible: () => document.visibilityState !== 'hidden',\n onVisibilityChange: (listener) => {\n document.addEventListener('visibilitychange', listener);\n return () => document.removeEventListener('visibilitychange', listener);\n },\n setTimer: (run, ms) => window.setTimeout(run, ms),\n clearTimer: (timer) => window.clearTimeout(timer as number),\n };\n}\n\nexport interface DemoPollHandlers {\n read: () => Promise<DemoContentStatus>;\n onStatus: (status: DemoContentStatus) => void;\n onError: (error: unknown) => void;\n}\n\nexport interface DemoPoller {\n /** Ask now (after the merchant starts or clears), then keep going while busy. */\n refresh: () => void;\n stop: () => void;\n}\n\nexport function startDemoPoller(\n handlers: DemoPollHandlers,\n env: DemoPollEnv = browserDemoPollEnv(),\n): DemoPoller {\n let timer: unknown = null;\n let inFlight = false;\n let stopped = false;\n let attempt = 0;\n let failures = 0;\n let lastKey = '';\n\n const clear = () => {\n if (timer !== null) env.clearTimer(timer);\n timer = null;\n };\n\n const schedule = (ms: number) => {\n clear();\n if (stopped) return;\n timer = env.setTimer(() => {\n timer = null;\n void ask();\n }, ms);\n };\n\n async function ask() {\n if (stopped || inFlight) return;\n inFlight = true;\n try {\n const status = await handlers.read();\n if (stopped) return;\n failures = 0;\n const key = `${status.state}:${status.progress?.phase}:${status.progress?.done}`;\n attempt = key === lastKey ? attempt + 1 : 0;\n lastKey = key;\n handlers.onStatus(status);\n if (isDemoContentBusy(status)) schedule(nextPollDelay(attempt, 0));\n } catch (error) {\n if (stopped) return;\n failures += 1;\n handlers.onError(error);\n schedule(nextPollDelay(attempt, failures));\n } finally {\n inFlight = false;\n }\n }\n\n const stopWatching = env.onVisibilityChange(() => {\n if (stopped) return;\n if (!env.isVisible()) {\n clear();\n return;\n }\n // Shown again: ask once now. The answer decides whether to keep going.\n clear();\n void ask();\n });\n\n void ask();\n\n return {\n refresh: () => {\n clear();\n attempt = 0;\n void ask();\n },\n stop: () => {\n stopped = true;\n clear();\n stopWatching();\n },\n };\n}\n"],"mappings":"AACA,SAAS,mBAAmB,qBAAqB;AAuB1C,SAAS,qBAAkC;AAChD,SAAO;AAAA,IACL,WAAW,MAAM,SAAS,oBAAoB;AAAA,IAC9C,oBAAoB,CAAC,aAAa;AAChC,eAAS,iBAAiB,oBAAoB,QAAQ;AACtD,aAAO,MAAM,SAAS,oBAAoB,oBAAoB,QAAQ;AAAA,IACxE;AAAA,IACA,UAAU,CAAC,KAAK,OAAO,OAAO,WAAW,KAAK,EAAE;AAAA,IAChD,YAAY,CAAC,UAAU,OAAO,aAAa,KAAe;AAAA,EAC5D;AACF;AAcO,SAAS,gBACd,UACA,MAAmB,mBAAmB,GAC1B;AACZ,MAAI,QAAiB;AACrB,MAAI,WAAW;AACf,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AACf,MAAI,UAAU;AAEd,QAAM,QAAQ,MAAM;AAClB,QAAI,UAAU,KAAM,KAAI,WAAW,KAAK;AACxC,YAAQ;AAAA,EACV;AAEA,QAAM,WAAW,CAAC,OAAe;AAC/B,UAAM;AACN,QAAI,QAAS;AACb,YAAQ,IAAI,SAAS,MAAM;AACzB,cAAQ;AACR,WAAK,IAAI;AAAA,IACX,GAAG,EAAE;AAAA,EACP;AAEA,iBAAe,MAAM;AACnB,QAAI,WAAW,SAAU;AACzB,eAAW;AACX,QAAI;AACF,YAAM,SAAS,MAAM,SAAS,KAAK;AACnC,UAAI,QAAS;AACb,iBAAW;AACX,YAAM,MAAM,GAAG,OAAO,KAAK,IAAI,OAAO,UAAU,KAAK,IAAI,OAAO,UAAU,IAAI;AAC9E,gBAAU,QAAQ,UAAU,UAAU,IAAI;AAC1C,gBAAU;AACV,eAAS,SAAS,MAAM;AACxB,UAAI,kBAAkB,MAAM,EAAG,UAAS,cAAc,SAAS,CAAC,CAAC;AAAA,IACnE,SAAS,OAAO;AACd,UAAI,QAAS;AACb,kBAAY;AACZ,eAAS,QAAQ,KAAK;AACtB,eAAS,cAAc,SAAS,QAAQ,CAAC;AAAA,IAC3C,UAAE;AACA,iBAAW;AAAA,IACb;AAAA,EACF;AAEA,QAAM,eAAe,IAAI,mBAAmB,MAAM;AAChD,QAAI,QAAS;AACb,QAAI,CAAC,IAAI,UAAU,GAAG;AACpB,YAAM;AACN;AAAA,IACF;AAEA,UAAM;AACN,SAAK,IAAI;AAAA,EACX,CAAC;AAED,OAAK,IAAI;AAET,SAAO;AAAA,IACL,SAAS,MAAM;AACb,YAAM;AACN,gBAAU;AACV,WAAK,IAAI;AAAA,IACX;AAAA,IACA,MAAM,MAAM;AACV,gBAAU;AACV,YAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AACF;","names":[]}
|
package/dist/demo-content.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { DemoContentCounts, DemoContentStatus } from './api/demo-content';
|
|
2
|
-
/**
|
|
3
|
-
* What the demo-content screens decide, with no React and no network in it, so
|
|
4
|
-
* every rule is a plain function a test can call.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Who may start, clear or re-apply demo content: the owner, or a team member
|
|
8
|
-
* whose permissions include both managing products and managing settings (the
|
|
9
|
-
* admin-level role). Matches the server's rule; anyone else is refused there
|
|
10
|
-
* with `not_owner_or_admin`, so the screens hide the actions first.
|
|
11
|
-
*/
|
|
12
|
-
export declare function canManageDemoContent(role: string | null | undefined, permissions?: Record<string, boolean> | null): boolean;
|
|
13
|
-
/** A job is running on the server; the page keeps asking until it stops. */
|
|
14
|
-
export declare function isDemoContentBusy(status: DemoContentStatus | null): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* How long to wait before asking again.
|
|
17
|
-
*
|
|
18
|
-
* Starts quick so a short job feels live, slows as it runs so a long one does
|
|
19
|
-
* not hammer the server, and backs off further after each failed ask. `attempt`
|
|
20
|
-
* counts asks since the last change in the answer; `failures` counts failed
|
|
21
|
-
* asks in a row.
|
|
22
|
-
*/
|
|
23
|
-
export declare const POLL_FIRST_MS = 1500;
|
|
24
|
-
export declare const POLL_MAX_MS = 10000;
|
|
25
|
-
export declare const POLL_ERROR_MAX_MS = 30000;
|
|
26
|
-
export declare function nextPollDelay(attempt: number, failures: number): number;
|
|
27
|
-
/** 0 to 100, or null when the server has not said how big the job is. */
|
|
28
|
-
export declare function progressPercent(status: DemoContentStatus | null): number | null;
|
|
29
|
-
/** The server's phase name as a short phrase; an unknown phase reads plainly. */
|
|
30
|
-
export declare function phaseLabel(phase: string | undefined, job?: 'apply' | 'clear'): string;
|
|
31
|
-
/** "12 products, 3 collections, 5 pages and 20 pictures" from the counts the server gave. */
|
|
32
|
-
export declare function describeCounts(counts: (Partial<DemoContentCounts> & {
|
|
33
|
-
images?: number;
|
|
34
|
-
}) | undefined): string | null;
|
|
35
|
-
/**
|
|
36
|
-
* A product (or collection) the demo pack added and the merchant has not kept.
|
|
37
|
-
* The server marks it with the tag `demo-pack` and `data.demoPack`; Keep this
|
|
38
|
-
* removes both.
|
|
39
|
-
*/
|
|
40
|
-
export declare function isDemoProduct(product: {
|
|
41
|
-
tags?: string[] | null;
|
|
42
|
-
data?: Record<string, unknown> | null;
|
|
43
|
-
}): boolean;
|
package/dist/demo-content.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
function canManageDemoContent(role, permissions) {
|
|
2
|
-
if (role === "owner") return true;
|
|
3
|
-
return permissions?.canManageProducts === true && permissions?.canManageSettings === true;
|
|
4
|
-
}
|
|
5
|
-
function isDemoContentBusy(status) {
|
|
6
|
-
return status?.state === "applying" || status?.state === "clearing";
|
|
7
|
-
}
|
|
8
|
-
const POLL_FIRST_MS = 1500;
|
|
9
|
-
const POLL_MAX_MS = 1e4;
|
|
10
|
-
const POLL_ERROR_MAX_MS = 3e4;
|
|
11
|
-
function nextPollDelay(attempt, failures) {
|
|
12
|
-
if (failures > 0) {
|
|
13
|
-
return Math.min(POLL_ERROR_MAX_MS, POLL_MAX_MS * 2 ** (failures - 1));
|
|
14
|
-
}
|
|
15
|
-
return Math.min(POLL_MAX_MS, Math.round(POLL_FIRST_MS * 1.5 ** attempt));
|
|
16
|
-
}
|
|
17
|
-
function progressPercent(status) {
|
|
18
|
-
const p = status?.progress;
|
|
19
|
-
if (!p || !(p.total > 0)) return null;
|
|
20
|
-
return Math.max(0, Math.min(100, Math.round(p.done / p.total * 100)));
|
|
21
|
-
}
|
|
22
|
-
const APPLY_PHASE_LABEL = {
|
|
23
|
-
fetching: "Getting the demo ready",
|
|
24
|
-
media: "Adding pictures",
|
|
25
|
-
products: "Adding products",
|
|
26
|
-
collections: "Adding collections",
|
|
27
|
-
content: "Adding content",
|
|
28
|
-
tenant: "Setting up your store",
|
|
29
|
-
pages: "Setting up pages",
|
|
30
|
-
shipping: "Setting up delivery",
|
|
31
|
-
pruning: "Tidying up",
|
|
32
|
-
activating: "Making it visible"
|
|
33
|
-
};
|
|
34
|
-
const CLEAR_PHASE_LABEL = {
|
|
35
|
-
catalogue: "Removing demo products and collections",
|
|
36
|
-
pages: "Putting pages back",
|
|
37
|
-
shipping: "Removing demo delivery",
|
|
38
|
-
settings: "Restoring settings"
|
|
39
|
-
};
|
|
40
|
-
function phaseLabel(phase, job = "apply") {
|
|
41
|
-
if (!phase) return "Working";
|
|
42
|
-
const table = job === "clear" ? CLEAR_PHASE_LABEL : APPLY_PHASE_LABEL;
|
|
43
|
-
return table[phase] ?? "Working";
|
|
44
|
-
}
|
|
45
|
-
function plural(n, one, many) {
|
|
46
|
-
return `${n.toLocaleString("en-US")} ${n === 1 ? one : many}`;
|
|
47
|
-
}
|
|
48
|
-
function describeCounts(counts) {
|
|
49
|
-
if (!counts) return null;
|
|
50
|
-
const parts = [];
|
|
51
|
-
if (counts.products) parts.push(plural(counts.products, "product", "products"));
|
|
52
|
-
if (counts.collections)
|
|
53
|
-
parts.push(plural(counts.collections, "collection", "collections"));
|
|
54
|
-
if (counts.pages) parts.push(plural(counts.pages, "page", "pages"));
|
|
55
|
-
const pictures = counts.media ?? counts.images;
|
|
56
|
-
if (pictures) parts.push(plural(pictures, "picture", "pictures"));
|
|
57
|
-
if (parts.length === 0) return null;
|
|
58
|
-
if (parts.length === 1) return parts[0];
|
|
59
|
-
return `${parts.slice(0, -1).join(", ")} and ${parts[parts.length - 1]}`;
|
|
60
|
-
}
|
|
61
|
-
function isDemoProduct(product) {
|
|
62
|
-
if (product.tags?.includes("demo-pack")) return true;
|
|
63
|
-
const d = product.data?.demoPack;
|
|
64
|
-
return typeof d === "object" && d !== null;
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
POLL_ERROR_MAX_MS,
|
|
68
|
-
POLL_FIRST_MS,
|
|
69
|
-
POLL_MAX_MS,
|
|
70
|
-
canManageDemoContent,
|
|
71
|
-
describeCounts,
|
|
72
|
-
isDemoContentBusy,
|
|
73
|
-
isDemoProduct,
|
|
74
|
-
nextPollDelay,
|
|
75
|
-
phaseLabel,
|
|
76
|
-
progressPercent
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=demo-content.js.map
|
package/dist/demo-content.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/demo-content.ts"],"sourcesContent":["import type {\n DemoContentCounts,\n DemoContentStatus,\n} from './api/demo-content';\n\n/**\n * What the demo-content screens decide, with no React and no network in it, so\n * every rule is a plain function a test can call.\n */\n\n/**\n * Who may start, clear or re-apply demo content: the owner, or a team member\n * whose permissions include both managing products and managing settings (the\n * admin-level role). Matches the server's rule; anyone else is refused there\n * with `not_owner_or_admin`, so the screens hide the actions first.\n */\nexport function canManageDemoContent(\n role: string | null | undefined,\n permissions?: Record<string, boolean> | null,\n): boolean {\n if (role === 'owner') return true;\n return permissions?.canManageProducts === true && permissions?.canManageSettings === true;\n}\n\n/** A job is running on the server; the page keeps asking until it stops. */\nexport function isDemoContentBusy(status: DemoContentStatus | null): boolean {\n return status?.state === 'applying' || status?.state === 'clearing';\n}\n\n/**\n * How long to wait before asking again.\n *\n * Starts quick so a short job feels live, slows as it runs so a long one does\n * not hammer the server, and backs off further after each failed ask. `attempt`\n * counts asks since the last change in the answer; `failures` counts failed\n * asks in a row.\n */\nexport const POLL_FIRST_MS = 1_500;\nexport const POLL_MAX_MS = 10_000;\nexport const POLL_ERROR_MAX_MS = 30_000;\n\nexport function nextPollDelay(attempt: number, failures: number): number {\n if (failures > 0) {\n return Math.min(POLL_ERROR_MAX_MS, POLL_MAX_MS * 2 ** (failures - 1));\n }\n return Math.min(POLL_MAX_MS, Math.round(POLL_FIRST_MS * 1.5 ** attempt));\n}\n\n/** 0 to 100, or null when the server has not said how big the job is. */\nexport function progressPercent(status: DemoContentStatus | null): number | null {\n const p = status?.progress;\n if (!p || !(p.total > 0)) return null;\n return Math.max(0, Math.min(100, Math.round((p.done / p.total) * 100)));\n}\n\n/** The server's phases, apply and clear, as short phrases. */\nconst APPLY_PHASE_LABEL: Record<string, string> = {\n fetching: 'Getting the demo ready',\n media: 'Adding pictures',\n products: 'Adding products',\n collections: 'Adding collections',\n content: 'Adding content',\n tenant: 'Setting up your store',\n pages: 'Setting up pages',\n shipping: 'Setting up delivery',\n pruning: 'Tidying up',\n activating: 'Making it visible',\n};\nconst CLEAR_PHASE_LABEL: Record<string, string> = {\n catalogue: 'Removing demo products and collections',\n pages: 'Putting pages back',\n shipping: 'Removing demo delivery',\n settings: 'Restoring settings',\n};\n\n/** The server's phase name as a short phrase; an unknown phase reads plainly. */\nexport function phaseLabel(\n phase: string | undefined,\n job: 'apply' | 'clear' = 'apply',\n): string {\n if (!phase) return 'Working';\n const table = job === 'clear' ? CLEAR_PHASE_LABEL : APPLY_PHASE_LABEL;\n return table[phase] ?? 'Working';\n}\n\nfunction plural(n: number, one: string, many: string): string {\n return `${n.toLocaleString('en-US')} ${n === 1 ? one : many}`;\n}\n\n/** \"12 products, 3 collections, 5 pages and 20 pictures\" from the counts the server gave. */\nexport function describeCounts(\n counts:\n | (Partial<DemoContentCounts> & { images?: number })\n | undefined,\n): string | null {\n if (!counts) return null;\n const parts: string[] = [];\n if (counts.products) parts.push(plural(counts.products, 'product', 'products'));\n if (counts.collections)\n parts.push(plural(counts.collections, 'collection', 'collections'));\n if (counts.pages) parts.push(plural(counts.pages, 'page', 'pages'));\n const pictures = counts.media ?? counts.images;\n if (pictures) parts.push(plural(pictures, 'picture', 'pictures'));\n if (parts.length === 0) return null;\n if (parts.length === 1) return parts[0];\n return `${parts.slice(0, -1).join(', ')} and ${parts[parts.length - 1]}`;\n}\n\n/**\n * A product (or collection) the demo pack added and the merchant has not kept.\n * The server marks it with the tag `demo-pack` and `data.demoPack`; Keep this\n * removes both.\n */\nexport function isDemoProduct(product: {\n tags?: string[] | null;\n data?: Record<string, unknown> | null;\n}): boolean {\n if (product.tags?.includes('demo-pack')) return true;\n const d = product.data?.demoPack;\n return typeof d === 'object' && d !== null;\n}\n"],"mappings":"AAgBO,SAAS,qBACd,MACA,aACS;AACT,MAAI,SAAS,QAAS,QAAO;AAC7B,SAAO,aAAa,sBAAsB,QAAQ,aAAa,sBAAsB;AACvF;AAGO,SAAS,kBAAkB,QAA2C;AAC3E,SAAO,QAAQ,UAAU,cAAc,QAAQ,UAAU;AAC3D;AAUO,MAAM,gBAAgB;AACtB,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAE1B,SAAS,cAAc,SAAiB,UAA0B;AACvE,MAAI,WAAW,GAAG;AAChB,WAAO,KAAK,IAAI,mBAAmB,cAAc,MAAM,WAAW,EAAE;AAAA,EACtE;AACA,SAAO,KAAK,IAAI,aAAa,KAAK,MAAM,gBAAgB,OAAO,OAAO,CAAC;AACzE;AAGO,SAAS,gBAAgB,QAAiD;AAC/E,QAAM,IAAI,QAAQ;AAClB,MAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,GAAI,QAAO;AACjC,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAO,EAAE,OAAO,EAAE,QAAS,GAAG,CAAC,CAAC;AACxE;AAGA,MAAM,oBAA4C;AAAA,EAChD,UAAU;AAAA,EACV,OAAO;AAAA,EACP,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AACd;AACA,MAAM,oBAA4C;AAAA,EAChD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AACZ;AAGO,SAAS,WACd,OACA,MAAyB,SACjB;AACR,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,QAAQ,QAAQ,UAAU,oBAAoB;AACpD,SAAO,MAAM,KAAK,KAAK;AACzB;AAEA,SAAS,OAAO,GAAW,KAAa,MAAsB;AAC5D,SAAO,GAAG,EAAE,eAAe,OAAO,CAAC,IAAI,MAAM,IAAI,MAAM,IAAI;AAC7D;AAGO,SAAS,eACd,QAGe;AACf,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,QAAkB,CAAC;AACzB,MAAI,OAAO,SAAU,OAAM,KAAK,OAAO,OAAO,UAAU,WAAW,UAAU,CAAC;AAC9E,MAAI,OAAO;AACT,UAAM,KAAK,OAAO,OAAO,aAAa,cAAc,aAAa,CAAC;AACpE,MAAI,OAAO,MAAO,OAAM,KAAK,OAAO,OAAO,OAAO,QAAQ,OAAO,CAAC;AAClE,QAAM,WAAW,OAAO,SAAS,OAAO;AACxC,MAAI,SAAU,OAAM,KAAK,OAAO,UAAU,WAAW,UAAU,CAAC;AAChE,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,MAAI,MAAM,WAAW,EAAG,QAAO,MAAM,CAAC;AACtC,SAAO,GAAG,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,QAAQ,MAAM,MAAM,SAAS,CAAC,CAAC;AACxE;AAOO,SAAS,cAAc,SAGlB;AACV,MAAI,QAAQ,MAAM,SAAS,WAAW,EAAG,QAAO;AAChD,QAAM,IAAI,QAAQ,MAAM;AACxB,SAAO,OAAO,MAAM,YAAY,MAAM;AACxC;","names":[]}
|
package/dist/stored-token.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function removeLegacyToken(): void;
|
package/dist/stored-token.js
DELETED
package/dist/stored-token.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/stored-token.ts"],"sourcesContent":["/**\n * The key older versions kept the session token under. The session is now only\n * the HttpOnly `pb_auth_token` cookie, so a copy here is a credential any script\n * on the page could read. Nothing writes it; this removes one left behind.\n */\nconst LEGACY_TOKEN_KEY = 'pb_token';\n\nexport function removeLegacyToken(): void {\n try {\n localStorage.removeItem(LEGACY_TOKEN_KEY);\n } catch {\n // Storage blocked: nothing was kept there.\n }\n}\n"],"mappings":"AAKA,MAAM,mBAAmB;AAElB,SAAS,oBAA0B;AACxC,MAAI;AACF,iBAAa,WAAW,gBAAgB;AAAA,EAC1C,QAAQ;AAAA,EAER;AACF;","names":[]}
|