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

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,11 @@ 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.<br>The results are ordered by their similarity score.
115
+ > * `page`: `number` — The current page number of the results.
116
+ > * `perPage`: `number` — The number of items per page.
117
+ > * `total`: `number` — The total number of similar products found.
118
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or expired,<br>which may affect personalized results.
119
119
  <!-- /DOCGEN -->
120
120
 
121
121
  #### Example
@@ -145,8 +145,8 @@ Retrieve pairs of complementary products.
145
145
  <!-- DOCGEN:params GetComplementaryProductsParams -->
146
146
  | Field | Type | Required | Description |
147
147
  | ----- | ---- | :------: | ----------- |
148
- | `permalink` | string | Yes | URL of the reference product. |
149
- | `similarityThreshold` | number | Yes | Minimum similarity score (0-1) for results. Default value: 0.2 |
148
+ | `permalink` | string | Yes | The URL permalink of the reference product.<br>Its style, color, and category are used to find matching items. |
149
+ | `similarityThreshold` | number | Yes | The minimum similarity score (0-1) for recommended products.<br>A higher value yields more similar items, while a lower value provides more variety. |
150
150
  | `tenantId` | number | Yes | Tenant (client) ID. |
151
151
  | `collectionName` | string | Yes | Embeddings collection name (namespace). |
152
152
  | `sid` | string | Yes | Session identifier (`sid`) for the user. |
@@ -161,9 +161,9 @@ Retrieve pairs of complementary products.
161
161
 
162
162
  <!-- DOCGEN:returns GetComplementaryProductsResponse -->
163
163
  > **`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.
164
+ > * `baseProduct`: `ProductDto` — The reference product used to generate recommendations.<br>This is the item that corresponds to the permalink from the request.
165
+ > * `complementary`: `ComplementaryPairDto[]` — A list of recommended pairs of products that are complementary to the base product.
166
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or has expired.<br>If true, personalization may be affected.
167
167
  <!-- /DOCGEN -->
168
168
 
169
169
  #### Example
@@ -199,7 +199,7 @@ Find visually similar items from an uploaded image.
199
199
  | `style` | string | No | Preferred style hint. |
200
200
  | `color` | string | No | Main color of interest. |
201
201
  | `productClass` | ProductClass | No | Target product class. |
202
- | `clothType` | string | No | Target cloth type. |
202
+ | `clothType` | ClothType | No | Target cloth type for filtering results. |
203
203
  | `page` | number | No | Current page number. |
204
204
  | `perPage` | number | No | Number of results per page. |
205
205
  | `similarityThreshold` | number | No | Similarity threshold for matching (0-1). |
@@ -242,16 +242,16 @@ Get products that complete a look from an image.
242
242
  <!-- DOCGEN:params GetComplementaryByImageBodyDto -->
243
243
  | Field | Type | Required | Description |
244
244
  | ----- | ---- | :------: | ----------- |
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. |
245
+ | `similarityThreshold` | number | Yes | The minimum similarity score (0-1) for recommended products. |
246
+ | `baseClothType` | ClothType | Yes | The type of product identified in the reference image. |
247
+ | `targetClothType` | ClothType | Yes | The desired type of complementary products to be recommended. |
248
248
  | `image` | string | Yes | Base64-encoded image data. |
249
249
  | `ageRange` | string | No | Target age range. |
250
250
  | `gender` | string | No | User gender (optional). |
251
251
  | `style` | string | No | Preferred style hint. |
252
252
  | `color` | string | No | Main color of interest. |
253
253
  | `productClass` | ProductClass | No | Target product class. |
254
- | `clothType` | string | No | Target cloth type. |
254
+ | `clothType` | ClothType | No | Target cloth type for filtering results. |
255
255
  | `page` | number | No | Current page number. |
256
256
  | `perPage` | number | No | Number of results per page. |
257
257
  | `tenantId` | number | Yes | Tenant (client) ID. |
@@ -268,12 +268,12 @@ Get products that complete a look from an image.
268
268
 
269
269
  <!-- DOCGEN:returns GetComplementaryProductsByImageResponse -->
270
270
  > **`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.
271
+ > * `baseProduct`: `ProductDto` — The product identified in the reference image.
272
+ > * `complementary`: `ProductDto[]` — A list of recommended products that are complementary to the base product.
273
+ > * `page`: `number` — The current page number of the results.
274
+ > * `perPage`: `number` — The number of items per page.
275
+ > * `total`: `number` — The total number of complementary products found.
276
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or has expired.
277
277
  <!-- /DOCGEN -->
278
278
 
279
279
  #### Example
@@ -309,8 +309,8 @@ Fetches or reuses session context.
309
309
 
310
310
  <!-- DOCGEN:returns SessionContext -->
311
311
  > **`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.
312
+ > * `sid`: `string` — The session identifier (sid) used in subsequent API calls for tracking and recommendations.
313
+ > * `sessionId`: `number` — A unique numeric identifier for the session instance, used for internal analytics.
314
314
  <!-- /DOCGEN -->
315
315
 
316
316
  #### Example
@@ -336,20 +336,20 @@ Sends user profile data. Uses cached `sid` if not provided.
336
336
  <!-- DOCGEN:params SessionProfilePayload -->
337
337
  | Field | Type | Required | Description |
338
338
  | ----- | ---- | :------: | ----------- |
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. |
339
+ | `name` | string | Yes | Internal profile identifier or display name for the user.<br>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.<br>Numerical value representing different skin tone categories. |
341
+ | `footShape` | string | Yes | Foot shape classification for footwear recommendations.<br>Used to provide better shoe fit analysis when available. |
342
+ | `gender` | string | Yes | User's gender for size system selection and fit calculations.<br>Uses single character format as defined by Sizebay's standards. |
343
+ | `age` | string | Yes | User's age for age-appropriate sizing and recommendations.<br>Stored as string to accommodate various age formats. |
344
+ | `is3dFeel` | boolean | Yes | Feature flag indicating if advanced 3D fit visualization is enabled.<br>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.<br>Used for comprehensive fit analysis and size calculations. |
346
+ | `height` | string | Yes | User's height in the unit system specified by isMetric.<br>Critical measurement for accurate size recommendations. |
347
347
  | `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. |
348
+ | `product` | string | Yes | Product context or identifier related to the current profiling session.<br>Can link the profile to a specific product being viewed. |
349
+ | `isMetric` | boolean | Yes | Unit system preference for all measurements and recommendations.<br>- true: Metric system (cm, kg)<br>- false: Imperial system (inches, lbs) |
350
+ | `bodyShapeChest` | number | Yes | Chest/bust body shape index for clothing fit analysis.<br>Numerical value representing body proportions in the chest area. |
351
+ | `bodyShapeHip` | number | Yes | Hip body shape index for lower body clothing fit analysis.<br>Numerical value representing body proportions in the hip area. |
352
+ | `bodyShapeWaist` | number | Yes | Waist body shape index for torso fit analysis.<br>Numerical value representing body proportions in the waist area. |
353
353
  <!-- /DOCGEN -->
354
354
 
355
355
  #### Example
@@ -385,24 +385,24 @@ await client.sendProfile(profilePayload);
385
385
  <!-- DOCGEN:params ProductDto -->
386
386
  | Field | Type | Required | Description |
387
387
  | ----- | ---- | :------: | ----------- |
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. |
388
+ | `id` | string | Yes | Unique identifier for the product from the e-commerce platform. |
389
+ | `title` | string | Yes | The display name or title of the product. |
390
+ | `productType` | string | Yes | The product's category, often in a hierarchical format. |
391
+ | `link` | string | Yes | The direct URL to the product's page. |
392
+ | `imageLink` | string | Yes | The URL for the main product image. |
393
+ | `gender` | string | Yes | The target gender for the product. |
394
+ | `availability` | string | Yes | The current stock availability of the product. |
395
+ | `productHash` | string | Yes | A SHA-256 hash for internal identification and caching. |
396
+ | `price` | string | Yes | The product's price, including the currency. |
397
+ | `salePrice` | string | Yes | The product's sale price, if applicable. |
398
+ | `itemGroupId` | string | Yes | An identifier for grouping product variants (e.g., by color or size). |
399
+ | `brand` | string | Yes | The brand of the product. |
400
+ | `color` | string | Yes | The color of the product. |
401
+ | `style` | string | Yes | The style classification of the product. |
402
+ | `gtin` | string | Yes | The Global Trade Item Number (GTIN) for the product. |
403
+ | `additionalImageLinks` | string[] | Yes | A list of additional image URLs for the product. |
404
+ | `suitableSizes` | SuitableSizeDto[] | No | Size recommendations from Sizebay's What Fits Me feature, including comfort scores.<br>This is populated when personalized sizing is available. |
405
+ | `clothType` | ClothType | No | The standardized clothing type, used for recommendations and size chart matching. |
406
406
  <!-- /DOCGEN -->
407
407
 
408
408
  #### `TrackData`
@@ -410,10 +410,10 @@ await client.sendProfile(profilePayload);
410
410
  <!-- DOCGEN:params TrackData -->
411
411
  | Field | Type | Required | Description |
412
412
  | ----- | ---- | :------: | ----------- |
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. |
413
+ | `sid` | string | Yes | The session identifier from Sizebay's session service, representing the user. |
414
+ | `tenantId` | number | Yes | The unique identifier for the tenant (client). |
415
+ | `properties` | Record<string, JSONValue> | Yes | A key-value map for event-specific data. |
416
+ | `permalink` | string | No | The URL of the product page associated with the event, if applicable. |
417
417
  <!-- /DOCGEN -->
418
418
 
419
419
  ### `SuitableSizeDto`
@@ -421,9 +421,9 @@ await client.sendProfile(profilePayload);
421
421
  <!-- DOCGEN:params SuitableSizeDto -->
422
422
  | Field | Type | Required | Description |
423
423
  | ----- | ---- | :------: | ----------- |
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. |
424
+ | `size` | string | Yes | Size label as defined in the product catalog (e.g., "M", "42", "8-10").<br>Uses the same format as the store's size system. |
425
+ | `comfortable` | number | Yes | AI-calculated comfort score ranging from 0 to 1, where a lower value indicates a better fit:<br>- 0.0 = Perfect, comfortable fit<br>- 0.5 = Adequate, but potentially tight/loose fit<br>- 1.0 = Very uncomfortable fit |
426
+ | `value` | boolean | No | Boolean indicator of whether this size is considered suitable for the user.<br>Based on comfort threshold and fit analysis algorithms. |
427
427
  <!-- /DOCGEN -->
428
428
 
429
429
  ### `ComplementaryPairDto`
@@ -431,6 +431,31 @@ await client.sendProfile(profilePayload);
431
431
  <!-- DOCGEN:params ComplementaryPairDto -->
432
432
  | Field | Type | Required | Description |
433
433
  | ----- | ---- | :------: | ----------- |
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 -->
434
+ | `first` | ProductDto | Yes | First recommended product that complements the base product sent in the request.<br>This product is selected based on style compatibility and fashion rules. |
435
+ | `secondary` | ProductDto | No | Second recommended product that complements the base product sent in the request.<br>May be null if no suitable second complementary item is found. |
436
+ <!-- /DOCGEN -->
437
+
438
+ ### `ClothType`
439
+
440
+ Standardized clothing type enum for categorization and filtering:
441
+
442
+ ```typescript
443
+ export const ClothType = {
444
+ TOP: 'TOP',
445
+ BOTTOM: 'BOTTOM',
446
+ SHOE_ACCESSORY: 'SHOE_ACCESSORY',
447
+ FULL_BODY: 'FULL_BODY',
448
+ UNDERWEAR_FULL_BODY: 'UNDERWEAR_FULL_BODY',
449
+ UNDERWEAR_BOTTOM: 'UNDERWEAR_BOTTOM',
450
+ UNDERWEAR_TOP: 'UNDERWEAR_TOP',
451
+ WETSUIT_FULL_BODY: 'WETSUIT_FULL_BODY',
452
+ WETSUIT_BOTTOM: 'WETSUIT_BOTTOM',
453
+ WETSUIT_TOP: 'WETSUIT_TOP',
454
+ } as const;
455
+
456
+ // Usage examples:
457
+ ClothType.TOP // For shirts, blouses, jackets
458
+ ClothType.BOTTOM // For pants, skirts, shorts
459
+ ClothType.FULL_BODY // For dresses, jumpsuits
460
+ ClothType.SHOE_ACCESSORY // For shoes, accessories
461
+ ```
@@ -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.4",
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",