@runwayml/sdk 3.5.0 → 3.7.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/CHANGELOG.md +16 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +5 -2
- package/client.js.map +1 -1
- package/client.mjs +5 -2
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +1 -1
- package/resources/character-performance.d.mts +32 -5
- package/resources/character-performance.d.mts.map +1 -1
- package/resources/character-performance.d.ts +32 -5
- package/resources/character-performance.d.ts.map +1 -1
- package/resources/character-performance.js +16 -0
- package/resources/character-performance.js.map +1 -1
- package/resources/character-performance.mjs +16 -0
- package/resources/character-performance.mjs.map +1 -1
- package/resources/image-to-video.d.mts +215 -88
- package/resources/image-to-video.d.mts.map +1 -1
- package/resources/image-to-video.d.ts +215 -88
- package/resources/image-to-video.d.ts.map +1 -1
- package/resources/image-to-video.js +10 -1
- package/resources/image-to-video.js.map +1 -1
- package/resources/image-to-video.mjs +10 -1
- package/resources/image-to-video.mjs.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/speech-to-speech.d.mts +16 -4
- package/resources/speech-to-speech.d.mts.map +1 -1
- package/resources/speech-to-speech.d.ts +16 -4
- package/resources/speech-to-speech.d.ts.map +1 -1
- package/resources/text-to-image.d.mts +3 -3
- package/resources/text-to-image.d.ts +3 -3
- package/resources/text-to-speech.d.mts +2 -2
- package/resources/text-to-speech.d.ts +2 -2
- package/resources/text-to-video.d.mts +50 -28
- package/resources/text-to-video.d.mts.map +1 -1
- package/resources/text-to-video.d.ts +50 -28
- package/resources/text-to-video.d.ts.map +1 -1
- package/resources/uploads.d.mts +33 -0
- package/resources/uploads.d.mts.map +1 -0
- package/resources/uploads.d.ts +33 -0
- package/resources/uploads.d.ts.map +1 -0
- package/resources/uploads.js +75 -0
- package/resources/uploads.js.map +1 -0
- package/resources/uploads.mjs +70 -0
- package/resources/uploads.mjs.map +1 -0
- package/resources/video-to-video.d.mts +12 -10
- package/resources/video-to-video.d.mts.map +1 -1
- package/resources/video-to-video.d.ts +12 -10
- package/resources/video-to-video.d.ts.map +1 -1
- package/resources/video-to-video.js +10 -0
- package/resources/video-to-video.js.map +1 -1
- package/resources/video-to-video.mjs +10 -0
- package/resources/video-to-video.mjs.map +1 -1
- package/resources/video-upscale.d.mts +9 -9
- package/resources/video-upscale.d.mts.map +1 -1
- package/resources/video-upscale.d.ts +9 -9
- package/resources/video-upscale.d.ts.map +1 -1
- package/resources/video-upscale.js +8 -0
- package/resources/video-upscale.js.map +1 -1
- package/resources/video-upscale.mjs +8 -0
- package/resources/video-upscale.mjs.map +1 -1
- package/resources/voice-dubbing.d.mts +10 -1
- package/resources/voice-dubbing.d.mts.map +1 -1
- package/resources/voice-dubbing.d.ts +10 -1
- package/resources/voice-dubbing.d.ts.map +1 -1
- package/resources/voice-dubbing.js +9 -0
- package/resources/voice-dubbing.js.map +1 -1
- package/resources/voice-dubbing.mjs +9 -0
- package/resources/voice-dubbing.mjs.map +1 -1
- package/resources/voice-isolation.d.mts +11 -2
- package/resources/voice-isolation.d.mts.map +1 -1
- package/resources/voice-isolation.d.ts +11 -2
- package/resources/voice-isolation.d.ts.map +1 -1
- package/resources/voice-isolation.js +10 -1
- package/resources/voice-isolation.js.map +1 -1
- package/resources/voice-isolation.mjs +10 -1
- package/resources/voice-isolation.mjs.map +1 -1
- package/src/client.ts +11 -2
- package/src/resources/character-performance.ts +32 -5
- package/src/resources/image-to-video.ts +253 -99
- package/src/resources/index.ts +1 -0
- package/src/resources/speech-to-speech.ts +16 -4
- package/src/resources/text-to-image.ts +3 -3
- package/src/resources/text-to-speech.ts +2 -2
- package/src/resources/text-to-video.ts +61 -28
- package/src/resources/uploads.ts +135 -0
- package/src/resources/video-to-video.ts +12 -10
- package/src/resources/video-upscale.ts +9 -9
- package/src/resources/voice-dubbing.ts +10 -1
- package/src/resources/voice-isolation.ts +11 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -8,36 +8,58 @@ export declare class TextToVideo extends APIResource {
|
|
|
8
8
|
create(body: TextToVideoCreateParams, options?: RequestOptions): APIPromiseWithAwaitableTask<TextToVideoCreateResponse>;
|
|
9
9
|
}
|
|
10
10
|
export interface TextToVideoCreateResponse {
|
|
11
|
-
/**
|
|
12
|
-
* The ID of the newly created task.
|
|
13
|
-
*/
|
|
14
11
|
id: string;
|
|
15
12
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
export type TextToVideoCreateParams = TextToVideoCreateParams.Veo3_1 | TextToVideoCreateParams.Veo3_1Fast | TextToVideoCreateParams.Veo3;
|
|
14
|
+
export declare namespace TextToVideoCreateParams {
|
|
15
|
+
interface Veo3_1 {
|
|
16
|
+
model: 'veo3.1';
|
|
17
|
+
/**
|
|
18
|
+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
19
|
+
* should describe in detail what should appear in the output.
|
|
20
|
+
*/
|
|
21
|
+
promptText: string;
|
|
22
|
+
/**
|
|
23
|
+
* The resolution of the output video.
|
|
24
|
+
*/
|
|
25
|
+
ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
|
|
26
|
+
/**
|
|
27
|
+
* The number of seconds of duration for the output video.
|
|
28
|
+
*/
|
|
29
|
+
duration?: 4 | 6 | 8;
|
|
30
|
+
}
|
|
31
|
+
interface Veo3_1Fast {
|
|
32
|
+
model: 'veo3.1_fast';
|
|
33
|
+
/**
|
|
34
|
+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
35
|
+
* should describe in detail what should appear in the output.
|
|
36
|
+
*/
|
|
37
|
+
promptText: string;
|
|
38
|
+
/**
|
|
39
|
+
* The resolution of the output video.
|
|
40
|
+
*/
|
|
41
|
+
ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
|
|
42
|
+
/**
|
|
43
|
+
* The number of seconds of duration for the output video.
|
|
44
|
+
*/
|
|
45
|
+
duration?: 4 | 6 | 8;
|
|
46
|
+
}
|
|
47
|
+
interface Veo3 {
|
|
48
|
+
/**
|
|
49
|
+
* The number of seconds of duration for the output video.
|
|
50
|
+
*/
|
|
51
|
+
duration: 8;
|
|
52
|
+
model: 'veo3';
|
|
53
|
+
/**
|
|
54
|
+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
55
|
+
* should describe in detail what should appear in the output.
|
|
56
|
+
*/
|
|
57
|
+
promptText: string;
|
|
58
|
+
/**
|
|
59
|
+
* The resolution of the output video.
|
|
60
|
+
*/
|
|
61
|
+
ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
export declare namespace TextToVideo {
|
|
43
65
|
export { type TextToVideoCreateResponse as TextToVideoCreateResponse, type TextToVideoCreateParams as TextToVideoCreateParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-to-video.d.mts","sourceRoot":"","sources":["../src/resources/text-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9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IAED,UAAiB,IAAI;QACnB;;WAEG;QACH,QAAQ,EAAE,CAAC,CAAC;QAEZ,KAAK,EAAE,MAAM,CAAC;QAEd;;;WAGG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;KAC5D;CACF;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -8,36 +8,58 @@ export declare class TextToVideo extends APIResource {
|
|
|
8
8
|
create(body: TextToVideoCreateParams, options?: RequestOptions): APIPromiseWithAwaitableTask<TextToVideoCreateResponse>;
|
|
9
9
|
}
|
|
10
10
|
export interface TextToVideoCreateResponse {
|
|
11
|
-
/**
|
|
12
|
-
* The ID of the newly created task.
|
|
13
|
-
*/
|
|
14
11
|
id: string;
|
|
15
12
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
13
|
+
export type TextToVideoCreateParams = TextToVideoCreateParams.Veo3_1 | TextToVideoCreateParams.Veo3_1Fast | TextToVideoCreateParams.Veo3;
|
|
14
|
+
export declare namespace TextToVideoCreateParams {
|
|
15
|
+
interface Veo3_1 {
|
|
16
|
+
model: 'veo3.1';
|
|
17
|
+
/**
|
|
18
|
+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
19
|
+
* should describe in detail what should appear in the output.
|
|
20
|
+
*/
|
|
21
|
+
promptText: string;
|
|
22
|
+
/**
|
|
23
|
+
* The resolution of the output video.
|
|
24
|
+
*/
|
|
25
|
+
ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
|
|
26
|
+
/**
|
|
27
|
+
* The number of seconds of duration for the output video.
|
|
28
|
+
*/
|
|
29
|
+
duration?: 4 | 6 | 8;
|
|
30
|
+
}
|
|
31
|
+
interface Veo3_1Fast {
|
|
32
|
+
model: 'veo3.1_fast';
|
|
33
|
+
/**
|
|
34
|
+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
35
|
+
* should describe in detail what should appear in the output.
|
|
36
|
+
*/
|
|
37
|
+
promptText: string;
|
|
38
|
+
/**
|
|
39
|
+
* The resolution of the output video.
|
|
40
|
+
*/
|
|
41
|
+
ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
|
|
42
|
+
/**
|
|
43
|
+
* The number of seconds of duration for the output video.
|
|
44
|
+
*/
|
|
45
|
+
duration?: 4 | 6 | 8;
|
|
46
|
+
}
|
|
47
|
+
interface Veo3 {
|
|
48
|
+
/**
|
|
49
|
+
* The number of seconds of duration for the output video.
|
|
50
|
+
*/
|
|
51
|
+
duration: 8;
|
|
52
|
+
model: 'veo3';
|
|
53
|
+
/**
|
|
54
|
+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
55
|
+
* should describe in detail what should appear in the output.
|
|
56
|
+
*/
|
|
57
|
+
promptText: string;
|
|
58
|
+
/**
|
|
59
|
+
* The resolution of the output video.
|
|
60
|
+
*/
|
|
61
|
+
ratio: '1280:720' | '720:1280' | '1080:1920' | '1920:1080';
|
|
62
|
+
}
|
|
41
63
|
}
|
|
42
64
|
export declare namespace TextToVideo {
|
|
43
65
|
export { type TextToVideoCreateResponse as TextToVideoCreateResponse, type TextToVideoCreateParams as TextToVideoCreateParams, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-to-video.d.ts","sourceRoot":"","sources":["../src/resources/text-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,2BAA2B,CAAC,yBAAyB,CAAC;CAK1D;AAED,MAAM,WAAW,yBAAyB;IACxC
|
|
1
|
+
{"version":3,"file":"text-to-video.d.ts","sourceRoot":"","sources":["../src/resources/text-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,uBAAuB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,2BAA2B,CAAC,yBAAyB,CAAC;CAK1D;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,MAAM,uBAAuB,GAC/B,uBAAuB,CAAC,MAAM,GAC9B,uBAAuB,CAAC,UAAU,GAClC,uBAAuB,CAAC,IAAI,CAAC;AAEjC,MAAM,CAAC,OAAO,WAAW,uBAAuB,CAAC;IAC/C,UAAiB,MAAM;QACrB,KAAK,EAAE,QAAQ,CAAC;QAEhB;;;WAGG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;QAE3D;;WAEG;QACH,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACtB;IAED,UAAiB,UAAU;QACzB,KAAK,EAAE,aAAa,CAAC;QAErB;;;WAGG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;QAE3D;;WAEG;QACH,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACtB;IAED,UAAiB,IAAI;QACnB;;WAEG;QACH,QAAQ,EAAE,CAAC,CAAC;QAEZ,KAAK,EAAE,MAAM,CAAC;QAEd;;;WAGG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;KAC5D;CACF;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
3
|
+
import { Uploadable } from "../internal/uploads.mjs";
|
|
4
|
+
export declare class Uploads extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Uploads a temporary media file that can be used in other API generation
|
|
7
|
+
* requests.
|
|
8
|
+
*
|
|
9
|
+
* The uploaded files will be automatically expired and deleted after a
|
|
10
|
+
* period of time.
|
|
11
|
+
*/
|
|
12
|
+
createEphemeral(params: UploadsCreateEphemeralParams, options?: RequestOptions): Promise<UploadCreateEphemeralResponse>;
|
|
13
|
+
}
|
|
14
|
+
export interface UploadCreateEphemeralResponse {
|
|
15
|
+
/**
|
|
16
|
+
* The Runway upload URI to use in other API generation requests.
|
|
17
|
+
*/
|
|
18
|
+
uri: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UploadsCreateEphemeralParams {
|
|
21
|
+
/**
|
|
22
|
+
* The file to upload. Must be a supported media type (image, video, or audio).
|
|
23
|
+
*/
|
|
24
|
+
file: Uploadable;
|
|
25
|
+
/**
|
|
26
|
+
* Optional metadata for the file, serialized as a field in multipart/form-data.
|
|
27
|
+
*/
|
|
28
|
+
fileMetadata?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare namespace Uploads {
|
|
31
|
+
export { type UploadCreateEphemeralResponse as UploadCreateEphemeralResponse, type UploadsCreateEphemeralParams as UploadsCreateEphemeralParams, };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=uploads.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["../src/resources/uploads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,UAAU,EAAE;AA+DrB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;OAMG;IACG,eAAe,CACnB,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,6BAA6B,CAAC;CA8B1C;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
3
|
+
import { Uploadable } from "../internal/uploads.js";
|
|
4
|
+
export declare class Uploads extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Uploads a temporary media file that can be used in other API generation
|
|
7
|
+
* requests.
|
|
8
|
+
*
|
|
9
|
+
* The uploaded files will be automatically expired and deleted after a
|
|
10
|
+
* period of time.
|
|
11
|
+
*/
|
|
12
|
+
createEphemeral(params: UploadsCreateEphemeralParams, options?: RequestOptions): Promise<UploadCreateEphemeralResponse>;
|
|
13
|
+
}
|
|
14
|
+
export interface UploadCreateEphemeralResponse {
|
|
15
|
+
/**
|
|
16
|
+
* The Runway upload URI to use in other API generation requests.
|
|
17
|
+
*/
|
|
18
|
+
uri: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UploadsCreateEphemeralParams {
|
|
21
|
+
/**
|
|
22
|
+
* The file to upload. Must be a supported media type (image, video, or audio).
|
|
23
|
+
*/
|
|
24
|
+
file: Uploadable;
|
|
25
|
+
/**
|
|
26
|
+
* Optional metadata for the file, serialized as a field in multipart/form-data.
|
|
27
|
+
*/
|
|
28
|
+
fileMetadata?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare namespace Uploads {
|
|
31
|
+
export { type UploadCreateEphemeralResponse as UploadCreateEphemeralResponse, type UploadsCreateEphemeralParams as UploadsCreateEphemeralParams, };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=uploads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["../src/resources/uploads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,UAAU,EAAE;AA+DrB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;OAMG;IACG,eAAe,CACnB,MAAM,EAAE,4BAA4B,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,6BAA6B,CAAC;CA8B1C;AAED,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Uploads = void 0;
|
|
5
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../core/resource.js");
|
|
7
|
+
const to_file_1 = require("../internal/to-file.js");
|
|
8
|
+
const Errors = tslib_1.__importStar(require("../core/error.js"));
|
|
9
|
+
const errors_1 = require("../internal/errors.js");
|
|
10
|
+
async function uploadFileToStorage(uploadUrl, fields, file, fileMetadata, timeout, fetch) {
|
|
11
|
+
const formData = new FormData();
|
|
12
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
13
|
+
formData.append(key, value);
|
|
14
|
+
}
|
|
15
|
+
if (fileMetadata !== undefined) {
|
|
16
|
+
formData.append('metadata', fileMetadata);
|
|
17
|
+
}
|
|
18
|
+
formData.append('file', file);
|
|
19
|
+
const controller = new AbortController();
|
|
20
|
+
const timeoutId = timeout ? setTimeout(() => controller.abort(), timeout) : undefined;
|
|
21
|
+
try {
|
|
22
|
+
const response = await fetch(uploadUrl, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
body: formData,
|
|
25
|
+
signal: controller.signal,
|
|
26
|
+
});
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
const errorText = await response.text().catch(() => '');
|
|
29
|
+
throw new Errors.APIError(response.status, { error: errorText }, `Upload failed with status ${response.status}`, response.headers);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (error instanceof Errors.APIError) {
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
const err = (0, errors_1.castToError)(error);
|
|
37
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
38
|
+
throw new Errors.APIConnectionTimeoutError();
|
|
39
|
+
}
|
|
40
|
+
throw new Errors.APIConnectionError({ cause: err });
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
if (timeoutId) {
|
|
44
|
+
clearTimeout(timeoutId);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
class Uploads extends resource_1.APIResource {
|
|
49
|
+
/**
|
|
50
|
+
* Uploads a temporary media file that can be used in other API generation
|
|
51
|
+
* requests.
|
|
52
|
+
*
|
|
53
|
+
* The uploaded files will be automatically expired and deleted after a
|
|
54
|
+
* period of time.
|
|
55
|
+
*/
|
|
56
|
+
async createEphemeral(params, options) {
|
|
57
|
+
const { file, fileMetadata } = params;
|
|
58
|
+
const fileObj = await (0, to_file_1.toFile)(file);
|
|
59
|
+
if (!fileObj.name || fileObj.name === 'unknown_file') {
|
|
60
|
+
throw new Error('Cannot infer filename from file. Please provide a File with a name property, ' +
|
|
61
|
+
'or use the toFile() utility with a name parameter to convert your data to a File.');
|
|
62
|
+
}
|
|
63
|
+
const placeholder = await this._client.post('/v1/uploads', {
|
|
64
|
+
body: { filename: fileObj.name, type: 'ephemeral' },
|
|
65
|
+
...options,
|
|
66
|
+
});
|
|
67
|
+
const timeout = options?.timeout ?? this._client.timeout;
|
|
68
|
+
// Access private fetch - using type assertion as it's needed for direct upload
|
|
69
|
+
const fetch = this._client.fetch;
|
|
70
|
+
await uploadFileToStorage(placeholder.uploadUrl, placeholder.fields, fileObj, fileMetadata, timeout, fetch);
|
|
71
|
+
return { uri: placeholder.runwayUri };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.Uploads = Uploads;
|
|
75
|
+
//# sourceMappingURL=uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.js","sourceRoot":"","sources":["../src/resources/uploads.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,kDAA+C;AAG/C,oDAA6C;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AC,OAAO,CAAC;QACzD,+EAA+E;QAC/E,MAAM,KAAK,GAAI,IAAI,CAAC,OAAuC,CAAC,KAAK,CAAC;QAClE,MAAM,mBAAmB,CACvB,WAAW,CAAC,SAAS,EACrB,WAAW,CAAC,MAAM,EAClB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,KAAK,CACN,CAAC;QAEF,OAAO,EAAE,GAAG,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;IACxC,CAAC;CACF;AAzCD,0BAyCC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { toFile } from "../internal/to-file.mjs";
|
|
4
|
+
import * as Errors from "../core/error.mjs";
|
|
5
|
+
import { castToError } from "../internal/errors.mjs";
|
|
6
|
+
async function uploadFileToStorage(uploadUrl, fields, file, fileMetadata, timeout, fetch) {
|
|
7
|
+
const formData = new FormData();
|
|
8
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
9
|
+
formData.append(key, value);
|
|
10
|
+
}
|
|
11
|
+
if (fileMetadata !== undefined) {
|
|
12
|
+
formData.append('metadata', fileMetadata);
|
|
13
|
+
}
|
|
14
|
+
formData.append('file', file);
|
|
15
|
+
const controller = new AbortController();
|
|
16
|
+
const timeoutId = timeout ? setTimeout(() => controller.abort(), timeout) : undefined;
|
|
17
|
+
try {
|
|
18
|
+
const response = await fetch(uploadUrl, {
|
|
19
|
+
method: 'POST',
|
|
20
|
+
body: formData,
|
|
21
|
+
signal: controller.signal,
|
|
22
|
+
});
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
const errorText = await response.text().catch(() => '');
|
|
25
|
+
throw new Errors.APIError(response.status, { error: errorText }, `Upload failed with status ${response.status}`, response.headers);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (error instanceof Errors.APIError) {
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
const err = castToError(error);
|
|
33
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
34
|
+
throw new Errors.APIConnectionTimeoutError();
|
|
35
|
+
}
|
|
36
|
+
throw new Errors.APIConnectionError({ cause: err });
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
if (timeoutId) {
|
|
40
|
+
clearTimeout(timeoutId);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export class Uploads extends APIResource {
|
|
45
|
+
/**
|
|
46
|
+
* Uploads a temporary media file that can be used in other API generation
|
|
47
|
+
* requests.
|
|
48
|
+
*
|
|
49
|
+
* The uploaded files will be automatically expired and deleted after a
|
|
50
|
+
* period of time.
|
|
51
|
+
*/
|
|
52
|
+
async createEphemeral(params, options) {
|
|
53
|
+
const { file, fileMetadata } = params;
|
|
54
|
+
const fileObj = await toFile(file);
|
|
55
|
+
if (!fileObj.name || fileObj.name === 'unknown_file') {
|
|
56
|
+
throw new Error('Cannot infer filename from file. Please provide a File with a name property, ' +
|
|
57
|
+
'or use the toFile() utility with a name parameter to convert your data to a File.');
|
|
58
|
+
}
|
|
59
|
+
const placeholder = await this._client.post('/v1/uploads', {
|
|
60
|
+
body: { filename: fileObj.name, type: 'ephemeral' },
|
|
61
|
+
...options,
|
|
62
|
+
});
|
|
63
|
+
const timeout = options?.timeout ?? this._client.timeout;
|
|
64
|
+
// Access private fetch - using type assertion as it's needed for direct upload
|
|
65
|
+
const fetch = this._client.fetch;
|
|
66
|
+
await uploadFileToStorage(placeholder.uploadUrl, placeholder.fields, fileObj, fileMetadata, timeout, fetch);
|
|
67
|
+
return { uri: placeholder.runwayUri };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=uploads.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["../src/resources/uploads.ts"],"names":[],"mappings":"AAAA,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M,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QACzD,+EAA+E;QAC/E,MAAM,KAAK,GAAI,IAAI,CAAC,OAAuC,CAAC,KAAK,CAAC;QAClE,MAAM,mBAAmB,CACvB,WAAW,CAAC,SAAS,EACrB,WAAW,CAAC,MAAM,EAClB,OAAO,EACP,YAAY,EACZ,OAAO,EACP,KAAK,CACN,CAAC;QAEF,OAAO,EAAE,GAAG,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -4,19 +4,23 @@ import { APIPromiseWithAwaitableTask } from "../lib/polling.mjs";
|
|
|
4
4
|
export declare class VideoToVideo extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* This endpoint will start a new task to generate a video from a video.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const videoToVideo = await client.videoToVideo.create({
|
|
11
|
+
* model: 'gen4_aleph',
|
|
12
|
+
* promptText: 'x',
|
|
13
|
+
* ratio: '1280:720',
|
|
14
|
+
* videoUri: 'https://example.com/video.mp4',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
7
17
|
*/
|
|
8
18
|
create(body: VideoToVideoCreateParams, options?: RequestOptions): APIPromiseWithAwaitableTask<VideoToVideoCreateResponse>;
|
|
9
19
|
}
|
|
10
20
|
export interface VideoToVideoCreateResponse {
|
|
11
|
-
/**
|
|
12
|
-
* The ID of the newly created task.
|
|
13
|
-
*/
|
|
14
21
|
id: string;
|
|
15
22
|
}
|
|
16
23
|
export interface VideoToVideoCreateParams {
|
|
17
|
-
/**
|
|
18
|
-
* The model variant to use.
|
|
19
|
-
*/
|
|
20
24
|
model: 'gen4_aleph';
|
|
21
25
|
/**
|
|
22
26
|
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
@@ -28,8 +32,7 @@ export interface VideoToVideoCreateParams {
|
|
|
28
32
|
*/
|
|
29
33
|
ratio: '1280:720' | '720:1280' | '1104:832' | '960:960' | '832:1104' | '1584:672' | '848:480' | '640:480';
|
|
30
34
|
/**
|
|
31
|
-
* A HTTPS URL
|
|
32
|
-
* [our docs](/assets/inputs#videos) on video inputs for more information.
|
|
35
|
+
* A HTTPS URL.
|
|
33
36
|
*/
|
|
34
37
|
videoUri: string;
|
|
35
38
|
/**
|
|
@@ -66,8 +69,7 @@ export declare namespace VideoToVideoCreateParams {
|
|
|
66
69
|
interface Reference {
|
|
67
70
|
type: 'image';
|
|
68
71
|
/**
|
|
69
|
-
* A HTTPS URL
|
|
70
|
-
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
72
|
+
* A HTTPS URL.
|
|
71
73
|
*/
|
|
72
74
|
uri: string;
|
|
73
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-to-video.d.mts","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"video-to-video.d.mts","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,2BAA2B,CAAC,0BAA0B,CAAC;CAK3D;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,YAAY,CAAC;IAEpB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IAE1G;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,iBAAiB,CAAC,EAAE,wBAAwB,CAAC,iBAAiB,CAAC;IAE/D;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAEvD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,wBAAwB,CAAC;IACxC;;OAEG;IACH,UAAiB,iBAAiB;QAChC;;;WAGG;QACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;KACxC;IAED;;;OAGG;IACH,UAAiB,SAAS;QACxB,IAAI,EAAE,OAAO,CAAC;QAEd;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;KACb;CACF;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -4,19 +4,23 @@ import { APIPromiseWithAwaitableTask } from "../lib/polling.js";
|
|
|
4
4
|
export declare class VideoToVideo extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* This endpoint will start a new task to generate a video from a video.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const videoToVideo = await client.videoToVideo.create({
|
|
11
|
+
* model: 'gen4_aleph',
|
|
12
|
+
* promptText: 'x',
|
|
13
|
+
* ratio: '1280:720',
|
|
14
|
+
* videoUri: 'https://example.com/video.mp4',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
7
17
|
*/
|
|
8
18
|
create(body: VideoToVideoCreateParams, options?: RequestOptions): APIPromiseWithAwaitableTask<VideoToVideoCreateResponse>;
|
|
9
19
|
}
|
|
10
20
|
export interface VideoToVideoCreateResponse {
|
|
11
|
-
/**
|
|
12
|
-
* The ID of the newly created task.
|
|
13
|
-
*/
|
|
14
21
|
id: string;
|
|
15
22
|
}
|
|
16
23
|
export interface VideoToVideoCreateParams {
|
|
17
|
-
/**
|
|
18
|
-
* The model variant to use.
|
|
19
|
-
*/
|
|
20
24
|
model: 'gen4_aleph';
|
|
21
25
|
/**
|
|
22
26
|
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
|
|
@@ -28,8 +32,7 @@ export interface VideoToVideoCreateParams {
|
|
|
28
32
|
*/
|
|
29
33
|
ratio: '1280:720' | '720:1280' | '1104:832' | '960:960' | '832:1104' | '1584:672' | '848:480' | '640:480';
|
|
30
34
|
/**
|
|
31
|
-
* A HTTPS URL
|
|
32
|
-
* [our docs](/assets/inputs#videos) on video inputs for more information.
|
|
35
|
+
* A HTTPS URL.
|
|
33
36
|
*/
|
|
34
37
|
videoUri: string;
|
|
35
38
|
/**
|
|
@@ -66,8 +69,7 @@ export declare namespace VideoToVideoCreateParams {
|
|
|
66
69
|
interface Reference {
|
|
67
70
|
type: 'image';
|
|
68
71
|
/**
|
|
69
|
-
* A HTTPS URL
|
|
70
|
-
* [our docs](/assets/inputs#images) on image inputs for more information.
|
|
72
|
+
* A HTTPS URL.
|
|
71
73
|
*/
|
|
72
74
|
uri: string;
|
|
73
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-to-video.d.ts","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"video-to-video.d.ts","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BA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int will start a new task to generate a video from a video.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const videoToVideo = await client.videoToVideo.create({
|
|
14
|
+
* model: 'gen4_aleph',
|
|
15
|
+
* promptText: 'x',
|
|
16
|
+
* ratio: '1280:720',
|
|
17
|
+
* videoUri: 'https://example.com/video.mp4',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
10
20
|
*/
|
|
11
21
|
create(body, options) {
|
|
12
22
|
return (0, polling_1.wrapAsWaitableResource)(this._client)(this._client.post('/v1/video_to_video', { body, ...options }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-to-video.js","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,+CAAqF;AAErF,MAAa,YAAa,SAAQ,sBAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"video-to-video.js","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,+CAAqF;AAErF,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAA,gCAAsB,EAA6B,IAAI,CAAC,OAAO,CAAC,CACrE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAC9D,CAAC;IACJ,CAAC;CACF;AAtBD,oCAsBC"}
|
|
@@ -4,6 +4,16 @@ import { wrapAsWaitableResource } from "../lib/polling.mjs";
|
|
|
4
4
|
export class VideoToVideo extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* This endpoint will start a new task to generate a video from a video.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const videoToVideo = await client.videoToVideo.create({
|
|
11
|
+
* model: 'gen4_aleph',
|
|
12
|
+
* promptText: 'x',
|
|
13
|
+
* ratio: '1280:720',
|
|
14
|
+
* videoUri: 'https://example.com/video.mp4',
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
7
17
|
*/
|
|
8
18
|
create(body, options) {
|
|
9
19
|
return wrapAsWaitableResource(this._client)(this._client.post('/v1/video_to_video', { body, ...options }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-to-video.mjs","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAA+B,sBAAsB,EAAE;AAE9D,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"video-to-video.mjs","sourceRoot":"","sources":["../src/resources/video-to-video.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAA+B,sBAAsB,EAAE;AAE9D,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,IAA8B,EAC9B,OAAwB;QAExB,OAAO,sBAAsB,CAA6B,IAAI,CAAC,OAAO,CAAC,CACrE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAC9D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -5,24 +5,24 @@ export declare class VideoUpscale extends APIResource {
|
|
|
5
5
|
/**
|
|
6
6
|
* This endpoint will start a new task to upscale a video. Videos will be upscaled
|
|
7
7
|
* by a factor of 4X, capped at a maximum of 4096px along each side.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const videoUpscale = await client.videoUpscale.create({
|
|
12
|
+
* model: 'upscale_v1',
|
|
13
|
+
* videoUri: 'https://example.com/video.mp4',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
8
16
|
*/
|
|
9
17
|
create(body: VideoUpscaleCreateParams, options?: RequestOptions): APIPromiseWithAwaitableTask<VideoUpscaleCreateResponse>;
|
|
10
18
|
}
|
|
11
19
|
export interface VideoUpscaleCreateResponse {
|
|
12
|
-
/**
|
|
13
|
-
* The ID of the newly created task.
|
|
14
|
-
*/
|
|
15
20
|
id: string;
|
|
16
21
|
}
|
|
17
22
|
export interface VideoUpscaleCreateParams {
|
|
18
|
-
/**
|
|
19
|
-
* The model variant to use.
|
|
20
|
-
*/
|
|
21
23
|
model: 'upscale_v1';
|
|
22
24
|
/**
|
|
23
|
-
* A HTTPS URL
|
|
24
|
-
* be less than 4096px on each side. The video duration may not exceed 40 seconds.
|
|
25
|
-
* See [our docs](/assets/inputs#videos) on video inputs for more information.
|
|
25
|
+
* A HTTPS URL.
|
|
26
26
|
*/
|
|
27
27
|
videoUri: string;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-upscale.d.mts","sourceRoot":"","sources":["../src/resources/video-upscale.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,YAAa,SAAQ,WAAW;IAC3C
|
|
1
|
+
{"version":3,"file":"video-upscale.d.mts","sourceRoot":"","sources":["../src/resources/video-upscale.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,cAAc,EAAE;OAClB,EAAE,2BAA2B,EAA0B;AAE9D,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAI,EAAE,wBAAwB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,2BAA2B,CAAC,0BAA0B,CAAC;CAK3D;AAED,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,YAAY,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|