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 |
|
|
97
|
-
| `page` | number | No |
|
|
98
|
-
| `perPage` | number | No |
|
|
99
|
-
| `similarityThreshold` | number | No |
|
|
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[]` —
|
|
115
|
-
|
|
116
|
-
> * `
|
|
117
|
-
> * `
|
|
118
|
-
> * `
|
|
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
|
-
|
|
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
|
|
165
|
-
|
|
166
|
-
> * `
|
|
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` |
|
|
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 |
|
|
246
|
-
| `baseClothType` |
|
|
247
|
-
| `targetClothType` |
|
|
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` |
|
|
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` —
|
|
272
|
-
> * `complementary`: `ProductDto[]` —
|
|
273
|
-
> * `page`: `number` —
|
|
274
|
-
> * `perPage`: `number` —
|
|
275
|
-
> * `total`: `number` —
|
|
276
|
-
> * `invalidPersonaHash`: `boolean` —
|
|
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` —
|
|
313
|
-
> * `sessionId`: `number` —
|
|
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.
|
|
340
|
-
|
|
341
|
-
| `
|
|
342
|
-
|
|
343
|
-
| `
|
|
344
|
-
|
|
345
|
-
| `
|
|
346
|
-
|
|
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.
|
|
349
|
-
|
|
350
|
-
| `
|
|
351
|
-
|
|
352
|
-
|
|
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
|
|
389
|
-
| `title` | string | Yes |
|
|
390
|
-
| `productType` | string | Yes |
|
|
391
|
-
| `link` | string | Yes |
|
|
392
|
-
| `imageLink` | string | Yes | URL
|
|
393
|
-
| `gender` | string | Yes |
|
|
394
|
-
| `availability` | string | Yes |
|
|
395
|
-
| `productHash` | string | Yes | SHA-256 hash
|
|
396
|
-
| `price` | string | Yes |
|
|
397
|
-
| `salePrice` | string | Yes |
|
|
398
|
-
| `itemGroupId` | string | Yes |
|
|
399
|
-
| `brand` | string | Yes |
|
|
400
|
-
| `color` | string | Yes |
|
|
401
|
-
| `style` | string | Yes |
|
|
402
|
-
| `gtin` | string | Yes | Global Trade Item Number
|
|
403
|
-
| `additionalImageLinks` | string[] | Yes |
|
|
404
|
-
| `suitableSizes` | SuitableSizeDto[] | No | Size recommendations
|
|
405
|
-
|
|
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 |
|
|
414
|
-
| `tenantId` | number | Yes |
|
|
415
|
-
| `properties` | Record<string, JSONValue> | Yes |
|
|
416
|
-
| `permalink` | string | No | URL of the product page associated with
|
|
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").
|
|
425
|
-
|
|
426
|
-
| `
|
|
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 |
|
|
435
|
-
|
|
436
|
-
|
|
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?:
|
|
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:
|
|
5
|
-
targetClothType:
|
|
5
|
+
baseClothType: ClothType;
|
|
6
|
+
targetClothType: ClothType;
|
|
6
7
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare const ClothType: {
|
|
2
|
-
TOP:
|
|
3
|
-
BOTTOM:
|
|
4
|
-
SHOE_ACCESSORY:
|
|
5
|
-
FULL_BODY:
|
|
6
|
-
UNDERWEAR_FULL_BODY:
|
|
7
|
-
UNDERWEAR_BOTTOM:
|
|
8
|
-
UNDERWEAR_TOP:
|
|
9
|
-
WETSUIT_FULL_BODY:
|
|
10
|
-
WETSUIT_BOTTOM:
|
|
11
|
-
WETSUIT_TOP:
|
|
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.
|
|
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",
|