@tokenoftrust/storefront-runner 6.9.0 → 6.9.1
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.
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* idempotency key, `actorId` the authenticated install.
|
|
17
17
|
*/
|
|
18
18
|
import { isStoredSku, parseSku, skuKey } from "@tot/public-runtime/sku";
|
|
19
|
-
import type { CommerceStage } from "@tot/public-runtime";
|
|
19
|
+
import type { CatalogProduct, CommerceStage } from "@tot/public-runtime";
|
|
20
20
|
import type { Queryable, QueryStatement } from "../../catalog/d1/catalog.js";
|
|
21
21
|
import {
|
|
22
22
|
guardedCorrectionStatement,
|
|
@@ -282,6 +282,11 @@ async function classifyRefused(
|
|
|
282
282
|
return inventoryRefusal("balance-out-of-range");
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
/** Every stored sku of the catalog's variants: the skus an app may write for this tenant. */
|
|
286
|
+
export function catalogSkus(products: readonly CatalogProduct[]): string[] {
|
|
287
|
+
return products.flatMap((product) => product.variants.flatMap((variant) => (variant.sku ? [variant.sku] : [])));
|
|
288
|
+
}
|
|
289
|
+
|
|
285
290
|
/** The stored catalog sku matching `sku` under the platform sku comparison, or null. */
|
|
286
291
|
export function matchCatalogSku(catalogSkus: Iterable<string>, sku: string): string | null {
|
|
287
292
|
const wanted = skuKey(sku);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.1",
|
|
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",
|