@picsart/ai-sdk 7.42.0 → 7.45.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.
- package/README.md +1 -1
- package/_vendor/model-types/index.d.ts +1 -0
- package/index.d.ts +6 -0
- package/index.js +19 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ catalog.search('kling') // search by name/id/provider
|
|
|
46
46
|
|
|
47
47
|
// Model metadata & params — the `Model` accessor
|
|
48
48
|
Model('flux-2-pro').name // 'Flux 2 Pro'
|
|
49
|
-
Model('flux-2-pro').meta() // mode, provider, badges, addedAt, updatedAt, …
|
|
49
|
+
Model('flux-2-pro').meta() // mode, provider, badges, addedAt, releasedAt, updatedAt, …
|
|
50
50
|
Model('flux-2-pro').params() // accepted parameters
|
|
51
51
|
Model('flux-2-pro').params().toSchema() // param schema
|
|
52
52
|
|
|
@@ -273,6 +273,7 @@ export type ModelInputById = {
|
|
|
273
273
|
"seedream-5.5": { resolution?: "1K" | "1.5K" | "2K"; prompt: string; aspectRatio?: "1:1" | "4:3" | "3:4" | "16:9" | "9:16" | "3:2" | "2:3" | "21:9"; imageUrls?: string[]; negativePrompt?: string; background?: "auto" | "transparent" | "opaque"; };
|
|
274
274
|
"gpt-image-2.6-flare": { prompt: string; aspectRatio?: "1:1" | "3:2" | "2:3" | "16:9" | "9:16" | "4:3" | "3:4" | "auto"; resolution?: "1K" | "2K" | "4K"; size?: string; quality?: "max" | "xhigh" | "high" | "medium" | "low"; complexity?: "high" | "medium" | "low"; background?: "opaque" | "transparent" | "auto"; outputFormat?: "png" | "jpeg" | "webp" | "gif" | "svg"; frameCount?: number; frameDurationMs?: number; svgAuthorModel?: "gpt-6.1-sol" | "gpt-6.1-terra" | "gpt-6-astra" | "gpt-6-sol" | "gpt-6-luna"; svgReasoningEffort?: "auto" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"; count?: 1 | 2 | 4 | 6 | 8 | 10; imageUrls?: string[]; markupUrl?: string; maskUrl?: string; };
|
|
275
275
|
"topaz-upscale-image": { imageUrls: [string, ...string[]]; model?: "Standard V2" | "Standard MAX" | "Low Resolution V2" | "High Fidelity V2" | "CGI" | "Text Refine" | "Redefine" | "Recovery" | "Recovery V2" | "Wonder" | "Wonder 3"; };
|
|
276
|
+
"topaz-upscale-image-generative": { imageUrls: [string, ...string[]]; model?: "Wonder 4" | "Wonder 3.5" | "Wonder 3" | "Wonder 2" | "Wonder" | "Recover 3" | "Standard MAX" | "Redefine" | "Recovery V2" | "Recovery"; };
|
|
276
277
|
"topaz-upscale-video": { videoUrl: string; model?: "Proteus" | "Artemis HQ" | "Artemis MQ" | "Artemis LQ" | "Nyx" | "Nyx Fast" | "Nyx XL" | "Nyx HF" | "Gaia HQ" | "Gaia CG" | "Gaia 2" | "Starlight Precise 2.5" | "Starlight HQ" | "Starlight Mini" | "Starlight Sharp" | "Starlight Fast 2"; };
|
|
277
278
|
"typesafe-evaluate": { state: string; imageUrls?: string[]; questions: Record<string, { type: "noul" | "choice" | "score" | "box"; instructions: unknown } & Record<string, unknown>>; };
|
|
278
279
|
"veed-fabric-v1": { prompt?: string; resolution?: "480p" | "720p"; imageUrls: [string, ...string[]]; audioUrl: string; };
|
package/index.d.ts
CHANGED
|
@@ -439,6 +439,8 @@ interface ModelMeta {
|
|
|
439
439
|
readonly provider: ProviderInfo;
|
|
440
440
|
/** ISO YYYY-MM-DD date the model was added to the catalog, or null if unknown. */
|
|
441
441
|
readonly addedAt: string | null;
|
|
442
|
+
/** ISO YYYY-MM-DD date the model went into full release at Picsart, or null while it is in preview. */
|
|
443
|
+
readonly releasedAt: string | null;
|
|
442
444
|
/** ISO YYYY-MM-DD date the model definition was last changed, or null if unknown. */
|
|
443
445
|
readonly updatedAt: string | null;
|
|
444
446
|
/** Release / availability tier. Absent on the definition ⇒ `'production'`. */
|
|
@@ -740,6 +742,8 @@ interface ModelDefinition {
|
|
|
740
742
|
badge?: BadgeType[];
|
|
741
743
|
/** ISO YYYY-MM-DD date the model was added. The 'new' badge is derived from this — see core/badges.ts. */
|
|
742
744
|
addedAt?: string;
|
|
745
|
+
/** ISO YYYY-MM-DD date the model went into full release at Picsart — tells how new it is. Absent while in preview. */
|
|
746
|
+
releasedAt?: string;
|
|
743
747
|
/** ISO YYYY-MM-DD date the model definition was last changed. Absent when unknown. */
|
|
744
748
|
updatedAt?: string;
|
|
745
749
|
/**
|
|
@@ -1606,6 +1610,8 @@ interface CatalogModel {
|
|
|
1606
1610
|
features?: ModelFeature[];
|
|
1607
1611
|
release?: ReleaseTag;
|
|
1608
1612
|
addedAt?: string;
|
|
1613
|
+
/** The server sends `null` while the model is still in preview (not yet fully released). */
|
|
1614
|
+
releasedAt?: string | null;
|
|
1609
1615
|
/** The server sends `null` for a model that has never been changed since it was added. */
|
|
1610
1616
|
updatedAt?: string | null;
|
|
1611
1617
|
estimatedTime?: number | Record<string, number>;
|
package/index.js
CHANGED
|
@@ -669,6 +669,7 @@ function toModelDefinition(wire) {
|
|
|
669
669
|
if (wire.badges !== void 0) def.badge = wire.badges;
|
|
670
670
|
if (wire.release !== void 0) def.release = wire.release;
|
|
671
671
|
if (wire.addedAt !== void 0) def.addedAt = wire.addedAt;
|
|
672
|
+
if (wire.releasedAt != null) def.releasedAt = wire.releasedAt;
|
|
672
673
|
if (wire.updatedAt != null) def.updatedAt = wire.updatedAt;
|
|
673
674
|
if (wire.estimatedTime !== void 0) def.estimatedTime = wire.estimatedTime;
|
|
674
675
|
if (wire.deprecated !== void 0) def.deprecated = wire.deprecated;
|
|
@@ -1454,6 +1455,7 @@ var ModelMetaImpl = class {
|
|
|
1454
1455
|
badges;
|
|
1455
1456
|
provider;
|
|
1456
1457
|
addedAt;
|
|
1458
|
+
releasedAt;
|
|
1457
1459
|
updatedAt;
|
|
1458
1460
|
release;
|
|
1459
1461
|
constructor(def) {
|
|
@@ -1470,6 +1472,7 @@ var ModelMetaImpl = class {
|
|
|
1470
1472
|
label: def.providerLabel
|
|
1471
1473
|
};
|
|
1472
1474
|
this.addedAt = def.addedAt ?? null;
|
|
1475
|
+
this.releasedAt = def.releasedAt ?? null;
|
|
1473
1476
|
this.updatedAt = def.updatedAt ?? null;
|
|
1474
1477
|
}
|
|
1475
1478
|
};
|
|
@@ -2615,13 +2618,27 @@ function toApiError(err, workflow, id) {
|
|
|
2615
2618
|
});
|
|
2616
2619
|
}
|
|
2617
2620
|
|
|
2621
|
+
// package.json
|
|
2622
|
+
var package_default = {
|
|
2623
|
+
version: "7.45.0"};
|
|
2624
|
+
|
|
2618
2625
|
// src/client/transport.ts
|
|
2619
2626
|
var GATEWAY_HEADERS = {
|
|
2620
2627
|
"platform": "api",
|
|
2621
2628
|
"X-Touchpoint": "sdk"
|
|
2622
2629
|
};
|
|
2630
|
+
var SDK_HEADERS = {
|
|
2631
|
+
"X-Picsart-Sdk": `js/${package_default.version}`
|
|
2632
|
+
};
|
|
2623
2633
|
function maybeFetch(config) {
|
|
2624
|
-
if (config.fetch)
|
|
2634
|
+
if (config.fetch) {
|
|
2635
|
+
const callerFetch = config.fetch;
|
|
2636
|
+
return (url, init) => {
|
|
2637
|
+
const headers = new Headers(init?.headers);
|
|
2638
|
+
for (const [name, value] of Object.entries(SDK_HEADERS)) headers.set(name, value);
|
|
2639
|
+
return callerFetch(url, { ...init, headers });
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2625
2642
|
if (config.apiKey) {
|
|
2626
2643
|
const token = config.apiKey.replace(/^Bearer\s+/i, "");
|
|
2627
2644
|
return (url, init) => {
|
|
@@ -2630,6 +2647,7 @@ function maybeFetch(config) {
|
|
|
2630
2647
|
for (const [name, value] of Object.entries(GATEWAY_HEADERS)) {
|
|
2631
2648
|
if (!headers.has(name)) headers.set(name, value);
|
|
2632
2649
|
}
|
|
2650
|
+
for (const [name, value] of Object.entries(SDK_HEADERS)) headers.set(name, value);
|
|
2633
2651
|
return globalThis.fetch(url, { ...init, headers });
|
|
2634
2652
|
};
|
|
2635
2653
|
}
|