@tokenoftrust/storefront-runner 1.4.1 → 2.0.0
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/apps/storefront/astro.config.mjs +17 -1
- package/apps/storefront/env.d.ts +54 -5
- package/apps/storefront/integrations/materialize-guard.mjs +54 -0
- package/apps/storefront/migrations-apps/0002_good_switch.sql +26 -0
- package/apps/storefront/migrations-apps/0003_mute_marauders.sql +12 -0
- package/apps/storefront/migrations-apps/0004_deep_morph.sql +36 -0
- package/apps/storefront/migrations-apps/0005_common_mystique.sql +23 -0
- package/apps/storefront/migrations-apps/0006_broad_microchip.sql +16 -0
- package/apps/storefront/migrations-apps/0007_brave_outlaw_kid.sql +15 -0
- package/apps/storefront/migrations-apps/0008_blue_dazzler.sql +11 -0
- package/apps/storefront/migrations-apps/0009_bored_shinobi_shaw.sql +15 -0
- package/apps/storefront/migrations-apps/0010_ws4_verified_provider_measurement.sql +35 -0
- package/apps/storefront/migrations-apps/meta/0002_snapshot.json +1160 -0
- package/apps/storefront/migrations-apps/meta/0003_snapshot.json +1235 -0
- package/apps/storefront/migrations-apps/meta/0004_snapshot.json +1474 -0
- package/apps/storefront/migrations-apps/meta/0005_snapshot.json +1617 -0
- package/apps/storefront/migrations-apps/meta/0006_snapshot.json +1716 -0
- package/apps/storefront/migrations-apps/meta/0007_snapshot.json +1812 -0
- package/apps/storefront/migrations-apps/meta/0008_snapshot.json +1881 -0
- package/apps/storefront/migrations-apps/meta/0009_snapshot.json +1979 -0
- package/apps/storefront/migrations-apps/meta/_journal.json +56 -0
- package/apps/storefront/public/apps/tot.demo.analytics/0.1.0/entry.js +42 -0
- package/apps/storefront/public/js/dashboard-team.js +38 -2
- package/apps/storefront/public/platform/amplitude-http/v1/entry.mjs +19 -0
- package/apps/storefront/public/platform/google-measurement/v1/entry.mjs +19 -0
- package/apps/storefront/public/shared/commerce-chrome.css +20 -2
- package/apps/storefront/scripts/build-v84-clean-clone-standalone.mjs +68 -0
- package/apps/storefront/scripts/deny-v84-clean-clone-standalone-capabilities.mjs +111 -0
- package/apps/storefront/scripts/deny-v84-dogfood-capabilities.mjs +2 -0
- package/apps/storefront/scripts/deny-v84-lifecycle-capabilities.mjs +247 -0
- package/apps/storefront/scripts/dogfood-v84-nonportable-routes.ts +73 -0
- package/apps/storefront/scripts/fixed-v84-native-install-producer.ts +79 -0
- package/apps/storefront/scripts/generated/v84-clean-clone-replay.bundle.mjs +10982 -0
- package/apps/storefront/scripts/import-v84-through-ws2.ts +38 -0
- package/apps/storefront/scripts/initialize-v84-lifecycle-tooling-dependency.ts +2 -0
- package/apps/storefront/scripts/initialize-v84-lifecycle-tooling.ts +4 -0
- package/apps/storefront/scripts/install-v84-native-through-ws1.ts +185 -0
- package/apps/storefront/scripts/prove-clone-isolation.ts +506 -0
- package/apps/storefront/scripts/replay-v84-clean-clone-pass.ts +148 -0
- package/apps/storefront/scripts/replay-v84-clean-clone-standalone.ts +35 -0
- package/apps/storefront/scripts/replay-v84-clean-clone.ts +214 -0
- package/apps/storefront/scripts/run-fixed-v84-native-install-producer.mjs +18 -0
- package/apps/storefront/scripts/run-v84-clone-isolation-proof.mjs +18 -0
- package/apps/storefront/scripts/run-v84-clone-lifecycle-proof.mjs +18 -0
- package/apps/storefront/scripts/run-v84-import-through-ws2-proof.mjs +17 -0
- package/apps/storefront/scripts/run-v84-nonportable-route-dogfood.mjs +15 -0
- package/apps/storefront/scripts/sanitize-v84-proof-environment.mjs +21 -0
- package/apps/storefront/scripts/v84CleanCloneGraphPin.ts +42 -0
- package/apps/storefront/scripts/v84CleanCloneSourceGraph.ts +145 -0
- package/apps/storefront/scripts/validate-v84-clone-lifecycle.ts +18 -0
- package/apps/storefront/src/components/Img.astro +1 -1
- package/apps/storefront/src/components/Seo.astro +65 -1
- package/apps/storefront/src/components/admin/AdminBlogDetailRail.astro +878 -0
- package/apps/storefront/src/components/admin/AdminBlogTab.astro +1435 -0
- package/apps/storefront/src/components/admin/AdminCustomersTab.astro +3 -7
- package/apps/storefront/src/components/admin/AdminIntegrationsTab.astro +105 -0
- package/apps/storefront/src/components/admin/AdminPublishTab.astro +1980 -2564
- package/apps/storefront/src/components/admin/AdminSettingsTab.astro +2 -2
- package/apps/storefront/src/components/admin/AdminSubscriptionsTab.astro +1 -3
- package/apps/storefront/src/components/admin/orders/OrdersWorkspace.astro +5 -5
- package/apps/storefront/src/components/blog/BlogPaywall.astro +87 -0
- package/apps/storefront/src/components/blog/PostAccessBadge.astro +43 -0
- package/apps/storefront/src/components/blog/PostGrid.astro +57 -0
- package/apps/storefront/src/components/blog/ReactionBar.astro +214 -0
- package/apps/storefront/src/components/chrome/NavDropdown.astro +12 -0
- package/apps/storefront/src/components/chrome/SiteFooter.astro +7 -2
- package/apps/storefront/src/components/chrome/SiteHeader.astro +46 -10
- package/apps/storefront/src/components/compliance/AdultSignatureNotice.astro +1 -1
- package/apps/storefront/src/components/compliance/ComplianceNotice.astro +1 -2
- package/apps/storefront/src/components/compliance/ExciseTaxNotice.astro +1 -2
- package/apps/storefront/src/components/compliance/PactActNotice.astro +1 -1
- package/apps/storefront/src/components/compliance/Prop65Warning.astro +1 -2
- package/apps/storefront/src/components/compliance/PurchaseLimitNotice.astro +2 -3
- package/apps/storefront/src/components/compliance/ShippingRestrictionNotice.astro +2 -2
- package/apps/storefront/src/components/compliance/StateEligibilityNotice.astro +2 -3
- package/apps/storefront/src/components/content/TrustStrip.astro +4 -4
- package/apps/storefront/src/components/islands/MobileNav.tsx +26 -1
- package/apps/storefront/src/components/islands/VariantSelector.tsx +27 -2
- package/apps/storefront/src/components/islands/useCheckoutHandoffCorrelation.ts +75 -0
- package/apps/storefront/src/components/membership/IllustrativeLabel.astro +1 -2
- package/apps/storefront/src/components/membership/TierCards.astro +2 -2
- package/apps/storefront/src/components/membership/TierComparisonTable.astro +2 -2
- package/apps/storefront/src/components/subscription/SavingsExplainer.astro +2 -2
- package/apps/storefront/src/config/adminTenantLookup.ts +35 -0
- package/apps/storefront/src/config/devTenantSeed.ts +9 -9
- package/apps/storefront/src/config/resolver.ts +4 -4
- package/apps/storefront/src/layouts/Layout.astro +146 -21
- package/apps/storefront/src/lib/activity/alerts.ts +17 -19
- package/apps/storefront/src/lib/activity/candidateSubmitLease.ts +87 -0
- package/apps/storefront/src/lib/activity/changeActorAttribution.ts +89 -9
- package/apps/storefront/src/lib/activity/deployVersion.ts +20 -27
- package/apps/storefront/src/lib/activity/ingest.ts +8 -8
- package/apps/storefront/src/lib/activity/ingestAuth.ts +1 -1
- package/apps/storefront/src/lib/activity/killSwitch.ts +6 -6
- package/apps/storefront/src/lib/activity/query.ts +9 -9
- package/apps/storefront/src/lib/activity/recordActivity.ts +11 -15
- package/apps/storefront/src/lib/activity/store.ts +4 -6
- package/apps/storefront/src/lib/activity/uiActor.ts +12 -12
- package/apps/storefront/src/lib/activity/workerCommit.ts +6 -6
- package/apps/storefront/src/lib/admin/adminShell.ts +292 -0
- package/apps/storefront/src/lib/admin/ai/approvalMode.ts +2 -3
- package/apps/storefront/src/lib/admin/ai/audit.ts +3 -5
- package/apps/storefront/src/lib/admin/checkoutStyleInput.ts +7 -7
- package/apps/storefront/src/lib/admin/checkoutStyleTarget.ts +3 -3
- package/apps/storefront/src/lib/admin/envelope.ts +1 -2
- package/apps/storefront/src/lib/admin/orderClient.ts +3 -5
- package/apps/storefront/src/lib/admin/services/orders.ts +17 -19
- package/apps/storefront/src/lib/admin/viewmodels/aiWorkflows.ts +4 -6
- package/apps/storefront/src/lib/admin/viewmodels/settings.ts +1 -1
- package/apps/storefront/src/lib/apps/adminService.ts +14 -4
- package/apps/storefront/src/lib/apps/adminSession.ts +54 -45
- package/apps/storefront/src/lib/apps/apiAuth.ts +2 -2
- package/apps/storefront/src/lib/apps/apiRoute.ts +2 -2
- package/apps/storefront/src/lib/apps/appVersionStore.ts +281 -0
- package/apps/storefront/src/lib/apps/catalogMapper.ts +1 -1
- package/apps/storefront/src/lib/apps/consentConfigStore.ts +228 -0
- package/apps/storefront/src/lib/apps/credentials.ts +2 -2
- package/apps/storefront/src/lib/apps/gatewayKeys.ts +4 -4
- package/apps/storefront/src/lib/apps/gtmMigrationInstall.ts +447 -0
- package/apps/storefront/src/lib/apps/gtmMigrationReport.ts +367 -0
- package/apps/storefront/src/lib/apps/gtmMigrationTab.ts +315 -0
- package/apps/storefront/src/lib/apps/healthAggregate.ts +5 -5
- package/apps/storefront/src/lib/apps/integrationLifecycle.ts +614 -0
- package/apps/storefront/src/lib/apps/integrationLifecycleController.ts +125 -0
- package/apps/storefront/src/lib/apps/integrationReadModel.ts +563 -0
- package/apps/storefront/src/lib/apps/integrationsTab.ts +547 -0
- package/apps/storefront/src/lib/apps/integrationsView.ts +106 -0
- package/apps/storefront/src/lib/apps/managedAnalyticsService.ts +599 -0
- package/apps/storefront/src/lib/apps/orders/attributionService.ts +2 -2
- package/apps/storefront/src/lib/apps/orders/customerHash.ts +1 -1
- package/apps/storefront/src/lib/apps/orders/foxyOrderClient.ts +12 -12
- package/apps/storefront/src/lib/apps/orders/idempotency.ts +7 -7
- package/apps/storefront/src/lib/apps/orders/orderConversionD1.ts +150 -0
- package/apps/storefront/src/lib/apps/orders/orderForwardReceiver.ts +9 -1
- package/apps/storefront/src/lib/apps/orders/orderMapper.ts +2 -2
- package/apps/storefront/src/lib/apps/orders/ordersStore.ts +7 -7
- package/apps/storefront/src/lib/apps/orders/verifiedProviderMeasurement.ts +117 -0
- package/apps/storefront/src/lib/apps/registryService.ts +270 -16
- package/apps/storefront/src/lib/apps/scopes.ts +2 -2
- package/apps/storefront/src/lib/apps/tenantIntegrationMaterialization.ts +170 -0
- package/apps/storefront/src/lib/apps/tokenIssuer.ts +4 -4
- package/apps/storefront/src/lib/apps/tokenVerifier.ts +6 -6
- package/apps/storefront/src/lib/apps/v84CleanCloneReplayContext.ts +16 -0
- package/apps/storefront/src/lib/apps/v84CloneLifecycleCacheEvidence.ts +105 -0
- package/apps/storefront/src/lib/apps/v84CloneLifecycleEvidence.ts +177 -0
- package/apps/storefront/src/lib/apps/v84CloneLifecycleMaterialization.ts +251 -0
- package/apps/storefront/src/lib/apps/v84CloneLifecycleSemantics.ts +241 -0
- package/apps/storefront/src/lib/apps/v84CloneMigrationEvidence.ts +211 -0
- package/apps/storefront/src/lib/apps/v84CloneNativeInstallEvidence.ts +409 -0
- package/apps/storefront/src/lib/apps/v84NonportableCodeCoaching.ts +368 -0
- package/apps/storefront/src/lib/apps/v84NonportableRouteContract.ts +188 -0
- package/apps/storefront/src/lib/apps/v84NonportableRouteDogfood.ts +291 -0
- package/apps/storefront/src/lib/apps/widgets/eligibility.ts +2 -2
- package/apps/storefront/src/lib/apps/widgets/frameProps.ts +3 -3
- package/apps/storefront/src/lib/apps/widgets/launchToken.ts +4 -4
- package/apps/storefront/src/lib/apps/widgets/placements.ts +2 -2
- package/apps/storefront/src/lib/apps/widgets/renderSlot.ts +1 -1
- package/apps/storefront/src/lib/apps/ws1ManagedAnalyticsClient.ts +95 -0
- package/apps/storefront/src/lib/auth/adminApiGuard.ts +66 -0
- package/apps/storefront/src/lib/auth/adminEntry.ts +11 -11
- package/apps/storefront/src/lib/auth/adminLanding.ts +88 -0
- package/apps/storefront/src/lib/auth/identityToken.ts +6 -14
- package/apps/storefront/src/lib/auth/loginGate.ts +75 -13
- package/apps/storefront/src/lib/auth/mcpClientAssertion.ts +2 -4
- package/apps/storefront/src/lib/auth/operatorSession.ts +113 -0
- package/apps/storefront/src/lib/auth/session.ts +7 -8
- package/apps/storefront/src/lib/auth/totAccessClient.ts +8 -18
- package/apps/storefront/src/lib/basePath.ts +9 -2
- package/apps/storefront/src/lib/blog/access.ts +29 -0
- package/apps/storefront/src/lib/blog/collection.ts +400 -0
- package/apps/storefront/src/lib/blog/markdown.ts +174 -0
- package/apps/storefront/src/lib/blog/provider.ts +62 -3
- package/apps/storefront/src/lib/blog/reactions.ts +87 -0
- package/apps/storefront/src/lib/blog/rss.ts +92 -0
- package/apps/storefront/src/lib/blog/teaser.ts +83 -0
- package/apps/storefront/src/lib/blog/types.ts +34 -0
- package/apps/storefront/src/lib/blog/viewCounts.ts +243 -0
- package/apps/storefront/src/lib/chrome/examples/tokenoftrust.chrome-assignments.example.json +6 -0
- package/apps/storefront/src/lib/chrome/examples/tokenoftrust.chrome.example.json +79 -0
- package/apps/storefront/src/lib/chrome/model.ts +48 -253
- package/apps/storefront/src/lib/chrome/navCurrent.ts +29 -0
- package/apps/storefront/src/lib/chrome/parseConfig.ts +18 -32
- package/apps/storefront/src/lib/chrome/variant.ts +39 -0
- package/apps/storefront/src/lib/commerce/checkoutHandoffCorrelation.ts +105 -0
- package/apps/storefront/src/lib/compliance/tamper-sentinel-boot.ts +152 -0
- package/apps/storefront/src/lib/compliance/tamper-sentinel.ts +327 -0
- package/apps/storefront/src/lib/content/index.ts +5 -5
- package/apps/storefront/src/lib/content-edit/applyDiff.ts +1 -1
- package/apps/storefront/src/lib/content-edit/route.ts +1 -1
- package/apps/storefront/src/lib/d1/catalog.ts +14 -2
- package/apps/storefront/src/lib/d1/schema-apps.ts +372 -17
- package/apps/storefront/src/lib/dev/activityIngestToken.ts +2 -4
- package/apps/storefront/src/lib/dev/activityStore.ts +3 -5
- package/apps/storefront/src/lib/dev/apiBase.ts +1 -4
- package/apps/storefront/src/lib/dev/cockpit/ask.ts +49 -0
- package/apps/storefront/src/lib/dev/cockpit/clickToSource.ts +71 -0
- package/apps/storefront/src/lib/dev/cockpit/copyCommand.ts +227 -0
- package/apps/storefront/src/lib/dev/cockpit/files.ts +249 -0
- package/apps/storefront/src/lib/dev/cockpit/hostedActivity.ts +500 -0
- package/apps/storefront/src/lib/dev/cockpit/infoPopover.ts +12 -0
- package/apps/storefront/src/lib/dev/cockpit/mcpCopy.ts +34 -0
- package/apps/storefront/src/lib/dev/cockpit/monitor.ts +107 -0
- package/apps/storefront/src/lib/dev/cockpit/stepper.ts +116 -0
- package/apps/storefront/src/lib/dev/cockpit/themeToggle.ts +23 -0
- package/apps/storefront/src/lib/dev/cockpitStore.ts +1 -9
- package/apps/storefront/src/lib/dev/devDraft.ts +1 -1
- package/apps/storefront/src/lib/dev/previewStatus.ts +9 -21
- package/apps/storefront/src/lib/dev/rendezvousBroker.ts +9 -24
- package/apps/storefront/src/lib/dev/runtimeStore.ts +1 -1
- package/apps/storefront/src/lib/edgeCache.ts +34 -5
- package/apps/storefront/src/lib/email/candidateConflictEmail.ts +80 -0
- package/apps/storefront/src/lib/http/fetchTransport.ts +63 -0
- package/apps/storefront/src/lib/i18n.ts +25 -0
- package/apps/storefront/src/lib/integration/browserEnvironment.ts +137 -0
- package/apps/storefront/src/lib/integration/managedInstallDeclarations.ts +72 -0
- package/apps/storefront/src/lib/integration/nonceStamp.ts +49 -0
- package/apps/storefront/src/lib/integration/tenantDeclarations.ts +116 -0
- package/apps/storefront/src/lib/jsonld.ts +118 -0
- package/apps/storefront/src/lib/membership/eligibility.ts +1 -1
- package/apps/storefront/src/lib/membership/model.ts +1 -2
- package/apps/storefront/src/lib/monitoring/manifest.ts +11 -11
- package/apps/storefront/src/lib/newsletter/confirmationEmail.ts +30 -0
- package/apps/storefront/src/lib/newsletter/consent.ts +23 -0
- package/apps/storefront/src/lib/newsletter/digest.ts +117 -0
- package/apps/storefront/src/lib/newsletter/resendClient.ts +79 -0
- package/apps/storefront/src/lib/newsletter/send.ts +265 -0
- package/apps/storefront/src/lib/newsletter/subscribers.ts +156 -0
- package/apps/storefront/src/lib/previewReload.ts +57 -1
- package/apps/storefront/src/lib/publish/adminPublishTab.ts +4625 -0
- package/apps/storefront/src/lib/publish/apex-readiness.ts +41 -18
- package/apps/storefront/src/lib/publish/buildStream.ts +269 -0
- package/apps/storefront/src/lib/publish/collapsePersistence.ts +72 -0
- package/apps/storefront/src/lib/publish/dispatchHealth.ts +5 -7
- package/apps/storefront/src/lib/publish/domainState.ts +22 -13
- package/apps/storefront/src/lib/publish/lifecycleState.ts +369 -0
- package/apps/storefront/src/lib/publish/liveReleaseSummary.ts +29 -0
- package/apps/storefront/src/lib/publish/mergeDoctorOnFailure.ts +78 -0
- package/apps/storefront/src/lib/publish/mergeHealthBanner.ts +62 -0
- package/apps/storefront/src/lib/publish/mergeRowFindings.ts +124 -0
- package/apps/storefront/src/lib/publish/mergeSupportEscalation.ts +75 -0
- package/apps/storefront/src/lib/publish/panelPolling.ts +78 -0
- package/apps/storefront/src/lib/publish/publish-guard.ts +88 -0
- package/apps/storefront/src/lib/publish/publishFormat.ts +165 -0
- package/apps/storefront/src/lib/publish/publishHero.ts +177 -0
- package/apps/storefront/src/lib/publish/reviewRelease/changeState.ts +66 -0
- package/apps/storefront/src/lib/publish/reviewRelease/copy.ts +141 -0
- package/apps/storefront/src/lib/publish/reviewRelease/index.ts +41 -0
- package/apps/storefront/src/lib/publish/reviewRelease/permissions.ts +47 -0
- package/apps/storefront/src/lib/publish/reviewRelease/releaseState.ts +42 -0
- package/apps/storefront/src/lib/publish/reviewRelease/types.ts +59 -0
- package/apps/storefront/src/lib/publish/reviewRelease/viewModel.ts +440 -0
- package/apps/storefront/src/lib/publish/reviewReleaseWorkspace/actions.ts +161 -0
- package/apps/storefront/src/lib/publish/reviewReleaseWorkspace/controller.ts +325 -0
- package/apps/storefront/src/lib/publish/reviewReleaseWorkspace/render.ts +241 -0
- package/apps/storefront/src/lib/publish/shipWorkspace.ts +121 -51
- package/apps/storefront/src/lib/publish/sseRoute.ts +119 -0
- package/apps/storefront/src/lib/publish/stageBundleUpload.ts +215 -0
- package/apps/storefront/src/lib/publish/streamLogConsole.ts +142 -0
- package/apps/storefront/src/lib/publish/versionNumber.ts +52 -0
- package/apps/storefront/src/lib/rate/kvWindow.ts +53 -0
- package/apps/storefront/src/lib/rawChrome.ts +125 -47
- package/apps/storefront/src/lib/rawMarketingHtml.ts +74 -3
- package/apps/storefront/src/lib/search/index.ts +2 -2
- package/apps/storefront/src/lib/seo/alternates.ts +42 -0
- package/apps/storefront/src/lib/seo/meta.ts +65 -0
- package/apps/storefront/src/lib/social/golive.ts +212 -0
- package/apps/storefront/src/lib/social/notify.ts +32 -0
- package/apps/storefront/src/lib/social/tokenStore.ts +171 -0
- package/apps/storefront/src/lib/storyblok/content-model.ts +7 -33
- package/apps/storefront/src/lib/storyblok/provider.ts +168 -60
- package/apps/storefront/src/lib/subscription/model.ts +4 -4
- package/apps/storefront/src/lib/the-build/provider.ts +32 -0
- package/apps/storefront/src/lib/the-build/readingTime.ts +35 -0
- package/apps/storefront/src/lib/the-build/toc.ts +95 -0
- package/apps/storefront/src/lib/tot/ToTClient.ts +1 -1
- package/apps/storefront/src/lib/tot/d1Client.ts +2 -2
- package/apps/storefront/src/lib/tot/totClientInterface.ts +3 -4
- package/apps/storefront/src/lib/webhooks/deliveryStore.ts +16 -17
- package/apps/storefront/src/middleware/index.ts +385 -52
- package/apps/storefront/src/pages/[...slug].astro +9 -4
- package/apps/storefront/src/pages/admin/review-release.astro +265 -0
- package/apps/storefront/src/pages/admin/select.astro +96 -0
- package/apps/storefront/src/pages/admin.astro +25 -1313
- package/apps/storefront/src/pages/api/activity.ts +8 -8
- package/apps/storefront/src/pages/api/admin/activity-alerts.ts +5 -20
- package/apps/storefront/src/pages/api/admin/orders/[id].ts +7 -2
- package/apps/storefront/src/pages/api/admin/orders.ts +8 -2
- package/apps/storefront/src/pages/api/apps/admin/gtm-migration-install.ts +174 -0
- package/apps/storefront/src/pages/api/apps/admin/gtm-migration.ts +96 -0
- package/apps/storefront/src/pages/api/apps/admin/integration-lifecycle.ts +118 -0
- package/apps/storefront/src/pages/api/apps/admin/integrations.ts +89 -0
- package/apps/storefront/src/pages/api/apps/admin/platform-adapters.ts +85 -0
- package/apps/storefront/src/pages/api/apps/internal/order-forward.ts +74 -2
- package/apps/storefront/src/pages/api/blog/[collection]/[slug]/react.ts +104 -0
- package/apps/storefront/src/pages/api/commerce/checkout-handoff.ts +77 -0
- package/apps/storefront/src/pages/api/compliance/tamper.ts +88 -0
- package/apps/storefront/src/pages/api/integrations/v1/[operation].ts +108 -0
- package/apps/storefront/src/pages/api/newsletter/[collection]/subscribe.ts +146 -0
- package/apps/storefront/src/pages/api/newsletter/confirm.ts +75 -0
- package/apps/storefront/src/pages/api/newsletter/unsubscribe.ts +90 -0
- package/apps/storefront/src/pages/api/publish/stage-bundle.ts +70 -0
- package/apps/storefront/src/pages/api/rum/vitals.ts +20 -2
- package/apps/storefront/src/pages/blog/[slug].astro +99 -19
- package/apps/storefront/src/pages/blog/author/[author].astro +140 -0
- package/apps/storefront/src/pages/blog/category/[category].astro +67 -0
- package/apps/storefront/src/pages/blog/index.astro +4 -2
- package/apps/storefront/src/pages/blog/tag/[tag].astro +65 -0
- package/apps/storefront/src/pages/cockpit.astro +77 -1353
- package/apps/storefront/src/pages/dashboard/[appDomain]/team.astro +15 -11
- package/apps/storefront/src/pages/index.astro +10 -5
- package/apps/storefront/src/pages/llms.txt.ts +1 -1
- package/apps/storefront/src/pages/products/[handle].astro +7 -6
- package/apps/storefront/src/pages/search.astro +1 -1
- package/apps/storefront/src/pages/sitemap.xml.ts +21 -1
- package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +31 -27
- package/apps/storefront/src/pages/style-guide/[tenant]/chrome/[theme].astro +1 -1
- package/apps/storefront/src/pages/tenants/[id]/[...path].ts +38 -2
- package/apps/storefront/src/pages/the-build/[slug].astro +129 -0
- package/apps/storefront/src/pages/the-build/index.astro +146 -0
- package/apps/storefront/src/pages/the-build/rss.xml.ts +33 -0
- package/apps/storefront/src/styles/admin.css +1106 -0
- package/apps/storefront/tsconfig.json +6 -1
- package/package.json +1 -1
- package/packages/public-runtime/package.json +3 -1
- package/packages/public-runtime/schemas/managed-analytics/v1/adapter-definition.schema.json +427 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/create-integration-install-request.schema.json +161 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/create-migration-draft-request.schema.json +157 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/delete-integration-install-request.schema.json +84 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/delete-migration-draft-request.schema.json +84 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/error-envelope.schema.json +180 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/get-adapter-definition-request.schema.json +52 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/get-integration-install-request.schema.json +52 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/get-integration-revision-request.schema.json +79 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/get-migration-draft-request.schema.json +52 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/integration-install.schema.json +167 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/integration-revision.schema.json +208 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/list-adapter-definitions-request.schema.json +53 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/list-integration-installs-request.schema.json +53 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/list-integration-revisions-request.schema.json +82 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/migration-draft.schema.json +218 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/mutation-request.schema.json +52 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/mutation-success-envelope.schema.json +49 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/read-request.schema.json +20 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/read-success-envelope.schema.json +45 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/revise-integration-install-request.schema.json +156 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/set-integration-install-status-request.schema.json +92 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/update-migration-draft-request.schema.json +184 -0
- package/packages/public-runtime/scripts/generate-managed-analytics-api-v1-schemas.mjs +13 -0
- package/packages/public-runtime/src/activity/catalog.ts +89 -33
- package/packages/public-runtime/src/activity/event.ts +6 -6
- package/packages/public-runtime/src/activity/index.ts +2 -2
- package/packages/public-runtime/src/activity/redaction.ts +4 -4
- package/packages/public-runtime/src/candidate-index.ts +42 -8
- package/packages/public-runtime/src/catalog-d1.ts +1 -1
- package/packages/public-runtime/src/checkout-orders.ts +2 -2
- package/packages/public-runtime/src/checkout-style-publish.ts +2 -2
- package/packages/public-runtime/src/checkout-style.ts +7 -7
- package/packages/public-runtime/src/checkout.ts +3 -3
- package/packages/public-runtime/src/chrome.ts +777 -0
- package/packages/public-runtime/src/compliance-obligations.ts +310 -0
- package/packages/public-runtime/src/csp.ts +99 -0
- package/packages/public-runtime/src/customization-preview.ts +25 -2
- package/packages/public-runtime/src/customization-runtime.ts +156 -3
- package/packages/public-runtime/src/customization-versioning.ts +10 -0
- package/packages/public-runtime/src/destination-webhook/contract.ts +353 -0
- package/packages/public-runtime/src/embed-catalog.d.mts +9 -0
- package/packages/public-runtime/src/embed-catalog.mjs +40 -0
- package/packages/public-runtime/src/evidence.ts +288 -0
- package/packages/public-runtime/src/gtm-migration/bounds.ts +138 -0
- package/packages/public-runtime/src/gtm-migration/disposition-rules.ts +361 -0
- package/packages/public-runtime/src/gtm-migration/dispositions.ts +181 -0
- package/packages/public-runtime/src/gtm-migration/draft-generator.ts +400 -0
- package/packages/public-runtime/src/gtm-migration/graph.ts +468 -0
- package/packages/public-runtime/src/gtm-migration/index.ts +95 -0
- package/packages/public-runtime/src/gtm-migration/parse.ts +410 -0
- package/packages/public-runtime/src/gtm-migration/references.ts +266 -0
- package/packages/public-runtime/src/gtm-migration/types.ts +86 -0
- package/packages/public-runtime/src/index.ts +17 -1
- package/packages/public-runtime/src/integration/assurance-decision.ts +259 -0
- package/packages/public-runtime/src/integration/assurance.ts +228 -0
- package/packages/public-runtime/src/integration/candidate-evidence.ts +377 -0
- package/packages/public-runtime/src/integration/commerce-broker.ts +497 -0
- package/packages/public-runtime/src/integration/consent-broker.ts +337 -0
- package/packages/public-runtime/src/integration/consent-cmp-demand.ts +115 -0
- package/packages/public-runtime/src/integration/consent-config.ts +260 -0
- package/packages/public-runtime/src/integration/consent-preview.ts +125 -0
- package/packages/public-runtime/src/integration/correlation-token.ts +444 -0
- package/packages/public-runtime/src/integration/csp-compiler.ts +267 -0
- package/packages/public-runtime/src/integration/csp.ts +105 -0
- package/packages/public-runtime/src/integration/digest.ts +43 -0
- package/packages/public-runtime/src/integration/environment.ts +228 -0
- package/packages/public-runtime/src/integration/events-catalog.ts +186 -0
- package/packages/public-runtime/src/integration/events.ts +701 -0
- package/packages/public-runtime/src/integration/g2-action-boundary.ts +106 -0
- package/packages/public-runtime/src/integration/index.ts +90 -0
- package/packages/public-runtime/src/integration/interim-bridge.ts +138 -0
- package/packages/public-runtime/src/integration/lifecycle-boot.ts +317 -0
- package/packages/public-runtime/src/integration/lifecycle-runtime.ts +393 -0
- package/packages/public-runtime/src/integration/lifecycle.ts +94 -0
- package/packages/public-runtime/src/integration/managed-analytics-api-v1-safety.d.mts +2 -0
- package/packages/public-runtime/src/integration/managed-analytics-api-v1-safety.mjs +10 -0
- package/packages/public-runtime/src/integration/managed-analytics-api-v1.schemas.ts +382 -0
- package/packages/public-runtime/src/integration/managed-analytics-api-v1.ts +684 -0
- package/packages/public-runtime/src/integration/managed-analytics-bridge.ts +383 -0
- package/packages/public-runtime/src/integration/managed-analytics-value-safety.ts +14 -0
- package/packages/public-runtime/src/integration/managed-analytics.ts +277 -0
- package/packages/public-runtime/src/integration/manifest.ts +470 -0
- package/packages/public-runtime/src/integration/native-amplitude.ts +362 -0
- package/packages/public-runtime/src/integration/native-ga4.ts +352 -0
- package/packages/public-runtime/src/integration/observability.ts +451 -0
- package/packages/public-runtime/src/integration/order-conversion.ts +0 -0
- package/packages/public-runtime/src/integration/phases.ts +182 -0
- package/packages/public-runtime/src/integration/plan.ts +112 -0
- package/packages/public-runtime/src/integration/platform-adapter-runtime.ts +146 -0
- package/packages/public-runtime/src/integration/platform-adapters.ts +671 -0
- package/packages/public-runtime/src/integration/promotion-gate.ts +451 -0
- package/packages/public-runtime/src/integration/provider-checkout-extension.ts +425 -0
- package/packages/public-runtime/src/integration/receipt-measurement.ts +370 -0
- package/packages/public-runtime/src/integration/regulated-parent-cert.ts +311 -0
- package/packages/public-runtime/src/integration/render-phases.ts +267 -0
- package/packages/public-runtime/src/integration/resolve.ts +465 -0
- package/packages/public-runtime/src/integration/result.ts +239 -0
- package/packages/public-runtime/src/integration/secrets.ts +92 -0
- package/packages/public-runtime/src/integration/tamper-evidence.ts +205 -0
- package/packages/public-runtime/src/integration/tamper-recovery.ts +127 -0
- package/packages/public-runtime/src/integration/version.ts +92 -0
- package/packages/public-runtime/src/integration-capabilities.ts +520 -0
- package/packages/public-runtime/src/membership.ts +2 -2
- package/packages/public-runtime/src/raw-html-policy.ts +2 -4
- package/packages/public-runtime/src/regulated-commerce/broker/consent-dedupe.ts +144 -0
- package/packages/public-runtime/src/regulated-commerce/correlation/contract.ts +177 -0
- package/packages/public-runtime/src/regulated-commerce/diagnostics/local-dispatch.ts +24 -0
- package/packages/public-runtime/src/regulated-commerce/diagnostics/read-model.ts +69 -0
- package/packages/public-runtime/src/regulated-commerce/dispatch/core.ts +134 -0
- package/packages/public-runtime/src/regulated-commerce/events/contract.ts +113 -0
- package/packages/public-runtime/src/regulated-commerce/ledger/core.ts +81 -0
- package/packages/public-runtime/src/regulated-commerce/mappings/ga4-ads.ts +87 -0
- package/packages/public-runtime/src/regulated-commerce/provider-order/bridge.ts +52 -0
- package/packages/public-runtime/src/regulated-commerce/purchase-truth/contract.ts +252 -0
- package/packages/public-runtime/src/regulated-commerce/sources/accepted-browser-operation.ts +67 -0
- package/packages/public-runtime/src/regulated-commerce/testing/fake-destination.ts +93 -0
- package/packages/public-runtime/src/static-bundle.ts +357 -0
- package/packages/public-runtime/src/tenant-assets.ts +143 -4
- package/packages/public-runtime/src/tenant.ts +81 -17
- package/packages/public-runtime/tests/fixtures/integration/browser-environment.example.json +8 -0
- package/packages/public-runtime/tests/fixtures/integration/commerce-event.example.json +44 -0
- package/packages/public-runtime/tests/fixtures/integration/commerce-order-event.example.json +44 -0
- package/packages/public-runtime/tests/fixtures/integration/compliance-assurance-record.example.json +50 -0
- package/packages/public-runtime/tests/fixtures/integration/integration-manifest-v2.example.json +120 -0
- package/packages/public-runtime/tests/fixtures/integration/managed-analytics-v1/fake-adapter-catalog.json +35 -0
- package/packages/public-runtime/tests/fixtures/integration/tenant-action-registry.example.json +11 -0
- package/packages/public-runtime/tests/fixtures/integration/tenant-local-example/README.md +22 -0
- package/packages/public-runtime/tests/fixtures/integration/tenant-local-example/entry.js +30 -0
- package/packages/public-runtime/tests/fixtures/integration/tenant-local-example/manifest.json +75 -0
- package/packages/public-runtime/tests/fixtures/integration/tenant-local-example/public-config.json +3 -0
- package/packages/public-runtime/tests/fixtures/regulated-commerce/fake-destinations.ts +38 -0
- package/packages/public-runtime/tests/gtm-migration/fixtures/gtm-sample-container-v84.provenance.json +29 -0
- package/packages/public-runtime/tests/gtm-migration/fixtures/gtm-sample-container-v84.redacted.json +3397 -0
- package/scripts/build/copy-tenant-assets.mjs +14 -4
- package/scripts/dev/ai-edit.mjs +1 -1
- package/scripts/dev/checkout-watch.mjs +2 -2
- package/scripts/dev/file-browser.mjs +4 -6
- package/scripts/dev/file-writer.mjs +3 -3
- package/scripts/dev/git-status.mjs +2 -2
- package/scripts/dev/integration-guardrails.mjs +498 -0
- package/scripts/dev/locate-handler.mjs +3 -3
- package/scripts/dev/port-check.mjs +3 -3
- package/scripts/dev/publish.mjs +5 -9
- package/scripts/dev/safe-path.mjs +2 -2
- package/scripts/dev/shot.mjs +1 -1
- package/scripts/dev/tenant-source-root.mjs +1 -1
- package/scripts/dev/unified-diff.mjs +8 -3
- package/scripts/tot-dev.mjs +8 -11
- package/apps/storefront/src/lib/dev/vcBinding.ts +0 -80
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
-
// Action catalog — the ALLOWLISTED registry of actionKeys
|
|
2
|
+
// Action catalog — the ALLOWLISTED registry of actionKeys.
|
|
3
3
|
//
|
|
4
4
|
// The `action` field of an ActivityEvent is NEVER a free string. It is one of
|
|
5
5
|
// the keys below, and each key ships a spec: which actor kinds may emit it,
|
|
@@ -7,22 +7,22 @@
|
|
|
7
7
|
// default-DENY allowlist of payload fields that survive redaction for it.
|
|
8
8
|
//
|
|
9
9
|
// WHY A FIXED CATALOG. Free-string actions make the downstream query/alert
|
|
10
|
-
// surface
|
|
10
|
+
// surface intractable: you cannot build a dashboard, an alert rule,
|
|
11
11
|
// or a redaction allowlist against an open vocabulary. Adding a NEW action is a
|
|
12
12
|
// deliberate edit HERE (plus, for the CLI, the JS mirror + its keep-in-step
|
|
13
13
|
// test — see the module README), not an ad-hoc string at a call site.
|
|
14
14
|
//
|
|
15
15
|
// GROUNDING. These keys were reverse-engineered from the activity surfaces that
|
|
16
|
-
// already exist informally in this repo, so
|
|
17
|
-
// inventing new vocab:
|
|
16
|
+
// already exist informally in this repo, so those surfaces map onto them 1:1
|
|
17
|
+
// rather than inventing new vocab:
|
|
18
18
|
// • CLI command dispatch + ~/.tot/activity.log → cli.command.*
|
|
19
19
|
// • obstacle beacon (obstacle-beacon.cjs) → cli.obstacle.reported
|
|
20
20
|
// • local→hosted dev bridge (dev/activityStore, runtimeStore, obstacleStore)
|
|
21
21
|
// → dev.*
|
|
22
22
|
// • preview serve / reconcile / Gitea webhook → preview.* / reconcile.* / webhook.*
|
|
23
|
-
// • deploy version observed (provenance
|
|
23
|
+
// • deploy version observed (provenance) → deploy.version_observed
|
|
24
24
|
// • ShipLoop CHANGE_STATES + admin routes
|
|
25
|
-
// (accept/reject/ship/revert/rollback/integrate/publish/invite
|
|
25
|
+
// (accept/reject/ship/revert/rollback/integrate/publish/invite)
|
|
26
26
|
// → change.* / content.* / grant.* / preview.*
|
|
27
27
|
// • app installs (STOREFRONT_APPS_DB) → app.*
|
|
28
28
|
// • agent cohort (later) → agent.*
|
|
@@ -154,7 +154,7 @@ export const ACTION_CATALOG = {
|
|
|
154
154
|
desc: "A preview build finished (result: ok|failed).",
|
|
155
155
|
},
|
|
156
156
|
"preview.override": {
|
|
157
|
-
//
|
|
157
|
+
// An AUTHENTICATED operator accepted the risk of a blocking-safety finding for a
|
|
158
158
|
// specific commit (/api/preview/override), letting the reconcile materialize past it.
|
|
159
159
|
// Cockpit-gated (signed-in real developer capability + session tenant), so the acting
|
|
160
160
|
// cohort is owner→merchant, staff→admin, or a signed-in developer→dev. The required
|
|
@@ -166,7 +166,7 @@ export const ACTION_CATALOG = {
|
|
|
166
166
|
"webhook.reconcile.received": {
|
|
167
167
|
// Gitea candidate-reconcile webhook (api/changes/candidate-reconcile.ts). Low
|
|
168
168
|
// volume (one per PR push, NOT per request) and the lifecycle PARTNER of
|
|
169
|
-
// `reconcile.terminal` — timelined so
|
|
169
|
+
// `reconcile.terminal` — timelined so the reconcile-hang watchdog can correlate
|
|
170
170
|
// "received" against "terminal" for the same changeId and detect an ABSENCE.
|
|
171
171
|
actors: ["system"], source: "server", sinks: LIFECYCLE,
|
|
172
172
|
argsAllow: ["repo", "action", "branch", "changeId"], renderedAllow: [],
|
|
@@ -174,18 +174,43 @@ export const ACTION_CATALOG = {
|
|
|
174
174
|
},
|
|
175
175
|
"reconcile.terminal": {
|
|
176
176
|
// A reconcile reached a terminal state (reconciled|blocked|failed). Low
|
|
177
|
-
// volume, high value → timelined for the ops UI
|
|
177
|
+
// volume, high value → timelined for the ops UI.
|
|
178
178
|
actors: ["system"], source: "server", sinks: LIFECYCLE,
|
|
179
|
-
argsAllow: ["changeId", "result", "evidenceStatus"], renderedAllow: [],
|
|
179
|
+
argsAllow: ["changeId", "result", "evidenceStatus", "evidencePushError"], renderedAllow: [],
|
|
180
180
|
desc: "A candidate reconcile reached a terminal state.",
|
|
181
181
|
},
|
|
182
|
+
"candidate.closed": {
|
|
183
|
+
// A `pull_request` `closed` webhook drove a candidate to its TERMINAL status
|
|
184
|
+
// (candidate-reconcile.ts): `merged` (squash-merged) or `closed` (closed
|
|
185
|
+
// unmerged), so the row leaves the operator's review queue. Low volume (one
|
|
186
|
+
// per PR close), high value — the end-of-life marker for a candidate's timeline.
|
|
187
|
+
actors: ["system"], source: "server", sinks: LIFECYCLE,
|
|
188
|
+
argsAllow: ["changeId", "merged", "result", "status"], renderedAllow: [],
|
|
189
|
+
desc: "A merged/closed PR webhook transitioned a candidate to a terminal state.",
|
|
190
|
+
},
|
|
191
|
+
"prebuild.dispatched": {
|
|
192
|
+
// Background pre-build (docs/epics/proposed/storefront-instant-static-rollback.md
|
|
193
|
+
// Addendum §B): a successful candidate reconcile fired (or failed to fire) the
|
|
194
|
+
// materialize+validate+STAGE-ONLY repository_dispatch for a static-publish
|
|
195
|
+
// tenant (candidate-reconcile.ts). Fail-open by design — this never gates the
|
|
196
|
+
// candidate reaching `ready`; recorded so a stuck/never-dispatched prebuild is
|
|
197
|
+
// observable rather than silently absent.
|
|
198
|
+
actors: ["system"], source: "server", sinks: LIFECYCLE,
|
|
199
|
+
argsAllow: ["changeId", "headSha"], renderedAllow: [],
|
|
200
|
+
desc: "A candidate's background static-prebuild dispatch (stage-only) succeeded or failed.",
|
|
201
|
+
},
|
|
182
202
|
|
|
183
|
-
// ── Deploy provenance (source: server or cli)
|
|
203
|
+
// ── Deploy provenance (source: server or cli) ────────────────────
|
|
184
204
|
"deploy.version_observed": {
|
|
185
205
|
actors: ["system", "dev"], source: "server", sinks: PROVENANCE,
|
|
186
206
|
argsAllow: ["version", "commit", "env", "observedFrom"], renderedAllow: [],
|
|
187
207
|
desc: "A deployed worker version/commit was observed (provenance).",
|
|
188
208
|
},
|
|
209
|
+
"publish.readiness_evidence.recorded": {
|
|
210
|
+
actors: ["system"], source: "server", sinks: PROVENANCE,
|
|
211
|
+
argsAllow: ["routes", "cfFailures", "statusMismatches", "targetHealthy"], renderedAllow: [],
|
|
212
|
+
desc: "Go-live readiness dual-run evidence was recorded for a tenant (u9 producer).",
|
|
213
|
+
},
|
|
189
214
|
|
|
190
215
|
// ── ShipLoop change lifecycle (source: ui/server) ──────────────────────────
|
|
191
216
|
// 1:1 with the admin ship routes + CHANGE_STATES (change-record.ts). Low
|
|
@@ -208,8 +233,17 @@ export const ACTION_CATALOG = {
|
|
|
208
233
|
argsAllow: ["changeId"], renderedAllow: ["reason"],
|
|
209
234
|
desc: "A change was rejected (reason required).",
|
|
210
235
|
},
|
|
236
|
+
"change.resolve": {
|
|
237
|
+
// One-click conflict resolution via
|
|
238
|
+
// candidate_refresh. Same admission ladder as change.reject (resolveShipSession
|
|
239
|
+
// → ship-on-behalf floor), so the same actor cohort. `strategy` is a
|
|
240
|
+
// low-cardinality enum (ours|theirs|merge), safe to render.
|
|
241
|
+
actors: ["admin"], source: "ui", sinks: LIFECYCLE,
|
|
242
|
+
argsAllow: ["changeId"], renderedAllow: ["strategy"],
|
|
243
|
+
desc: "A not-mergeable change was resolved by rebuilding it from the base tip under a strategy.",
|
|
244
|
+
},
|
|
211
245
|
"change.ship": {
|
|
212
|
-
//
|
|
246
|
+
// The admin/cockpit "Publish" (go-live) handler admits the store OWNER
|
|
213
247
|
// (merchant), ToT staff (admin), a ship-on-behalf developer (dev), AND the
|
|
214
248
|
// headless Bearer/CLI operator (agent) — the actor list reflects who actually
|
|
215
249
|
// reaches POST /api/changes/ship, not a placeholder subset.
|
|
@@ -218,7 +252,7 @@ export const ACTION_CATALOG = {
|
|
|
218
252
|
desc: "A change was shipped to the live channel.",
|
|
219
253
|
},
|
|
220
254
|
"change.revert": {
|
|
221
|
-
//
|
|
255
|
+
// Same admission ladder as change.ship/rollback (resolveShipSession) — owner
|
|
222
256
|
// (merchant), staff (admin), ship-on-behalf dev, headless operator (agent). The
|
|
223
257
|
// `/api/changes/revert` route gates on the SAME seam, so the emitter cohort matches.
|
|
224
258
|
actors: ["admin", "merchant", "dev", "agent"], source: "ui", sinks: LIFECYCLE,
|
|
@@ -226,7 +260,7 @@ export const ACTION_CATALOG = {
|
|
|
226
260
|
desc: "A change was reverted.",
|
|
227
261
|
},
|
|
228
262
|
"change.hotfix": {
|
|
229
|
-
//
|
|
263
|
+
// The owner-only emergency HOTFIX lane (/api/changes/hotfix) — a DISTINCT verb
|
|
230
264
|
// from change.ship (never a `--base main` flag): a bypass-normal-flow live promote
|
|
231
265
|
// from `main` while `preview` holds other unshipped work. Same resolveShipSession
|
|
232
266
|
// ladder as ship/rollback (owner ⊇ ship-on-behalf), so the same cohort set.
|
|
@@ -235,18 +269,36 @@ export const ACTION_CATALOG = {
|
|
|
235
269
|
desc: "An emergency hotfix was released to the live channel (bypassing unshipped preview work).",
|
|
236
270
|
},
|
|
237
271
|
"change.rollback": {
|
|
238
|
-
//
|
|
272
|
+
// Same admission ladder as change.ship (resolveShipSession) — owner
|
|
239
273
|
// (merchant), staff (admin), ship-on-behalf dev, headless operator (agent).
|
|
240
274
|
actors: ["admin", "merchant", "dev", "agent"], source: "ui", sinks: LIFECYCLE,
|
|
241
275
|
argsAllow: ["changeId", "toVersion"], renderedAllow: ["reason"],
|
|
242
276
|
desc: "The live channel was rolled back to a prior version.",
|
|
243
277
|
},
|
|
244
278
|
"change.integrate": {
|
|
245
|
-
//
|
|
279
|
+
// Accept/integrate (resolveShipSession) admits the same cohort set.
|
|
246
280
|
actors: ["admin", "merchant", "dev", "agent"], source: "ui", sinks: LIFECYCLE,
|
|
247
281
|
argsAllow: ["changeId"], renderedAllow: [],
|
|
248
282
|
desc: "A change was integrated into the shared preview.",
|
|
249
283
|
},
|
|
284
|
+
"change.rebuild": {
|
|
285
|
+
// Retry a dead aggregate rebuild without a new merge (/api/changes/rebuild).
|
|
286
|
+
// Same admission ladder as change.integrate/revert (resolveShipSession) — the
|
|
287
|
+
// route gates on the SAME seam, so the emitter cohort matches. No changeId: a
|
|
288
|
+
// rebuild retries the tenant's most recent integration attempt, not one candidate.
|
|
289
|
+
actors: ["admin", "merchant", "dev", "agent"], source: "ui", sinks: LIFECYCLE,
|
|
290
|
+
argsAllow: [], renderedAllow: [],
|
|
291
|
+
desc: "A dead aggregate rebuild was retried without a new merge.",
|
|
292
|
+
},
|
|
293
|
+
"change.resync": {
|
|
294
|
+
// Advance the shared preview aggregate to an out-of-band branch tip
|
|
295
|
+
// without a candidate/<changeId> PR (/api/changes/resync). Same admission
|
|
296
|
+
// ladder as change.integrate/rebuild (resolveShipSession). No changeId: a
|
|
297
|
+
// resync pins an operator-supplied branch/sha, not one candidate.
|
|
298
|
+
actors: ["admin", "merchant", "dev", "agent"], source: "ui", sinks: LIFECYCLE,
|
|
299
|
+
argsAllow: [], renderedAllow: [],
|
|
300
|
+
desc: "The shared preview aggregate was resynced to an out-of-band branch tip.",
|
|
301
|
+
},
|
|
250
302
|
"change.transition": {
|
|
251
303
|
// Generic SDLC transition for states without a dedicated verb above
|
|
252
304
|
// (triage↔in_progress↔ready_for_review↔announced↔closed).
|
|
@@ -262,7 +314,7 @@ export const ACTION_CATALOG = {
|
|
|
262
314
|
desc: "Tenant customization/content was published to a version.",
|
|
263
315
|
},
|
|
264
316
|
"content.checkout_style.saved": {
|
|
265
|
-
// NEW
|
|
317
|
+
// NEW: a tenant's checkout styling was saved to a versioned test artifact
|
|
266
318
|
// (Settings → Checkout styling → publishToTest spine). A persistent tenant
|
|
267
319
|
// customization — low volume, high value → timelined. Actor cohort mirrors the
|
|
268
320
|
// route's own auth (resolveOwnerSession): a merchant saving their own tenant, or
|
|
@@ -272,7 +324,7 @@ export const ACTION_CATALOG = {
|
|
|
272
324
|
desc: "A tenant's checkout styling was saved to a version.",
|
|
273
325
|
},
|
|
274
326
|
"change.go_live": {
|
|
275
|
-
//
|
|
327
|
+
// Renamed from the orphaned, un-namespaced `go_live` (the ONE key that broke the
|
|
276
328
|
// domain-prefix rule). The snake_case suffix is kept (the `deploy.version_observed`
|
|
277
329
|
// precedent) — only the missing `change.` domain prefix is added. Wired into
|
|
278
330
|
// /api/preview/promote (promote the current preview snapshot to live).
|
|
@@ -285,9 +337,9 @@ export const ACTION_CATALOG = {
|
|
|
285
337
|
// Invitee identity is PII → DROPPED by allowlist; only the role/resource +
|
|
286
338
|
// an opaque hashed invitee ref (rendered) survive.
|
|
287
339
|
"grant.invite": {
|
|
288
|
-
//
|
|
340
|
+
// The self-serve "Invite a Developer" handler admits an owner (merchant) or
|
|
289
341
|
// staff (admin) session, and the headless operator (agent) via the Bearer seam.
|
|
290
|
-
//
|
|
342
|
+
// The SECOND invite path (grants/team-invite.ts) is session-authed by vendor
|
|
291
343
|
// MEMBERSHIP — a signed-in team member who is neither owner nor staff classifies as
|
|
292
344
|
// "dev" (see uiActor.classifyActorKind), so `dev` joins the admission set.
|
|
293
345
|
actors: ["admin", "merchant", "dev", "agent"], source: "ui", sinks: LIFECYCLE,
|
|
@@ -295,14 +347,14 @@ export const ACTION_CATALOG = {
|
|
|
295
347
|
desc: "A developer/team invite was issued.",
|
|
296
348
|
},
|
|
297
349
|
"grant.approve": {
|
|
298
|
-
//
|
|
350
|
+
// The browserless CLI sign-in approval is taken by whoever is signed in
|
|
299
351
|
// (owner→merchant, staff→admin, or a signed-in developer→dev).
|
|
300
352
|
actors: ["admin", "merchant", "dev"], source: "ui", sinks: LIFECYCLE,
|
|
301
353
|
argsAllow: ["role", "resource"], renderedAllow: [],
|
|
302
354
|
desc: "A pending access request / CLI sign-in was approved.",
|
|
303
355
|
},
|
|
304
356
|
"grant.revoke": {
|
|
305
|
-
//
|
|
357
|
+
// The self-serve "remove a developer from my team" handler (/api/grants/revoke),
|
|
306
358
|
// the inverse of grant.invite — same resolveOwnerSession seam, so the same cohort
|
|
307
359
|
// (owner→merchant, staff→admin, headless operator→agent). The revoked developer's
|
|
308
360
|
// identity is PII → DROPPED by the allowlist; only an opaque hashed ref survives.
|
|
@@ -320,10 +372,14 @@ export const ACTION_CATALOG = {
|
|
|
320
372
|
argsAllow: ["changeId"], renderedAllow: ["inviteeRef"],
|
|
321
373
|
desc: "A reviewer/developer was invited to a preview.",
|
|
322
374
|
},
|
|
323
|
-
"preview.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
375
|
+
"preview.evidence.retry": {
|
|
376
|
+
// An operator retried the change_report_evidence push for an already-`ready`
|
|
377
|
+
// candidate whose evidence.pushFailed was set (candidate-evidence-retry.ts) —
|
|
378
|
+
// the manual recovery for fb-1787938036559-ppmu4e when the automatic retry in
|
|
379
|
+
// reportPreviewEvidence still didn't land.
|
|
380
|
+
actors: ["admin", "merchant", "dev", "system"], source: "server", sinks: LIFECYCLE,
|
|
381
|
+
argsAllow: ["changeId", "versionId", "pushed"], renderedAllow: [],
|
|
382
|
+
desc: "An operator retried a candidate's evidence push to MCP after it failed.",
|
|
327
383
|
},
|
|
328
384
|
"store.connect": {
|
|
329
385
|
actors: ["merchant", "admin"], source: "ui", sinks: LIFECYCLE,
|
|
@@ -377,8 +433,8 @@ export const ACTION_CATALOG = {
|
|
|
377
433
|
|
|
378
434
|
// ── Agent cohort (source: server/cli) — later ──────────────────────────────
|
|
379
435
|
// Placeholder spine so the agent cohort (a later card) has stable keys to emit
|
|
380
|
-
// against without reopening
|
|
381
|
-
// defines what an agent action is allowed to record.
|
|
436
|
+
// against without reopening the action catalog. Args are deliberately empty until
|
|
437
|
+
// that card defines what an agent action is allowed to record.
|
|
382
438
|
"agent.action.invoked": {
|
|
383
439
|
actors: ["agent"], source: "server", sinks: HIGH_VOLUME,
|
|
384
440
|
argsAllow: ["tool"], renderedAllow: [],
|
|
@@ -390,9 +446,9 @@ export const ACTION_CATALOG = {
|
|
|
390
446
|
desc: "An automated agent action finished.",
|
|
391
447
|
},
|
|
392
448
|
|
|
393
|
-
// ──
|
|
394
|
-
//
|
|
395
|
-
// and machine-authed (signature/idempotency/app-JWT) mutations
|
|
449
|
+
// ── Remaining grant/staff-ops gaps + machine/agent-driven mutations ─────
|
|
450
|
+
// Wires the invite/grant paths, staff-impersonation, cache,
|
|
451
|
+
// and machine-authed (signature/idempotency/app-JWT) mutations the earlier catalog entries left out.
|
|
396
452
|
// Grant/staff actions are low-volume lifecycle → timelined; the machine cohort's
|
|
397
453
|
// high-volume streams (order-forward, attribution) are analytics-only.
|
|
398
454
|
"grant.issue": {
|
|
@@ -433,7 +489,7 @@ export const ACTION_CATALOG = {
|
|
|
433
489
|
},
|
|
434
490
|
"store.connect.completed": {
|
|
435
491
|
// domain/callback.ts — the CI completion callback for the www-domain job, the
|
|
436
|
-
// machine-side terminal PARTNER of
|
|
492
|
+
// machine-side terminal PARTNER of `store.connect`. Signature-authed, one per
|
|
437
493
|
// connect run (rare) → low-volume lifecycle terminal, timelined like reconcile.terminal.
|
|
438
494
|
actors: ["system"], source: "server", sinks: LIFECYCLE,
|
|
439
495
|
argsAllow: ["status", "state", "action"], renderedAllow: [],
|
|
@@ -469,7 +525,7 @@ export const ACTION_CATALOG = {
|
|
|
469
525
|
|
|
470
526
|
// ── Meta (source: server) ──────────────────────────────────────────────────
|
|
471
527
|
"system.ingest.rejected": {
|
|
472
|
-
// The ingest endpoint
|
|
528
|
+
// The ingest endpoint rejected an event (unknown action, actor
|
|
473
529
|
// mismatch, canary tripped). Self-telemetry so a leak attempt is visible.
|
|
474
530
|
actors: ["system"], source: "server", sinks: HIGH_VOLUME,
|
|
475
531
|
argsAllow: ["reason", "attemptedAction"], renderedAllow: [],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
-
// ActivityEvent — the versioned actor×action telemetry envelope
|
|
2
|
+
// ActivityEvent — the versioned actor×action telemetry envelope.
|
|
3
3
|
//
|
|
4
4
|
// One event = "an ACTOR performed an ACTION, here is the OUTCOME." It is the
|
|
5
5
|
// single shape every operational-activity emitter produces and every sink
|
|
6
6
|
// stores, across the whole storefront platform (dev/CLI first, then merchant/
|
|
7
|
-
// admin/agent). Downstream
|
|
8
|
-
//
|
|
9
|
-
//
|
|
7
|
+
// admin/agent). Downstream consumers import this directly: server
|
|
8
|
+
// recordActivity() · deploy provenance · CLI emitActivity · ingest+store ·
|
|
9
|
+
// the query/timeline UI · alerts.
|
|
10
10
|
//
|
|
11
11
|
// TWO ZONES, and the split is load-bearing:
|
|
12
12
|
// 1. CORE fields (everything except `payload`) — always safe to store. They
|
|
@@ -86,9 +86,9 @@ export interface ActivityScope {
|
|
|
86
86
|
*/
|
|
87
87
|
traceId?: string;
|
|
88
88
|
/**
|
|
89
|
-
* BUILD PROVENANCE
|
|
89
|
+
* BUILD PROVENANCE. The git commit SHA the running server/edge build
|
|
90
90
|
* was cut from — stamped by the emitter onto every SERVER-sourced event so the
|
|
91
|
-
* query surface
|
|
91
|
+
* query surface can derive **deploy skew**: is the build that produced this
|
|
92
92
|
* event == the pushed umbrella tip, or is a stale worker still serving? Core,
|
|
93
93
|
* non-secret by construction (a 40-hex git sha, never PII/free-text), so it is
|
|
94
94
|
* never redacted. Absent on `cli`/`ui`-sourced events and on any build with no
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
2
|
// @tot/public-runtime/activity — the operational activity telemetry contract.
|
|
3
3
|
//
|
|
4
|
-
//
|
|
4
|
+
// The actor×action ActivityEvent envelope, the allowlisted action
|
|
5
5
|
// catalog, and the default-deny redaction contract. This is the FOUNDATION the
|
|
6
6
|
// downstream cards import directly — nothing here does I/O or picks a store; it
|
|
7
7
|
// is pure types + pure functions so server, edge, and the CLI's JS mirror can
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// DECISIONS.md §8; the per-action routing lives on each catalog entry (sinks).
|
|
10
10
|
//
|
|
11
11
|
// See ./README.md for the envelope shape, catalog rules, redaction contract,
|
|
12
|
-
// and the CLI-mirror keep-in-step obligation
|
|
12
|
+
// and the CLI-mirror keep-in-step obligation.
|
|
13
13
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
14
14
|
export * from "./event.js";
|
|
15
15
|
export * from "./catalog.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
-
// Redaction contract for the activity payload zone
|
|
2
|
+
// Redaction contract for the activity payload zone.
|
|
3
3
|
//
|
|
4
|
-
// This is the surface
|
|
4
|
+
// This is the surface the adversarial PII/secret-leak review will attack,
|
|
5
5
|
// so the posture is deliberately conservative. Three layers, in order:
|
|
6
6
|
//
|
|
7
7
|
// 1. DEFAULT-DENY ALLOWLIST. For a given action, ONLY the top-level payload
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
// shapes (JWTs, bearer tokens, API keys, private keys, emails, card/phone
|
|
21
21
|
// numbers) AND secret-looking KEY NAMES. A hit replaces the value with a
|
|
22
22
|
// redaction marker and is REPORTED (the fact of the hit, never the value) so
|
|
23
|
-
//
|
|
23
|
+
// alerting can flag it and auditing can review it. A secret-named key is dropped outright.
|
|
24
24
|
//
|
|
25
25
|
// The safe constructor createActivityEvent() runs all three before an event is
|
|
26
26
|
// ever returned — you cannot build an event whose payload skipped redaction.
|
|
27
27
|
//
|
|
28
|
-
// OPEN QUESTION
|
|
28
|
+
// OPEN QUESTION: the canonical actor-id pseudonymization salt.
|
|
29
29
|
// This module scrubs PII that leaks into the PAYLOAD, but actor.id in the CORE
|
|
30
30
|
// zone is the emitter's responsibility to pseudonymize. A shared, salted,
|
|
31
31
|
// non-reversible hash helper (with the salt as a Worker secret) should land with
|
|
@@ -52,6 +52,38 @@ export interface ReviewEnvironmentEvidence {
|
|
|
52
52
|
/** Derived upstream: every `REQUIRED_FOR_PROMOTE` check is `pass`. */
|
|
53
53
|
promotable: boolean;
|
|
54
54
|
generatedAt: string;
|
|
55
|
+
/**
|
|
56
|
+
* True when this verdict was computed locally but the `change_report_evidence`
|
|
57
|
+
* push to MCP did NOT land (even after retry) — MCP has no evidence (or a stale
|
|
58
|
+
* one) for this commit, so `preview_status`/`change_ready` can disagree with
|
|
59
|
+
* `promotable` above (fb-1787938036559-ppmu4e). Absent/false ⇒ the push
|
|
60
|
+
* succeeded, this verdict is the same one MCP is serving. A UI/CLI should
|
|
61
|
+
* treat `true` as "evidence missing upstream — offer a retry", not as a
|
|
62
|
+
* failed verdict.
|
|
63
|
+
*/
|
|
64
|
+
pushFailed?: boolean;
|
|
65
|
+
/** The push failure's error message, when `pushFailed` is true. */
|
|
66
|
+
pushError?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Durable, reviewer-facing progress for one bounded candidate reconcile. */
|
|
70
|
+
export interface CandidateReconcileLifecycle {
|
|
71
|
+
phase:
|
|
72
|
+
| "queued"
|
|
73
|
+
| "archive-requested"
|
|
74
|
+
| "archive-downloading"
|
|
75
|
+
| "archive-validating"
|
|
76
|
+
| "archive-ingesting"
|
|
77
|
+
| "evidence-reporting"
|
|
78
|
+
| "ready"
|
|
79
|
+
| "blocked";
|
|
80
|
+
correlationId: string;
|
|
81
|
+
startedAt: string;
|
|
82
|
+
lastUpdatedAt: string;
|
|
83
|
+
elapsedMs: number;
|
|
84
|
+
bytes?: number;
|
|
85
|
+
files?: number;
|
|
86
|
+
terminalError?: { code: string; message: string; correlationId: string; elapsedMs: number } | null;
|
|
55
87
|
}
|
|
56
88
|
|
|
57
89
|
/**
|
|
@@ -110,11 +142,13 @@ export interface ReviewEnvironment {
|
|
|
110
142
|
* dead/unregistered webhook shows as "queued since <submittedAt>, never
|
|
111
143
|
* picked up" instead of no record at all). Additive + optional: every OTHER
|
|
112
144
|
* writer of this projection (`reconcileCandidate`, `acceptCandidateAtomic`,
|
|
113
|
-
*
|
|
145
|
+
* terminal cleanup) simply carries it forward unset/
|
|
114
146
|
* untouched — only the submit-ack path ever sets it. Deliberately distinct
|
|
115
147
|
* from `updatedAt`, which every writer bumps on any recompute for any reason.
|
|
116
148
|
*/
|
|
117
149
|
submittedAt?: string;
|
|
150
|
+
/** Bounded reconcile progress and terminal reason, if this candidate has run. */
|
|
151
|
+
reconcileLifecycle?: CandidateReconcileLifecycle;
|
|
118
152
|
}
|
|
119
153
|
|
|
120
154
|
/** KV key for one tenant-change `ReviewEnvironment` projection. */
|
|
@@ -136,10 +170,10 @@ export interface CandidateKv {
|
|
|
136
170
|
}
|
|
137
171
|
|
|
138
172
|
/**
|
|
139
|
-
* A {@link CandidateKv} that can also DELETE a key — the
|
|
140
|
-
*
|
|
173
|
+
* A {@link CandidateKv} that can also DELETE a key — the terminal candidate
|
|
174
|
+
* cleanup surface. Kept separate from `CandidateKv` so the many
|
|
141
175
|
* write-only `{ get, put }` adapters (the webhook reconcile, build-on-demand,
|
|
142
|
-
* accept) are unaffected: only
|
|
176
|
+
* accept) are unaffected: only terminal cleanup constructs a delete-capable
|
|
143
177
|
* adapter. A real Cloudflare KV namespace satisfies this structurally.
|
|
144
178
|
*/
|
|
145
179
|
export interface CandidateKvDeletable extends CandidateKv {
|
|
@@ -266,17 +300,17 @@ export async function writeReviewEnvironment(
|
|
|
266
300
|
|
|
267
301
|
/**
|
|
268
302
|
* Evict one `ReviewEnvironment` record AND remove its `changeId` from the tenant
|
|
269
|
-
* index
|
|
303
|
+
* index. The per-record key is deleted
|
|
270
304
|
* outright; the tenant index is updated by the SAME serialized read-modify-write
|
|
271
|
-
* `writeReviewEnvironment` uses (see {@link serializeIndexWrite}), so a
|
|
305
|
+
* `writeReviewEnvironment` uses (see {@link serializeIndexWrite}), so a deletion that
|
|
272
306
|
* races a concurrent write for a DIFFERENT candidate never resurrects a dropped
|
|
273
307
|
* entry or leaves a dangling index id (the corruption risk this helper exists to
|
|
274
308
|
* prevent — the mirror-image of `writeReviewEnvironment`'s append).
|
|
275
309
|
*
|
|
276
310
|
* IDEMPOTENT by contract: deleting an already-absent candidate is a clean no-op.
|
|
277
311
|
* Returns whether anything was actually removed (`true` iff the record existed OR
|
|
278
|
-
* the index carried the id), so the caller can report
|
|
279
|
-
* repeat
|
|
312
|
+
* the index carried the id), so the caller can report cleanup honestly while a
|
|
313
|
+
* repeat deletion still succeeds.
|
|
280
314
|
*/
|
|
281
315
|
export async function deleteReviewEnvironment(
|
|
282
316
|
kv: CandidateKvDeletable,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* D1 (edge SQLite) catalog read-model — schema + row projections (the one-store
|
|
3
|
-
* target
|
|
3
|
+
* target). The storefront reads search, faceted
|
|
4
4
|
* listing, and full products from D1; the ETL emits the rows. This is the shared
|
|
5
5
|
* contract both sides agree on.
|
|
6
6
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Order READ DTO — the FROZEN v1 contract shape the storefront consumes from
|
|
3
|
-
* the checkout order API's `GET /commerce/orders[/:orderId]` (card 8585
|
|
3
|
+
* the checkout order API's `GET /commerce/orders[/:orderId]` (card 8585). Kept in
|
|
4
4
|
* `@tot/public-runtime` (types only, no secrets, edge-safe) so the server-side
|
|
5
|
-
* order client
|
|
5
|
+
* order client, the Orders admin route, and the view-model mapping
|
|
6
6
|
* all code against one source of truth.
|
|
7
7
|
*
|
|
8
8
|
* Authoritative API shape lives with the checkout order service; this file
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* HMAC-SHA256 of `JSON.stringify(body)` keyed by the STORE'S ToT SECRET KEY —
|
|
11
11
|
* byte-identical to the commerce service's webhook-signature verifier. That
|
|
12
12
|
* secret is the storefront's `TOT_SECRET_KEY`; this is independent of the
|
|
13
|
-
* provider API credentials
|
|
13
|
+
* provider API credentials.
|
|
14
14
|
*
|
|
15
15
|
* Edge-safe + node-free (WebCrypto HMAC); the network call is injected so the
|
|
16
16
|
* flow is fully unit-testable offline. The caller (the checkout-styling promote
|
|
@@ -190,7 +190,7 @@ export async function publishCheckoutTheme(
|
|
|
190
190
|
/**
|
|
191
191
|
* Convenience: the env → checkout service base URL for this workstream's targets.
|
|
192
192
|
* qa/test use the non-prod proxy; live uses the prod proxy. Kept here so the
|
|
193
|
-
* promote hook
|
|
193
|
+
* promote hook resolves one place.
|
|
194
194
|
*/
|
|
195
195
|
export function checkoutServiceBaseUrl(env: CustomizationEnv): string {
|
|
196
196
|
// "test" is the qa target's env; "live" is prod.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Checkout-styling data model + published-artifact read plumbing.
|
|
3
3
|
*
|
|
4
4
|
* The hosted checkout is styled by CSS pushed through the commerce service's theme
|
|
5
|
-
* endpoint
|
|
5
|
+
* endpoint. This module owns the *source of truth* for that styling: a
|
|
6
6
|
* small, structured, tenant-editable descriptor that later units render into
|
|
7
7
|
* ASCII-safe CSS. It sits on the SAME versioned publish spine as theme/content
|
|
8
8
|
* (D1VersionStore + KV pointers) — resolution is per-environment via
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* Two colocated artifacts under `tenants/<id>/`:
|
|
13
13
|
* - `checkout-style.json` — the structured `CheckoutStyle` descriptor (below).
|
|
14
14
|
* - `checkout.css` — an optional raw-CSS escape hatch a merchant edits
|
|
15
|
-
* directly; hosted + pushed to checkout as-is
|
|
15
|
+
* directly; hosted + pushed to checkout as-is.
|
|
16
16
|
*
|
|
17
17
|
* Pure + dependency-free (node-free, edge-safe): the caller injects the same
|
|
18
18
|
* `KvGet` used for theme/content, keeping this unit-testable and storage-agnostic.
|
|
19
|
-
* No UI here — that
|
|
19
|
+
* No UI here — that lives elsewhere.
|
|
20
20
|
*/
|
|
21
21
|
import type { CustomizationEnv } from "./customization-preview.js";
|
|
22
22
|
import type { DeepPartial, ThemeTokens } from "./tenant.js";
|
|
@@ -64,7 +64,7 @@ export interface CheckoutStyleButton {
|
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* The structured checkout-styling descriptor — the `checkout-style.json`
|
|
67
|
-
* artifact. This is the model a merchant edits
|
|
67
|
+
* artifact. This is the model a merchant edits and the renderer turns into
|
|
68
68
|
* the CSS pushed to checkout. A published artifact is a `DeepPartial` of this
|
|
69
69
|
* (a merchant may set one field without restating the rest); `resolveCheckout
|
|
70
70
|
* Style` merges it over `DEFAULT_CHECKOUT_STYLE` so the resolved value is always
|
|
@@ -105,7 +105,7 @@ export const DEFAULT_CHECKOUT_STYLE: CheckoutStyle = {
|
|
|
105
105
|
* Derive a checkout style FROM a tenant's brand `ThemeTokens`, so the checkout is
|
|
106
106
|
* consistent with the look/feel the merchant already chose for the storefront
|
|
107
107
|
* instead of a neutral default. This is the "from theme" seam: the settings editor
|
|
108
|
-
*
|
|
108
|
+
* seeds a merchant's starting style from it, and a tenant that ships a brand
|
|
109
109
|
* theme gets an in-brand checkout with no hand-authoring.
|
|
110
110
|
*
|
|
111
111
|
* It maps the small, opinionated checkout surface onto the full theme palette:
|
|
@@ -289,13 +289,13 @@ export async function resolveCheckoutStyleCss(
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
// ---------------------------------------------------------------------------
|
|
292
|
-
// CSS serialization (the artifact pushed to checkout)
|
|
292
|
+
// CSS serialization (the artifact pushed to checkout)
|
|
293
293
|
// ---------------------------------------------------------------------------
|
|
294
294
|
|
|
295
295
|
/**
|
|
296
296
|
* True iff every character is 7-bit ASCII (code point < 128). The checkout
|
|
297
297
|
* template cache pass is NOT Unicode-safe — a non-ASCII byte in the cached
|
|
298
|
-
* checkout content yields a BLANK page. So the publisher
|
|
298
|
+
* checkout content yields a BLANK page. So the publisher MUST gate both
|
|
299
299
|
* the generated token CSS and any raw override through this before pushing a
|
|
300
300
|
* `content_url` to `/theme/foxy`. We reject rather than transliterate, so a
|
|
301
301
|
* merchant is told to fix their input instead of getting silently-mangled CSS.
|
|
@@ -97,7 +97,7 @@ export interface BuildVariantCartPayloadOptions {
|
|
|
97
97
|
secret?: string;
|
|
98
98
|
purchaseOption?: ProductPurchaseOption;
|
|
99
99
|
/**
|
|
100
|
-
* The member-adjusted EFFECTIVE price to sign
|
|
100
|
+
* The member-adjusted EFFECTIVE price to sign, computed server-side via
|
|
101
101
|
* membership.ts `priceForPurchaseOption` for the shopper's resolved eligibility.
|
|
102
102
|
* When set it REPLACES the list/subscription price as the single signed source
|
|
103
103
|
* of truth, so a given price is only ever valid for the member context it was
|
|
@@ -189,7 +189,7 @@ export function cartFieldsForVariant(
|
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* Validate a caller-supplied EFFECTIVE price before it becomes the signed source
|
|
192
|
-
* of truth
|
|
192
|
+
* of truth. The member-adjusted price (membership.ts
|
|
193
193
|
* `priceForPurchaseOption`) is computed server-side and threaded in so the SIGNED
|
|
194
194
|
* price reflects the shopper's resolved eligibility. It must be a finite,
|
|
195
195
|
* non-negative amount no greater than the list price — an effective price is
|
|
@@ -325,7 +325,7 @@ export async function buildVariantCartPayload(
|
|
|
325
325
|
variant: CatalogVariant,
|
|
326
326
|
opts: BuildVariantCartPayloadOptions,
|
|
327
327
|
): Promise<VariantCartPayload> {
|
|
328
|
-
// Hide-at-launch guard
|
|
328
|
+
// Hide-at-launch guard: refuse to SIGN a subscription option while
|
|
329
329
|
// Autopilot is disabled. `visiblePurchaseOptions` removes subscription options
|
|
330
330
|
// for such tenants, so one reaching the signer means the visibility filter was
|
|
331
331
|
// bypassed (e.g. a crafted request) — signing it would mint a valid subscription
|