magic-hour 0.8.2 → 0.8.4
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 +39 -38
- package/dist/core/api-promise.d.ts +6 -5
- package/dist/core/api-promise.js +33 -20
- package/dist/core/auth.js +0 -1
- package/dist/core/content-type.js +4 -4
- package/dist/core/core-client.d.ts +4 -2
- package/dist/core/core-client.js +3 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/environment.d.ts +1 -1
- package/dist/environment.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/resources/v1/ai-clothes-changer/resource-client.js +0 -1
- package/dist/resources/v1/ai-headshot-generator/resource-client.js +0 -1
- package/dist/resources/v1/ai-image-generator/resource-client.js +0 -1
- package/dist/resources/v1/ai-image-upscaler/resource-client.js +0 -1
- package/dist/resources/v1/ai-photo-editor/resource-client.js +0 -1
- package/dist/resources/v1/ai-qr-code-generator/resource-client.js +0 -1
- package/dist/resources/v1/animation/resource-client.js +0 -1
- package/dist/resources/v1/face-swap/resource-client.js +0 -1
- package/dist/resources/v1/face-swap-photo/resource-client.js +0 -1
- package/dist/resources/v1/files/upload-urls/resource-client.js +0 -1
- package/dist/resources/v1/image-background-remover/resource-client.js +0 -1
- package/dist/resources/v1/image-projects/resource-client.js +1 -2
- package/dist/resources/v1/image-to-video/resource-client.js +0 -1
- package/dist/resources/v1/lip-sync/resource-client.js +0 -1
- package/dist/resources/v1/text-to-video/resource-client.js +0 -1
- package/dist/resources/v1/video-projects/resource-client.js +1 -2
- package/dist/resources/v1/video-to-video/resource-client.js +0 -1
- package/package.json +17 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Magic Hour
|
|
1
|
+
# Magic Hour Typescript SDK
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+
[](https://www.npmjs.com/package/magic-hour)
|
|
4
4
|
|
|
5
5
|
Magic Hour provides an API (beta) that can be integrated into your own application to generate videos and images using AI.
|
|
6
6
|
|
|
@@ -27,78 +27,79 @@ const client = new Client({
|
|
|
27
27
|
});
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
>
|
|
30
|
+
> [!WARNING]
|
|
31
|
+
> Any API call that renders a video will utilize frames in your account.
|
|
31
32
|
|
|
32
33
|
## Module Documentation and Snippets
|
|
33
34
|
|
|
34
|
-
### [v1.
|
|
35
|
+
### [v1.aiClothesChanger](src/resources/v1/ai-clothes-changer/README.md)
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
* [create](src/resources/v1/ai-clothes-changer/README.md#create) - AI Clothes Changer
|
|
37
38
|
|
|
38
|
-
### [v1.
|
|
39
|
+
### [v1.aiHeadshotGenerator](src/resources/v1/ai-headshot-generator/README.md)
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
* [create](src/resources/v1/ai-headshot-generator/README.md#create) - AI Headshots
|
|
41
42
|
|
|
42
|
-
### [v1.
|
|
43
|
+
### [v1.aiImageGenerator](src/resources/v1/ai-image-generator/README.md)
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
* [create](src/resources/v1/ai-image-generator/README.md#create) - AI Images
|
|
45
46
|
|
|
46
|
-
### [v1.
|
|
47
|
+
### [v1.aiImageUpscaler](src/resources/v1/ai-image-upscaler/README.md)
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
* [create](src/resources/v1/ai-image-upscaler/README.md#create) - AI Image Upscaler
|
|
49
50
|
|
|
50
|
-
### [v1.
|
|
51
|
+
### [v1.aiPhotoEditor](src/resources/v1/ai-photo-editor/README.md)
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
* [create](src/resources/v1/ai-photo-editor/README.md#create) - AI Photo Editor
|
|
53
54
|
|
|
54
|
-
### [v1.
|
|
55
|
+
### [v1.aiQrCodeGenerator](src/resources/v1/ai-qr-code-generator/README.md)
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
* [create](src/resources/v1/ai-qr-code-generator/README.md#create) - AI QR Code
|
|
57
58
|
|
|
58
59
|
### [v1.animation](src/resources/v1/animation/README.md)
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
* [create](src/resources/v1/animation/README.md#create) - Animation
|
|
61
62
|
|
|
62
|
-
### [v1.
|
|
63
|
+
### [v1.faceSwap](src/resources/v1/face-swap/README.md)
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
* [create](src/resources/v1/face-swap/README.md#create) - Face Swap video
|
|
65
66
|
|
|
66
|
-
### [v1.
|
|
67
|
+
### [v1.faceSwapPhoto](src/resources/v1/face-swap-photo/README.md)
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
* [create](src/resources/v1/face-swap-photo/README.md#create) - Face Swap Photo
|
|
69
70
|
|
|
70
|
-
### [v1.files.
|
|
71
|
+
### [v1.files.uploadUrls](src/resources/v1/files/upload-urls/README.md)
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
* [create](src/resources/v1/files/upload-urls/README.md#create) - Generate asset upload urls
|
|
73
74
|
|
|
74
|
-
### [v1.
|
|
75
|
+
### [v1.imageBackgroundRemover](src/resources/v1/image-background-remover/README.md)
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
* [create](src/resources/v1/image-background-remover/README.md#create) - Image Background Remover
|
|
77
78
|
|
|
78
|
-
### [v1.
|
|
79
|
+
### [v1.imageProjects](src/resources/v1/image-projects/README.md)
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
* [delete](src/resources/v1/image-projects/README.md#delete) - Delete image
|
|
82
|
+
* [get](src/resources/v1/image-projects/README.md#get) - Get image details
|
|
82
83
|
|
|
83
|
-
### [v1.
|
|
84
|
+
### [v1.imageToVideo](src/resources/v1/image-to-video/README.md)
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
* [create](src/resources/v1/image-to-video/README.md#create) - Image-to-Video
|
|
86
87
|
|
|
87
|
-
### [v1.
|
|
88
|
+
### [v1.lipSync](src/resources/v1/lip-sync/README.md)
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
* [create](src/resources/v1/lip-sync/README.md#create) - Lip Sync
|
|
90
91
|
|
|
91
|
-
### [v1.
|
|
92
|
+
### [v1.textToVideo](src/resources/v1/text-to-video/README.md)
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
* [create](src/resources/v1/text-to-video/README.md#create) - Text-to-Video
|
|
94
95
|
|
|
95
|
-
### [v1.
|
|
96
|
+
### [v1.videoProjects](src/resources/v1/video-projects/README.md)
|
|
96
97
|
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
* [delete](src/resources/v1/video-projects/README.md#delete) - Delete video
|
|
99
|
+
* [get](src/resources/v1/video-projects/README.md#get) - Get video details
|
|
99
100
|
|
|
100
|
-
### [v1.
|
|
101
|
+
### [v1.videoToVideo](src/resources/v1/video-to-video/README.md)
|
|
101
102
|
|
|
102
|
-
|
|
103
|
+
* [create](src/resources/v1/video-to-video/README.md#create) - Video-to-Video
|
|
103
104
|
|
|
104
105
|
<!-- MODULE DOCS END -->
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import {
|
|
3
|
-
import { ResponseType } from "./core-client";
|
|
2
|
+
import { ApiResponse } from "./core-client";
|
|
4
3
|
export interface ApiPromiseProps {
|
|
5
|
-
responsePromise: Promise<
|
|
6
|
-
|
|
4
|
+
responsePromise: Promise<ApiResponse>;
|
|
5
|
+
responseStream: boolean;
|
|
6
|
+
responseRaw: boolean;
|
|
7
7
|
responseSchema?: z.Schema | undefined;
|
|
8
8
|
}
|
|
9
9
|
export type EventSourceResponse<T> = AsyncIterableIterator<T>;
|
|
@@ -14,7 +14,8 @@ export declare class ApiPromise<T> extends Promise<T> implements AsyncIterator<T
|
|
|
14
14
|
* Gets the raw response as returned by `fetch` rather than automatically
|
|
15
15
|
* parsing the response.
|
|
16
16
|
*/
|
|
17
|
-
asResponse(): Promise<
|
|
17
|
+
asResponse(): Promise<ApiResponse>;
|
|
18
|
+
private getResponseType;
|
|
18
19
|
private parseResponse;
|
|
19
20
|
private handleNodeStream;
|
|
20
21
|
private handleWebStream;
|
package/dist/core/api-promise.js
CHANGED
|
@@ -36,6 +36,7 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.ApiPromise = void 0;
|
|
38
38
|
const binary_response_1 = require("./binary-response");
|
|
39
|
+
const content_type_1 = require("./content-type");
|
|
39
40
|
class ApiPromise extends Promise {
|
|
40
41
|
constructor(responseProps) {
|
|
41
42
|
super((resolve) => {
|
|
@@ -52,27 +53,39 @@ class ApiPromise extends Promise {
|
|
|
52
53
|
return yield this.responseProps.responsePromise;
|
|
53
54
|
});
|
|
54
55
|
}
|
|
56
|
+
getResponseType(contentType) {
|
|
57
|
+
if (content_type_1.JSON_PATTERN.test(contentType)) {
|
|
58
|
+
return "json";
|
|
59
|
+
}
|
|
60
|
+
else if (content_type_1.TEXT_PATTERN.test(contentType)) {
|
|
61
|
+
return "text";
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return "binary";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
55
67
|
parseResponse() {
|
|
56
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
|
|
69
|
+
var _a;
|
|
70
|
+
const { responsePromise, responseSchema, responseRaw } = this.responseProps;
|
|
58
71
|
const response = yield responsePromise;
|
|
59
|
-
const contentType = response.headers.get("content-type");
|
|
60
72
|
if (response.status === 204) {
|
|
61
73
|
return null;
|
|
62
74
|
}
|
|
63
|
-
else if (
|
|
64
|
-
return
|
|
75
|
+
else if (responseRaw) {
|
|
76
|
+
return response;
|
|
65
77
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
const contentType = (_a = response.headers.get("content-type")) !== null && _a !== void 0 ? _a : "";
|
|
79
|
+
switch (this.getResponseType(contentType)) {
|
|
80
|
+
case "json":
|
|
81
|
+
const rawJson = yield response.json();
|
|
82
|
+
return responseSchema ? responseSchema.parse(rawJson) : rawJson;
|
|
83
|
+
case "text":
|
|
84
|
+
return (yield response.text());
|
|
85
|
+
case "binary":
|
|
86
|
+
default:
|
|
87
|
+
return new binary_response_1.BinaryResponse(yield response.blob(), contentType);
|
|
73
88
|
}
|
|
74
|
-
// fall back on text
|
|
75
|
-
return (yield response.text());
|
|
76
89
|
});
|
|
77
90
|
}
|
|
78
91
|
handleNodeStream(stream) {
|
|
@@ -133,8 +146,8 @@ class ApiPromise extends Promise {
|
|
|
133
146
|
}
|
|
134
147
|
asEventStream() {
|
|
135
148
|
return __asyncGenerator(this, arguments, function* asEventStream_1() {
|
|
136
|
-
const { responsePromise,
|
|
137
|
-
if (
|
|
149
|
+
const { responsePromise, responseStream } = this.responseProps;
|
|
150
|
+
if (!responseStream) {
|
|
138
151
|
throw new Error("Response is not an event stream");
|
|
139
152
|
}
|
|
140
153
|
const response = yield __await(responsePromise);
|
|
@@ -152,8 +165,8 @@ class ApiPromise extends Promise {
|
|
|
152
165
|
}
|
|
153
166
|
next() {
|
|
154
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
-
const {
|
|
156
|
-
if (
|
|
168
|
+
const { responseStream } = this.responseProps;
|
|
169
|
+
if (responseStream) {
|
|
157
170
|
const iterator = this.asEventStream();
|
|
158
171
|
const result = yield iterator.next();
|
|
159
172
|
return result;
|
|
@@ -165,8 +178,8 @@ class ApiPromise extends Promise {
|
|
|
165
178
|
[Symbol.asyncIterator]() {
|
|
166
179
|
const iterator = {
|
|
167
180
|
next: () => __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
const {
|
|
169
|
-
if (
|
|
181
|
+
const { responseStream } = this.responseProps;
|
|
182
|
+
if (responseStream) {
|
|
170
183
|
const stream = this.asEventStream();
|
|
171
184
|
return stream.next();
|
|
172
185
|
}
|
|
@@ -177,7 +190,7 @@ class ApiPromise extends Promise {
|
|
|
177
190
|
return iterator;
|
|
178
191
|
}
|
|
179
192
|
then(onfulfilled, onrejected) {
|
|
180
|
-
if (this.responseProps.
|
|
193
|
+
if (this.responseProps.responseStream) {
|
|
181
194
|
return Promise.resolve(this.asEventStream());
|
|
182
195
|
}
|
|
183
196
|
return this.parseResponse().then(onfulfilled, onrejected);
|
package/dist/core/auth.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.URL_FORM = exports.MULTIPART_FORM = exports.TEXT_PATTERN = exports.JSON_PATTERN = void 0;
|
|
4
4
|
// use a pattern to match json content type to handle
|
|
5
|
-
// base case of application/json as well as vendor
|
|
5
|
+
// base case of application/json as well as vendor specific
|
|
6
6
|
// headers e.g. application/vnd.github+json
|
|
7
|
-
exports.JSON_PATTERN =
|
|
7
|
+
exports.JSON_PATTERN = /^application\/(.+\+)?json/;
|
|
8
8
|
// use a pattern to match text types to handle base case
|
|
9
|
-
// of text/plain as well as more
|
|
10
|
-
exports.TEXT_PATTERN =
|
|
9
|
+
// of text/plain as well as more specific cases e.g. text/html
|
|
10
|
+
exports.TEXT_PATTERN = /^text\/(.+)/;
|
|
11
11
|
exports.MULTIPART_FORM = "multipart/form-data";
|
|
12
12
|
exports.URL_FORM = "application/x-www-form-urlencoded";
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { Response as NodeResponse } from "node-fetch";
|
|
2
3
|
import { AuthProvider } from "./auth";
|
|
3
4
|
import { ApiPromise } from "./api-promise";
|
|
4
5
|
export interface CoreClientProps {
|
|
5
6
|
baseUrl: string;
|
|
6
7
|
timeout?: number | undefined;
|
|
7
8
|
}
|
|
9
|
+
export type ApiResponse = Response | NodeResponse;
|
|
8
10
|
export type HttpMethod = "get" | "post" | "put" | "patch" | "delete";
|
|
9
|
-
export type ResponseType = "json" | "blob" | "unknown" | "event-stream";
|
|
10
11
|
export type RequestConfig = {
|
|
11
12
|
method: HttpMethod;
|
|
12
13
|
path: string;
|
|
13
|
-
responseType: ResponseType;
|
|
14
14
|
responseSchema?: z.Schema;
|
|
15
|
+
responseStream?: boolean;
|
|
16
|
+
responseRaw?: boolean;
|
|
15
17
|
auth?: string[];
|
|
16
18
|
query?: string[];
|
|
17
19
|
body?: any;
|
package/dist/core/core-client.js
CHANGED
|
@@ -143,9 +143,11 @@ class CoreClient {
|
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
makeRequest(cfg) {
|
|
146
|
+
var _a, _b;
|
|
146
147
|
return new api_promise_1.ApiPromise({
|
|
147
148
|
responsePromise: this.request(cfg),
|
|
148
|
-
|
|
149
|
+
responseRaw: (_a = cfg.responseRaw) !== null && _a !== void 0 ? _a : false,
|
|
150
|
+
responseStream: (_b = cfg.responseStream) !== null && _b !== void 0 ? _b : false,
|
|
149
151
|
responseSchema: cfg.responseSchema,
|
|
150
152
|
});
|
|
151
153
|
}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CoreClient, CoreClientProps, CoreResourceClient, RequestOptions, } from "./core-client";
|
|
1
|
+
export { ApiResponse, CoreClient, CoreClientProps, CoreResourceClient, RequestOptions, } from "./core-client";
|
|
2
2
|
export { AuthProvider, AuthBasic, AuthBearer, AuthKeyQuery, AuthKeyHeader, AuthCookieHeader, OAuth2, OAuth2PasswordProps, OAuth2ClientCredentialsProps, } from "./auth";
|
|
3
3
|
export { RUNTIME } from "./runtime";
|
|
4
4
|
export { ApiPromise, EventSourceResponse } from "./api-promise";
|
package/dist/environment.d.ts
CHANGED
package/dist/environment.js
CHANGED
|
@@ -4,5 +4,5 @@ exports.Environment = void 0;
|
|
|
4
4
|
var Environment;
|
|
5
5
|
(function (Environment) {
|
|
6
6
|
Environment["Environment"] = "https://api.magichour.ai";
|
|
7
|
-
Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.8.
|
|
7
|
+
Environment["MockServer"] = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.8.3";
|
|
8
8
|
})(Environment || (exports.Environment = Environment = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Client as default } from "./client";
|
|
2
|
-
export { ApiError, BinaryResponse, RequestOptions, UploadFile, isUploadFile, } from "./core";
|
|
2
|
+
export { ApiError, ApiResponse, BinaryResponse, RequestOptions, UploadFile, isUploadFile, } from "./core";
|
|
3
3
|
export { Environment } from "./environment";
|
|
4
4
|
export * as resources from "./resources";
|
|
5
5
|
export * as types from "./types";
|
|
@@ -22,7 +22,6 @@ class AiClothesChangerClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_ai_clothes_changer_body_1.Schemas$PostV1AiClothesChangerBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_ai_clothes_changer_response_1.Schemas$PostV1AiClothesChangerResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -22,7 +22,6 @@ class AiHeadshotGeneratorClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_ai_headshot_generator_body_1.Schemas$PostV1AiHeadshotGeneratorBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_ai_headshot_generator_response_1.Schemas$PostV1AiHeadshotGeneratorResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -22,7 +22,6 @@ class AiImageGeneratorClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_ai_image_generator_body_1.Schemas$PostV1AiImageGeneratorBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_ai_image_generator_response_1.Schemas$PostV1AiImageGeneratorResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -22,7 +22,6 @@ class AiImageUpscalerClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_ai_image_upscaler_body_1.Schemas$PostV1AiImageUpscalerBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_ai_image_upscaler_response_1.Schemas$PostV1AiImageUpscalerResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -24,7 +24,6 @@ class AiPhotoEditorClient extends core_1.CoreResourceClient {
|
|
|
24
24
|
auth: ["bearerAuth"],
|
|
25
25
|
contentType: "application/json",
|
|
26
26
|
body: post_v1_ai_photo_editor_body_1.Schemas$PostV1AiPhotoEditorBody.out.parse(request),
|
|
27
|
-
responseType: "json",
|
|
28
27
|
responseSchema: post_v1_ai_photo_editor_response_1.Schemas$PostV1AiPhotoEditorResponse.in,
|
|
29
28
|
opts,
|
|
30
29
|
});
|
|
@@ -22,7 +22,6 @@ class AiQrCodeGeneratorClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_ai_qr_code_generator_body_1.Schemas$PostV1AiQrCodeGeneratorBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_ai_qr_code_generator_response_1.Schemas$PostV1AiQrCodeGeneratorResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -22,7 +22,6 @@ class AnimationClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_animation_body_1.Schemas$PostV1AnimationBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_animation_response_1.Schemas$PostV1AnimationResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -25,7 +25,6 @@ class FaceSwapClient extends core_1.CoreResourceClient {
|
|
|
25
25
|
auth: ["bearerAuth"],
|
|
26
26
|
contentType: "application/json",
|
|
27
27
|
body: post_v1_face_swap_body_1.Schemas$PostV1FaceSwapBody.out.parse(request),
|
|
28
|
-
responseType: "json",
|
|
29
28
|
responseSchema: post_v1_face_swap_response_1.Schemas$PostV1FaceSwapResponse.in,
|
|
30
29
|
opts,
|
|
31
30
|
});
|
|
@@ -22,7 +22,6 @@ class FaceSwapPhotoClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_face_swap_photo_body_1.Schemas$PostV1FaceSwapPhotoBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_face_swap_photo_response_1.Schemas$PostV1FaceSwapPhotoResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -41,7 +41,6 @@ class UploadUrlsClient extends core_1.CoreResourceClient {
|
|
|
41
41
|
auth: ["bearerAuth"],
|
|
42
42
|
contentType: "application/json",
|
|
43
43
|
body: post_v1_files_upload_urls_body_1.Schemas$PostV1FilesUploadUrlsBody.out.parse(request),
|
|
44
|
-
responseType: "json",
|
|
45
44
|
responseSchema: post_v1_files_upload_urls_response_1.Schemas$PostV1FilesUploadUrlsResponse.in,
|
|
46
45
|
opts,
|
|
47
46
|
});
|
|
@@ -22,7 +22,6 @@ class ImageBackgroundRemoverClient extends core_1.CoreResourceClient {
|
|
|
22
22
|
auth: ["bearerAuth"],
|
|
23
23
|
contentType: "application/json",
|
|
24
24
|
body: post_v1_image_background_remover_body_1.Schemas$PostV1ImageBackgroundRemoverBody.out.parse(request),
|
|
25
|
-
responseType: "json",
|
|
26
25
|
responseSchema: post_v1_image_background_remover_response_1.Schemas$PostV1ImageBackgroundRemoverResponse.in,
|
|
27
26
|
opts,
|
|
28
27
|
});
|
|
@@ -28,7 +28,6 @@ class ImageProjectsClient extends core_1.CoreResourceClient {
|
|
|
28
28
|
method: "get",
|
|
29
29
|
path: `/v1/image-projects/${request.id}`,
|
|
30
30
|
auth: ["bearerAuth"],
|
|
31
|
-
responseType: "json",
|
|
32
31
|
responseSchema: get_v1_image_projects_id_response_1.Schemas$GetV1ImageProjectsIdResponse.in,
|
|
33
32
|
opts,
|
|
34
33
|
});
|
|
@@ -45,7 +44,7 @@ class ImageProjectsClient extends core_1.CoreResourceClient {
|
|
|
45
44
|
method: "delete",
|
|
46
45
|
path: `/v1/image-projects/${request.id}`,
|
|
47
46
|
auth: ["bearerAuth"],
|
|
48
|
-
|
|
47
|
+
responseRaw: true,
|
|
49
48
|
opts,
|
|
50
49
|
});
|
|
51
50
|
}
|
|
@@ -25,7 +25,6 @@ class ImageToVideoClient extends core_1.CoreResourceClient {
|
|
|
25
25
|
auth: ["bearerAuth"],
|
|
26
26
|
contentType: "application/json",
|
|
27
27
|
body: post_v1_image_to_video_body_1.Schemas$PostV1ImageToVideoBody.out.parse(request),
|
|
28
|
-
responseType: "json",
|
|
29
28
|
responseSchema: post_v1_image_to_video_response_1.Schemas$PostV1ImageToVideoResponse.in,
|
|
30
29
|
opts,
|
|
31
30
|
});
|
|
@@ -25,7 +25,6 @@ class LipSyncClient extends core_1.CoreResourceClient {
|
|
|
25
25
|
auth: ["bearerAuth"],
|
|
26
26
|
contentType: "application/json",
|
|
27
27
|
body: post_v1_lip_sync_body_1.Schemas$PostV1LipSyncBody.out.parse(request),
|
|
28
|
-
responseType: "json",
|
|
29
28
|
responseSchema: post_v1_lip_sync_response_1.Schemas$PostV1LipSyncResponse.in,
|
|
30
29
|
opts,
|
|
31
30
|
});
|
|
@@ -25,7 +25,6 @@ class TextToVideoClient extends core_1.CoreResourceClient {
|
|
|
25
25
|
auth: ["bearerAuth"],
|
|
26
26
|
contentType: "application/json",
|
|
27
27
|
body: post_v1_text_to_video_body_1.Schemas$PostV1TextToVideoBody.out.parse(request),
|
|
28
|
-
responseType: "json",
|
|
29
28
|
responseSchema: post_v1_text_to_video_response_1.Schemas$PostV1TextToVideoResponse.in,
|
|
30
29
|
opts,
|
|
31
30
|
});
|
|
@@ -28,7 +28,6 @@ class VideoProjectsClient extends core_1.CoreResourceClient {
|
|
|
28
28
|
method: "get",
|
|
29
29
|
path: `/v1/video-projects/${request.id}`,
|
|
30
30
|
auth: ["bearerAuth"],
|
|
31
|
-
responseType: "json",
|
|
32
31
|
responseSchema: get_v1_video_projects_id_response_1.Schemas$GetV1VideoProjectsIdResponse.in,
|
|
33
32
|
opts,
|
|
34
33
|
});
|
|
@@ -45,7 +44,7 @@ class VideoProjectsClient extends core_1.CoreResourceClient {
|
|
|
45
44
|
method: "delete",
|
|
46
45
|
path: `/v1/video-projects/${request.id}`,
|
|
47
46
|
auth: ["bearerAuth"],
|
|
48
|
-
|
|
47
|
+
responseRaw: true,
|
|
49
48
|
opts,
|
|
50
49
|
});
|
|
51
50
|
}
|
|
@@ -25,7 +25,6 @@ class VideoToVideoClient extends core_1.CoreResourceClient {
|
|
|
25
25
|
auth: ["bearerAuth"],
|
|
26
26
|
contentType: "application/json",
|
|
27
27
|
body: post_v1_video_to_video_body_1.Schemas$PostV1VideoToVideoBody.out.parse(request),
|
|
28
|
-
responseType: "json",
|
|
29
28
|
responseSchema: post_v1_video_to_video_response_1.Schemas$PostV1VideoToVideoResponse.in,
|
|
30
29
|
opts,
|
|
31
30
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magic-hour",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -45,5 +45,19 @@
|
|
|
45
45
|
"ts-node": "^10.9.2",
|
|
46
46
|
"tsc-alias": "^1.8.10",
|
|
47
47
|
"typescript": "^5.2.0"
|
|
48
|
-
}
|
|
49
|
-
|
|
48
|
+
},
|
|
49
|
+
"description": "Node SDK for Magic Hour API",
|
|
50
|
+
"keywords": [
|
|
51
|
+
"magic hour",
|
|
52
|
+
"AI video",
|
|
53
|
+
"AI image",
|
|
54
|
+
"api"
|
|
55
|
+
],
|
|
56
|
+
"homepage": "https://github.com/magichourhq/magic-hour-node",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "git://github.com/magichourhq/magic-hour-node.git"
|
|
60
|
+
},
|
|
61
|
+
"bugs": "https://github.com/magichourhq/magic-hour-node/issues",
|
|
62
|
+
"license": "MIT"
|
|
63
|
+
}
|