@tokenoftrust/storefront-runner 2.4.65 → 2.4.67
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.
|
@@ -477,12 +477,11 @@ export default function VariantSelector({
|
|
|
477
477
|
</div>
|
|
478
478
|
</div>
|
|
479
479
|
|
|
480
|
-
{/* Add to cart. With a wired checkout store
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
placeholder. */}
|
|
480
|
+
{/* Add to cart. With a wired checkout store the form action is the
|
|
481
|
+
checkout-handoff commerce route (`/api/commerce/checkout-handoff`).
|
|
482
|
+
Product fields are server-pre-signed; the quantity is the selected
|
|
483
|
+
stepper value. Without a store (marketing tenant, or signed mode with
|
|
484
|
+
no cart secret) the control is a disabled placeholder. */}
|
|
486
485
|
{checkoutCart ? (
|
|
487
486
|
<div class="flex flex-col gap-1.5">
|
|
488
487
|
<form
|
|
@@ -66,9 +66,7 @@ export class CommerceAlarmDispatcher {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export async function getReliableDispatcher(): Promise<CommerceAlarmDispatcher | Response> {
|
|
69
|
-
const scheduler = await readEnv("SCRAPPY_COMMERCE_SCHEDULER");
|
|
70
|
-
if (scheduler !== COMMERCE_SCHEDULER) return json({ error: "commerce scheduler not configured" }, 503);
|
|
71
69
|
const d1 = await readD1("STOREFRONT_APPS_DB");
|
|
72
70
|
if (!d1) return json({ error: "commerce scheduler not configured" }, 503);
|
|
73
|
-
return new CommerceAlarmDispatcher(fromD1(d1),
|
|
71
|
+
return new CommerceAlarmDispatcher(fromD1(d1), COMMERCE_SCHEDULER);
|
|
74
72
|
}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
import type { APIContext } from "astro";
|
|
12
12
|
import { requireAdminApiEntry } from "@/lib/auth/adminApiGuard";
|
|
13
13
|
import { workerCommit } from "@/lib/activity/workerCommit";
|
|
14
|
-
import { readEnv } from "@/lib/env";
|
|
15
14
|
import {
|
|
16
15
|
COMMERCE_SCHEDULER,
|
|
17
16
|
actorMayCommand,
|
|
@@ -107,8 +106,7 @@ export function admitAdminReplay(input: {
|
|
|
107
106
|
export async function GET(context: APIContext): Promise<Response> {
|
|
108
107
|
const access = await requireAdminApiEntry(context, { requireOwner: true });
|
|
109
108
|
if (!access.ok) return json({ ok: false, reason: access.reason }, access.status);
|
|
110
|
-
|
|
111
|
-
return json({ ok: true, report: projectAdminReadiness({ scheduler, deployedSha: workerCommit() }) });
|
|
109
|
+
return json({ ok: true, report: projectAdminReadiness({ scheduler: COMMERCE_SCHEDULER, deployedSha: workerCommit() }) });
|
|
112
110
|
}
|
|
113
111
|
|
|
114
112
|
export async function POST(context: APIContext): Promise<Response> {
|
|
@@ -133,13 +131,12 @@ export async function POST(context: APIContext): Promise<Response> {
|
|
|
133
131
|
if (!OPAQUE.test(record.orderId) || !OPAQUE.test(record.sourceEventId)) return json({ ok: false, reason: "refused" }, 400);
|
|
134
132
|
const decision = admitAdminReplay({ tenantId: context.locals.tenant.tenant_id, stage, kind });
|
|
135
133
|
if (!decision.admitted) return json({ ok: false, reason: decision.reason }, 403);
|
|
136
|
-
const scheduler = await readEnv("SCRAPPY_COMMERCE_SCHEDULER");
|
|
137
134
|
return json({
|
|
138
135
|
ok: true,
|
|
139
136
|
admitted: true,
|
|
140
137
|
durableWrite: false,
|
|
141
138
|
command: "reconcile",
|
|
142
139
|
reason: decision.reason,
|
|
143
|
-
report: projectAdminReadiness({ scheduler, deployedSha: workerCommit() }),
|
|
140
|
+
report: projectAdminReadiness({ scheduler: COMMERCE_SCHEDULER, deployedSha: workerCommit() }),
|
|
144
141
|
});
|
|
145
142
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.67",
|
|
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",
|
|
@@ -110,13 +110,13 @@ export interface BuildVariantCartPayloadOptions {
|
|
|
110
110
|
secret?: string;
|
|
111
111
|
purchaseOption?: ProductPurchaseOption;
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
114
|
-
* membership.ts `priceForPurchaseOption` for
|
|
115
|
-
*
|
|
116
|
-
* of
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
113
|
+
* Member-adjusted effective price to sign. `buildMemberSignedCartPayload`
|
|
114
|
+
* in membership.ts runs `priceForPurchaseOption` for this request's resolved
|
|
115
|
+
* eligibility and passes that price here. `buildVariantCartPayload` signs it
|
|
116
|
+
* in place of the list or subscription price, so the signature matches only
|
|
117
|
+
* that member context. Absent, the list or subscription price is signed for
|
|
118
|
+
* an anonymous shopper. The client never supplies this value; only the
|
|
119
|
+
* server, holding the cart secret, signs it.
|
|
120
120
|
*/
|
|
121
121
|
signedPrice?: number;
|
|
122
122
|
/**
|