platform-types 1.10.807 → 1.10.808

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PRODUCT_MEDIA_INVALID_REASONS = exports.MAX_PRODUCT_PICTURE_ALT_CHARS = exports.PRODUCT_UPSERT_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_CAP = exports.PUBLIC_PRODUCT_SUGGEST_ERROR_CODES = exports.PUBLIC_PRODUCT_BY_SLUG_ERROR_CODES = exports.PRODUCT_PUBLISH_OVERDUE_AFTER_MS = exports.PRODUCT_PUBLISH_AT_MAX_AHEAD_MS = exports.PRODUCT_POST_ERROR_CODES = exports.PRODUCT_IDENTITY_ERROR_CODES = exports.PRODUCT_EXPORT_ERROR_CODES = exports.PRODUCT_CATALOG_EXPORT_COLUMNS = exports.RECENT_PURCHASES_MAX = exports.BEST_SELLERS_MAX = exports.DISCOVERY_SORTS = exports.MAX_BASE_QUANTITY = exports.BASE_QUANTITY_DECIMAL_PLACES = void 0;
3
+ exports.PRODUCT_MEDIA_INVALID_REASONS = exports.MAX_PRODUCT_PICTURE_ALT_CHARS = exports.PRODUCT_UPSERT_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_CAP = exports.PUBLIC_PRODUCT_SUGGEST_ERROR_CODES = exports.PUBLIC_PRODUCT_BY_SLUG_ERROR_CODES = exports.PRODUCT_PUBLISH_OVERDUE_AFTER_MS = exports.PRODUCT_PUBLISH_AT_MAX_AHEAD_MS = exports.PRODUCT_POST_ERROR_CODES = exports.PRODUCT_IDENTITY_ERROR_CODES = exports.PRODUCT_EXPORT_ERROR_CODES = exports.PRODUCT_CATALOG_EXPORT_COLUMNS = exports.RECENT_PURCHASES_MAX = exports.BEST_SELLERS_MAX = exports.DISCOVERY_FACETS = exports.DISCOVERY_SORTS = exports.MAX_BASE_QUANTITY = exports.BASE_QUANTITY_DECIMAL_PLACES = void 0;
4
4
  /** Maximum decimal places in a canonical base quantity; inputs are exact, never rounded. */
5
5
  exports.BASE_QUANTITY_DECIMAL_PLACES = 6;
6
6
  /** Absolute base-quantity input bound; signed adjustments admit the negative of this value. */
@@ -11,6 +11,12 @@ exports.MAX_BASE_QUANTITY = 1_000_000;
11
11
  * order them inside one bounded request).
12
12
  */
13
13
  exports.DISCOVERY_SORTS = ['newest'];
14
+ /**
15
+ * The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
16
+ * `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
17
+ * (the filter matches no descendants, so a rolled-up parent would select nothing).
18
+ */
19
+ exports.DISCOVERY_FACETS = ['brand', 'tag', 'category'];
14
20
  /** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
15
21
  exports.BEST_SELLERS_MAX = 50;
16
22
  /** Most distinct products a buyer's recent-purchases row holds, and web `mode=recently-bought` returns. */
package/dist/product.d.ts CHANGED
@@ -9,6 +9,13 @@ export declare const MAX_BASE_QUANTITY = 1000000;
9
9
  */
10
10
  export declare const DISCOVERY_SORTS: readonly ["newest"];
11
11
  export type DiscoverySort = (typeof DISCOVERY_SORTS)[number];
12
+ /**
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
+ * (the filter matches no descendants, so a rolled-up parent would select nothing).
16
+ */
17
+ export declare const DISCOVERY_FACETS: readonly ["brand", "tag", "category"];
18
+ export type DiscoveryFacet = (typeof DISCOVERY_FACETS)[number];
12
19
  /** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
13
20
  export declare const BEST_SELLERS_MAX = 50;
14
21
  /** Most distinct products a buyer's recent-purchases row holds, and web `mode=recently-bought` returns. */
@@ -281,6 +288,38 @@ declare global {
281
288
  sort?: string;
282
289
  /** The previous response's `LastEvaluatedKey`, under the SAME filters and sort; else 400 INVALID_CURSOR. */
283
290
  startKey?: string;
291
+ /**
292
+ * Comma-separated `DISCOVERY_FACETS` members to count. Unknown members are
293
+ * ignored; a value outside `^[\w,-]{1,128}$` is 400 `INVALID_DISCOVERY_QUERY`.
294
+ * Honoured only on a first page (no `startKey`), ignored after it. Never bound
295
+ * into the cursor.
296
+ */
297
+ facets?: string;
298
+ }
299
+ /**
300
+ * One facet value: applied as its filter with the other current filters, it returns at
301
+ * least `count` rows across the walk — exactly `count` unless the facets are `truncated`.
302
+ */
303
+ interface DiscoveryFacetValue {
304
+ id: string;
305
+ count: number;
306
+ }
307
+ /**
308
+ * The values each requested facet can take under the current query, count
309
+ * descending. Disjunctive: a facet is counted with every other filter applied
310
+ * but not its own, so the picked brand still lists its sibling brands. A
311
+ * facet absent from the request is absent here.
312
+ */
313
+ interface DiscoveryFacets {
314
+ brand?: DiscoveryFacetValue[];
315
+ tag?: DiscoveryFacetValue[];
316
+ category?: DiscoveryFacetValue[];
317
+ /**
318
+ * The count walk hit its read budget before the catalogue ended: every
319
+ * listed value still returns rows, but counts are lower bounds and a value
320
+ * may be missing — fall back to the store-wide list for anything unlisted.
321
+ */
322
+ truncated?: true;
284
323
  }
285
324
  /** One page of a discovery walk; `data` can be empty while `LastEvaluatedKey` is set. */
286
325
  interface PublicProductDiscoverResponse {
@@ -291,6 +330,12 @@ declare global {
291
330
  sort?: (typeof DISCOVERY_SORTS)[number];
292
331
  /** Present while rows remain; absent means the walk is complete. */
293
332
  LastEvaluatedKey?: string;
333
+ /**
334
+ * Only on a first page whose request named a known facet. Also absent when the
335
+ * count failed (the rows still answer) — read absence as "fall back to the
336
+ * store-wide lists", never as "no values".
337
+ */
338
+ facets?: DiscoveryFacets;
294
339
  }
295
340
  /**
296
341
  * Web `GET /products?mode=best-sellers` and `mode=recently-bought`: at most 50 rows, no cursor,
package/dist/product.js CHANGED
@@ -8,6 +8,12 @@ export const MAX_BASE_QUANTITY = 1_000_000;
8
8
  * order them inside one bounded request).
9
9
  */
10
10
  export const DISCOVERY_SORTS = ['newest'];
11
+ /**
12
+ * The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
13
+ * `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
14
+ * (the filter matches no descendants, so a rolled-up parent would select nothing).
15
+ */
16
+ export const DISCOVERY_FACETS = ['brand', 'tag', 'category'];
11
17
  /** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
12
18
  export const BEST_SELLERS_MAX = 50;
13
19
  /** Most distinct products a buyer's recent-purchases row holds, and web `mode=recently-bought` returns. */
@@ -762,6 +762,8 @@ declare global {
762
762
  /** Web `mode=discover`'s `sort`; an unserved one answers 400 `DISCOVERY_SORT_UNSUPPORTED`. */
763
763
  sort?: DiscoverySort;
764
764
  startKey?: string;
765
+ /** Web `mode=discover`'s `facets`: counted on a first page only, answered as `facets`. */
766
+ facets?: string;
765
767
  }
766
768
  /**
767
769
  * Web `GET /products?updatedAt=`'s recency listing (the shop's «Ingresos» page), with the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.807",
3
+ "version": "1.10.808",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",