@tokenoftrust/storefront-runner 1.4.2-rc.0 → 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 +3 -3
- package/apps/storefront/env.d.ts +54 -5
- package/apps/storefront/integrations/materialize-guard.mjs +12 -14
- 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/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 +42 -0
- package/apps/storefront/public/apps/tot.demo.analytics/0.1.0/entry.js +42 -0
- 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/admin/AdminBlogTab.astro +19 -16
- package/apps/storefront/src/components/admin/AdminIntegrationsTab.astro +105 -0
- package/apps/storefront/src/components/admin/AdminPublishTab.astro +1057 -412
- package/apps/storefront/src/components/admin/AdminSettingsTab.astro +2 -2
- package/apps/storefront/src/components/admin/orders/OrdersWorkspace.astro +5 -5
- 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 +100 -20
- package/apps/storefront/src/lib/activity/candidateSubmitLease.ts +87 -0
- package/apps/storefront/src/lib/activity/changeActorAttribution.ts +86 -6
- package/apps/storefront/src/lib/activity/deployVersion.ts +1 -1
- package/apps/storefront/src/lib/admin/adminShell.ts +2 -0
- package/apps/storefront/src/lib/admin/envelope.ts +1 -2
- package/apps/storefront/src/lib/apps/adminService.ts +10 -0
- package/apps/storefront/src/lib/apps/adminSession.ts +1 -1
- package/apps/storefront/src/lib/apps/appVersionStore.ts +281 -0
- package/apps/storefront/src/lib/apps/consentConfigStore.ts +228 -0
- 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/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/orderConversionD1.ts +150 -0
- package/apps/storefront/src/lib/apps/orders/orderForwardReceiver.ts +8 -0
- package/apps/storefront/src/lib/apps/orders/ordersStore.ts +1 -1
- package/apps/storefront/src/lib/apps/orders/verifiedProviderMeasurement.ts +117 -0
- package/apps/storefront/src/lib/apps/registryService.ts +264 -10
- package/apps/storefront/src/lib/apps/tenantIntegrationMaterialization.ts +170 -0
- 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/ws1ManagedAnalyticsClient.ts +95 -0
- package/apps/storefront/src/lib/auth/adminApiGuard.ts +66 -0
- package/apps/storefront/src/lib/auth/adminEntry.ts +2 -2
- package/apps/storefront/src/lib/auth/adminLanding.ts +88 -0
- package/apps/storefront/src/lib/blog/collection.ts +97 -10
- package/apps/storefront/src/lib/blog/markdown.ts +1 -1
- package/apps/storefront/src/lib/blog/provider.ts +57 -3
- package/apps/storefront/src/lib/blog/types.ts +9 -9
- 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 +12 -0
- package/apps/storefront/src/lib/d1/schema-apps.ts +276 -0
- 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/runtimeStore.ts +1 -1
- package/apps/storefront/src/lib/edgeCache.ts +18 -6
- package/apps/storefront/src/lib/email/candidateConflictEmail.ts +80 -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/membership/eligibility.ts +1 -1
- package/apps/storefront/src/lib/membership/model.ts +1 -2
- package/apps/storefront/src/lib/newsletter/confirmationEmail.ts +2 -2
- package/apps/storefront/src/lib/newsletter/consent.ts +2 -2
- package/apps/storefront/src/lib/newsletter/send.ts +3 -3
- package/apps/storefront/src/lib/previewReload.ts +57 -1
- package/apps/storefront/src/lib/publish/adminPublishTab.ts +1775 -669
- 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/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/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 +22 -3
- package/apps/storefront/src/lib/publish/sseRoute.ts +119 -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/rawChrome.ts +125 -47
- package/apps/storefront/src/lib/rawMarketingHtml.ts +74 -3
- package/apps/storefront/src/lib/seo/alternates.ts +1 -1
- package/apps/storefront/src/lib/social/notify.ts +4 -4
- 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 +9 -4
- package/apps/storefront/src/middleware/index.ts +273 -51
- 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 +16 -2
- 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/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/rum/vitals.ts +1 -2
- package/apps/storefront/src/pages/blog/[slug].astro +5 -5
- package/apps/storefront/src/pages/blog/author/[author].astro +3 -3
- package/apps/storefront/src/pages/blog/category/[category].astro +2 -2
- package/apps/storefront/src/pages/blog/index.astro +2 -2
- package/apps/storefront/src/pages/blog/tag/[tag].astro +2 -2
- package/apps/storefront/src/pages/cockpit.astro +61 -1362
- 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/sitemap.xml.ts +2 -2
- 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 +4 -4
- package/apps/storefront/src/pages/the-build/index.astro +2 -2
- package/apps/storefront/src/pages/the-build/rss.xml.ts +2 -2
- package/apps/storefront/src/styles/admin.css +27 -1
- package/apps/storefront/tsconfig.json +1 -1
- package/package.json +1 -1
- package/packages/public-runtime/package.json +2 -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 +41 -37
- 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/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-runtime.ts +32 -1
- 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 +16 -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 +5 -5
- package/packages/public-runtime/src/tenant-assets.ts +143 -4
- package/packages/public-runtime/src/tenant.ts +45 -9
- 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/dev/file-browser.mjs +2 -2
- package/scripts/dev/file-writer.mjs +2 -2
- package/scripts/dev/integration-guardrails.mjs +498 -0
- package/scripts/dev/safe-path.mjs +2 -2
- package/scripts/dev/tenant-source-root.mjs +1 -1
- package/scripts/tot-dev.mjs +2 -2
|
@@ -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,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
|