magic-hour 0.87.0 → 0.89.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.
Files changed (66) hide show
  1. package/README.md +4 -0
  2. package/dist/environment.d.ts +1 -1
  3. package/dist/environment.js +1 -1
  4. package/dist/resources/v1/ai-headshot-generator/resource-client.d.ts +1 -1
  5. package/dist/resources/v1/ai-headshot-generator/resource-client.js +1 -1
  6. package/dist/resources/v1/ai-image-generator/request-types.d.ts +7 -2
  7. package/dist/resources/v1/ai-image-generator/request-types.js +2 -0
  8. package/dist/resources/v1/ai-video-editor/request-types.d.ts +11 -3
  9. package/dist/resources/v1/ai-video-editor/request-types.js +11 -2
  10. package/dist/resources/v1/face-detection/resource-client.d.ts +4 -0
  11. package/dist/resources/v1/face-detection/resource-client.js +2 -0
  12. package/dist/resources/v1/image-to-video/request-types.d.ts +1 -1
  13. package/dist/resources/v1/index.d.ts +1 -0
  14. package/dist/resources/v1/index.js +2 -1
  15. package/dist/resources/v1/resource-client.d.ts +3 -0
  16. package/dist/resources/v1/resource-client.js +5 -0
  17. package/dist/resources/v1/text-to-video/request-types.d.ts +5 -3
  18. package/dist/resources/v1/video-to-video/request-types.d.ts +7 -6
  19. package/dist/resources/v1/video-to-video/request-types.js +4 -0
  20. package/dist/resources/v1/video-to-video/resource-client.d.ts +6 -0
  21. package/dist/resources/v1/video-to-video/resource-client.js +6 -0
  22. package/dist/resources/v1/voices/index.d.ts +2 -0
  23. package/dist/resources/v1/voices/index.js +5 -0
  24. package/dist/resources/v1/voices/request-types.d.ts +27 -0
  25. package/dist/resources/v1/voices/request-types.js +71 -0
  26. package/dist/resources/v1/voices/resource-client.d.ts +14 -0
  27. package/dist/resources/v1/voices/resource-client.js +75 -0
  28. package/dist/types/index.d.ts +6 -0
  29. package/dist/types/v1-ai-image-generator-create-body-model-enum.d.ts +5 -1
  30. package/dist/types/v1-ai-image-generator-create-body-resolution-enum.d.ts +1 -0
  31. package/dist/types/v1-ai-image-generator-create-body.d.ts +7 -2
  32. package/dist/types/v1-ai-image-generator-create-body.js +2 -0
  33. package/dist/types/v1-ai-video-editor-create-body-references-item.d.ts +29 -0
  34. package/dist/types/v1-ai-video-editor-create-body-references-item.js +71 -0
  35. package/dist/types/v1-ai-video-editor-create-body-resolution-enum.d.ts +2 -2
  36. package/dist/types/v1-ai-video-editor-create-body.d.ts +11 -3
  37. package/dist/types/v1-ai-video-editor-create-body.js +11 -2
  38. package/dist/types/v1-ai-voice-cloner-create-body-style-language-enum.d.ts +4 -0
  39. package/dist/types/v1-ai-voice-cloner-create-body-style-language-enum.js +2 -0
  40. package/dist/types/v1-ai-voice-cloner-create-body-style.d.ts +11 -1
  41. package/dist/types/v1-ai-voice-cloner-create-body-style.js +178 -0
  42. package/dist/types/v1-ai-voice-generator-create-body-style-language-enum.d.ts +4 -0
  43. package/dist/types/v1-ai-voice-generator-create-body-style-language-enum.js +2 -0
  44. package/dist/types/v1-ai-voice-generator-create-body-style-voice-name-enum.d.ts +2 -2
  45. package/dist/types/v1-ai-voice-generator-create-body-style.d.ts +14 -4
  46. package/dist/types/v1-ai-voice-generator-create-body-style.js +1150 -6
  47. package/dist/types/v1-face-detection-get-response-error.d.ts +27 -0
  48. package/dist/types/v1-face-detection-get-response-error.js +71 -0
  49. package/dist/types/v1-face-detection-get-response.d.ts +6 -0
  50. package/dist/types/v1-face-detection-get-response.js +5 -0
  51. package/dist/types/v1-image-to-video-create-body.d.ts +1 -1
  52. package/dist/types/v1-text-to-video-create-body.d.ts +5 -3
  53. package/dist/types/v1-video-to-video-create-body-assets.d.ts +5 -0
  54. package/dist/types/v1-video-to-video-create-body-assets.js +4 -0
  55. package/dist/types/v1-video-to-video-create-body-style-art-style-enum.d.ts +1 -1
  56. package/dist/types/v1-video-to-video-create-body-style-model-enum.d.ts +2 -1
  57. package/dist/types/v1-video-to-video-create-body-style-version-enum.d.ts +3 -2
  58. package/dist/types/v1-video-to-video-create-body-style.d.ts +9 -7
  59. package/dist/types/v1-video-to-video-create-body-style.js +688 -2
  60. package/dist/types/v1-video-to-video-create-body.d.ts +7 -6
  61. package/dist/types/v1-video-to-video-create-body.js +4 -0
  62. package/dist/types/v1-voices-list-response-voices-item.d.ts +37 -0
  63. package/dist/types/v1-voices-list-response-voices-item.js +79 -0
  64. package/dist/types/v1-voices-list-response.d.ts +25 -0
  65. package/dist/types/v1-voices-list-response.js +72 -0
  66. package/package.json +1 -1
@@ -13,6 +13,10 @@ export type V1VideoToVideoCreateBody = {
13
13
  * End time of your clip (seconds). Must be greater than start_seconds.
14
14
  */
15
15
  endSeconds: number;
16
+ /**
17
+ * Source video FPS for v3 frame limits and estimated credits. Defaults to 30; final charges settle to rendered frames.
18
+ */
19
+ fps?: number | undefined;
16
20
  /**
17
21
  * Determines whether the resulting video will have the same frame per second as the original video, or half.
18
22
  * * `FULL` - the result video will have the same FPS as the input video
@@ -20,9 +24,7 @@ export type V1VideoToVideoCreateBody = {
20
24
  */
21
25
  fpsResolution?: ("FULL" | "HALF") | undefined;
22
26
  /**
23
- * `height` is deprecated and no longer influences the output video's resolution.
24
- *
25
- * This field is retained only for backward compatibility and will be removed in a future release.
27
+ * Source video height in integer pixels. Required and positive for v3; ignored for v1/v2.
26
28
  */
27
29
  height?: number | null | undefined;
28
30
  /**
@@ -35,9 +37,7 @@ export type V1VideoToVideoCreateBody = {
35
37
  startSeconds: number;
36
38
  style: V1VideoToVideoCreateBodyStyle;
37
39
  /**
38
- * `width` is deprecated and no longer influences the output video's resolution.
39
- *
40
- * This field is retained only for backward compatibility and will be removed in a future release.
40
+ * Source video width in integer pixels. Required and positive for v3; ignored for v1/v2.
41
41
  */
42
42
  width?: number | null | undefined;
43
43
  };
@@ -49,6 +49,7 @@ export type V1VideoToVideoCreateBody = {
49
49
  export type External$V1VideoToVideoCreateBody = {
50
50
  assets: External$V1VideoToVideoCreateBodyAssets;
51
51
  end_seconds: number;
52
+ fps?: number | undefined;
52
53
  fps_resolution?: ("FULL" | "HALF") | undefined;
53
54
  height?: number | null | undefined;
54
55
  name?: string | undefined;
@@ -45,6 +45,7 @@ const SchemaIn$V1VideoToVideoCreateBody = z
45
45
  .object({
46
46
  assets: v1_video_to_video_create_body_assets_1.Schemas$V1VideoToVideoCreateBodyAssets.in,
47
47
  end_seconds: z.number(),
48
+ fps: z.number().optional(),
48
49
  fps_resolution: z.enum(["FULL", "HALF"]).optional(),
49
50
  height: z.number().int().nullable().optional(),
50
51
  name: z.string().optional(),
@@ -56,6 +57,7 @@ const SchemaIn$V1VideoToVideoCreateBody = z
56
57
  return (0, make_api_request_js_1.zodTransform)(obj, {
57
58
  assets: "assets",
58
59
  end_seconds: "endSeconds",
60
+ fps: "fps",
59
61
  fps_resolution: "fpsResolution",
60
62
  height: "height",
61
63
  name: "name",
@@ -72,6 +74,7 @@ const SchemaOut$V1VideoToVideoCreateBody = z
72
74
  .object({
73
75
  assets: v1_video_to_video_create_body_assets_1.Schemas$V1VideoToVideoCreateBodyAssets.out,
74
76
  endSeconds: z.number(),
77
+ fps: z.number().optional(),
75
78
  fpsResolution: z.enum(["FULL", "HALF"]).optional(),
76
79
  height: z.number().int().nullable().optional(),
77
80
  name: z.string().optional(),
@@ -83,6 +86,7 @@ const SchemaOut$V1VideoToVideoCreateBody = z
83
86
  return (0, make_api_request_js_1.zodTransform)(obj, {
84
87
  assets: "assets",
85
88
  endSeconds: "end_seconds",
89
+ fps: "fps",
86
90
  fpsResolution: "fps_resolution",
87
91
  height: "height",
88
92
  name: "name",
@@ -0,0 +1,37 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * V1VoicesListResponseVoicesItem
4
+ */
5
+ export type V1VoicesListResponseVoicesItem = {
6
+ /**
7
+ * URL of the voice's avatar image, or null when the voice has no avatar.
8
+ */
9
+ avatarUrl: string | null;
10
+ /**
11
+ * Unique ID of the voice. Pass it as `style.voice_name` when generating speech. Names are not unique, so use the ID.
12
+ */
13
+ id: string;
14
+ /**
15
+ * Display name of the voice.
16
+ */
17
+ name: string;
18
+ /**
19
+ * URL of an audio sample of the voice.
20
+ */
21
+ previewUrl: string;
22
+ };
23
+ /**
24
+ * @internal
25
+ * V1VoicesListResponseVoicesItem without any key transformation, this is what
26
+ * we expect to come in as network data
27
+ */
28
+ export type External$V1VoicesListResponseVoicesItem = {
29
+ avatar_url: string | null;
30
+ id: string;
31
+ name: string;
32
+ preview_url: string;
33
+ };
34
+ export declare const Schemas$V1VoicesListResponseVoicesItem: {
35
+ in: z.ZodType<V1VoicesListResponseVoicesItem, z.ZodTypeDef, unknown>;
36
+ out: z.ZodType<External$V1VoicesListResponseVoicesItem, z.ZodTypeDef, V1VoicesListResponseVoicesItem>;
37
+ };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1VoicesListResponseVoicesItem = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ /**
40
+ * Takes network data, validates it, and transforms keys to match typescript object V1VoicesListResponseVoicesItem
41
+ */
42
+ const SchemaIn$V1VoicesListResponseVoicesItem = z
43
+ .object({
44
+ avatar_url: z.string().nullable(),
45
+ id: z.string(),
46
+ name: z.string(),
47
+ preview_url: z.string(),
48
+ })
49
+ .transform((obj) => {
50
+ return (0, make_api_request_js_1.zodTransform)(obj, {
51
+ avatar_url: "avatarUrl",
52
+ id: "id",
53
+ name: "name",
54
+ preview_url: "previewUrl",
55
+ });
56
+ });
57
+ /**
58
+ * @internal
59
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1VoicesListResponseVoicesItem
60
+ */
61
+ const SchemaOut$V1VoicesListResponseVoicesItem = z
62
+ .object({
63
+ avatarUrl: z.string().nullable(),
64
+ id: z.string(),
65
+ name: z.string(),
66
+ previewUrl: z.string(),
67
+ })
68
+ .transform((obj) => {
69
+ return (0, make_api_request_js_1.zodTransform)(obj, {
70
+ avatarUrl: "avatar_url",
71
+ id: "id",
72
+ name: "name",
73
+ previewUrl: "preview_url",
74
+ });
75
+ });
76
+ exports.Schemas$V1VoicesListResponseVoicesItem = {
77
+ in: SchemaIn$V1VoicesListResponseVoicesItem,
78
+ out: SchemaOut$V1VoicesListResponseVoicesItem,
79
+ };
@@ -0,0 +1,25 @@
1
+ import * as z from "zod";
2
+ import { External$V1VoicesListResponseVoicesItem, V1VoicesListResponseVoicesItem } from "./v1-voices-list-response-voices-item";
3
+ /**
4
+ * V1VoicesListResponse
5
+ */
6
+ export type V1VoicesListResponse = {
7
+ /**
8
+ * Cursor for the next page, or null when there are no more voices.
9
+ */
10
+ nextCursor: string | null;
11
+ voices: V1VoicesListResponseVoicesItem[];
12
+ };
13
+ /**
14
+ * @internal
15
+ * V1VoicesListResponse without any key transformation, this is what
16
+ * we expect to come in as network data
17
+ */
18
+ export type External$V1VoicesListResponse = {
19
+ next_cursor: string | null;
20
+ voices: External$V1VoicesListResponseVoicesItem[];
21
+ };
22
+ export declare const Schemas$V1VoicesListResponse: {
23
+ in: z.ZodType<V1VoicesListResponse, z.ZodTypeDef, unknown>;
24
+ out: z.ZodType<External$V1VoicesListResponse, z.ZodTypeDef, V1VoicesListResponse>;
25
+ };
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Schemas$V1VoicesListResponse = void 0;
37
+ const make_api_request_js_1 = require("make-api-request-js");
38
+ const z = __importStar(require("zod"));
39
+ const v1_voices_list_response_voices_item_1 = require("./v1-voices-list-response-voices-item");
40
+ /**
41
+ * Takes network data, validates it, and transforms keys to match typescript object V1VoicesListResponse
42
+ */
43
+ const SchemaIn$V1VoicesListResponse = z
44
+ .object({
45
+ next_cursor: z.string().nullable(),
46
+ voices: z.array(v1_voices_list_response_voices_item_1.Schemas$V1VoicesListResponseVoicesItem.in),
47
+ })
48
+ .transform((obj) => {
49
+ return (0, make_api_request_js_1.zodTransform)(obj, {
50
+ next_cursor: "nextCursor",
51
+ voices: "voices",
52
+ });
53
+ });
54
+ /**
55
+ * @internal
56
+ * Takes typescript data, validates it, and maps keys to match the expected external object External$V1VoicesListResponse
57
+ */
58
+ const SchemaOut$V1VoicesListResponse = z
59
+ .object({
60
+ nextCursor: z.string().nullable(),
61
+ voices: z.array(v1_voices_list_response_voices_item_1.Schemas$V1VoicesListResponseVoicesItem.out),
62
+ })
63
+ .transform((obj) => {
64
+ return (0, make_api_request_js_1.zodTransform)(obj, {
65
+ nextCursor: "next_cursor",
66
+ voices: "voices",
67
+ });
68
+ });
69
+ exports.Schemas$V1VoicesListResponse = {
70
+ in: SchemaIn$V1VoicesListResponse,
71
+ out: SchemaOut$V1VoicesListResponse,
72
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magic-hour",
3
- "version": "0.87.0",
3
+ "version": "0.89.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {