@heavybit/ecommerce-contracts 0.3.22 → 0.3.24

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.searchDocumentPageSchema = exports.searchDocumentLookupSchema = exports.searchDocumentSchema = exports.MAX_SEARCH_DOCUMENT_PAGE = void 0;
3
+ exports.searchFacetsResultSchema = exports.searchFacetsSchema = exports.searchFacetsQuerySchema = exports.searchResultSchema = exports.searchQuerySchema = exports.MAX_SEARCH_BRANDS = exports.MAX_SEARCH_CATEGORIES = exports.MAX_SEARCH_PAGE = exports.SEARCH_SORTS = exports.searchDocumentPageSchema = exports.searchDocumentLookupSchema = exports.searchDocumentSchema = exports.MAX_SEARCH_DOCUMENT_PAGE = void 0;
4
4
  /**
5
5
  * Internal answers catalog-service gives search-service so it can build and rebuild its index (Prompt 26.1): one product
6
6
  * as a flat search document, and pages of them. Only sellable products of active shops are ever returned.
@@ -23,10 +23,61 @@ exports.searchDocumentSchema = shared_lib_1.z.object({
23
23
  priceCents: shared_lib_1.z.number().int().nonnegative(),
24
24
  inStock: shared_lib_1.z.boolean(),
25
25
  rating: shared_lib_1.z.number().min(0).max(5),
26
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
27
+ popularity: shared_lib_1.z.number().int().nonnegative().optional(),
26
28
  createdAt: shared_lib_1.z.string().datetime({ offset: true }),
27
29
  }).passthrough();
28
30
  /** Envelope `data` of `GET /api/v1/internal/search-documents/{productId}?companyId=`: `null` when the product is not indexable (draft, disabled, deleted, no active variant, shop not active). */
29
31
  exports.searchDocumentLookupSchema = shared_lib_1.z.object({ document: exports.searchDocumentSchema.nullable() }).passthrough();
30
32
  /** Envelope `data` of `GET /api/v1/internal/search-documents?companyId=&cursor=&limit=`: a page and the cursor of the next one. */
31
33
  exports.searchDocumentPageSchema = shared_lib_1.z.object({ items: shared_lib_1.z.array(exports.searchDocumentSchema), nextCursor: shared_lib_1.z.string().nullable() }).passthrough();
34
+ /** Sorts the engine can apply (Prompt 26.2). `relevance` is the engine's own ranking. */
35
+ exports.SEARCH_SORTS = ['relevance', 'price_asc', 'price_desc', 'newest', 'rating', 'popularity'];
36
+ /** Most ids one `GET /internal/search` page returns. */
37
+ exports.MAX_SEARCH_PAGE = 100;
38
+ /** Most category ids one search can filter on (the chosen category plus its children). */
39
+ exports.MAX_SEARCH_CATEGORIES = 100;
40
+ /** Most brand names one search can filter on. */
41
+ exports.MAX_SEARCH_BRANDS = 20;
42
+ /**
43
+ * Query of `GET /api/v1/internal/search` (caller: catalog-service). Always scoped to one shop (`companyId`, TEN-8).
44
+ * `categoryIds` is a comma-separated list of ULIDs; prices are minor units (KES cents, campaign-aware, CR-26-01).
45
+ */
46
+ exports.searchQuerySchema = shared_lib_1.z.object({
47
+ companyId: shared_lib_1.idSchema,
48
+ /** Words to match. Empty browses the whole shop (the facets of a category page). */
49
+ q: shared_lib_1.z.string().trim().max(200).default(''),
50
+ categoryIds: shared_lib_1.z.string().max(exports.MAX_SEARCH_CATEGORIES * 27).optional().transform((v) => (v ? v.split(',').filter(Boolean) : undefined))
51
+ .pipe(shared_lib_1.z.array(shared_lib_1.idSchema).max(exports.MAX_SEARCH_CATEGORIES).optional()),
52
+ minPriceCents: shared_lib_1.z.coerce.number().int().nonnegative().optional(),
53
+ maxPriceCents: shared_lib_1.z.coerce.number().int().nonnegative().optional(),
54
+ inStock: shared_lib_1.z.enum(['true', 'false']).optional().transform((v) => (v === undefined ? undefined : v === 'true')),
55
+ /** Comma-separated brand names (any of). */
56
+ brands: shared_lib_1.z.string().max(exports.MAX_SEARCH_BRANDS * 80).optional().transform((v) => (v ? v.split(',').map((b) => b.trim()).filter(Boolean) : undefined))
57
+ .pipe(shared_lib_1.z.array(shared_lib_1.z.string().max(80)).max(exports.MAX_SEARCH_BRANDS).optional()),
58
+ /** Smallest average rating, 1 to 5. */
59
+ minRating: shared_lib_1.z.coerce.number().min(1).max(5).optional(),
60
+ sort: shared_lib_1.z.enum(exports.SEARCH_SORTS).default('relevance'),
61
+ offset: shared_lib_1.z.coerce.number().int().min(0).max(10_000).default(0),
62
+ limit: shared_lib_1.z.coerce.number().int().min(1).max(exports.MAX_SEARCH_PAGE).default(24),
63
+ }).strict();
64
+ /** Envelope `data` of `GET /api/v1/internal/search`: product ids in result order and the engine's total hit count. Catalog hydrates the cards. */
65
+ exports.searchResultSchema = shared_lib_1.z.object({ ids: shared_lib_1.z.array(shared_lib_1.idSchema), total: shared_lib_1.z.number().int().nonnegative() }).passthrough();
66
+ /** Query of `GET /api/v1/internal/search/facets`: the same filters as the search, without sort or paging. */
67
+ exports.searchFacetsQuerySchema = exports.searchQuerySchema.omit({ sort: true, offset: true, limit: true });
68
+ /** One value of a facet and how many products of the current result carry it. */
69
+ const facetCount = shared_lib_1.z.number().int().nonnegative();
70
+ /**
71
+ * Facet counts of one search (26.3), under the shopper's current filters. Price buckets are `[minCents, maxCents]` inclusive
72
+ * (`maxCents` null = open-ended); rating entries are "at least `min` stars". Zero-count entries are left out.
73
+ */
74
+ exports.searchFacetsSchema = shared_lib_1.z.object({
75
+ categories: shared_lib_1.z.array(shared_lib_1.z.object({ id: shared_lib_1.idSchema, count: facetCount })),
76
+ brands: shared_lib_1.z.array(shared_lib_1.z.object({ name: shared_lib_1.z.string(), count: facetCount })),
77
+ inStock: shared_lib_1.z.object({ count: facetCount }),
78
+ price: shared_lib_1.z.array(shared_lib_1.z.object({ minCents: shared_lib_1.z.number().int().nonnegative(), maxCents: shared_lib_1.z.number().int().nonnegative().nullable(), count: facetCount })),
79
+ rating: shared_lib_1.z.array(shared_lib_1.z.object({ min: shared_lib_1.z.number().int().min(1).max(5), count: facetCount })),
80
+ }).passthrough();
81
+ /** Envelope `data` of `GET /api/v1/internal/search/facets`. */
82
+ exports.searchFacetsResultSchema = shared_lib_1.z.object({ facets: exports.searchFacetsSchema }).passthrough();
32
83
  //# sourceMappingURL=search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/internal/search.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,qDAAmD;AAEnD,yEAAyE;AAC5D,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,cAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,qBAAQ;IACZ,SAAS,EAAE,qBAAQ;IACnB,IAAI,EAAE,cAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,WAAW,EAAE,cAAC,CAAC,KAAK,CAAC,qBAAQ,CAAC;IAC9B,KAAK,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,UAAU,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC1C,OAAO,EAAE,cAAC,CAAC,OAAO,EAAE;IACpB,MAAM,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,SAAS,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;CACjD,CAAC,CAAC,WAAW,EAAE,CAAC;AAEjB,kMAAkM;AACrL,QAAA,0BAA0B,GAAG,cAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,4BAAoB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAEhH,mIAAmI;AACtH,QAAA,wBAAwB,GAAG,cAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,cAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC,EAAE,UAAU,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,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C,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9I,MAAM,EAAE,cAAC,CAAC,KAAK,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,cAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;CACtF,CAAC,CAAC,WAAW,EAAE,CAAC;AAEjB,+DAA+D;AAClD,QAAA,wBAAwB,GAAG,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,0BAAkB,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC"}
@@ -20,10 +20,61 @@ export const searchDocumentSchema = z.object({
20
20
  priceCents: z.number().int().nonnegative(),
21
21
  inStock: z.boolean(),
22
22
  rating: z.number().min(0).max(5),
23
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
24
+ popularity: z.number().int().nonnegative().optional(),
23
25
  createdAt: z.string().datetime({ offset: true }),
24
26
  }).passthrough();
25
27
  /** Envelope `data` of `GET /api/v1/internal/search-documents/{productId}?companyId=`: `null` when the product is not indexable (draft, disabled, deleted, no active variant, shop not active). */
26
28
  export const searchDocumentLookupSchema = z.object({ document: searchDocumentSchema.nullable() }).passthrough();
27
29
  /** Envelope `data` of `GET /api/v1/internal/search-documents?companyId=&cursor=&limit=`: a page and the cursor of the next one. */
28
30
  export const searchDocumentPageSchema = z.object({ items: z.array(searchDocumentSchema), nextCursor: z.string().nullable() }).passthrough();
31
+ /** Sorts the engine can apply (Prompt 26.2). `relevance` is the engine's own ranking. */
32
+ export const SEARCH_SORTS = ['relevance', 'price_asc', 'price_desc', 'newest', 'rating', 'popularity'];
33
+ /** Most ids one `GET /internal/search` page returns. */
34
+ export const MAX_SEARCH_PAGE = 100;
35
+ /** Most category ids one search can filter on (the chosen category plus its children). */
36
+ export const MAX_SEARCH_CATEGORIES = 100;
37
+ /** Most brand names one search can filter on. */
38
+ export const MAX_SEARCH_BRANDS = 20;
39
+ /**
40
+ * Query of `GET /api/v1/internal/search` (caller: catalog-service). Always scoped to one shop (`companyId`, TEN-8).
41
+ * `categoryIds` is a comma-separated list of ULIDs; prices are minor units (KES cents, campaign-aware, CR-26-01).
42
+ */
43
+ export const searchQuerySchema = z.object({
44
+ companyId: idSchema,
45
+ /** Words to match. Empty browses the whole shop (the facets of a category page). */
46
+ q: z.string().trim().max(200).default(''),
47
+ categoryIds: z.string().max(MAX_SEARCH_CATEGORIES * 27).optional().transform((v) => (v ? v.split(',').filter(Boolean) : undefined))
48
+ .pipe(z.array(idSchema).max(MAX_SEARCH_CATEGORIES).optional()),
49
+ minPriceCents: z.coerce.number().int().nonnegative().optional(),
50
+ maxPriceCents: z.coerce.number().int().nonnegative().optional(),
51
+ inStock: z.enum(['true', 'false']).optional().transform((v) => (v === undefined ? undefined : v === 'true')),
52
+ /** Comma-separated brand names (any of). */
53
+ brands: z.string().max(MAX_SEARCH_BRANDS * 80).optional().transform((v) => (v ? v.split(',').map((b) => b.trim()).filter(Boolean) : undefined))
54
+ .pipe(z.array(z.string().max(80)).max(MAX_SEARCH_BRANDS).optional()),
55
+ /** Smallest average rating, 1 to 5. */
56
+ minRating: z.coerce.number().min(1).max(5).optional(),
57
+ sort: z.enum(SEARCH_SORTS).default('relevance'),
58
+ offset: z.coerce.number().int().min(0).max(10_000).default(0),
59
+ limit: z.coerce.number().int().min(1).max(MAX_SEARCH_PAGE).default(24),
60
+ }).strict();
61
+ /** Envelope `data` of `GET /api/v1/internal/search`: product ids in result order and the engine's total hit count. Catalog hydrates the cards. */
62
+ export const searchResultSchema = z.object({ ids: z.array(idSchema), total: z.number().int().nonnegative() }).passthrough();
63
+ /** Query of `GET /api/v1/internal/search/facets`: the same filters as the search, without sort or paging. */
64
+ export const searchFacetsQuerySchema = searchQuerySchema.omit({ sort: true, offset: true, limit: true });
65
+ /** One value of a facet and how many products of the current result carry it. */
66
+ const facetCount = z.number().int().nonnegative();
67
+ /**
68
+ * Facet counts of one search (26.3), under the shopper's current filters. Price buckets are `[minCents, maxCents]` inclusive
69
+ * (`maxCents` null = open-ended); rating entries are "at least `min` stars". Zero-count entries are left out.
70
+ */
71
+ export const searchFacetsSchema = z.object({
72
+ categories: z.array(z.object({ id: idSchema, count: facetCount })),
73
+ brands: z.array(z.object({ name: z.string(), count: facetCount })),
74
+ inStock: z.object({ count: facetCount }),
75
+ price: z.array(z.object({ minCents: z.number().int().nonnegative(), maxCents: z.number().int().nonnegative().nullable(), count: facetCount })),
76
+ rating: z.array(z.object({ min: z.number().int().min(1).max(5), count: facetCount })),
77
+ }).passthrough();
78
+ /** Envelope `data` of `GET /api/v1/internal/search/facets`. */
79
+ export const searchFacetsResultSchema = z.object({ facets: searchFacetsSchema }).passthrough();
29
80
  //# sourceMappingURL=search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/internal/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAC;AAEnD,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,QAAQ;IACZ,SAAS,EAAE,QAAQ;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;I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CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;CACtF,CAAC,CAAC,WAAW,EAAE,CAAC;AAEjB,+DAA+D;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC"}
@@ -20,6 +20,8 @@ export declare const searchDocumentSchema: z.ZodObject<{
20
20
  priceCents: z.ZodNumber;
21
21
  inStock: z.ZodBoolean;
22
22
  rating: z.ZodNumber;
23
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
24
+ popularity: z.ZodOptional<z.ZodNumber>;
23
25
  createdAt: z.ZodString;
24
26
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
25
27
  id: z.ZodString;
@@ -31,6 +33,8 @@ export declare const searchDocumentSchema: z.ZodObject<{
31
33
  priceCents: z.ZodNumber;
32
34
  inStock: z.ZodBoolean;
33
35
  rating: z.ZodNumber;
36
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
37
+ popularity: z.ZodOptional<z.ZodNumber>;
34
38
  createdAt: z.ZodString;
35
39
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
36
40
  id: z.ZodString;
@@ -42,6 +46,8 @@ export declare const searchDocumentSchema: z.ZodObject<{
42
46
  priceCents: z.ZodNumber;
43
47
  inStock: z.ZodBoolean;
44
48
  rating: z.ZodNumber;
49
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
50
+ popularity: z.ZodOptional<z.ZodNumber>;
45
51
  createdAt: z.ZodString;
46
52
  }, z.ZodTypeAny, "passthrough">>;
47
53
  /** Envelope `data` of `GET /api/v1/internal/search-documents/{productId}?companyId=`: `null` when the product is not indexable (draft, disabled, deleted, no active variant, shop not active). */
@@ -56,6 +62,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
56
62
  priceCents: z.ZodNumber;
57
63
  inStock: z.ZodBoolean;
58
64
  rating: z.ZodNumber;
65
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
66
+ popularity: z.ZodOptional<z.ZodNumber>;
59
67
  createdAt: z.ZodString;
60
68
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
61
69
  id: z.ZodString;
@@ -67,6 +75,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
67
75
  priceCents: z.ZodNumber;
68
76
  inStock: z.ZodBoolean;
69
77
  rating: z.ZodNumber;
78
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
79
+ popularity: z.ZodOptional<z.ZodNumber>;
70
80
  createdAt: z.ZodString;
71
81
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
72
82
  id: z.ZodString;
@@ -78,6 +88,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
78
88
  priceCents: z.ZodNumber;
79
89
  inStock: z.ZodBoolean;
80
90
  rating: z.ZodNumber;
91
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
92
+ popularity: z.ZodOptional<z.ZodNumber>;
81
93
  createdAt: z.ZodString;
82
94
  }, z.ZodTypeAny, "passthrough">>>;
83
95
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -91,6 +103,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
91
103
  priceCents: z.ZodNumber;
92
104
  inStock: z.ZodBoolean;
93
105
  rating: z.ZodNumber;
106
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
107
+ popularity: z.ZodOptional<z.ZodNumber>;
94
108
  createdAt: z.ZodString;
95
109
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
96
110
  id: z.ZodString;
@@ -102,6 +116,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
102
116
  priceCents: z.ZodNumber;
103
117
  inStock: z.ZodBoolean;
104
118
  rating: z.ZodNumber;
119
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
120
+ popularity: z.ZodOptional<z.ZodNumber>;
105
121
  createdAt: z.ZodString;
106
122
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
107
123
  id: z.ZodString;
@@ -113,6 +129,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
113
129
  priceCents: z.ZodNumber;
114
130
  inStock: z.ZodBoolean;
115
131
  rating: z.ZodNumber;
132
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
133
+ popularity: z.ZodOptional<z.ZodNumber>;
116
134
  createdAt: z.ZodString;
117
135
  }, z.ZodTypeAny, "passthrough">>>;
118
136
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
@@ -126,6 +144,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
126
144
  priceCents: z.ZodNumber;
127
145
  inStock: z.ZodBoolean;
128
146
  rating: z.ZodNumber;
147
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
148
+ popularity: z.ZodOptional<z.ZodNumber>;
129
149
  createdAt: z.ZodString;
130
150
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
131
151
  id: z.ZodString;
@@ -137,6 +157,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
137
157
  priceCents: z.ZodNumber;
138
158
  inStock: z.ZodBoolean;
139
159
  rating: z.ZodNumber;
160
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
161
+ popularity: z.ZodOptional<z.ZodNumber>;
140
162
  createdAt: z.ZodString;
141
163
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
142
164
  id: z.ZodString;
@@ -148,6 +170,8 @@ export declare const searchDocumentLookupSchema: z.ZodObject<{
148
170
  priceCents: z.ZodNumber;
149
171
  inStock: z.ZodBoolean;
150
172
  rating: z.ZodNumber;
173
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
174
+ popularity: z.ZodOptional<z.ZodNumber>;
151
175
  createdAt: z.ZodString;
152
176
  }, z.ZodTypeAny, "passthrough">>>;
153
177
  }, z.ZodTypeAny, "passthrough">>;
@@ -163,6 +187,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
163
187
  priceCents: z.ZodNumber;
164
188
  inStock: z.ZodBoolean;
165
189
  rating: z.ZodNumber;
190
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
191
+ popularity: z.ZodOptional<z.ZodNumber>;
166
192
  createdAt: z.ZodString;
167
193
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
168
194
  id: z.ZodString;
@@ -174,6 +200,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
174
200
  priceCents: z.ZodNumber;
175
201
  inStock: z.ZodBoolean;
176
202
  rating: z.ZodNumber;
203
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
204
+ popularity: z.ZodOptional<z.ZodNumber>;
177
205
  createdAt: z.ZodString;
178
206
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
179
207
  id: z.ZodString;
@@ -185,6 +213,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
185
213
  priceCents: z.ZodNumber;
186
214
  inStock: z.ZodBoolean;
187
215
  rating: z.ZodNumber;
216
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
217
+ popularity: z.ZodOptional<z.ZodNumber>;
188
218
  createdAt: z.ZodString;
189
219
  }, z.ZodTypeAny, "passthrough">>, "many">;
190
220
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -199,6 +229,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
199
229
  priceCents: z.ZodNumber;
200
230
  inStock: z.ZodBoolean;
201
231
  rating: z.ZodNumber;
232
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
233
+ popularity: z.ZodOptional<z.ZodNumber>;
202
234
  createdAt: z.ZodString;
203
235
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
204
236
  id: z.ZodString;
@@ -210,6 +242,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
210
242
  priceCents: z.ZodNumber;
211
243
  inStock: z.ZodBoolean;
212
244
  rating: z.ZodNumber;
245
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
246
+ popularity: z.ZodOptional<z.ZodNumber>;
213
247
  createdAt: z.ZodString;
214
248
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
215
249
  id: z.ZodString;
@@ -221,6 +255,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
221
255
  priceCents: z.ZodNumber;
222
256
  inStock: z.ZodBoolean;
223
257
  rating: z.ZodNumber;
258
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
259
+ popularity: z.ZodOptional<z.ZodNumber>;
224
260
  createdAt: z.ZodString;
225
261
  }, z.ZodTypeAny, "passthrough">>, "many">;
226
262
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -235,6 +271,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
235
271
  priceCents: z.ZodNumber;
236
272
  inStock: z.ZodBoolean;
237
273
  rating: z.ZodNumber;
274
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
275
+ popularity: z.ZodOptional<z.ZodNumber>;
238
276
  createdAt: z.ZodString;
239
277
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
240
278
  id: z.ZodString;
@@ -246,6 +284,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
246
284
  priceCents: z.ZodNumber;
247
285
  inStock: z.ZodBoolean;
248
286
  rating: z.ZodNumber;
287
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
288
+ popularity: z.ZodOptional<z.ZodNumber>;
249
289
  createdAt: z.ZodString;
250
290
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
251
291
  id: z.ZodString;
@@ -257,6 +297,8 @@ export declare const searchDocumentPageSchema: z.ZodObject<{
257
297
  priceCents: z.ZodNumber;
258
298
  inStock: z.ZodBoolean;
259
299
  rating: z.ZodNumber;
300
+ /** Demand signal for the popularity sort: how many shoppers rated or reviewed it (the count catalog owns, 26.3). Absent on older documents. */
301
+ popularity: z.ZodOptional<z.ZodNumber>;
260
302
  createdAt: z.ZodString;
261
303
  }, z.ZodTypeAny, "passthrough">>, "many">;
262
304
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -267,4 +309,735 @@ export type SearchDocument = z.infer<typeof searchDocumentSchema>;
267
309
  export type SearchDocumentLookup = z.infer<typeof searchDocumentLookupSchema>;
268
310
  /** Answer of the page read. */
269
311
  export type SearchDocumentPage = z.infer<typeof searchDocumentPageSchema>;
312
+ /** Sorts the engine can apply (Prompt 26.2). `relevance` is the engine's own ranking. */
313
+ export declare const SEARCH_SORTS: readonly ["relevance", "price_asc", "price_desc", "newest", "rating", "popularity"];
314
+ /** Most ids one `GET /internal/search` page returns. */
315
+ export declare const MAX_SEARCH_PAGE = 100;
316
+ /** Most category ids one search can filter on (the chosen category plus its children). */
317
+ export declare const MAX_SEARCH_CATEGORIES = 100;
318
+ /** Most brand names one search can filter on. */
319
+ export declare const MAX_SEARCH_BRANDS = 20;
320
+ /**
321
+ * Query of `GET /api/v1/internal/search` (caller: catalog-service). Always scoped to one shop (`companyId`, TEN-8).
322
+ * `categoryIds` is a comma-separated list of ULIDs; prices are minor units (KES cents, campaign-aware, CR-26-01).
323
+ */
324
+ export declare const searchQuerySchema: z.ZodObject<{
325
+ companyId: z.ZodString;
326
+ /** Words to match. Empty browses the whole shop (the facets of a category page). */
327
+ q: z.ZodDefault<z.ZodString>;
328
+ categoryIds: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
329
+ minPriceCents: z.ZodOptional<z.ZodNumber>;
330
+ maxPriceCents: z.ZodOptional<z.ZodNumber>;
331
+ inStock: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
332
+ /** Comma-separated brand names (any of). */
333
+ brands: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
334
+ /** Smallest average rating, 1 to 5. */
335
+ minRating: z.ZodOptional<z.ZodNumber>;
336
+ sort: z.ZodDefault<z.ZodEnum<["relevance", "price_asc", "price_desc", "newest", "rating", "popularity"]>>;
337
+ offset: z.ZodDefault<z.ZodNumber>;
338
+ limit: z.ZodDefault<z.ZodNumber>;
339
+ }, "strict", z.ZodTypeAny, {
340
+ sort: "rating" | "popularity" | "relevance" | "price_asc" | "price_desc" | "newest";
341
+ offset: number;
342
+ companyId: string;
343
+ q: string;
344
+ limit: number;
345
+ categoryIds?: string[] | undefined;
346
+ inStock?: boolean | undefined;
347
+ minPriceCents?: number | undefined;
348
+ maxPriceCents?: number | undefined;
349
+ brands?: string[] | undefined;
350
+ minRating?: number | undefined;
351
+ }, {
352
+ companyId: string;
353
+ sort?: "rating" | "popularity" | "relevance" | "price_asc" | "price_desc" | "newest" | undefined;
354
+ offset?: number | undefined;
355
+ categoryIds?: string | undefined;
356
+ inStock?: "true" | "false" | undefined;
357
+ q?: string | undefined;
358
+ minPriceCents?: number | undefined;
359
+ maxPriceCents?: number | undefined;
360
+ brands?: string | undefined;
361
+ minRating?: number | undefined;
362
+ limit?: number | undefined;
363
+ }>;
364
+ /** Envelope `data` of `GET /api/v1/internal/search`: product ids in result order and the engine's total hit count. Catalog hydrates the cards. */
365
+ export declare const searchResultSchema: z.ZodObject<{
366
+ ids: z.ZodArray<z.ZodString, "many">;
367
+ total: z.ZodNumber;
368
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
369
+ ids: z.ZodArray<z.ZodString, "many">;
370
+ total: z.ZodNumber;
371
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
372
+ ids: z.ZodArray<z.ZodString, "many">;
373
+ total: z.ZodNumber;
374
+ }, z.ZodTypeAny, "passthrough">>;
375
+ /** Parsed search query. */
376
+ export type SearchQuery = z.output<typeof searchQuerySchema>;
377
+ /** Answer of the search. */
378
+ export type SearchResult = z.infer<typeof searchResultSchema>;
379
+ /** Query of `GET /api/v1/internal/search/facets`: the same filters as the search, without sort or paging. */
380
+ export declare const searchFacetsQuerySchema: z.ZodObject<Omit<{
381
+ companyId: z.ZodString;
382
+ /** Words to match. Empty browses the whole shop (the facets of a category page). */
383
+ q: z.ZodDefault<z.ZodString>;
384
+ categoryIds: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
385
+ minPriceCents: z.ZodOptional<z.ZodNumber>;
386
+ maxPriceCents: z.ZodOptional<z.ZodNumber>;
387
+ inStock: z.ZodEffects<z.ZodOptional<z.ZodEnum<["true", "false"]>>, boolean | undefined, "true" | "false" | undefined>;
388
+ /** Comma-separated brand names (any of). */
389
+ brands: z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodString>, string[] | undefined, string | undefined>, z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
390
+ /** Smallest average rating, 1 to 5. */
391
+ minRating: z.ZodOptional<z.ZodNumber>;
392
+ sort: z.ZodDefault<z.ZodEnum<["relevance", "price_asc", "price_desc", "newest", "rating", "popularity"]>>;
393
+ offset: z.ZodDefault<z.ZodNumber>;
394
+ limit: z.ZodDefault<z.ZodNumber>;
395
+ }, "sort" | "offset" | "limit">, "strict", z.ZodTypeAny, {
396
+ companyId: string;
397
+ q: string;
398
+ categoryIds?: string[] | undefined;
399
+ inStock?: boolean | undefined;
400
+ minPriceCents?: number | undefined;
401
+ maxPriceCents?: number | undefined;
402
+ brands?: string[] | undefined;
403
+ minRating?: number | undefined;
404
+ }, {
405
+ companyId: string;
406
+ categoryIds?: string | undefined;
407
+ inStock?: "true" | "false" | undefined;
408
+ q?: string | undefined;
409
+ minPriceCents?: number | undefined;
410
+ maxPriceCents?: number | undefined;
411
+ brands?: string | undefined;
412
+ minRating?: number | undefined;
413
+ }>;
414
+ /**
415
+ * Facet counts of one search (26.3), under the shopper's current filters. Price buckets are `[minCents, maxCents]` inclusive
416
+ * (`maxCents` null = open-ended); rating entries are "at least `min` stars". Zero-count entries are left out.
417
+ */
418
+ export declare const searchFacetsSchema: z.ZodObject<{
419
+ categories: z.ZodArray<z.ZodObject<{
420
+ id: z.ZodString;
421
+ count: z.ZodNumber;
422
+ }, "strip", z.ZodTypeAny, {
423
+ id: string;
424
+ count: number;
425
+ }, {
426
+ id: string;
427
+ count: number;
428
+ }>, "many">;
429
+ brands: z.ZodArray<z.ZodObject<{
430
+ name: z.ZodString;
431
+ count: z.ZodNumber;
432
+ }, "strip", z.ZodTypeAny, {
433
+ name: string;
434
+ count: number;
435
+ }, {
436
+ name: string;
437
+ count: number;
438
+ }>, "many">;
439
+ inStock: z.ZodObject<{
440
+ count: z.ZodNumber;
441
+ }, "strip", z.ZodTypeAny, {
442
+ count: number;
443
+ }, {
444
+ count: number;
445
+ }>;
446
+ price: z.ZodArray<z.ZodObject<{
447
+ minCents: z.ZodNumber;
448
+ maxCents: z.ZodNullable<z.ZodNumber>;
449
+ count: z.ZodNumber;
450
+ }, "strip", z.ZodTypeAny, {
451
+ count: number;
452
+ minCents: number;
453
+ maxCents: number | null;
454
+ }, {
455
+ count: number;
456
+ minCents: number;
457
+ maxCents: number | null;
458
+ }>, "many">;
459
+ rating: z.ZodArray<z.ZodObject<{
460
+ min: z.ZodNumber;
461
+ count: z.ZodNumber;
462
+ }, "strip", z.ZodTypeAny, {
463
+ count: number;
464
+ min: number;
465
+ }, {
466
+ count: number;
467
+ min: number;
468
+ }>, "many">;
469
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
470
+ categories: z.ZodArray<z.ZodObject<{
471
+ id: z.ZodString;
472
+ count: z.ZodNumber;
473
+ }, "strip", z.ZodTypeAny, {
474
+ id: string;
475
+ count: number;
476
+ }, {
477
+ id: string;
478
+ count: number;
479
+ }>, "many">;
480
+ brands: z.ZodArray<z.ZodObject<{
481
+ name: z.ZodString;
482
+ count: z.ZodNumber;
483
+ }, "strip", z.ZodTypeAny, {
484
+ name: string;
485
+ count: number;
486
+ }, {
487
+ name: string;
488
+ count: number;
489
+ }>, "many">;
490
+ inStock: z.ZodObject<{
491
+ count: z.ZodNumber;
492
+ }, "strip", z.ZodTypeAny, {
493
+ count: number;
494
+ }, {
495
+ count: number;
496
+ }>;
497
+ price: z.ZodArray<z.ZodObject<{
498
+ minCents: z.ZodNumber;
499
+ maxCents: z.ZodNullable<z.ZodNumber>;
500
+ count: z.ZodNumber;
501
+ }, "strip", z.ZodTypeAny, {
502
+ count: number;
503
+ minCents: number;
504
+ maxCents: number | null;
505
+ }, {
506
+ count: number;
507
+ minCents: number;
508
+ maxCents: number | null;
509
+ }>, "many">;
510
+ rating: z.ZodArray<z.ZodObject<{
511
+ min: z.ZodNumber;
512
+ count: z.ZodNumber;
513
+ }, "strip", z.ZodTypeAny, {
514
+ count: number;
515
+ min: number;
516
+ }, {
517
+ count: number;
518
+ min: number;
519
+ }>, "many">;
520
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
521
+ categories: z.ZodArray<z.ZodObject<{
522
+ id: z.ZodString;
523
+ count: z.ZodNumber;
524
+ }, "strip", z.ZodTypeAny, {
525
+ id: string;
526
+ count: number;
527
+ }, {
528
+ id: string;
529
+ count: number;
530
+ }>, "many">;
531
+ brands: z.ZodArray<z.ZodObject<{
532
+ name: z.ZodString;
533
+ count: z.ZodNumber;
534
+ }, "strip", z.ZodTypeAny, {
535
+ name: string;
536
+ count: number;
537
+ }, {
538
+ name: string;
539
+ count: number;
540
+ }>, "many">;
541
+ inStock: z.ZodObject<{
542
+ count: z.ZodNumber;
543
+ }, "strip", z.ZodTypeAny, {
544
+ count: number;
545
+ }, {
546
+ count: number;
547
+ }>;
548
+ price: z.ZodArray<z.ZodObject<{
549
+ minCents: z.ZodNumber;
550
+ maxCents: z.ZodNullable<z.ZodNumber>;
551
+ count: z.ZodNumber;
552
+ }, "strip", z.ZodTypeAny, {
553
+ count: number;
554
+ minCents: number;
555
+ maxCents: number | null;
556
+ }, {
557
+ count: number;
558
+ minCents: number;
559
+ maxCents: number | null;
560
+ }>, "many">;
561
+ rating: z.ZodArray<z.ZodObject<{
562
+ min: z.ZodNumber;
563
+ count: z.ZodNumber;
564
+ }, "strip", z.ZodTypeAny, {
565
+ count: number;
566
+ min: number;
567
+ }, {
568
+ count: number;
569
+ min: number;
570
+ }>, "many">;
571
+ }, z.ZodTypeAny, "passthrough">>;
572
+ /** Envelope `data` of `GET /api/v1/internal/search/facets`. */
573
+ export declare const searchFacetsResultSchema: z.ZodObject<{
574
+ facets: z.ZodObject<{
575
+ categories: z.ZodArray<z.ZodObject<{
576
+ id: z.ZodString;
577
+ count: z.ZodNumber;
578
+ }, "strip", z.ZodTypeAny, {
579
+ id: string;
580
+ count: number;
581
+ }, {
582
+ id: string;
583
+ count: number;
584
+ }>, "many">;
585
+ brands: z.ZodArray<z.ZodObject<{
586
+ name: z.ZodString;
587
+ count: z.ZodNumber;
588
+ }, "strip", z.ZodTypeAny, {
589
+ name: string;
590
+ count: number;
591
+ }, {
592
+ name: string;
593
+ count: number;
594
+ }>, "many">;
595
+ inStock: z.ZodObject<{
596
+ count: z.ZodNumber;
597
+ }, "strip", z.ZodTypeAny, {
598
+ count: number;
599
+ }, {
600
+ count: number;
601
+ }>;
602
+ price: z.ZodArray<z.ZodObject<{
603
+ minCents: z.ZodNumber;
604
+ maxCents: z.ZodNullable<z.ZodNumber>;
605
+ count: z.ZodNumber;
606
+ }, "strip", z.ZodTypeAny, {
607
+ count: number;
608
+ minCents: number;
609
+ maxCents: number | null;
610
+ }, {
611
+ count: number;
612
+ minCents: number;
613
+ maxCents: number | null;
614
+ }>, "many">;
615
+ rating: z.ZodArray<z.ZodObject<{
616
+ min: z.ZodNumber;
617
+ count: z.ZodNumber;
618
+ }, "strip", z.ZodTypeAny, {
619
+ count: number;
620
+ min: number;
621
+ }, {
622
+ count: number;
623
+ min: number;
624
+ }>, "many">;
625
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
626
+ categories: z.ZodArray<z.ZodObject<{
627
+ id: z.ZodString;
628
+ count: z.ZodNumber;
629
+ }, "strip", z.ZodTypeAny, {
630
+ id: string;
631
+ count: number;
632
+ }, {
633
+ id: string;
634
+ count: number;
635
+ }>, "many">;
636
+ brands: z.ZodArray<z.ZodObject<{
637
+ name: z.ZodString;
638
+ count: z.ZodNumber;
639
+ }, "strip", z.ZodTypeAny, {
640
+ name: string;
641
+ count: number;
642
+ }, {
643
+ name: string;
644
+ count: number;
645
+ }>, "many">;
646
+ inStock: z.ZodObject<{
647
+ count: z.ZodNumber;
648
+ }, "strip", z.ZodTypeAny, {
649
+ count: number;
650
+ }, {
651
+ count: number;
652
+ }>;
653
+ price: z.ZodArray<z.ZodObject<{
654
+ minCents: z.ZodNumber;
655
+ maxCents: z.ZodNullable<z.ZodNumber>;
656
+ count: z.ZodNumber;
657
+ }, "strip", z.ZodTypeAny, {
658
+ count: number;
659
+ minCents: number;
660
+ maxCents: number | null;
661
+ }, {
662
+ count: number;
663
+ minCents: number;
664
+ maxCents: number | null;
665
+ }>, "many">;
666
+ rating: z.ZodArray<z.ZodObject<{
667
+ min: z.ZodNumber;
668
+ count: z.ZodNumber;
669
+ }, "strip", z.ZodTypeAny, {
670
+ count: number;
671
+ min: number;
672
+ }, {
673
+ count: number;
674
+ min: number;
675
+ }>, "many">;
676
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
677
+ categories: z.ZodArray<z.ZodObject<{
678
+ id: z.ZodString;
679
+ count: z.ZodNumber;
680
+ }, "strip", z.ZodTypeAny, {
681
+ id: string;
682
+ count: number;
683
+ }, {
684
+ id: string;
685
+ count: number;
686
+ }>, "many">;
687
+ brands: z.ZodArray<z.ZodObject<{
688
+ name: z.ZodString;
689
+ count: z.ZodNumber;
690
+ }, "strip", z.ZodTypeAny, {
691
+ name: string;
692
+ count: number;
693
+ }, {
694
+ name: string;
695
+ count: number;
696
+ }>, "many">;
697
+ inStock: z.ZodObject<{
698
+ count: z.ZodNumber;
699
+ }, "strip", z.ZodTypeAny, {
700
+ count: number;
701
+ }, {
702
+ count: number;
703
+ }>;
704
+ price: z.ZodArray<z.ZodObject<{
705
+ minCents: z.ZodNumber;
706
+ maxCents: z.ZodNullable<z.ZodNumber>;
707
+ count: z.ZodNumber;
708
+ }, "strip", z.ZodTypeAny, {
709
+ count: number;
710
+ minCents: number;
711
+ maxCents: number | null;
712
+ }, {
713
+ count: number;
714
+ minCents: number;
715
+ maxCents: number | null;
716
+ }>, "many">;
717
+ rating: z.ZodArray<z.ZodObject<{
718
+ min: z.ZodNumber;
719
+ count: z.ZodNumber;
720
+ }, "strip", z.ZodTypeAny, {
721
+ count: number;
722
+ min: number;
723
+ }, {
724
+ count: number;
725
+ min: number;
726
+ }>, "many">;
727
+ }, z.ZodTypeAny, "passthrough">>;
728
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
729
+ facets: z.ZodObject<{
730
+ categories: z.ZodArray<z.ZodObject<{
731
+ id: z.ZodString;
732
+ count: z.ZodNumber;
733
+ }, "strip", z.ZodTypeAny, {
734
+ id: string;
735
+ count: number;
736
+ }, {
737
+ id: string;
738
+ count: number;
739
+ }>, "many">;
740
+ brands: z.ZodArray<z.ZodObject<{
741
+ name: z.ZodString;
742
+ count: z.ZodNumber;
743
+ }, "strip", z.ZodTypeAny, {
744
+ name: string;
745
+ count: number;
746
+ }, {
747
+ name: string;
748
+ count: number;
749
+ }>, "many">;
750
+ inStock: z.ZodObject<{
751
+ count: z.ZodNumber;
752
+ }, "strip", z.ZodTypeAny, {
753
+ count: number;
754
+ }, {
755
+ count: number;
756
+ }>;
757
+ price: z.ZodArray<z.ZodObject<{
758
+ minCents: z.ZodNumber;
759
+ maxCents: z.ZodNullable<z.ZodNumber>;
760
+ count: z.ZodNumber;
761
+ }, "strip", z.ZodTypeAny, {
762
+ count: number;
763
+ minCents: number;
764
+ maxCents: number | null;
765
+ }, {
766
+ count: number;
767
+ minCents: number;
768
+ maxCents: number | null;
769
+ }>, "many">;
770
+ rating: z.ZodArray<z.ZodObject<{
771
+ min: z.ZodNumber;
772
+ count: z.ZodNumber;
773
+ }, "strip", z.ZodTypeAny, {
774
+ count: number;
775
+ min: number;
776
+ }, {
777
+ count: number;
778
+ min: number;
779
+ }>, "many">;
780
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
781
+ categories: z.ZodArray<z.ZodObject<{
782
+ id: z.ZodString;
783
+ count: z.ZodNumber;
784
+ }, "strip", z.ZodTypeAny, {
785
+ id: string;
786
+ count: number;
787
+ }, {
788
+ id: string;
789
+ count: number;
790
+ }>, "many">;
791
+ brands: z.ZodArray<z.ZodObject<{
792
+ name: z.ZodString;
793
+ count: z.ZodNumber;
794
+ }, "strip", z.ZodTypeAny, {
795
+ name: string;
796
+ count: number;
797
+ }, {
798
+ name: string;
799
+ count: number;
800
+ }>, "many">;
801
+ inStock: z.ZodObject<{
802
+ count: z.ZodNumber;
803
+ }, "strip", z.ZodTypeAny, {
804
+ count: number;
805
+ }, {
806
+ count: number;
807
+ }>;
808
+ price: z.ZodArray<z.ZodObject<{
809
+ minCents: z.ZodNumber;
810
+ maxCents: z.ZodNullable<z.ZodNumber>;
811
+ count: z.ZodNumber;
812
+ }, "strip", z.ZodTypeAny, {
813
+ count: number;
814
+ minCents: number;
815
+ maxCents: number | null;
816
+ }, {
817
+ count: number;
818
+ minCents: number;
819
+ maxCents: number | null;
820
+ }>, "many">;
821
+ rating: z.ZodArray<z.ZodObject<{
822
+ min: z.ZodNumber;
823
+ count: z.ZodNumber;
824
+ }, "strip", z.ZodTypeAny, {
825
+ count: number;
826
+ min: number;
827
+ }, {
828
+ count: number;
829
+ min: number;
830
+ }>, "many">;
831
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
832
+ categories: z.ZodArray<z.ZodObject<{
833
+ id: z.ZodString;
834
+ count: z.ZodNumber;
835
+ }, "strip", z.ZodTypeAny, {
836
+ id: string;
837
+ count: number;
838
+ }, {
839
+ id: string;
840
+ count: number;
841
+ }>, "many">;
842
+ brands: z.ZodArray<z.ZodObject<{
843
+ name: z.ZodString;
844
+ count: z.ZodNumber;
845
+ }, "strip", z.ZodTypeAny, {
846
+ name: string;
847
+ count: number;
848
+ }, {
849
+ name: string;
850
+ count: number;
851
+ }>, "many">;
852
+ inStock: z.ZodObject<{
853
+ count: z.ZodNumber;
854
+ }, "strip", z.ZodTypeAny, {
855
+ count: number;
856
+ }, {
857
+ count: number;
858
+ }>;
859
+ price: z.ZodArray<z.ZodObject<{
860
+ minCents: z.ZodNumber;
861
+ maxCents: z.ZodNullable<z.ZodNumber>;
862
+ count: z.ZodNumber;
863
+ }, "strip", z.ZodTypeAny, {
864
+ count: number;
865
+ minCents: number;
866
+ maxCents: number | null;
867
+ }, {
868
+ count: number;
869
+ minCents: number;
870
+ maxCents: number | null;
871
+ }>, "many">;
872
+ rating: z.ZodArray<z.ZodObject<{
873
+ min: z.ZodNumber;
874
+ count: z.ZodNumber;
875
+ }, "strip", z.ZodTypeAny, {
876
+ count: number;
877
+ min: number;
878
+ }, {
879
+ count: number;
880
+ min: number;
881
+ }>, "many">;
882
+ }, z.ZodTypeAny, "passthrough">>;
883
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
884
+ facets: z.ZodObject<{
885
+ categories: z.ZodArray<z.ZodObject<{
886
+ id: z.ZodString;
887
+ count: z.ZodNumber;
888
+ }, "strip", z.ZodTypeAny, {
889
+ id: string;
890
+ count: number;
891
+ }, {
892
+ id: string;
893
+ count: number;
894
+ }>, "many">;
895
+ brands: z.ZodArray<z.ZodObject<{
896
+ name: z.ZodString;
897
+ count: z.ZodNumber;
898
+ }, "strip", z.ZodTypeAny, {
899
+ name: string;
900
+ count: number;
901
+ }, {
902
+ name: string;
903
+ count: number;
904
+ }>, "many">;
905
+ inStock: z.ZodObject<{
906
+ count: z.ZodNumber;
907
+ }, "strip", z.ZodTypeAny, {
908
+ count: number;
909
+ }, {
910
+ count: number;
911
+ }>;
912
+ price: z.ZodArray<z.ZodObject<{
913
+ minCents: z.ZodNumber;
914
+ maxCents: z.ZodNullable<z.ZodNumber>;
915
+ count: z.ZodNumber;
916
+ }, "strip", z.ZodTypeAny, {
917
+ count: number;
918
+ minCents: number;
919
+ maxCents: number | null;
920
+ }, {
921
+ count: number;
922
+ minCents: number;
923
+ maxCents: number | null;
924
+ }>, "many">;
925
+ rating: z.ZodArray<z.ZodObject<{
926
+ min: z.ZodNumber;
927
+ count: z.ZodNumber;
928
+ }, "strip", z.ZodTypeAny, {
929
+ count: number;
930
+ min: number;
931
+ }, {
932
+ count: number;
933
+ min: number;
934
+ }>, "many">;
935
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
936
+ categories: z.ZodArray<z.ZodObject<{
937
+ id: z.ZodString;
938
+ count: z.ZodNumber;
939
+ }, "strip", z.ZodTypeAny, {
940
+ id: string;
941
+ count: number;
942
+ }, {
943
+ id: string;
944
+ count: number;
945
+ }>, "many">;
946
+ brands: z.ZodArray<z.ZodObject<{
947
+ name: z.ZodString;
948
+ count: z.ZodNumber;
949
+ }, "strip", z.ZodTypeAny, {
950
+ name: string;
951
+ count: number;
952
+ }, {
953
+ name: string;
954
+ count: number;
955
+ }>, "many">;
956
+ inStock: z.ZodObject<{
957
+ count: z.ZodNumber;
958
+ }, "strip", z.ZodTypeAny, {
959
+ count: number;
960
+ }, {
961
+ count: number;
962
+ }>;
963
+ price: z.ZodArray<z.ZodObject<{
964
+ minCents: z.ZodNumber;
965
+ maxCents: z.ZodNullable<z.ZodNumber>;
966
+ count: z.ZodNumber;
967
+ }, "strip", z.ZodTypeAny, {
968
+ count: number;
969
+ minCents: number;
970
+ maxCents: number | null;
971
+ }, {
972
+ count: number;
973
+ minCents: number;
974
+ maxCents: number | null;
975
+ }>, "many">;
976
+ rating: z.ZodArray<z.ZodObject<{
977
+ min: z.ZodNumber;
978
+ count: z.ZodNumber;
979
+ }, "strip", z.ZodTypeAny, {
980
+ count: number;
981
+ min: number;
982
+ }, {
983
+ count: number;
984
+ min: number;
985
+ }>, "many">;
986
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
987
+ categories: z.ZodArray<z.ZodObject<{
988
+ id: z.ZodString;
989
+ count: z.ZodNumber;
990
+ }, "strip", z.ZodTypeAny, {
991
+ id: string;
992
+ count: number;
993
+ }, {
994
+ id: string;
995
+ count: number;
996
+ }>, "many">;
997
+ brands: z.ZodArray<z.ZodObject<{
998
+ name: z.ZodString;
999
+ count: z.ZodNumber;
1000
+ }, "strip", z.ZodTypeAny, {
1001
+ name: string;
1002
+ count: number;
1003
+ }, {
1004
+ name: string;
1005
+ count: number;
1006
+ }>, "many">;
1007
+ inStock: z.ZodObject<{
1008
+ count: z.ZodNumber;
1009
+ }, "strip", z.ZodTypeAny, {
1010
+ count: number;
1011
+ }, {
1012
+ count: number;
1013
+ }>;
1014
+ price: z.ZodArray<z.ZodObject<{
1015
+ minCents: z.ZodNumber;
1016
+ maxCents: z.ZodNullable<z.ZodNumber>;
1017
+ count: z.ZodNumber;
1018
+ }, "strip", z.ZodTypeAny, {
1019
+ count: number;
1020
+ minCents: number;
1021
+ maxCents: number | null;
1022
+ }, {
1023
+ count: number;
1024
+ minCents: number;
1025
+ maxCents: number | null;
1026
+ }>, "many">;
1027
+ rating: z.ZodArray<z.ZodObject<{
1028
+ min: z.ZodNumber;
1029
+ count: z.ZodNumber;
1030
+ }, "strip", z.ZodTypeAny, {
1031
+ count: number;
1032
+ min: number;
1033
+ }, {
1034
+ count: number;
1035
+ min: number;
1036
+ }>, "many">;
1037
+ }, z.ZodTypeAny, "passthrough">>;
1038
+ }, z.ZodTypeAny, "passthrough">>;
1039
+ /** Facet counts of one search. */
1040
+ export type SearchFacets = z.infer<typeof searchFacetsSchema>;
1041
+ /** Parsed facets query. */
1042
+ export type SearchFacetsQuery = z.output<typeof searchFacetsQuerySchema>;
270
1043
  //# sourceMappingURL=search.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/internal/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAY,CAAC,EAAE,MAAM,sBAAsB,CAAC;AAEnD,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWjB,CAAC;AAEjB,kMAAkM;AAClM,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAwE,CAAC;AAEhH,mIAAmI;AACnI,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAsG,CAAC;AAE5I,6BAA6B;AAC7B,MAAM,MAAM,cAAc,GAAG,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMf,CAAC;AAEjB,+DAA+D;AAC/D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAyD,CAAC;AAE/F,kCAAkC;AAClC,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,2BAA2B;AAC3B,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heavybit/ecommerce-contracts",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "The e-commerce app's shared contracts: app settings, identity and scope bindings, step-up scopes, event catalogue and v1 payload schemas. Built on @heavybit/shared-lib; no business logic.",
5
5
  "license": "MIT",
6
6
  "type": "module",