sizebay-core-sdk 1.11.0 → 1.12.0-dev.1

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.dev.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Sizebay Core SDK - Development Guide
2
2
 
3
3
  This guide is intended to help developers understand the project structure, how to create and integrate new modules, run tests, and configure automated releases with Semantic Release.
4
-
4
+ -- teste bot publish
5
5
  ---
6
6
 
7
7
  ## Project Structure
8
8
 
9
- The project is organized as follows:
9
+ The project is organized as follows:
10
10
 
11
11
  ```
12
12
  📦src
package/README.md CHANGED
@@ -296,6 +296,133 @@ console.log(imgComp.baseProduct, imgComp.complementary);
296
296
 
297
297
  ---
298
298
 
299
+ ## Permalink Search Services
300
+
301
+ ### `searchSimilarByPermalink(payload: GetSimilarByPermalinkBodyDto): Promise<GetSimilarProductsResponse>`
302
+
303
+ Find visually similar items from a product permalink or productId using AI-powered image analysis.
304
+
305
+ #### Payload
306
+
307
+ <!-- DOCGEN:params GetSimilarByPermalinkBodyDto -->
308
+ | Field | Type | Required | Description |
309
+ | ----- | ---- | :------: | ----------- |
310
+ | `permalink` | string | No | The URL permalink of the reference product for the similarity search. |
311
+ | `productId` | string | No | Product ID (either permalink or productId must be provided). |
312
+ | `ageRange` | string | No | Target age range. |
313
+ | `gender` | string | No | User gender (optional). |
314
+ | `style` | string | No | Preferred style hint. |
315
+ | `color` | string | No | Main color of interest. |
316
+ | `productClass` | ProductClass | No | Target product class. |
317
+ | `clothType` | ClothType | No | Target cloth type for filtering results. |
318
+ | `page` | number | No | Current page number. |
319
+ | `perPage` | number | No | Number of results per page. |
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). |
329
+ <!-- /DOCGEN -->
330
+
331
+ #### Returns
332
+
333
+ <!-- DOCGEN:returns GetSimilarProductsResponse -->
334
+ > **`GetSimilarProductsResponse`**
335
+ > * `data`: `ProductDto[]` — An array of products that are visually similar to the reference item.<br>The results are ordered by their similarity score.
336
+ > * `page`: `number` — The current page number of the results.
337
+ > * `perPage`: `number` — The number of items per page.
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.
340
+ <!-- /DOCGEN -->
341
+
342
+ #### Example
343
+
344
+ ```typescript
345
+ const similarProducts = await client.searchSimilarByPermalink({
346
+ tenantId: 123,
347
+ collectionName: "products",
348
+ sid: "session123",
349
+ sizeSystem: "BR",
350
+ locale: "pt-BR",
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"
358
+ });
359
+ console.log(similarProducts.data);
360
+ ```
361
+
362
+ ### `searchComplementaryByPermalink(payload: GetComplementaryByPermalinkBodyDto): Promise<GetComplementaryProductsResponse>`
363
+
364
+ Find complementary products from a product permalink or productId using AI-powered analysis.
365
+
366
+ #### Payload
367
+
368
+ <!-- DOCGEN:params GetComplementaryByPermalinkBodyDto -->
369
+ | Field | Type | Required | Description |
370
+ | ----- | ---- | :------: | ----------- |
371
+ | `permalink` | string | No | The URL permalink of the reference product. |
372
+ | `productId` | string | No | Product ID (either permalink or productId must be provided). |
373
+ | `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. |
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 -->
392
+
393
+ #### Returns
394
+
395
+ <!-- DOCGEN:returns GetComplementaryProductsResponse -->
396
+ > **`GetComplementaryProductsResponse`**
397
+ > * `baseProduct`: `ProductDto` — The reference product used to generate recommendations.<br>This is the item that corresponds to the permalink from the request.
398
+ > * `complementary`: `ComplementaryPairDto[]` — A list of recommended pairs of products that are complementary to the base product.
399
+ > * `invalidPersonaHash`: `boolean` — Indicates if the provided persona hash is invalid or has expired.<br>If true, personalization may be affected.
400
+ <!-- /DOCGEN -->
401
+
402
+ #### Example
403
+
404
+ ```typescript
405
+ const complementaryProducts = await client.searchComplementaryByPermalink({
406
+ tenantId: 123,
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);
422
+ ```
423
+
424
+ ---
425
+
299
426
  ## Session Module
300
427
 
301
428
  Retrieves and caches session context:
@@ -461,4 +588,4 @@ ClothType.TOP // For shirts, blouses, jackets
461
588
  ClothType.BOTTOM // For pants, skirts, shorts
462
589
  ClothType.FULL_BODY // For dresses, jumpsuits
463
590
  ClothType.SHOE_ACCESSORY // For shoes, accessories
464
- ```
591
+ ```
@@ -2,9 +2,11 @@ import { SDKConfigOptions } from '../types';
2
2
  export declare class Config {
3
3
  private endpoints;
4
4
  private serviceOverrides;
5
+ private fashionLooksToken?;
5
6
  constructor(options: SDKConfigOptions);
6
7
  getEndpoint(serviceName: string): string;
7
8
  getServiceConfig(serviceName: string): {
8
9
  [key: string]: any;
9
10
  };
11
+ getFashionLooksToken(): string | undefined;
10
12
  }
@@ -0,0 +1,5 @@
1
+ export interface AuthHeaders {
2
+ Authorization?: string;
3
+ 'x-credit-api-key'?: string;
4
+ }
5
+ export declare function buildAuthHeaders(token?: string, apiKey?: string): AuthHeaders;
@@ -1,5 +1,5 @@
1
1
  import { Config } from '../config';
2
- import { GetSimilarProductsParams, GetComplementaryProductsParams, GetSimilarByImageBodyDto, GetComplementaryByImageBodyDto, GetSimilarProductsResponse, GetComplementaryProductsResponse, GetComplementaryProductsByImageResponse } from '../types/ai-image';
2
+ import { GetSimilarProductsParams, GetComplementaryProductsParams, GetSimilarByImageBodyDto, GetComplementaryByImageBodyDto, GetSimilarByPermalinkBodyDto, GetComplementaryByPermalinkBodyDto, GetSimilarProductsResponse, GetComplementaryProductsResponse, GetComplementaryProductsByImageResponse } from '../types/ai-image';
3
3
  export declare class AIImageService {
4
4
  private endpoint;
5
5
  constructor(config: Config);
@@ -8,4 +8,6 @@ export declare class AIImageService {
8
8
  getComplementaryProducts(params: GetComplementaryProductsParams): Promise<GetComplementaryProductsResponse>;
9
9
  searchSimilarByImage(payload: GetSimilarByImageBodyDto): Promise<GetSimilarProductsResponse>;
10
10
  searchComplementaryByImage(payload: GetComplementaryByImageBodyDto): Promise<GetComplementaryProductsByImageResponse>;
11
+ searchSimilarByPermalink(payload: GetSimilarByPermalinkBodyDto): Promise<GetSimilarProductsResponse>;
12
+ searchComplementaryByPermalink(payload: GetComplementaryByPermalinkBodyDto): Promise<GetComplementaryProductsResponse>;
11
13
  }
@@ -0,0 +1,9 @@
1
+ import { Config } from '../../config';
2
+ import { GenerateTokenDto, TokenResponseDto, ValidateTokenResponseDto } from '../../types/fashion-looks';
3
+ export declare class FashionLooksAuth {
4
+ private endpoint;
5
+ private config;
6
+ constructor(config: Config);
7
+ generateToken(payload: GenerateTokenDto): Promise<TokenResponseDto>;
8
+ validateToken(token?: string): Promise<ValidateTokenResponseDto>;
9
+ }
@@ -0,0 +1,8 @@
1
+ import { Config } from '../../config';
2
+ import { CreateGroupedLookFeedbackDto, GroupedLookFeedbackResponseDto } from '../../types/fashion-looks';
3
+ export declare class FashionLooksGroupedLooksFeedback {
4
+ private endpoint;
5
+ private config;
6
+ constructor(config: Config);
7
+ createFeedback(payload: CreateGroupedLookFeedbackDto): Promise<GroupedLookFeedbackResponseDto>;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { Config } from '../../config';
2
+ import { GroupedLookResponseDto, UpdateGroupedLookDto, GetGroupedLooksParams, GetGroupedLooksResponse } from '../../types/fashion-looks';
3
+ export declare class FashionLooksGroupedLooks {
4
+ private endpoint;
5
+ private config;
6
+ constructor(config: Config);
7
+ private appendQueryParams;
8
+ getGroupedLooks(params?: GetGroupedLooksParams): Promise<GetGroupedLooksResponse>;
9
+ getGroupedLookById(id: string): Promise<GroupedLookResponseDto>;
10
+ updateGroupedLook(id: string, payload: UpdateGroupedLookDto): Promise<GroupedLookResponseDto>;
11
+ getPublicGroupedLooks(params: GetGroupedLooksParams & {
12
+ tenantId: number;
13
+ }): Promise<GetGroupedLooksResponse>;
14
+ getPublicGroupedLookById(id: string, tenantId: number): Promise<GroupedLookResponseDto>;
15
+ }
@@ -0,0 +1,6 @@
1
+ export { FashionLooksAuth } from './auth';
2
+ export { FashionLooksWallet } from './wallet';
3
+ export { FashionLooksPlans } from './plans';
4
+ export { FashionLooksTryon } from './tryon';
5
+ export { FashionLooksGroupedLooks } from './grouped-looks';
6
+ export { FashionLooksGroupedLooksFeedback } from './grouped-looks-feedback';
@@ -0,0 +1,10 @@
1
+ import { Config } from '../../config';
2
+ import { Plan } from '../../types/fashion-looks';
3
+ export declare class FashionLooksPlans {
4
+ private endpoint;
5
+ private config;
6
+ constructor(config: Config);
7
+ getAllPlans(): Promise<Plan[]>;
8
+ getPlanById(planId: string): Promise<Plan>;
9
+ getTenantActivePlan(tenantId: number): Promise<Plan>;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { Config } from '../../config';
2
+ import { GenerateTryonDto, TryonTaskResponseDto, TryonDetails, FindProductByTenantDto, ProductItemResponseDto } from '../../types/fashion-looks';
3
+ export declare class FashionLooksTryon {
4
+ private endpoint;
5
+ private config;
6
+ constructor(config: Config);
7
+ generateTryon(payload: GenerateTryonDto): Promise<TryonTaskResponseDto>;
8
+ getTryonById(id: string): Promise<TryonDetails>;
9
+ getTryonHistory(params?: {
10
+ limit?: number;
11
+ offset?: number;
12
+ }): Promise<TryonDetails[]>;
13
+ findProductsByTenant(payload: FindProductByTenantDto): Promise<ProductItemResponseDto>;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { Config } from '../../config';
2
+ import { WalletBalanceDto, TransactionHistoryResponse } from '../../types/fashion-looks';
3
+ export declare class FashionLooksWallet {
4
+ private endpoint;
5
+ private config;
6
+ constructor(config: Config);
7
+ getBalance(): Promise<WalletBalanceDto>;
8
+ getTransactionHistory(params?: {
9
+ limit?: number;
10
+ offset?: number;
11
+ }): Promise<TransactionHistoryResponse>;
12
+ }
@@ -1,4 +1,10 @@
1
1
  import { Tracker } from './tracker';
2
2
  import { AIImageService } from './ai-image-service';
3
3
  import { SessionManager } from './sessions';
4
- export declare const moduleClasses: (typeof Tracker | typeof AIImageService | typeof SessionManager)[];
4
+ import { FashionLooksAuth } from './fashion-looks/auth';
5
+ import { FashionLooksWallet } from './fashion-looks/wallet';
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)[];