platform-types 1.10.808 → 1.10.809
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 +3 -3
- package/dist/product.d.ts +27 -9
- package/dist/product.js +3 -3
- package/package.json +1 -1
package/dist/cjs/product.js
CHANGED
|
@@ -7,10 +7,10 @@ exports.BASE_QUANTITY_DECIMAL_PLACES = 6;
|
|
|
7
7
|
exports.MAX_BASE_QUANTITY = 1_000_000;
|
|
8
8
|
/**
|
|
9
9
|
* The `sort` values Web `GET /products?mode=discover` serves. `newest` is
|
|
10
|
-
* descending product id;
|
|
11
|
-
*
|
|
10
|
+
* descending product id; `price_asc` / `price_desc` are the caller's own price
|
|
11
|
+
* (see `PublicProductDiscoverInput.sort`). Name sorts are not served.
|
|
12
12
|
*/
|
|
13
|
-
exports.DISCOVERY_SORTS = ['newest'];
|
|
13
|
+
exports.DISCOVERY_SORTS = ['newest', 'price_asc', 'price_desc'];
|
|
14
14
|
/**
|
|
15
15
|
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
16
16
|
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
|
package/dist/product.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export declare const BASE_QUANTITY_DECIMAL_PLACES = 6;
|
|
|
4
4
|
export declare const MAX_BASE_QUANTITY = 1000000;
|
|
5
5
|
/**
|
|
6
6
|
* The `sort` values Web `GET /products?mode=discover` serves. `newest` is
|
|
7
|
-
* descending product id;
|
|
8
|
-
*
|
|
7
|
+
* descending product id; `price_asc` / `price_desc` are the caller's own price
|
|
8
|
+
* (see `PublicProductDiscoverInput.sort`). Name sorts are not served.
|
|
9
9
|
*/
|
|
10
|
-
export declare const DISCOVERY_SORTS: readonly ["newest"];
|
|
10
|
+
export declare const DISCOVERY_SORTS: readonly ["newest", "price_asc", "price_desc"];
|
|
11
11
|
export type DiscoverySort = (typeof DISCOVERY_SORTS)[number];
|
|
12
12
|
/**
|
|
13
13
|
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
@@ -280,10 +280,22 @@ declare global {
|
|
|
280
280
|
isNew?: 'true';
|
|
281
281
|
/**
|
|
282
282
|
* A member of `DISCOVERY_SORTS`. `newest` = descending product id (mint
|
|
283
|
-
* order), on every filter combination.
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
283
|
+
* order), on every filter combination. `price_asc` / `price_desc` = the
|
|
284
|
+
* caller's own price, as each row is priced for them: in the store's display
|
|
285
|
+
* currency, an open offer counting as the price, no quantity break. Rows the
|
|
286
|
+
* caller is shown no price for (a hidden slot, every row for a guest of a
|
|
287
|
+
* store that hides prices) come LAST in both directions; equal prices and
|
|
288
|
+
* that unpriced tail are newest first. A price sort reads the whole filtered
|
|
289
|
+
* set on every page, so a set too large for one read is 400
|
|
290
|
+
* `DISCOVERY_SORT_UNSUPPORTED` after the reads, with `supportedSorts`
|
|
291
|
+
* naming what that query can be served in, and a read the time budget cut
|
|
292
|
+
* short is 503 `PRODUCT_LOOKUP_INCOMPLETE` (retryable). A price cursor is
|
|
293
|
+
* also bound to the caller's price list: resumed under another (a sign-in,
|
|
294
|
+
* a list change) it is 400 `INVALID_CURSOR`. A well-formed value the api does
|
|
295
|
+
* not serve is 400 `DISCOVERY_SORT_UNSUPPORTED` ({@link DiscoverySortRefusal})
|
|
296
|
+
* before any read; one not matching `^[a-z_]{1,32}$` is 400
|
|
297
|
+
* `INVALID_DISCOVERY_QUERY`. An empty value is absent. Bound into the cursor
|
|
298
|
+
* when present.
|
|
287
299
|
*/
|
|
288
300
|
sort?: string;
|
|
289
301
|
/** The previous response's `LastEvaluatedKey`, under the SAME filters and sort; else 400 INVALID_CURSOR. */
|
|
@@ -380,8 +392,14 @@ declare global {
|
|
|
380
392
|
truncated?: true;
|
|
381
393
|
}
|
|
382
394
|
/** Refusals of Web `GET /products?mode=discover`. */
|
|
383
|
-
type DiscoveryErrorCode = 'INVALID_DISCOVERY_QUERY' | 'INVALID_CURSOR' | 'DISCOVERY_SORT_UNSUPPORTED'
|
|
384
|
-
/**
|
|
395
|
+
type DiscoveryErrorCode = 'INVALID_DISCOVERY_QUERY' | 'INVALID_CURSOR' | 'DISCOVERY_SORT_UNSUPPORTED'
|
|
396
|
+
/** 503: a price-sorted walk the time budget cut short; retry. */
|
|
397
|
+
| 'PRODUCT_LOOKUP_INCOMPLETE';
|
|
398
|
+
/**
|
|
399
|
+
* 400 body for a `sort` the api does not serve for this request; `supportedSorts` lists what
|
|
400
|
+
* it does — every member for an unknown value, the non-price sorts when a price sort's
|
|
401
|
+
* filtered set was too large to read whole.
|
|
402
|
+
*/
|
|
385
403
|
interface DiscoverySortRefusal {
|
|
386
404
|
message: string;
|
|
387
405
|
error: 'DISCOVERY_SORT_UNSUPPORTED';
|
package/dist/product.js
CHANGED
|
@@ -4,10 +4,10 @@ export const BASE_QUANTITY_DECIMAL_PLACES = 6;
|
|
|
4
4
|
export const MAX_BASE_QUANTITY = 1_000_000;
|
|
5
5
|
/**
|
|
6
6
|
* The `sort` values Web `GET /products?mode=discover` serves. `newest` is
|
|
7
|
-
* descending product id;
|
|
8
|
-
*
|
|
7
|
+
* descending product id; `price_asc` / `price_desc` are the caller's own price
|
|
8
|
+
* (see `PublicProductDiscoverInput.sort`). Name sorts are not served.
|
|
9
9
|
*/
|
|
10
|
-
export const DISCOVERY_SORTS = ['newest'];
|
|
10
|
+
export const DISCOVERY_SORTS = ['newest', 'price_asc', 'price_desc'];
|
|
11
11
|
/**
|
|
12
12
|
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
13
13
|
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
|