@reactionary/hcl 0.9.2

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.
Files changed (36) hide show
  1. package/README.md +11 -0
  2. package/capabilities/category.capability.js +170 -0
  3. package/capabilities/product-search.capability.js +89 -0
  4. package/capabilities/product.capability.js +157 -0
  5. package/core/client.js +120 -0
  6. package/core/initialize.js +97 -0
  7. package/core/initialize.types.js +8 -0
  8. package/core/locale-params.js +9 -0
  9. package/factories/category/category.factory.js +60 -0
  10. package/factories/index.js +3 -0
  11. package/factories/product/product.factory.js +154 -0
  12. package/factories/product-search/product-search.factory.js +71 -0
  13. package/index.js +11 -0
  14. package/package.json +14 -0
  15. package/schema/capabilities.schema.js +27 -0
  16. package/schema/category.schema.js +9 -0
  17. package/schema/configuration.schema.js +33 -0
  18. package/schema/hcl.schema.js +0 -0
  19. package/src/capabilities/category.capability.d.ts +15 -0
  20. package/src/capabilities/product-search.capability.d.ts +14 -0
  21. package/src/capabilities/product.capability.d.ts +20 -0
  22. package/src/core/client.d.ts +19 -0
  23. package/src/core/initialize.d.ts +5 -0
  24. package/src/core/initialize.types.d.ts +42 -0
  25. package/src/core/locale-params.d.ts +6 -0
  26. package/src/factories/category/category.factory.d.ts +12 -0
  27. package/src/factories/index.d.ts +3 -0
  28. package/src/factories/product/product.factory.d.ts +8 -0
  29. package/src/factories/product-search/product-search.factory.d.ts +11 -0
  30. package/src/index.d.ts +11 -0
  31. package/src/schema/capabilities.schema.d.ts +63 -0
  32. package/src/schema/category.schema.d.ts +27 -0
  33. package/src/schema/configuration.schema.d.ts +18 -0
  34. package/src/schema/hcl.schema.d.ts +312 -0
  35. package/src/test/test-utils.d.ts +241 -0
  36. package/test/test-utils.js +30 -0
@@ -0,0 +1,27 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * HCL-specific extension of the core Category schema.
4
+ * Adds `uniqueId` — the internal HCL uniqueID required by the product search
5
+ * API's `categoryId` parameter. Stored here so `createCategoryNavigationFilter`
6
+ * can return it without an extra API call.
7
+ */
8
+ export declare const HclCategorySchema: z.ZodObject<{
9
+ identifier: z.ZodDefault<z.ZodObject<{
10
+ key: z.ZodString;
11
+ }, z.core.$loose>>;
12
+ name: z.ZodDefault<z.ZodString>;
13
+ slug: z.ZodDefault<z.ZodString>;
14
+ text: z.ZodDefault<z.ZodString>;
15
+ images: z.ZodDefault<z.ZodArray<z.ZodObject<{
16
+ sourceUrl: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
17
+ altText: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
18
+ width: z.ZodNonOptional<z.ZodOptional<z.ZodNumber>>;
19
+ height: z.ZodNonOptional<z.ZodOptional<z.ZodNumber>>;
20
+ }, z.core.$loose>>>;
21
+ parentCategory: z.ZodOptional<z.ZodObject<{
22
+ key: z.ZodString;
23
+ }, z.core.$loose>>;
24
+ uniqueId: z.ZodOptional<z.ZodString>;
25
+ parentUniqueId: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$loose>;
27
+ export type HclCategory = z.output<typeof HclCategorySchema>;
@@ -0,0 +1,18 @@
1
+ import * as z from 'zod';
2
+ export declare const HclConfigurationSchema: z.ZodObject<{
3
+ apiUrl: z.ZodString;
4
+ storeId: z.ZodString;
5
+ catalogId: z.ZodOptional<z.ZodString>;
6
+ /**
7
+ * Maps BCP 47 locale strings (from RequestContext) to HCL Commerce langId values.
8
+ * HCL uses numeric language identifiers (e.g. -1 for English, -11 for Finnish).
9
+ * Add an entry for each locale your store supports.
10
+ */
11
+ localeMap: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
12
+ profiles: z.ZodDefault<z.ZodObject<{
13
+ product: z.ZodDefault<z.ZodString>;
14
+ productSearch: z.ZodDefault<z.ZodString>;
15
+ categoryBrowse: z.ZodDefault<z.ZodString>;
16
+ }, z.core.$loose>>;
17
+ }, z.core.$loose>;
18
+ export type HclConfiguration = z.infer<typeof HclConfigurationSchema>;
@@ -0,0 +1,312 @@
1
+ /**
2
+ * HCL Commerce Query Service response types.
3
+ * Shaped from the actual API response, which is richer than the generated OpenAPI contracts.
4
+ * Reference: karkkainen-commerce-storefront/integration/data/core/types/Product.ts
5
+ */
6
+ export interface HclPrice {
7
+ usage: string;
8
+ description: string;
9
+ currency: string;
10
+ value: string;
11
+ }
12
+ export interface HclProductAttributeValue {
13
+ identifier: string | string[];
14
+ sequence: string | string[];
15
+ unitOfMeasure: string | string[];
16
+ unitID: string | string[];
17
+ image1: string | string[];
18
+ image1path: string | string[];
19
+ value: string | string[];
20
+ id: string | string[];
21
+ attributeIdentifier?: string;
22
+ }
23
+ export interface HclProductAttribute {
24
+ id: string;
25
+ identifier: string;
26
+ name: string;
27
+ usage: string;
28
+ displayable: string;
29
+ storeDisplay: string;
30
+ facetable: string;
31
+ comparable: string;
32
+ searchable: string;
33
+ swatchable: string;
34
+ merchandisable: string;
35
+ sequence: string;
36
+ associatedKeyword: string;
37
+ values: HclProductAttributeValue[];
38
+ }
39
+ export interface HclAttachment {
40
+ mimeType: string;
41
+ attachmentAssetPath: string;
42
+ name: string;
43
+ attachmentAssetID: string;
44
+ }
45
+ export interface HclSeo {
46
+ href: string;
47
+ tokenValue?: string;
48
+ }
49
+ export interface HclGroupingProperties {
50
+ groupCount: number;
51
+ groupHero: string;
52
+ groupListPriceRange: [string, string];
53
+ groupOfferPriceRange: [string, string];
54
+ groupMinPriceValue: string;
55
+ groupMaxPriceValue: string;
56
+ }
57
+ export interface HclImage {
58
+ name: string;
59
+ sequence: string;
60
+ fullImage: string;
61
+ thumbnail: string;
62
+ /** Raw (pre-CDN-transform) full image path. Present in standard HCL_V2 detail profiles. */
63
+ fullImageRaw?: string;
64
+ /** Raw (pre-CDN-transform) thumbnail path. Present in standard HCL_V2 detail profiles. */
65
+ thumbnailRaw?: string;
66
+ }
67
+ /**
68
+ * A product item as returned by HCL search profiles
69
+ * (e.g. HCL_V2_findProductsBySearchTermWithPrice, HCL_V2_findProductsByCategoryWithPriceRange).
70
+ *
71
+ * Search profile responses contain aggregated entries without nested SKU items[].
72
+ * Attribute values may be arrays (aggregated across all variants of the group).
73
+ * Use this type in product-search factories.
74
+ */
75
+ export interface HclProductSearchItem {
76
+ id: string;
77
+ partNumber: string;
78
+ name: string;
79
+ shortDescription: string;
80
+ /** Absent in search profiles — only populated in detail profiles. */
81
+ longDescription?: string;
82
+ thumbnail: string;
83
+ /** Raw (pre-CDN-transform) thumbnail path. Standard HCL_V2 field. */
84
+ thumbnailRaw?: string;
85
+ /**
86
+ * Full-size image URL. Absent in search profiles (HCL_V2_findProductsBySearchTerm*).
87
+ * Present in detail profiles (HCL_V2_findProductByPartNumber_Details).
88
+ */
89
+ fullImage?: string;
90
+ /** 'product' | 'item' | 'variant' | 'package' | 'bundle' */
91
+ type: string;
92
+ catalogEntryTypeCode?: string;
93
+ hasSingleSKU: boolean;
94
+ /** 'true' | 'false' */
95
+ buyable: string;
96
+ sellerId: string;
97
+ /** Absent in search profiles. */
98
+ seller?: string;
99
+ manufacturer: string;
100
+ /** Absent in search profiles. */
101
+ numberOfSKUs?: number;
102
+ /** Absent in search profiles. */
103
+ sequence?: string;
104
+ /** Internal HCL store ID. Standard HCL_V2 field. */
105
+ storeID?: string;
106
+ seo?: HclSeo;
107
+ parentCatalogGroupID: string | string[];
108
+ parentCatalogEntryID?: string;
109
+ price: HclPrice[];
110
+ /**
111
+ * Descriptive/Defining attributes. Present in detail profiles and some
112
+ * search profiles (server-dependent). Always treat as optional.
113
+ */
114
+ attributes?: HclProductAttribute[];
115
+ /** Aggregated variant pricing/grouping data — present only in search profile responses */
116
+ groupingProperties?: HclGroupingProperties;
117
+ }
118
+ /**
119
+ * A full product entry as returned by HCL detail profiles
120
+ * (e.g. HCL_V2_findProductByPartNumber_Details).
121
+ *
122
+ * Extends HclProductSearchItem with detail-only fields: nested SKU items[],
123
+ * attachments, images, and merchandising associations.
124
+ * Use this type in product detail factories.
125
+ */
126
+ export interface HclProductResponse extends HclProductSearchItem {
127
+ /** Variant SKUs with full detail data — only present in detail profile responses */
128
+ items: HclProductResponse[];
129
+ /** Kit/bundle SKU list */
130
+ sKUs?: HclProductResponse[];
131
+ /** Kit/bundle component list */
132
+ components?: HclProductResponse[];
133
+ /** Quantity — only present on components array elements */
134
+ quantity?: string;
135
+ merchandisingAssociations?: HclProductResponse[];
136
+ attachments?: HclAttachment[];
137
+ images?: HclImage[];
138
+ /**
139
+ * Raw (pre-CDN-transform) full image path. Standard HCL_V2 field in detail profiles.
140
+ * For SKU items, also present as a sibling of `fullImage`.
141
+ */
142
+ fullImageRaw?: string;
143
+ /**
144
+ * Link to parent category API endpoint. Standard HCL_V2 field on SKU-level items.
145
+ * e.g. `/search/resources/api/v2/categories?storeId=41&id=10507`
146
+ */
147
+ parent?: string;
148
+ }
149
+ export interface HclFacetEntry {
150
+ /** The API returns count as number or string depending on facet type. */
151
+ count: number | string;
152
+ /** Display label shown to the user */
153
+ label: string;
154
+ name: string;
155
+ /** The filterable value, e.g. an attribute value or category ID */
156
+ value: string;
157
+ term: string;
158
+ frequency: string;
159
+ fullPath: string;
160
+ fullPathCategoryIds: string;
161
+ image: string;
162
+ shortDescription: string;
163
+ }
164
+ /**
165
+ * A single facet group as returned in HCL product search responses.
166
+ * Reference: karkkainen-commerce-storefront/integration/data/core/types/Product.ts
167
+ */
168
+ export interface HclFacet {
169
+ /** The facet key/identifier, e.g. "manufacturer" */
170
+ value: string;
171
+ name: string;
172
+ entry: HclFacetEntry[];
173
+ }
174
+ export interface HclProductQueryResponse {
175
+ recordSetCount?: number;
176
+ recordSetTotal?: number;
177
+ recordSetStartNumber?: number;
178
+ recordSetComplete?: boolean;
179
+ /** v2 query service total count field */
180
+ total?: number;
181
+ /** Standard v2/products response array */
182
+ contents?: HclProductResponse[];
183
+ /** Used by some profiles (e.g. productview) */
184
+ catalogEntryView?: HclProductResponse[];
185
+ facets?: HclFacet[];
186
+ }
187
+ /**
188
+ * Response from /api/v2/urls — resolves a URL slug to a token/identifier.
189
+ * Reference: karkkainen-commerce-storefront/integration/data/core/types/IncomingContent.ts
190
+ */
191
+ export interface HclUrlResponse {
192
+ /** The URL slug that was looked up */
193
+ identifier: string;
194
+ /** The type of the resolved entity, e.g. 'ProductToken' | 'CategoryToken' */
195
+ tokenName: string;
196
+ /** The partNumber (product) or id (category) of the resolved entity */
197
+ tokenExternalValue: string;
198
+ /** Internal HCL token value */
199
+ tokenValue: string;
200
+ /** Internal token record ID */
201
+ id?: string;
202
+ /** Store ID for this token */
203
+ storeId?: string;
204
+ /** Token status code (1 = active) */
205
+ status?: number;
206
+ /** Locale string, e.g. 'en_US' */
207
+ language?: string;
208
+ /** Store type, e.g. 'CPS' */
209
+ 'store.type'?: string;
210
+ redirect?: string;
211
+ page?: {
212
+ /** Page template name, e.g. 'PRODUCT_PAGE' or 'CATEGORY_PAGE' */
213
+ name?: string;
214
+ type: string;
215
+ title: string;
216
+ metaDescription: string;
217
+ metaKeyword: string;
218
+ imageAlternateDescription?: string;
219
+ redirect?: string;
220
+ };
221
+ }
222
+ export interface HclUrlQueryResponse {
223
+ contents?: HclUrlResponse[];
224
+ }
225
+ /**
226
+ * SEO data for a category as returned by /api/v2/categories.
227
+ * Reference: karkkainen-commerce-storefront/integration/data/core/types/Category.ts
228
+ */
229
+ export interface HclCategorySeo {
230
+ /** Not present in actual API responses — kept optional for forward-compatibility */
231
+ id?: string;
232
+ /** Full SEO URL path, e.g. "/Electronics/c/Electronics" */
233
+ href: string;
234
+ }
235
+ /**
236
+ * Navigation links returned alongside each category entry.
237
+ * Note: `children` links are plain strings in format "href: <url>", not objects.
238
+ */
239
+ export interface HclCategoryLinks {
240
+ parent?: {
241
+ href: string;
242
+ };
243
+ children?: string[];
244
+ self?: {
245
+ href: string;
246
+ };
247
+ }
248
+ /**
249
+ * A single category entry as returned by the HCL Commerce Query Service.
250
+ */
251
+ export interface HclCategoryResponse {
252
+ uniqueID: string;
253
+ /** Alias for uniqueID — both fields are returned by the API */
254
+ id?: string;
255
+ /** Human-readable URL slug / identifier, e.g. "Electronics" */
256
+ identifier: string;
257
+ name: string;
258
+ shortDescription?: string;
259
+ longDescription?: string;
260
+ description?: string;
261
+ thumbnail?: string;
262
+ fullImage?: string;
263
+ sequence: string;
264
+ /** Internal HCL store ID. Standard HCL_V2 field. */
265
+ storeID?: string;
266
+ seo: HclCategorySeo;
267
+ /** Parent category uniqueID — may be a root marker value like "-1" or "0" */
268
+ parentCatalogGroupID: string;
269
+ children?: HclCategoryResponse[];
270
+ links?: HclCategoryLinks;
271
+ }
272
+ export interface HclCategoryQueryResponse {
273
+ contents?: HclCategoryResponse[];
274
+ }
275
+ export interface HclFindCategoriesQuery {
276
+ storeId?: string;
277
+ catalogId?: string;
278
+ langId?: string;
279
+ /** Filter by category uniqueID */
280
+ id?: string[];
281
+ /** Filter by category identifier (slug) */
282
+ identifier?: string[];
283
+ /** Limit child categories to those under this parent uniqueID */
284
+ parentCategoryId?: string;
285
+ /** Controls depth and breadth: "depth,limit" e.g. "1,0" means 1 level deep, no count limit */
286
+ depthAndLimit?: string;
287
+ profileName?: string;
288
+ }
289
+ export interface HclFindProductsQuery {
290
+ storeId?: string;
291
+ catalogId?: string;
292
+ langId?: string;
293
+ currency?: string;
294
+ /** Filter by HCL product IDs */
295
+ id?: string[];
296
+ /** Filter by part numbers (product or SKU level) */
297
+ partNumber?: string[];
298
+ categoryId?: string;
299
+ searchTerm?: string;
300
+ contractId?: string;
301
+ /** Profile name controlling the subset of data returned */
302
+ profileName?: string;
303
+ limit?: number;
304
+ offset?: number;
305
+ checkEntitlement?: boolean;
306
+ /**
307
+ * Active facet filter values to apply (repeated param).
308
+ * Each entry is the URL-encoded value from HclFacetEntry.value,
309
+ * e.g. 'manufacturer.raw%3A%22Home+Design%22'.
310
+ */
311
+ facets?: string[];
312
+ }
@@ -0,0 +1,241 @@
1
+ import { type RequestContext } from '@reactionary/core';
2
+ import { type HclConfiguration } from '../schema/configuration.schema.js';
3
+ export declare function getHclTestConfiguration(): HclConfiguration;
4
+ export declare function createHclClient(contextOverrides?: Partial<RequestContext>): Omit<import("@reactionary/core").Client, "product" | "productSearch" | "category"> & Omit<import("@reactionary/core").ClientFromCapabilities<{
5
+ product?: true | undefined;
6
+ productSearch?: true | undefined;
7
+ price?: false | undefined;
8
+ cart?: false | undefined;
9
+ checkout?: false | undefined;
10
+ inventory?: false | undefined;
11
+ category?: true | undefined;
12
+ }>, "product" | "productSearch" | "price" | "cart" | "checkout" | "inventory" | "category"> & {
13
+ product: import("../index.js").HclProductCapability<import("../index.js").HclProductFactory<import("zod").ZodObject<{
14
+ identifier: import("zod").ZodObject<{
15
+ key: import("zod").ZodString;
16
+ }, import("zod/v4/core").$loose>;
17
+ name: import("zod").ZodString;
18
+ slug: import("zod").ZodString;
19
+ description: import("zod").ZodString;
20
+ longDescription: import("zod").ZodString;
21
+ brand: import("zod").ZodString;
22
+ manufacturer: import("zod").ZodString;
23
+ parentCategories: import("zod").ZodArray<import("zod").ZodObject<{
24
+ key: import("zod").ZodString;
25
+ }, import("zod/v4/core").$loose>>;
26
+ published: import("zod").ZodBoolean;
27
+ sharedAttributes: import("zod").ZodArray<import("zod").ZodObject<{
28
+ identifier: import("zod").ZodObject<{
29
+ key: import("zod").ZodString;
30
+ }, import("zod/v4/core").$loose>;
31
+ group: import("zod").ZodString;
32
+ name: import("zod").ZodString;
33
+ values: import("zod").ZodArray<import("zod").ZodObject<{
34
+ identifier: import("zod").ZodObject<{
35
+ key: import("zod").ZodString;
36
+ }, import("zod/v4/core").$loose>;
37
+ value: import("zod").ZodString;
38
+ label: import("zod").ZodString;
39
+ }, import("zod/v4/core").$loose>>;
40
+ }, import("zod/v4/core").$loose>>;
41
+ options: import("zod").ZodArray<import("zod").ZodObject<{
42
+ identifier: import("zod").ZodObject<{
43
+ key: import("zod").ZodString;
44
+ }, import("zod/v4/core").$loose>;
45
+ name: import("zod").ZodString;
46
+ values: import("zod").ZodArray<import("zod").ZodObject<{
47
+ identifier: import("zod").ZodObject<{
48
+ option: import("zod").ZodObject<{
49
+ key: import("zod").ZodString;
50
+ }, import("zod/v4/core").$loose>;
51
+ key: import("zod").ZodString;
52
+ }, import("zod/v4/core").$loose>;
53
+ label: import("zod").ZodString;
54
+ }, import("zod/v4/core").$loose>>;
55
+ }, import("zod/v4/core").$loose>>;
56
+ mainVariant: import("zod").ZodObject<{
57
+ identifier: import("zod").ZodObject<{
58
+ sku: import("zod").ZodString;
59
+ }, import("zod/v4/core").$loose>;
60
+ name: import("zod").ZodString;
61
+ images: import("zod").ZodArray<import("zod").ZodObject<{
62
+ sourceUrl: import("zod").ZodDefault<import("zod").ZodString>;
63
+ altText: import("zod").ZodDefault<import("zod").ZodString>;
64
+ width: import("zod").ZodOptional<import("zod").ZodNumber>;
65
+ height: import("zod").ZodOptional<import("zod").ZodNumber>;
66
+ }, import("zod/v4/core").$loose>>;
67
+ ean: import("zod").ZodString;
68
+ gtin: import("zod").ZodString;
69
+ upc: import("zod").ZodString;
70
+ barcode: import("zod").ZodString;
71
+ options: import("zod").ZodArray<import("zod").ZodObject<{
72
+ identifier: import("zod").ZodObject<{
73
+ key: import("zod").ZodString;
74
+ }, import("zod/v4/core").$loose>;
75
+ name: import("zod").ZodString;
76
+ value: import("zod").ZodObject<{
77
+ identifier: import("zod").ZodObject<{
78
+ option: import("zod").ZodObject<{
79
+ key: import("zod").ZodString;
80
+ }, import("zod/v4/core").$loose>;
81
+ key: import("zod").ZodString;
82
+ }, import("zod/v4/core").$loose>;
83
+ label: import("zod").ZodString;
84
+ }, import("zod/v4/core").$loose>;
85
+ }, import("zod/v4/core").$loose>>;
86
+ }, import("zod/v4/core").$loose>;
87
+ variants: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
88
+ identifier: import("zod").ZodObject<{
89
+ sku: import("zod").ZodString;
90
+ }, import("zod/v4/core").$loose>;
91
+ name: import("zod").ZodString;
92
+ images: import("zod").ZodArray<import("zod").ZodObject<{
93
+ sourceUrl: import("zod").ZodDefault<import("zod").ZodString>;
94
+ altText: import("zod").ZodDefault<import("zod").ZodString>;
95
+ width: import("zod").ZodOptional<import("zod").ZodNumber>;
96
+ height: import("zod").ZodOptional<import("zod").ZodNumber>;
97
+ }, import("zod/v4/core").$loose>>;
98
+ ean: import("zod").ZodString;
99
+ gtin: import("zod").ZodString;
100
+ upc: import("zod").ZodString;
101
+ barcode: import("zod").ZodString;
102
+ options: import("zod").ZodArray<import("zod").ZodObject<{
103
+ identifier: import("zod").ZodObject<{
104
+ key: import("zod").ZodString;
105
+ }, import("zod/v4/core").$loose>;
106
+ name: import("zod").ZodString;
107
+ value: import("zod").ZodObject<{
108
+ identifier: import("zod").ZodObject<{
109
+ option: import("zod").ZodObject<{
110
+ key: import("zod").ZodString;
111
+ }, import("zod/v4/core").$loose>;
112
+ key: import("zod").ZodString;
113
+ }, import("zod/v4/core").$loose>;
114
+ label: import("zod").ZodString;
115
+ }, import("zod/v4/core").$loose>;
116
+ }, import("zod/v4/core").$loose>>;
117
+ }, import("zod/v4/core").$loose>>>;
118
+ }, import("zod/v4/core").$loose>>>;
119
+ productSearch: import("../index.js").HclProductSearchCapability<import("../index.js").HclProductSearchFactory<import("zod").ZodObject<{
120
+ pageNumber: import("zod").ZodNumber;
121
+ pageSize: import("zod").ZodNumber;
122
+ totalCount: import("zod").ZodNumber;
123
+ totalPages: import("zod").ZodNumber;
124
+ items: import("zod").ZodArray<import("zod").ZodObject<{
125
+ identifier: import("zod").ZodObject<{
126
+ key: import("zod").ZodString;
127
+ }, import("zod/v4/core").$loose>;
128
+ name: import("zod").ZodString;
129
+ slug: import("zod").ZodString;
130
+ variants: import("zod").ZodArray<import("zod").ZodObject<{
131
+ variant: import("zod").ZodObject<{
132
+ sku: import("zod").ZodString;
133
+ }, import("zod/v4/core").$loose>;
134
+ image: import("zod").ZodObject<{
135
+ sourceUrl: import("zod").ZodDefault<import("zod").ZodString>;
136
+ altText: import("zod").ZodDefault<import("zod").ZodString>;
137
+ width: import("zod").ZodOptional<import("zod").ZodNumber>;
138
+ height: import("zod").ZodOptional<import("zod").ZodNumber>;
139
+ }, import("zod/v4/core").$loose>;
140
+ options: import("zod").ZodOptional<import("zod").ZodObject<{
141
+ identifier: import("zod").ZodObject<{
142
+ key: import("zod").ZodString;
143
+ }, import("zod/v4/core").$loose>;
144
+ name: import("zod").ZodString;
145
+ value: import("zod").ZodObject<{
146
+ identifier: import("zod").ZodObject<{
147
+ option: import("zod").ZodObject<{
148
+ key: import("zod").ZodString;
149
+ }, import("zod/v4/core").$loose>;
150
+ key: import("zod").ZodString;
151
+ }, import("zod/v4/core").$loose>;
152
+ label: import("zod").ZodString;
153
+ }, import("zod/v4/core").$loose>;
154
+ }, import("zod/v4/core").$loose>>;
155
+ }, import("zod/v4/core").$loose>>;
156
+ }, import("zod/v4/core").$loose>>;
157
+ identifier: import("zod").ZodObject<{
158
+ term: import("zod").ZodString;
159
+ facets: import("zod").ZodArray<import("zod").ZodObject<{
160
+ facet: import("zod").ZodObject<{
161
+ key: import("zod").ZodString;
162
+ }, import("zod/v4/core").$loose>;
163
+ key: import("zod").ZodString;
164
+ }, import("zod/v4/core").$strip>>;
165
+ filters: import("zod").ZodArray<import("zod").ZodString>;
166
+ paginationOptions: import("zod").ZodObject<{
167
+ pageNumber: import("zod").ZodDefault<import("zod").ZodNumber>;
168
+ pageSize: import("zod").ZodDefault<import("zod").ZodNumber>;
169
+ }, import("zod/v4/core").$loose>;
170
+ categoryFilter: import("zod").ZodOptional<import("zod").ZodObject<{
171
+ facet: import("zod").ZodObject<{
172
+ key: import("zod").ZodString;
173
+ }, import("zod/v4/core").$loose>;
174
+ key: import("zod").ZodString;
175
+ }, import("zod/v4/core").$strip>>;
176
+ company: import("zod").ZodOptional<import("zod").ZodObject<{
177
+ taxIdentifier: import("zod").ZodString;
178
+ }, import("zod/v4/core").$loose>>;
179
+ }, import("zod/v4/core").$loose>;
180
+ facets: import("zod").ZodArray<import("zod").ZodObject<{
181
+ identifier: import("zod").ZodObject<{
182
+ key: import("zod").ZodString;
183
+ }, import("zod/v4/core").$loose>;
184
+ name: import("zod").ZodString;
185
+ values: import("zod").ZodArray<import("zod").ZodObject<{
186
+ identifier: import("zod").ZodObject<{
187
+ facet: import("zod").ZodObject<{
188
+ key: import("zod").ZodString;
189
+ }, import("zod/v4/core").$loose>;
190
+ key: import("zod").ZodString;
191
+ }, import("zod/v4/core").$strip>;
192
+ name: import("zod").ZodString;
193
+ count: import("zod").ZodNumber;
194
+ active: import("zod").ZodBoolean;
195
+ }, import("zod/v4/core").$loose>>;
196
+ }, import("zod/v4/core").$loose>>;
197
+ }, import("zod/v4/core").$strip>>>;
198
+ category: import("../index.js").HclCategoryCapability<import("../index.js").HclCategoryFactory<import("zod").ZodObject<{
199
+ identifier: import("zod").ZodDefault<import("zod").ZodObject<{
200
+ key: import("zod").ZodString;
201
+ }, import("zod/v4/core").$loose>>;
202
+ name: import("zod").ZodDefault<import("zod").ZodString>;
203
+ slug: import("zod").ZodDefault<import("zod").ZodString>;
204
+ text: import("zod").ZodDefault<import("zod").ZodString>;
205
+ images: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
206
+ sourceUrl: import("zod").ZodNonOptional<import("zod").ZodDefault<import("zod").ZodString>>;
207
+ altText: import("zod").ZodNonOptional<import("zod").ZodDefault<import("zod").ZodString>>;
208
+ width: import("zod").ZodNonOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
209
+ height: import("zod").ZodNonOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
210
+ }, import("zod/v4/core").$loose>>>;
211
+ parentCategory: import("zod").ZodOptional<import("zod").ZodObject<{
212
+ key: import("zod").ZodString;
213
+ }, import("zod/v4/core").$loose>>;
214
+ uniqueId: import("zod").ZodOptional<import("zod").ZodString>;
215
+ parentUniqueId: import("zod").ZodOptional<import("zod").ZodString>;
216
+ }, import("zod/v4/core").$loose>, import("zod").ZodObject<{
217
+ pageNumber: import("zod").ZodNumber;
218
+ pageSize: import("zod").ZodNumber;
219
+ totalCount: import("zod").ZodNumber;
220
+ totalPages: import("zod").ZodNumber;
221
+ items: import("zod").ZodArray<import("zod").ZodObject<{
222
+ identifier: import("zod").ZodDefault<import("zod").ZodObject<{
223
+ key: import("zod").ZodString;
224
+ }, import("zod/v4/core").$loose>>;
225
+ name: import("zod").ZodDefault<import("zod").ZodString>;
226
+ slug: import("zod").ZodDefault<import("zod").ZodString>;
227
+ text: import("zod").ZodDefault<import("zod").ZodString>;
228
+ images: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
229
+ sourceUrl: import("zod").ZodNonOptional<import("zod").ZodDefault<import("zod").ZodString>>;
230
+ altText: import("zod").ZodNonOptional<import("zod").ZodDefault<import("zod").ZodString>>;
231
+ width: import("zod").ZodNonOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
232
+ height: import("zod").ZodNonOptional<import("zod").ZodOptional<import("zod").ZodNumber>>;
233
+ }, import("zod/v4/core").$loose>>>;
234
+ parentCategory: import("zod").ZodOptional<import("zod").ZodObject<{
235
+ key: import("zod").ZodString;
236
+ }, import("zod/v4/core").$loose>>;
237
+ }, import("zod/v4/core").$loose>>;
238
+ }, import("zod/v4/core").$strip>>>;
239
+ } & {
240
+ cache: import("@reactionary/core").Cache;
241
+ };
@@ -0,0 +1,30 @@
1
+ import {
2
+ ClientBuilder,
3
+ NoOpCache,
4
+ createInitialRequestContext
5
+ } from "@reactionary/core";
6
+ import { withHclCapabilities } from "../core/initialize.js";
7
+ import {
8
+ HclConfigurationSchema
9
+ } from "../schema/configuration.schema.js";
10
+ function getHclTestConfiguration() {
11
+ return HclConfigurationSchema.parse({
12
+ apiUrl: process.env["HCL_API_URL"],
13
+ storeId: process.env["HCL_STORE_ID"],
14
+ catalogId: process.env["HCL_CATALOG_ID"] || void 0
15
+ });
16
+ }
17
+ function createHclClient(contextOverrides = {}) {
18
+ const context = { ...createInitialRequestContext(), ...contextOverrides };
19
+ return new ClientBuilder(context).withCache(new NoOpCache()).withCapability(
20
+ withHclCapabilities(getHclTestConfiguration(), {
21
+ product: { enabled: true },
22
+ category: { enabled: true },
23
+ productSearch: { enabled: true }
24
+ })
25
+ ).build();
26
+ }
27
+ export {
28
+ createHclClient,
29
+ getHclTestConfiguration
30
+ };