@growth-labs/store 0.2.0 → 0.2.2
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/dist/client.d.ts +16 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -1
- package/dist/client.js.map +1 -1
- package/dist/collections.d.ts +35 -0
- package/dist/collections.d.ts.map +1 -1
- package/dist/collections.js +77 -0
- package/dist/collections.js.map +1 -1
- package/dist/health.d.ts +8 -5
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +12 -9
- package/dist/health.js.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +31 -26
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +11 -7
- package/dist/options.js.map +1 -1
- package/dist/routes/cart-bootstrap.d.ts.map +1 -1
- package/dist/routes/cart-bootstrap.js +2 -1
- package/dist/routes/cart-bootstrap.js.map +1 -1
- package/dist/routes/checkout.d.ts.map +1 -1
- package/dist/routes/checkout.js +2 -1
- package/dist/routes/checkout.js.map +1 -1
- package/dist/routes/webhook.d.ts.map +1 -1
- package/dist/routes/webhook.js +29 -1
- package/dist/routes/webhook.js.map +1 -1
- package/dist/state.d.ts +2 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +32 -2
- package/dist/state.js.map +1 -1
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +8 -0
- package/src/collections.ts +95 -0
- package/src/components/StoreCartPage.astro +1 -1
- package/src/components/StoreCollectionPage.astro +35 -15
- package/src/components/StoreIndexPage.astro +10 -4
- package/src/components/StoreProductPage.astro +1 -1
- package/src/health.ts +14 -11
- package/src/index.ts +17 -1
- package/src/options.ts +11 -7
- package/src/routes/cart-bootstrap.ts +2 -1
- package/src/routes/checkout.ts +2 -1
- package/src/routes/webhook.ts +31 -1
- package/src/state.ts +34 -2
- package/src/types.ts +6 -0
- package/src/virtual.d.ts +2 -2
package/dist/routes/checkout.js
CHANGED
|
@@ -2,10 +2,11 @@ import { env as cloudflareEnv } from 'cloudflare:workers';
|
|
|
2
2
|
import { createCheckoutResponse } from '../api.js';
|
|
3
3
|
import { getConfig } from '../state.js';
|
|
4
4
|
export async function POST(context) {
|
|
5
|
+
const config = await getConfig();
|
|
5
6
|
return createCheckoutResponse({
|
|
6
7
|
request: context.request,
|
|
7
8
|
env: cloudflareEnv,
|
|
8
|
-
cartOrigin:
|
|
9
|
+
cartOrigin: config.cartOrigin,
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
12
|
export function ALL() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/routes/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAAoB,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAmB;IAC7C,OAAO,sBAAsB,CAAC;QAC7B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,EAAE,aAA4B;QACjC,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/routes/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAAoB,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAmB;IAC7C,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAA;IAChC,OAAO,sBAAsB,CAAC;QAC7B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,EAAE,aAA4B;QACjC,UAAU,EAAE,MAAM,CAAC,UAAU;KAC7B,CAAC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,GAAG;IAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;AACvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/routes/webhook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/routes/webhook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAgCvC,wBAAsB,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAMjE;AAED,wBAAgB,GAAG,IAAI,QAAQ,CAE9B"}
|
package/dist/routes/webhook.js
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import { env as cloudflareEnv } from 'cloudflare:workers';
|
|
2
|
-
import { createWebhookResponse } from '../api.js';
|
|
2
|
+
import { createWebhookResponse, setOrderPlacedHandler } from '../api.js';
|
|
3
|
+
import { createD1OrderHandler } from '../orders.js';
|
|
4
|
+
import { getConfigOrNull } from '../state.js';
|
|
5
|
+
let orderHandlerRegistered = false;
|
|
6
|
+
/**
|
|
7
|
+
* `store()`'s `astro:config:setup` hook also calls `setOrderPlacedHandler`,
|
|
8
|
+
* but that call runs in the astro CLI's Node process while loading
|
|
9
|
+
* astro.config.mjs — a different module instantiation than the one a built
|
|
10
|
+
* Worker ships (see state.ts). This route module IS part of the Worker's own
|
|
11
|
+
* runtime bundle (it's `injectRoute`-registered), so it registers the D1
|
|
12
|
+
* order handler itself, once, against the exact `api.js` instance this
|
|
13
|
+
* route's `createWebhookResponse` call also uses. Idempotent with the
|
|
14
|
+
* config-setup-time call — whichever runs last in a given process wins, and
|
|
15
|
+
* both install the same handler shape.
|
|
16
|
+
*/
|
|
17
|
+
async function ensureOrderHandlerRegistered() {
|
|
18
|
+
if (orderHandlerRegistered)
|
|
19
|
+
return;
|
|
20
|
+
const config = await getConfigOrNull();
|
|
21
|
+
if (!config)
|
|
22
|
+
return;
|
|
23
|
+
setOrderPlacedHandler(createD1OrderHandler({
|
|
24
|
+
d1Binding: config.telemetry.d1Binding,
|
|
25
|
+
waeBinding: config.telemetry.waeBinding,
|
|
26
|
+
siteId: config.telemetry.siteId,
|
|
27
|
+
}));
|
|
28
|
+
orderHandlerRegistered = true;
|
|
29
|
+
}
|
|
3
30
|
export async function POST(context) {
|
|
31
|
+
await ensureOrderHandlerRegistered();
|
|
4
32
|
return createWebhookResponse({
|
|
5
33
|
request: context.request,
|
|
6
34
|
env: cloudflareEnv,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/routes/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAAE,qBAAqB,EAAmB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/routes/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEzD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAmB,MAAM,WAAW,CAAA;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,IAAI,sBAAsB,GAAG,KAAK,CAAA;AAElC;;;;;;;;;;GAUG;AACH,KAAK,UAAU,4BAA4B;IAC1C,IAAI,sBAAsB;QAAE,OAAM;IAClC,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAA;IACtC,IAAI,CAAC,MAAM;QAAE,OAAM;IACnB,qBAAqB,CACpB,oBAAoB,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,SAAS;QACrC,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,UAAU;QACvC,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM;KAC/B,CAAC,CACF,CAAA;IACD,sBAAsB,GAAG,IAAI,CAAA;AAC9B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAmB;IAC7C,MAAM,4BAA4B,EAAE,CAAA;IACpC,OAAO,qBAAqB,CAAC;QAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,GAAG,EAAE,aAA2B;KAChC,CAAC,CAAA;AACH,CAAC;AAED,MAAM,UAAU,GAAG;IAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;AACvE,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedStoreOptions } from './options.js';
|
|
2
2
|
export declare function _setConfig(next: ResolvedStoreOptions): void;
|
|
3
|
-
export declare function getConfig(): ResolvedStoreOptions
|
|
4
|
-
export declare function getConfigOrNull(): ResolvedStoreOptions | null
|
|
3
|
+
export declare function getConfig(): Promise<ResolvedStoreOptions>;
|
|
4
|
+
export declare function getConfigOrNull(): Promise<ResolvedStoreOptions | null>;
|
|
5
5
|
//# sourceMappingURL=state.d.ts.map
|
package/dist/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAIxD,wBAAgB,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAE3D;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAIxD,wBAAgB,UAAU,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAE3D;AA4BD,wBAAsB,SAAS,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAU/D;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAK5E"}
|
package/dist/state.js
CHANGED
|
@@ -2,13 +2,43 @@ let config = null;
|
|
|
2
2
|
export function _setConfig(next) {
|
|
3
3
|
config = next;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* `_setConfig` is called both by `store()`'s `astro:config:setup` hook — which
|
|
7
|
+
* runs in the astro CLI's Node process while *loading* astro.config.mjs, a
|
|
8
|
+
* different module instantiation than the one the built Worker ships — and by
|
|
9
|
+
* the vite-plugin-generated `virtual:growth-labs/store/config` module, which
|
|
10
|
+
* bakes the resolved options in as literal data and calls `_setConfig` as
|
|
11
|
+
* part of its own module body. The virtual module is the only one of the two
|
|
12
|
+
* that is guaranteed to execute inside the actual bundled Worker's runtime
|
|
13
|
+
* module graph, so it is the fallback here.
|
|
14
|
+
*
|
|
15
|
+
* A dynamic import keeps the `virtual:` specifier off every caller's static
|
|
16
|
+
* import graph (the pure-Node import gate, and any non-Vite tooling, would
|
|
17
|
+
* otherwise choke on the scheme) — see scripts/verify-pure-node-import.mjs
|
|
18
|
+
* and health.ts's identical `cloudflare:workers` pattern.
|
|
19
|
+
*/
|
|
20
|
+
async function resolveViaVirtualModule() {
|
|
21
|
+
try {
|
|
22
|
+
const mod = (await import('virtual:growth-labs/store/config'));
|
|
23
|
+
return mod?.config ?? null;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function getConfig() {
|
|
30
|
+
if (!config) {
|
|
31
|
+
config = await resolveViaVirtualModule();
|
|
32
|
+
}
|
|
6
33
|
if (!config) {
|
|
7
34
|
throw new Error('@growth-labs/store: config accessed before the integration ran. Add store() to astro.config.mjs.');
|
|
8
35
|
}
|
|
9
36
|
return config;
|
|
10
37
|
}
|
|
11
|
-
export function getConfigOrNull() {
|
|
38
|
+
export async function getConfigOrNull() {
|
|
39
|
+
if (!config) {
|
|
40
|
+
config = await resolveViaVirtualModule();
|
|
41
|
+
}
|
|
12
42
|
return config;
|
|
13
43
|
}
|
|
14
44
|
//# sourceMappingURL=state.js.map
|
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,IAAI,MAAM,GAAgC,IAAI,CAAA;AAE9C,MAAM,UAAU,UAAU,CAAC,IAA0B;IACpD,MAAM,GAAG,IAAI,CAAA;AACd,CAAC;AAED,MAAM,UAAU,SAAS;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,IAAI,MAAM,GAAgC,IAAI,CAAA;AAE9C,MAAM,UAAU,UAAU,CAAC,IAA0B;IACpD,MAAM,GAAG,IAAI,CAAA;AACd,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,KAAK,UAAU,uBAAuB;IACrC,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAE5D,CAAA;QACD,OAAO,GAAG,EAAE,MAAM,IAAI,IAAI,CAAA;IAC3B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAA;IACZ,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,GAAG,MAAM,uBAAuB,EAAE,CAAA;IACzC,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACd,kGAAkG,CAClG,CAAA;IACF,CAAC;IACD,OAAO,MAAM,CAAA;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe;IACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,MAAM,GAAG,MAAM,uBAAuB,EAAE,CAAA;IACzC,CAAC;IACD,OAAO,MAAM,CAAA;AACd,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1179,6 +1179,57 @@ export declare const FwCollectionProductsSchema: z.ZodObject<{
|
|
|
1179
1179
|
};
|
|
1180
1180
|
}>;
|
|
1181
1181
|
export type FwCollectionProducts = z.infer<typeof FwCollectionProductsSchema>;
|
|
1182
|
+
export declare const FwCollectionListSchema: z.ZodObject<{
|
|
1183
|
+
results: z.ZodArray<z.ZodObject<{
|
|
1184
|
+
id: z.ZodString;
|
|
1185
|
+
slug: z.ZodString;
|
|
1186
|
+
name: z.ZodString;
|
|
1187
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1188
|
+
}, "strip", z.ZodTypeAny, {
|
|
1189
|
+
id: string;
|
|
1190
|
+
name: string;
|
|
1191
|
+
slug: string;
|
|
1192
|
+
description?: string | undefined;
|
|
1193
|
+
}, {
|
|
1194
|
+
id: string;
|
|
1195
|
+
name: string;
|
|
1196
|
+
slug: string;
|
|
1197
|
+
description?: string | undefined;
|
|
1198
|
+
}>, "many">;
|
|
1199
|
+
paging: z.ZodObject<{
|
|
1200
|
+
hasNextPage: z.ZodBoolean;
|
|
1201
|
+
nextPageToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1202
|
+
}, "strip", z.ZodTypeAny, {
|
|
1203
|
+
hasNextPage: boolean;
|
|
1204
|
+
nextPageToken?: string | null | undefined;
|
|
1205
|
+
}, {
|
|
1206
|
+
hasNextPage: boolean;
|
|
1207
|
+
nextPageToken?: string | null | undefined;
|
|
1208
|
+
}>;
|
|
1209
|
+
}, "strip", z.ZodTypeAny, {
|
|
1210
|
+
results: {
|
|
1211
|
+
id: string;
|
|
1212
|
+
name: string;
|
|
1213
|
+
slug: string;
|
|
1214
|
+
description?: string | undefined;
|
|
1215
|
+
}[];
|
|
1216
|
+
paging: {
|
|
1217
|
+
hasNextPage: boolean;
|
|
1218
|
+
nextPageToken?: string | null | undefined;
|
|
1219
|
+
};
|
|
1220
|
+
}, {
|
|
1221
|
+
results: {
|
|
1222
|
+
id: string;
|
|
1223
|
+
name: string;
|
|
1224
|
+
slug: string;
|
|
1225
|
+
description?: string | undefined;
|
|
1226
|
+
}[];
|
|
1227
|
+
paging: {
|
|
1228
|
+
hasNextPage: boolean;
|
|
1229
|
+
nextPageToken?: string | null | undefined;
|
|
1230
|
+
};
|
|
1231
|
+
}>;
|
|
1232
|
+
export type FwCollectionList = z.infer<typeof FwCollectionListSchema>;
|
|
1182
1233
|
export declare const FwCartItemSchema: z.ZodObject<{
|
|
1183
1234
|
variant: z.ZodObject<{
|
|
1184
1235
|
id: z.ZodString;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,eAAO,MAAM,wBAAwB;;;;;;;;;EAGnC,CAAA;AACF,MAAM,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AAE,OAAO;CAOxE"}
|
package/dist/types.js
CHANGED
|
@@ -64,6 +64,10 @@ export const FwCollectionProductsSchema = z.object({
|
|
|
64
64
|
results: z.array(FwProductSchema),
|
|
65
65
|
paging: FwPagingSchema,
|
|
66
66
|
});
|
|
67
|
+
export const FwCollectionListSchema = z.object({
|
|
68
|
+
results: z.array(FwCollectionSchema),
|
|
69
|
+
paging: FwPagingSchema,
|
|
70
|
+
});
|
|
67
71
|
export const FwCartItemSchema = z.object({
|
|
68
72
|
variant: FwVariantSchema,
|
|
69
73
|
quantity: z.number(),
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAA;AAGF,MAAM,CAAC,MAA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YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACnC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAClC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC/B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC1B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC1B,CAAC;aACD,WAAW,EAAE;aACb,QAAQ,EAAE;KACZ,CAAC;SACD,WAAW,EAAE;CACf,CAAC;KACD,WAAW,EAAE,CAAA;AAGf;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACzB,MAAM,CAAQ;IACd,GAAG,CAAQ;IACX,IAAI,CAAU;IAE9B,YAAY,MAAc,EAAE,GAAW,EAAE,OAAe,EAAE,IAAc;QACvE,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACjB,CAAC;CACD"}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ZodTypeAny, z } from 'zod'
|
|
|
2
2
|
import {
|
|
3
3
|
FourthwallError,
|
|
4
4
|
FwCartSchema,
|
|
5
|
+
FwCollectionListSchema,
|
|
5
6
|
FwCollectionProductsSchema,
|
|
6
7
|
FwProductSchema,
|
|
7
8
|
FwShopSchema,
|
|
@@ -126,6 +127,13 @@ export function createFourthwallClient(config: FourthwallClientConfig) {
|
|
|
126
127
|
return call(FwShopSchema, '/v1/shop')
|
|
127
128
|
},
|
|
128
129
|
|
|
130
|
+
/** `GET /v1/collections` — the shop's own collection list; source of truth for what exists. */
|
|
131
|
+
getCollections(args: { page?: number; size?: number } = {}) {
|
|
132
|
+
return call(FwCollectionListSchema, '/v1/collections', {
|
|
133
|
+
query: { page: args.page, size: args.size },
|
|
134
|
+
})
|
|
135
|
+
},
|
|
136
|
+
|
|
129
137
|
/** `GET /v1/collections/{handle}/products` — paginated product list. */
|
|
130
138
|
getCollectionProducts(args: {
|
|
131
139
|
handle: string
|
package/src/collections.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { cachedJson } from './cache.js'
|
|
2
|
+
import type { FourthwallClient } from './client.js'
|
|
3
|
+
|
|
1
4
|
export type StoreCollectionGrouping = 'division' | 'type'
|
|
2
5
|
|
|
3
6
|
export interface StoreCollection {
|
|
@@ -22,6 +25,17 @@ export interface StoreCollection {
|
|
|
22
25
|
productKind?: string
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Site-config shape for `StoreOptions.collections` — an override, not the
|
|
30
|
+
* exhaustive list. The Fourthwall shop is the source of truth for which
|
|
31
|
+
* collections *exist*; a site only overrides ordering, labels, grouping, or
|
|
32
|
+
* hiding specific handles. `name` is optional here (falls back to the shop's
|
|
33
|
+
* own name) since a site overriding a collection often just wants to set
|
|
34
|
+
* `grouping`/`hidden`/`coverImagePath` without retyping the display name.
|
|
35
|
+
*/
|
|
36
|
+
export type StoreCollectionOverride = Pick<StoreCollection, 'handle'> &
|
|
37
|
+
Partial<Omit<StoreCollection, 'handle'>>
|
|
38
|
+
|
|
25
39
|
export function getStoreCollection(
|
|
26
40
|
collections: StoreCollection[],
|
|
27
41
|
handle: string,
|
|
@@ -29,6 +43,87 @@ export function getStoreCollection(
|
|
|
29
43
|
return collections.find((c) => c.handle === handle)
|
|
30
44
|
}
|
|
31
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Resolves the site's actual collection list from the live Fourthwall shop,
|
|
48
|
+
* with `overrides` (site config) layered on top for ordering/labels/grouping/
|
|
49
|
+
* hidden — never as the exhaustive source. Fixes the "6 divergent hand-listed
|
|
50
|
+
* collection arrays silently drift from the shop" defect (channel-store-
|
|
51
|
+
* recovery review): a site's config used to BE the full list, so a collection
|
|
52
|
+
* added on Fourthwall's side (or one the config simply omitted) 404'd
|
|
53
|
+
* forever, invisibly, until a shopper reported it or an operator noticed
|
|
54
|
+
* lost sales — the exact "review distribution, not checkout" failure shape
|
|
55
|
+
* this whole program exists to close.
|
|
56
|
+
*
|
|
57
|
+
* Ordering: override entries first, in the order the site listed them, then
|
|
58
|
+
* any shop collections the site didn't mention, in the shop's own order. An
|
|
59
|
+
* override for a handle the shop no longer has is dropped, not fabricated —
|
|
60
|
+
* the shop is authoritative for existence, the site is only authoritative
|
|
61
|
+
* for presentation.
|
|
62
|
+
*
|
|
63
|
+
* `client: null` (storefront token not configured yet, e.g. bigbrain
|
|
64
|
+
* pre-launch) falls back to treating `overrides` as the full list, since
|
|
65
|
+
* there is no live shop to reconcile against.
|
|
66
|
+
*/
|
|
67
|
+
export async function resolveShopCollections(input: {
|
|
68
|
+
client: FourthwallClient | null
|
|
69
|
+
overrides: StoreCollectionOverride[]
|
|
70
|
+
}): Promise<StoreCollection[]> {
|
|
71
|
+
if (!input.client) {
|
|
72
|
+
return input.overrides.map((override) => ({
|
|
73
|
+
...override,
|
|
74
|
+
name: override.name ?? override.handle,
|
|
75
|
+
}))
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const client = input.client
|
|
79
|
+
const shopCollections: { slug: string; name: string; description?: string }[] = []
|
|
80
|
+
const PAGE_SIZE = 100
|
|
81
|
+
let page = 1
|
|
82
|
+
let hasNextPage = true
|
|
83
|
+
while (hasNextPage && page <= 10) {
|
|
84
|
+
const result = await cachedJson({
|
|
85
|
+
pathSegment: '/collections',
|
|
86
|
+
query: { page, size: PAGE_SIZE },
|
|
87
|
+
ttlSeconds: 300,
|
|
88
|
+
fetcher: () => client.getCollections({ page, size: PAGE_SIZE }),
|
|
89
|
+
})
|
|
90
|
+
shopCollections.push(...result.results)
|
|
91
|
+
hasNextPage = result.paging.hasNextPage
|
|
92
|
+
page += 1
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const merged: StoreCollection[] = []
|
|
96
|
+
const seen = new Set<string>()
|
|
97
|
+
|
|
98
|
+
for (const override of input.overrides) {
|
|
99
|
+
const shop = shopCollections.find((c) => c.slug === override.handle)
|
|
100
|
+
if (!shop) continue // the shop no longer has this handle -- drop the stale override, never fabricate one
|
|
101
|
+
merged.push({
|
|
102
|
+
handle: override.handle,
|
|
103
|
+
name: override.name ?? shop.name,
|
|
104
|
+
description: override.description ?? shop.description,
|
|
105
|
+
coverImagePath: override.coverImagePath,
|
|
106
|
+
grouping: override.grouping,
|
|
107
|
+
hidden: override.hidden ?? false,
|
|
108
|
+
productKind: override.productKind,
|
|
109
|
+
})
|
|
110
|
+
seen.add(override.handle)
|
|
111
|
+
}
|
|
112
|
+
// Every shop collection the site didn't mention still routes and displays
|
|
113
|
+
// -- with no grouping, so it never silently disappears (or reappears) from
|
|
114
|
+
// the division/type shelves the site did curate.
|
|
115
|
+
for (const shop of shopCollections) {
|
|
116
|
+
if (seen.has(shop.slug)) continue
|
|
117
|
+
merged.push({
|
|
118
|
+
handle: shop.slug,
|
|
119
|
+
name: shop.name,
|
|
120
|
+
description: shop.description,
|
|
121
|
+
hidden: false,
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
return merged
|
|
125
|
+
}
|
|
126
|
+
|
|
32
127
|
export function getGroupedCollections(
|
|
33
128
|
collections: StoreCollection[],
|
|
34
129
|
grouping: StoreCollectionGrouping,
|
|
@@ -14,7 +14,7 @@ interface Props {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const { storePath = '/store/', fourthwallShopUrl } = Astro.props
|
|
17
|
-
const config = getConfig()
|
|
17
|
+
const config = await getConfig()
|
|
18
18
|
const env = cloudflareEnv as FwEnv
|
|
19
19
|
const token = env?.PUBLIC_FW_STOREFRONT_TOKEN ?? ''
|
|
20
20
|
const currency = env?.PUBLIC_FW_DEFAULT_CURRENCY ?? config.defaultCurrency
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import { env as cloudflareEnv } from 'cloudflare:workers'
|
|
3
3
|
import { cachedJson } from '../cache.js'
|
|
4
4
|
import { createFourthwallClient } from '../client.js'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
filterPublishedCollections,
|
|
7
|
+
getGroupedCollections,
|
|
8
|
+
getStoreCollection,
|
|
9
|
+
resolveShopCollections,
|
|
10
|
+
} from '../collections.js'
|
|
6
11
|
import { getConfig } from '../state.js'
|
|
7
12
|
import type { FwProduct } from '../types.js'
|
|
8
13
|
import ProductCard from './ProductCard.astro'
|
|
@@ -14,27 +19,43 @@ interface FwEnv {
|
|
|
14
19
|
interface Props {
|
|
15
20
|
handle: string
|
|
16
21
|
basePath?: string
|
|
17
|
-
|
|
22
|
+
/** @default 404 */
|
|
23
|
+
notFoundResponseStatus?: number
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
const { handle, basePath = '/store',
|
|
21
|
-
const config = getConfig()
|
|
22
|
-
|
|
23
|
-
const collection = getStoreCollection(config.collections, handle)
|
|
24
|
-
if (!collection) {
|
|
25
|
-
return Astro.redirect(notFoundPath)
|
|
26
|
-
}
|
|
26
|
+
const { handle, basePath = '/store', notFoundResponseStatus = 404 } = Astro.props
|
|
27
|
+
const config = await getConfig()
|
|
27
28
|
|
|
28
29
|
const env = cloudflareEnv as FwEnv
|
|
29
30
|
const token = env?.PUBLIC_FW_STOREFRONT_TOKEN ?? ''
|
|
30
31
|
const cookieCurrency = Astro.cookies.get('fw_currency')?.value
|
|
31
32
|
const currency = cookieCurrency && config.supportedCurrencies.includes(cookieCurrency) ? cookieCurrency : config.defaultCurrency
|
|
33
|
+
const client = token ? createFourthwallClient({ token, defaultCurrency: currency }) : null
|
|
34
|
+
|
|
35
|
+
const collections = await resolveShopCollections({ client, overrides: config.collections })
|
|
36
|
+
const collection = getStoreCollection(collections, handle)
|
|
37
|
+
if (!collection) {
|
|
38
|
+
// A real 404 status, matching StoreProductPage's own precedent — a
|
|
39
|
+
// redirect to a "/404/" page 302s, and that page then answers 200 unless
|
|
40
|
+
// it explicitly sets its own status, which is a soft-404 (bad for
|
|
41
|
+
// indexing, and it's what let this component 302 to a 200 in production
|
|
42
|
+
// — channel-store-recovery B3's second P0 report).
|
|
43
|
+
//
|
|
44
|
+
// NOTE: like Astro.redirect(), returning a Response only works before any
|
|
45
|
+
// output has streamed. A site nesting this component inside its own
|
|
46
|
+
// <Base>/layout (the intended usage) has usually already streamed the
|
|
47
|
+
// layout shell by this point, so sites should pre-check with
|
|
48
|
+
// resolveShopCollections + getStoreCollection themselves, before
|
|
49
|
+
// rendering this component, and return their own 404 Response — this
|
|
50
|
+
// path only actually takes effect when the component is rendered as a
|
|
51
|
+
// standalone top-level page.
|
|
52
|
+
return new Response('Not Found', { status: notFoundResponseStatus })
|
|
53
|
+
}
|
|
32
54
|
|
|
33
55
|
let products: FwProduct[] = []
|
|
34
56
|
let errorMessage: string | null = null
|
|
35
57
|
|
|
36
|
-
if (
|
|
37
|
-
const client = createFourthwallClient({ token, defaultCurrency: currency })
|
|
58
|
+
if (client) {
|
|
38
59
|
try {
|
|
39
60
|
const PAGE_SIZE = 100
|
|
40
61
|
const firstPage = await cachedJson({
|
|
@@ -68,8 +89,7 @@ if (token) {
|
|
|
68
89
|
}
|
|
69
90
|
|
|
70
91
|
const getProductsForHandle = async (h: string) => {
|
|
71
|
-
if (!
|
|
72
|
-
const client = createFourthwallClient({ token, defaultCurrency: currency })
|
|
92
|
+
if (!client) return []
|
|
73
93
|
const result = await cachedJson({
|
|
74
94
|
pathSegment: `/collections/${encodeURIComponent(h)}/products`,
|
|
75
95
|
query: { cur: currency, nav: 'published' },
|
|
@@ -80,8 +100,8 @@ const getProductsForHandle = async (h: string) => {
|
|
|
80
100
|
}
|
|
81
101
|
|
|
82
102
|
const [divisionNav, typeNav] = await Promise.all([
|
|
83
|
-
filterPublishedCollections(getGroupedCollections(
|
|
84
|
-
filterPublishedCollections(getGroupedCollections(
|
|
103
|
+
filterPublishedCollections(getGroupedCollections(collections, 'division'), getProductsForHandle),
|
|
104
|
+
filterPublishedCollections(getGroupedCollections(collections, 'type'), getProductsForHandle),
|
|
85
105
|
])
|
|
86
106
|
const activeHandle = collection.handle
|
|
87
107
|
const useDenseGrid = products.length >= 6
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import { env as cloudflareEnv } from 'cloudflare:workers'
|
|
3
3
|
import { cachedJson } from '../cache.js'
|
|
4
4
|
import { createFourthwallClient } from '../client.js'
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
filterPublishedCollections,
|
|
7
|
+
getGroupedCollections,
|
|
8
|
+
resolveShopCollections,
|
|
9
|
+
type StoreCollection,
|
|
10
|
+
} from '../collections.js'
|
|
6
11
|
import { getConfig } from '../state.js'
|
|
7
12
|
import type { FwProduct } from '../types.js'
|
|
8
13
|
import CollectionCard from './CollectionCard.astro'
|
|
@@ -19,16 +24,17 @@ interface Props {
|
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
const { heading, basePath = '/store' } = Astro.props
|
|
22
|
-
const config = getConfig()
|
|
27
|
+
const config = await getConfig()
|
|
23
28
|
const env = cloudflareEnv as FwEnv
|
|
24
29
|
const token = env?.PUBLIC_FW_STOREFRONT_TOKEN ?? ''
|
|
25
30
|
const cookieCurrency = Astro.cookies.get('fw_currency')?.value
|
|
26
31
|
const currency = cookieCurrency && config.supportedCurrencies.includes(cookieCurrency) ? cookieCurrency : config.defaultCurrency
|
|
27
32
|
|
|
28
33
|
const storeUnconfigured = config.checkoutEnabled && !token
|
|
29
|
-
const divisionCollections = getGroupedCollections(config.collections, 'division')
|
|
30
|
-
const typeCollections = getGroupedCollections(config.collections, 'type')
|
|
31
34
|
const client = token ? createFourthwallClient({ token, defaultCurrency: currency }) : null
|
|
35
|
+
const collections = await resolveShopCollections({ client, overrides: config.collections })
|
|
36
|
+
const divisionCollections = getGroupedCollections(collections, 'division')
|
|
37
|
+
const typeCollections = getGroupedCollections(collections, 'type')
|
|
32
38
|
|
|
33
39
|
interface CollectionCardData {
|
|
34
40
|
collection: StoreCollection
|
|
@@ -36,7 +36,7 @@ interface Props {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const { slug, basePath = '/store', notFoundResponseStatus = 404, fourthwallShopBaseUrl, kind = 'merch', kindModule: KindModule } = Astro.props
|
|
39
|
-
const config = getConfig()
|
|
39
|
+
const config = await getConfig()
|
|
40
40
|
const env = cloudflareEnv as FwEnv
|
|
41
41
|
const token = env?.PUBLIC_FW_STOREFRONT_TOKEN ?? ''
|
|
42
42
|
const cookieCurrency = Astro.cookies.get('fw_currency')?.value
|
package/src/health.ts
CHANGED
|
@@ -85,22 +85,19 @@ async function checkOrderStaleness(
|
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* `health({ checks: [createStoreHealthCheck()] })` needs no arguments in the
|
|
88
|
-
* common case:
|
|
89
|
-
*
|
|
90
|
-
* `state.ts
|
|
91
|
-
*
|
|
92
|
-
*
|
|
88
|
+
* common case: `.check()` resolves `telemetry.{d1Binding,siteId,
|
|
89
|
+
* staleOrderAlertDays}` from the integration's config at request time (via
|
|
90
|
+
* `getConfigOrNull()` — see state.ts for why this must happen per-request
|
|
91
|
+
* rather than once when `createStoreHealthCheck()` itself is called, which
|
|
92
|
+
* for most sites happens while building `astro.config.mjs`'s options object,
|
|
93
|
+
* before the config singleton a built Worker actually serves from exists).
|
|
94
|
+
* Explicit options here only override that default — useful for tests, never
|
|
95
|
+
* required in a real site.
|
|
93
96
|
*/
|
|
94
97
|
export function createStoreHealthCheck(options: StoreHealthCheckOptions = {}): {
|
|
95
98
|
name: string
|
|
96
99
|
check: () => Promise<StoreHealthCheckResult>
|
|
97
100
|
} {
|
|
98
|
-
const resolvedConfig = getConfigOrNull()
|
|
99
|
-
const d1Binding = options.d1Binding ?? resolvedConfig?.telemetry.d1Binding ?? 'DB'
|
|
100
|
-
const siteId = options.siteId ?? resolvedConfig?.telemetry.siteId
|
|
101
|
-
const staleOrderAlertDays =
|
|
102
|
-
options.staleOrderAlertDays ?? resolvedConfig?.telemetry.staleOrderAlertDays ?? 7
|
|
103
|
-
|
|
104
101
|
return {
|
|
105
102
|
name: 'store',
|
|
106
103
|
async check() {
|
|
@@ -115,6 +112,12 @@ export function createStoreHealthCheck(options: StoreHealthCheckOptions = {}): {
|
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
|
|
115
|
+
const resolvedConfig = options.d1Binding && options.siteId ? null : await getConfigOrNull()
|
|
116
|
+
const d1Binding = options.d1Binding ?? resolvedConfig?.telemetry.d1Binding ?? 'DB'
|
|
117
|
+
const siteId = options.siteId ?? resolvedConfig?.telemetry.siteId
|
|
118
|
+
const staleOrderAlertDays =
|
|
119
|
+
options.staleOrderAlertDays ?? resolvedConfig?.telemetry.staleOrderAlertDays ?? 7
|
|
120
|
+
|
|
118
121
|
if (env && siteId) {
|
|
119
122
|
const staleReason = await checkOrderStaleness(env, {
|
|
120
123
|
d1Binding,
|
package/src/index.ts
CHANGED
|
@@ -67,12 +67,17 @@ export { buildCacheKey, cachedJson, purgeCollectionCache, purgeProductCache } fr
|
|
|
67
67
|
export { buildCheckoutUrl } from './checkout-url.js'
|
|
68
68
|
export type { FourthwallClient, FourthwallClientConfig } from './client.js'
|
|
69
69
|
export { createFourthwallClient } from './client.js'
|
|
70
|
-
export type {
|
|
70
|
+
export type {
|
|
71
|
+
StoreCollection,
|
|
72
|
+
StoreCollectionGrouping,
|
|
73
|
+
StoreCollectionOverride,
|
|
74
|
+
} from './collections.js'
|
|
71
75
|
export {
|
|
72
76
|
filterPublishedCollections,
|
|
73
77
|
getGroupedCollections,
|
|
74
78
|
getStoreCollection,
|
|
75
79
|
resolveProductKind,
|
|
80
|
+
resolveShopCollections,
|
|
76
81
|
} from './collections.js'
|
|
77
82
|
export type { StoreHealthCheckOptions } from './health.js'
|
|
78
83
|
export { createStoreHealthCheck } from './health.js'
|
|
@@ -81,6 +86,17 @@ export type { ResolvedStoreOptions, StoreOptions } from './options.js'
|
|
|
81
86
|
export { storeOptionsSchema } from './options.js'
|
|
82
87
|
export type { OrderTelemetryOptions } from './orders.js'
|
|
83
88
|
export { buildStoreOrderWAEDataPoint, createD1OrderHandler } from './orders.js'
|
|
89
|
+
/**
|
|
90
|
+
* `getConfig`/`getConfigOrNull` resolve this site's fully-parsed `StoreOptions`
|
|
91
|
+
* at runtime — the same mechanism `.astro` page components use internally
|
|
92
|
+
* (see state.ts). Exported so a site's own page can read config (e.g.
|
|
93
|
+
* `collections` overrides for a pre-render 404 check) without importing its
|
|
94
|
+
* own build-time options module, which is unsafe inside a Worker (the
|
|
95
|
+
* channel-store-recovery B3 P0: importing growth-labs-options.mjs for just
|
|
96
|
+
* `storeOptions.collections` also ran buildLlmsContent()'s Node-only file
|
|
97
|
+
* read, throwing in the deployed Worker).
|
|
98
|
+
*/
|
|
99
|
+
export { getConfig, getConfigOrNull } from './state.js'
|
|
84
100
|
export type * from './types.js'
|
|
85
101
|
export type { MerchantReturnPolicy, StoreVariantClientData } from './variant.js'
|
|
86
102
|
export {
|