@tokenoftrust/storefront-runner 2.4.88 → 2.4.90
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 +2 -2
- package/apps/storefront/drizzle.config.apps.ts +1 -1
- package/apps/storefront/env.d.ts +1 -1
- package/apps/storefront/migrations/README.md +5 -5
- package/apps/storefront/perf/README.md +6 -6
- package/apps/storefront/perf/assert-budgets.ts +2 -2
- package/apps/storefront/src/components/catalog/storefront/CollectionCard.astro +1 -1
- package/apps/storefront/src/components/catalog/storefront/ProductCard.astro +1 -1
- package/apps/storefront/src/components/catalog/storefront/commerce/BrandGrid.astro +1 -1
- package/apps/storefront/src/components/catalog/storefront/commerce/TagFilterCloud.astro +1 -1
- package/apps/storefront/src/components/catalog/storefront/islands/QuickView.tsx +1 -1
- package/apps/storefront/src/components/catalog/storefront/islands/RecentlyViewed.tsx +1 -1
- package/apps/storefront/src/components/catalog/storefront/islands/SearchTypeahead.tsx +1 -1
- package/apps/storefront/src/components/catalog/storefront/plp/ActiveFilters.astro +2 -2
- package/apps/storefront/src/components/catalog/storefront/plp/FacetSidebar.astro +2 -2
- package/apps/storefront/src/components/catalog/storefront/plp/Pagination.astro +1 -1
- package/apps/storefront/src/components/content/storefront/Breadcrumbs.astro +1 -1
- package/apps/storefront/src/components/content/storefront/EmptyState.astro +1 -1
- package/apps/storefront/src/components/content/storefront/blog/BlogPaywall.astro +1 -1
- package/apps/storefront/src/components/content/storefront/blog/ReactionBar.astro +2 -2
- package/apps/storefront/src/components/content/storefront/chrome/NavDropdown.astro +1 -1
- package/apps/storefront/src/components/content/storefront/chrome/SiteFooter.astro +1 -1
- package/apps/storefront/src/components/content/storefront/chrome/SiteHeader.astro +1 -1
- package/apps/storefront/src/components/content/storefront/chrome/UtilityNav.astro +1 -1
- package/apps/storefront/src/components/content/storefront/commerce/ArticleCard.astro +1 -1
- package/apps/storefront/src/components/content/storefront/home/Hero.astro +1 -1
- package/apps/storefront/src/components/content/storefront/marketing/CardGrid.astro +1 -1
- package/apps/storefront/src/components/content/storefront/marketing/Integrations.astro +1 -1
- package/apps/storefront/src/components/content/storefront/marketing/MarketingCtas.astro +1 -1
- package/apps/storefront/src/components/customers/storefront/islands/SavedList.tsx +1 -1
- package/apps/storefront/src/config/adminTargetTenant.ts +1 -1
- package/apps/storefront/src/config/devTenants.ts +1 -1
- package/apps/storefront/src/config/resolver.ts +2 -2
- package/apps/storefront/src/layouts/Layout.astro +5 -5
- package/apps/storefront/src/lib/{admin → access/admin}/README.md +3 -3
- package/apps/storefront/src/lib/{admin → access/admin}/adminShell.ts +1 -1
- package/apps/storefront/src/lib/{admin → access/admin}/envelope.ts +2 -2
- package/apps/storefront/src/lib/{admin → access/admin}/viewmodels/settings.ts +2 -2
- package/apps/storefront/src/lib/{auth → access/auth}/adminApiGuard.ts +2 -2
- package/apps/storefront/src/lib/{auth → access/auth}/adminEntry.ts +3 -3
- package/apps/storefront/src/lib/{auth → access/auth}/adminLanding.ts +1 -1
- package/apps/storefront/src/lib/{auth → access/auth}/brokerAssertion.ts +1 -1
- package/apps/storefront/src/lib/{auth → access/auth}/devAuth.ts +1 -1
- package/apps/storefront/src/lib/{auth → access/auth}/identityToken.ts +2 -2
- package/apps/storefront/src/lib/{auth → access/auth}/loginGate.ts +2 -2
- package/apps/storefront/src/lib/{auth → access/auth}/mcpClientAssertion.ts +1 -1
- package/apps/storefront/src/lib/{auth → access/auth}/route.ts +1 -1
- package/apps/storefront/src/lib/{auth → access/auth}/totAccessClient.ts +5 -5
- package/apps/storefront/src/lib/{dashboard → access/dashboard}/delegateGate.ts +3 -3
- package/apps/storefront/src/lib/{dashboard → access/dashboard}/staffAdmission.ts +1 -1
- package/apps/storefront/src/lib/{dashboard → access/dashboard}/staffVendorAccess.ts +1 -1
- package/apps/storefront/src/lib/{dashboard → access/dashboard}/tenantSelection.ts +1 -1
- package/apps/storefront/src/lib/{admin/services/mock → access/fixtures}/settings.ts +4 -4
- package/apps/storefront/src/lib/{shared → access/shared}/accessExplain.ts +1 -1
- package/apps/storefront/src/lib/{adminTenantEnvelope.ts → access/shared/adminTenantEnvelope.ts} +3 -3
- package/apps/storefront/src/lib/{shared → access/shared}/developerInvites.ts +5 -5
- package/apps/storefront/src/lib/{shared → access/shared}/invitePreflight.ts +1 -1
- package/apps/storefront/src/lib/{shared → access/shared}/principalGrants.ts +3 -3
- package/apps/storefront/src/lib/{tenantRouting.ts → access/shared/tenantRouting.ts} +1 -1
- package/apps/storefront/src/lib/{shared → access/shared}/viewerGrant.ts +1 -1
- package/apps/storefront/src/lib/activity/fixtures/evidence.ts +2 -2
- package/apps/storefront/src/lib/activity/killSwitch.ts +1 -1
- package/apps/storefront/src/lib/activity/uiActor.ts +5 -5
- package/apps/storefront/src/lib/activity/workerCommit.ts +1 -1
- package/apps/storefront/src/lib/admin/services/mock/index.ts +4 -4
- package/apps/storefront/src/lib/assets/durableR2Bindings.ts +1 -1
- package/apps/storefront/src/lib/{admin → automation/admin}/viewmodels/aiWorkflows.ts +3 -3
- package/apps/storefront/src/lib/{admin → automation}/ai/askEnvelope.ts +1 -1
- package/apps/storefront/src/lib/{admin → automation}/ai/operationalRuns.ts +4 -4
- package/apps/storefront/src/lib/{admin/services/mock → automation/fixtures}/aiWorkflows.ts +4 -4
- package/apps/storefront/src/lib/catalog/fixtures/products.ts +4 -4
- package/apps/storefront/src/lib/checkout/admin/checkoutStyleTarget.ts +2 -2
- package/apps/storefront/src/lib/checkout/commerce/checkoutHandoffCorrelation.ts +1 -1
- package/apps/storefront/src/lib/checkout/fixtures/checkoutSettings.ts +1 -1
- package/apps/storefront/src/lib/checkout/shared/checkoutCommerce.ts +1 -1
- package/apps/storefront/src/lib/compliance/browser/checkoutVerificationFlow.ts +1 -1
- package/apps/storefront/src/lib/compliance/enforcement.ts +1 -1
- package/apps/storefront/src/lib/compliance/tamper-sentinel-boot.ts +1 -1
- package/apps/storefront/src/lib/compliance/verification/totVerificationClient.ts +2 -2
- package/apps/storefront/src/lib/content/blog/access.ts +1 -1
- package/apps/storefront/src/lib/content/blog/collection.ts +1 -1
- package/apps/storefront/src/lib/content/blog/postView.ts +2 -2
- package/apps/storefront/src/lib/content/blog/provider.ts +1 -1
- package/apps/storefront/src/lib/content/shared/heroSlideshow.ts +1 -1
- package/apps/storefront/src/lib/content/shared/homeVisualParity.ts +1 -1
- package/apps/storefront/src/lib/content/shared/rawMarketingHtml.ts +1 -1
- package/apps/storefront/src/lib/content/storyblok/provider.ts +1 -1
- package/apps/storefront/src/lib/customers/fixtures/customers.ts +3 -3
- package/apps/storefront/src/lib/{admin → developer-experience/admin}/memoizeByEnvelope.ts +1 -1
- package/apps/storefront/src/lib/{dev → developer-experience/dev}/activityIngestToken.ts +2 -2
- package/apps/storefront/src/lib/{dev → developer-experience/dev}/cliSignInCode.ts +4 -4
- package/apps/storefront/src/lib/{dev → developer-experience/dev}/livePreview.ts +1 -1
- package/apps/storefront/src/lib/{dev → developer-experience/dev}/previewStatus.ts +2 -2
- package/apps/storefront/src/lib/{dev → developer-experience/dev}/rendezvousBroker.ts +3 -3
- package/apps/storefront/src/lib/{dev → developer-experience/dev}/subjectReissue.ts +2 -2
- package/apps/storefront/src/lib/{http → developer-experience/http}/mcpServiceCall.ts +1 -1
- package/apps/storefront/src/lib/{cloudflare-workers.d.ts → developer-experience/types/cloudflare-workers.d.ts} +1 -1
- package/apps/storefront/src/lib/engagement/messaging/messagesClient.ts +2 -2
- package/apps/storefront/src/lib/engagement/newsletter/resendClient.ts +1 -1
- package/apps/storefront/src/lib/engagement/social/tokenStore.ts +1 -1
- package/apps/storefront/src/lib/fulfillment/fulfillmentService.ts +4 -4
- package/apps/storefront/src/lib/integrations/apps/gatewayKeys.ts +1 -1
- package/apps/storefront/src/lib/integrations/apps/registryAccess.ts +1 -1
- package/apps/storefront/src/lib/integrations/integration/browserEnvironment.ts +1 -1
- package/apps/storefront/src/lib/integrations/webhooks/emit.ts +1 -1
- package/apps/storefront/src/lib/integrations/webhooks/getDispatcher.ts +1 -1
- package/apps/storefront/src/lib/measurement/attribution/orderConversionD1.ts +1 -1
- package/apps/storefront/src/lib/measurement/tracking/d1Control.ts +1 -1
- package/apps/storefront/src/lib/measurement/tracking/interactionCollector.ts +1 -1
- package/apps/storefront/src/lib/measurement/tracking/tenantD1Registry.ts +1 -1
- package/apps/storefront/src/lib/{monitoring → observability/monitoring}/manifest.ts +2 -2
- package/apps/storefront/src/lib/{analytics → observability/performance}/budgets.json +1 -1
- package/apps/storefront/src/lib/{analytics → observability/performance}/webVitals.ts +1 -1
- package/apps/storefront/src/lib/orders/fixtures/orders.ts +4 -4
- package/apps/storefront/src/lib/orders/providers/foxyOrderClient.ts +1 -1
- package/apps/storefront/src/lib/{basePath.ts → publication/shared/basePath.ts} +1 -1
- package/apps/storefront/src/lib/{env.ts → publication/shared/env.ts} +1 -1
- package/apps/storefront/src/lib/{previewReload.ts → publication/shared/previewReload.ts} +1 -1
- package/apps/storefront/src/lib/{runtimeEnv.ts → publication/shared/runtimeEnv.ts} +1 -1
- package/apps/storefront/src/lib/{url.ts → publication/shared/url.ts} +1 -1
- package/apps/storefront/src/lib/reporting/fixtures/reporting.ts +3 -3
- package/apps/storefront/src/lib/subscriptions/fixtures/subscriptions.ts +3 -3
- package/apps/storefront/src/middleware/candidatePin.ts +1 -1
- package/apps/storefront/src/middleware/controlPlane.ts +8 -8
- package/apps/storefront/src/middleware/index.ts +13 -13
- package/apps/storefront/src/middleware/publicRender.ts +2 -2
- package/apps/storefront/src/middleware/renderChain.ts +9 -9
- package/apps/storefront/src/middleware/staticBundle.ts +2 -2
- package/apps/storefront/src/pages/404.astro +1 -1
- package/apps/storefront/src/pages/api/activity.ts +1 -1
- package/apps/storefront/src/pages/api/admin/activity-alerts.ts +2 -2
- package/apps/storefront/src/pages/api/admin/commerce-readiness.ts +1 -1
- package/apps/storefront/src/pages/api/admin/fulfillment/batches.ts +1 -1
- package/apps/storefront/src/pages/api/admin/fulfillment/orders/[id]/address.ts +1 -1
- package/apps/storefront/src/pages/api/admin/fulfillment/orders/[id].ts +1 -1
- package/apps/storefront/src/pages/api/admin/interaction-insights.ts +2 -2
- package/apps/storefront/src/pages/api/admin/orders/[id].ts +2 -2
- package/apps/storefront/src/pages/api/admin/orders.ts +2 -2
- package/apps/storefront/src/pages/api/auth/logout.ts +2 -2
- package/apps/storefront/src/pages/api/auth/magic-exchange.ts +6 -6
- package/apps/storefront/src/pages/api/auth/send.ts +3 -3
- package/apps/storefront/src/pages/api/auth/step-up-send.ts +1 -1
- package/apps/storefront/src/pages/api/auth/step-up-verify.ts +3 -3
- package/apps/storefront/src/pages/api/auth/verify.ts +5 -5
- package/apps/storefront/src/pages/api/blog/[collection]/[slug]/react.ts +2 -2
- package/apps/storefront/src/pages/api/checkout-style.css.ts +1 -1
- package/apps/storefront/src/pages/api/cli/policy.ts +1 -1
- package/apps/storefront/src/pages/api/commerce/final-cart-authorization.ts +1 -1
- package/apps/storefront/src/pages/api/newsletter/[collection]/subscribe.ts +2 -2
- package/apps/storefront/src/pages/api/newsletter/confirm.ts +1 -1
- package/apps/storefront/src/pages/api/newsletter/unsubscribe.ts +2 -2
- package/apps/storefront/src/pages/api/newsletter.ts +2 -2
- package/apps/storefront/src/pages/api/request-access.ts +1 -1
- package/apps/storefront/src/pages/api/rum/vitals.ts +2 -2
- package/apps/storefront/src/pages/api/tracking/interaction.ts +1 -1
- package/apps/storefront/src/pages/auth/login.astro +3 -3
- package/apps/storefront/src/pages/auth/magic.astro +1 -1
- package/apps/storefront/src/pages/capabilities.astro +1 -1
- package/apps/storefront/src/pages/collections/[handle].astro +2 -2
- package/apps/storefront/src/pages/feed.json.ts +1 -1
- package/apps/storefront/src/pages/index.astro +1 -1
- package/apps/storefront/src/pages/llms.txt.ts +1 -1
- package/apps/storefront/src/pages/products/[handle].astro +1 -1
- package/apps/storefront/src/pages/search-index.json.ts +1 -1
- package/apps/storefront/src/pages/search.astro +1 -1
- package/apps/storefront/src/pages/sitemap.xml.ts +1 -1
- package/apps/storefront/src/pages/tenants/[id]/[...path].ts +1 -1
- package/apps/storefront/test/pipeline/fake-preview-services.ts +2 -2
- package/apps/storefront/test/pipeline/harness.ts +1 -1
- package/apps/storefront/test/pipeline/matrix-faults.ts +4 -4
- package/apps/storefront/test/pipeline/pipeline-host.ts +9 -9
- package/apps/storefront/test/pipeline/publish-kinds.ts +4 -4
- package/apps/storefront/test/pipeline/synthetic-job.ts +3 -3
- package/apps/storefront/test/pipeline-faults/matrix-lib.ts +2 -2
- package/package.json +1 -1
- package/packages/public-runtime/src/hosted-image-media-types.ts +1 -1
- package/packages/public-runtime/src/retention-holds.ts +1 -1
- package/scripts/dev/locate.mjs +1 -1
- package/apps/storefront/src/lib/admin/ai/index.ts +0 -6
- /package/apps/storefront/src/components/{auth → access/storefront/auth}/AuthBadge.astro +0 -0
- /package/apps/storefront/src/lib/{auth → access/auth}/gatePage.ts +0 -0
- /package/apps/storefront/src/lib/{auth → access/auth}/internalContentAuthority.ts +0 -0
- /package/apps/storefront/src/lib/{auth → access/auth}/operatorSession.ts +0 -0
- /package/apps/storefront/src/lib/{auth → access/auth}/session.ts +0 -0
- /package/apps/storefront/src/lib/{auth → access/auth}/stepUpChallenge.ts +0 -0
- /package/apps/storefront/src/lib/{dashboard → access/dashboard}/vendorQuery.ts +0 -0
- /package/apps/storefront/src/lib/{admin/services/mock → access/fixtures}/tenants.ts +0 -0
- /package/apps/storefront/src/lib/{email → access/notifications}/magicLinkInviteEmail.ts +0 -0
- /package/apps/storefront/src/lib/{privacy → access/privacy}/emailHint.ts +0 -0
- /package/apps/storefront/src/lib/{rate → access/rate}/kvWindow.ts +0 -0
- /package/apps/storefront/src/lib/{shared → access/shared}/capability.ts +0 -0
- /package/apps/storefront/src/lib/{cspStaticHashes.ts → access/shared/cspStaticHashes.ts} +0 -0
- /package/apps/storefront/src/lib/{demoGate.ts → access/shared/demoGate.ts} +0 -0
- /package/apps/storefront/src/lib/{maintenance.ts → access/shared/maintenance.ts} +0 -0
- /package/apps/storefront/src/lib/{securityHeaders.ts → access/shared/securityHeaders.ts} +0 -0
- /package/apps/storefront/src/lib/{tenantOrigins.ts → access/shared/tenantOrigins.ts} +0 -0
- /package/apps/storefront/src/lib/{admin → automation}/ai/approvalMode.ts +0 -0
- /package/apps/storefront/src/lib/{admin → automation}/ai/audit.ts +0 -0
- /package/apps/storefront/src/lib/{admin → automation}/ai/recommendation.ts +0 -0
- /package/apps/storefront/src/lib/{admin → developer-experience/admin}/seed.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/activityStore.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/ai-widget-client.js +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/apiBase.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/ask.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/clickToSource.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/copyCommand.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/files.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/hostedActivity.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/infoPopover.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/mcpCopy.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/monitor.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/stepper.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/cockpit/themeToggle.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/devDraft.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/obstacleStore.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/runtimeStore.ts +0 -0
- /package/apps/storefront/src/lib/{dev → developer-experience/dev}/storeStatus.ts +0 -0
- /package/apps/storefront/src/lib/{fixtures → developer-experience/fixtures}/regulated-commerce-truth/index.ts +0 -0
- /package/apps/storefront/src/lib/{fixtures → developer-experience/fixtures}/ws3-readonly-clone-preflight/index.ts +0 -0
- /package/apps/storefront/src/lib/{http → developer-experience/http}/fetchTransport.ts +0 -0
- /package/apps/storefront/src/lib/{memoryKv.ts → developer-experience/shared/memoryKv.ts} +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/capture.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/consoleLine.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/debugConsole.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/debugMode.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/debugWindow.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/redact.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/reference.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/referenceStore.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/report.ts +0 -0
- /package/apps/storefront/src/lib/{diag → observability/diag}/session.ts +0 -0
- /package/apps/storefront/src/lib/{analytics → observability/performance}/lighthouseReport.ts +0 -0
- /package/apps/storefront/src/lib/{analytics → observability/performance}/perfBudgets.ts +0 -0
- /package/apps/storefront/src/lib/{analytics → observability/performance}/rumAlert.ts +0 -0
- /package/apps/storefront/src/lib/{health.ts → observability/shared/health.ts} +0 -0
- /package/apps/storefront/src/lib/{d1 → publication/d1}/schema-apps.ts +0 -0
- /package/apps/storefront/src/lib/{email → publication/notifications}/candidateConflictEmail.ts +0 -0
- /package/apps/storefront/src/lib/{cdnForward.ts → publication/shared/cdnForward.ts} +0 -0
- /package/apps/storefront/src/lib/{edgeCache.ts → publication/shared/edgeCache.ts} +0 -0
|
@@ -31,7 +31,7 @@ const cliVersion = (() => {
|
|
|
31
31
|
const cliInstallSpec = cliVersion ? `@tokenoftrust/cli@${cliVersion}` : "@tokenoftrust/cli";
|
|
32
32
|
|
|
33
33
|
// The commit THIS build was cut from, baked in at BUILD time so /health can report
|
|
34
|
-
// exactly which code is live (see src/lib/health.ts + src/middleware). Prefer a CI-
|
|
34
|
+
// exactly which code is live (see src/lib/observability/shared/health.ts + src/middleware). Prefer a CI-
|
|
35
35
|
// provided SHA (Workers Builds / GitHub Actions / CF Pages) so the value is right even
|
|
36
36
|
// when the build runs from a shallow/detached checkout; fall back to `git rev-parse`
|
|
37
37
|
// for local deploys. deploy.sh's source guard pins HEAD to origin/<deploySourceBranch>,
|
|
@@ -87,7 +87,7 @@ export default defineConfig({
|
|
|
87
87
|
// Small first-paint tradeoff, offset by cross-page caching (see LIMITATIONS).
|
|
88
88
|
build: { inlineStylesheets: "never" },
|
|
89
89
|
// The cross-site form check runs in the front door (src/middleware/index.ts,
|
|
90
|
-
// lib/cdnForward.ts `crossSiteFormRefusal`) with the same rule, against the
|
|
90
|
+
// lib/publication/shared/cdnForward.ts `crossSiteFormRefusal`) with the same rule, against the
|
|
91
91
|
// origin the viewer used. Astro's own check compares with the request URL, which
|
|
92
92
|
// for a CloudFront-forwarded Tier 3 request is this Worker's host, not the viewer's.
|
|
93
93
|
security: { checkOrigin: false },
|
|
@@ -8,6 +8,6 @@ import { defineConfig } from "drizzle-kit";
|
|
|
8
8
|
// lineage/journal — the whole point of splitting the database.
|
|
9
9
|
export default defineConfig({
|
|
10
10
|
dialect: "sqlite",
|
|
11
|
-
schema: "./src/lib/d1/schema-apps.ts",
|
|
11
|
+
schema: "./src/lib/publication/d1/schema-apps.ts",
|
|
12
12
|
out: "./migrations-apps",
|
|
13
13
|
});
|
package/apps/storefront/env.d.ts
CHANGED
|
@@ -226,7 +226,7 @@ declare global {
|
|
|
226
226
|
* the opaque subject, email + role(s)/capability tot20 resolved on this tenant, so chrome
|
|
227
227
|
* can show "signed in as … — owner/developer/staff". Absent on open or
|
|
228
228
|
* password-gated hosts. Chrome only: authorization reads the session record for the
|
|
229
|
-
* routed tenant (lib/pipeline/admission-request), never this.
|
|
229
|
+
* routed tenant (lib/publication/pipeline/admission-request), never this.
|
|
230
230
|
*/
|
|
231
231
|
viewer?: {
|
|
232
232
|
/** Opaque identity-provider subject from the verified session assertion. */
|
|
@@ -10,20 +10,20 @@ by **Drizzle Kit** (ADR-0002), applied by `wrangler d1 migrations apply`.
|
|
|
10
10
|
|
|
11
11
|
## Source of truth
|
|
12
12
|
|
|
13
|
-
- **`src/lib/d1/schema.ts`** (Drizzle schema, catalog + customization ONLY) is the
|
|
13
|
+
- **`src/lib/publication/d1/schema.ts`** (Drizzle schema, catalog + customization ONLY) is the
|
|
14
14
|
source of truth for migration *generation*. `drizzle-kit generate` diffs it into
|
|
15
15
|
numbered `migrations/*.sql` (+ `meta/` journal) and owns the SQLite table-rebuild
|
|
16
16
|
logic for `ALTER`s.
|
|
17
17
|
- **`products_fts`** (FTS5 virtual table) can't be modelled by Drizzle — it's a custom
|
|
18
18
|
migration (`0001_products_fts.sql`), hand-maintained.
|
|
19
19
|
- The raw-SQL read model + ETL still consume `CATALOG_D1_SCHEMA`/`CUSTOMIZATION_D1_SCHEMA`
|
|
20
|
-
(`@tot/private-controlplane`). A **structural** equivalence test (`src/lib/d1/schema.test.ts`,
|
|
20
|
+
(`@tot/private-controlplane`). A **structural** equivalence test (`src/lib/publication/d1/schema.test.ts`,
|
|
21
21
|
PRAGMA-based) asserts the migrations reproduce that contract, so generator and read
|
|
22
22
|
model can't drift.
|
|
23
23
|
|
|
24
24
|
## Safety (D1 has no rollback)
|
|
25
25
|
|
|
26
|
-
`src/lib/d1/migrationSafety.ts` + its test **fail CI** on any unmarked `DROP TABLE` /
|
|
26
|
+
`src/lib/publication/d1/migrationSafety.ts` + its test **fail CI** on any unmarked `DROP TABLE` /
|
|
27
27
|
`DROP COLUMN` (which also catches SQLite column-dropping rebuilds), because the
|
|
28
28
|
equivalence test only proves *end-state* correctness, not a safe transition. An
|
|
29
29
|
*intended* destructive change must opt in, in the migration file:
|
|
@@ -35,7 +35,7 @@ equivalence test only proves *end-state* correctness, not a safe transition. An
|
|
|
35
35
|
## Workflows
|
|
36
36
|
|
|
37
37
|
**Regular change (add/alter a column, table):**
|
|
38
|
-
1. Edit `src/lib/d1/schema.ts`.
|
|
38
|
+
1. Edit `src/lib/publication/d1/schema.ts`.
|
|
39
39
|
2. `pnpm --filter @tot/storefront gen:migrations` (Drizzle emits the next numbered SQL,
|
|
40
40
|
including SQLite table-rebuilds for unsupported `ALTER`s).
|
|
41
41
|
3. If a column was removed, add `-- allow-destructive: <reason>` to the generated file.
|
|
@@ -56,5 +56,5 @@ wrangler d1 migrations apply CATALOG_DB --env <env> [--remote|--local]
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
> Catalog + customization tables share the **one** `CATALOG_DB` binding (one edge DB),
|
|
59
|
-
> per `src/lib/customization/d1Store.ts`. The storefront-apps tables are a SEPARATE D1
|
|
59
|
+
> per `src/lib/publication/customization/d1Store.ts`. The storefront-apps tables are a SEPARATE D1
|
|
60
60
|
> (`STOREFRONT_APPS_DB`) applied the same way, from `../migrations-apps/`.
|
|
@@ -9,12 +9,12 @@ harness); the **field half** (Real User Monitoring) lives in
|
|
|
9
9
|
|
|
10
10
|
| File | Role |
|
|
11
11
|
|------|------|
|
|
12
|
-
| `../src/lib/
|
|
13
|
-
| `../src/lib/
|
|
14
|
-
| `../src/lib/
|
|
12
|
+
| `../src/lib/observability/performance/budgets.json` | **Source of truth.** Route budgets (LCP/INP/CLS p75 + JS/CSS/image/total KiB) + the third-party script allowlist. Edit here; everything derives from it. |
|
|
13
|
+
| `../src/lib/observability/performance/perfBudgets.ts` | Typed lens + **pure** budget-assertion logic (`evaluateManifest`) + the Lighthouse-budgets exporter (`toLighthouseBudgets`). Unit-tested in `perfBudgets.test.ts`. |
|
|
14
|
+
| `../src/lib/observability/performance/lighthouseReport.ts` | Pure adapter: a Lighthouse result (LHR JSON) → a `RouteMeasurement` the gate evaluates. Unit-tested in `lighthouseReport.test.ts`. |
|
|
15
15
|
| `assert-budgets.ts` | Thin CLI: reads measurements / LHRs, runs the gate, exits non-zero on a violation. |
|
|
16
|
-
| `../src/lib/
|
|
17
|
-
| `../src/lib/
|
|
16
|
+
| `../src/lib/observability/performance/webVitals.ts` | Field RUM beacon (LCP/INP/CLS from real visitors → the RUM sink). |
|
|
17
|
+
| `../src/lib/observability/performance/rumAlert.ts` | Pure sink-side regression-alert contract; feeds F16's `core-web-vitals` monitor. Unit-tested in `rumAlert.test.ts`. |
|
|
18
18
|
|
|
19
19
|
The budget numbers are enforced identically in three places, all reading the one
|
|
20
20
|
manifest: the lab gate here, a Lighthouse `--budget-path` run (via
|
|
@@ -56,7 +56,7 @@ silently drift.
|
|
|
56
56
|
|
|
57
57
|
## Field RUM
|
|
58
58
|
|
|
59
|
-
`startWebVitals()` (from `../src/lib/
|
|
59
|
+
`startWebVitals()` (from `../src/lib/observability/performance/webVitals.ts`) is called from the
|
|
60
60
|
client entry; it measures LCP/INP/CLS per real navigation, buckets each into the
|
|
61
61
|
same budgeted route id the lab gate uses, and beacons finished samples to the RUM
|
|
62
62
|
sink (`RUM_BEACON_PATH`). The sink rolls samples up per route/hour and calls
|
|
@@ -41,8 +41,8 @@ import {
|
|
|
41
41
|
ROUTE_IDS,
|
|
42
42
|
type RouteId,
|
|
43
43
|
type RouteMeasurement,
|
|
44
|
-
} from "../src/lib/
|
|
45
|
-
import { lhrToMeasurement, type LighthouseResult } from "../src/lib/
|
|
44
|
+
} from "../src/lib/observability/performance/perfBudgets.js";
|
|
45
|
+
import { lhrToMeasurement, type LighthouseResult } from "../src/lib/observability/performance/lighthouseReport.js";
|
|
46
46
|
|
|
47
47
|
function die(msg: string, code = 2): never {
|
|
48
48
|
process.stderr.write(`assert-budgets: ${msg}\n`);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { CatalogCollection } from "@tot/public-runtime";
|
|
8
8
|
import Img from "@/components/assets/storefront/Img.astro";
|
|
9
|
-
import { withBase } from "@/lib/basePath";
|
|
9
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
10
10
|
import { pageUrlForm } from "@/lib/content/seo/urlForm";
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
@@ -14,7 +14,7 @@ import Img from "@/components/assets/storefront/Img.astro";
|
|
|
14
14
|
import Badge from "@/components/content/storefront/Badge.astro";
|
|
15
15
|
import PriceDisplay from "@/components/catalog/storefront/commerce/PriceDisplay.astro";
|
|
16
16
|
import RatingStars from "@/components/catalog/storefront/commerce/RatingStars.astro";
|
|
17
|
-
import { withBase } from "@/lib/basePath";
|
|
17
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
18
18
|
import { pageUrlForm } from "@/lib/content/seo/urlForm";
|
|
19
19
|
|
|
20
20
|
interface Props {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import Section from "@/components/content/storefront/Section.astro";
|
|
17
17
|
import Img from "@/components/assets/storefront/Img.astro";
|
|
18
|
-
import { withBase } from "@/lib/basePath";
|
|
18
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
19
19
|
|
|
20
20
|
export interface Brand {
|
|
21
21
|
/** Brand name — the link label, image alt, and text-fallback wordmark. */
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* raw-chrome `.tag-cloud` / `.tag-chip` block in
|
|
11
11
|
* public/shared/commerce-chrome.css — same token vocabulary, same look.
|
|
12
12
|
*/
|
|
13
|
-
import { withBase } from "@/lib/basePath";
|
|
13
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
14
14
|
|
|
15
15
|
export interface TagItem {
|
|
16
16
|
/** Display label. */
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useEffect, useRef, useState } from "preact/hooks";
|
|
10
10
|
import { formatPrice } from "@/lib/content/shared/format";
|
|
11
11
|
import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
|
|
12
|
-
import { withClientBase } from "@/lib/basePath";
|
|
12
|
+
import { withClientBase } from "@/lib/publication/shared/basePath";
|
|
13
13
|
|
|
14
14
|
interface QV {
|
|
15
15
|
handle: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { useEffect, useState } from "preact/hooks";
|
|
9
9
|
import { formatPrice } from "@/lib/content/shared/format";
|
|
10
10
|
import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
|
|
11
|
-
import { withClientBase } from "@/lib/basePath";
|
|
11
|
+
import { withClientBase } from "@/lib/publication/shared/basePath";
|
|
12
12
|
|
|
13
13
|
export interface RVItem {
|
|
14
14
|
handle: string;
|
|
@@ -14,7 +14,7 @@ import { useCallback, useEffect, useRef, useState } from "preact/hooks";
|
|
|
14
14
|
import type { TypeaheadDoc } from "@/lib/catalog/search/index";
|
|
15
15
|
import { formatPrice } from "@/lib/content/shared/format";
|
|
16
16
|
import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
|
|
17
|
-
import { withClientBase } from "@/lib/basePath";
|
|
17
|
+
import { withClientBase } from "@/lib/publication/shared/basePath";
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
20
20
|
action?: string;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Active-filter chips (Shopify-style). Shows what's applied as removable pills
|
|
4
4
|
* above the grid — each chip is a link that drops exactly one filter, so it's
|
|
5
|
-
* URL-addressable and back-button safe like the rest of faceting (src/lib/url.ts).
|
|
5
|
+
* URL-addressable and back-button safe like the rest of faceting (src/lib/publication/shared/url.ts).
|
|
6
6
|
*/
|
|
7
7
|
import type { ListProductsQuery } from "@tot/public-runtime";
|
|
8
|
-
import { toggleFacet, buildQueryString } from "@/lib/url";
|
|
8
|
+
import { toggleFacet, buildQueryString } from "@/lib/publication/shared/url";
|
|
9
9
|
|
|
10
10
|
interface Props {
|
|
11
11
|
query: ListProductsQuery;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* facet is a real link that toggles a querystring param (no JS required for
|
|
5
5
|
* filtering). The optional mobile drawer toggle is the only island.
|
|
6
6
|
*
|
|
7
|
-
* Encoding handled by src/lib/url.ts (opt.<Name>=<value>, tag=, price, avail).
|
|
7
|
+
* Encoding handled by src/lib/publication/shared/url.ts (opt.<Name>=<value>, tag=, price, avail).
|
|
8
8
|
*/
|
|
9
9
|
import type { Facet, ListProductsQuery } from "@tot/public-runtime";
|
|
10
|
-
import { toggleFacet, buildQueryString, isPriceBucketActive, togglePriceBucket } from "@/lib/url";
|
|
10
|
+
import { toggleFacet, buildQueryString, isPriceBucketActive, togglePriceBucket } from "@/lib/publication/shared/url";
|
|
11
11
|
import { PRICE_BUCKETS, bucketByKey } from "@/lib/catalog/shared/priceBuckets";
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* be progressively enhanced to append, but the no-JS path stays correct.
|
|
7
7
|
*/
|
|
8
8
|
import type { ListProductsQuery } from "@tot/public-runtime";
|
|
9
|
-
import { buildQueryString } from "@/lib/url";
|
|
9
|
+
import { buildQueryString } from "@/lib/publication/shared/url";
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
query: ListProductsQuery;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Build `crumbs` with `siteTrail` (lib/content/shared/breadcrumbs.ts) and pass the SAME array to `breadcrumbLd`.
|
|
14
14
|
* `class` adds a hook for the page's own styles (`breadcrumbs` on the blog templates).
|
|
15
15
|
*/
|
|
16
|
-
import { withBase } from "@/lib/basePath";
|
|
16
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
17
17
|
import { pageUrlForm } from "@/lib/content/seo/urlForm";
|
|
18
18
|
import type { Crumb } from "@/lib/content/shared/breadcrumbs";
|
|
19
19
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* <EmptyState> — intentional empty result (search/PLP). Copy is passed in by
|
|
4
4
|
* the parent (kept in the tenant's editorial voice).
|
|
5
5
|
*/
|
|
6
|
-
import { withBase } from "@/lib/basePath";
|
|
6
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
9
9
|
title: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
// Paywall card shown under the teaser of a gated post the viewer can't read in
|
|
3
|
-
// full. Mirrors the "Coming soon" host gate (`src/lib/auth/gatePage.ts`):
|
|
3
|
+
// full. Mirrors the "Coming soon" host gate (`src/lib/access/auth/gatePage.ts`):
|
|
4
4
|
// badge + headline + one line of value + a single CTA — restyled with the site's
|
|
5
5
|
// design tokens so it reads as native article chrome, and preceded by a fade that
|
|
6
6
|
// dissolves the truncated body into the card.
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* view counts). Tenant/collection-generic: mounts on any post route.
|
|
10
10
|
*/
|
|
11
11
|
import { getReactionCounts, REACTIONS, type Reaction } from "@/lib/content/blog/reactions.js";
|
|
12
|
-
import { readKv } from "@/lib/runtimeEnv";
|
|
13
|
-
import { withBase } from "@/lib/basePath";
|
|
12
|
+
import { readKv } from "@/lib/publication/shared/runtimeEnv";
|
|
13
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
/** Collection id the post lives in (e.g. "blog", "the-build"). */
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Tenant-agnostic; theme-token skinned.
|
|
17
17
|
*/
|
|
18
18
|
import type { ChromeNavItem, ChromeLink } from "@/lib/content/chrome/model";
|
|
19
|
-
import { withBase } from "@/lib/basePath";
|
|
19
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
20
20
|
import { isCurrentNavHref } from "@/lib/content/chrome/navCurrent";
|
|
21
21
|
import { trackingAttributes } from "@tot/public-runtime";
|
|
22
22
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* or checkout logic (commerce boundary).
|
|
9
9
|
*/
|
|
10
10
|
import type { ChromeLink, FooterColumn, FooterNewsletter, SocialLink, ChromeLogo, FooterVariant } from "@/lib/content/chrome/model";
|
|
11
|
-
import { withBase } from "@/lib/basePath";
|
|
11
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
12
12
|
import { CHROME_PLACEMENT } from "@/lib/content/chrome/trackingPlacements";
|
|
13
13
|
import { resolveNewsletterAgeAttestation } from "@/lib/content/chrome/newsletterAgeAttestation";
|
|
14
14
|
import { trackingAttributes } from "@tot/public-runtime";
|
|
@@ -18,7 +18,7 @@ import MegaMenu from "@/components/content/storefront/chrome/MegaMenu.astro";
|
|
|
18
18
|
import NavDropdown from "@/components/content/storefront/chrome/NavDropdown.astro";
|
|
19
19
|
import SearchTypeahead from "@/components/catalog/storefront/islands/SearchTypeahead.tsx";
|
|
20
20
|
import MobileNav from "@/components/content/storefront/islands/MobileNav.tsx";
|
|
21
|
-
import { withBase } from "@/lib/basePath";
|
|
21
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
22
22
|
import { ctaIdentityAttr } from "@/lib/content/chrome/ctaIdentity";
|
|
23
23
|
import { CHROME_PLACEMENT } from "@/lib/content/chrome/trackingPlacements";
|
|
24
24
|
import { trackingAttributes } from "@tot/public-runtime";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* convenience — the mobile menu carries these links).
|
|
7
7
|
*/
|
|
8
8
|
import type { ChromeLink, SocialLink } from "@/lib/content/chrome/model";
|
|
9
|
-
import { withBase } from "@/lib/basePath";
|
|
9
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
10
10
|
import { CHROME_PLACEMENT } from "@/lib/content/chrome/trackingPlacements";
|
|
11
11
|
import { trackingAttributes } from "@tot/public-runtime";
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* excerpts — omit a field and its row simply doesn't render.
|
|
18
18
|
*/
|
|
19
19
|
import Img from "@/components/assets/storefront/Img.astro";
|
|
20
|
-
import { withBase } from "@/lib/basePath";
|
|
20
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
21
21
|
|
|
22
22
|
export interface ArticleImage {
|
|
23
23
|
src: string;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import type { HeroBlock } from "@/lib/content/storyblok/content-model";
|
|
23
23
|
import type { CatalogProduct } from "@tot/public-runtime";
|
|
24
24
|
import Img from "@/components/assets/storefront/Img.astro";
|
|
25
|
-
import { withBase } from "@/lib/basePath";
|
|
25
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
26
26
|
import { pageUrlForm } from "@/lib/content/seo/urlForm";
|
|
27
27
|
import { heroSlideshowView } from "@/lib/content/shared/heroSlideshow";
|
|
28
28
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import Section from "@/components/content/storefront/Section.astro";
|
|
8
8
|
import type { CardGridBlock } from "@/lib/content/storyblok/content-model";
|
|
9
|
-
import { withBase } from "@/lib/basePath";
|
|
9
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
block: CardGridBlock;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import Section from "@/components/content/storefront/Section.astro";
|
|
8
8
|
import CodeSample from "@/components/content/storefront/marketing/CodeSample.astro";
|
|
9
9
|
import type { IntegrationsBlock } from "@/lib/content/storyblok/content-model";
|
|
10
|
-
import { withBase } from "@/lib/basePath";
|
|
10
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
11
11
|
|
|
12
12
|
interface Props {
|
|
13
13
|
block: IntegrationsBlock;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* base-path prefix so path-routed tenants stay in-tenant.
|
|
7
7
|
*/
|
|
8
8
|
import type { MarketingCta } from "@/lib/content/storyblok/content-model";
|
|
9
|
-
import { withBase } from "@/lib/basePath";
|
|
9
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
10
10
|
|
|
11
11
|
interface Props {
|
|
12
12
|
ctas?: MarketingCta[];
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "@/lib/customers/shared/wishlist";
|
|
14
14
|
import { formatPrice } from "@/lib/content/shared/format";
|
|
15
15
|
import { placeholderDataUri, isUsableImageUrl } from "@/lib/content/shared/placeholder";
|
|
16
|
-
import { withClientBase } from "@/lib/basePath";
|
|
16
|
+
import { withClientBase } from "@/lib/publication/shared/basePath";
|
|
17
17
|
|
|
18
18
|
interface Props {
|
|
19
19
|
locale: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* The admin console can operate on a target tenant that differs from the routed
|
|
6
6
|
* (adminApp) tenant on `Astro.locals.tenant` — a real ToT-staff session may point
|
|
7
|
-
* `targetTenant` at another tenant it has access to (see lib/adminTenantEnvelope).
|
|
7
|
+
* `targetTenant` at another tenant it has access to (see lib/access/shared/adminTenantEnvelope).
|
|
8
8
|
* Panels that need the target's real config (e.g. the checkout appearance
|
|
9
9
|
* panel, which derives from `theme_tokens` + `commerce.checkout`) resolve it HERE,
|
|
10
10
|
* in the config layer, rather than reaching into the static tenant map — so they
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dev-only tenant-registry seam for the localhost sign-in bypass.
|
|
3
3
|
*
|
|
4
|
-
* `lib/auth/devAuth` can't import the concrete static tenant map directly
|
|
4
|
+
* `lib/access/auth/devAuth` can't import the concrete static tenant map directly
|
|
5
5
|
* (tenancy-resolver-fence — the registry stays behind the `config` boundary so a
|
|
6
6
|
* single-tenant extraction stays a drop-in). This exposes exactly the one thing
|
|
7
7
|
* that bypass needs: the resources a local dev session is granted membership on.
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* default is configurable, not hardcoded.
|
|
22
22
|
*/
|
|
23
23
|
import { tenantIdFromPath, type TenantResolver } from "@tot/public-runtime";
|
|
24
|
-
import { readEnv, readKv } from "@/lib/env";
|
|
24
|
+
import { readEnv, readKv } from "@/lib/publication/shared/env";
|
|
25
25
|
import {
|
|
26
26
|
tenantResolver as staticResolver,
|
|
27
27
|
staticTenants,
|
|
@@ -31,7 +31,7 @@ import { KvTenantResolver, putTenant } from "@/config/kvTenantResolver";
|
|
|
31
31
|
import { getTenantTheme } from "@/themes/tenants";
|
|
32
32
|
import { devTenantsToSeed } from "@/config/devTenantSeed";
|
|
33
33
|
import { tenantAnalyticsRawById } from "@/config/tenantAnalyticsFiles";
|
|
34
|
-
import { MemoryKv } from "@/lib/memoryKv";
|
|
34
|
+
import { MemoryKv } from "@/lib/developer-experience/shared/memoryKv";
|
|
35
35
|
|
|
36
36
|
// LOCAL dev loop discovery: enumerate the colocated tenant dirs on disk,
|
|
37
37
|
// INCLUDING a developer's checkout grafted in by `tot dev` (scripts/tot-dev.mjs).
|
|
@@ -21,7 +21,7 @@ import ShippingRestrictionNotice from "@/components/compliance/storefront/compli
|
|
|
21
21
|
import ExciseTaxNotice from "@/components/compliance/storefront/compliance/ExciseTaxNotice.astro";
|
|
22
22
|
import { EXCISE_TAX_DISCLOSURE_TEXT } from "@/lib/compliance/rawComplianceNotices";
|
|
23
23
|
import IsolatedAgeGate from "@/components/compliance/storefront/islands/IsolatedAgeGate.tsx";
|
|
24
|
-
import AuthBadge from "@/components/auth/AuthBadge.astro";
|
|
24
|
+
import AuthBadge from "@/components/access/storefront/auth/AuthBadge.astro";
|
|
25
25
|
import { referenceTheme } from "@/themes/reference";
|
|
26
26
|
import { mergeTheme } from "@/themes/schema";
|
|
27
27
|
import { organizationLd, websiteLd } from "@/lib/content/shared/jsonld";
|
|
@@ -37,7 +37,7 @@ import { splitFooterLegal } from "@/lib/content/chrome/footerLegal";
|
|
|
37
37
|
import { bindManagedCartAnchors, managedCartHref } from "@/lib/content/chrome/managedCart";
|
|
38
38
|
import type { HeaderVariant, FooterVariant } from "@/lib/content/chrome/model";
|
|
39
39
|
import { renderIntegrationPhases, INTERACTION_TRACKING_BOOT_JS } from "@tot/public-runtime";
|
|
40
|
-
import { readViewerSession } from "@/lib/auth/route";
|
|
40
|
+
import { readViewerSession } from "@/lib/access/auth/route";
|
|
41
41
|
import AppWidgetFrame from "@/components/integrations/storefront/apps/AppWidgetFrame.astro";
|
|
42
42
|
import { getRegistryService } from "@/lib/integrations/apps/registryAccess.js";
|
|
43
43
|
import { renderWidgetSlot } from "@/lib/integrations/apps/widgets/renderSlot.js";
|
|
@@ -542,7 +542,7 @@ const footerWidgets = await renderWidgetSlot(
|
|
|
542
542
|
root-absolute links inside that prefix so navigation stays on the
|
|
543
543
|
tenant. Host-routed requests have no base path and skip this entirely. */}
|
|
544
544
|
<script>
|
|
545
|
-
import { bindBasePathAnchors } from "@/lib/basePath";
|
|
545
|
+
import { bindBasePathAnchors } from "@/lib/publication/shared/basePath";
|
|
546
546
|
bindBasePathAnchors();
|
|
547
547
|
</script>
|
|
548
548
|
|
|
@@ -601,7 +601,7 @@ const footerWidgets = await renderWidgetSlot(
|
|
|
601
601
|
where PerformanceObserver is absent. This is the per-route-template
|
|
602
602
|
signal the `core-web-vitals` monitor consumes. */}
|
|
603
603
|
<script>
|
|
604
|
-
import { startConsentGatedWebVitals } from "@/lib/
|
|
604
|
+
import { startConsentGatedWebVitals } from "@/lib/observability/performance/webVitals";
|
|
605
605
|
startConsentGatedWebVitals();
|
|
606
606
|
</script>
|
|
607
607
|
|
|
@@ -631,7 +631,7 @@ const footerWidgets = await renderWidgetSlot(
|
|
|
631
631
|
listener, and the install-once marker makes a double install a no-op —
|
|
632
632
|
which is what makes the raw chrome wrapper spliced into this document
|
|
633
633
|
(above) safe. Emitted as `is:inline` + the page nonce so it needs no
|
|
634
|
-
entry in lib/cspStaticHashes.ts. */}
|
|
634
|
+
entry in lib/access/shared/cspStaticHashes.ts. */}
|
|
635
635
|
<script is:inline nonce={cspNonce} set:html={INTERACTION_TRACKING_BOOT_JS}></script>
|
|
636
636
|
|
|
637
637
|
{/* Swaps every <AsyncStylesheet>-rendered preload link to rel="stylesheet"
|
|
@@ -10,8 +10,8 @@ these implement.
|
|
|
10
10
|
## Tenant envelope
|
|
11
11
|
|
|
12
12
|
The canonical tenant envelope is `AdminTenantEnvelope`, defined in
|
|
13
|
-
`lib/adminTenantEnvelope.ts` (admin-tenant-mode) and re-exported from
|
|
14
|
-
`lib/admin/envelope.ts` so everything under `lib/admin/**` can import it from
|
|
13
|
+
`lib/access/shared/adminTenantEnvelope.ts` (admin-tenant-mode) and re-exported from
|
|
14
|
+
`lib/access/admin/envelope.ts` so everything under `lib/admin/**` can import it from
|
|
15
15
|
a stable relative path:
|
|
16
16
|
|
|
17
17
|
```ts
|
|
@@ -29,7 +29,7 @@ refused not hidden-only). `targetTenant` is the sole key mock services use to
|
|
|
29
29
|
select/derive data. **Authorization must always be evaluated against
|
|
30
30
|
`targetTenant`, never `adminAppTenant`** (decision `tenant-envelope-contract`).
|
|
31
31
|
|
|
32
|
-
(`lib/admin/envelope.ts` used to declare its own 2-field copy of this
|
|
32
|
+
(`lib/access/admin/envelope.ts` used to declare its own 2-field copy of this
|
|
33
33
|
interface — data-view-contracts and admin-tenant-mode were built in parallel
|
|
34
34
|
per that decision, with no live coordination. Reconciled here per decision
|
|
35
35
|
`envelope-type-duplication-follow-up`: one canonical type, re-exported.)
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* only (window.__toTAdminAsk + a "tot:admin-ask" CustomEvent), never sent over
|
|
11
11
|
* the network.
|
|
12
12
|
*/
|
|
13
|
-
import { buildAskEnvelope, type AskEnvelope } from "
|
|
13
|
+
import { buildAskEnvelope, type AskEnvelope } from "../../automation/ai/askEnvelope";
|
|
14
14
|
|
|
15
15
|
/** Static shell data shared by server-rendered navigation and browser startup. */
|
|
16
16
|
export const ADMIN_SHELL_CONFIG = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical tenant envelope for the admin console lives in
|
|
3
|
-
* `lib/adminTenantEnvelope.ts` (admin-tenant-mode) — it carries the real
|
|
3
|
+
* `lib/access/shared/adminTenantEnvelope.ts` (admin-tenant-mode) — it carries the real
|
|
4
4
|
* staff-override authorization (`resolveAdminTenantMode`) that admin.astro
|
|
5
5
|
* actually runs. This module re-exports that type so every mock service under
|
|
6
6
|
* `lib/admin/**` can keep importing it from a stable relative path
|
|
7
7
|
* (`../../envelope`) without declaring a second, competing interface.
|
|
8
8
|
*/
|
|
9
|
-
export type { AdminTenantEnvelope } from "@/lib/adminTenantEnvelope";
|
|
9
|
+
export type { AdminTenantEnvelope } from "@/lib/access/shared/adminTenantEnvelope";
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { CheckoutStyle } from "@tot/public-runtime";
|
|
10
|
-
import type { ApprovalMode } from "
|
|
11
|
-
import type { AuditEvent } from "
|
|
10
|
+
import type { ApprovalMode } from "../../../automation/ai/approvalMode";
|
|
11
|
+
import type { AuditEvent } from "../../../automation/ai/audit";
|
|
12
12
|
|
|
13
13
|
export type { ApprovalMode };
|
|
14
14
|
export type { CheckoutStyle };
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* Astro/I-O wrapper the routes call.
|
|
18
18
|
*/
|
|
19
19
|
import type { APIContext } from "astro";
|
|
20
|
-
import { readViewerSession } from "@/lib/auth/route";
|
|
21
|
-
import { resolveAdminEntry, type AdminEntryDecision } from "@/lib/auth/adminEntry";
|
|
20
|
+
import { readViewerSession } from "@/lib/access/auth/route";
|
|
21
|
+
import { resolveAdminEntry, type AdminEntryDecision } from "@/lib/access/auth/adminEntry";
|
|
22
22
|
import type { SessionRecord } from "./session.js";
|
|
23
23
|
|
|
24
24
|
export type AdminApiAccess =
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* keeps a non-member / unauthenticated visitor on the legitimate sign-in gate.
|
|
5
5
|
*
|
|
6
6
|
* NARROW to auth/session ENTRY: it CONSUMES the admin tab UX
|
|
7
|
-
* (`pages/admin.astro` + `components/admin/AdminPublishTab.astro`) and the
|
|
7
|
+
* (`pages/admin.astro` + `components/publication/admin/AdminPublishTab.astro`) and the
|
|
8
8
|
* ship-capability model (`change/shipCapabilities` + `change/route` decideIsOwner)
|
|
9
9
|
* rather than reimplementing either. Everything it resolves is bound to the
|
|
10
10
|
* RESOLVED tenant, never taken from client input, and never requires a
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
*/
|
|
32
32
|
import type { SessionRecord } from "./session.js";
|
|
33
33
|
import { sessionHostCapability } from "./loginGate.js";
|
|
34
|
-
import { staffAdmits } from "@/lib/dashboard/tenantSelection";
|
|
34
|
+
import { staffAdmits } from "@/lib/access/dashboard/tenantSelection";
|
|
35
35
|
import {
|
|
36
36
|
decideIsOwner,
|
|
37
37
|
isOwnerCapability,
|
|
38
38
|
resolveShipCapabilities,
|
|
39
39
|
type Capability,
|
|
40
40
|
type ShipCapabilities,
|
|
41
|
-
} from "@/lib/shared/capability";
|
|
41
|
+
} from "@/lib/access/shared/capability";
|
|
42
42
|
|
|
43
43
|
/** Which entry case a viewer is in, for chrome + the DoD test matrix. */
|
|
44
44
|
export type AdminEntryPrincipal =
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import type { SessionRecord } from "./session.js";
|
|
26
26
|
import { sessionAdmitsHost } from "./loginGate.js";
|
|
27
27
|
import { safeNext } from "./route.js";
|
|
28
|
-
import { selectTenant } from "@/lib/dashboard/tenantSelection";
|
|
28
|
+
import { selectTenant } from "@/lib/access/dashboard/tenantSelection";
|
|
29
29
|
|
|
30
30
|
/** The tenant-selection surface, in both host-routed and tenant-first path forms. */
|
|
31
31
|
export function isAdminSelectPath(pathname: string): boolean {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* direction of the same decoupled-authZ pattern).
|
|
24
24
|
*/
|
|
25
25
|
import { SignJWT, importPKCS8, type CryptoKey } from "jose";
|
|
26
|
-
import { readEnv } from "@/lib/env";
|
|
26
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
27
27
|
|
|
28
28
|
/** The audience tot20's broker verifier pins. */
|
|
29
29
|
export const BROKER_AUDIENCE = "tot20-broker";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Keeping the bypass in one file means "does prod contain the bypass?" is a single
|
|
17
17
|
* grep (`devAuth`), and the production path in send/verify is never weakened.
|
|
18
18
|
*/
|
|
19
|
-
import { readEnv } from "@/lib/env";
|
|
19
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
20
20
|
import { devTenantResources } from "@/config/devTenants";
|
|
21
21
|
import { createSession } from "./session.js";
|
|
22
22
|
|
|
@@ -26,12 +26,12 @@ import {
|
|
|
26
26
|
type JWTVerifyGetKey,
|
|
27
27
|
type JSONWebKeySet,
|
|
28
28
|
} from "jose";
|
|
29
|
-
import { readEnv } from "@/lib/env";
|
|
29
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
30
30
|
import {
|
|
31
31
|
TENANT_ROLES,
|
|
32
32
|
isTenantRole,
|
|
33
33
|
type TenantRole,
|
|
34
|
-
} from "@/lib/shared/capability";
|
|
34
|
+
} from "@/lib/access/shared/capability";
|
|
35
35
|
|
|
36
36
|
/** tot's issuer — consumers pin/allowlist this (`auth.jwt.issuer`). */
|
|
37
37
|
export const TOT_ISSUER = "tokenoftrust-internal-ops";
|