@primestyleai/tryon 5.8.58 → 5.9.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.
@@ -4,7 +4,7 @@ export declare class ApiClient {
4
4
  private baseUrl;
5
5
  constructor(apiKey: string, apiUrl?: string);
6
6
  private get headers();
7
- submitTryOn(modelImage: string, garmentImage: string, fitInfo?: FitAreaInfo[]): Promise<TryOnResponse>;
7
+ submitTryOn(modelImage: string, garmentImage: string, fitInfo?: FitAreaInfo[], category?: "apparel" | "hat" | "sunglasses"): Promise<TryOnResponse>;
8
8
  getStatus(jobId: string): Promise<TryOnStatus>;
9
9
  getStreamUrl(): string;
10
10
  }
@@ -10,9 +10,10 @@ class ApiClient {
10
10
  Authorization: `Bearer ${this.apiKey}`
11
11
  };
12
12
  }
13
- async submitTryOn(modelImage, garmentImage, fitInfo) {
13
+ async submitTryOn(modelImage, garmentImage, fitInfo, category) {
14
14
  const body = { modelImage, garmentImage };
15
15
  if (fitInfo && fitInfo.length > 0) body.fitInfo = fitInfo;
16
+ if (category && category !== "apparel") body.category = category;
16
17
  const res = await fetch(`${this.baseUrl}/api/v1/tryon`, {
17
18
  method: "POST",
18
19
  headers: this.headers,
@@ -1,5 +1,5 @@
1
- import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-J6U0-q_3.js";
2
- import { P, b, T, d, r } from "./index-J6U0-q_3.js";
1
+ import { c as createT, A as ApiClient, S as SseClient, i as isValidImageFile, a as compressImage } from "./index-CuIieeOy.js";
2
+ import { P, b, T, d, r } from "./index-CuIieeOy.js";
3
3
  function detectProductImage() {
4
4
  const ogImage = document.querySelector(
5
5
  'meta[property="og:image"]'