@tokenoftrust/storefront-runner 7.11.7 → 7.11.9
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.
|
@@ -367,7 +367,7 @@ async function cartFormPost(context: APIContext, shopper?: GatedHandoff): Promis
|
|
|
367
367
|
const quantity = form.get("quantity");
|
|
368
368
|
if (purchase.length !== 3 || submitted.length !== 3 + Number(ref !== null) ||
|
|
369
369
|
typeof handle !== "string" || typeof variantId !== "string" ||
|
|
370
|
-
typeof quantity !== "string" || !/^[1-9]\d{0,
|
|
370
|
+
typeof quantity !== "string" || !/^[1-9]\d{0,4}$/.test(quantity) || Number(quantity) > MAX_CART_QUANTITY ||
|
|
371
371
|
handle.length < 1 || handle.length > 160 || variantId.length < 1 || variantId.length > 256) {
|
|
372
372
|
return cartDenial("signature", "Invalid cart.", 422, returnUrl);
|
|
373
373
|
}
|
|
@@ -517,8 +517,11 @@ export class AppRegistryService {
|
|
|
517
517
|
|
|
518
518
|
const existing = await this.findRowByAppTenantEnv(input.appId, ctx.tenantId, input.env);
|
|
519
519
|
if (existing && existing.status !== "uninstalled") {
|
|
520
|
+
const byOther = Boolean(existing.install_actor && existing.install_actor !== ctx.actor);
|
|
520
521
|
throw new RegistryError(
|
|
521
|
-
|
|
522
|
+
byOther
|
|
523
|
+
? `App "${input.appId}" is already installed for this tenant/env by another developer.`
|
|
524
|
+
: `App "${input.appId}" is already installed for this tenant/env.`,
|
|
522
525
|
"already_installed",
|
|
523
526
|
);
|
|
524
527
|
}
|
|
@@ -22,6 +22,7 @@ import { isOnSale, isNew, isAvailable, fromPrice } from "@/lib/catalog/tot/query
|
|
|
22
22
|
import {
|
|
23
23
|
buildMemberSignedCartPayload,
|
|
24
24
|
commerceTenantId,
|
|
25
|
+
MAX_CART_QUANTITY,
|
|
25
26
|
SAMPLE_CART_HANDOFF_URL,
|
|
26
27
|
sampleVariantCartPayload,
|
|
27
28
|
workerCartApiPath,
|
|
@@ -457,7 +458,7 @@ const structuredData = {
|
|
|
457
458
|
data-product-title={product.title} class="grid gap-3">
|
|
458
459
|
<label>Option <select name="variantId" required></select></label>
|
|
459
460
|
<p data-shopper-price aria-live="polite"></p>
|
|
460
|
-
<label>Quantity <input name="quantity" type="number" min="1" max=
|
|
461
|
+
<label>Quantity <input name="quantity" type="number" min="1" max={MAX_CART_QUANTITY} value="1" required /></label>
|
|
461
462
|
<input name="productHandle" type="hidden" />
|
|
462
463
|
<button type="submit" class="rounded-md bg-[var(--color-primary)] px-4 py-3 text-[var(--color-primary-contrast)]">
|
|
463
464
|
Add to cart
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "7.11.
|
|
3
|
+
"version": "7.11.9",
|
|
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",
|
|
@@ -231,7 +231,7 @@ export type CartRoutePhase = "preview" | "publication";
|
|
|
231
231
|
export const CART_API_ENDPOINT = "/api/commerce/checkout-handoff";
|
|
232
232
|
|
|
233
233
|
/** Inclusive upper bound for a cart line quantity. */
|
|
234
|
-
export const MAX_CART_QUANTITY =
|
|
234
|
+
export const MAX_CART_QUANTITY = 10_000;
|
|
235
235
|
|
|
236
236
|
/** Most lines one assistant proposal may carry. */
|
|
237
237
|
export const CART_PROPOSAL_MAX_LINES = 50;
|