@usequeek/app-sdk 0.6.0 → 0.6.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/README.md +35 -22
- package/dist/auth-fetch.d.ts +23 -22
- package/dist/auth-fetch.d.ts.map +1 -1
- package/dist/auth-fetch.js +23 -21
- package/dist/auth-fetch.js.map +1 -1
- package/dist/browser.d.ts +25 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +27 -0
- package/dist/browser.js.map +1 -0
- package/dist/server.d.ts +3 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +12 -50
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +15 -83
- package/dist/session.js.map +1 -1
- package/dist/theme.d.ts +9 -5
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +9 -5
- package/dist/theme.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -10,6 +10,18 @@ npm i @usequeek/app-sdk pg
|
|
|
10
10
|
|
|
11
11
|
Requires Node `>=22.14`. `pg` is a regular dependency (the production store). `hono` is an optional peer — install it (`npm i hono`) only if you use the Hono wrappers.
|
|
12
12
|
|
|
13
|
+
## Which entry do I import?
|
|
14
|
+
|
|
15
|
+
| Import | For | Pulls in |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `@usequeek/app-sdk` (main) | Server / universal code: handlers, client, stores, verifiers | `node:crypto`, `pg` — NOT browser-bundlable |
|
|
18
|
+
| `@usequeek/app-sdk/server` | Session-token verifier (`verifySessionToken`) | Server-only (`jose`) — never import in a browser bundle |
|
|
19
|
+
| `@usequeek/app-sdk/hono` | Thin Hono wrappers (`hono` optional peer) | Server-only |
|
|
20
|
+
| `@usequeek/app-sdk/react` | React apps (`<QueekProvider>`, `useQueek()`; `react` optional peer) | Browser-safe (built on the same bridge modules as `/browser`) |
|
|
21
|
+
| `@usequeek/app-sdk/browser` | Plain-browser code: `installAuthFetch` + bridge/theme helpers, no framework | Browser-safe ONLY — importing these helpers from the main entry drags in the whole barrel and breaks Vite/Rollup builds |
|
|
22
|
+
|
|
23
|
+
Browser rule of thumb: if the code ships to the browser and does not need React, import it from `@usequeek/app-sdk/browser`. `installAuthFetch` is a browser-safe MODULE, but it is not browser-safe FROM THE MAIN ENTRY — the main barrel re-exports server modules (`app-auth` → `node:crypto`, `store` → `pg`), so a bundler resolving `installAuthFetch` from `@usequeek/app-sdk` still parses those Node-only files and fails.
|
|
24
|
+
|
|
13
25
|
The shape follows [`@shopify/shopify-api`](https://github.com/Shopify/shopify-app-js/blob/main/packages/apps/shopify-api/README.md): the core "doesn't rely on any specific framework, so you can include it alongside your preferred stack" (runtime differences are covered by adapters such as `@shopify/shopify-api/adapters/node`), and framework integrations are separate packages in the [shopify-app-js monorepo](https://github.com/Shopify/shopify-app-js) (e.g. `@shopify/shopify-app-express` and `@shopify/shopify-app-remix` build on `@shopify/shopify-api`).
|
|
14
26
|
|
|
15
27
|
## Example (any framework)
|
|
@@ -325,15 +337,17 @@ Hono: mount `createProxyHandler({ store, path, onVerified })` from
|
|
|
325
337
|
`verifySessionToken` — HS256 dashboard session tokens minted per installation
|
|
326
338
|
(`embsec_…` secret, raw UTF-8 key bytes, 20 s clock tolerance, slug audience,
|
|
327
339
|
issuer = the handoff `apiBase` verbatim (`installation.apiBase` — it equals the
|
|
328
|
-
bare `app.url` the backend signs as `iss`), full installation binding).
|
|
340
|
+
bare `app.url` the backend signs as `iss`), full installation binding). One token
|
|
341
|
+
type, exactly Shopify's `id_token`: the dashboard puts the same token in the
|
|
342
|
+
first-load URL param (`queek_token`, stripped on arrival) and answers bridge
|
|
343
|
+
`ready` requests with it, so the app's exchange endpoint verifies first-load and
|
|
344
|
+
refresh tokens with this one verifier — no purpose split, extra claims are
|
|
345
|
+
ignored. The secret never enters a
|
|
329
346
|
browser bundle: the main entry does not export the verifier. The install
|
|
330
347
|
and resync handoffs deliver `embed_secret` + `app_id`; the store keeps
|
|
331
348
|
them on the installation (`embedSecret` encrypted, `appId`), and
|
|
332
349
|
`sessionTokenInstallationId` reads the token's `installation_id` as an
|
|
333
350
|
unverified routing hint so a server can load that row before verifying.
|
|
334
|
-
`verifyLaunchToken` checks the signed-first-load token the same way plus the purpose pin
|
|
335
|
-
(`purpose` must be `launch`, with the `store` p_id and `theme` hints) — a launch token is refused
|
|
336
|
-
as a bridge token and vice versa.
|
|
337
351
|
- **frame** (`frame.ts`, browser-safe, no secret): the embedded-app bridge
|
|
338
352
|
v1 — typed unions both directions (`ready{capabilities,sdkVersion}`,
|
|
339
353
|
`theme`, `title`/`title-action`, `toast`, `save-bar`/`save-bar-action`,
|
|
@@ -363,8 +377,10 @@ Hono: mount `createProxyHandler({ store, path, onVerified })` from
|
|
|
363
377
|
Each pick carries a `requestId` (on `pick-resource`); a dashboard that
|
|
364
378
|
declares `pick-resource` MUST echo it on `resource-picked` / `resource-pick-cancelled` — answers with a
|
|
365
379
|
different or missing id are dropped as stale.
|
|
366
|
-
- **auth** (`auth-fetch.ts`, browser-safe
|
|
367
|
-
|
|
380
|
+
- **auth** (`auth-fetch.ts`, no secret — browser-safe as a module, but import it
|
|
381
|
+
from `@usequeek/app-sdk/browser` in browser bundles, never from the main
|
|
382
|
+
entry): `installAuthFetch({ exchange })`
|
|
383
|
+
— reads the dashboard token (`queek_token` query param) from the first
|
|
368
384
|
load, strips it with `history.replaceState`, exchanges it once for the
|
|
369
385
|
app's own session, attaches `Authorization: Bearer <session>` to
|
|
370
386
|
same-origin fetch (cookies stay out), and re-establishes via the bridge
|
|
@@ -372,27 +388,25 @@ Hono: mount `createProxyHandler({ store, path, onVerified })` from
|
|
|
372
388
|
window itself) and is not retried per request after a failed attempt — only
|
|
373
389
|
after a later dashboard token arrives. Pass the same `capabilities`/
|
|
374
390
|
`sdkVersion` as the provider so its refresh `ready` announces one consistent set. The app's
|
|
375
|
-
token-exchange endpoint receives the
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
(both purposes):
|
|
391
|
+
token-exchange endpoint receives the first-load token and every 401-refresh
|
|
392
|
+
token through the same `exchange` callback — one token type, so it verifies
|
|
393
|
+
both with the single `verifySessionToken` verifier:
|
|
379
394
|
|
|
380
395
|
```ts
|
|
381
|
-
import {
|
|
396
|
+
import { verifySessionTokenDetailed } from "@usequeek/app-sdk/server";
|
|
382
397
|
|
|
383
398
|
async function exchange(token: string): Promise<string> {
|
|
384
399
|
const options = { secret: installation.embedSecret!, audience: "my-app", issuer: installation.apiBase, expected };
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
if (bridge.ok) return mintAppSession(bridge.claims);
|
|
389
|
-
throw Object.assign(new Error("unauthorized"), { status: 401 });
|
|
400
|
+
const checked = await verifySessionTokenDetailed(token, options);
|
|
401
|
+
if (!checked.ok) throw Object.assign(new Error("unauthorized"), { status: 401 });
|
|
402
|
+
return mintAppSession(checked.claims);
|
|
390
403
|
}
|
|
391
404
|
```
|
|
392
405
|
- **theme** (`theme.ts`, browser-safe, no secret): `applyTheme(mode)` toggles
|
|
393
406
|
`.dark` on `<html>` + `color-scheme` (shadcn's dark-mode mechanism);
|
|
394
|
-
`themeBootstrapScript()` returns the inline `<head>` snippet that reads
|
|
395
|
-
`theme`
|
|
407
|
+
`themeBootstrapScript()` returns the inline `<head>` snippet that reads the
|
|
408
|
+
unsigned `theme` URL param before first paint (no flash — a first-paint hint
|
|
409
|
+
only, validated to `light`|`dark`, overwritten by the live bridge message);
|
|
396
410
|
`installThemeListener` follows live bridge `theme{mode}` messages (only from
|
|
397
411
|
`window.parent` by default; pass `expectSource` to override). The live mode is
|
|
398
412
|
remembered in `sessionStorage`, and the bootstrap script falls back to it when
|
|
@@ -461,10 +475,9 @@ Replace the host with the dashboard origin you registered. `frame-ancestors`
|
|
|
461
475
|
is a docs-only control the dashboard cannot enforce for you: without it any
|
|
462
476
|
site may frame the page, and the token handshake (origin-bound) is your only
|
|
463
477
|
remaining gate. Verify every token server-side before trusting calls that carry one:
|
|
464
|
-
the token-exchange endpoint receives the
|
|
465
|
-
|
|
466
|
-
`
|
|
467
|
-
(both purposes — see the `auth` entry above).
|
|
478
|
+
the token-exchange endpoint receives the first-load token and every 401-refresh
|
|
479
|
+
token through the same `installAuthFetch({ exchange })` callback — one token type,
|
|
480
|
+
verified with the single `verifySessionToken` verifier (see the `auth` entry above).
|
|
468
481
|
|
|
469
482
|
## Local development
|
|
470
483
|
|
package/dist/auth-fetch.d.ts
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Same-origin session carriage for embedded apps (U-validation "Auth
|
|
3
|
-
* carriage"): `installAuthFetch()` reads the
|
|
4
|
-
* first
|
|
3
|
+
* carriage"): `installAuthFetch()` reads the dashboard token from the
|
|
4
|
+
* first-load URL (`?queek_token=`, stripped immediately), exchanges it
|
|
5
|
+
* ONCE for the app's own session, and attaches
|
|
5
6
|
* `Authorization: Bearer <session>` to every same-origin fetch. A 401
|
|
6
7
|
* re-establishes the session via the bridge `ready→token` flow and retries
|
|
7
8
|
* once. Cookies stay out (`credentials: "omit"` on handled requests —
|
|
8
9
|
* the cross-site iframe cannot rely on them anyway).
|
|
9
10
|
*
|
|
10
11
|
* The caller supplies `exchange(token) => session`: the app's own endpoint
|
|
11
|
-
* that verifies the dashboard token server-side
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* fall back to `verifySessionToken` (both purposes). This module never
|
|
18
|
-
* sees secrets — it only carries opaque tokens.
|
|
12
|
+
* that verifies the dashboard token server-side with the single
|
|
13
|
+
* `verifySessionToken` verifier and mints the app session — the exchange
|
|
14
|
+
* runs once on the first load so the first paint needs no bridge
|
|
15
|
+
* round-trip, and again (same callback) with a fresh token of the same
|
|
16
|
+
* type after every 401 refresh. This module never sees secrets — it only
|
|
17
|
+
* carries opaque tokens.
|
|
19
18
|
*
|
|
20
19
|
* DOM-free by design (like `frame.ts`): location/history access is
|
|
21
20
|
* injectable and defaults to the global window when present.
|
|
22
21
|
*/
|
|
23
22
|
import { type EmbedEventTarget, type EmbedPostTarget } from "./frame.js";
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
26
|
-
* frame src contract (
|
|
27
|
-
*
|
|
28
|
-
* `token`
|
|
24
|
+
* Dashboard token query param on the first load. Matches the dashboard
|
|
25
|
+
* frame src contract (the ONLY token that may ride a URL, namespaced so it
|
|
26
|
+
* cannot collide with an app's own `token` param). The token is the same
|
|
27
|
+
* type the bridge `ready→token` flow returns on refresh — first load and
|
|
28
|
+
* refresh differ only in transport (URL param vs postMessage), exactly
|
|
29
|
+
* Shopify's `id_token`.
|
|
29
30
|
*/
|
|
30
31
|
export declare const LAUNCH_TOKEN_PARAM = "queek_token";
|
|
31
32
|
/** How long to wait for the dashboard's token reply after a `ready`. */
|
|
@@ -33,15 +34,14 @@ export declare const BRIDGE_TOKEN_TIMEOUT_MS = 8000;
|
|
|
33
34
|
export interface AuthFetchOptions {
|
|
34
35
|
/**
|
|
35
36
|
* Exchange a dashboard token for the app's own session (caller's endpoint).
|
|
36
|
-
* The endpoint receives the
|
|
37
|
-
*
|
|
38
|
-
* `
|
|
39
|
-
* `verifySessionToken` (both purposes).
|
|
37
|
+
* The endpoint receives the first-load token and every 401-refresh token
|
|
38
|
+
* through this same callback — one token type, so it verifies both with
|
|
39
|
+
* the single `verifySessionToken` verifier.
|
|
40
40
|
*/
|
|
41
41
|
exchange: (token: string) => Promise<string>;
|
|
42
42
|
/** Exact dashboard origin for the `ready→token` refresh flow. */
|
|
43
43
|
dashboardOrigin: string;
|
|
44
|
-
/**
|
|
44
|
+
/** First-load token query param (default `queek_token`). */
|
|
45
45
|
param?: string;
|
|
46
46
|
/** postMessage target for `ready` (defaults to the global window's parent). */
|
|
47
47
|
postTarget?: EmbedPostTarget;
|
|
@@ -79,11 +79,12 @@ export interface InstalledAuth {
|
|
|
79
79
|
/** Unsubscribe the bridge token listener. */
|
|
80
80
|
dispose: () => void;
|
|
81
81
|
}
|
|
82
|
-
/** Read the
|
|
82
|
+
/** Read the first-load token from a URL without touching it. */
|
|
83
83
|
export declare function readLaunchToken(href: string, param?: string): string | null;
|
|
84
84
|
/**
|
|
85
|
-
* Strip the
|
|
86
|
-
* preserved). Returns the stripped href, or null when no token is
|
|
85
|
+
* Strip the first-load token from a URL (every other param, plus the hash,
|
|
86
|
+
* is preserved). Returns the stripped href, or null when no token is
|
|
87
|
+
* present.
|
|
87
88
|
*/
|
|
88
89
|
export declare function stripLaunchToken(href: string, param?: string): string | null;
|
|
89
90
|
export declare function installAuthFetch(options: AuthFetchOptions): InstalledAuth;
|
package/dist/auth-fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-fetch.d.ts","sourceRoot":"","sources":["../src/auth-fetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"auth-fetch.d.ts","sourceRoot":"","sources":["../src/auth-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAgC,MAAM,YAAY,CAAC;AAEvG;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7C,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;IACvB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,+HAA+H;IAC/H,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChF,kFAAkF;IAClF,UAAU,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAChC,iFAAiF;IACjF,KAAK,EAAE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9B,kEAAkE;IAClE,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAeD,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAA2B,GAAG,MAAM,GAAG,IAAI,CAO/F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAA2B,GAAG,MAAM,GAAG,IAAI,CAWhG;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAqNzE"}
|
package/dist/auth-fetch.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Same-origin session carriage for embedded apps (U-validation "Auth
|
|
3
|
-
* carriage"): `installAuthFetch()` reads the
|
|
4
|
-
* first
|
|
3
|
+
* carriage"): `installAuthFetch()` reads the dashboard token from the
|
|
4
|
+
* first-load URL (`?queek_token=`, stripped immediately), exchanges it
|
|
5
|
+
* ONCE for the app's own session, and attaches
|
|
5
6
|
* `Authorization: Bearer <session>` to every same-origin fetch. A 401
|
|
6
7
|
* re-establishes the session via the bridge `ready→token` flow and retries
|
|
7
8
|
* once. Cookies stay out (`credentials: "omit"` on handled requests —
|
|
8
9
|
* the cross-site iframe cannot rely on them anyway).
|
|
9
10
|
*
|
|
10
11
|
* The caller supplies `exchange(token) => session`: the app's own endpoint
|
|
11
|
-
* that verifies the dashboard token server-side
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* fall back to `verifySessionToken` (both purposes). This module never
|
|
18
|
-
* sees secrets — it only carries opaque tokens.
|
|
12
|
+
* that verifies the dashboard token server-side with the single
|
|
13
|
+
* `verifySessionToken` verifier and mints the app session — the exchange
|
|
14
|
+
* runs once on the first load so the first paint needs no bridge
|
|
15
|
+
* round-trip, and again (same callback) with a fresh token of the same
|
|
16
|
+
* type after every 401 refresh. This module never sees secrets — it only
|
|
17
|
+
* carries opaque tokens.
|
|
19
18
|
*
|
|
20
19
|
* DOM-free by design (like `frame.ts`): location/history access is
|
|
21
20
|
* injectable and defaults to the global window when present.
|
|
22
21
|
*/
|
|
23
22
|
import { listenToDashboard, sendReady } from "./frame.js";
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
26
|
-
* frame src contract (
|
|
27
|
-
*
|
|
28
|
-
* `token`
|
|
24
|
+
* Dashboard token query param on the first load. Matches the dashboard
|
|
25
|
+
* frame src contract (the ONLY token that may ride a URL, namespaced so it
|
|
26
|
+
* cannot collide with an app's own `token` param). The token is the same
|
|
27
|
+
* type the bridge `ready→token` flow returns on refresh — first load and
|
|
28
|
+
* refresh differ only in transport (URL param vs postMessage), exactly
|
|
29
|
+
* Shopify's `id_token`.
|
|
29
30
|
*/
|
|
30
31
|
export const LAUNCH_TOKEN_PARAM = "queek_token";
|
|
31
32
|
/** How long to wait for the dashboard's token reply after a `ready`. */
|
|
@@ -34,7 +35,7 @@ function globalWindow() {
|
|
|
34
35
|
const scope = globalThis;
|
|
35
36
|
return scope.window?.location !== undefined ? (scope.window ?? null) : null;
|
|
36
37
|
}
|
|
37
|
-
/** Read the
|
|
38
|
+
/** Read the first-load token from a URL without touching it. */
|
|
38
39
|
export function readLaunchToken(href, param = LAUNCH_TOKEN_PARAM) {
|
|
39
40
|
try {
|
|
40
41
|
const token = new URL(href, "https://app.invalid").searchParams.get(param);
|
|
@@ -45,8 +46,9 @@ export function readLaunchToken(href, param = LAUNCH_TOKEN_PARAM) {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
48
|
-
* Strip the
|
|
49
|
-
* preserved). Returns the stripped href, or null when no token is
|
|
49
|
+
* Strip the first-load token from a URL (every other param, plus the hash,
|
|
50
|
+
* is preserved). Returns the stripped href, or null when no token is
|
|
51
|
+
* present.
|
|
50
52
|
*/
|
|
51
53
|
export function stripLaunchToken(href, param = LAUNCH_TOKEN_PARAM) {
|
|
52
54
|
try {
|
|
@@ -73,11 +75,11 @@ export function installAuthFetch(options) {
|
|
|
73
75
|
const fetchFn = fetchImpl;
|
|
74
76
|
const listenTarget = options.listenTarget ?? win ?? undefined;
|
|
75
77
|
const postTarget = options.postTarget ?? win?.parent;
|
|
76
|
-
// Signed first load: read the
|
|
78
|
+
// Signed first load: read the token, strip it from the URL bar
|
|
77
79
|
// immediately (it must not linger in history), exchange it once.
|
|
78
80
|
const href = getHref();
|
|
79
|
-
const
|
|
80
|
-
const stripped =
|
|
81
|
+
const firstLoadToken = readLaunchToken(href, param);
|
|
82
|
+
const stripped = firstLoadToken === null ? null : stripLaunchToken(href, param);
|
|
81
83
|
if (stripped !== null) {
|
|
82
84
|
try {
|
|
83
85
|
replaceUrl(stripped);
|
|
@@ -104,7 +106,7 @@ export function installAuthFetch(options) {
|
|
|
104
106
|
}
|
|
105
107
|
return exchangePromise;
|
|
106
108
|
};
|
|
107
|
-
const ready =
|
|
109
|
+
const ready = firstLoadToken === null ? Promise.resolve(null) : runExchange(firstLoadToken).catch(() => null);
|
|
108
110
|
// A recovery only makes sense inside a dashboard frame: unframed, nothing
|
|
109
111
|
// can ever answer the ready. After one failed recovery, later requests skip
|
|
110
112
|
// it (no 8s stall per fetch) until a later token proves the dashboard is
|
package/dist/auth-fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-fetch.js","sourceRoot":"","sources":["../src/auth-fetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"auth-fetch.js","sourceRoot":"","sources":["../src/auth-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAA+C,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAEhD,wEAAwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AA4D5C,SAAS,YAAY;IACnB,MAAM,KAAK,GAAG,UAAgD,CAAC;IAC/D,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9E,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,QAAgB,kBAAkB;IAC9E,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3E,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAA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AK,IAAI,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC;YACH,OAAO,MAAM,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,cAAc,GAAG,IAAI,CAAC;YACtB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,GAAG,EAAE,CAAC,OAAO;QACzB,KAAK;QACL,OAAO;QACP,OAAO,EAAE,GAAG,EAAE;YACZ,YAAY,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;YAC5C,YAAY,GAAG,IAAI,CAAC;YACpB,aAAa,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plain-browser entry for `@usequeek/app-sdk` (Booking fix): the embedded-app
|
|
3
|
+
* bridge plus `installAuthFetch`, with ZERO Node-only modules.
|
|
4
|
+
*
|
|
5
|
+
* Import from `@usequeek/app-sdk/browser` in any browser bundle (Vite,
|
|
6
|
+
* Rollup, esbuild, …). Importing the same helpers from the MAIN entry pulls
|
|
7
|
+
* the whole barrel (`app-auth` → `node:crypto`, `store` → `pg`, …) and breaks
|
|
8
|
+
* browser builds — the main entry stays the server/universal entry on
|
|
9
|
+
* purpose (see README "Which entry do I import?").
|
|
10
|
+
*
|
|
11
|
+
* This module re-exports ONLY modules with no Node dependencies:
|
|
12
|
+
* `auth-fetch.js`, `frame.js`, `theme.js` (each imports at most each other).
|
|
13
|
+
* The scope consent-link builder (`buildScopeRequestLink`) is deliberately
|
|
14
|
+
* NOT here: it lives in `scopes.ts`, which imports `app-auth`/`client`/
|
|
15
|
+
* `store` (`node:crypto`, `pg`, `node:sqlite`) — open consent links from the
|
|
16
|
+
* browser with `sendOpen` instead (see README "Scopes").
|
|
17
|
+
*
|
|
18
|
+
* `tests/browser.test.ts` statically walks this file's transitive imports
|
|
19
|
+
* and fails if any of them ever gains a `node:*` / `pg` / `hono` / `jose` /
|
|
20
|
+
* `react` dependency, so this entry can never silently regress.
|
|
21
|
+
*/
|
|
22
|
+
export { type AuthFetchOptions, BRIDGE_TOKEN_TIMEOUT_MS, type InstalledAuth, installAuthFetch, LAUNCH_TOKEN_PARAM, readLaunchToken, stripLaunchToken, } from "./auth-fetch.js";
|
|
23
|
+
export { APP_SOURCE, type AppInboundMessage, type AppOutboundMessage, BRIDGE_VERSION, type BridgeTheme, DASHBOARD_SOURCE, type EmbedEvent, type EmbedEventTarget, type EmbedPostTarget, type FrameBridgeOptions, listenToDashboard, type PickResourceRequest, type ReadyOptions, type ResourceItem, type SaveBarAction, type SaveBarState, sendNavigated, sendOpen, sendPickResource, sendReady, sendResize, sendSaveBar, sendTitle, type ThemeMode, type TitleActionDef, } from "./frame.js";
|
|
24
|
+
export { applyTheme, getThemeModeFromUrl, installThemeListener, rememberThemeMode, syncThemeUrl, THEME_PARAM, THEME_STORAGE_KEY, type ThemeDocument, type ThemeDocumentElement, type ThemeListenerOptions, type ThemeStorage, type ThemeUrlOptions, themeBootstrapScript, } from "./theme.js";
|
|
25
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,KAAK,aAAa,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,cAAc,EACd,KAAK,WAAW,EAChB,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plain-browser entry for `@usequeek/app-sdk` (Booking fix): the embedded-app
|
|
3
|
+
* bridge plus `installAuthFetch`, with ZERO Node-only modules.
|
|
4
|
+
*
|
|
5
|
+
* Import from `@usequeek/app-sdk/browser` in any browser bundle (Vite,
|
|
6
|
+
* Rollup, esbuild, …). Importing the same helpers from the MAIN entry pulls
|
|
7
|
+
* the whole barrel (`app-auth` → `node:crypto`, `store` → `pg`, …) and breaks
|
|
8
|
+
* browser builds — the main entry stays the server/universal entry on
|
|
9
|
+
* purpose (see README "Which entry do I import?").
|
|
10
|
+
*
|
|
11
|
+
* This module re-exports ONLY modules with no Node dependencies:
|
|
12
|
+
* `auth-fetch.js`, `frame.js`, `theme.js` (each imports at most each other).
|
|
13
|
+
* The scope consent-link builder (`buildScopeRequestLink`) is deliberately
|
|
14
|
+
* NOT here: it lives in `scopes.ts`, which imports `app-auth`/`client`/
|
|
15
|
+
* `store` (`node:crypto`, `pg`, `node:sqlite`) — open consent links from the
|
|
16
|
+
* browser with `sendOpen` instead (see README "Scopes").
|
|
17
|
+
*
|
|
18
|
+
* `tests/browser.test.ts` statically walks this file's transitive imports
|
|
19
|
+
* and fails if any of them ever gains a `node:*` / `pg` / `hono` / `jose` /
|
|
20
|
+
* `react` dependency, so this entry can never silently regress.
|
|
21
|
+
*/
|
|
22
|
+
export { BRIDGE_TOKEN_TIMEOUT_MS, installAuthFetch, LAUNCH_TOKEN_PARAM, readLaunchToken, stripLaunchToken, } from "./auth-fetch.js";
|
|
23
|
+
export { APP_SOURCE, BRIDGE_VERSION, DASHBOARD_SOURCE, listenToDashboard, sendNavigated, sendOpen, sendPickResource, sendReady, sendResize, sendSaveBar, sendTitle, } from "./frame.js";
|
|
24
|
+
// NOTE: ThemeMode comes from ./frame.js only — theme.js merely re-exports
|
|
25
|
+
// it, so listing it here too would be ambiguous.
|
|
26
|
+
export { applyTheme, getThemeModeFromUrl, installThemeListener, rememberThemeMode, syncThemeUrl, THEME_PARAM, THEME_STORAGE_KEY, themeBootstrapScript, } from "./theme.js";
|
|
27
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAEL,uBAAuB,EAEvB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,EAGV,cAAc,EAEd,gBAAgB,EAKhB,iBAAiB,EAMjB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GAGV,MAAM,YAAY,CAAC;AACpB,0EAA0E;AAC1E,iDAAiD;AACjD,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,iBAAiB,EAMjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Server-only entry
|
|
2
|
+
* Server-only entry: session-token verification needs the
|
|
3
3
|
* per-installation `embsec_…` secret, which must never enter a browser
|
|
4
4
|
* bundle. Import the verifier from `@usequeek/app-sdk/server`, never from
|
|
5
5
|
* the main entry.
|
|
6
6
|
*/
|
|
7
|
-
export type {
|
|
8
|
-
export { EMBED_SECRET_PREFIX,
|
|
7
|
+
export type { SessionTokenBinding, SessionTokenClaims, SessionTokenFailure, VerifySessionTokenOptions, } from "./session.js";
|
|
8
|
+
export { EMBED_SECRET_PREFIX, SESSION_CLOCK_TOLERANCE_SECONDS, sessionTokenInstallationId, verifySessionToken, verifySessionTokenDetailed, } from "./session.js";
|
|
9
9
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,cAAc,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Server-only entry
|
|
2
|
+
* Server-only entry: session-token verification needs the
|
|
3
3
|
* per-installation `embsec_…` secret, which must never enter a browser
|
|
4
4
|
* bundle. Import the verifier from `@usequeek/app-sdk/server`, never from
|
|
5
5
|
* the main entry.
|
|
6
6
|
*/
|
|
7
|
-
export { EMBED_SECRET_PREFIX,
|
|
7
|
+
export { EMBED_SECRET_PREFIX, SESSION_CLOCK_TOLERANCE_SECONDS, sessionTokenInstallationId, verifySessionToken, verifySessionTokenDetailed, } from "./session.js";
|
|
8
8
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,0BAA0B,EAC1B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,cAAc,CAAC"}
|
package/dist/session.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dashboard session tokens
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Dashboard session tokens: short-lived HS256 JWTs the backend mints per
|
|
3
|
+
* installation for the framed merchant page. The app backend verifies them
|
|
4
|
+
* with the per-installation `embsec_…` secret before trusting any call
|
|
5
|
+
* that carries one.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* first-load
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* launch token that rode a URL can never be replayed as a bridge token
|
|
15
|
-
* and vice versa.
|
|
7
|
+
* ONE token type, exactly Shopify's `id_token` shape: the dashboard puts
|
|
8
|
+
* the same token in the first-load URL param (`queek_token`, stripped on
|
|
9
|
+
* arrival) and answers bridge `ready` requests with it, so the app's
|
|
10
|
+
* exchange endpoint verifies first-load and refresh tokens with this one
|
|
11
|
+
* verifier. No purpose split: extra claims the mint may carry are ignored,
|
|
12
|
+
* never gated — identity binding (installation, audience, issuer, expiry)
|
|
13
|
+
* is the whole check.
|
|
16
14
|
*
|
|
17
15
|
* Server-only: the secret must never enter a browser bundle, so this module
|
|
18
16
|
* ships behind the `./server` export, not the main entry. Style mirrors
|
|
@@ -24,7 +22,7 @@ export declare const EMBED_SECRET_PREFIX = "embsec_";
|
|
|
24
22
|
export declare const SESSION_TOKEN_ALG = "HS256";
|
|
25
23
|
/** Backend skew the verifier tolerates (matches the mint side). */
|
|
26
24
|
export declare const SESSION_CLOCK_TOLERANCE_SECONDS = 20;
|
|
27
|
-
export type SessionTokenFailure = "missing_token" | "missing_secret" | "wrong_algorithm" | "invalid_signature" | "expired" | "not_yet_valid" | "wrong_audience" | "wrong_issuer" | "
|
|
25
|
+
export type SessionTokenFailure = "missing_token" | "missing_secret" | "wrong_algorithm" | "invalid_signature" | "expired" | "not_yet_valid" | "wrong_audience" | "wrong_issuer" | "binding_mismatch";
|
|
28
26
|
export interface SessionTokenClaims {
|
|
29
27
|
installationId: string;
|
|
30
28
|
vendorId: string;
|
|
@@ -41,17 +39,6 @@ export interface SessionTokenBinding {
|
|
|
41
39
|
appSlug: string;
|
|
42
40
|
appId: string;
|
|
43
41
|
}
|
|
44
|
-
/**
|
|
45
|
-
* Launch-token claims: the bridge binding plus the launch-only hints the
|
|
46
|
-
* backend mints for the signed first load — the store p_id (the URL-safe
|
|
47
|
-
* store id) and the dashboard theme for a flash-free first paint. Both are
|
|
48
|
-
* hints, not auth: `storePid` is null when the mint carried none, `theme`
|
|
49
|
-
* is null unless the mint carried exactly `light` or `dark`.
|
|
50
|
-
*/
|
|
51
|
-
export interface LaunchTokenClaims extends SessionTokenClaims {
|
|
52
|
-
storePid: number | null;
|
|
53
|
-
theme: "light" | "dark" | null;
|
|
54
|
-
}
|
|
55
42
|
export interface VerifySessionTokenOptions {
|
|
56
43
|
/** The per-installation `embsec_…` secret, raw UTF-8 bytes (never decoded). */
|
|
57
44
|
secret: string;
|
|
@@ -80,24 +67,6 @@ export declare function verifySessionTokenDetailed(token: string, options: Verif
|
|
|
80
67
|
ok: false;
|
|
81
68
|
reason: SessionTokenFailure;
|
|
82
69
|
}>;
|
|
83
|
-
/**
|
|
84
|
-
* Server-side launch exchange input (signed first load): verify a
|
|
85
|
-
* purpose=launch token with the SAME checks as the bridge verifier
|
|
86
|
-
* (signature, audience, issuer, installation binding, expiry) plus the
|
|
87
|
-
* purpose pin — anything but exactly `"launch"` is refused with
|
|
88
|
-
* `wrong_purpose`, so a bridge token can never open the exchange. On
|
|
89
|
-
* success the app mints its own session from the claims (subject, store,
|
|
90
|
-
* theme) and the first paint needs no bridge round-trip. Callers map every
|
|
91
|
-
* `{ ok: false }` to 401, mirroring the backend `verify()`.
|
|
92
|
-
*/
|
|
93
|
-
export declare function verifyLaunchToken(token: string, options: VerifySessionTokenOptions): Promise<boolean>;
|
|
94
|
-
export declare function verifyLaunchTokenDetailed(token: string, options: VerifySessionTokenOptions): Promise<{
|
|
95
|
-
ok: true;
|
|
96
|
-
claims: LaunchTokenClaims;
|
|
97
|
-
} | {
|
|
98
|
-
ok: false;
|
|
99
|
-
reason: SessionTokenFailure;
|
|
100
|
-
}>;
|
|
101
70
|
/**
|
|
102
71
|
* ROUTING HINT ONLY — the `installation_id` claim read WITHOUT verifying
|
|
103
72
|
* anything, so a server can load the installation whose embed secret then
|
|
@@ -106,11 +75,4 @@ export declare function verifyLaunchTokenDetailed(token: string, options: Verify
|
|
|
106
75
|
* Null for anything that is not a decodable JWT carrying the claim.
|
|
107
76
|
*/
|
|
108
77
|
export declare function sessionTokenInstallationId(token: string): string | null;
|
|
109
|
-
/**
|
|
110
|
-
* True for the purposes the bridge verifier accepts: absent (legacy
|
|
111
|
-
* tokens) or "session". "launch" is the signed first-load token for the
|
|
112
|
-
* launch exchange (`verifyLaunchToken`) only, so the bridge verifier
|
|
113
|
-
* refuses it. Any other present value fails closed.
|
|
114
|
-
*/
|
|
115
|
-
export declare function isBridgePurpose(purpose: unknown): boolean;
|
|
116
78
|
//# sourceMappingURL=session.d.ts.map
|
package/dist/session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC,mEAAmE;AACnE,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,mBAAmB,GACnB,SAAS,GACT,eAAe,GACf,gBAAgB,GAChB,cAAc,GACd,kBAAkB,CAAC;AAEvB,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,CAAC,CAUhG;AAkDD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOvE"}
|
package/dist/session.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { decodeJwt, decodeProtectedHeader, jwtVerify } from "jose";
|
|
2
2
|
/**
|
|
3
|
-
* Dashboard session tokens
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Dashboard session tokens: short-lived HS256 JWTs the backend mints per
|
|
4
|
+
* installation for the framed merchant page. The app backend verifies them
|
|
5
|
+
* with the per-installation `embsec_…` secret before trusting any call
|
|
6
|
+
* that carries one.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* first-load
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* launch token that rode a URL can never be replayed as a bridge token
|
|
16
|
-
* and vice versa.
|
|
8
|
+
* ONE token type, exactly Shopify's `id_token` shape: the dashboard puts
|
|
9
|
+
* the same token in the first-load URL param (`queek_token`, stripped on
|
|
10
|
+
* arrival) and answers bridge `ready` requests with it, so the app's
|
|
11
|
+
* exchange endpoint verifies first-load and refresh tokens with this one
|
|
12
|
+
* verifier. No purpose split: extra claims the mint may carry are ignored,
|
|
13
|
+
* never gated — identity binding (installation, audience, issuer, expiry)
|
|
14
|
+
* is the whole check.
|
|
17
15
|
*
|
|
18
16
|
* Server-only: the secret must never enter a browser bundle, so this module
|
|
19
17
|
* ships behind the `./server` export, not the main entry. Style mirrors
|
|
@@ -33,16 +31,7 @@ export async function verifySessionTokenDetailed(token, options) {
|
|
|
33
31
|
const envelope = await verifyTokenEnvelope(token, options);
|
|
34
32
|
if (!envelope.ok)
|
|
35
33
|
return envelope;
|
|
36
|
-
const
|
|
37
|
-
// Purpose binding (backend contract): absent or "session" is a bridge
|
|
38
|
-
// token; "launch" belongs to the signed first-load exchange only and is
|
|
39
|
-
// refused here with the same failure path callers map to 401. Any other
|
|
40
|
-
// present purpose fails closed as well — the bridge verifier accepts
|
|
41
|
-
// exactly the bridge purposes, never a foreign one.
|
|
42
|
-
if (!isBridgePurpose(payload.purpose)) {
|
|
43
|
-
return { ok: false, reason: "wrong_purpose" };
|
|
44
|
-
}
|
|
45
|
-
const claims = readSessionClaims(payload);
|
|
34
|
+
const claims = readSessionClaims(envelope.payload);
|
|
46
35
|
const { expected } = options;
|
|
47
36
|
if (!claims || !bindingMatches(claims, expected)) {
|
|
48
37
|
return { ok: false, reason: "binding_mismatch" };
|
|
@@ -50,39 +39,9 @@ export async function verifySessionTokenDetailed(token, options) {
|
|
|
50
39
|
return { ok: true, claims };
|
|
51
40
|
}
|
|
52
41
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* purpose pin — anything but exactly `"launch"` is refused with
|
|
57
|
-
* `wrong_purpose`, so a bridge token can never open the exchange. On
|
|
58
|
-
* success the app mints its own session from the claims (subject, store,
|
|
59
|
-
* theme) and the first paint needs no bridge round-trip. Callers map every
|
|
60
|
-
* `{ ok: false }` to 401, mirroring the backend `verify()`.
|
|
61
|
-
*/
|
|
62
|
-
export async function verifyLaunchToken(token, options) {
|
|
63
|
-
const result = await verifyLaunchTokenDetailed(token, options);
|
|
64
|
-
return result.ok;
|
|
65
|
-
}
|
|
66
|
-
export async function verifyLaunchTokenDetailed(token, options) {
|
|
67
|
-
const envelope = await verifyTokenEnvelope(token, options);
|
|
68
|
-
if (!envelope.ok)
|
|
69
|
-
return envelope;
|
|
70
|
-
const { payload } = envelope;
|
|
71
|
-
if (payload.purpose !== "launch") {
|
|
72
|
-
return { ok: false, reason: "wrong_purpose" };
|
|
73
|
-
}
|
|
74
|
-
const claims = readSessionClaims(payload);
|
|
75
|
-
const { expected } = options;
|
|
76
|
-
if (!claims || !bindingMatches(claims, expected)) {
|
|
77
|
-
return { ok: false, reason: "binding_mismatch" };
|
|
78
|
-
}
|
|
79
|
-
return { ok: true, claims: { ...claims, ...readLaunchHints(payload) } };
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Shared envelope verification for both purposes: presence, secret shape,
|
|
83
|
-
* algorithm pin, then signature + audience + issuer + expiry via jose.
|
|
84
|
-
* Purpose and binding checks stay with the caller — the only thing that
|
|
85
|
-
* differs between the bridge and launch verifiers.
|
|
42
|
+
* Envelope verification: presence, secret shape, algorithm pin, then
|
|
43
|
+
* signature + audience + issuer + expiry via jose. Binding checks stay
|
|
44
|
+
* with the caller.
|
|
86
45
|
*/
|
|
87
46
|
async function verifyTokenEnvelope(token, options) {
|
|
88
47
|
if (!token) {
|
|
@@ -120,24 +79,6 @@ function bindingMatches(claims, expected) {
|
|
|
120
79
|
claims.appSlug === expected.appSlug &&
|
|
121
80
|
claims.appId === expected.appId);
|
|
122
81
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Launch-only hints off a verified payload. Tolerant by design (they steer
|
|
125
|
-
* first paint, never auth): `store` is the integer p_id or null, `theme`
|
|
126
|
-
* survives only as exactly `light` or `dark`.
|
|
127
|
-
*
|
|
128
|
-
* Boundary (deliberate, pinned both sides): this `store` claim is an INT,
|
|
129
|
-
* while install-handoff p_ids are STRINGS per the handoff contract — never
|
|
130
|
-
* accept a string here to "match" the handoff; a string claim nulls the
|
|
131
|
-
* hint (session.test.ts) exactly as the backend pins int (AppUiKitTest).
|
|
132
|
-
*/
|
|
133
|
-
function readLaunchHints(payload) {
|
|
134
|
-
const store = payload.store;
|
|
135
|
-
const theme = payload.theme;
|
|
136
|
-
return {
|
|
137
|
-
storePid: typeof store === "number" && Number.isInteger(store) && store >= 0 ? store : null,
|
|
138
|
-
theme: theme === "light" || theme === "dark" ? theme : null,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
82
|
/**
|
|
142
83
|
* ROUTING HINT ONLY — the `installation_id` claim read WITHOUT verifying
|
|
143
84
|
* anything, so a server can load the installation whose embed secret then
|
|
@@ -168,15 +109,6 @@ function readTokenAlg(token) {
|
|
|
168
109
|
return null;
|
|
169
110
|
}
|
|
170
111
|
}
|
|
171
|
-
/**
|
|
172
|
-
* True for the purposes the bridge verifier accepts: absent (legacy
|
|
173
|
-
* tokens) or "session". "launch" is the signed first-load token for the
|
|
174
|
-
* launch exchange (`verifyLaunchToken`) only, so the bridge verifier
|
|
175
|
-
* refuses it. Any other present value fails closed.
|
|
176
|
-
*/
|
|
177
|
-
export function isBridgePurpose(purpose) {
|
|
178
|
-
return purpose === undefined || purpose === null || purpose === "session";
|
|
179
|
-
}
|
|
180
112
|
function readSessionClaims(payload) {
|
|
181
113
|
const pick = (key) => typeof payload[key] === "string" && payload[key].length > 0 ? payload[key] : null;
|
|
182
114
|
const installationId = pick("installation_id");
|
package/dist/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEnE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C,k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AE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,IAAI,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,KAAK,0BAA0B,EAAE,CAAC;QACxC,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,MAAM,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACjC,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dashboard-following theme (U7): dark when the dashboard is dark, light
|
|
3
|
-
* when light, switching live. First load carries `theme=light|dark`
|
|
4
|
-
*
|
|
5
|
-
* `<html class="dark">` with no flash; live changes arrive
|
|
6
|
-
* `theme{mode}` messages and toggle the `dark` class — shadcn's
|
|
7
|
-
* dark-mode mechanism.
|
|
3
|
+
* when light, switching live. First load carries `theme=light|dark` as a
|
|
4
|
+
* plain UNSIGNED URL query param (dashboard `resolvedTheme`) so the app
|
|
5
|
+
* server-renders `<html class="dark">` with no flash; live changes arrive
|
|
6
|
+
* as bridge `theme{mode}` messages and toggle the `dark` class — shadcn's
|
|
7
|
+
* own dark-mode mechanism.
|
|
8
|
+
*
|
|
9
|
+
* The param is a first-paint hint only, never auth: it is validated
|
|
10
|
+
* (exactly `light` or `dark` — anything else is ignored) and the live
|
|
11
|
+
* bridge message overwrites it.
|
|
8
12
|
*
|
|
9
13
|
* DOM-free by design (structural minimal types, like `frame.ts`): pass a
|
|
10
14
|
* document in, or let the helpers use the global one when present.
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EAGpB,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,qEAAqE;AACrE,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAeD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE;QAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC;IAC3D,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,oBAAoB,CAAC;CACvC;AAOD,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAUtF;AAeD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,MAAoB,EAC3B,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,GAC5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
|
* Dashboard-following theme (U7): dark when the dashboard is dark, light
|
|
3
|
-
* when light, switching live. First load carries `theme=light|dark`
|
|
4
|
-
*
|
|
5
|
-
* `<html class="dark">` with no flash; live changes arrive
|
|
6
|
-
* `theme{mode}` messages and toggle the `dark` class — shadcn's
|
|
7
|
-
* dark-mode mechanism.
|
|
3
|
+
* when light, switching live. First load carries `theme=light|dark` as a
|
|
4
|
+
* plain UNSIGNED URL query param (dashboard `resolvedTheme`) so the app
|
|
5
|
+
* server-renders `<html class="dark">` with no flash; live changes arrive
|
|
6
|
+
* as bridge `theme{mode}` messages and toggle the `dark` class — shadcn's
|
|
7
|
+
* own dark-mode mechanism.
|
|
8
|
+
*
|
|
9
|
+
* The param is a first-paint hint only, never auth: it is validated
|
|
10
|
+
* (exactly `light` or `dark` — anything else is ignored) and the live
|
|
11
|
+
* bridge message overwrites it.
|
|
8
12
|
*
|
|
9
13
|
* DOM-free by design (structural minimal types, like `frame.ts`): pass a
|
|
10
14
|
* document in, or let the helpers use the global one when present.
|
package/dist/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,iBAAiB,EACjB,SAAS,GAEV,MAAM,YAAY,CAAC;AAIpB,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAO/C,SAAS,oBAAoB;IAC3B,IAAI,CAAC;QACH,MAAM,OAAO,GAAI,UAA2D,CAAC,cAAc,CAAC;QAC5F,OAAO,OAAO,IAAI,IAAI,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CA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AK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;IAChG,SAAS,CAAC,eAAe,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC,CAAC;IACrE,OAAO,iBAAiB,CAAC;QACvB,eAAe;QACf,MAAM;QACN,YAAY,EAAE,YAAY,IAAI,SAAS;QACvC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAC5B,iBAAiB,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACvC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YACvF,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usequeek/app-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "SDK for Queek installable apps: webhook signature verification, install handlers, typed Merchant API client, webhook dispatch, encrypted installation store.",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"./react": {
|
|
31
31
|
"types": "./dist/react.d.ts",
|
|
32
32
|
"default": "./dist/react.js"
|
|
33
|
+
},
|
|
34
|
+
"./browser": {
|
|
35
|
+
"types": "./dist/browser.d.ts",
|
|
36
|
+
"default": "./dist/browser.js"
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"files": [
|