platform-types 1.10.813 → 1.10.814
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/cjs/product.js +4 -2
- package/dist/product.d.ts +15 -3
- package/dist/product.js +4 -2
- package/package.json +1 -1
package/dist/cjs/product.js
CHANGED
|
@@ -14,8 +14,10 @@ exports.MAX_BASE_QUANTITY = 1_000_000;
|
|
|
14
14
|
exports.DISCOVERY_SORTS = ['newest', 'price_asc', 'price_desc', 'name_asc', 'name_desc'];
|
|
15
15
|
/**
|
|
16
16
|
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
17
|
-
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId
|
|
18
|
-
*
|
|
17
|
+
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`.
|
|
18
|
+
* The `categoryId` filter selects a category's enabled descendants too, so a filter on a
|
|
19
|
+
* parent yields counts for several descendant ids; a product has one primary category,
|
|
20
|
+
* so a client sums exact counts over a subtree without counting a product twice.
|
|
19
21
|
*/
|
|
20
22
|
exports.DISCOVERY_FACETS = ['brand', 'tag', 'category'];
|
|
21
23
|
/** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
|
package/dist/product.d.ts
CHANGED
|
@@ -12,8 +12,10 @@ export declare const DISCOVERY_SORTS: readonly ["newest", "price_asc", "price_de
|
|
|
12
12
|
export type DiscoverySort = (typeof DISCOVERY_SORTS)[number];
|
|
13
13
|
/**
|
|
14
14
|
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
15
|
-
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId
|
|
16
|
-
*
|
|
15
|
+
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`.
|
|
16
|
+
* The `categoryId` filter selects a category's enabled descendants too, so a filter on a
|
|
17
|
+
* parent yields counts for several descendant ids; a product has one primary category,
|
|
18
|
+
* so a client sums exact counts over a subtree without counting a product twice.
|
|
17
19
|
*/
|
|
18
20
|
export declare const DISCOVERY_FACETS: readonly ["brand", "tag", "category"];
|
|
19
21
|
export type DiscoveryFacet = (typeof DISCOVERY_FACETS)[number];
|
|
@@ -272,7 +274,17 @@ declare global {
|
|
|
272
274
|
mode: 'discover';
|
|
273
275
|
/** Free text, ≤100 chars; every token must appear in the product's search term. */
|
|
274
276
|
search?: string;
|
|
275
|
-
/**
|
|
277
|
+
/**
|
|
278
|
+
* A primary category AND every enabled descendant: a product whose primary
|
|
279
|
+
* category is this one or any category below it. A disabled descendant
|
|
280
|
+
* excludes its whole branch. An id the store's enabled tree does not hold —
|
|
281
|
+
* unknown, or itself disabled — matches its own products only. A cursor is
|
|
282
|
+
* bound to the subtree it was minted over: once descendants count, or after
|
|
283
|
+
* the enabled subtree changes, a parent's cursor is 400 `INVALID_CURSOR`
|
|
284
|
+
* (a category with no enabled descendant keeps its cursors). A subtree too
|
|
285
|
+
* large for a price or name sort's whole-set read is refused like any such
|
|
286
|
+
* set (`DISCOVERY_SORT_UNSUPPORTED`).
|
|
287
|
+
*/
|
|
276
288
|
categoryId?: string;
|
|
277
289
|
brandId?: string;
|
|
278
290
|
/**
|
package/dist/product.js
CHANGED
|
@@ -11,8 +11,10 @@ export const MAX_BASE_QUANTITY = 1_000_000;
|
|
|
11
11
|
export const DISCOVERY_SORTS = ['newest', 'price_asc', 'price_desc', 'name_asc', 'name_desc'];
|
|
12
12
|
/**
|
|
13
13
|
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
14
|
-
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId
|
|
15
|
-
*
|
|
14
|
+
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`.
|
|
15
|
+
* The `categoryId` filter selects a category's enabled descendants too, so a filter on a
|
|
16
|
+
* parent yields counts for several descendant ids; a product has one primary category,
|
|
17
|
+
* so a client sums exact counts over a subtree without counting a product twice.
|
|
16
18
|
*/
|
|
17
19
|
export const DISCOVERY_FACETS = ['brand', 'tag', 'category'];
|
|
18
20
|
/** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
|