@snowcone-app/mockup-resolver 1.0.3 → 1.0.5
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/CHANGELOG.md +14 -0
- package/dist/index.js +1278 -282
- package/package.json +2 -2
- package/src/asset-allowlist.ts +14 -68
- package/src/index.ts +375 -169
- package/src/public-params.ts +9 -1
- package/src/resolve.ts +143 -1
- package/test/public-params.test.ts +11 -2
- package/test/resolve.test.ts +169 -0
- package/wrangler.jsonc +7 -2
package/src/public-params.ts
CHANGED
|
@@ -20,7 +20,15 @@ import {
|
|
|
20
20
|
* (4 different `view=` values → 4 identical images). Pre-launch, fail loudly.
|
|
21
21
|
*/
|
|
22
22
|
export function rejectUnknownPublicParams(url: URL): Response | null {
|
|
23
|
-
const unknown = unknownPublicParams(url.searchParams)
|
|
23
|
+
const unknown = unknownPublicParams(url.searchParams).filter(
|
|
24
|
+
// Operator debug passthrough (ADR-0096): `debug=<RENDER_DEBUG_SECRET>`
|
|
25
|
+
// is transport, not public grammar — with the 302 retired, waterfall
|
|
26
|
+
// replays re-fetch the PUBLIC url, so the resolver must accept the
|
|
27
|
+
// param (it forwards it under the seal; the render box gates its
|
|
28
|
+
// value). Deliberately NOT added to mockup-url's PARAMS: it is an
|
|
29
|
+
// operator surface, not part of the developer contract.
|
|
30
|
+
(p) => p !== "debug",
|
|
31
|
+
);
|
|
24
32
|
if (unknown.length === 0) return null;
|
|
25
33
|
return new Response(
|
|
26
34
|
JSON.stringify({ error: unknownPublicParamsMessage(unknown) }),
|
package/src/resolve.ts
CHANGED
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
// logic in `apps/www/app/api/harness/mockup/route.ts` (the prototype) and the
|
|
5
5
|
// SDK's `getProduct`. Edge-safe: plain fetch + JSON. (ADR-0073 §10.)
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
PARAMS,
|
|
9
|
+
type DesignElement,
|
|
10
|
+
type ImageAlignment,
|
|
11
|
+
type ParsedFill,
|
|
12
|
+
} from "@snowcone-app/mockup-url";
|
|
8
13
|
|
|
9
14
|
/** Paths reserved for the signer/utility surface — never treated as a productCode. */
|
|
10
15
|
const RESERVED_RESOLVE_PATHS = new Set([
|
|
@@ -200,6 +205,143 @@ export function resolveAlbumPagePlacement(
|
|
|
200
205
|
return { ...base, key };
|
|
201
206
|
}
|
|
202
207
|
|
|
208
|
+
// ─── Artwork assembly: one base design → all placements + per-key overrides ──
|
|
209
|
+
// ADR-0089. The mockup-URL grammar resolves artwork as ONE base design layer
|
|
210
|
+
// that every placement inherits, plus per-placement overrides:
|
|
211
|
+
//
|
|
212
|
+
// asset=<url> → SEED every placement with this base (each using
|
|
213
|
+
// ITS OWN geometry, alignment "center").
|
|
214
|
+
// asset.<key>=<url> → OVERRIDE the base on that one placement.
|
|
215
|
+
// asset=default → blank ALL placements as base (house placeholder).
|
|
216
|
+
// asset.<key>=default → blank ONE placement while the others keep the base.
|
|
217
|
+
//
|
|
218
|
+
// Placements with neither a base nor an override stay blank (no element). The
|
|
219
|
+
// base broadcast does NOT depend on the single default-placement resolution —
|
|
220
|
+
// it fans out across `product.placements` directly, so every placement renders
|
|
221
|
+
// the design by default (the pit of success).
|
|
222
|
+
|
|
223
|
+
/** The reserved house-blank token — see the resolver's `DEFAULT_ASSET_TOKEN`. */
|
|
224
|
+
const DEFAULT_ASSET_TOKEN = "default";
|
|
225
|
+
|
|
226
|
+
/** Image alignment values accepted on `align.<key>` fills. */
|
|
227
|
+
const ALIGNMENTS = new Set<string>([
|
|
228
|
+
"center", "top", "far-top", "bottom", "far-bottom",
|
|
229
|
+
"left", "far-left", "right", "far-right",
|
|
230
|
+
]);
|
|
231
|
+
/** Tile scales accepted on `tile.<key>` fills (mirrors rendercenter). */
|
|
232
|
+
const ALLOWED_TILES = [0.25, 0.5, 1, 2, 4];
|
|
233
|
+
|
|
234
|
+
/** Inputs the assembler needs from the request, decoupled from the Worker env. */
|
|
235
|
+
export interface AssembleArtworkInput {
|
|
236
|
+
/** The base `asset=` value (URL, the `default` token, or null when absent). */
|
|
237
|
+
asset: string | null;
|
|
238
|
+
/** Per-placement overrides parsed from `asset.<key>`/`color.<key>`/etc. */
|
|
239
|
+
design: Record<string, ParsedFill>;
|
|
240
|
+
/** The URL the reserved `default` token resolves to (the house blank PNG). */
|
|
241
|
+
house: string;
|
|
242
|
+
/** Resolve a wire key to a placement (catalog key + album page expansion). */
|
|
243
|
+
findPlacement: (key: string) => ResolvedPlacement | null;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** The assembler either yields render elements or a typed, listing error. */
|
|
247
|
+
export type AssembleArtworkResult =
|
|
248
|
+
| { ok: true; elements: DesignElement[] }
|
|
249
|
+
| { ok: false; status: number; code: string; message: string };
|
|
250
|
+
|
|
251
|
+
/** Build one image/color `DesignElement` for a placement from a parsed fill. */
|
|
252
|
+
function elementFromFill(
|
|
253
|
+
fill: ParsedFill,
|
|
254
|
+
pl: ResolvedPlacement,
|
|
255
|
+
house: string
|
|
256
|
+
): DesignElement | null {
|
|
257
|
+
if (fill.color) {
|
|
258
|
+
return {
|
|
259
|
+
type: "color",
|
|
260
|
+
hex: fill.color,
|
|
261
|
+
placement: pl.label,
|
|
262
|
+
width: pl.width,
|
|
263
|
+
height: pl.height,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
if (fill.src) {
|
|
267
|
+
const el: DesignElement = {
|
|
268
|
+
type: "image",
|
|
269
|
+
imageUrl: fill.src === DEFAULT_ASSET_TOKEN ? house : fill.src,
|
|
270
|
+
placement: pl.label,
|
|
271
|
+
width: pl.width,
|
|
272
|
+
height: pl.height,
|
|
273
|
+
alignment:
|
|
274
|
+
fill.align && ALIGNMENTS.has(fill.align)
|
|
275
|
+
? (fill.align as ImageAlignment)
|
|
276
|
+
: "center",
|
|
277
|
+
};
|
|
278
|
+
if (fill.tile !== undefined && ALLOWED_TILES.includes(fill.tile)) {
|
|
279
|
+
el.tiles = fill.tile as 0.25 | 0.5 | 1 | 2 | 4;
|
|
280
|
+
}
|
|
281
|
+
return el;
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Assemble the render `DesignElement[]` from the base+override grammar
|
|
288
|
+
* (ADR-0089). Pure — no env, no fetch — so the base-broadcast / per-key
|
|
289
|
+
* override / `default`-token / unknown-key contract is unit-testable.
|
|
290
|
+
*
|
|
291
|
+
* A `default` token (base OR per-key) means house-blank; a per-key override
|
|
292
|
+
* REPLACES the base on that placement only; an unknown `asset.<key>` key fails
|
|
293
|
+
* loudly with `E_PLACEMENT_NOT_FOUND`, naming the bad key and listing every
|
|
294
|
+
* valid placement key for this product.
|
|
295
|
+
*/
|
|
296
|
+
export function assembleArtwork(
|
|
297
|
+
product: ResolvedProduct,
|
|
298
|
+
input: AssembleArtworkInput
|
|
299
|
+
): AssembleArtworkResult {
|
|
300
|
+
const { asset, design, house, findPlacement } = input;
|
|
301
|
+
// Per-placement element, keyed by the placement LABEL (the wire key for a
|
|
302
|
+
// page expands onto the base label, so two page_N overrides would otherwise
|
|
303
|
+
// collide — but each carries its own page key/label, so labels stay unique).
|
|
304
|
+
const byKey = new Map<string, DesignElement>();
|
|
305
|
+
|
|
306
|
+
// 1. Base broadcast: seed EVERY placement with the base, each using its own
|
|
307
|
+
// geometry. `default` seeds the house blank as the base for all.
|
|
308
|
+
if (asset !== null) {
|
|
309
|
+
const baseUrl = asset === DEFAULT_ASSET_TOKEN ? house : asset;
|
|
310
|
+
for (const pl of product.placements) {
|
|
311
|
+
byKey.set(pl.key, {
|
|
312
|
+
type: "image",
|
|
313
|
+
imageUrl: baseUrl,
|
|
314
|
+
placement: pl.label,
|
|
315
|
+
width: pl.width,
|
|
316
|
+
height: pl.height,
|
|
317
|
+
alignment: "center",
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// 2. Per-key overrides REPLACE the base on the named placement. Unknown keys
|
|
323
|
+
// fail loudly (E_PLACEMENT_NOT_FOUND, listing valid keys). A `default`
|
|
324
|
+
// override blanks that one placement; the others keep the base.
|
|
325
|
+
for (const key of Object.keys(design)) {
|
|
326
|
+
const pl = findPlacement(key);
|
|
327
|
+
if (!pl) {
|
|
328
|
+
const valid = product.placements.map((p) => p.key);
|
|
329
|
+
return {
|
|
330
|
+
ok: false,
|
|
331
|
+
status: 400,
|
|
332
|
+
code: "E_PLACEMENT_NOT_FOUND",
|
|
333
|
+
message:
|
|
334
|
+
`Unknown placement "${key}" for product ${product.id}. ` +
|
|
335
|
+
`Valid placements: ${valid.length > 0 ? valid.join(", ") : "(none)"}.`,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const el = elementFromFill(design[key], pl, house);
|
|
339
|
+
if (el) byKey.set(pl.key, el);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return { ok: true, elements: [...byKey.values()] };
|
|
343
|
+
}
|
|
344
|
+
|
|
203
345
|
/** Fetch a product from Meilisearch (KV-cached). Returns null if not found. */
|
|
204
346
|
export async function fetchProduct(
|
|
205
347
|
productCode: string,
|
|
@@ -14,12 +14,12 @@ import { rejectUnknownPublicParams } from '../src/public-params'
|
|
|
14
14
|
|
|
15
15
|
describe('isKnownPublicParam', () => {
|
|
16
16
|
it('accepts every exact public param name', () => {
|
|
17
|
-
for (const name of ['asset', 'design', 'shop', 'placement', 'page', 'variant', 'mockup', 'width', 'aspect', 'signature']) {
|
|
17
|
+
for (const name of ['asset', 'design', 'shop', 'placement', 'page', 'variant', 'mockup', 'width', 'aspect', 'bg', 'signature']) {
|
|
18
18
|
expect(isKnownPublicParam(name), name).toBe(true)
|
|
19
19
|
}
|
|
20
20
|
// The exported list matches the grammar exactly (no extras, no omissions).
|
|
21
21
|
expect([...PUBLIC_PARAM_NAMES].sort()).toEqual(
|
|
22
|
-
['aspect', 'asset', 'design', 'mockup', 'page', 'placement', 'shop', 'signature', 'variant', 'width'],
|
|
22
|
+
['aspect', 'asset', 'bg', 'design', 'mockup', 'page', 'placement', 'shop', 'signature', 'variant', 'width'],
|
|
23
23
|
)
|
|
24
24
|
})
|
|
25
25
|
|
|
@@ -69,6 +69,11 @@ describe('unknownPublicParams', () => {
|
|
|
69
69
|
expect(unknownPublicParams(url.searchParams)).toEqual([])
|
|
70
70
|
})
|
|
71
71
|
|
|
72
|
+
it('returns [] for a background override (bg=)', () => {
|
|
73
|
+
const url = new URL('https://img.snowcone.app/tee?asset=default&shop=abc123&bg=f5f0ea')
|
|
74
|
+
expect(unknownPublicParams(url.searchParams)).toEqual([])
|
|
75
|
+
})
|
|
76
|
+
|
|
72
77
|
it('names unknown keys, deduped, in first-seen order', () => {
|
|
73
78
|
const url = new URL(
|
|
74
79
|
'https://img.snowcone.app/tee?asset=x&view=a&shop=abc123&view=b&foo=1',
|
|
@@ -100,6 +105,10 @@ describe('unknownPublicParamsMessage', () => {
|
|
|
100
105
|
expect(unknownPublicParamsMessage(['key'])).toContain('shop=<shopId>')
|
|
101
106
|
})
|
|
102
107
|
|
|
108
|
+
it('tells `background=` users to use bg=', () => {
|
|
109
|
+
expect(unknownPublicParamsMessage(['background'])).toContain('bg=<6-hex>')
|
|
110
|
+
})
|
|
111
|
+
|
|
103
112
|
it('pluralizes and lists every offending key', () => {
|
|
104
113
|
const msg = unknownPublicParamsMessage(['view', 'foo'])
|
|
105
114
|
expect(msg).toContain('Unknown query parameters "view", "foo"')
|
package/test/resolve.test.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import {
|
|
3
|
+
assembleArtwork,
|
|
3
4
|
looksLikeResolveRequest,
|
|
4
5
|
normalizeAlbum,
|
|
5
6
|
resolveAlbumPagePlacement,
|
|
6
7
|
resolveVariant,
|
|
7
8
|
slugify,
|
|
9
|
+
type ResolvedPlacement,
|
|
8
10
|
type ResolvedProduct,
|
|
9
11
|
} from "../src/resolve";
|
|
10
12
|
|
|
@@ -267,3 +269,170 @@ describe("slugify", () => {
|
|
|
267
269
|
expect(slugify("Front Left")).toBe("front_left");
|
|
268
270
|
});
|
|
269
271
|
});
|
|
272
|
+
|
|
273
|
+
// ─── ADR-0089: base broadcast + per-placement override ───────────────────────
|
|
274
|
+
describe("assembleArtwork (base + override, ADR-0089)", () => {
|
|
275
|
+
const HOUSE = "https://img.snowcone.app/_blank.png";
|
|
276
|
+
|
|
277
|
+
// A three-placement product with distinct geometry per placement, so we can
|
|
278
|
+
// assert the base broadcast uses EACH placement's own width/height.
|
|
279
|
+
const shirt: ResolvedProduct = {
|
|
280
|
+
id: "SHIRT1",
|
|
281
|
+
variants: [{ gvid: "v1" }],
|
|
282
|
+
mockups: [],
|
|
283
|
+
placements: [
|
|
284
|
+
{ key: "front", label: "Front", type: "image", width: 4000, height: 5000 },
|
|
285
|
+
{ key: "back", label: "Back", type: "image", width: 3000, height: 6000 },
|
|
286
|
+
{ key: "sleeve", label: "Sleeve", type: "image", width: 800, height: 1200 },
|
|
287
|
+
],
|
|
288
|
+
defaultGvid: "v1",
|
|
289
|
+
attributes: {},
|
|
290
|
+
combinations: [],
|
|
291
|
+
album: null,
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// Strict findPlacement, mirroring the resolver: exact catalog key + album
|
|
295
|
+
// page expansion (none here).
|
|
296
|
+
const find = (k: string): ResolvedPlacement | null =>
|
|
297
|
+
shirt.placements.find((p) => p.key === k) ?? null;
|
|
298
|
+
|
|
299
|
+
const ART = "https://cdn.example.com/art.png";
|
|
300
|
+
const OTHER = "https://cdn.example.com/other.png";
|
|
301
|
+
|
|
302
|
+
it("scalar asset broadcasts the base to EVERY placement, each with its own geometry", () => {
|
|
303
|
+
const r = assembleArtwork(shirt, {
|
|
304
|
+
asset: ART,
|
|
305
|
+
design: {},
|
|
306
|
+
house: HOUSE,
|
|
307
|
+
findPlacement: find,
|
|
308
|
+
});
|
|
309
|
+
expect(r.ok).toBe(true);
|
|
310
|
+
if (!r.ok) return;
|
|
311
|
+
expect(r.elements).toHaveLength(3);
|
|
312
|
+
// Each placement gets the base art at ITS OWN geometry (not the primary's).
|
|
313
|
+
expect(r.elements).toEqual([
|
|
314
|
+
{ type: "image", imageUrl: ART, placement: "Front", width: 4000, height: 5000, alignment: "center" },
|
|
315
|
+
{ type: "image", imageUrl: ART, placement: "Back", width: 3000, height: 6000, alignment: "center" },
|
|
316
|
+
{ type: "image", imageUrl: ART, placement: "Sleeve", width: 800, height: 1200, alignment: "center" },
|
|
317
|
+
]);
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
it("a keyed override fills ONLY the named placement (no base → others blank)", () => {
|
|
321
|
+
const r = assembleArtwork(shirt, {
|
|
322
|
+
asset: null,
|
|
323
|
+
design: { back: { src: OTHER } },
|
|
324
|
+
house: HOUSE,
|
|
325
|
+
findPlacement: find,
|
|
326
|
+
});
|
|
327
|
+
expect(r.ok).toBe(true);
|
|
328
|
+
if (!r.ok) return;
|
|
329
|
+
expect(r.elements).toEqual([
|
|
330
|
+
{ type: "image", imageUrl: OTHER, placement: "Back", width: 3000, height: 6000, alignment: "center" },
|
|
331
|
+
]);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it("base + override COMPOSES: base everywhere, override replaces just its placement", () => {
|
|
335
|
+
const r = assembleArtwork(shirt, {
|
|
336
|
+
asset: ART,
|
|
337
|
+
design: { back: { src: OTHER } },
|
|
338
|
+
house: HOUSE,
|
|
339
|
+
findPlacement: find,
|
|
340
|
+
});
|
|
341
|
+
expect(r.ok).toBe(true);
|
|
342
|
+
if (!r.ok) return;
|
|
343
|
+
const byLabel = Object.fromEntries(r.elements.map((e) => [e.placement, e]));
|
|
344
|
+
expect(byLabel.Front.imageUrl).toBe(ART);
|
|
345
|
+
expect(byLabel.Sleeve.imageUrl).toBe(ART);
|
|
346
|
+
// Back is overridden, and keeps Back's own geometry.
|
|
347
|
+
expect(byLabel.Back).toEqual({
|
|
348
|
+
type: "image", imageUrl: OTHER, placement: "Back", width: 3000, height: 6000, alignment: "center",
|
|
349
|
+
});
|
|
350
|
+
expect(r.elements).toHaveLength(3);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
it("asset=default blanks ALL placements as the base (house placeholder)", () => {
|
|
354
|
+
const r = assembleArtwork(shirt, {
|
|
355
|
+
asset: "default",
|
|
356
|
+
design: {},
|
|
357
|
+
house: HOUSE,
|
|
358
|
+
findPlacement: find,
|
|
359
|
+
});
|
|
360
|
+
expect(r.ok).toBe(true);
|
|
361
|
+
if (!r.ok) return;
|
|
362
|
+
expect(r.elements).toHaveLength(3);
|
|
363
|
+
expect(r.elements.every((e) => e.imageUrl === HOUSE)).toBe(true);
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it("asset.<key>=default blanks ONE placement while the others keep the base", () => {
|
|
367
|
+
const r = assembleArtwork(shirt, {
|
|
368
|
+
asset: ART,
|
|
369
|
+
design: { sleeve: { src: "default" } },
|
|
370
|
+
house: HOUSE,
|
|
371
|
+
findPlacement: find,
|
|
372
|
+
});
|
|
373
|
+
expect(r.ok).toBe(true);
|
|
374
|
+
if (!r.ok) return;
|
|
375
|
+
const byLabel = Object.fromEntries(r.elements.map((e) => [e.placement, e]));
|
|
376
|
+
expect(byLabel.Front.imageUrl).toBe(ART);
|
|
377
|
+
expect(byLabel.Back.imageUrl).toBe(ART);
|
|
378
|
+
expect(byLabel.Sleeve.imageUrl).toBe(HOUSE); // house-blanked
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it("carries align + tile from a positioned override fill", () => {
|
|
382
|
+
const r = assembleArtwork(shirt, {
|
|
383
|
+
asset: null,
|
|
384
|
+
design: { front: { src: ART, align: "top", tile: 2 } },
|
|
385
|
+
house: HOUSE,
|
|
386
|
+
findPlacement: find,
|
|
387
|
+
});
|
|
388
|
+
expect(r.ok).toBe(true);
|
|
389
|
+
if (!r.ok) return;
|
|
390
|
+
expect(r.elements[0]).toEqual({
|
|
391
|
+
type: "image", imageUrl: ART, placement: "Front", width: 4000, height: 5000, alignment: "top", tiles: 2,
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
it("a color override emits a color element on its placement", () => {
|
|
396
|
+
const r = assembleArtwork(shirt, {
|
|
397
|
+
asset: null,
|
|
398
|
+
design: { front: { color: "#ff0000" } },
|
|
399
|
+
house: HOUSE,
|
|
400
|
+
findPlacement: find,
|
|
401
|
+
});
|
|
402
|
+
expect(r.ok).toBe(true);
|
|
403
|
+
if (!r.ok) return;
|
|
404
|
+
expect(r.elements[0]).toEqual({
|
|
405
|
+
type: "color", hex: "#ff0000", placement: "Front", width: 4000, height: 5000,
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
it("an unknown override key fails loudly (E_PLACEMENT_NOT_FOUND) and LISTS valid keys", () => {
|
|
410
|
+
const r = assembleArtwork(shirt, {
|
|
411
|
+
asset: ART,
|
|
412
|
+
design: { chest: { src: OTHER } },
|
|
413
|
+
house: HOUSE,
|
|
414
|
+
findPlacement: find,
|
|
415
|
+
});
|
|
416
|
+
expect(r.ok).toBe(false);
|
|
417
|
+
if (r.ok) return;
|
|
418
|
+
expect(r.code).toBe("E_PLACEMENT_NOT_FOUND");
|
|
419
|
+
expect(r.status).toBe(400);
|
|
420
|
+
expect(r.message).toContain('"chest"');
|
|
421
|
+
// Names every valid placement key for the product.
|
|
422
|
+
expect(r.message).toContain("front");
|
|
423
|
+
expect(r.message).toContain("back");
|
|
424
|
+
expect(r.message).toContain("sleeve");
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
it("no base and no overrides → no elements (caller 400s on empty)", () => {
|
|
428
|
+
const r = assembleArtwork(shirt, {
|
|
429
|
+
asset: null,
|
|
430
|
+
design: {},
|
|
431
|
+
house: HOUSE,
|
|
432
|
+
findPlacement: find,
|
|
433
|
+
});
|
|
434
|
+
expect(r.ok).toBe(true);
|
|
435
|
+
if (!r.ok) return;
|
|
436
|
+
expect(r.elements).toHaveLength(0);
|
|
437
|
+
});
|
|
438
|
+
});
|
package/wrangler.jsonc
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
// MEILISEARCH_API_KEY is the public read-only search key (same as apps/www);
|
|
36
36
|
// URL_SIGNING_SECRET + KV_CACHE_SERVICE_TOKEN stay secrets (wrangler secret put).
|
|
37
37
|
"MEILISEARCH_HOST": "https://search.snowcone.app",
|
|
38
|
-
"MEILISEARCH_API_KEY": "
|
|
38
|
+
"MEILISEARCH_API_KEY": "73f573ead9be75531c56ee89d104caa49d79154db387f119a013d33eccfe654b",
|
|
39
39
|
"MEILISEARCH_INDEX": "snowcone",
|
|
40
40
|
"MOCKUP_BASE_URL": "https://cdn.snowcone.app",
|
|
41
41
|
"KV_CACHE_BASE_URL": "https://api.snowcone.app",
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
// against, read with the same public search key.
|
|
44
44
|
"MEILISEARCH_DESIGNS_INDEX": "snowcone-designs"
|
|
45
45
|
},
|
|
46
|
+
"services": [
|
|
47
|
+
// ADR-0096: single-leg renders — after sealing, the resolver calls the
|
|
48
|
+
// render edge in-process and streams bytes back (the 302 hop is retired).
|
|
49
|
+
{ "binding": "RENDER_EDGE", "service": "mockup-edge-cache-production" }
|
|
50
|
+
],
|
|
46
51
|
"kv_namespaces": [
|
|
47
52
|
{
|
|
48
53
|
"binding": "ACCOUNTS",
|
|
@@ -63,7 +68,7 @@
|
|
|
63
68
|
"TTL_DEFAULT": "3600",
|
|
64
69
|
"LOG_LEVEL": "debug",
|
|
65
70
|
"MEILISEARCH_HOST": "https://search.snowcone.app",
|
|
66
|
-
"MEILISEARCH_API_KEY": "
|
|
71
|
+
"MEILISEARCH_API_KEY": "73f573ead9be75531c56ee89d104caa49d79154db387f119a013d33eccfe654b",
|
|
67
72
|
"MEILISEARCH_INDEX": "snowcone-dev",
|
|
68
73
|
"MOCKUP_BASE_URL": "https://cdn.snowcone.app",
|
|
69
74
|
"KV_CACHE_BASE_URL": "http://localhost:4000",
|