@tokenoftrust/storefront-runner 7.11.2 → 7.11.4

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.
@@ -63,7 +63,7 @@ function uploadRecordKey(tenantId: string, address: string): string {
63
63
  return `original-images/${tenantId}/uploads/${address}.json`;
64
64
  }
65
65
 
66
- async function readUploadedOriginalEntry(
66
+ export async function readUploadedOriginalEntry(
67
67
  bucket: CapturedOriginalBucket,
68
68
  tenantId: string,
69
69
  address: string,
@@ -201,8 +201,18 @@ export async function tryServeStaticBundle(
201
201
  // `null` = the manifest proves this path is outside the bundle's static surface
202
202
  // (an app surface like /admin) — the caller owns it.
203
203
  if (!bundleResponse) return null;
204
- if (bundleCacheKey && cache) {
205
- await putCachedPage(cache, bundleCacheKey, bundleResponse);
204
+ if (bundleCacheKey && cache && bundleResponse.status === 200 && !bundleResponse.headers.has("set-cookie")) {
205
+ const cc = bundleResponse.headers.get("cache-control") ?? "";
206
+ if (!cc.includes("no-store") && !cc.includes("private")) {
207
+ if ((bundleResponse.headers.get("content-type") ?? "").includes("text/html")) {
208
+ await putCachedPage(cache, bundleCacheKey, bundleResponse);
209
+ } else {
210
+ const cloned = bundleResponse.clone();
211
+ const toStore = new Response(cloned.body, cloned);
212
+ toStore.headers.set("X-ToT-Cache", "stored");
213
+ await cache.put(bundleCacheKey, toStore).catch(() => void 0);
214
+ }
215
+ }
206
216
  }
207
217
  return bundleResponse;
208
218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/storefront-runner",
3
- "version": "7.11.2",
3
+ "version": "7.11.4",
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",
@@ -34,7 +34,7 @@ export interface StateComplianceRule {
34
34
  * (fail closed).
35
35
  */
36
36
  banCoolingAgents?: boolean;
37
- /** Per-order regulated-unit cap for this region (overrides the ruleset default). */
37
+ /** Per-order regulated-unit cap for this region. */
38
38
  perOrderUnitLimit?: number;
39
39
  /** Adult signature on delivery required for this region (else the PACT baseline). */
40
40
  adultSignatureRequired?: boolean;
@@ -97,8 +97,6 @@ export interface ComplianceRuleset {
97
97
  verification: VerificationRequirement;
98
98
  excise: ExciseRequirement;
99
99
  pactAct: PactActRule;
100
- /** Fallback per-order regulated-unit cap when no state rule sets one. */
101
- defaultPerOrderUnitLimit?: number;
102
100
  /** The substance of jurisdiction enforcement — data-driven, not a static list in code. */
103
101
  states: StateComplianceRule[];
104
102
  /** ISO date the rule DATA was last reviewed (provenance). */
@@ -153,11 +151,10 @@ export function stateRuleFor(
153
151
  return ruleset.states.find((s) => s.region.toUpperCase() === key);
154
152
  }
155
153
 
156
- /** The effective per-order unit limit for a region (state rule wins over the default). */
154
+ /** The effective per-order unit limit for a region, when the state rule declares one. */
157
155
  export function effectivePerOrderLimit(
158
- ruleset: Pick<ComplianceRuleset, "states" | "defaultPerOrderUnitLimit">,
156
+ ruleset: Pick<ComplianceRuleset, "states">,
159
157
  region: string | undefined | null,
160
158
  ): number | undefined {
161
- const stateLimit = stateRuleFor(ruleset, region)?.perOrderUnitLimit;
162
- return stateLimit ?? ruleset.defaultPerOrderUnitLimit;
159
+ return stateRuleFor(ruleset, region)?.perOrderUnitLimit;
163
160
  }
@@ -597,6 +597,9 @@ const PLATFORM_CUSTOM_PROPERTIES = [
597
597
  "--space-7",
598
598
  "--space-8",
599
599
  "--space-9",
600
+ "--space-10",
601
+ "--space-11",
602
+ "--space-12",
600
603
  "--container-max",
601
604
  "--section-rhythm",
602
605
  "--radius-sm",
@@ -610,6 +613,10 @@ const PLATFORM_CUSTOM_PROPERTIES = [
610
613
  "--shadow-md",
611
614
  "--shadow-lg",
612
615
  "--tap-target",
616
+ "--focus-ring",
617
+ "--surface-card",
618
+ "--text-muted",
619
+ "--display-size",
613
620
  ] as const;
614
621
 
615
622
  const NO_DECLARED_CUSTOM_PROPERTIES: ReadonlySet<string> = new Set(PLATFORM_CUSTOM_PROPERTIES);
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "schema": "compliance-decisions-golden/1",
3
3
  "ruleProfile": "vape-nicotine-us",
4
- "defaultPerOrderUnitLimit": null,
5
4
  "products": {
6
5
  "unflavored": {"containsNicotine":true,"isFlavored":false,"category":"ends","coolingAgent":null,"regulated":true,"restrictedRegions":[]},
7
6
  "tobacco-only": {"containsNicotine":true,"isFlavored":false,"category":"ends","coolingAgent":false,"regulated":true,"restrictedRegions":[]},