@tokenoftrust/storefront-runner 2.4.84 → 2.4.86
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/package.json +1 -1
- package/apps/storefront/src/components/{apps → integrations/storefront/apps}/AppWidgetFrame.astro +1 -1
- package/apps/storefront/src/config/devTenantSeed.ts +1 -1
- package/apps/storefront/src/layouts/Layout.astro +3 -3
- package/apps/storefront/src/lib/admin/README.md +3 -3
- package/apps/storefront/src/lib/admin/adminShell.ts +27 -39
- package/apps/storefront/src/lib/admin/ai/askEnvelope.ts +2 -3
- package/apps/storefront/src/lib/apps/orders/orderForwardReceiver.ts +2 -2
- package/apps/storefront/src/lib/apps/orders/orderMapper.ts +1 -1
- package/apps/storefront/src/lib/{apps → integrations/apps}/appVersionStore.ts +1 -1
- package/apps/storefront/src/lib/{apps → integrations/apps}/credentials.ts +1 -1
- package/apps/storefront/src/lib/{apps → integrations/apps}/orders/idempotency.ts +1 -1
- package/apps/storefront/src/lib/{apps → integrations/apps}/registryAccess.ts +2 -2
- package/apps/storefront/src/lib/{apps → integrations/apps}/registryService.ts +1 -1
- package/apps/storefront/src/lib/{integration → integrations/integration}/browserEnvironment.ts +1 -1
- package/apps/storefront/src/lib/{integration → integrations/integration}/managedInstallDeclarations.ts +1 -1
- package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/deliveryEngine.ts +1 -1
- package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/deliveryStore.ts +1 -1
- package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/emit.ts +2 -2
- package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/getDispatcher.ts +2 -2
- package/apps/storefront/src/middleware/controlPlane.ts +1 -1
- package/apps/storefront/src/middleware/renderChain.ts +5 -5
- package/apps/storefront/src/pages/index.astro +3 -3
- package/apps/storefront/src/pages/products/[handle].astro +3 -3
- package/docs/widget-library-guide.md +1 -1
- package/package.json +1 -1
- package/packages/public-runtime/src/customization-scripts.ts +1 -1
- /package/apps/storefront/src/components/{WidgetFrame.astro → integrations/storefront/WidgetFrame.astro} +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/gatewayKeys.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/gtmMigrationDraft.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/orders/customerHash.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/routeParams.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/scopes.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/widgets/eligibility.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/widgets/frameProps.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/widgets/launchToken.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/widgets/placements.ts +0 -0
- /package/apps/storefront/src/lib/{apps → integrations/apps}/widgets/renderSlot.ts +0 -0
- /package/apps/storefront/src/lib/{integration → integrations/integration}/bakedManagedInstalls.ts +0 -0
- /package/apps/storefront/src/lib/{integration → integrations/integration}/nonceStamp.ts +0 -0
- /package/apps/storefront/src/lib/{integration → integrations/integration}/renderIntegrationState.ts +0 -0
- /package/apps/storefront/src/lib/{integration → integrations/integration}/stageDestinationIds.ts +0 -0
- /package/apps/storefront/src/lib/{integration → integrations/integration}/tenantAnalyticsDeclarations.ts +0 -0
- /package/apps/storefront/src/lib/{integration → integrations/integration}/tenantDeclarations.ts +0 -0
- /package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/cloudflareQueueDispatcher.ts +0 -0
- /package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/deliveryMapper.ts +0 -0
- /package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/dispatcher.ts +0 -0
- /package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/endpointGuard.ts +0 -0
- /package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/events.ts +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"preview": "wrangler dev",
|
|
15
15
|
"typecheck": "astro check && tsc --noEmit",
|
|
16
16
|
"astro": "astro",
|
|
17
|
-
"test": "NODE_OPTIONS=--experimental-sqlite vitest run --exclude src/lib/apps/v84CleanCloneReplay.test.ts --exclude src/lib/apps/v84NonportableRouteDogfood.test.ts --exclude src/lib/apps/v84CloneLifecycleEvidence.test.ts && NODE_OPTIONS=--experimental-sqlite vitest run src/lib/apps/v84CleanCloneReplay.test.ts src/lib/apps/v84NonportableRouteDogfood.test.ts src/lib/apps/v84CloneLifecycleEvidence.test.ts --fileParallelism=false && pnpm run test:pipeline && pnpm run test:pipeline-faults"
|
|
17
|
+
"test": "NODE_OPTIONS=--experimental-sqlite vitest run --exclude src/lib/integrations/apps/v84CleanCloneReplay.test.ts --exclude src/lib/integrations/apps/v84NonportableRouteDogfood.test.ts --exclude src/lib/integrations/apps/v84CloneLifecycleEvidence.test.ts && NODE_OPTIONS=--experimental-sqlite vitest run src/lib/integrations/apps/v84CleanCloneReplay.test.ts src/lib/integrations/apps/v84NonportableRouteDogfood.test.ts src/lib/integrations/apps/v84CloneLifecycleEvidence.test.ts --fileParallelism=false && pnpm run test:pipeline && pnpm run test:pipeline-faults"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@astrojs/cloudflare": "^14.0.1",
|
package/apps/storefront/src/components/{apps → integrations/storefront/apps}/AppWidgetFrame.astro
RENAMED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* `<iframe>` for the parent-side `mountWidgetPostMessageBridge()`
|
|
11
11
|
* (`@tot/public-runtime`) to scan for.
|
|
12
12
|
*/
|
|
13
|
-
import { buildAppWidgetFrameAttrs, type AppWidgetFrameProps } from "@/lib/apps/widgets/frameProps.js";
|
|
13
|
+
import { buildAppWidgetFrameAttrs, type AppWidgetFrameProps } from "@/lib/integrations/apps/widgets/frameProps.js";
|
|
14
14
|
|
|
15
15
|
type Props = AppWidgetFrameProps;
|
|
16
16
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
import type { DeepPartial, TenantConfig, ThemeTokens } from "@tot/public-runtime";
|
|
29
29
|
import { SHARED_DEMO_CHECKOUT } from "@tot/public-runtime";
|
|
30
30
|
import { rootPublicationSpaceConfig } from "./publicationSpaceConfig";
|
|
31
|
-
import { loadTenantAnalyticsDeclarations } from "@/lib/integration/tenantAnalyticsDeclarations";
|
|
31
|
+
import { loadTenantAnalyticsDeclarations } from "@/lib/integrations/integration/tenantAnalyticsDeclarations";
|
|
32
32
|
|
|
33
33
|
/** Per-dir overrides the resolver derives from disk before synthesis. */
|
|
34
34
|
export interface DevTenantHints {
|
|
@@ -38,9 +38,9 @@ import { bindManagedCartAnchors, managedCartHref } from "@/lib/chrome/managedCar
|
|
|
38
38
|
import type { HeaderVariant, FooterVariant } from "@/lib/chrome/model";
|
|
39
39
|
import { renderIntegrationPhases, INTERACTION_TRACKING_BOOT_JS } from "@tot/public-runtime";
|
|
40
40
|
import { readViewerSession } from "@/lib/auth/route";
|
|
41
|
-
import AppWidgetFrame from "@/components/apps/AppWidgetFrame.astro";
|
|
42
|
-
import { getRegistryService } from "@/lib/apps/registryAccess.js";
|
|
43
|
-
import { renderWidgetSlot } from "@/lib/apps/widgets/renderSlot.js";
|
|
41
|
+
import AppWidgetFrame from "@/components/integrations/storefront/apps/AppWidgetFrame.astro";
|
|
42
|
+
import { getRegistryService } from "@/lib/integrations/apps/registryAccess.js";
|
|
43
|
+
import { renderWidgetSlot } from "@/lib/integrations/apps/widgets/renderSlot.js";
|
|
44
44
|
|
|
45
45
|
interface Props {
|
|
46
46
|
title: string;
|
|
@@ -81,8 +81,8 @@ lib/admin/
|
|
|
81
81
|
testable source of truth for what the floating Ask button emits — the full
|
|
82
82
|
tenant envelope, active tab, selected record id (if any), role +
|
|
83
83
|
permissions (derived from `isStaff`), active filters, and evidence context.
|
|
84
|
-
`
|
|
85
|
-
|
|
84
|
+
The processed `adminShell.ts` client imports this builder and emits its
|
|
85
|
+
result on Ask-button click as
|
|
86
86
|
`window.__toTAdminAsk` and a `tot:admin-ask` `CustomEvent` — **dev-inspectable
|
|
87
87
|
only, no chat backend yet.** The envelope changes whenever the active tab
|
|
88
88
|
changes (kept current by `setAskContext`) and is rebuilt fresh on click so a
|
|
@@ -117,6 +117,6 @@ const orders = getOrdersViewModel({
|
|
|
117
117
|
- **Tabs/pages → lib, never lib → tabs/pages.** Nothing under `lib/admin/**`
|
|
118
118
|
imports from `components/admin/**` or `pages/admin.astro`. Tab components
|
|
119
119
|
and `admin.astro` are free to import from here (`admin.astro` already does,
|
|
120
|
-
for `resolveAdminTenantMode` and the
|
|
120
|
+
for `resolveAdminTenantMode` and the shared shell configuration).
|
|
121
121
|
- Gaps in these contracts should go back to the workstream board as a
|
|
122
122
|
decision, not get patched from a tab's unit.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* the tablists. Imported from a processed `<script>` in admin.astro (ADR 0013):
|
|
5
5
|
* type-checked, bundled, tree-shaken, and its bundle hash is in the enforced
|
|
6
6
|
* CSP. The Ask envelope is built with the shared, unit-tested
|
|
7
|
-
* `buildAskEnvelope` (ai/askEnvelope)
|
|
7
|
+
* `buildAskEnvelope` (ai/askEnvelope).
|
|
8
8
|
*
|
|
9
9
|
* There is no chat backend yet — the Ask envelope is emitted for dev inspection
|
|
10
10
|
* only (window.__toTAdminAsk + a "tot:admin-ask" CustomEvent), never sent over
|
|
@@ -12,33 +12,23 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { buildAskEnvelope, type AskEnvelope } from "./ai/askEnvelope";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
orders: "
|
|
31
|
-
|
|
32
|
-
subscriptions: "Subscriptions",
|
|
33
|
-
customers: "Customers",
|
|
34
|
-
fulfillment: "Fulfillment",
|
|
35
|
-
reporting: "Reporting",
|
|
36
|
-
"ai-workflows": "AI Workflows",
|
|
37
|
-
blog: "Blog",
|
|
38
|
-
publish: "Publish",
|
|
39
|
-
integrations: "Integrations",
|
|
40
|
-
settings: "Settings",
|
|
41
|
-
};
|
|
15
|
+
/** Static shell data shared by server-rendered navigation and browser startup. */
|
|
16
|
+
export const ADMIN_SHELL_CONFIG = {
|
|
17
|
+
workAreas: [
|
|
18
|
+
{ id: "orders", label: "Orders", icon: "i-file" },
|
|
19
|
+
{ id: "products", label: "Products", icon: "i-box" },
|
|
20
|
+
{ id: "subscriptions", label: "Subscriptions", icon: "i-refresh" },
|
|
21
|
+
{ id: "customers", label: "Customers", icon: "i-users" },
|
|
22
|
+
{ id: "fulfillment", label: "Fulfillment", icon: "i-truck" },
|
|
23
|
+
{ id: "reporting", label: "Reporting", icon: "i-chart" },
|
|
24
|
+
{ id: "ai-workflows", label: "AI Workflows", icon: "i-workflows" },
|
|
25
|
+
{ id: "blog", label: "Blog", icon: "i-file" },
|
|
26
|
+
{ id: "publish", label: "Publish", icon: "i-export" },
|
|
27
|
+
{ id: "integrations", label: "Integrations", icon: "i-workflows" },
|
|
28
|
+
{ id: "settings", label: "Settings", icon: "i-gear" },
|
|
29
|
+
],
|
|
30
|
+
defaultTabs: { staff: "orders", merchant: "settings" },
|
|
31
|
+
} as const;
|
|
42
32
|
|
|
43
33
|
declare global {
|
|
44
34
|
interface Window {
|
|
@@ -47,11 +37,13 @@ declare global {
|
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
export function initAdminShell(): void {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
40
|
+
const tabIds = ADMIN_SHELL_CONFIG.workAreas.map(({ id }) => id);
|
|
41
|
+
const tabSet = new Set<string>(tabIds);
|
|
42
|
+
const tabHashPattern = new RegExp(`^#(${tabIds.join("|")})$`);
|
|
52
43
|
const canViewInternalGuide =
|
|
53
44
|
document.documentElement.dataset.internalAdminGuide === "true";
|
|
54
|
-
const defaultTab =
|
|
45
|
+
const defaultTab =
|
|
46
|
+
ADMIN_SHELL_CONFIG.defaultTabs[canViewInternalGuide ? "staff" : "merchant"];
|
|
55
47
|
|
|
56
48
|
const buildAskEnvelopeForTab = (id: string): AskEnvelope => {
|
|
57
49
|
const root = document.documentElement.dataset;
|
|
@@ -74,7 +66,9 @@ export function initAdminShell(): void {
|
|
|
74
66
|
};
|
|
75
67
|
|
|
76
68
|
const setAskContext = (id: string): void => {
|
|
77
|
-
const label =
|
|
69
|
+
const label =
|
|
70
|
+
ADMIN_SHELL_CONFIG.workAreas.find((area) => area.id === id)?.label ??
|
|
71
|
+
"Storefront";
|
|
78
72
|
const askButton = document.querySelector<HTMLElement>("[data-admin-ask]");
|
|
79
73
|
const askContext = document.querySelector<HTMLElement>(
|
|
80
74
|
"[data-admin-ask-context]",
|
|
@@ -196,7 +190,7 @@ export function initAdminShell(): void {
|
|
|
196
190
|
// normalized away to #settings for merchant viewers.
|
|
197
191
|
const hashTab = window.location.hash.slice(1).split("?")[0] ?? "";
|
|
198
192
|
if (!canViewInternalGuide && !tabSet.has(hashTab)) {
|
|
199
|
-
history.replaceState(null, "",
|
|
193
|
+
history.replaceState(null, "", `#${defaultTab}`);
|
|
200
194
|
}
|
|
201
195
|
if (scroll) requestAnimationFrame(() => scrollToHashTarget(panelId));
|
|
202
196
|
return;
|
|
@@ -229,12 +223,6 @@ export function initAdminShell(): void {
|
|
|
229
223
|
const envelope = buildAskEnvelopeForTab(activeTab);
|
|
230
224
|
window.__toTAdminAsk = envelope;
|
|
231
225
|
document.dispatchEvent(new CustomEvent("tot:admin-ask", { detail: envelope }));
|
|
232
|
-
if (
|
|
233
|
-
window.location.hostname === "localhost" ||
|
|
234
|
-
window.location.hostname === "127.0.0.1"
|
|
235
|
-
) {
|
|
236
|
-
console.debug("[admin:ask]", envelope);
|
|
237
|
-
}
|
|
238
226
|
});
|
|
239
227
|
|
|
240
228
|
document.addEventListener("click", (event) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The floating `Ask` button's context envelope (baseline §Horizontal AI
|
|
3
3
|
* Concepts / Ask; ai-evidence-substrate item a). PURE + no I/O so it is
|
|
4
|
-
* unit-testable and reusable from
|
|
5
|
-
* plain-object mirror, since `is:inline` scripts cannot import modules) and
|
|
4
|
+
* unit-testable and reusable from the processed adminShell.ts client and
|
|
6
5
|
* any future server-side Ask route. There is no chat backend yet — today
|
|
7
|
-
* this is emitted for dev inspection only (see
|
|
6
|
+
* this is emitted for dev inspection only (see adminShell.ts's `data-admin-ask`
|
|
8
7
|
* click handler), never sent over the network.
|
|
9
8
|
*/
|
|
10
9
|
import type { AdminTenantEnvelope } from "../envelope";
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
* see `docs/private-apps/order-forward-contract.md` for the full rationale.
|
|
34
34
|
*/
|
|
35
35
|
import { OrdersStore, ScrappyOrderLedger, type OrderLineItem, type OrderStatus, type Order } from "./ordersStore.js";
|
|
36
|
-
import { emitWebhookEvent } from "../../webhooks/emit.js";
|
|
37
|
-
import type { WebhookTopic } from "../../webhooks/deliveryStore.js";
|
|
36
|
+
import { emitWebhookEvent } from "../../integrations/webhooks/emit.js";
|
|
37
|
+
import type { WebhookTopic } from "../../integrations/webhooks/deliveryStore.js";
|
|
38
38
|
import type { Queryable } from "../../d1/catalog.js";
|
|
39
39
|
import {
|
|
40
40
|
createLocalJWKSet,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* internals — and never lets a raw customer identifier leave this module:
|
|
9
9
|
* customer identity is always the per-(tenant, install) `customerHash`.
|
|
10
10
|
*/
|
|
11
|
-
import { customerHash } from "
|
|
11
|
+
import { customerHash } from "../../integrations/apps/orders/customerHash.js";
|
|
12
12
|
import type { FoxyOrder, FoxyOrderLineItem } from "./foxyOrderClient.js";
|
|
13
13
|
import {
|
|
14
14
|
COMPLIANCE_STATES,
|
|
@@ -37,7 +37,7 @@ import type {
|
|
|
37
37
|
NormalizedContribution,
|
|
38
38
|
} from "@tot/public-runtime";
|
|
39
39
|
import { findForbiddenFields } from "@tot/public-runtime";
|
|
40
|
-
import type { Queryable, QueryStatement } from "
|
|
40
|
+
import type { Queryable, QueryStatement } from "../../d1/catalog.js";
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* One managed-app version's COMPLETE restorable facet set — everything a rollback
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { sha256Hex } from "@tot/public-runtime";
|
|
21
21
|
import type { CredentialPort, IssuedCredential } from "./registryService.js";
|
|
22
|
-
import type { Queryable } from "
|
|
22
|
+
import type { Queryable } from "../../d1/catalog.js";
|
|
23
23
|
|
|
24
24
|
/** `IssuedCredential` plus the one-time plaintext secret — never stored, never re-returned. */
|
|
25
25
|
export type IssuedCredentialSecret = IssuedCredential & { secret: string };
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* idempotent write route can reuse this.
|
|
15
15
|
*/
|
|
16
16
|
import { sha256Hex } from "@tot/public-runtime";
|
|
17
|
-
import type { Queryable } from "
|
|
17
|
+
import type { Queryable } from "../../../d1/catalog.js";
|
|
18
18
|
|
|
19
19
|
export type IdempotencyCheck =
|
|
20
20
|
| { status: "proceed" }
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
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
|
-
import { fromD1 } from "
|
|
20
|
-
import { readD1, readEnv } from "
|
|
19
|
+
import { fromD1 } from "../../d1/catalog.js";
|
|
20
|
+
import { readD1, readEnv } from "../../env.js";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* No-store JSON response — install/rotate bodies carry a one-time client
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
type PlanIntegrationEntry,
|
|
71
71
|
type PlanIntegrationConsent,
|
|
72
72
|
} from "@tot/public-runtime";
|
|
73
|
-
import type { Queryable } from "
|
|
73
|
+
import type { Queryable } from "../../d1/catalog.js";
|
|
74
74
|
|
|
75
75
|
export type AppInstallStatus = "active" | "suspended" | "uninstalled";
|
|
76
76
|
|
package/apps/storefront/src/lib/{integration → integrations/integration}/browserEnvironment.ts
RENAMED
|
@@ -23,7 +23,7 @@ import { isAdminPath } from "@/lib/auth/loginGate";
|
|
|
23
23
|
import {
|
|
24
24
|
resolveIntegrationRenderState,
|
|
25
25
|
type IntegrationRenderState,
|
|
26
|
-
} from "@/lib/integration/renderIntegrationState";
|
|
26
|
+
} from "@/lib/integrations/integration/renderIntegrationState";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* The non-secret render revision: the commit SHA this build was cut from (baked at
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type IntegrationDeclarationInput,
|
|
12
12
|
} from "@tot/public-runtime";
|
|
13
13
|
import { AppVersionStore } from "../apps/appVersionStore.js";
|
|
14
|
-
import type { Queryable } from "
|
|
14
|
+
import type { Queryable } from "../../d1/catalog.js";
|
|
15
15
|
import { migrateLegacyDestinationIds, parseStageDestinationIds } from "./stageDestinationIds.js";
|
|
16
16
|
|
|
17
17
|
const MANAGED_KIND = "managed-analytics-v1";
|
|
@@ -28,7 +28,7 @@ import { buildCloudEventEnvelope } from "./events.js";
|
|
|
28
28
|
import { computeBackoffDelaySeconds, MAX_DELIVERY_ATTEMPTS, type AttemptOutcome } from "./dispatcher.js";
|
|
29
29
|
import { validateWebhookEndpoint } from "./endpointGuard.js";
|
|
30
30
|
import { COMMERCE_SCHEDULER } from "@tot/public-runtime";
|
|
31
|
-
import type { Queryable } from "
|
|
31
|
+
import type { Queryable } from "../../d1/catalog.js";
|
|
32
32
|
|
|
33
33
|
/** Bounded per-attempt timeout — a hung receiver must not hold a dispatcher slot open indefinitely. */
|
|
34
34
|
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* the delivery via `getOrThrowDelivery` before returning it, the same
|
|
40
40
|
* read-after-write discipline `AppRegistryService` uses.
|
|
41
41
|
*/
|
|
42
|
-
import type { Queryable } from "
|
|
42
|
+
import type { Queryable } from "../../d1/catalog.js";
|
|
43
43
|
|
|
44
44
|
/** Mirrors the `Delivery.topic` / CloudEvents channel enum in the D1/D2 contract. */
|
|
45
45
|
export type WebhookTopic =
|
|
@@ -50,8 +50,8 @@ import { TOPIC_REQUIRED_SCOPE } from "./events.js";
|
|
|
50
50
|
import { getDispatcher } from "./getDispatcher.js";
|
|
51
51
|
import { getRegistryService } from "../apps/registryAccess.js";
|
|
52
52
|
import type { AppInstall } from "../apps/registryService.js";
|
|
53
|
-
import { fromD1 } from "
|
|
54
|
-
import { readD1 } from "
|
|
53
|
+
import { fromD1 } from "../../d1/catalog.js";
|
|
54
|
+
import { readD1 } from "../../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";
|
|
@@ -22,8 +22,8 @@ import { AppRegistryService } from "../apps/registryService.js";
|
|
|
22
22
|
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
|
-
import { fromD1, type Queryable } from "
|
|
26
|
-
import { readD1, readEnv, readQueue } from "
|
|
25
|
+
import { fromD1, type Queryable } from "../../d1/catalog.js";
|
|
26
|
+
import { readD1, readEnv, readQueue } from "../../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`. */
|
|
@@ -10,7 +10,7 @@ import type { APIContext, MiddlewareNext } from "astro";
|
|
|
10
10
|
import { readEnv, readD1, readKv } from "@/lib/env";
|
|
11
11
|
import { fromD1, type D1Like } from "@/lib/d1/catalog";
|
|
12
12
|
import { readCurrentTenantConsentConfig } from "@/lib/apps/consentConfigRead";
|
|
13
|
-
import { loadActiveManagedInstallDeclarations } from "@/lib/integration/managedInstallDeclarations";
|
|
13
|
+
import { loadActiveManagedInstallDeclarations } from "@/lib/integrations/integration/managedInstallDeclarations";
|
|
14
14
|
import { buildTenantConsentBroker, verifyPreviewToken } from "@tot/public-runtime";
|
|
15
15
|
import { tenantIsDeclaredPublic } from "@/config/tenants";
|
|
16
16
|
import type {
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
verifyConsentSnapshotSig,
|
|
65
65
|
resolveNativeGa4SandboxUrl,
|
|
66
66
|
} from "@tot/public-runtime";
|
|
67
|
-
import { readBakedManagedInstalls } from "@/lib/integration/bakedManagedInstalls";
|
|
67
|
+
import { readBakedManagedInstalls } from "@/lib/integrations/integration/bakedManagedInstalls";
|
|
68
68
|
import { readWithImagePreviewRewriteOverlay } from "@tot/public-runtime/image-preview-rewrite-overlay";
|
|
69
69
|
import type {
|
|
70
70
|
CapabilityConfig,
|
|
@@ -84,24 +84,24 @@ import {
|
|
|
84
84
|
HTML_CACHE_POLICY_CAPTURE_PROBE,
|
|
85
85
|
} from "@tot/public-runtime";
|
|
86
86
|
import { publicationContentRedirectLocationV1 } from "@tot/public-runtime/publication-content-redirects";
|
|
87
|
-
import { loadTenantIntegrationDeclarations } from "@/lib/integration/tenantDeclarations";
|
|
87
|
+
import { loadTenantIntegrationDeclarations } from "@/lib/integrations/integration/tenantDeclarations";
|
|
88
88
|
import { resolveTenantCommerce } from "@/lib/checkoutCommerce";
|
|
89
89
|
import {
|
|
90
90
|
requestBrowserEnvironment,
|
|
91
91
|
previewBrowserEnvironment,
|
|
92
92
|
deriveSiteSurface,
|
|
93
93
|
cspHeaderName,
|
|
94
|
-
} from "@/lib/integration/browserEnvironment";
|
|
94
|
+
} from "@/lib/integrations/integration/browserEnvironment";
|
|
95
95
|
import {
|
|
96
96
|
carriesLiveNonce,
|
|
97
97
|
freshNonce,
|
|
98
98
|
isErrorPageReroute,
|
|
99
99
|
stampResponseNonce,
|
|
100
|
-
} from "@/lib/integration/nonceStamp";
|
|
100
|
+
} from "@/lib/integrations/integration/nonceStamp";
|
|
101
101
|
import {
|
|
102
102
|
composeIntegrationDeclarations,
|
|
103
103
|
resolveIntegrationRenderState,
|
|
104
|
-
} from "@/lib/integration/renderIntegrationState";
|
|
104
|
+
} from "@/lib/integrations/integration/renderIntegrationState";
|
|
105
105
|
import { recordActivity } from "@/lib/activity/recordActivity";
|
|
106
106
|
import { middlewareRewriteTargetV1 } from "./routeBranch.js";
|
|
107
107
|
import { declaredTenantOrigins } from "@/lib/tenantOrigins";
|
|
@@ -21,9 +21,9 @@ import TierCards from "@/components/membership/storefront/membership/TierCards.a
|
|
|
21
21
|
import { withBase } from "@/lib/basePath";
|
|
22
22
|
import { rawHtmlPolicy, rawHtmlResponse } from "@/lib/rawMarketingHtml";
|
|
23
23
|
import { renderRawComplianceTop, renderRawComplianceBottom } from "@/lib/compliance/rawComplianceNotices";
|
|
24
|
-
import AppWidgetFrame from "@/components/apps/AppWidgetFrame.astro";
|
|
25
|
-
import { getRegistryService } from "@/lib/apps/registryAccess.js";
|
|
26
|
-
import { renderWidgetSlot } from "@/lib/apps/widgets/renderSlot.js";
|
|
24
|
+
import AppWidgetFrame from "@/components/integrations/storefront/apps/AppWidgetFrame.astro";
|
|
25
|
+
import { getRegistryService } from "@/lib/integrations/apps/registryAccess.js";
|
|
26
|
+
import { renderWidgetSlot } from "@/lib/integrations/apps/widgets/renderSlot.js";
|
|
27
27
|
import type { CatalogCollection, CatalogProduct } from "@tot/public-runtime";
|
|
28
28
|
import {
|
|
29
29
|
isMarketingBlock,
|
|
@@ -49,9 +49,9 @@ import { productPageType, structuredDataProfile } from "@/lib/seo/structuredData
|
|
|
49
49
|
import { pageUrlForm } from "@/lib/seo/urlForm";
|
|
50
50
|
import { sourceSeoTitle } from "@/lib/seo/documentTitle";
|
|
51
51
|
import { shippingPolicyPath } from "@/lib/commerce/shippingPolicy";
|
|
52
|
-
import AppWidgetFrame from "@/components/apps/AppWidgetFrame.astro";
|
|
53
|
-
import { getRegistryService } from "@/lib/apps/registryAccess.js";
|
|
54
|
-
import { renderWidgetSlot } from "@/lib/apps/widgets/renderSlot.js";
|
|
52
|
+
import AppWidgetFrame from "@/components/integrations/storefront/apps/AppWidgetFrame.astro";
|
|
53
|
+
import { getRegistryService } from "@/lib/integrations/apps/registryAccess.js";
|
|
54
|
+
import { renderWidgetSlot } from "@/lib/integrations/apps/widgets/renderSlot.js";
|
|
55
55
|
|
|
56
56
|
const { handle } = Astro.params;
|
|
57
57
|
const { tenant, tot, canonicalBase, basePath, apiBasePath, commerce } = Astro.locals;
|
|
@@ -1317,7 +1317,7 @@ Shared primitives composed by the higher-level widgets, plus the homepage hero.
|
|
|
1317
1317
|
<Img src={image?.url} rehosted={image?.rehosted} seed={image?.id ?? handle} alt={title} width={800} height={1000} sizes="(min-width:1024px) 25vw, 100vw" priority />
|
|
1318
1318
|
```
|
|
1319
1319
|
|
|
1320
|
-
### WidgetFrame (`components/WidgetFrame.astro`)
|
|
1320
|
+
### WidgetFrame (`components/integrations/storefront/WidgetFrame.astro`)
|
|
1321
1321
|
|
|
1322
1322
|
- **Purpose:** Renders a tenant-registered widget (`isolation: "sandbox"`) in a sandboxed iframe —
|
|
1323
1323
|
`allow-scripts` without `allow-same-origin` puts it in an opaque origin (can't read page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.86",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tenant browser-script vocabulary the renderer needs: the slot / strategy /
|
|
3
3
|
* isolation constants, the CSP hash helper, and the sandboxed widget iframe
|
|
4
|
-
* attributes the renderer draws (`components/WidgetFrame.astro`).
|
|
4
|
+
* attributes the renderer draws (`components/integrations/storefront/WidgetFrame.astro`).
|
|
5
5
|
*
|
|
6
6
|
* Dependency-free + Workers-portable (Web Crypto, btoa).
|
|
7
7
|
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/apps/storefront/src/lib/{integration → integrations/integration}/bakedManagedInstalls.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/apps/storefront/src/lib/{integration → integrations/integration}/renderIntegrationState.ts
RENAMED
|
File without changes
|
/package/apps/storefront/src/lib/{integration → integrations/integration}/stageDestinationIds.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/apps/storefront/src/lib/{integration → integrations/integration}/tenantDeclarations.ts
RENAMED
|
File without changes
|
/package/apps/storefront/src/lib/{webhooks → integrations/webhooks}/cloudflareQueueDispatcher.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|