@tokenoftrust/storefront-runner 2.5.6 → 3.0.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/agency-kit/tools/lib/public-binaries.mjs +111 -0
- package/apps/storefront/astro.config.mjs +7 -0
- package/apps/storefront/env.d.ts +3 -0
- package/apps/storefront/src/components/catalog/storefront/ProductCard.astro +5 -4
- package/apps/storefront/src/components/catalog/storefront/commerce/PriceDisplay.astro +2 -1
- package/apps/storefront/src/components/catalog/storefront/islands/SearchTypeahead.tsx +17 -20
- package/apps/storefront/src/components/catalog/storefront/islands/VariantSelector.tsx +13 -21
- package/apps/storefront/src/components/catalog/storefront/plp/Pagination.astro +9 -5
- package/apps/storefront/src/components/checkout/storefront/commerce/CheckoutLoader.astro +18 -6
- package/apps/storefront/src/components/compliance/storefront/islands/CheckoutComplianceGate.tsx +19 -4
- package/apps/storefront/src/components/content/storefront/Badge.astro +1 -0
- package/apps/storefront/src/components/content/storefront/blog/BlogIndexView.astro +10 -1
- package/apps/storefront/src/components/publication/storefront/islands/CatalogQueryView.tsx +321 -0
- package/apps/storefront/src/config/declaredTenantConfig.ts +59 -27
- package/apps/storefront/src/config/devTenantSeed.ts +2 -1
- package/apps/storefront/src/layouts/Layout.astro +1 -1
- package/apps/storefront/src/lib/access/auth/gatePage.ts +29 -14
- package/apps/storefront/src/lib/access/shared/publicAccess.ts +95 -0
- package/apps/storefront/src/lib/access/shared/tenantRouting.ts +19 -0
- package/apps/storefront/src/lib/catalog/shared/catalogIndex.ts +109 -0
- package/apps/storefront/src/lib/catalog/shared/catalogQueryView.ts +60 -0
- package/apps/storefront/src/lib/catalog/shared/collectionPaging.ts +78 -0
- package/apps/storefront/src/lib/catalog/shared/stockStatus.ts +23 -0
- package/apps/storefront/src/lib/catalog/tot/query.ts +8 -0
- package/apps/storefront/src/lib/checkout/browser/checkoutRequirementsForm.ts +54 -0
- package/apps/storefront/src/lib/checkout/commerce/checkoutHandoffRoute.ts +103 -35
- package/apps/storefront/src/lib/checkout/commerce/checkoutRequirements.ts +88 -0
- package/apps/storefront/src/lib/checkout/commerce/finalCartAuthorization.ts +2 -0
- package/apps/storefront/src/lib/checkout/commerce/sharedStoreAdmission.ts +95 -0
- package/apps/storefront/src/lib/checkout/shared/lazyCheckoutLoader.ts +191 -0
- package/apps/storefront/src/lib/compliance/browser/checkoutVerificationFlow.ts +9 -0
- package/apps/storefront/src/lib/compliance/enforcement.ts +7 -5
- package/apps/storefront/src/lib/content/seo/structuredData.ts +12 -3
- package/apps/storefront/src/lib/content/storyblok/provider.ts +4 -2
- package/apps/storefront/src/lib/observability/shared/serverTiming.ts +110 -0
- package/apps/storefront/src/lib/publication/shared/edgeCache.ts +3 -4
- package/apps/storefront/src/lib/publication/shared/staticQuery.ts +64 -0
- package/apps/storefront/src/middleware/controlPlane.ts +14 -11
- package/apps/storefront/src/middleware/index.ts +33 -12
- package/apps/storefront/src/middleware/renderChain.ts +52 -26
- package/apps/storefront/src/pages/[...slug].astro +3 -0
- package/apps/storefront/src/pages/api/commerce/final-cart-authorization.ts +112 -42
- package/apps/storefront/src/pages/api/compliance/preflight.ts +61 -13
- package/apps/storefront/src/pages/blog/author/[author].astro +1 -1
- package/apps/storefront/src/pages/blog/category/[category].astro +1 -1
- package/apps/storefront/src/pages/blog/tag/[tag].astro +1 -1
- package/apps/storefront/src/pages/catalog-index.json.ts +20 -0
- package/apps/storefront/src/pages/collections/[handle]/page/[n].astro +28 -0
- package/apps/storefront/src/pages/collections/[handle].astro +13 -198
- package/apps/storefront/src/pages/collections/_CollectionView.astro +251 -0
- package/apps/storefront/src/pages/collections/index.astro +1 -1
- package/apps/storefront/src/pages/products/[handle].astro +10 -5
- package/apps/storefront/src/pages/search.astro +33 -33
- package/apps/storefront/src/pages/sitemap.xml.ts +7 -1
- package/apps/storefront/vitest.config.cts +3 -0
- package/package.json +1 -1
- package/packages/cli/src/declared-config.mjs +318 -32
- package/packages/cli/src/publication-spaces.mjs +1 -1
- package/packages/public-runtime/package.json +1 -0
- package/packages/public-runtime/schemas/publication-space/v1/manifest.schema.json +1 -1
- package/packages/public-runtime/schemas/publication-space/v1/normalized-mount.schema.json +1 -1
- package/packages/public-runtime/src/activity/catalog.ts +8 -1
- package/packages/public-runtime/src/candidate-index.ts +5 -0
- package/packages/public-runtime/src/capabilities.ts +12 -9
- package/packages/public-runtime/src/capture-rewrites.ts +687 -0
- package/packages/public-runtime/src/checkout-orders.ts +6 -7
- package/packages/public-runtime/src/checkout.ts +190 -6
- package/packages/public-runtime/src/compliance/evaluate.ts +7 -3
- package/packages/public-runtime/src/compliance/profile.ts +90 -14
- package/packages/public-runtime/src/compliance-coherence.d.mts +10 -1
- package/packages/public-runtime/src/compliance-coherence.mjs +129 -29
- package/packages/public-runtime/src/customization-runtime.ts +64 -2
- package/packages/public-runtime/src/declared-tenant-config.d.mts +13 -2
- package/packages/public-runtime/src/declared-tenant-config.mjs +83 -1
- package/packages/public-runtime/src/image-preview-rewrite-overlay.ts +13 -37
- package/packages/public-runtime/src/membership.ts +3 -0
- package/packages/public-runtime/src/publication-space.ts +1 -0
- package/packages/public-runtime/src/tenant.ts +28 -4
- package/scripts/tenant/validate.mjs +17 -8
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* ArtifactPath)` overrides the build-time `TenantConfig.capabilities` default.
|
|
24
24
|
*/
|
|
25
25
|
import type { TenantConfig } from "./tenant.js";
|
|
26
|
+
import { resolveObligationIds } from "./compliance-obligations.js";
|
|
26
27
|
|
|
27
28
|
export interface CapabilityState {
|
|
28
29
|
enabled: boolean;
|
|
@@ -70,24 +71,26 @@ export function capabilitiesArtifactPath(tenantId: string): string {
|
|
|
70
71
|
/**
|
|
71
72
|
* Resolve the non-negotiable compliance floor for a tenant. This is intentionally
|
|
72
73
|
* narrower than feature defaults: it says only what MUST remain on for the site
|
|
73
|
-
* to be publishable.
|
|
74
|
+
* to be publishable. Each capability is required exactly when the obligation
|
|
75
|
+
* registry (`resolveObligationIds`) applies the duty it serves.
|
|
74
76
|
*/
|
|
75
77
|
export function resolveComplianceObligations(
|
|
76
78
|
tenant: Pick<TenantConfig, "compliance" | "siteType">,
|
|
77
79
|
): CapabilityObligations {
|
|
80
|
+
const owed = new Set(resolveObligationIds(tenant));
|
|
78
81
|
return {
|
|
79
82
|
cartCheckout: { required: false },
|
|
80
|
-
ageVerification:
|
|
83
|
+
ageVerification: owed.has("age_gate")
|
|
81
84
|
? {
|
|
82
85
|
required: true,
|
|
83
|
-
reason: `Tenant requires age/identity verification for ${tenant.compliance
|
|
86
|
+
reason: `Tenant requires age/identity verification for ${tenant.compliance?.minAge}+ access.`,
|
|
84
87
|
}
|
|
85
88
|
: { required: false },
|
|
86
|
-
exciseTax:
|
|
89
|
+
exciseTax: owed.has("excise")
|
|
87
90
|
? {
|
|
88
91
|
required: true,
|
|
89
92
|
reason:
|
|
90
|
-
"Tenant sells
|
|
93
|
+
"Tenant sells excise-taxed products (`compliance.nicotineWarning` or `compliance.exciseTax`) and must keep excise-tax collection enabled at checkout.",
|
|
91
94
|
}
|
|
92
95
|
: { required: false },
|
|
93
96
|
};
|
|
@@ -130,18 +133,18 @@ export function resolveCapabilities(
|
|
|
130
133
|
override?: Partial<CapabilityConfig> | null,
|
|
131
134
|
): CapabilityConfig {
|
|
132
135
|
const c = tenant.capabilities;
|
|
136
|
+
const owed = new Set(resolveObligationIds(tenant));
|
|
133
137
|
const base: CapabilityConfig = {
|
|
134
138
|
// Commerce tenants get a cart by default; marketing tenants don't.
|
|
135
139
|
cartCheckout: {
|
|
136
140
|
enabled: c?.cartCheckout?.enabled ?? tenant.siteType !== "marketing",
|
|
137
141
|
},
|
|
138
|
-
//
|
|
142
|
+
// A tenant that owes a duty has the capability serving it on by default.
|
|
139
143
|
ageVerification: {
|
|
140
|
-
enabled: c?.ageVerification?.enabled ??
|
|
144
|
+
enabled: c?.ageVerification?.enabled ?? owed.has("age_gate"),
|
|
141
145
|
},
|
|
142
|
-
// Nicotine/vape tenants collect excise by default.
|
|
143
146
|
exciseTax: {
|
|
144
|
-
enabled: c?.exciseTax?.enabled ??
|
|
147
|
+
enabled: c?.exciseTax?.enabled ?? owed.has("excise"),
|
|
145
148
|
},
|
|
146
149
|
};
|
|
147
150
|
const requested = override
|