@tokenoftrust/storefront-runner 2.4.89 → 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 +1 -1
- 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/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/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/resolver.ts +1 -1
- package/apps/storefront/src/layouts/Layout.astro +1 -1
- package/apps/storefront/src/lib/access/auth/adminEntry.ts +1 -1
- package/apps/storefront/src/lib/access/auth/brokerAssertion.ts +1 -1
- package/apps/storefront/src/lib/access/auth/devAuth.ts +1 -1
- package/apps/storefront/src/lib/access/auth/identityToken.ts +1 -1
- package/apps/storefront/src/lib/access/auth/mcpClientAssertion.ts +1 -1
- package/apps/storefront/src/lib/access/auth/route.ts +1 -1
- package/apps/storefront/src/lib/access/auth/totAccessClient.ts +1 -1
- package/apps/storefront/src/lib/access/dashboard/delegateGate.ts +1 -1
- package/apps/storefront/src/lib/access/dashboard/staffVendorAccess.ts +1 -1
- package/apps/storefront/src/lib/access/shared/developerInvites.ts +1 -1
- package/apps/storefront/src/lib/access/shared/principalGrants.ts +1 -1
- package/apps/storefront/src/lib/access/shared/tenantRouting.ts +1 -1
- package/apps/storefront/src/lib/activity/killSwitch.ts +1 -1
- package/apps/storefront/src/lib/activity/uiActor.ts +1 -1
- package/apps/storefront/src/lib/assets/durableR2Bindings.ts +1 -1
- package/apps/storefront/src/lib/checkout/commerce/checkoutHandoffCorrelation.ts +1 -1
- package/apps/storefront/src/lib/checkout/shared/checkoutCommerce.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 +1 -1
- package/apps/storefront/src/lib/content/blog/collection.ts +1 -1
- 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/developer-experience/dev/cliSignInCode.ts +1 -1
- package/apps/storefront/src/lib/developer-experience/dev/rendezvousBroker.ts +1 -1
- package/apps/storefront/src/lib/developer-experience/http/mcpServiceCall.ts +1 -1
- package/apps/storefront/src/lib/developer-experience/types/cloudflare-workers.d.ts +1 -1
- package/apps/storefront/src/lib/engagement/messaging/messagesClient.ts +1 -1
- 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 +1 -1
- 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/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/observability/performance/webVitals.ts +1 -1
- package/apps/storefront/src/lib/orders/providers/foxyOrderClient.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/{url.ts → publication/shared/url.ts} +1 -1
- package/apps/storefront/src/middleware/candidatePin.ts +1 -1
- package/apps/storefront/src/middleware/controlPlane.ts +2 -2
- package/apps/storefront/src/middleware/index.ts +2 -2
- package/apps/storefront/src/middleware/publicRender.ts +2 -2
- package/apps/storefront/src/middleware/renderChain.ts +4 -4
- 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 +1 -1
- package/apps/storefront/src/pages/api/admin/interaction-insights.ts +1 -1
- package/apps/storefront/src/pages/api/admin/orders/[id].ts +1 -1
- package/apps/storefront/src/pages/api/admin/orders.ts +1 -1
- package/apps/storefront/src/pages/api/auth/send.ts +1 -1
- package/apps/storefront/src/pages/api/auth/verify.ts +1 -1
- package/apps/storefront/src/pages/api/blog/[collection]/[slug]/react.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/apps/storefront/src/pages/api/tracking/interaction.ts +1 -1
- package/apps/storefront/src/pages/auth/login.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/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/{basePath.ts → publication/shared/basePath.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
- /package/apps/storefront/src/lib/{runtimeEnv.ts → publication/shared/runtimeEnv.ts} +0 -0
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* (the MCP derives the expected audience from that fixed path, not the sub-path), so
|
|
20
20
|
* one minted assertion shape covers every call. SERVER-SIDE ONLY.
|
|
21
21
|
*/
|
|
22
|
-
import { readEnv } from "@/lib/env";
|
|
22
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
23
23
|
import { mintMcpClientAssertion, McpClientAssertionError } from "@/lib/access/auth/mcpClientAssertion";
|
|
24
24
|
import { FetchHttpTransport, type HttpTransport } from "@/lib/developer-experience/http/fetchTransport";
|
|
25
25
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* (a non-skipped failure), while each caller keeps its own fail-open / fail-closed mapping
|
|
11
11
|
* for the outcome.
|
|
12
12
|
*/
|
|
13
|
-
import { readEnv } from "@/lib/env";
|
|
13
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
14
14
|
|
|
15
15
|
export interface McpServiceResponse {
|
|
16
16
|
status: number;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The storefront does not depend on @cloudflare/workers-types (its globals collide with the DOM
|
|
5
5
|
* lib Astro compiles against), so the Durable Object surface the pipeline needs is declared here.
|
|
6
6
|
* The module only resolves inside workerd; under Node it is imported lazily and guarded
|
|
7
|
-
* (`lib/runtimeEnv.ts`).
|
|
7
|
+
* (`lib/publication/shared/runtimeEnv.ts`).
|
|
8
8
|
*/
|
|
9
9
|
declare module "cloudflare:workers" {
|
|
10
10
|
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Built like `@/lib/grants/developerInvites` (interface + Http impl + Mock + env factory).
|
|
17
17
|
*/
|
|
18
|
-
import { readEnv } from "@/lib/env";
|
|
18
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
19
19
|
|
|
20
20
|
export interface InlineEmail {
|
|
21
21
|
/** Recipient address. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* (`POST /emails/batch`, up to 100 messages/call); audience/consent/unsubscribe
|
|
6
6
|
* state stays first-party in our D1, never in a vendor list.
|
|
7
7
|
*/
|
|
8
|
-
import { readEnv } from "../../env.js";
|
|
8
|
+
import { readEnv } from "../../publication/shared/env.js";
|
|
9
9
|
|
|
10
10
|
/** Resend's batch limit: at most 100 messages per `/emails/batch` call. */
|
|
11
11
|
export const RESEND_BATCH_LIMIT = 100;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* `null` when either binding is absent so callers degrade rather than throw.
|
|
20
20
|
*/
|
|
21
21
|
import type { Queryable } from "../../catalog/d1/catalog.js";
|
|
22
|
-
import { readD1, readEnv } from "../../env.js";
|
|
22
|
+
import { readD1, readEnv } from "../../publication/shared/env.js";
|
|
23
23
|
|
|
24
24
|
/** The decrypted token material we persist as one JSON blob under AES-GCM. */
|
|
25
25
|
export interface SocialTokenPayload {
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
type ProviderOutcome,
|
|
31
31
|
type StockState,
|
|
32
32
|
} from "@tot/public-runtime";
|
|
33
|
-
import { readD1 } from "@/lib/env";
|
|
33
|
+
import { readD1 } from "@/lib/publication/shared/env";
|
|
34
34
|
import { decideAdminApiAccess } from "@/lib/access/auth/adminApiGuard";
|
|
35
35
|
import { readViewerSession } from "@/lib/access/auth/route";
|
|
36
36
|
import type { SessionRecord } from "@/lib/access/auth/session";
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* shape change.
|
|
20
20
|
*/
|
|
21
21
|
import { importPKCS8, exportJWK, type CryptoKey, type JWK, type JSONWebKeySet } from "jose";
|
|
22
|
-
import { readEnv } from "@/lib/env";
|
|
22
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
23
23
|
|
|
24
24
|
/** The only algorithm the gateway signs with (verifiers reject anything else). */
|
|
25
25
|
export const APP_GATEWAY_ALG = "RS256";
|
|
@@ -17,7 +17,7 @@ import { AppRegistryService } from "./registryService.js";
|
|
|
17
17
|
import { D1CredentialStore } from "./credentials.js";
|
|
18
18
|
import { DEFAULT_APP_GATEWAY_KID, APP_GATEWAY_KID_ENV } from "./gatewayKeys.js";
|
|
19
19
|
import { fromD1 } from "../../catalog/d1/catalog.js";
|
|
20
|
-
import { readD1, readEnv } from "../../env.js";
|
|
20
|
+
import { readD1, readEnv } from "../../publication/shared/env.js";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* No-store JSON response — install/rotate bodies carry a one-time client
|
|
@@ -51,7 +51,7 @@ import { getDispatcher } from "./getDispatcher.js";
|
|
|
51
51
|
import { getRegistryService } from "../apps/registryAccess.js";
|
|
52
52
|
import type { AppInstall } from "../apps/registryService.js";
|
|
53
53
|
import { fromD1 } from "../../catalog/d1/catalog.js";
|
|
54
|
-
import { readD1 } from "../../env.js";
|
|
54
|
+
import { readD1 } from "../../publication/shared/env.js";
|
|
55
55
|
|
|
56
56
|
/** Contract-scoped payload schema version — `asyncapi.yaml`'s `dataschemaversion` is `const: "1"` for V1. */
|
|
57
57
|
const DATASCHEMA_VERSION = "1";
|
|
@@ -23,7 +23,7 @@ import { D1CredentialStore } from "../apps/credentials.js";
|
|
|
23
23
|
import { DEFAULT_APP_GATEWAY_KID, APP_GATEWAY_KID_ENV } from "../apps/gatewayKeys.js";
|
|
24
24
|
import { json } from "../apps/registryAccess.js";
|
|
25
25
|
import { fromD1, type Queryable } from "../../catalog/d1/catalog.js";
|
|
26
|
-
import { readD1, readEnv, readQueue } from "../../env.js";
|
|
26
|
+
import { readD1, readEnv, readQueue } from "../../publication/shared/env.js";
|
|
27
27
|
import { COMMERCE_SCHEDULER } from "@tot/public-runtime";
|
|
28
28
|
|
|
29
29
|
/** Binding name `getDispatcher()` checks to pick the Cloudflare Queues adapter. Not yet declared in `wrangler.toml`. */
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* in-memory `node:sqlite` in tests unchanged.
|
|
17
17
|
*/
|
|
18
18
|
import type { Queryable } from "../../catalog/d1/catalog.js";
|
|
19
|
-
import { readEnv } from "@/lib/env";
|
|
19
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
20
20
|
import {
|
|
21
21
|
computeOrderConversion,
|
|
22
22
|
resolveConversionEnvironment,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* stores use (`d1/catalog.ts`), so the insert code in `interactionStore.ts` is
|
|
22
22
|
* transport-agnostic and unit-testable against an in-memory sqlite.
|
|
23
23
|
*/
|
|
24
|
-
import { readEnv } from "../../env.js";
|
|
24
|
+
import { readEnv } from "../../publication/shared/env.js";
|
|
25
25
|
import type { Queryable, QueryStatement } from "../../catalog/d1/catalog.js";
|
|
26
26
|
|
|
27
27
|
const CF_API_BASE = "https://api.cloudflare.com/client/v4";
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* violate either.
|
|
27
27
|
*/
|
|
28
28
|
import type { TotInteraction } from "@tot/public-runtime";
|
|
29
|
-
import { withClientApiBase } from "@/lib/basePath";
|
|
29
|
+
import { withClientApiBase } from "@/lib/publication/shared/basePath";
|
|
30
30
|
|
|
31
31
|
/** Where the browser beacon POSTs interaction batches. */
|
|
32
32
|
export const INTERACTION_BEACON_PATH = "/api/tracking/interaction";
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* never fail because storage is unconfigured.
|
|
32
32
|
*/
|
|
33
33
|
import { sha256Hex } from "@tot/public-runtime";
|
|
34
|
-
import { readEnv } from "../../env.js";
|
|
34
|
+
import { readEnv } from "../../publication/shared/env.js";
|
|
35
35
|
import type { Queryable } from "../../catalog/d1/catalog.js";
|
|
36
36
|
import {
|
|
37
37
|
ensureDatabase,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
isPurposeEligible,
|
|
35
35
|
parseConsentSnapshot,
|
|
36
36
|
} from "@tot/public-runtime";
|
|
37
|
-
import { withClientApiBase } from "@/lib/basePath";
|
|
37
|
+
import { withClientApiBase } from "@/lib/publication/shared/basePath";
|
|
38
38
|
|
|
39
39
|
/** The three field metrics we collect. INP is field-only (no lab equivalent). */
|
|
40
40
|
export type WebVitalName = "lcp" | "inp" | "cls";
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* `messagesClient.ts`, is a shared singleton that multiple callers (read
|
|
24
24
|
* routes, event receiver) each independently resolve.
|
|
25
25
|
*/
|
|
26
|
-
import { readEnv } from "@/lib/env";
|
|
26
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
27
27
|
|
|
28
28
|
/** One order line item, as tot-foxycart's `buildOrderPayload()` returns it. */
|
|
29
29
|
export interface FoxyOrderLineItem {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* A tiny live-reload client is injected (by src/middleware) into `test`-env HTML
|
|
7
7
|
* pages ONLY — never `live`. It polls `GET /api/preview/version?tenant=<id>` (the
|
|
8
8
|
* per-tenant edge cache-version integer, which bumps on every reconcile/publish;
|
|
9
|
-
* see lib/edgeCache.ts + api/preview/reconcile.ts) and reloads the page when the
|
|
9
|
+
* see lib/publication/shared/edgeCache.ts + api/preview/reconcile.ts) and reloads the page when the
|
|
10
10
|
* version changes. Poll-based v1; an SSE / Durable-Object PUSH is the later
|
|
11
11
|
* upgrade (TODO below) that removes the ~1s poll latency.
|
|
12
12
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* &opt.Size=M&tag=sale&priceMin=50&priceMax=200&q=wool
|
|
9
9
|
*/
|
|
10
10
|
import type { ListProductsQuery } from "@tot/public-runtime";
|
|
11
|
-
import type { PriceBucket } from "
|
|
11
|
+
import type { PriceBucket } from "../../catalog/shared/priceBuckets.js";
|
|
12
12
|
|
|
13
13
|
export function parseQuery(url: URL): ListProductsQuery {
|
|
14
14
|
const sp = url.searchParams;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* `hasCandidatePin` means the same thing at both: a pin this tenant actually
|
|
9
9
|
* verified, never the mere presence of a query param a client can type.
|
|
10
10
|
*/
|
|
11
|
-
import { readEnv } from "@/lib/runtimeEnv";
|
|
11
|
+
import { readEnv } from "@/lib/publication/shared/runtimeEnv";
|
|
12
12
|
import { CANDIDATE_CONTENT_PIN_PARAM, verifyContentPinToken } from "@tot/public-runtime";
|
|
13
13
|
|
|
14
14
|
export interface CandidateContentPin {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* then delegates to the shared render chain with those values supplied.
|
|
8
8
|
*/
|
|
9
9
|
import type { APIContext, MiddlewareNext } from "astro";
|
|
10
|
-
import { readEnv, readD1, readKv } from "@/lib/env";
|
|
10
|
+
import { readEnv, readD1, readKv } from "@/lib/publication/shared/env";
|
|
11
11
|
import { fromD1, type D1Like } from "@/lib/catalog/d1/catalog";
|
|
12
12
|
import { readCurrentTenantConsentConfig } from "@/lib/measurement/consent/consentConfigRead";
|
|
13
13
|
import { loadActiveManagedInstallDeclarations } from "@/lib/integrations/integration/managedInstallDeclarations";
|
|
@@ -209,7 +209,7 @@ export async function serveControlPlane(input: ControlPlaneInput): Promise<Respo
|
|
|
209
209
|
// with no standing here (staff browsing without a selection) carries none —
|
|
210
210
|
// the session's standing on any other store never appears on this host.
|
|
211
211
|
// Authorization never reads this chrome: admission resolves standing from the
|
|
212
|
-
// session record for the routed tenant (lib/pipeline/admission-request).
|
|
212
|
+
// session record for the routed tenant (lib/publication/pipeline/admission-request).
|
|
213
213
|
//
|
|
214
214
|
// On an admin path, "the host" a staff viewer is really acting on is the
|
|
215
215
|
// ?asTenant= impersonation target (mirrors admin.astro/AdminPublishTab.astro's
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
import { defineMiddleware } from "astro:middleware";
|
|
23
23
|
import type { APIContext, MiddlewareNext } from "astro";
|
|
24
24
|
import { getTenantResolver } from "@/config/resolver";
|
|
25
|
-
import { readEnv, readKv, readR2 } from "@/lib/runtimeEnv";
|
|
25
|
+
import { readEnv, readKv, readR2 } from "@/lib/publication/shared/runtimeEnv";
|
|
26
26
|
import { resolveCdnForwardRouting, resolveTenantRouting } from "@/lib/access/shared/tenantRouting";
|
|
27
|
-
import { crossSiteFormRefusal, verifyCdnForward } from "@/lib/cdnForward";
|
|
27
|
+
import { crossSiteFormRefusal, verifyCdnForward } from "@/lib/publication/shared/cdnForward";
|
|
28
28
|
import { compileRouteTierIndexV1, resolvePublicationRoutePlanV1, type RouteTierIndexV1 , storefrontModeRequiresSignIn } from "@tot/public-runtime";
|
|
29
29
|
import type { PublicationArtifactBucketV1, TenantConfig } from "@tot/public-runtime";
|
|
30
30
|
import { DEV_DRAFT_COOKIE } from "@/lib/developer-experience/dev/devDraft";
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* accident. That absence is the contract, and it is held structurally rather
|
|
8
8
|
* than by review: `public-render-no-request-time-d1` (.dependency-cruiser.cjs)
|
|
9
9
|
* fails `pnpm run check` if ANY module reachable from this one reaches
|
|
10
|
-
* `lib/env.ts`, the sole accessor for a live D1 handle. The public path reaches
|
|
11
|
-
* `lib/runtimeEnv.ts` instead — readEnv/readKv/readR2, the substrate that serves
|
|
10
|
+
* `lib/publication/shared/env.ts`, the sole accessor for a live D1 handle. The public path reaches
|
|
11
|
+
* `lib/publication/shared/runtimeEnv.ts` instead — readEnv/readKv/readR2, the substrate that serves
|
|
12
12
|
* published bytes.
|
|
13
13
|
*
|
|
14
14
|
* Two companions cover what a forward graph walk from this module cannot see:
|
|
@@ -12,7 +12,7 @@ import type { APIContext, MiddlewareNext } from "astro";
|
|
|
12
12
|
import { referenceTheme } from "@/themes/reference";
|
|
13
13
|
import { mergeTheme, themeToCssVars } from "@/themes/schema";
|
|
14
14
|
import { createToTClient } from "@/lib/catalog/tot/ToTClient";
|
|
15
|
-
import { readEnv, readR2 } from "@/lib/runtimeEnv";
|
|
15
|
+
import { readEnv, readR2 } from "@/lib/publication/shared/runtimeEnv";
|
|
16
16
|
import { tryServeStaticBundle } from "./staticBundle.js";
|
|
17
17
|
import { isPlatformPublicDiscoveryPath } from "./routeBranch.js";
|
|
18
18
|
import { resolveCandidateContentPin, type CandidateContentPin } from "./candidatePin.js";
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
readCacheVersion,
|
|
27
27
|
getCachedPage,
|
|
28
28
|
putCachedPage,
|
|
29
|
-
} from "@/lib/edgeCache";
|
|
29
|
+
} from "@/lib/publication/shared/edgeCache";
|
|
30
30
|
import { STATIC_SCRIPT_HASHES, STATIC_STYLE_HASHES } from "@/lib/access/shared/cspStaticHashes";
|
|
31
31
|
import { applySecurityHeaders } from "@/lib/access/shared/securityHeaders";
|
|
32
|
-
import { maybeInjectPreviewReload } from "@/lib/previewReload";
|
|
32
|
+
import { maybeInjectPreviewReload } from "@/lib/publication/shared/previewReload";
|
|
33
33
|
import {
|
|
34
34
|
resolveCustomizationEnv,
|
|
35
35
|
buildCsp,
|
|
@@ -178,7 +178,7 @@ export async function runRenderChain(input: RenderChainInput): Promise<Response>
|
|
|
178
178
|
|
|
179
179
|
// Candidate-render CONTENT PIN (`__tot_candidate_pin`): a signed, tenant- and
|
|
180
180
|
// expiry-bound token minted ONLY by the control-plane candidate/revision
|
|
181
|
-
// renderers (`src/lib/preview/pinnedRouteRender.ts`, never client-forgeable)
|
|
181
|
+
// renderers (`src/lib/publication/preview/pinnedRouteRender.ts`, never client-forgeable)
|
|
182
182
|
// that pins THIS one render's content resolution to an exact immutable
|
|
183
183
|
// `versionId`, bypassing the shared `{live,test}` channel entirely. It rides
|
|
184
184
|
// an in-process `context.rewrite()` from those renderers so a real Astro
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* hashed names exist only inside a tenant's bundle, never in the Worker's own
|
|
8
8
|
* build output). It reads R2 and KV and never D1.
|
|
9
9
|
*/
|
|
10
|
-
import { readR2 } from "@/lib/runtimeEnv";
|
|
11
|
-
import { getCachedPage, putCachedPage, staticBundleCacheKey } from "@/lib/edgeCache";
|
|
10
|
+
import { readR2 } from "@/lib/publication/shared/runtimeEnv";
|
|
11
|
+
import { getCachedPage, putCachedPage, staticBundleCacheKey } from "@/lib/publication/shared/edgeCache";
|
|
12
12
|
import {
|
|
13
13
|
resolveChannelDigest,
|
|
14
14
|
serveStaticBundle,
|
|
@@ -13,7 +13,7 @@ export const prerender = false;
|
|
|
13
13
|
|
|
14
14
|
import Layout from "@/layouts/Layout.astro";
|
|
15
15
|
import CollectionCard from "@/components/catalog/storefront/CollectionCard.astro";
|
|
16
|
-
import { withBase } from "@/lib/basePath";
|
|
16
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
17
17
|
|
|
18
18
|
const { tenant, tot, basePath, features } = Astro.locals;
|
|
19
19
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* origin check, so the server-to-server callers work.
|
|
29
29
|
*/
|
|
30
30
|
import type { APIContext } from "astro";
|
|
31
|
-
import { readD1, readEnv, readAnalytics, runAfterResponse, type CfExecutionContextLike } from "@/lib/env";
|
|
31
|
+
import { readD1, readEnv, readAnalytics, runAfterResponse, type CfExecutionContextLike } from "@/lib/publication/shared/env";
|
|
32
32
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
33
33
|
import { verifyIngestAuth } from "@/lib/activity/ingestAuth";
|
|
34
34
|
import { ingestEvents, type IngestRejection } from "@/lib/activity/ingest";
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import type { APIContext } from "astro";
|
|
28
28
|
import { requireAdminApiEntry } from "@/lib/access/auth/adminApiGuard";
|
|
29
|
-
import { readD1 } from "@/lib/env";
|
|
29
|
+
import { readD1 } from "@/lib/publication/shared/env";
|
|
30
30
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
31
31
|
import { checkActivityAlerts } from "@/lib/activity/alerts";
|
|
32
32
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import type { APIContext } from "astro";
|
|
31
31
|
import { requireAdminApiEntry } from "@/lib/access/auth/adminApiGuard";
|
|
32
|
-
import { readD1 } from "@/lib/env";
|
|
32
|
+
import { readD1 } from "@/lib/publication/shared/env";
|
|
33
33
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
34
34
|
import { resolveTenantStore, trackingNamePrefix } from "@/lib/measurement/tracking/tenantD1Registry";
|
|
35
35
|
import { readD1Control } from "@/lib/measurement/tracking/d1Control";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Read-only.
|
|
8
8
|
*/
|
|
9
9
|
import type { APIContext } from "astro";
|
|
10
|
-
import { readEnv } from "@/lib/env";
|
|
10
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
11
11
|
import { requireAdminApiEntry } from "@/lib/access/auth/adminApiGuard";
|
|
12
12
|
import {
|
|
13
13
|
commerceActorForAdmin,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* host/approver layer) — same posture as `api/evidence.json.ts`; no new gate here.
|
|
11
11
|
*/
|
|
12
12
|
import type { APIContext } from "astro";
|
|
13
|
-
import { readEnv } from "@/lib/env";
|
|
13
|
+
import { readEnv } from "@/lib/publication/shared/env";
|
|
14
14
|
import { requireAdminApiEntry } from "@/lib/access/auth/adminApiGuard";
|
|
15
15
|
import {
|
|
16
16
|
createCheckoutOrderClient,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* redirect to the "enter your code" step. Accepts an HTML form post (no JS needed).
|
|
10
10
|
*/
|
|
11
11
|
import type { APIContext } from "astro";
|
|
12
|
-
import { readKv } from "@/lib/env";
|
|
12
|
+
import { readKv } from "@/lib/publication/shared/env";
|
|
13
13
|
import {
|
|
14
14
|
EMAIL_RE,
|
|
15
15
|
getAccessClient,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* the idiomatic write path today. See docs/architecture/dev-experience-hosted-vs-local.md.
|
|
22
22
|
*/
|
|
23
23
|
import type { APIContext } from "astro";
|
|
24
|
-
import { readKv } from "@/lib/env";
|
|
24
|
+
import { readKv } from "@/lib/publication/shared/env";
|
|
25
25
|
|
|
26
26
|
export const prerender = false;
|
|
27
27
|
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
type StockState,
|
|
19
19
|
} from "@tot/public-runtime";
|
|
20
20
|
import { fromD1, listAllActiveProducts } from "@/lib/catalog/d1/catalog.js";
|
|
21
|
-
import { readD1, readEnv } from "@/lib/env";
|
|
21
|
+
import { readD1, readEnv } from "@/lib/publication/shared/env";
|
|
22
22
|
import { evaluateFinalCart, type SeamView } from "@/lib/checkout/commerce/finalCartAuthorization.js";
|
|
23
23
|
import { d1CommerceRunner, mirrorOnHand, reserveAllocation } from "@/lib/inventory/allocations.js";
|
|
24
24
|
import { POST as compliancePreflight } from "../compliance/preflight.js";
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* is redirected back to the referrer so the page can show its own thanks.
|
|
16
16
|
*/
|
|
17
17
|
import type { APIRoute } from "astro";
|
|
18
|
-
import { readD1, readKv, readEnv } from "@/lib/env";
|
|
18
|
+
import { readD1, readKv, readEnv } from "@/lib/publication/shared/env";
|
|
19
19
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
20
20
|
import { checkRateLimit } from "@/lib/access/rate/kvWindow";
|
|
21
21
|
import { NewsletterSubscribersStore } from "@/lib/engagement/newsletter/subscribers";
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* stale token renders a clean "invalid link" page — never a 500.
|
|
11
11
|
*/
|
|
12
12
|
import type { APIRoute } from "astro";
|
|
13
|
-
import { readD1 } from "@/lib/env";
|
|
13
|
+
import { readD1 } from "@/lib/publication/shared/env";
|
|
14
14
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
15
15
|
import { NewsletterSubscribersStore } from "@/lib/engagement/newsletter/subscribers";
|
|
16
16
|
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* (re-unsubscribing is a no-op success) and NON-LEAKING: an unknown token gets the exact
|
|
15
15
|
* same response as a real one, so an observer can't probe which tokens exist.
|
|
16
16
|
*
|
|
17
|
-
* NOTE (integration): The front door.s cross-site form check (lib/cdnForward.ts `crossSiteFormRefusal`,
|
|
17
|
+
* NOTE (integration): The front door.s cross-site form check (lib/publication/shared/cdnForward.ts `crossSiteFormRefusal`,
|
|
18
18
|
* the rule Astro.s `security.checkOrigin` applies) 403s a cross-origin form-encoded POST before it reaches this handler, which
|
|
19
19
|
* would break the RFC 8058 one-click POST from a mailbox provider. See the unit report.
|
|
20
20
|
*/
|
|
21
21
|
import type { APIContext } from "astro";
|
|
22
|
-
import { readD1 } from "@/lib/env";
|
|
22
|
+
import { readD1 } from "@/lib/publication/shared/env";
|
|
23
23
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
24
24
|
import { unsubscribeByToken } from "@/lib/engagement/newsletter/subscribers";
|
|
25
25
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* 500. All failures degrade to a friendly thank-you.
|
|
16
16
|
*/
|
|
17
17
|
import type { APIContext } from "astro";
|
|
18
|
-
import { readKv } from "@/lib/env";
|
|
19
|
-
import { withBase } from "@/lib/basePath";
|
|
18
|
+
import { readKv } from "@/lib/publication/shared/env";
|
|
19
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
20
20
|
|
|
21
21
|
// Minimal, permissive email shape check — we are not the source of truth for
|
|
22
22
|
// deliverability; the ESP validates properly downstream.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { APIRoute } from "astro";
|
|
16
16
|
import { rateMetric, type WebVitalName, type WebVitalsSample } from "@/lib/observability/performance/webVitals";
|
|
17
|
-
import { readKv, runAfterResponse, type CfExecutionContextLike } from "@/lib/env";
|
|
17
|
+
import { readKv, runAfterResponse, type CfExecutionContextLike } from "@/lib/publication/shared/env";
|
|
18
18
|
import { recordBlogView } from "@/lib/content/blog/viewCounts";
|
|
19
19
|
|
|
20
20
|
export const prerender = false;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* stream is ever added.
|
|
38
38
|
*/
|
|
39
39
|
import type { APIContext } from "astro";
|
|
40
|
-
import { readD1, readAnalytics, runAfterResponse, type CfExecutionContextLike } from "@/lib/env";
|
|
40
|
+
import { readD1, readAnalytics, runAfterResponse, type CfExecutionContextLike } from "@/lib/publication/shared/env";
|
|
41
41
|
import { fromD1 } from "@/lib/catalog/d1/catalog";
|
|
42
42
|
import { ingestInteractions, type StampedInteractionEvent } from "@/lib/measurement/tracking/collectorIngest";
|
|
43
43
|
import { readD1Control } from "@/lib/measurement/tracking/d1Control";
|
|
@@ -62,7 +62,7 @@ const showCodeStep = sent && errorCode !== "expired" && errorCode !== "too_many_
|
|
|
62
62
|
const devMode = import.meta.env.DEV;
|
|
63
63
|
let devAuthOn = false;
|
|
64
64
|
if (devMode) {
|
|
65
|
-
const { readEnv } = await import("@/lib/env");
|
|
65
|
+
const { readEnv } = await import("@/lib/publication/shared/env");
|
|
66
66
|
devAuthOn = (await readEnv("DEV_AUTH")) === "1";
|
|
67
67
|
}
|
|
68
68
|
---
|
|
@@ -15,12 +15,12 @@ import ActiveFilters from "@/components/catalog/storefront/plp/ActiveFilters.ast
|
|
|
15
15
|
import SortSelect from "@/components/catalog/storefront/plp/SortSelect.astro";
|
|
16
16
|
import Pagination from "@/components/catalog/storefront/plp/Pagination.astro";
|
|
17
17
|
import Img from "@/components/assets/storefront/Img.astro";
|
|
18
|
-
import { parseQuery, buildQueryString } from "@/lib/url";
|
|
18
|
+
import { parseQuery, buildQueryString } from "@/lib/publication/shared/url";
|
|
19
19
|
import { breadcrumbLd, itemListLd } from "@/lib/content/shared/jsonld";
|
|
20
20
|
import { truncate } from "@/lib/content/shared/format";
|
|
21
21
|
import { pageUrlForm } from "@/lib/content/seo/urlForm";
|
|
22
22
|
import { sourceSeoTitle } from "@/lib/content/seo/documentTitle";
|
|
23
|
-
import { withBase } from "@/lib/basePath";
|
|
23
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
24
24
|
import { isBlankDescriptionHtml, sanitizeDescriptionHtml } from "@/lib/content/sanitizeDescriptionHtml";
|
|
25
25
|
|
|
26
26
|
const { handle } = Astro.params;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { APIContext } from "astro";
|
|
9
9
|
import { compileRouteTierIndexV1 } from "@tot/public-runtime";
|
|
10
|
-
import { readKv } from "@/lib/runtimeEnv.js";
|
|
10
|
+
import { readKv } from "@/lib/publication/shared/runtimeEnv.js";
|
|
11
11
|
import {
|
|
12
12
|
declaresMountedSpacesV1,
|
|
13
13
|
feedInstantV1,
|
|
@@ -18,7 +18,7 @@ import TrustStrip from "@/components/content/storefront/content/TrustStrip.astro
|
|
|
18
18
|
import Faq from "@/components/content/storefront/marketing/Faq.astro";
|
|
19
19
|
import MarketingBlocks from "@/components/content/storefront/marketing/MarketingBlocks.astro";
|
|
20
20
|
import TierCards from "@/components/membership/storefront/membership/TierCards.astro";
|
|
21
|
-
import { withBase } from "@/lib/basePath";
|
|
21
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
22
22
|
import { rawHtmlPolicy, rawHtmlResponse } from "@/lib/content/shared/rawMarketingHtml";
|
|
23
23
|
import { renderRawComplianceTop, renderRawComplianceBottom } from "@/lib/compliance/rawComplianceNotices";
|
|
24
24
|
import AppWidgetFrame from "@/components/integrations/storefront/apps/AppWidgetFrame.astro";
|
|
@@ -13,7 +13,7 @@ import type { APIContext } from "astro";
|
|
|
13
13
|
import { nonEmptyCollections } from "@/lib/catalog/tot/query.js";
|
|
14
14
|
import { getBlogSettings, listBlogPosts } from "@/lib/content/blog/provider.js";
|
|
15
15
|
import { compileRouteTierIndexV1 } from "@tot/public-runtime";
|
|
16
|
-
import { readKv } from "@/lib/runtimeEnv.js";
|
|
16
|
+
import { readKv } from "@/lib/publication/shared/runtimeEnv.js";
|
|
17
17
|
import {
|
|
18
18
|
declaresMountedSpacesV1,
|
|
19
19
|
mountedDiscoveryUrlV1,
|
|
@@ -44,7 +44,7 @@ import { resolveMemberContext } from "@/lib/membership/eligibility";
|
|
|
44
44
|
import { truncate } from "@/lib/content/shared/format";
|
|
45
45
|
import { productLd, breadcrumbLd, reviewLd } from "@/lib/content/shared/jsonld";
|
|
46
46
|
import { isUsableImageUrl } from "@/lib/content/shared/placeholder";
|
|
47
|
-
import { withBase } from "@/lib/basePath";
|
|
47
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
48
48
|
import { productPageType, structuredDataProfile } from "@/lib/content/seo/structuredData";
|
|
49
49
|
import { pageUrlForm } from "@/lib/content/seo/urlForm";
|
|
50
50
|
import { sourceSeoTitle } from "@/lib/content/seo/documentTitle";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { APIContext } from "astro";
|
|
8
8
|
import { compileRouteTierIndexV1 } from "@tot/public-runtime";
|
|
9
|
-
import { readKv } from "@/lib/runtimeEnv.js";
|
|
9
|
+
import { readKv } from "@/lib/publication/shared/runtimeEnv.js";
|
|
10
10
|
import {
|
|
11
11
|
declaresMountedSpacesV1,
|
|
12
12
|
mountedDiscoveryUrlV1,
|
|
@@ -17,7 +17,7 @@ import EmptyState from "@/components/content/storefront/EmptyState.astro";
|
|
|
17
17
|
import Section from "@/components/content/storefront/Section.astro";
|
|
18
18
|
import { toTypeaheadDoc } from "@/lib/catalog/search/index";
|
|
19
19
|
import { breadcrumbLd } from "@/lib/content/shared/jsonld";
|
|
20
|
-
import { withBase } from "@/lib/basePath";
|
|
20
|
+
import { withBase } from "@/lib/publication/shared/basePath";
|
|
21
21
|
|
|
22
22
|
const { tenant, tot, canonicalBase, basePath } = Astro.locals;
|
|
23
23
|
// Commerce-only route (page + typeahead JSON): off for marketing tenants.
|