sizebay-core-sdk 1.12.0-dev.1 → 1.12.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 +110 -94
- package/dist/config/index.d.ts +0 -2
- package/dist/modules/fashion-looks.d.ts +9 -0
- package/dist/modules/index.d.ts +2 -7
- package/dist/sizebay-core-sdk.es.js +124 -545
- package/dist/sizebay-core-sdk.umd.js +1 -1
- package/dist/types/common/sdk.types.d.ts +0 -1
- package/dist/types/fashion-looks/index.d.ts +3 -6
- package/dist/types/fashion-looks/params/get-grouped-looks.dto.d.ts +18 -0
- package/dist/types/fashion-looks/responses/grouped-look-feedback-response.dto.d.ts +8 -0
- package/dist/types/fashion-looks/responses/grouped-look-response.dto.d.ts +23 -0
- package/dist/types/fashion-looks/responses/grouped-looks-list-response.dto.d.ts +12 -0
- package/package.json +1 -1
- package/dist/helpers/auth-helper.d.ts +0 -5
- package/dist/modules/fashion-looks/auth.d.ts +0 -9
- package/dist/modules/fashion-looks/grouped-looks-feedback.d.ts +0 -8
- package/dist/modules/fashion-looks/grouped-looks.d.ts +0 -15
- package/dist/modules/fashion-looks/index.d.ts +0 -6
- package/dist/modules/fashion-looks/plans.d.ts +0 -10
- package/dist/modules/fashion-looks/tryon.d.ts +0 -14
- package/dist/modules/fashion-looks/wallet.d.ts +0 -12
- package/dist/types/fashion-looks/auth.d.ts +0 -13
- package/dist/types/fashion-looks/common.d.ts +0 -9
- package/dist/types/fashion-looks/grouped-looks.d.ts +0 -58
- package/dist/types/fashion-looks/plans.d.ts +0 -24
- package/dist/types/fashion-looks/tryon.d.ts +0 -44
- package/dist/types/fashion-looks/wallet.d.ts +0 -9
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ A modular SDK for integrating Sizebay services into your application. Features e
|
|
|
4
4
|
|
|
5
5
|
- Event tracking
|
|
6
6
|
- AI image recommendations (similar / complementary / sizing)
|
|
7
|
+
- Fashion looks (grouped looks with try-ons)
|
|
7
8
|
- Session & profile management
|
|
8
9
|
- Environment-aware endpoints (`-dev` / `-prod`)
|
|
9
10
|
- Full TypeScript typings
|
|
@@ -16,6 +17,7 @@ A modular SDK for integrating Sizebay services into your application. Features e
|
|
|
16
17
|
2. [Quick Start](#quick-start)
|
|
17
18
|
3. [Tracker Module](#tracker-module)
|
|
18
19
|
4. [AI Image Service Module](#ai-image-service-module)
|
|
20
|
+
5. [Fashion Looks Module](#fashion-looks-module)
|
|
19
21
|
6. [Session Module](#session-module)
|
|
20
22
|
7. [DTO Reference](#dto-reference)
|
|
21
23
|
|
|
@@ -296,129 +298,86 @@ console.log(imgComp.baseProduct, imgComp.complementary);
|
|
|
296
298
|
|
|
297
299
|
---
|
|
298
300
|
|
|
299
|
-
##
|
|
301
|
+
## Fashion Looks Module
|
|
300
302
|
|
|
301
|
-
### `
|
|
303
|
+
### `getGroupedLooks(params: GetGroupedLooksParams): Promise<GroupedLooksListResponse>`
|
|
302
304
|
|
|
303
|
-
|
|
305
|
+
Get grouped looks with optional filters and pagination (Public endpoint).
|
|
304
306
|
|
|
305
|
-
####
|
|
307
|
+
#### Parameters
|
|
306
308
|
|
|
307
|
-
<!-- DOCGEN:params
|
|
309
|
+
<!-- DOCGEN:params GetGroupedLooksParams -->
|
|
308
310
|
| Field | Type | Required | Description |
|
|
309
311
|
| ----- | ---- | :------: | ----------- |
|
|
310
|
-
| `
|
|
311
|
-
| `
|
|
312
|
-
| `
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
| `
|
|
317
|
-
| `
|
|
318
|
-
| `
|
|
319
|
-
| `
|
|
320
|
-
| `similarityThreshold` | number | No | Similarity threshold for matching (0-1). |
|
|
321
|
-
| `tenantId` | number | Yes | Tenant (client) ID. |
|
|
322
|
-
| `collectionName` | string | Yes | Embeddings collection name (namespace). |
|
|
323
|
-
| `sid` | string | Yes | Session identifier (`sid`) for the user. |
|
|
324
|
-
| `sizeSystem` | string | Yes | Size system code (e.g., 'BR', 'EU', 'US'). |
|
|
325
|
-
| `locale` | string | Yes | Locale for internationalized responses (language and region). |
|
|
326
|
-
| `currency` | string | Yes | Currency code for pricing information in responses. |
|
|
327
|
-
| `filterByWhatFitsMe` | boolean | No | Whether to apply What Fits Me logic. |
|
|
328
|
-
| `personaHash` | string | No | Hash representing the user persona (required if WFM is enabled). |
|
|
312
|
+
| `tenantId` | number | Yes | Tenant ID (required). |
|
|
313
|
+
| `limit` | number | No | Maximum number of looks to return per page (1-100).<br>Use smaller values for faster responses, larger for comprehensive results. |
|
|
314
|
+
| `offset` | number | No | Number of looks to skip before returning results.<br>Use with limit to implement pagination: page 2 = offset 50 (if limit is 50). |
|
|
315
|
+
| `order` | SortOrder | No | Sort order by creation date.<br>Use 'desc' to show newest looks first, 'asc' for oldest first. |
|
|
316
|
+
| `permalink` | string | No | Filter by product permalink.<br>Find all looks that include this specific product. Useful for showing<br>styling suggestions when a user views a product page. |
|
|
317
|
+
| `gender` | Gender | No | Filter by target gender.<br>Show only looks designed for MALE or FEMALE audiences. |
|
|
318
|
+
| `ageGroup` | AgeGroup | No | Filter by target age group.<br>Show only looks appropriate for the specified age range. |
|
|
319
|
+
| `style` | Style | No | Filter by style category.<br>Show only looks matching the desired style (casual, formal, party, etc.). |
|
|
320
|
+
| `collection` | Collection | No | Filter by seasonal collection.<br>Show only looks from a specific season (spring, summer, fall, winter). |
|
|
321
|
+
| `status` | GroupedLookStatus | No | Filter by active status.<br>Use 'enabled' to show only active looks, 'disabled' for inactive ones. |
|
|
329
322
|
<!-- /DOCGEN -->
|
|
330
323
|
|
|
331
324
|
#### Returns
|
|
332
325
|
|
|
333
|
-
<!-- DOCGEN:returns
|
|
334
|
-
> **`
|
|
335
|
-
> * `data`: `
|
|
336
|
-
> * `
|
|
337
|
-
> * `
|
|
338
|
-
> * `total`: `number` — The total number of similar products found.
|
|
339
|
-
> * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or expired,<br>which may affect personalized results.
|
|
326
|
+
<!-- DOCGEN:returns GroupedLooksListResponse -->
|
|
327
|
+
> **`GroupedLooksListResponse`**
|
|
328
|
+
> * `data`: `GroupedLookResponseDto[]` — Fashion looks for the current page.<br>Display these looks to users. Each look contains styled outfits with try-on images.
|
|
329
|
+
> * `total`: `number` — Total number of looks matching your filters across all pages.<br>Use this to show "Showing X of Y looks" or calculate total pages.
|
|
330
|
+
> * `pagination`: `PaginationInfo` — Pagination information for navigating between pages.<br>Use this to implement pagination controls in your UI.
|
|
340
331
|
<!-- /DOCGEN -->
|
|
341
332
|
|
|
342
333
|
#### Example
|
|
343
334
|
|
|
344
335
|
```typescript
|
|
345
|
-
const
|
|
346
|
-
tenantId:
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
currency: "BRL",
|
|
352
|
-
permalink: "https://example.com/products/red-dress-456",
|
|
353
|
-
similarityThreshold: 0.7,
|
|
354
|
-
page: 1,
|
|
355
|
-
perPage: 10,
|
|
356
|
-
style: "Casual",
|
|
357
|
-
color: "red"
|
|
336
|
+
const looks = await client.getGroupedLooks({
|
|
337
|
+
tenantId: 1,
|
|
338
|
+
limit: 50,
|
|
339
|
+
gender: 'FEMALE',
|
|
340
|
+
style: 'casual',
|
|
341
|
+
collection: 'summer',
|
|
358
342
|
});
|
|
359
|
-
console.log(
|
|
343
|
+
console.log(looks.data, looks.total);
|
|
360
344
|
```
|
|
361
345
|
|
|
362
|
-
|
|
346
|
+
---
|
|
363
347
|
|
|
364
|
-
|
|
348
|
+
### `getGroupedLookById(id: string, tenantId: number): Promise<GroupedLookResponseDto>`
|
|
365
349
|
|
|
366
|
-
|
|
350
|
+
Get a specific grouped look by ID (Public endpoint).
|
|
367
351
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
|
371
|
-
|
|
|
372
|
-
| `
|
|
373
|
-
| `
|
|
374
|
-
| `baseClothType` | ClothType | No | Base cloth type for the reference product. |
|
|
375
|
-
| `targetClothType` | ClothType | No | Target cloth type for complementary products. |
|
|
376
|
-
| `ageRange` | string | No | Target age range. |
|
|
377
|
-
| `gender` | string | No | User gender (optional). |
|
|
378
|
-
| `style` | string | No | Preferred style hint. |
|
|
379
|
-
| `color` | string | No | Main color of interest. |
|
|
380
|
-
| `productClass` | ProductClass | No | Target product class. |
|
|
381
|
-
| `page` | number | No | Current page number. |
|
|
382
|
-
| `perPage` | number | No | Number of results per page. |
|
|
383
|
-
| `tenantId` | number | Yes | Tenant (client) ID. |
|
|
384
|
-
| `collectionName` | string | Yes | Embeddings collection name (namespace). |
|
|
385
|
-
| `sid` | string | Yes | Session identifier (`sid`) for the user. |
|
|
386
|
-
| `sizeSystem` | string | Yes | Size system code (e.g., 'BR', 'EU', 'US'). |
|
|
387
|
-
| `locale` | string | Yes | Locale for internationalized responses (language and region). |
|
|
388
|
-
| `currency` | string | Yes | Currency code for pricing information in responses. |
|
|
389
|
-
| `filterByWhatFitsMe` | boolean | No | Whether to apply What Fits Me logic. |
|
|
390
|
-
| `personaHash` | string | No | Hash representing the user persona (required if WFM is enabled). |
|
|
391
|
-
<!-- /DOCGEN -->
|
|
352
|
+
#### Parameters
|
|
353
|
+
|
|
354
|
+
| Parameter | Type | Required | Description |
|
|
355
|
+
| ----------- | ------ | :------: | -------------------------- |
|
|
356
|
+
| `id` | string | Yes | Grouped look UUID |
|
|
357
|
+
| `tenantId` | number | Yes | Tenant ID |
|
|
392
358
|
|
|
393
359
|
#### Returns
|
|
394
360
|
|
|
395
|
-
<!-- DOCGEN:returns
|
|
396
|
-
> **`
|
|
397
|
-
> * `
|
|
398
|
-
> * `
|
|
399
|
-
> * `
|
|
361
|
+
<!-- DOCGEN:returns GroupedLookResponseDto -->
|
|
362
|
+
> **`GroupedLookResponseDto`**
|
|
363
|
+
> * `id`: `string` — Unique identifier for this fashion look (UUID).<br>Use this to fetch the look again or reference it in other operations.
|
|
364
|
+
> * `tenantId`: `number` — Tenant ID that owns this look.
|
|
365
|
+
> * `gender`: `Gender` — Target gender for this look (MALE or FEMALE).<br>Use to filter or categorize looks by target audience.
|
|
366
|
+
> * `ageGroup`: `AgeGroup` — Target age group for this look.<br>Use to show age-appropriate looks to users.
|
|
367
|
+
> * `style`: `Style` — Style category of this look.<br>Use to filter looks by style preference or display style tags.
|
|
368
|
+
> * `collection`: `Collection` — Seasonal collection this look belongs to.<br>Use to show seasonal looks or filter by collection.
|
|
369
|
+
> * `rate`: `number` — Quality rating of this look (0-5).<br>Higher ratings indicate better quality. Use to sort or filter by quality.
|
|
370
|
+
> * `status`: `GroupedLookStatus` — Current status of this look.<br>Only show 'enabled' looks to users, hide 'disabled' ones.
|
|
371
|
+
> * `timestamp`: `string` — When this look was created (ISO 8601 format).<br>Use to sort by date or show "new" looks.
|
|
372
|
+
> * `tryons`: `TryonGroup[]` — All virtual try-on images organized by body type and skin tone.<br>Iterate through this to display all try-on variations. Each group represents<br>a body type, and each group contains try-ons for different skin tones.
|
|
373
|
+
> * `feedback`: `GroupedLookFeedbackResponseDto` — User feedback for this look, if any has been submitted.<br>Use to display feedback or quality metrics to users.
|
|
400
374
|
<!-- /DOCGEN -->
|
|
401
375
|
|
|
402
376
|
#### Example
|
|
403
377
|
|
|
404
378
|
```typescript
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
collectionName: "products",
|
|
408
|
-
sid: "session123",
|
|
409
|
-
sizeSystem: "BR",
|
|
410
|
-
locale: "pt-BR",
|
|
411
|
-
currency: "BRL",
|
|
412
|
-
productId: "12345",
|
|
413
|
-
similarityThreshold: 0.3,
|
|
414
|
-
baseClothType: ClothType.BOTTOM,
|
|
415
|
-
targetClothType: ClothType.TOP,
|
|
416
|
-
page: 1,
|
|
417
|
-
perPage: 10,
|
|
418
|
-
style: "Casual",
|
|
419
|
-
color: "blue"
|
|
420
|
-
});
|
|
421
|
-
console.log(complementaryProducts.baseProduct, complementaryProducts.complementary);
|
|
379
|
+
const look = await client.getGroupedLookById('uuid-here', 1);
|
|
380
|
+
console.log(look.id, look.style, look.tryons);
|
|
422
381
|
```
|
|
423
382
|
|
|
424
383
|
---
|
|
@@ -589,3 +548,60 @@ ClothType.BOTTOM // For pants, skirts, shorts
|
|
|
589
548
|
ClothType.FULL_BODY // For dresses, jumpsuits
|
|
590
549
|
ClothType.SHOE_ACCESSORY // For shoes, accessories
|
|
591
550
|
```
|
|
551
|
+
|
|
552
|
+
### `GroupedLookResponseDto`
|
|
553
|
+
|
|
554
|
+
<!-- DOCGEN:params GroupedLookResponseDto -->
|
|
555
|
+
| Field | Type | Required | Description |
|
|
556
|
+
| ----- | ---- | :------: | ----------- |
|
|
557
|
+
| `id` | string | Yes | Unique identifier for this fashion look (UUID).<br>Use this to fetch the look again or reference it in other operations. |
|
|
558
|
+
| `tenantId` | number | Yes | Tenant ID that owns this look. |
|
|
559
|
+
| `gender` | Gender | Yes | Target gender for this look (MALE or FEMALE).<br>Use to filter or categorize looks by target audience. |
|
|
560
|
+
| `ageGroup` | AgeGroup | Yes | Target age group for this look.<br>Use to show age-appropriate looks to users. |
|
|
561
|
+
| `style` | Style | Yes | Style category of this look.<br>Use to filter looks by style preference or display style tags. |
|
|
562
|
+
| `collection` | Collection | Yes | Seasonal collection this look belongs to.<br>Use to show seasonal looks or filter by collection. |
|
|
563
|
+
| `rate` | number | Yes | Quality rating of this look (0-5).<br>Higher ratings indicate better quality. Use to sort or filter by quality. |
|
|
564
|
+
| `status` | GroupedLookStatus | Yes | Current status of this look.<br>Only show 'enabled' looks to users, hide 'disabled' ones. |
|
|
565
|
+
| `timestamp` | string | Yes | When this look was created (ISO 8601 format).<br>Use to sort by date or show "new" looks. |
|
|
566
|
+
| `tryons` | TryonGroup[] | Yes | All virtual try-on images organized by body type and skin tone.<br>Iterate through this to display all try-on variations. Each group represents<br>a body type, and each group contains try-ons for different skin tones. |
|
|
567
|
+
| `feedback` | GroupedLookFeedbackResponseDto | No | User feedback for this look, if any has been submitted.<br>Use to display feedback or quality metrics to users. |
|
|
568
|
+
<!-- /DOCGEN -->
|
|
569
|
+
|
|
570
|
+
### `GroupedLooksListResponse`
|
|
571
|
+
|
|
572
|
+
<!-- DOCGEN:params GroupedLooksListResponse -->
|
|
573
|
+
| Field | Type | Required | Description |
|
|
574
|
+
| ----- | ---- | :------: | ----------- |
|
|
575
|
+
| `data` | GroupedLookResponseDto[] | Yes | Fashion looks for the current page.<br>Display these looks to users. Each look contains styled outfits with try-on images. |
|
|
576
|
+
| `total` | number | Yes | Total number of looks matching your filters across all pages.<br>Use this to show "Showing X of Y looks" or calculate total pages. |
|
|
577
|
+
| `pagination` | PaginationInfo | Yes | Pagination information for navigating between pages.<br>Use this to implement pagination controls in your UI. |
|
|
578
|
+
<!-- /DOCGEN -->
|
|
579
|
+
|
|
580
|
+
### `PaginationInfo`
|
|
581
|
+
|
|
582
|
+
<!-- DOCGEN:params PaginationInfo -->
|
|
583
|
+
| Field | Type | Required | Description |
|
|
584
|
+
| ----- | ---- | :------: | ----------- |
|
|
585
|
+
| `limit` | number | Yes | Number of looks returned in this page.<br>Matches the limit parameter you sent in the request. |
|
|
586
|
+
| `offset` | number | Yes | Number of looks skipped to reach this page.<br>Matches the offset parameter you sent in the request. |
|
|
587
|
+
| `hasNext` | boolean | Yes | Whether there are more looks available after this page.<br>Use this to show/hide "Next" button or load more functionality. |
|
|
588
|
+
| `hasPrevious` | boolean | Yes | Whether there are looks before this page.<br>Use this to show/hide "Previous" button. |
|
|
589
|
+
<!-- /DOCGEN -->
|
|
590
|
+
|
|
591
|
+
### `TryonGroup`
|
|
592
|
+
|
|
593
|
+
<!-- DOCGEN:params TryonGroup -->
|
|
594
|
+
| Field | Type | Required | Description |
|
|
595
|
+
| ----- | ---- | :------: | ----------- |
|
|
596
|
+
| `bmi` | string | Yes | Body type identifier (e.g., 'slim', 'regular', 'plus'). |
|
|
597
|
+
| `skinTones` | TryonDetails[] | Yes | Try-on images for different skin tones within this body type.<br>Iterate through these to show all skin tone variations for the same body type. |
|
|
598
|
+
<!-- /DOCGEN -->
|
|
599
|
+
|
|
600
|
+
### `TryonDetails`
|
|
601
|
+
|
|
602
|
+
<!-- DOCGEN:params TryonDetails -->
|
|
603
|
+
| Field | Type | Required | Description |
|
|
604
|
+
| ----- | ---- | :------: | ----------- |
|
|
605
|
+
| `skinTone` | string | Yes | Skin tone identifier (e.g., 'light', 'brown', 'dark'). |
|
|
606
|
+
| `tryonDetails` | Record<string, any> | Yes | Try-on image data including URL and rendering metadata.<br>Contains the actual image URL and other properties needed to display the try-on. |
|
|
607
|
+
<!-- /DOCGEN -->
|
package/dist/config/index.d.ts
CHANGED
|
@@ -2,11 +2,9 @@ import { SDKConfigOptions } from '../types';
|
|
|
2
2
|
export declare class Config {
|
|
3
3
|
private endpoints;
|
|
4
4
|
private serviceOverrides;
|
|
5
|
-
private fashionLooksToken?;
|
|
6
5
|
constructor(options: SDKConfigOptions);
|
|
7
6
|
getEndpoint(serviceName: string): string;
|
|
8
7
|
getServiceConfig(serviceName: string): {
|
|
9
8
|
[key: string]: any;
|
|
10
9
|
};
|
|
11
|
-
getFashionLooksToken(): string | undefined;
|
|
12
10
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Config } from '../config';
|
|
2
|
+
import { GetGroupedLooksParams, GroupedLooksListResponse, GroupedLookResponseDto } from '../types/fashion-looks';
|
|
3
|
+
export declare class FashionLooks {
|
|
4
|
+
private endpoint;
|
|
5
|
+
constructor(config: Config);
|
|
6
|
+
private appendQueryParams;
|
|
7
|
+
getGroupedLooks(params: GetGroupedLooksParams): Promise<GroupedLooksListResponse>;
|
|
8
|
+
getGroupedLookById(id: string, tenantId: number): Promise<GroupedLookResponseDto>;
|
|
9
|
+
}
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Tracker } from './tracker';
|
|
2
2
|
import { AIImageService } from './ai-image-service';
|
|
3
3
|
import { SessionManager } from './sessions';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { FashionLooksPlans } from './fashion-looks/plans';
|
|
7
|
-
import { FashionLooksTryon } from './fashion-looks/tryon';
|
|
8
|
-
import { FashionLooksGroupedLooks } from './fashion-looks/grouped-looks';
|
|
9
|
-
import { FashionLooksGroupedLooksFeedback } from './fashion-looks/grouped-looks-feedback';
|
|
10
|
-
export declare const moduleClasses: (typeof Tracker | typeof AIImageService | typeof SessionManager | typeof FashionLooksAuth | typeof FashionLooksWallet | typeof FashionLooksPlans | typeof FashionLooksTryon | typeof FashionLooksGroupedLooks | typeof FashionLooksGroupedLooksFeedback)[];
|
|
4
|
+
import { FashionLooks } from './fashion-looks';
|
|
5
|
+
export declare const moduleClasses: (typeof Tracker | typeof AIImageService | typeof SessionManager | typeof FashionLooks)[];
|