@farthershore/farthershore-js 0.2.0 → 0.8.0
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/CHANGELOG.md +22 -0
- package/README.md +47 -11
- package/dist/auth-user.d.ts +7 -0
- package/dist/auth-user.d.ts.map +1 -0
- package/dist/auth-user.js +43 -0
- package/dist/auth-user.js.map +1 -0
- package/dist/auto-key.d.ts +14 -0
- package/dist/auto-key.d.ts.map +1 -0
- package/dist/auto-key.js +70 -0
- package/dist/auto-key.js.map +1 -0
- package/dist/bootstrap.d.ts +19 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +50 -1
- package/dist/bootstrap.js.map +1 -1
- package/dist/cache.d.ts +9 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +12 -0
- package/dist/cache.js.map +1 -1
- package/dist/catalog.d.ts +185 -10
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +449 -90
- package/dist/catalog.js.map +1 -1
- package/dist/client.d.ts +66 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +78 -2
- package/dist/client.js.map +1 -1
- package/dist/components/app.d.ts +7 -0
- package/dist/components/app.d.ts.map +1 -1
- package/dist/components/app.js +13 -19
- package/dist/components/app.js.map +1 -1
- package/dist/components/audit-log-table.d.ts +8 -0
- package/dist/components/audit-log-table.d.ts.map +1 -0
- package/dist/components/audit-log-table.js +49 -0
- package/dist/components/audit-log-table.js.map +1 -0
- package/dist/components/auth-guard.d.ts +80 -0
- package/dist/components/auth-guard.d.ts.map +1 -0
- package/dist/components/auth-guard.js +93 -0
- package/dist/components/auth-guard.js.map +1 -0
- package/dist/components/auth.d.ts +4 -3
- package/dist/components/auth.d.ts.map +1 -1
- package/dist/components/auth.js +74 -5
- package/dist/components/auth.js.map +1 -1
- package/dist/components/auto-key-banner.d.ts +8 -0
- package/dist/components/auto-key-banner.d.ts.map +1 -0
- package/dist/components/auto-key-banner.js +33 -0
- package/dist/components/auto-key-banner.js.map +1 -0
- package/dist/components/bill-estimator.d.ts +10 -0
- package/dist/components/bill-estimator.d.ts.map +1 -0
- package/dist/components/bill-estimator.js +22 -0
- package/dist/components/bill-estimator.js.map +1 -0
- package/dist/components/billing.d.ts.map +1 -1
- package/dist/components/billing.js +13 -1
- package/dist/components/billing.js.map +1 -1
- package/dist/components/cancel-subscription.d.ts +10 -0
- package/dist/components/cancel-subscription.d.ts.map +1 -0
- package/dist/components/cancel-subscription.js +57 -0
- package/dist/components/cancel-subscription.js.map +1 -0
- package/dist/components/capability-usage-card.d.ts +8 -0
- package/dist/components/capability-usage-card.d.ts.map +1 -0
- package/dist/components/capability-usage-card.js +39 -0
- package/dist/components/capability-usage-card.js.map +1 -0
- package/dist/components/chrome.d.ts.map +1 -1
- package/dist/components/chrome.js +1 -0
- package/dist/components/chrome.js.map +1 -1
- package/dist/components/credit.d.ts.map +1 -1
- package/dist/components/credit.js +1 -0
- package/dist/components/credit.js.map +1 -1
- package/dist/components/docs.d.ts.map +1 -1
- package/dist/components/docs.js +1 -0
- package/dist/components/docs.js.map +1 -1
- package/dist/components/env-badge.d.ts +14 -0
- package/dist/components/env-badge.d.ts.map +1 -0
- package/dist/components/env-badge.js +23 -0
- package/dist/components/env-badge.js.map +1 -0
- package/dist/components/error-boundary.d.ts +26 -0
- package/dist/components/error-boundary.d.ts.map +1 -0
- package/dist/components/error-boundary.js +43 -0
- package/dist/components/error-boundary.js.map +1 -0
- package/dist/components/feature-gate.d.ts +51 -0
- package/dist/components/feature-gate.d.ts.map +1 -0
- package/dist/components/feature-gate.js +61 -0
- package/dist/components/feature-gate.js.map +1 -0
- package/dist/components/feature.d.ts.map +1 -1
- package/dist/components/feature.js +1 -0
- package/dist/components/feature.js.map +1 -1
- package/dist/components/index.d.ts +40 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +33 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/keys.d.ts.map +1 -1
- package/dist/components/keys.js +1 -0
- package/dist/components/keys.js.map +1 -1
- package/dist/components/limit-boundary.d.ts +39 -0
- package/dist/components/limit-boundary.d.ts.map +1 -0
- package/dist/components/limit-boundary.js +63 -0
- package/dist/components/limit-boundary.js.map +1 -0
- package/dist/components/manifest-nav.d.ts +47 -0
- package/dist/components/manifest-nav.d.ts.map +1 -0
- package/dist/components/manifest-nav.js +26 -0
- package/dist/components/manifest-nav.js.map +1 -0
- package/dist/components/onboarding-view.d.ts +16 -0
- package/dist/components/onboarding-view.d.ts.map +1 -0
- package/dist/components/onboarding-view.js +23 -0
- package/dist/components/onboarding-view.js.map +1 -0
- package/dist/components/org-switcher.d.ts +11 -0
- package/dist/components/org-switcher.d.ts.map +1 -0
- package/dist/components/org-switcher.js +32 -0
- package/dist/components/org-switcher.js.map +1 -0
- package/dist/components/payment-health-banner.d.ts +8 -0
- package/dist/components/payment-health-banner.d.ts.map +1 -0
- package/dist/components/payment-health-banner.js +42 -0
- package/dist/components/payment-health-banner.js.map +1 -0
- package/dist/components/plans-table.d.ts.map +1 -1
- package/dist/components/plans-table.js +1 -0
- package/dist/components/plans-table.js.map +1 -1
- package/dist/components/product-docs/markdown.d.ts +8 -14
- package/dist/components/product-docs/markdown.d.ts.map +1 -1
- package/dist/components/product-docs/markdown.js +10 -14
- package/dist/components/product-docs/markdown.js.map +1 -1
- package/dist/components/product-docs/navigation.d.ts.map +1 -1
- package/dist/components/product-docs/navigation.js +1 -0
- package/dist/components/product-docs/navigation.js.map +1 -1
- package/dist/components/product-docs/product-docs-shell.d.ts.map +1 -1
- package/dist/components/product-docs/product-docs-shell.js +1 -0
- package/dist/components/product-docs/product-docs-shell.js.map +1 -1
- package/dist/components/product-docs/product-docs.d.ts.map +1 -1
- package/dist/components/product-docs/product-docs.js +1 -0
- package/dist/components/product-docs/product-docs.js.map +1 -1
- package/dist/components/rate-limit-display.d.ts +10 -0
- package/dist/components/rate-limit-display.d.ts.map +1 -0
- package/dist/components/rate-limit-display.js +48 -0
- package/dist/components/rate-limit-display.js.map +1 -0
- package/dist/components/resources-panel.d.ts +15 -0
- package/dist/components/resources-panel.d.ts.map +1 -0
- package/dist/components/resources-panel.js +53 -0
- package/dist/components/resources-panel.js.map +1 -0
- package/dist/components/root.d.ts +34 -2
- package/dist/components/root.d.ts.map +1 -1
- package/dist/components/root.js +33 -8
- package/dist/components/root.js.map +1 -1
- package/dist/components/sign-in.d.ts.map +1 -1
- package/dist/components/sign-in.js +1 -0
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/spend-cap-control.d.ts +8 -0
- package/dist/components/spend-cap-control.d.ts.map +1 -0
- package/dist/components/spend-cap-control.js +64 -0
- package/dist/components/spend-cap-control.js.map +1 -0
- package/dist/components/splash.d.ts.map +1 -1
- package/dist/components/splash.js +1 -0
- package/dist/components/splash.js.map +1 -1
- package/dist/components/styles.css +290 -0
- package/dist/components/team-panel.d.ts +8 -0
- package/dist/components/team-panel.d.ts.map +1 -0
- package/dist/components/team-panel.js +69 -0
- package/dist/components/team-panel.js.map +1 -0
- package/dist/components/theme.d.ts.map +1 -1
- package/dist/components/theme.js +1 -0
- package/dist/components/theme.js.map +1 -1
- package/dist/components/top-up-prompt.d.ts +13 -0
- package/dist/components/top-up-prompt.d.ts.map +1 -0
- package/dist/components/top-up-prompt.js +51 -0
- package/dist/components/top-up-prompt.js.map +1 -0
- package/dist/components/trial-banner.d.ts +11 -0
- package/dist/components/trial-banner.d.ts.map +1 -0
- package/dist/components/trial-banner.js +25 -0
- package/dist/components/trial-banner.js.map +1 -0
- package/dist/components/upgrade-prompt.d.ts +18 -0
- package/dist/components/upgrade-prompt.d.ts.map +1 -0
- package/dist/components/upgrade-prompt.js +76 -0
- package/dist/components/upgrade-prompt.js.map +1 -0
- package/dist/components/usage.d.ts.map +1 -1
- package/dist/components/usage.js +39 -6
- package/dist/components/usage.js.map +1 -1
- package/dist/config.d.ts +74 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +41 -3
- package/dist/config.js.map +1 -1
- package/dist/csv.d.ts +44 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +99 -0
- package/dist/csv.js.map +1 -0
- package/dist/deny-codes.d.ts +44 -0
- package/dist/deny-codes.d.ts.map +1 -0
- package/dist/deny-codes.js +76 -0
- package/dist/deny-codes.js.map +1 -0
- package/dist/errors.d.ts +238 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +382 -1
- package/dist/errors.js.map +1 -1
- package/dist/generated/catalog-types.d.ts +119 -0
- package/dist/generated/catalog-types.d.ts.map +1 -0
- package/dist/generated/catalog-types.js +21 -0
- package/dist/generated/catalog-types.js.map +1 -0
- package/dist/generated/version.d.ts +5 -0
- package/dist/generated/version.d.ts.map +1 -0
- package/dist/generated/version.js +18 -0
- package/dist/generated/version.js.map +1 -0
- package/dist/http.d.ts +6 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +246 -62
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +20 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -3
- package/dist/index.js.map +1 -1
- package/dist/organization.d.ts +31 -0
- package/dist/organization.d.ts.map +1 -0
- package/dist/organization.js +90 -0
- package/dist/organization.js.map +1 -0
- package/dist/react/hooks.d.ts +172 -6
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js +402 -19
- package/dist/react/hooks.js.map +1 -1
- package/dist/react/index.d.ts +9 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +12 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/organization-context.d.ts +42 -0
- package/dist/react/organization-context.d.ts.map +1 -0
- package/dist/react/organization-context.js +96 -0
- package/dist/react/organization-context.js.map +1 -0
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react/provider.js +3 -1
- package/dist/react/provider.js.map +1 -1
- package/dist/react/use-async.d.ts.map +1 -1
- package/dist/react/use-async.js +1 -0
- package/dist/react/use-async.js.map +1 -1
- package/dist/react/use-reconcile.d.ts +26 -0
- package/dist/react/use-reconcile.d.ts.map +1 -0
- package/dist/react/use-reconcile.js +70 -0
- package/dist/react/use-reconcile.js.map +1 -0
- package/dist/react/use-upgrade.d.ts +44 -0
- package/dist/react/use-upgrade.d.ts.map +1 -0
- package/dist/react/use-upgrade.js +115 -0
- package/dist/react/use-upgrade.js.map +1 -0
- package/dist/reconcile.d.ts +34 -0
- package/dist/reconcile.d.ts.map +1 -0
- package/dist/reconcile.js +66 -0
- package/dist/reconcile.js.map +1 -0
- package/dist/resources/account.d.ts +5 -1
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +8 -3
- package/dist/resources/account.js.map +1 -1
- package/dist/resources/api.d.ts +39 -0
- package/dist/resources/api.d.ts.map +1 -0
- package/dist/resources/api.js +78 -0
- package/dist/resources/api.js.map +1 -0
- package/dist/resources/auth.d.ts +7 -1
- package/dist/resources/auth.d.ts.map +1 -1
- package/dist/resources/auth.js +10 -1
- package/dist/resources/auth.js.map +1 -1
- package/dist/resources/billing.d.ts +47 -6
- package/dist/resources/billing.d.ts.map +1 -1
- package/dist/resources/billing.js +77 -14
- package/dist/resources/billing.js.map +1 -1
- package/dist/resources/entitlements.d.ts +24 -0
- package/dist/resources/entitlements.d.ts.map +1 -1
- package/dist/resources/entitlements.js +34 -0
- package/dist/resources/entitlements.js.map +1 -1
- package/dist/resources/plans.d.ts +4 -1
- package/dist/resources/plans.d.ts.map +1 -1
- package/dist/resources/plans.js +25 -1
- package/dist/resources/plans.js.map +1 -1
- package/dist/resources/product.d.ts +4 -1
- package/dist/resources/product.d.ts.map +1 -1
- package/dist/resources/product.js +3 -0
- package/dist/resources/product.js.map +1 -1
- package/dist/resources/resources.d.ts +46 -0
- package/dist/resources/resources.d.ts.map +1 -0
- package/dist/resources/resources.js +97 -0
- package/dist/resources/resources.js.map +1 -0
- package/dist/resources/usage.d.ts +15 -3
- package/dist/resources/usage.d.ts.map +1 -1
- package/dist/resources/usage.js +6 -0
- package/dist/resources/usage.js.map +1 -1
- package/dist/top-up.d.ts +12 -0
- package/dist/top-up.d.ts.map +1 -0
- package/dist/top-up.js +33 -0
- package/dist/top-up.js.map +1 -0
- package/dist/types.d.ts +205 -40
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +10 -3
- package/dist/types.js.map +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ This project adheres to Semantic Versioning (pre-1.0: minors may break).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.8.0] - 2026-06-22
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **Lockstep SDK family.** `@farthershore/farthershore-js`,
|
|
13
|
+
`@farthershore/product`, and `@farthershore/backend` now publish at ONE shared
|
|
14
|
+
version (`0.8.0`). The frontend SDK jumps `0.2.0` → `0.8.0` to align with the
|
|
15
|
+
family floor (the highest current SDK). Pin all three to the same version. A CI
|
|
16
|
+
invariant (`sdk-family-version` in `@farthershore/contracts`) keeps the three
|
|
17
|
+
`package.json` versions equal.
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- `X-FS-SDK-Version` request header on every Core call — a one-way client
|
|
22
|
+
annotation (value = the SDK version) for platform observability. The platform
|
|
23
|
+
does not branch on it.
|
|
24
|
+
- A compat fingerprint (`CONTRACTS_FP`) is stamped into the generated catalog
|
|
25
|
+
types — a stable hash over the canonical `@farthershore/contracts` DTO set so
|
|
26
|
+
CI can detect when an SDK projection drifts from contracts.
|
|
27
|
+
- The resolve/bootstrap DTO now carries an additive `schemaVersion` for future
|
|
28
|
+
negotiation (read tolerantly; absent = `1`).
|
|
29
|
+
|
|
8
30
|
## [0.2.0] - 2026-06-18
|
|
9
31
|
|
|
10
32
|
### Added
|
package/README.md
CHANGED
|
@@ -4,12 +4,14 @@ The **Farther Shore Frontend SDK** — the canonical browser integration layer
|
|
|
4
4
|
between a static frontend artifact (the default dev-portal template, generated
|
|
5
5
|
frontends, managed components, custom frontends) and the Farther Shore platform.
|
|
6
6
|
|
|
7
|
-
> **Status: `0.
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
>
|
|
11
|
-
>
|
|
12
|
-
>
|
|
7
|
+
> **Status: `0.8.0` (lockstep SDK family).** Published to npm. Versioned in
|
|
8
|
+
> lockstep with `@farthershore/product` and `@farthershore/backend` — pin the
|
|
9
|
+
> three to the SAME version. Pre-1.0, so minor versions may include breaking
|
|
10
|
+
> changes while the API stabilizes against the dev portal, managed template, and
|
|
11
|
+
> real builder features. See [`PUBLISHING.md`](./PUBLISHING.md) for the gates to
|
|
12
|
+
> `1.0.0` (wire-contract lock, browser token exchange, gateway CORS, stage e2e).
|
|
13
|
+
> The `@stripe/stripe-js` analog to the upstream runtime package
|
|
14
|
+
> `@farthershore/backend`.
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
17
|
pnpm add @farthershore/farthershore-js # React is an optional peer (for /react)
|
|
@@ -196,6 +198,37 @@ Hooks: `useBootstrap`, `useProduct`, `useSession` (+ `signIn`/`signOut`),
|
|
|
196
198
|
`openBillingPortal`), `useFeature(name)`, plus `useFartherShore()` for the raw
|
|
197
199
|
client. They're thin wrappers over the client — no duplicated logic.
|
|
198
200
|
|
|
201
|
+
## Customizing the portal (the fork model)
|
|
202
|
+
|
|
203
|
+
Every product ships with a generic managed portal by default. To customize it,
|
|
204
|
+
**edit the product repo's `frontend/` tree** (what `farthershore init` / platform
|
|
205
|
+
provisioning scaffolds): change the components, layout, and styles, then push —
|
|
206
|
+
the platform rebuilds `frontend/` into a custom release and serves it instead of
|
|
207
|
+
the default. Your product's _contract_ (plans, pricing, routes, meters) lives in
|
|
208
|
+
`product/` and is managed as code; the UI lives in `frontend/`.
|
|
209
|
+
|
|
210
|
+
The scaffold is already SDK-wired: one `createFartherShoreClient.fromEnv()`
|
|
211
|
+
client (coreUrl from the bundler env in dev, edge-injected `window.__FS_CONFIG__`
|
|
212
|
+
in prod — env stays automatic) under one `<FartherShoreRoot>`, rendering the
|
|
213
|
+
zero-prop data components (`<PlansTable/>`, `<UsageCard/>`, `<BillingSummary/>`,
|
|
214
|
+
`<ApiKeysPanel/>`, …).
|
|
215
|
+
|
|
216
|
+
### Rendering a product-authored nav after a fork — `<FsManifestNav>`
|
|
217
|
+
|
|
218
|
+
A product can author a `frontendManifest` (nav + pages) in `product.config.ts`.
|
|
219
|
+
The managed default template renders it, but a **fork that replaces the template
|
|
220
|
+
silently drops it**. `<FsManifestNav>` is the opt-in fix: it maps the manifest's
|
|
221
|
+
`nav` entries to links so the authored nav survives a fork with one import. It's
|
|
222
|
+
zero-prop, accessible (a `<nav aria-label>` of links with `aria-current` on the
|
|
223
|
+
active path), and renders nothing when no manifest was authored.
|
|
224
|
+
|
|
225
|
+
```tsx
|
|
226
|
+
import { FsManifestNav } from "@farthershore/farthershore-js/components";
|
|
227
|
+
|
|
228
|
+
// Renders boot.frontendManifest.nav; swap in a router <Link> via linkComponent.
|
|
229
|
+
<FsManifestNav activePath={location.pathname} />;
|
|
230
|
+
```
|
|
231
|
+
|
|
199
232
|
## Deferred (no platform endpoint yet)
|
|
200
233
|
|
|
201
234
|
- **Clerk browser sign-in** is host-app-driven (pass `getToken`); the SDK doesn't
|
|
@@ -205,13 +238,16 @@ client. They're thin wrappers over the client — no duplicated logic.
|
|
|
205
238
|
|
|
206
239
|
## Versioning & stability
|
|
207
240
|
|
|
208
|
-
This package is **pre-1.0 (`0.x`)
|
|
209
|
-
|
|
241
|
+
This package is **pre-1.0 (`0.x`)** and ships as part of a **lockstep SDK
|
|
242
|
+
family**: `@farthershore/farthershore-js`, `@farthershore/product`, and
|
|
243
|
+
`@farthershore/backend` are published at the SAME version (currently `0.8.0`).
|
|
244
|
+
Pin all three to the same version. Under SemVer's 0.x rules a **minor** bump
|
|
245
|
+
(`0.8.x` → `0.9.0`) may include **breaking changes**, so the usual caret range is
|
|
210
246
|
unsafe here:
|
|
211
247
|
|
|
212
|
-
- ❌ `^0.
|
|
213
|
-
silently accept a breaking `0.
|
|
214
|
-
- ✅ Pin **exact** (`0.
|
|
248
|
+
- ❌ `^0.8` / `^0.8.0` — caret does **not** lock the minor across `0.x`; it would
|
|
249
|
+
silently accept a breaking `0.9.0`.
|
|
250
|
+
- ✅ Pin **exact** (`0.8.0`) or use a patch-only tilde (`~0.8.0`) until `1.0.0`.
|
|
215
251
|
|
|
216
252
|
Breaking changes within `0.x` are recorded in [`CHANGELOG.md`](./CHANGELOG.md)
|
|
217
253
|
(Keep a Changelog format) — read it before bumping.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FsAuthUser } from "./types.js";
|
|
2
|
+
/** Normalize a Clerk user object OR a persona sign-in response user into the
|
|
3
|
+
* SDK's {@link FsAuthUser}. Returns null when `raw` isn't an object (signed
|
|
4
|
+
* out / unknown). Every named field degrades to null; `fullName` falls back to
|
|
5
|
+
* `first last` when Clerk/persona doesn't supply one. */
|
|
6
|
+
export declare function normalizeAuthUser(raw: unknown): FsAuthUser | null;
|
|
7
|
+
//# sourceMappingURL=auth-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-user.d.ts","sourceRoot":"","sources":["../src/auth-user.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAkB7C;;;0DAG0D;AAC1D,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAmBjE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// W6.1 — the FsAuthUser normalizer. One typed identity (`FsAuthUser`) over the
|
|
2
|
+
// two shapes the SDK ever sees: Clerk's user object and the persona sign-in
|
|
3
|
+
// RESPONSE user (built by core's `synthesizeUser`). Both put the primary email
|
|
4
|
+
// at the NESTED path `primaryEmailAddress.emailAddress` — read that path, with
|
|
5
|
+
// a flat `email` fallback. SDK-only: no platform/contracts dependency.
|
|
6
|
+
function str(v) {
|
|
7
|
+
return typeof v === "string" && v.length > 0 ? v : null;
|
|
8
|
+
}
|
|
9
|
+
/** Read the primary email from EITHER the Clerk/persona nested
|
|
10
|
+
* `primaryEmailAddress.emailAddress` path OR a flat top-level `email`. */
|
|
11
|
+
function readEmail(o) {
|
|
12
|
+
const nested = o.primaryEmailAddress;
|
|
13
|
+
if (nested && typeof nested === "object") {
|
|
14
|
+
const email = nested.emailAddress;
|
|
15
|
+
const s = str(email);
|
|
16
|
+
if (s)
|
|
17
|
+
return s;
|
|
18
|
+
}
|
|
19
|
+
return str(o.email);
|
|
20
|
+
}
|
|
21
|
+
/** Normalize a Clerk user object OR a persona sign-in response user into the
|
|
22
|
+
* SDK's {@link FsAuthUser}. Returns null when `raw` isn't an object (signed
|
|
23
|
+
* out / unknown). Every named field degrades to null; `fullName` falls back to
|
|
24
|
+
* `first last` when Clerk/persona doesn't supply one. */
|
|
25
|
+
export function normalizeAuthUser(raw) {
|
|
26
|
+
if (!raw || typeof raw !== "object")
|
|
27
|
+
return null;
|
|
28
|
+
const o = raw;
|
|
29
|
+
const firstName = str(o.firstName);
|
|
30
|
+
const lastName = str(o.lastName);
|
|
31
|
+
const explicitFull = str(o.fullName);
|
|
32
|
+
const synthesizedFull = [firstName, lastName].filter(Boolean).join(" ") || null;
|
|
33
|
+
return {
|
|
34
|
+
id: str(o.id),
|
|
35
|
+
firstName,
|
|
36
|
+
lastName,
|
|
37
|
+
fullName: explicitFull ?? synthesizedFull,
|
|
38
|
+
email: readEmail(o),
|
|
39
|
+
imageUrl: str(o.imageUrl),
|
|
40
|
+
raw,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=auth-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-user.js","sourceRoot":"","sources":["../src/auth-user.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/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AC,CAAC;QACnB,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;QACzB,GAAG;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** The auto-created key arrives as `string | { secret?: string } | null` on the
|
|
2
|
+
* wire (OnboardingResult.autoApiKey). Normalize it to the bare secret, or null. */
|
|
3
|
+
export declare function normalizeAutoApiKey(value: unknown): string | null;
|
|
4
|
+
/** Stash the one-time secret for the dashboard to reveal. A falsy/invalid value
|
|
5
|
+
* is a no-op (the banner simply never shows). SSR/storage-blocked safe. */
|
|
6
|
+
export declare function storeAutoApiKey(value: unknown): void;
|
|
7
|
+
/** Read the stored secret WITHOUT clearing it. Returns null when none is
|
|
8
|
+
* stashed (or storage is unavailable). Clearing is the caller's explicit
|
|
9
|
+
* post-mount step so a re-render can't consume the showing key. */
|
|
10
|
+
export declare function peekAutoApiKey(): string | null;
|
|
11
|
+
/** Consume the stored secret — call once the reveal banner has mounted, so it is
|
|
12
|
+
* shown exactly once and never re-shown on a later visit. */
|
|
13
|
+
export declare function clearAutoApiKey(): void;
|
|
14
|
+
//# sourceMappingURL=auto-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-key.d.ts","sourceRoot":"","sources":["../src/auto-key.ts"],"names":[],"mappings":"AAkBA;oFACoF;AACpF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOjE;AAED;4EAC4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAUpD;AAED;;oEAEoE;AACpE,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAS9C;AAED;8DAC8D;AAC9D,wBAAgB,eAAe,IAAI,IAAI,CAQtC"}
|
package/dist/auto-key.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// One-time auto-created API-key reveal store (W8.4).
|
|
2
|
+
//
|
|
3
|
+
// During onboarding the platform auto-creates an API key whose secret is shown
|
|
4
|
+
// EXACTLY ONCE (`OnboardingResult.autoApiKey`). This SDK-managed store hands that
|
|
5
|
+
// secret from the onboarding/subscribe call to the dashboard, where it is
|
|
6
|
+
// revealed once and cleared — so a generated frontend doesn't hand-roll the
|
|
7
|
+
// stash (the dev-portal template previously kept its own copy).
|
|
8
|
+
//
|
|
9
|
+
// Backed by sessionStorage: the secret never lands in a URL / browser history
|
|
10
|
+
// and dies with the tab. The contract mirrors the SSR portal's 60s HttpOnly
|
|
11
|
+
// cookie: shown once, never re-shown.
|
|
12
|
+
// - storeAutoApiKey(value): stash after the onboarding/subscribe call.
|
|
13
|
+
// - peekAutoApiKey(): read WITHOUT clearing (so a StrictMode double
|
|
14
|
+
// render or remount can't eat the one showing).
|
|
15
|
+
// - clearAutoApiKey(): consume it — call once the banner has mounted.
|
|
16
|
+
const AUTO_KEY_STORAGE_KEY = "fs_auto_key";
|
|
17
|
+
/** The auto-created key arrives as `string | { secret?: string } | null` on the
|
|
18
|
+
* wire (OnboardingResult.autoApiKey). Normalize it to the bare secret, or null. */
|
|
19
|
+
export function normalizeAutoApiKey(value) {
|
|
20
|
+
if (typeof value === "string" && value)
|
|
21
|
+
return value;
|
|
22
|
+
if (value && typeof value === "object") {
|
|
23
|
+
const secret = value.secret;
|
|
24
|
+
if (typeof secret === "string" && secret)
|
|
25
|
+
return secret;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
/** Stash the one-time secret for the dashboard to reveal. A falsy/invalid value
|
|
30
|
+
* is a no-op (the banner simply never shows). SSR/storage-blocked safe. */
|
|
31
|
+
export function storeAutoApiKey(value) {
|
|
32
|
+
const key = normalizeAutoApiKey(value);
|
|
33
|
+
if (!key)
|
|
34
|
+
return;
|
|
35
|
+
try {
|
|
36
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
37
|
+
window.sessionStorage.setItem(AUTO_KEY_STORAGE_KEY, key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
/* no storage → the banner simply never shows */
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Read the stored secret WITHOUT clearing it. Returns null when none is
|
|
45
|
+
* stashed (or storage is unavailable). Clearing is the caller's explicit
|
|
46
|
+
* post-mount step so a re-render can't consume the showing key. */
|
|
47
|
+
export function peekAutoApiKey() {
|
|
48
|
+
try {
|
|
49
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
50
|
+
return window.sessionStorage.getItem(AUTO_KEY_STORAGE_KEY);
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Consume the stored secret — call once the reveal banner has mounted, so it is
|
|
59
|
+
* shown exactly once and never re-shown on a later visit. */
|
|
60
|
+
export function clearAutoApiKey() {
|
|
61
|
+
try {
|
|
62
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
63
|
+
window.sessionStorage.removeItem(AUTO_KEY_STORAGE_KEY);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
/* best-effort */
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=auto-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-key.js","sourceRoot":"","sources":["../src/auto-key.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,+EAA+E;AAC/E,kFAAkF;AAClF,0EAA0E;AAC1E,4EAA4E;AAC5E,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,sCAAsC;AACtC,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAE7E,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAE3C;oFACoF;AACpF,MAAM,UAAU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AAC;IAAC,MAAM,CAAC;QACP,iBAAiB;IACnB,CAAC;AACH,CAAC"}
|
package/dist/bootstrap.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { type ClientContext } from "./config.js";
|
|
2
|
-
import type { Bootstrap } from "./types.js";
|
|
2
|
+
import type { Bootstrap, Plan } from "./types.js";
|
|
3
|
+
import type { PortalPlanWire, PlanMeterWire, PlanLimitWire } from "./generated/catalog-types.js";
|
|
4
|
+
type RawPlanMeter = PlanMeterWire;
|
|
5
|
+
type RawPlanLimit = PlanLimitWire;
|
|
6
|
+
type RawPortalPlan = Omit<PortalPlanWire, "grants" | "meters" | "limits" | "planDetails" | "featureGates" | "capability_limits" | "max_monthly_spend_cents" | "min_monthly_spend_cents"> & {
|
|
7
|
+
grants?: PortalPlanWire["grants"] | null;
|
|
8
|
+
meters?: RawPlanMeter[] | null;
|
|
9
|
+
limits?: RawPlanLimit[] | null;
|
|
10
|
+
planDetails?: string[] | null;
|
|
11
|
+
featureGates?: Record<string, boolean> | null;
|
|
12
|
+
capability_limits?: Record<string, number | boolean> | null;
|
|
13
|
+
max_monthly_spend_cents?: number | null;
|
|
14
|
+
min_monthly_spend_cents?: number | null;
|
|
15
|
+
};
|
|
16
|
+
/** Map a snake_case wire `PortalPlan` → the camelCase domain {@link Plan}.
|
|
17
|
+
* INTERNAL helper shared by `resolveBootstrap` (catalog) and the `/me`
|
|
18
|
+
* account surface (`availablePlans`) — NOT part of the public API. */
|
|
19
|
+
export declare function mapPlan(p: RawPortalPlan): Plan;
|
|
3
20
|
/** Resolve + cache the product/env/gateway onto `ctx`. Idempotent — safe to call
|
|
4
21
|
* repeatedly; the client memoizes the result. */
|
|
5
22
|
export declare function resolveBootstrap(ctx: ClientContext): Promise<Bootstrap>;
|
|
23
|
+
export {};
|
|
6
24
|
//# sourceMappingURL=bootstrap.d.ts.map
|
package/dist/bootstrap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAEV,SAAS,
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAEV,SAAS,EAMT,IAAI,EAKL,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACd,MAAM,8BAA8B,CAAC;AAiDtC,KAAK,YAAY,GAAG,aAAa,CAAC;AAClC,KAAK,YAAY,GAAG,aAAa,CAAC;AAQlC,KAAK,aAAa,GAAG,IAAI,CACvB,cAAc,EACZ,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,yBAAyB,GACzB,yBAAyB,CAC5B,GAAG;IACF,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC,CAAC;AAoFF;;uEAEuE;AACvE,wBAAgB,OAAO,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,CAqB9C;AAsED;kDACkD;AAClD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CA8C7E"}
|
package/dist/bootstrap.js
CHANGED
|
@@ -77,13 +77,19 @@ function mapPlanLimit(l) {
|
|
|
77
77
|
...(l.enforcement ? { enforcement: l.enforcement } : {}),
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
/** Map a snake_case wire `PortalPlan` → the camelCase domain {@link Plan}.
|
|
81
|
+
* INTERNAL helper shared by `resolveBootstrap` (catalog) and the `/me`
|
|
82
|
+
* account surface (`availablePlans`) — NOT part of the public API. */
|
|
83
|
+
export function mapPlan(p) {
|
|
81
84
|
return {
|
|
82
85
|
id: p.id,
|
|
83
86
|
key: p.key,
|
|
84
87
|
name: p.name,
|
|
85
88
|
description: p.description ?? null,
|
|
86
89
|
recurringFeeCents: p.recurring_fee_cents,
|
|
90
|
+
// The platform omits `billing_interval` for monthly plans (the default);
|
|
91
|
+
// default a missing/absent value to "month" so the UI always has a cadence.
|
|
92
|
+
billingInterval: p.billing_interval === "year" ? "year" : "month",
|
|
87
93
|
grants: p.grants ?? [],
|
|
88
94
|
trialDays: p.trial_days,
|
|
89
95
|
maxMonthlySpendCents: p.max_monthly_spend_cents ?? null,
|
|
@@ -93,8 +99,48 @@ function mapPlan(p) {
|
|
|
93
99
|
planDetails: p.planDetails ?? [],
|
|
94
100
|
featureGates: p.featureGates ?? {},
|
|
95
101
|
capabilityLimits: p.capability_limits ?? {},
|
|
102
|
+
...(p.creditPolicy ? { creditPolicy: p.creditPolicy } : {}),
|
|
96
103
|
};
|
|
97
104
|
}
|
|
105
|
+
/** Map the resolve DTO's declared-resource catalog into the SDK domain type,
|
|
106
|
+
* enriching each entry with its per-plan numeric `cap`. The cap is NOT on the
|
|
107
|
+
* catalog wire shape — it lives on each plan's `capability_limits[<name>]`
|
|
108
|
+
* (the BARE resource name, e.g. `widgets`, NOT `resource:widgets`). We resolve
|
|
109
|
+
* it from the FEATURED plan when one is set, else the first plan that caps it,
|
|
110
|
+
* so the catalog carries a sensible default ceiling for display. A `true`
|
|
111
|
+
* (unlimited) or non-numeric entry leaves `cap` undefined; a resource no plan
|
|
112
|
+
* caps stays uncapped. The authoritative live cap for the SUBSCRIBER's pinned
|
|
113
|
+
* plan still comes from `fs.resources(name).count()` (W5.2). */
|
|
114
|
+
function mapDeclaredResources(raw, plans, featuredCompiledPlanId) {
|
|
115
|
+
if (!Array.isArray(raw))
|
|
116
|
+
return [];
|
|
117
|
+
const featured = featuredCompiledPlanId
|
|
118
|
+
? plans.find((p) => p.id === featuredCompiledPlanId)
|
|
119
|
+
: undefined;
|
|
120
|
+
function capFor(name) {
|
|
121
|
+
const fromFeatured = featured?.capabilityLimits[name];
|
|
122
|
+
if (typeof fromFeatured === "number")
|
|
123
|
+
return fromFeatured;
|
|
124
|
+
for (const plan of plans) {
|
|
125
|
+
const value = plan.capabilityLimits[name];
|
|
126
|
+
if (typeof value === "number")
|
|
127
|
+
return value;
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
return raw
|
|
132
|
+
.filter((r) => !!r && typeof r.name === "string")
|
|
133
|
+
.map((r) => {
|
|
134
|
+
const cap = capFor(r.name);
|
|
135
|
+
return {
|
|
136
|
+
name: r.name,
|
|
137
|
+
...(r.display ? { display: r.display } : {}),
|
|
138
|
+
scope: r.scope === "subject" ? "subject" : "subscription",
|
|
139
|
+
...(r.subjectType ? { subjectType: r.subjectType } : {}),
|
|
140
|
+
...(cap !== undefined ? { cap } : {}),
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
}
|
|
98
144
|
/** Derive coarse capability keys from the resolved product + plans so a
|
|
99
145
|
* managed frontend can branch on what the product actually offers (instead of
|
|
100
146
|
* the previously hard-coded empty array). */
|
|
@@ -144,6 +190,8 @@ export async function resolveBootstrap(ctx) {
|
|
|
144
190
|
ctx.environmentId = ctx.environmentId ?? environment.id;
|
|
145
191
|
ctx.gatewayUrl = ctx.gatewayUrl ?? `https://${product.gatewayHost}`;
|
|
146
192
|
return {
|
|
193
|
+
// CC5 — tolerant read: absent version means the pre-versioning shape (1).
|
|
194
|
+
schemaVersion: raw.schemaVersion ?? 1,
|
|
147
195
|
product,
|
|
148
196
|
environment,
|
|
149
197
|
branding: product.branding,
|
|
@@ -151,6 +199,7 @@ export async function resolveBootstrap(ctx) {
|
|
|
151
199
|
frontendReleaseHash: raw.frontendReleaseHash ?? null,
|
|
152
200
|
frontendManifest: raw.frontendManifest ?? null,
|
|
153
201
|
capabilities: deriveCapabilities(product, plans),
|
|
202
|
+
declaredResources: mapDeclaredResources(raw.product.declaredResources, plans, product.featuredCompiledPlanId),
|
|
154
203
|
features: [],
|
|
155
204
|
};
|
|
156
205
|
}
|
package/dist/bootstrap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,iFAAiF;AACjF,gFAAgF;AAChF,sCAAsC;AACtC,EAAE;AACF,8EAA8E;AAC9E,uEAAuE;AACvE,gFAAgF;AAChF,6EAA6E;AAC7E,2EAA2E;AAC3E,kDAAkD;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,iFAAiF;AACjF,gFAAgF;AAChF,sCAAsC;AACtC,EAAE;AACF,8EAA8E;AAC9E,uEAAuE;AACvE,gFAAgF;AAChF,6EAA6E;AAC7E,2EAA2E;AAC3E,kDAAkD;AAElD,OAAO,EAAE,SAAS,E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,GAAG,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC,EAAE,CAAC;IAC5C,IAAI,WAAW;QAAE,GAAG,CAAC,aAAa,GAAG,GAAG,CAAC,aAAa,IAAI,WAAW,CAAC,EAAE,CAAC;IACzE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,IAAI,WAAW,OAAO,CAAC,WAAW,EAAE,CAAC;IAEpE,OAAO;QACL,0EAA0E;QAC1E,aAAa,EAAE,GAAG,CAAC,aAAa,IAAI,CAAC;QACrC,OAAO;QACP,WAAW;QACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK;QACL,mBAAmB,EAAE,GAAG,CAAC,mBAAmB,IAAI,IAAI;QACpD,gBAAgB,EAAE,GAAG,CAAC,gBAAgB,IAAI,IAAI;QAC9C,YAAY,EAAE,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC;QAChD,iBAAiB,EAAE,oBAAoB,CACrC,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAC7B,KAAK,EACL,OAAO,CAAC,sBAAsB,CAC/B;QACD,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC"}
|
package/dist/cache.d.ts
CHANGED
|
@@ -6,4 +6,13 @@ export interface ReadCacheEntry {
|
|
|
6
6
|
export declare function cachedRead<T>(ctx: ClientContext, parts: ReadonlyArray<string | null | undefined>, fn: () => Promise<T>): Promise<T>;
|
|
7
7
|
/** Drop every cached read — after any mutation, auth change, or org switch. */
|
|
8
8
|
export declare function bustReadCache(ctx: ClientContext): void;
|
|
9
|
+
/**
|
|
10
|
+
* Reset everything an ENTITLEMENT-MUTATING action invalidates (W6.3): the read
|
|
11
|
+
* cache AND the cached short-lived gateway context token. A plan change /
|
|
12
|
+
* cancel / restore / top-up / subscribe can change what the edge grants, so the
|
|
13
|
+
* next feature call must re-mint a token reflecting the new entitlement instead
|
|
14
|
+
* of riding the stale one. Use this (not bare {@link bustReadCache}) after any
|
|
15
|
+
* mutation that can move the subscriber's entitlement.
|
|
16
|
+
*/
|
|
17
|
+
export declare function bustEntitlementCaches(ctx: ClientContext): void;
|
|
9
18
|
//# sourceMappingURL=cache.d.ts.map
|
package/dist/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAC/C,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAEtD"}
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3B;AAED,wBAAgB,UAAU,CAAC,CAAC,EAC1B,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAC/C,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAEtD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAG9D"}
|
package/dist/cache.js
CHANGED
|
@@ -31,4 +31,16 @@ export function cachedRead(ctx, parts, fn) {
|
|
|
31
31
|
export function bustReadCache(ctx) {
|
|
32
32
|
ctx.readCache.clear();
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Reset everything an ENTITLEMENT-MUTATING action invalidates (W6.3): the read
|
|
36
|
+
* cache AND the cached short-lived gateway context token. A plan change /
|
|
37
|
+
* cancel / restore / top-up / subscribe can change what the edge grants, so the
|
|
38
|
+
* next feature call must re-mint a token reflecting the new entitlement instead
|
|
39
|
+
* of riding the stale one. Use this (not bare {@link bustReadCache}) after any
|
|
40
|
+
* mutation that can move the subscriber's entitlement.
|
|
41
|
+
*/
|
|
42
|
+
export function bustEntitlementCaches(ctx) {
|
|
43
|
+
ctx.readCache.clear();
|
|
44
|
+
ctx.gatewayContextToken = null;
|
|
45
|
+
}
|
|
34
46
|
//# sourceMappingURL=cache.js.map
|
package/dist/cache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,uEAAuE;AACvE,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,EAAE;AACF,qEAAqE;AACrE,yEAAyE;AACzE,sCAAsC;AAItC,MAAM,WAAW,GAAG,MAAM,CAAC;AAO3B,MAAM,UAAU,UAAU,CACxB,GAAkB,EAClB,KAA+C,EAC/C,EAAoB;IAEpB,MAAM,GAAG,GAAG,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,M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