sizebay-core-sdk 1.10.0-dev.2 → 1.10.0-dev.3

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/README.md CHANGED
@@ -93,10 +93,10 @@ Fetch products similar to a reference.
93
93
  <!-- DOCGEN:params GetSimilarProductsParams -->
94
94
  | Field | Type | Required | Description |
95
95
  | ----- | ---- | :------: | ----------- |
96
- | `permalink` | string | Yes | Product permalink used as reference for similarity. |
97
- | `page` | number | No | Pagination: current page (optional). |
98
- | `perPage` | number | No | Pagination: number of items per page (optional). |
99
- | `similarityThreshold` | number | No | Minimum similarity threshold (0 to 1). Default value: 0.5 |
96
+ | `permalink` | string | Yes | The URL permalink of the reference product for the similarity search. |
97
+ | `page` | number | No | The page number for pagination. |
98
+ | `perPage` | number | No | The number of items to return per page. |
99
+ | `similarityThreshold` | number | No | The minimum similarity score (0-1) for the results. |
100
100
  | `tenantId` | number | Yes | Tenant (client) ID. |
101
101
  | `collectionName` | string | Yes | Embeddings collection name (namespace). |
102
102
  | `sid` | string | Yes | Session identifier (`sid`) for the user. |
@@ -111,11 +111,13 @@ Fetch products similar to a reference.
111
111
 
112
112
  <!-- DOCGEN:returns GetSimilarProductsResponse -->
113
113
  > **`GetSimilarProductsResponse`**
114
- > * `data`: `ProductDto[]` — Array of products that match the visual similarity criteria. Ordered by relevance/similarity score, with most similar items first.
115
- > * `page`: `number` Current page number in the paginated result set. Used for navigation through large result sets.
116
- > * `perPage`: `number` — Number of items returned per page. Defines the size of each page in the pagination.
117
- > * `total`: `number` — Total number of products matching the similarity criteria. Across all pages, useful for calculating total pages.
118
- > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or expired. When true, What Fits Me filtering was requested but couldn't be applied.
114
+ > * `data`: `ProductDto[]` — An array of products that are visually similar to the reference item.
115
+ The results are ordered by their similarity score.
116
+ > * `page`: `number` — The current page number of the results.
117
+ > * `perPage`: `number` — The number of items per page.
118
+ > * `total`: `number` — The total number of similar products found.
119
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or expired,
120
+ which may affect personalized results.
119
121
  <!-- /DOCGEN -->
120
122
 
121
123
  #### Example
@@ -145,8 +147,10 @@ Retrieve pairs of complementary products.
145
147
  <!-- DOCGEN:params GetComplementaryProductsParams -->
146
148
  | Field | Type | Required | Description |
147
149
  | ----- | ---- | :------: | ----------- |
148
- | `permalink` | string | Yes | URL of the reference product. |
149
- | `similarityThreshold` | number | Yes | Minimum similarity score (0-1) for results. Default value: 0.2 |
150
+ | `permalink` | string | Yes | The URL permalink of the reference product.
151
+ Its style, color, and category are used to find matching items. |
152
+ | `similarityThreshold` | number | Yes | The minimum similarity score (0-1) for recommended products.
153
+ A higher value yields more similar items, while a lower value provides more variety. |
150
154
  | `tenantId` | number | Yes | Tenant (client) ID. |
151
155
  | `collectionName` | string | Yes | Embeddings collection name (namespace). |
152
156
  | `sid` | string | Yes | Session identifier (`sid`) for the user. |
@@ -161,9 +165,11 @@ Retrieve pairs of complementary products.
161
165
 
162
166
  <!-- DOCGEN:returns GetComplementaryProductsResponse -->
163
167
  > **`GetComplementaryProductsResponse`**
164
- > * `baseProduct`: `ProductDto` — The reference product used in the lookup.
165
- > * `complementary`: `ComplementaryPairDto[]` List of recommended product pairs.
166
- > * `invalidPersonaHash`: `boolean` — Whether the persona hash is invalid.
168
+ > * `baseProduct`: `ProductDto` — The reference product used to generate recommendations.
169
+ This is the item that corresponds to the permalink from the request.
170
+ > * `complementary`: `ComplementaryPairDto[]` — A list of recommended pairs of products that are complementary to the base product.
171
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or has expired.
172
+ If true, personalization may be affected.
167
173
  <!-- /DOCGEN -->
168
174
 
169
175
  #### Example
@@ -199,7 +205,7 @@ Find visually similar items from an uploaded image.
199
205
  | `style` | string | No | Preferred style hint. |
200
206
  | `color` | string | No | Main color of interest. |
201
207
  | `productClass` | ProductClass | No | Target product class. |
202
- | `clothType` | string | No | Target cloth type. |
208
+ | `clothType` | ClothType | No | Target cloth type for filtering results. |
203
209
  | `page` | number | No | Current page number. |
204
210
  | `perPage` | number | No | Number of results per page. |
205
211
  | `similarityThreshold` | number | No | Similarity threshold for matching (0-1). |
@@ -242,16 +248,16 @@ Get products that complete a look from an image.
242
248
  <!-- DOCGEN:params GetComplementaryByImageBodyDto -->
243
249
  | Field | Type | Required | Description |
244
250
  | ----- | ---- | :------: | ----------- |
245
- | `similarityThreshold` | number | Yes | Minimum similarity score (0-1) for results. |
246
- | `baseClothType` | string | Yes | Type of the base product in the image. |
247
- | `targetClothType` | string | Yes | Type of complementary products to find. |
251
+ | `similarityThreshold` | number | Yes | The minimum similarity score (0-1) for recommended products. |
252
+ | `baseClothType` | ClothType | Yes | The type of product identified in the reference image. |
253
+ | `targetClothType` | ClothType | Yes | The desired type of complementary products to be recommended. |
248
254
  | `image` | string | Yes | Base64-encoded image data. |
249
255
  | `ageRange` | string | No | Target age range. |
250
256
  | `gender` | string | No | User gender (optional). |
251
257
  | `style` | string | No | Preferred style hint. |
252
258
  | `color` | string | No | Main color of interest. |
253
259
  | `productClass` | ProductClass | No | Target product class. |
254
- | `clothType` | string | No | Target cloth type. |
260
+ | `clothType` | ClothType | No | Target cloth type for filtering results. |
255
261
  | `page` | number | No | Current page number. |
256
262
  | `perPage` | number | No | Number of results per page. |
257
263
  | `tenantId` | number | Yes | Tenant (client) ID. |
@@ -268,12 +274,12 @@ Get products that complete a look from an image.
268
274
 
269
275
  <!-- DOCGEN:returns GetComplementaryProductsByImageResponse -->
270
276
  > **`GetComplementaryProductsByImageResponse`**
271
- > * `baseProduct`: `ProductDto` — Main product found from image.
272
- > * `complementary`: `ProductDto[]` — Complementary products recommended.
273
- > * `page`: `number` — Pagination - current page.
274
- > * `perPage`: `number` — Pagination - per page.
275
- > * `total`: `number` — Pagination - total results.
276
- > * `invalidPersonaHash`: `boolean` — Whether the persona hash is invalid.
277
+ > * `baseProduct`: `ProductDto` — The product identified in the reference image.
278
+ > * `complementary`: `ProductDto[]` — A list of recommended products that are complementary to the base product.
279
+ > * `page`: `number` — The current page number of the results.
280
+ > * `perPage`: `number` — The number of items per page.
281
+ > * `total`: `number` — The total number of complementary products found.
282
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or has expired.
277
283
  <!-- /DOCGEN -->
278
284
 
279
285
  #### Example
@@ -309,8 +315,8 @@ Fetches or reuses session context.
309
315
 
310
316
  <!-- DOCGEN:returns SessionContext -->
311
317
  > **`SessionContext`**
312
- > * `sid`: `string` — Session identifier (catalog user ID) used for subsequent API calls. This value should be passed as the 'sid' parameter in tracking and recommendation requests.
313
- > * `sessionId`: `number` — Unique numeric identifier for this session instance. Used internally by Sizebay for session management and analytics.
318
+ > * `sid`: `string` — The session identifier (sid) used in subsequent API calls for tracking and recommendations.
319
+ > * `sessionId`: `number` — A unique numeric identifier for the session instance, used for internal analytics.
314
320
  <!-- /DOCGEN -->
315
321
 
316
322
  #### Example
@@ -336,20 +342,34 @@ Sends user profile data. Uses cached `sid` if not provided.
336
342
  <!-- DOCGEN:params SessionProfilePayload -->
337
343
  | Field | Type | Required | Description |
338
344
  | ----- | ---- | :------: | ----------- |
339
- | `name` | string | Yes | Internal profile identifier or display name for the user. Typically used for analytics and user identification within Sizebay's system. |
340
- | `skinType` | number | Yes | Skin tone classification used for color matching and style recommendations. Numerical value representing different skin tone categories. |
341
- | `footShape` | string | Yes | Foot shape classification for footwear recommendations. Used to provide better shoe fit analysis when available. |
342
- | `gender` | string | Yes | User's gender for size system selection and fit calculations. Uses single character format as defined by Sizebay's standards. |
343
- | `age` | string | Yes | User's age for age-appropriate sizing and recommendations. Stored as string to accommodate various age formats. |
344
- | `is3dFeel` | boolean | Yes | Feature flag indicating if advanced 3D fit visualization is enabled. Affects the level of detail in size recommendations and fit analysis. |
345
- | `weight` | string | Yes | User's body weight in the unit system specified by isMetric. Used for comprehensive fit analysis and size calculations. |
346
- | `height` | string | Yes | User's height in the unit system specified by isMetric. Critical measurement for accurate size recommendations. |
345
+ | `name` | string | Yes | Internal profile identifier or display name for the user.
346
+ Typically used for analytics and user identification within Sizebay's system. |
347
+ | `skinType` | number | Yes | Skin tone classification used for color matching and style recommendations.
348
+ Numerical value representing different skin tone categories. |
349
+ | `footShape` | string | Yes | Foot shape classification for footwear recommendations.
350
+ Used to provide better shoe fit analysis when available. |
351
+ | `gender` | string | Yes | User's gender for size system selection and fit calculations.
352
+ Uses single character format as defined by Sizebay's standards. |
353
+ | `age` | string | Yes | User's age for age-appropriate sizing and recommendations.
354
+ Stored as string to accommodate various age formats. |
355
+ | `is3dFeel` | boolean | Yes | Feature flag indicating if advanced 3D fit visualization is enabled.
356
+ Affects the level of detail in size recommendations and fit analysis. |
357
+ | `weight` | string | Yes | User's body weight in the unit system specified by isMetric.
358
+ Used for comprehensive fit analysis and size calculations. |
359
+ | `height` | string | Yes | User's height in the unit system specified by isMetric.
360
+ Critical measurement for accurate size recommendations. |
347
361
  | `measures` | { insoleLength: number; poundWeight: number | null; } | Yes | Additional precise body measurements for enhanced fit accuracy. |
348
- | `product` | string | Yes | Product context or identifier related to the current profiling session. Can link the profile to a specific product being viewed. |
349
- | `isMetric` | boolean | Yes | Unit system preference for all measurements and recommendations. - true: Metric system (cm, kg) - false: Imperial system (inches, lbs) |
350
- | `bodyShapeChest` | number | Yes | Chest/bust body shape index for clothing fit analysis. Numerical value representing body proportions in the chest area. |
351
- | `bodyShapeHip` | number | Yes | Hip body shape index for lower body clothing fit analysis. Numerical value representing body proportions in the hip area. |
352
- | `bodyShapeWaist` | number | Yes | Waist body shape index for torso fit analysis. Numerical value representing body proportions in the waist area. |
362
+ | `product` | string | Yes | Product context or identifier related to the current profiling session.
363
+ Can link the profile to a specific product being viewed. |
364
+ | `isMetric` | boolean | Yes | Unit system preference for all measurements and recommendations.
365
+ - true: Metric system (cm, kg)
366
+ - false: Imperial system (inches, lbs) |
367
+ | `bodyShapeChest` | number | Yes | Chest/bust body shape index for clothing fit analysis.
368
+ Numerical value representing body proportions in the chest area. |
369
+ | `bodyShapeHip` | number | Yes | Hip body shape index for lower body clothing fit analysis.
370
+ Numerical value representing body proportions in the hip area. |
371
+ | `bodyShapeWaist` | number | Yes | Waist body shape index for torso fit analysis.
372
+ Numerical value representing body proportions in the waist area. |
353
373
  <!-- /DOCGEN -->
354
374
 
355
375
  #### Example
@@ -385,24 +405,25 @@ await client.sendProfile(profilePayload);
385
405
  <!-- DOCGEN:params ProductDto -->
386
406
  | Field | Type | Required | Description |
387
407
  | ----- | ---- | :------: | ----------- |
388
- | `id` | string | Yes | Unique product identifier from the e-commerce platform (e.g., Shopify product ID). |
389
- | `title` | string | Yes | Product display name or title as shown in the store. |
390
- | `productType` | string | Yes | Hierarchical product category path using standardized format. |
391
- | `link` | string | Yes | Complete URL to the product page in the e-commerce store. |
392
- | `imageLink` | string | Yes | URL of the main product image used for AI analysis and display. |
393
- | `gender` | string | Yes | Target gender for the product using standardized values. |
394
- | `availability` | string | Yes | Current stock availability status of the product. |
395
- | `productHash` | string | Yes | SHA-256 hash used for product identification, caching, and deduplication in Sizebay's systems. |
396
- | `price` | string | Yes | Product price including currency code in the format "value CURRENCY". |
397
- | `salePrice` | string | Yes | Sale or discounted price including currency code. Same format as regular price. |
398
- | `itemGroupId` | string | Yes | Identifier used to group product variations (different sizes/colors of the same item). Often matches the main product ID when no variations exist. |
399
- | `brand` | string | Yes | Product brand name in uppercase format. |
400
- | `color` | string | Yes | Product color specification - can be a color name or internal color code. |
401
- | `style` | string | Yes | Product style identifier or description used for categorization and filtering. |
402
- | `gtin` | string | Yes | Global Trade Item Number - unique product identifier for retail tracking. Often matches the product ID in e-commerce platforms. |
403
- | `additionalImageLinks` | string[] | Yes | Array of additional product image URLs for comprehensive visual analysis. Listed in order of priority/relevance for AI processing. |
404
- | `suitableSizes` | SuitableSizeDto[] | No | Size recommendations with comfort scores generated by Sizebay's What Fits Me technology. Only populated when What Fits Me filtering is enabled and user profile is available. |
405
- | `clothType` | string | No | Standardized clothing type classification used for size table matching and recommendations. |
408
+ | `id` | string | Yes | Unique identifier for the product from the e-commerce platform. |
409
+ | `title` | string | Yes | The display name or title of the product. |
410
+ | `productType` | string | Yes | The product's category, often in a hierarchical format. |
411
+ | `link` | string | Yes | The direct URL to the product's page. |
412
+ | `imageLink` | string | Yes | The URL for the main product image. |
413
+ | `gender` | string | Yes | The target gender for the product. |
414
+ | `availability` | string | Yes | The current stock availability of the product. |
415
+ | `productHash` | string | Yes | A SHA-256 hash for internal identification and caching. |
416
+ | `price` | string | Yes | The product's price, including the currency. |
417
+ | `salePrice` | string | Yes | The product's sale price, if applicable. |
418
+ | `itemGroupId` | string | Yes | An identifier for grouping product variants (e.g., by color or size). |
419
+ | `brand` | string | Yes | The brand of the product. |
420
+ | `color` | string | Yes | The color of the product. |
421
+ | `style` | string | Yes | The style classification of the product. |
422
+ | `gtin` | string | Yes | The Global Trade Item Number (GTIN) for the product. |
423
+ | `additionalImageLinks` | string[] | Yes | A list of additional image URLs for the product. |
424
+ | `suitableSizes` | SuitableSizeDto[] | No | Size recommendations from Sizebay's What Fits Me feature, including comfort scores.
425
+ This is populated when personalized sizing is available. |
426
+ | `clothType` | ClothType | No | The standardized clothing type, used for recommendations and size chart matching. |
406
427
  <!-- /DOCGEN -->
407
428
 
408
429
  #### `TrackData`
@@ -410,10 +431,10 @@ await client.sendProfile(profilePayload);
410
431
  <!-- DOCGEN:params TrackData -->
411
432
  | Field | Type | Required | Description |
412
433
  | ----- | ---- | :------: | ----------- |
413
- | `sid` | string | Yes | Session identifier obtained from Sizebay's session service. This is the catalog user ID returned by the session endpoint. |
414
- | `tenantId` | number | Yes | Unique identifier for the client/tenant using Sizebay's services. Each e-commerce partner has their own tenant ID. |
415
- | `properties` | Record<string, JSONValue> | Yes | Flexible key-value map containing event-specific data and context. Can include product information, user actions, custom metrics, etc. |
416
- | `permalink` | string | No | URL of the product page associated with this event. Required for product-related events like "RECOMMENDATION_DONE", "ADD_TO_CART". Optional for general tracking events. |
434
+ | `sid` | string | Yes | The session identifier from Sizebay's session service, representing the user. |
435
+ | `tenantId` | number | Yes | The unique identifier for the tenant (client). |
436
+ | `properties` | Record<string, JSONValue> | Yes | A key-value map for event-specific data. |
437
+ | `permalink` | string | No | The URL of the product page associated with the event, if applicable. |
417
438
  <!-- /DOCGEN -->
418
439
 
419
440
  ### `SuitableSizeDto`
@@ -421,9 +442,14 @@ await client.sendProfile(profilePayload);
421
442
  <!-- DOCGEN:params SuitableSizeDto -->
422
443
  | Field | Type | Required | Description |
423
444
  | ----- | ---- | :------: | ----------- |
424
- | `size` | string | Yes | Size label as defined in the product catalog (e.g., "M", "42", "8-10"). Uses the same format as the store's size system. |
425
- | `comfortable` | number | Yes | AI-calculated comfort score ranging from 0 to 1, where: - 0.0 = Very uncomfortable fit - 0.5 = Adequate fit - 1.0 = Perfect comfortable fit |
426
- | `value` | boolean | No | Boolean indicator of whether this size is considered suitable for the user. Based on comfort threshold and fit analysis algorithms. |
445
+ | `size` | string | Yes | Size label as defined in the product catalog (e.g., "M", "42", "8-10").
446
+ Uses the same format as the store's size system. |
447
+ | `comfortable` | number | Yes | AI-calculated comfort score ranging from 0 to 1, where:
448
+ - 0.0 = Very uncomfortable fit
449
+ - 0.5 = Adequate fit
450
+ - 1.0 = Perfect comfortable fit |
451
+ | `value` | boolean | No | Boolean indicator of whether this size is considered suitable for the user.
452
+ Based on comfort threshold and fit analysis algorithms. |
427
453
  <!-- /DOCGEN -->
428
454
 
429
455
  ### `ComplementaryPairDto`
@@ -431,6 +457,33 @@ await client.sendProfile(profilePayload);
431
457
  <!-- DOCGEN:params ComplementaryPairDto -->
432
458
  | Field | Type | Required | Description |
433
459
  | ----- | ---- | :------: | ----------- |
434
- | `first` | ProductDto | Yes | Primary product in the complementary relationship. This is typically the base item that the user is viewing or interested in. |
435
- | `secondary` | ProductDto | No | Secondary product that complements the first item. May be null if no suitable complementary item is found. |
436
- <!-- /DOCGEN -->
460
+ | `first` | ProductDto | Yes | First recommended product that complements the base product sent in the request.
461
+ This product is selected based on style compatibility and fashion rules. |
462
+ | `secondary` | ProductDto | No | Second recommended product that complements the base product sent in the request.
463
+ May be null if no suitable second complementary item is found. |
464
+ <!-- /DOCGEN -->
465
+
466
+ ### `ClothType`
467
+
468
+ Standardized clothing type enum for categorization and filtering:
469
+
470
+ ```typescript
471
+ export const ClothType = {
472
+ TOP: 'TOP',
473
+ BOTTOM: 'BOTTOM',
474
+ SHOE_ACCESSORY: 'SHOE_ACCESSORY',
475
+ FULL_BODY: 'FULL_BODY',
476
+ UNDERWEAR_FULL_BODY: 'UNDERWEAR_FULL_BODY',
477
+ UNDERWEAR_BOTTOM: 'UNDERWEAR_BOTTOM',
478
+ UNDERWEAR_TOP: 'UNDERWEAR_TOP',
479
+ WETSUIT_FULL_BODY: 'WETSUIT_FULL_BODY',
480
+ WETSUIT_BOTTOM: 'WETSUIT_BOTTOM',
481
+ WETSUIT_TOP: 'WETSUIT_TOP',
482
+ } as const;
483
+
484
+ // Usage examples:
485
+ ClothType.TOP // For shirts, blouses, jackets
486
+ ClothType.BOTTOM // For pants, skirts, shorts
487
+ ClothType.FULL_BODY // For dresses, jumpsuits
488
+ ClothType.SHOE_ACCESSORY // For shoes, accessories
489
+ ```
@@ -1,5 +1,6 @@
1
1
  import { BaseSearchParams } from './base-search.dto';
2
2
  import { ProductClass } from '../../common/product-class.type';
3
+ import { ClothType } from '../../common/cloth-type.type';
3
4
  export interface BaseImageSearchParams extends BaseSearchParams {
4
5
  image: string;
5
6
  ageRange?: string;
@@ -7,7 +8,7 @@ export interface BaseImageSearchParams extends BaseSearchParams {
7
8
  style?: string;
8
9
  color?: string;
9
10
  productClass?: ProductClass;
10
- clothType?: string;
11
+ clothType?: ClothType;
11
12
  page?: number;
12
13
  perPage?: number;
13
14
  similarityThreshold?: number;
@@ -1,6 +1,7 @@
1
1
  import { BaseImageSearchParams } from '../base/base-image-search.dto';
2
+ import { ClothType } from '../../common/cloth-type.type';
2
3
  export interface GetComplementaryByImageBodyDto extends BaseImageSearchParams {
3
4
  similarityThreshold: number;
4
- baseClothType: string;
5
- targetClothType: string;
5
+ baseClothType: ClothType;
6
+ targetClothType: ClothType;
6
7
  }
@@ -1,13 +1,13 @@
1
1
  export declare const ClothType: {
2
- TOP: string;
3
- BOTTOM: string;
4
- SHOE_ACCESSORY: string;
5
- FULL_BODY: string;
6
- UNDERWEAR_FULL_BODY: string;
7
- UNDERWEAR_BOTTOM: string;
8
- UNDERWEAR_TOP: string;
9
- WETSUIT_FULL_BODY: string;
10
- WETSUIT_BOTTOM: string;
11
- WETSUIT_TOP: string;
2
+ readonly TOP: "TOP";
3
+ readonly BOTTOM: "BOTTOM";
4
+ readonly SHOE_ACCESSORY: "SHOE_ACCESSORY";
5
+ readonly FULL_BODY: "FULL_BODY";
6
+ readonly UNDERWEAR_FULL_BODY: "UNDERWEAR_FULL_BODY";
7
+ readonly UNDERWEAR_BOTTOM: "UNDERWEAR_BOTTOM";
8
+ readonly UNDERWEAR_TOP: "UNDERWEAR_TOP";
9
+ readonly WETSUIT_FULL_BODY: "WETSUIT_FULL_BODY";
10
+ readonly WETSUIT_BOTTOM: "WETSUIT_BOTTOM";
11
+ readonly WETSUIT_TOP: "WETSUIT_TOP";
12
12
  };
13
13
  export type ClothType = (typeof ClothType)[keyof typeof ClothType];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sizebay-core-sdk",
3
- "version": "1.10.0-dev.2",
3
+ "version": "1.10.0-dev.3",
4
4
  "description": "A SDK designed for integrating multiple services (such as event tracking, AI services, etc.) into your application.",
5
5
  "main": "dist/sizebay-core-sdk.umd.js",
6
6
  "module": "dist/sizebay-core-sdk.es.js",