@picsart/ai-sdk 7.41.0 → 7.43.0

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.
@@ -247,6 +247,7 @@ export type ModelInputById = {
247
247
  "runway-gen4.5": { prompt: string; duration?: 5 | 8 | 10; aspectRatio?: "16:9" | "9:16"; imageUrls?: string[]; };
248
248
  "sam-3-video": { prompt: string; videoUrl: string; detectionThreshold?: number; applyMask?: boolean; outputFormat?: "mp4" | "webm"; };
249
249
  "seed-audio-1.0": { prompt: string; voiceId?: string; audioUrls?: string[]; imageUrls?: string[]; format?: "wav" | "mp3" | "pcm" | "ogg_opus"; sampleRate?: 8000 | 16000 | 24000 | 32000 | 44100 | 48000; speechRate?: number; loudnessRate?: number; pitchRate?: number; aigcWatermark?: boolean; };
250
+ "seed-tts-3.0": { prompt: string; voiceId?: string; instructions?: string; format?: "mp3" | "wav" | "pcm" | "ogg_opus"; sampleRate?: 8000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000; speed?: number; volume?: number; pitch?: number; };
250
251
  "seed-audio-1.0-multilingual": { prompt: string; voiceId?: string; audioUrls?: string[]; imageUrls?: string[]; format?: "wav" | "mp3" | "pcm" | "ogg_opus"; sampleRate?: 8000 | 16000 | 24000 | 32000 | 44100 | 48000; speechRate?: number; loudnessRate?: number; pitchRate?: number; aigcWatermark?: boolean; };
251
252
  "seedance-1.5-pro": { prompt: string; aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive"; resolution?: "480p" | "720p"; duration?: -1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; generateAudio?: boolean; startFrame?: string; endFrame?: string; };
252
253
  "seedance-2.0": { prompt: string; aspectRatio?: "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive"; resolution?: "480p" | "720p" | "1080p" | "4k"; duration?: -1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15; generateAudio?: boolean; returnLastFrame?: boolean; imageUrls?: string[]; videoUrls?: string[]; audioUrls?: string[]; startFrame?: string; endFrame?: string; };
package/index.js CHANGED
@@ -2615,13 +2615,27 @@ function toApiError(err, workflow, id) {
2615
2615
  });
2616
2616
  }
2617
2617
 
2618
+ // package.json
2619
+ var package_default = {
2620
+ version: "7.43.0"};
2621
+
2618
2622
  // src/client/transport.ts
2619
2623
  var GATEWAY_HEADERS = {
2620
2624
  "platform": "api",
2621
2625
  "X-Touchpoint": "sdk"
2622
2626
  };
2627
+ var SDK_HEADERS = {
2628
+ "X-Picsart-Sdk": `js/${package_default.version}`
2629
+ };
2623
2630
  function maybeFetch(config) {
2624
- if (config.fetch) return config.fetch;
2631
+ if (config.fetch) {
2632
+ const callerFetch = config.fetch;
2633
+ return (url, init) => {
2634
+ const headers = new Headers(init?.headers);
2635
+ for (const [name, value] of Object.entries(SDK_HEADERS)) headers.set(name, value);
2636
+ return callerFetch(url, { ...init, headers });
2637
+ };
2638
+ }
2625
2639
  if (config.apiKey) {
2626
2640
  const token = config.apiKey.replace(/^Bearer\s+/i, "");
2627
2641
  return (url, init) => {
@@ -2630,6 +2644,7 @@ function maybeFetch(config) {
2630
2644
  for (const [name, value] of Object.entries(GATEWAY_HEADERS)) {
2631
2645
  if (!headers.has(name)) headers.set(name, value);
2632
2646
  }
2647
+ for (const [name, value] of Object.entries(SDK_HEADERS)) headers.set(name, value);
2633
2648
  return globalThis.fetch(url, { ...init, headers });
2634
2649
  };
2635
2650
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "7.41.0",
3
+ "version": "7.43.0",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",