@tokenoftrust/storefront-runner 7.8.0 → 7.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -287,8 +287,12 @@ export interface GatedHandoff {
|
|
|
287
287
|
prepareProof: () => Promise<{ proof: string; buyerConfirmation: string; bind: (selector: string) => Promise<boolean> } | null>;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
/** The provider endpoint a gated cart is handed to with its bound shopper checkout proof. */
|
|
291
|
+
export const shopperCheckoutHandoffAction = (providerOrigin: string): URL =>
|
|
292
|
+
new URL("/api/commerce/shopper-checkout-handoff", providerOrigin);
|
|
293
|
+
|
|
290
294
|
function buyerHandoff(providerOrigin: string, selector: string, proof: string, confirmation: string): Response {
|
|
291
|
-
const action =
|
|
295
|
+
const action = shopperCheckoutHandoffAction(providerOrigin);
|
|
292
296
|
const fields = { fcsid: selector, shopper_checkout: proof, buyer_confirmation: confirmation };
|
|
293
297
|
const inputs = Object.entries(fields).map(([name, value]) =>
|
|
294
298
|
`<input type="hidden" name="${name}" value="${escapeHtml(value)}">`).join("");
|
|
@@ -6,11 +6,16 @@ import { safeNext } from "@/lib/access/auth/safeNext";
|
|
|
6
6
|
export const SHOPPER_ADMISSION_CLASSES = [
|
|
7
7
|
"shopper-public", "shopper-origin", "shopper-session", "shopper-approved",
|
|
8
8
|
"shopper-owner-read", "shopper-owner-mutation",
|
|
9
|
+
"shopper-portal-read", "shopper-portal-approved-read", "shopper-portal-mutation", "shopper-portal-approved-mutation",
|
|
9
10
|
] as const;
|
|
10
11
|
export type ShopperAdmissionClass = (typeof SHOPPER_ADMISSION_CLASSES)[number];
|
|
12
|
+
/** Account portal routes: the signed-in shopper's own records; mutations are same-origin POST or DELETE. */
|
|
13
|
+
export type ShopperPortalAdmission = Extract<ShopperAdmissionClass, `shopper-portal-${string}`>;
|
|
14
|
+
type PortalMutation = Extract<ShopperPortalAdmission, `${string}-mutation`>;
|
|
11
15
|
export type ShopperRouteAdmission = {
|
|
12
|
-
GET?: Exclude<ShopperAdmissionClass, "shopper-origin" | "shopper-owner-mutation">;
|
|
13
|
-
POST?: Extract<ShopperAdmissionClass, "shopper-origin" | "shopper-owner-mutation">;
|
|
16
|
+
GET?: Exclude<ShopperAdmissionClass, "shopper-origin" | "shopper-owner-mutation" | PortalMutation>;
|
|
17
|
+
POST?: Extract<ShopperAdmissionClass, "shopper-origin" | "shopper-owner-mutation" | PortalMutation>;
|
|
18
|
+
DELETE?: PortalMutation;
|
|
14
19
|
};
|
|
15
20
|
|
|
16
21
|
export interface ShopperScope {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|