@runapi.ai/happyhorse 0.2.4 → 0.2.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # HappyHorse API JavaScript SDK for RunAPI
2
2
 
3
- The happyhorse ai api JavaScript SDK is the language-specific package for HappyHorse on RunAPI. Use this package for text, image, reference-to-video, and edit-video workflows that need JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
3
+ The happyhorse ai api JavaScript SDK is the language-specific package for HappyHorse on RunAPI. Use this package for text, image, and edit-video workflows that need JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
4
4
 
5
5
  ## Install
6
6
 
@@ -15,15 +15,16 @@ import { HappyHorseClient } from '@runapi.ai/happyhorse';
15
15
 
16
16
  const client = new HappyHorseClient();
17
17
  const video = await client.textToVideo.run({
18
- model: 'happyhorse-text-to-video',
19
- prompt: 'A tiny paper horse gallops through a miniature cardboard city at night.',
20
- resolution: '1080p',
18
+ model: 'happyhorse-character',
19
+ prompt: 'Character1 walks through a miniature cardboard city at night.',
20
+ reference_image_urls: ['https://cdn.runapi.ai/public/samples/reference-1.jpg'],
21
+ output_resolution: '1080p',
21
22
  aspect_ratio: '16:9',
22
- duration: 5,
23
+ duration_seconds: 5,
23
24
  });
24
25
  ```
25
26
 
26
- For image-to-video, call `client.imageToVideo.run` with `model: 'happyhorse-image-to-video'` and exactly one `image_urls` entry. For reference-to-video, call `client.referenceToVideo.run` with `model: 'happyhorse-reference-to-video'` and 1-9 `reference_image` entries. For edit-video, call `client.editVideo.run` with `model: 'happyhorse-video-edit'`, one `video_url`, and optional `reference_image` entries.
27
+ For image-to-video, call `client.imageToVideo.run` with `model: 'happyhorse-image-to-video'` and exactly one `image_urls` entry. For character-guided text-to-video, call `client.textToVideo.run` with `model: 'happyhorse-character'` and 1-9 `reference_image_urls` entries. For edit-video, call `client.editVideo.run` with `model: 'happyhorse-edit-video'`, one `video_url`, and optional `reference_image` entries.
27
28
 
28
29
  ## Links
29
30
 
@@ -31,8 +32,8 @@ For image-to-video, call `client.imageToVideo.run` with `model: 'happyhorse-imag
31
32
  - SDK docs: https://runapi.ai/docs#sdk-happyhorse
32
33
  - Product docs: https://runapi.ai/docs#happyhorse
33
34
  - Image-to-video pricing and rate limits: https://runapi.ai/models/happyhorse/image-to-video
34
- - Reference-to-video pricing and rate limits: https://runapi.ai/models/happyhorse/reference-to-video
35
- - Edit-video pricing and rate limits: https://runapi.ai/models/happyhorse/video-edit
35
+ - Character pricing and rate limits: https://runapi.ai/models/happyhorse/character
36
+ - Edit-video pricing and rate limits: https://runapi.ai/models/happyhorse/edit-video
36
37
  - Pricing and rate limits: https://runapi.ai/models/happyhorse/text-to-video
37
38
  - Provider comparison: https://runapi.ai/providers/alibaba
38
39
  - Full catalog: https://runapi.ai/models
package/dist/index.d.mts CHANGED
@@ -1,47 +1,37 @@
1
1
  import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- type HappyHorseTextToVideoModel = 'happyhorse-text-to-video';
4
+ type HappyHorseTextToVideoModel = 'happyhorse-text-to-video' | 'happyhorse-character';
5
5
  type HappyHorseImageToVideoModel = 'happyhorse-image-to-video';
6
- type HappyHorseReferenceToVideoModel = 'happyhorse-reference-to-video';
7
- type HappyHorseEditVideoModel = 'happyhorse-video-edit';
8
- type HappyHorseResolution = '720p' | '1080p';
6
+ type HappyHorseEditVideoModel = 'happyhorse-edit-video';
7
+ type HappyHorseOutputResolution = '720p' | '1080p';
9
8
  type HappyHorseAspectRatio = '16:9' | '9:16' | '1:1' | '4:3' | '3:4';
10
- type HappyHorseAudioSetting = 'auto' | 'origin';
9
+ type HappyHorseAudioSetting = 'auto' | 'original';
11
10
  interface TextToVideoParams {
12
11
  model: HappyHorseTextToVideoModel;
13
12
  prompt: string;
14
- resolution?: HappyHorseResolution;
13
+ reference_image_urls?: string[];
14
+ output_resolution?: HappyHorseOutputResolution;
15
15
  aspect_ratio?: HappyHorseAspectRatio;
16
- duration?: number;
16
+ duration_seconds?: number;
17
17
  seed?: number;
18
18
  callback_url?: string;
19
19
  }
20
20
  interface ImageToVideoParams {
21
21
  model: HappyHorseImageToVideoModel;
22
- image_urls: string[];
22
+ first_frame_image_url: string;
23
23
  prompt?: string;
24
- resolution?: HappyHorseResolution;
25
- duration?: number;
26
- seed?: number;
27
- callback_url?: string;
28
- }
29
- interface ReferenceToVideoParams {
30
- model: HappyHorseReferenceToVideoModel;
31
- prompt: string;
32
- reference_image: string[];
33
- resolution?: HappyHorseResolution;
34
- aspect_ratio?: HappyHorseAspectRatio;
35
- duration?: number;
24
+ output_resolution?: HappyHorseOutputResolution;
25
+ duration_seconds?: number;
36
26
  seed?: number;
37
27
  callback_url?: string;
38
28
  }
39
29
  interface EditVideoParams {
40
30
  model: HappyHorseEditVideoModel;
41
31
  prompt: string;
42
- video_url: string;
43
- reference_image?: string[];
44
- resolution?: HappyHorseResolution;
32
+ source_video_url: string;
33
+ reference_image_urls?: string[];
34
+ output_resolution?: HappyHorseOutputResolution;
45
35
  audio_setting?: HappyHorseAudioSetting;
46
36
  seed?: number;
47
37
  callback_url?: string;
@@ -69,11 +59,6 @@ type CompletedImageToVideoResponse = ImageToVideoResponse & {
69
59
  status: 'completed';
70
60
  videos: Video[];
71
61
  };
72
- type ReferenceToVideoResponse = TextToVideoResponse;
73
- type CompletedReferenceToVideoResponse = ReferenceToVideoResponse & {
74
- status: 'completed';
75
- videos: Video[];
76
- };
77
62
  type EditVideoResponse = TextToVideoResponse;
78
63
  type CompletedEditVideoResponse = EditVideoResponse & {
79
64
  status: 'completed';
@@ -96,14 +81,6 @@ declare class ImageToVideo {
96
81
  get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse>;
97
82
  }
98
83
 
99
- declare class ReferenceToVideo {
100
- private readonly http;
101
- constructor(http: HttpClient);
102
- run(params: ReferenceToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedReferenceToVideoResponse>;
103
- create(params: ReferenceToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
104
- get(id: string, options?: RequestOptions): Promise<ReferenceToVideoResponse>;
105
- }
106
-
107
84
  declare class TextToVideo {
108
85
  private readonly http;
109
86
  constructor(http: HttpClient);
@@ -115,9 +92,8 @@ declare class TextToVideo {
115
92
  declare class HappyHorseClient {
116
93
  readonly textToVideo: TextToVideo;
117
94
  readonly imageToVideo: ImageToVideo;
118
- readonly referenceToVideo: ReferenceToVideo;
119
95
  readonly editVideo: EditVideo;
120
96
  constructor(options?: ClientOptions);
121
97
  }
122
98
 
123
- export { type CompletedEditVideoResponse, type CompletedImageToVideoResponse, type CompletedReferenceToVideoResponse, type CompletedTextToVideoResponse, type EditVideoParams, type EditVideoResponse, type HappyHorseAspectRatio, type HappyHorseAudioSetting, HappyHorseClient, type HappyHorseEditVideoModel, type HappyHorseImageToVideoModel, type HappyHorseReferenceToVideoModel, type HappyHorseResolution, type HappyHorseTextToVideoModel, type ImageToVideoParams, type ImageToVideoResponse, type ReferenceToVideoParams, type ReferenceToVideoResponse, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type Video };
99
+ export { type CompletedEditVideoResponse, type CompletedImageToVideoResponse, type CompletedTextToVideoResponse, type EditVideoParams, type EditVideoResponse, type HappyHorseAspectRatio, type HappyHorseAudioSetting, HappyHorseClient, type HappyHorseEditVideoModel, type HappyHorseImageToVideoModel, type HappyHorseOutputResolution, type HappyHorseTextToVideoModel, type ImageToVideoParams, type ImageToVideoResponse, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type Video };
package/dist/index.d.ts CHANGED
@@ -1,47 +1,37 @@
1
1
  import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- type HappyHorseTextToVideoModel = 'happyhorse-text-to-video';
4
+ type HappyHorseTextToVideoModel = 'happyhorse-text-to-video' | 'happyhorse-character';
5
5
  type HappyHorseImageToVideoModel = 'happyhorse-image-to-video';
6
- type HappyHorseReferenceToVideoModel = 'happyhorse-reference-to-video';
7
- type HappyHorseEditVideoModel = 'happyhorse-video-edit';
8
- type HappyHorseResolution = '720p' | '1080p';
6
+ type HappyHorseEditVideoModel = 'happyhorse-edit-video';
7
+ type HappyHorseOutputResolution = '720p' | '1080p';
9
8
  type HappyHorseAspectRatio = '16:9' | '9:16' | '1:1' | '4:3' | '3:4';
10
- type HappyHorseAudioSetting = 'auto' | 'origin';
9
+ type HappyHorseAudioSetting = 'auto' | 'original';
11
10
  interface TextToVideoParams {
12
11
  model: HappyHorseTextToVideoModel;
13
12
  prompt: string;
14
- resolution?: HappyHorseResolution;
13
+ reference_image_urls?: string[];
14
+ output_resolution?: HappyHorseOutputResolution;
15
15
  aspect_ratio?: HappyHorseAspectRatio;
16
- duration?: number;
16
+ duration_seconds?: number;
17
17
  seed?: number;
18
18
  callback_url?: string;
19
19
  }
20
20
  interface ImageToVideoParams {
21
21
  model: HappyHorseImageToVideoModel;
22
- image_urls: string[];
22
+ first_frame_image_url: string;
23
23
  prompt?: string;
24
- resolution?: HappyHorseResolution;
25
- duration?: number;
26
- seed?: number;
27
- callback_url?: string;
28
- }
29
- interface ReferenceToVideoParams {
30
- model: HappyHorseReferenceToVideoModel;
31
- prompt: string;
32
- reference_image: string[];
33
- resolution?: HappyHorseResolution;
34
- aspect_ratio?: HappyHorseAspectRatio;
35
- duration?: number;
24
+ output_resolution?: HappyHorseOutputResolution;
25
+ duration_seconds?: number;
36
26
  seed?: number;
37
27
  callback_url?: string;
38
28
  }
39
29
  interface EditVideoParams {
40
30
  model: HappyHorseEditVideoModel;
41
31
  prompt: string;
42
- video_url: string;
43
- reference_image?: string[];
44
- resolution?: HappyHorseResolution;
32
+ source_video_url: string;
33
+ reference_image_urls?: string[];
34
+ output_resolution?: HappyHorseOutputResolution;
45
35
  audio_setting?: HappyHorseAudioSetting;
46
36
  seed?: number;
47
37
  callback_url?: string;
@@ -69,11 +59,6 @@ type CompletedImageToVideoResponse = ImageToVideoResponse & {
69
59
  status: 'completed';
70
60
  videos: Video[];
71
61
  };
72
- type ReferenceToVideoResponse = TextToVideoResponse;
73
- type CompletedReferenceToVideoResponse = ReferenceToVideoResponse & {
74
- status: 'completed';
75
- videos: Video[];
76
- };
77
62
  type EditVideoResponse = TextToVideoResponse;
78
63
  type CompletedEditVideoResponse = EditVideoResponse & {
79
64
  status: 'completed';
@@ -96,14 +81,6 @@ declare class ImageToVideo {
96
81
  get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse>;
97
82
  }
98
83
 
99
- declare class ReferenceToVideo {
100
- private readonly http;
101
- constructor(http: HttpClient);
102
- run(params: ReferenceToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedReferenceToVideoResponse>;
103
- create(params: ReferenceToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse>;
104
- get(id: string, options?: RequestOptions): Promise<ReferenceToVideoResponse>;
105
- }
106
-
107
84
  declare class TextToVideo {
108
85
  private readonly http;
109
86
  constructor(http: HttpClient);
@@ -115,9 +92,8 @@ declare class TextToVideo {
115
92
  declare class HappyHorseClient {
116
93
  readonly textToVideo: TextToVideo;
117
94
  readonly imageToVideo: ImageToVideo;
118
- readonly referenceToVideo: ReferenceToVideo;
119
95
  readonly editVideo: EditVideo;
120
96
  constructor(options?: ClientOptions);
121
97
  }
122
98
 
123
- export { type CompletedEditVideoResponse, type CompletedImageToVideoResponse, type CompletedReferenceToVideoResponse, type CompletedTextToVideoResponse, type EditVideoParams, type EditVideoResponse, type HappyHorseAspectRatio, type HappyHorseAudioSetting, HappyHorseClient, type HappyHorseEditVideoModel, type HappyHorseImageToVideoModel, type HappyHorseReferenceToVideoModel, type HappyHorseResolution, type HappyHorseTextToVideoModel, type ImageToVideoParams, type ImageToVideoResponse, type ReferenceToVideoParams, type ReferenceToVideoResponse, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type Video };
99
+ export { type CompletedEditVideoResponse, type CompletedImageToVideoResponse, type CompletedTextToVideoResponse, type EditVideoParams, type EditVideoResponse, type HappyHorseAspectRatio, type HappyHorseAudioSetting, HappyHorseClient, type HappyHorseEditVideoModel, type HappyHorseImageToVideoModel, type HappyHorseOutputResolution, type HappyHorseTextToVideoModel, type ImageToVideoParams, type ImageToVideoResponse, type TaskCreateResponse, type TextToVideoParams, type TextToVideoResponse, type Video };
package/dist/index.js CHANGED
@@ -20,23 +20,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- AuthenticationError: () => import_core6.AuthenticationError,
23
+ AuthenticationError: () => import_core5.AuthenticationError,
24
24
  HappyHorseClient: () => HappyHorseClient,
25
- InsufficientCreditsError: () => import_core6.InsufficientCreditsError,
26
- NetworkError: () => import_core6.NetworkError,
27
- NotFoundError: () => import_core6.NotFoundError,
28
- RateLimitError: () => import_core6.RateLimitError,
29
- RunApiError: () => import_core6.RunApiError,
30
- ServiceUnavailableError: () => import_core6.ServiceUnavailableError,
31
- TaskFailedError: () => import_core6.TaskFailedError,
32
- TaskTimeoutError: () => import_core6.TaskTimeoutError,
33
- TimeoutError: () => import_core6.TimeoutError,
34
- ValidationError: () => import_core6.ValidationError
25
+ InsufficientCreditsError: () => import_core5.InsufficientCreditsError,
26
+ NetworkError: () => import_core5.NetworkError,
27
+ NotFoundError: () => import_core5.NotFoundError,
28
+ RateLimitError: () => import_core5.RateLimitError,
29
+ RunApiError: () => import_core5.RunApiError,
30
+ ServiceUnavailableError: () => import_core5.ServiceUnavailableError,
31
+ TaskFailedError: () => import_core5.TaskFailedError,
32
+ TaskTimeoutError: () => import_core5.TaskTimeoutError,
33
+ TimeoutError: () => import_core5.TimeoutError,
34
+ ValidationError: () => import_core5.ValidationError
35
35
  });
36
36
  module.exports = __toCommonJS(index_exports);
37
37
 
38
38
  // src/client.ts
39
- var import_core5 = require("@runapi.ai/core");
39
+ var import_core4 = require("@runapi.ai/core");
40
40
 
41
41
  // src/resources/edit-video.ts
42
42
  var import_core = require("@runapi.ai/core");
@@ -94,11 +94,11 @@ var ImageToVideo = class {
94
94
  }
95
95
  };
96
96
 
97
- // src/resources/reference-to-video.ts
97
+ // src/resources/text-to-video.ts
98
98
  var import_core3 = require("@runapi.ai/core");
99
99
  var import_internal3 = require("@runapi.ai/core/internal");
100
- var ENDPOINT3 = "/api/v1/happyhorse/reference_to_video";
101
- var ReferenceToVideo = class {
100
+ var ENDPOINT3 = "/api/v1/happyhorse/text_to_video";
101
+ var TextToVideo = class {
102
102
  constructor(http) {
103
103
  this.http = http;
104
104
  }
@@ -122,51 +122,21 @@ var ReferenceToVideo = class {
122
122
  }
123
123
  };
124
124
 
125
- // src/resources/text-to-video.ts
126
- var import_core4 = require("@runapi.ai/core");
127
- var import_internal4 = require("@runapi.ai/core/internal");
128
- var ENDPOINT4 = "/api/v1/happyhorse/text_to_video";
129
- var TextToVideo = class {
130
- constructor(http) {
131
- this.http = http;
132
- }
133
- http;
134
- async run(params, options) {
135
- const { id } = await this.create(params, options);
136
- const response = await (0, import_internal4.pollUntilComplete)(() => this.get(id, options), {
137
- maxWaitMs: options?.maxWaitMs,
138
- pollIntervalMs: options?.pollIntervalMs
139
- });
140
- return response;
141
- }
142
- async create(params, options) {
143
- return this.http.request("POST", ENDPOINT4, {
144
- body: (0, import_core4.compactParams)(params),
145
- ...options
146
- });
147
- }
148
- async get(id, options) {
149
- return this.http.request("GET", `${ENDPOINT4}/${id}`, options ?? {});
150
- }
151
- };
152
-
153
125
  // src/client.ts
154
126
  var HappyHorseClient = class {
155
127
  textToVideo;
156
128
  imageToVideo;
157
- referenceToVideo;
158
129
  editVideo;
159
130
  constructor(options = {}) {
160
- const http = (0, import_core5.createHttpClient)(options);
131
+ const http = (0, import_core4.createHttpClient)(options);
161
132
  this.textToVideo = new TextToVideo(http);
162
133
  this.imageToVideo = new ImageToVideo(http);
163
- this.referenceToVideo = new ReferenceToVideo(http);
164
134
  this.editVideo = new EditVideo(http);
165
135
  }
166
136
  };
167
137
 
168
138
  // src/index.ts
169
- var import_core6 = require("@runapi.ai/core");
139
+ var import_core5 = require("@runapi.ai/core");
170
140
  // Annotate the CommonJS export names for ESM import in node:
171
141
  0 && (module.exports = {
172
142
  AuthenticationError,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/edit-video.ts","../src/resources/image-to-video.ts","../src/resources/reference-to-video.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { HappyHorseClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { EditVideo } from './resources/edit-video';\nimport { ImageToVideo } from './resources/image-to-video';\nimport { ReferenceToVideo } from './resources/reference-to-video';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class HappyHorseClient {\n public readonly textToVideo: TextToVideo;\n public readonly imageToVideo: ImageToVideo;\n public readonly referenceToVideo: ReferenceToVideo;\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n this.imageToVideo = new ImageToVideo(http);\n this.referenceToVideo = new ReferenceToVideo(http);\n this.editVideo = new EditVideo(http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedEditVideoResponse,\n EditVideoParams,\n EditVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/edit_video';\n\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: EditVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditVideoResponse;\n }\n\n async create(params: EditVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<EditVideoResponse> {\n return this.http.request<EditVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/image_to_video';\n\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ImageToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedImageToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ImageToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedImageToVideoResponse;\n }\n\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse> {\n return this.http.request<ImageToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedReferenceToVideoResponse,\n ReferenceToVideoParams,\n ReferenceToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/reference_to_video';\n\nexport class ReferenceToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ReferenceToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedReferenceToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ReferenceToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedReferenceToVideoResponse;\n }\n\n async create(params: ReferenceToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ReferenceToVideoResponse> {\n return this.http.request<ReferenceToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAqD;;;ACCrD,kBAA8B;AAC9B,sBAAkC;AAQlC,IAAM,WAAW;AAEV,IAAM,YAAN,MAAgB;AAAA,EACrB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAAyB,SAAgF;AACjH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,mCAAqC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACvF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,WAAO,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D,UAAM,2BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACvF;AACF;;;ACjCA,IAAAC,eAA8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hBA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/edit-video.ts","../src/resources/image-to-video.ts","../src/resources/text-to-video.ts"],"sourcesContent":["export { HappyHorseClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { EditVideo } from './resources/edit-video';\nimport { ImageToVideo } from './resources/image-to-video';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class HappyHorseClient {\n public readonly textToVideo: TextToVideo;\n public readonly imageToVideo: ImageToVideo;\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n this.imageToVideo = new ImageToVideo(http);\n this.editVideo = new EditVideo(http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedEditVideoResponse,\n EditVideoParams,\n EditVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/edit_video';\n\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: EditVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditVideoResponse;\n }\n\n async create(params: EditVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<EditVideoResponse> {\n return this.http.request<EditVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/image_to_video';\n\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ImageToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedImageToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ImageToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedImageToVideoResponse;\n }\n\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse> {\n return this.http.request<ImageToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAAqD;;;ACCrD,kBAA8B;AAC9B,sBAAkC;AAQlC,IAAM,WAAW;AAEV,IAAM,YAAN,MAAgB;AAAA,EACrB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAAyB,SAAgF;AACjH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,mCAAqC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACvF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,WAAO,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D,UAAM,2BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACvF;AACF;;;ACjCA,IAAAC,eAA8B;A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A,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACzF;AACF;;;AH7BO,IAAM,mBAAN,MAAuB;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,WAAO,+BAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,eAAe,IAAI,aAAa,IAAI;AACzC,SAAK,YAAY,IAAI,UAAU,IAAI;AAAA,EACrC;AACF;;;ADbA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
package/dist/index.mjs CHANGED
@@ -57,11 +57,11 @@ var ImageToVideo = class {
57
57
  }
58
58
  };
59
59
 
60
- // src/resources/reference-to-video.ts
60
+ // src/resources/text-to-video.ts
61
61
  import { compactParams as compactParams3 } from "@runapi.ai/core";
62
62
  import { pollUntilComplete as pollUntilComplete3 } from "@runapi.ai/core/internal";
63
- var ENDPOINT3 = "/api/v1/happyhorse/reference_to_video";
64
- var ReferenceToVideo = class {
63
+ var ENDPOINT3 = "/api/v1/happyhorse/text_to_video";
64
+ var TextToVideo = class {
65
65
  constructor(http) {
66
66
  this.http = http;
67
67
  }
@@ -85,45 +85,15 @@ var ReferenceToVideo = class {
85
85
  }
86
86
  };
87
87
 
88
- // src/resources/text-to-video.ts
89
- import { compactParams as compactParams4 } from "@runapi.ai/core";
90
- import { pollUntilComplete as pollUntilComplete4 } from "@runapi.ai/core/internal";
91
- var ENDPOINT4 = "/api/v1/happyhorse/text_to_video";
92
- var TextToVideo = class {
93
- constructor(http) {
94
- this.http = http;
95
- }
96
- http;
97
- async run(params, options) {
98
- const { id } = await this.create(params, options);
99
- const response = await pollUntilComplete4(() => this.get(id, options), {
100
- maxWaitMs: options?.maxWaitMs,
101
- pollIntervalMs: options?.pollIntervalMs
102
- });
103
- return response;
104
- }
105
- async create(params, options) {
106
- return this.http.request("POST", ENDPOINT4, {
107
- body: compactParams4(params),
108
- ...options
109
- });
110
- }
111
- async get(id, options) {
112
- return this.http.request("GET", `${ENDPOINT4}/${id}`, options ?? {});
113
- }
114
- };
115
-
116
88
  // src/client.ts
117
89
  var HappyHorseClient = class {
118
90
  textToVideo;
119
91
  imageToVideo;
120
- referenceToVideo;
121
92
  editVideo;
122
93
  constructor(options = {}) {
123
94
  const http = createHttpClient(options);
124
95
  this.textToVideo = new TextToVideo(http);
125
96
  this.imageToVideo = new ImageToVideo(http);
126
- this.referenceToVideo = new ReferenceToVideo(http);
127
97
  this.editVideo = new EditVideo(http);
128
98
  }
129
99
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/resources/edit-video.ts","../src/resources/image-to-video.ts","../src/resources/reference-to-video.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { EditVideo } from './resources/edit-video';\nimport { ImageToVideo } from './resources/image-to-video';\nimport { ReferenceToVideo } from './resources/reference-to-video';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class HappyHorseClient {\n public readonly textToVideo: TextToVideo;\n public readonly imageToVideo: ImageToVideo;\n public readonly referenceToVideo: ReferenceToVideo;\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n this.imageToVideo = new ImageToVideo(http);\n this.referenceToVideo = new ReferenceToVideo(http);\n this.editVideo = new EditVideo(http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedEditVideoResponse,\n EditVideoParams,\n EditVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/edit_video';\n\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: EditVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditVideoResponse;\n }\n\n async create(params: EditVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<EditVideoResponse> {\n return this.http.request<EditVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/image_to_video';\n\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ImageToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedImageToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ImageToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedImageToVideoResponse;\n }\n\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse> {\n return this.http.request<ImageToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedReferenceToVideoResponse,\n ReferenceToVideoParams,\n ReferenceToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/reference_to_video';\n\nexport class ReferenceToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ReferenceToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedReferenceToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ReferenceToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedReferenceToVideoResponse;\n }\n\n async create(params: ReferenceToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ReferenceToVideoResponse> {\n return this.http.request<ReferenceToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export { HappyHorseClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,wBAA4C;;;ACCrD,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAM,WAAW;AAEV,IAAM,YAAN,MAAgB;AAAA,EACrB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAAyB,SAAgF;AACjH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAM,kBAAqC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACvF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,WAAO,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D,MAAM,cAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACvF;AACF;;;ACjCA,SAAS,iBAAAA,sBAAqB;AAC9B,SAAS,qBAAAC,0BAAyB;AAQlC,IAAMC,YAAW;AAEV,IAAM,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ACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","pollUntilComplete","ENDPOINT","compactParams","pollUntilComplete","ENDPOINT","compactParams","pollUntilComplete","ENDPOINT"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/edit-video.ts","../src/resources/image-to-video.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { createHttpClient, type ClientOptions } from '@runapi.ai/core';\nimport { EditVideo } from './resources/edit-video';\nimport { ImageToVideo } from './resources/image-to-video';\nimport { TextToVideo } from './resources/text-to-video';\n\nexport class HappyHorseClient {\n public readonly textToVideo: TextToVideo;\n public readonly imageToVideo: ImageToVideo;\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n const http = createHttpClient(options);\n this.textToVideo = new TextToVideo(http);\n this.imageToVideo = new ImageToVideo(http);\n this.editVideo = new EditVideo(http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedEditVideoResponse,\n EditVideoParams,\n EditVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/edit_video';\n\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: EditVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditVideoResponse;\n }\n\n async create(params: EditVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<EditVideoResponse> {\n return this.http.request<EditVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/image_to_video';\n\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: ImageToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedImageToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<ImageToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedImageToVideoResponse;\n }\n\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<ImageToVideoResponse> {\n return this.http.request<ImageToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions } from '@runapi.ai/core';\nimport { compactParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/text_to_video';\n\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n async run(params: TextToVideoParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToVideoResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToVideoResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToVideoResponse;\n }\n\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body: compactParams(params),\n ...options,\n });\n }\n\n async get(id: string, options?: RequestOptions): Promise<TextToVideoResponse> {\n return this.http.request<TextToVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export { HappyHorseClient } from './client';\nexport * from './types';\n\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,wBAA4C;;;ACCrD,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAM,WAAW;AAEV,IAAM,YAAN,MAAgB;AAAA,EACrB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA,EAE7B,MAAM,IAAI,QAAyB,SAAgF;AACjH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,MAAM,kBAAqC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACvF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,WAAO,KAAK,KAAK,QAA4B,QAAQ,UAAU;AAAA,MAC7D,MAAM,cAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAG,QAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACvF;AACF;;;ACjCA,SAAS,iBAAAA,sBAAqB;A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D,MAAMF,eAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGE,SAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACzF;AACF;;;AH7BO,IAAM,mBAAN,MAAuB;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO,iBAAiB,OAAO;AACrC,SAAK,cAAc,IAAI,YAAY,IAAI;AACvC,SAAK,eAAe,IAAI,aAAa,IAAI;AACzC,SAAK,YAAY,IAAI,UAAU,IAAI;AAAA,EACrC;AACF;;;AIbA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","pollUntilComplete","ENDPOINT","compactParams","pollUntilComplete","ENDPOINT"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runapi.ai/happyhorse",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "RunAPI HappyHorse SDK for JavaScript, Ruby, and Go",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -28,7 +28,7 @@
28
28
  "clean": "rm -rf dist"
29
29
  },
30
30
  "dependencies": {
31
- "@runapi.ai/core": "^0.2.4"
31
+ "@runapi.ai/core": "^0.2.5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.0.0",
@@ -5,7 +5,7 @@
5
5
  </p>
6
6
 
7
7
  <p align="center">
8
- Install this agent skill, inspect HappyHorse fields, then run text, image, reference-to-video, or edit-video jobs through the RunAPI CLI.
8
+ Install this agent skill, inspect HappyHorse fields, then run text, image, or edit-video jobs through the RunAPI CLI.
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <br/>
23
23
 
24
- Generate text, image, reference-to-video, or edit-video clips with HappyHorse in 720p or 1080p. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate HappyHorse through RunAPI.
24
+ Generate text, image, or edit-video clips with HappyHorse in 720p or 1080p. Text-to-video can also use ordered reference images through the character model. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate HappyHorse through RunAPI.
25
25
 
26
26
  The canonical agent file is `skills/happyhorse/SKILL.md`.
27
27
 
@@ -51,22 +51,23 @@ import { HappyHorseClient } from '@runapi.ai/happyhorse';
51
51
 
52
52
  const client = new HappyHorseClient();
53
53
  const result = await client.textToVideo.run({
54
- model: 'happyhorse-text-to-video',
55
- prompt: 'A tiny paper horse gallops through a miniature cardboard city at night.',
56
- resolution: '1080p',
54
+ model: 'happyhorse-character',
55
+ prompt: 'Character1 walks through a miniature cardboard city at night.',
56
+ reference_image_urls: ['https://cdn.runapi.ai/public/samples/reference-1.jpg'],
57
+ output_resolution: '1080p',
57
58
  aspect_ratio: '16:9',
58
- duration: 5,
59
+ duration_seconds: 5,
59
60
  });
60
61
  ```
61
62
 
62
- Image-to-video tasks use `client.imageToVideo` with `model: 'happyhorse-image-to-video'` and exactly one `image_urls` entry. Reference-to-video tasks use `client.referenceToVideo` with `model: 'happyhorse-reference-to-video'` and 1-9 `reference_image` entries. Edit-video tasks use `client.editVideo` with `model: 'happyhorse-video-edit'`, one `video_url`, and optional `reference_image` entries.
63
+ Image-to-video tasks use `client.imageToVideo` with `model: 'happyhorse-image-to-video'` and `first_frame_image_url`. Character-guided text-to-video tasks use `client.textToVideo` with `model: 'happyhorse-character'` and 1-9 `reference_image_urls` entries. Edit-video tasks use `client.editVideo` with `model: 'happyhorse-edit-video'`, one `source_video_url`, and optional `reference_image_urls`.
63
64
 
64
65
  ## Variants
65
66
 
66
67
  - `happyhorse-text-to-video`: create 3-15 second videos from a text prompt with 720p or 1080p output.
68
+ - `happyhorse-character`: create 3-15 second text-to-video clips guided by 1-9 ordered reference images.
67
69
  - `happyhorse-image-to-video`: animate one first-frame image into a 3-15 second video with 720p or 1080p output.
68
- - `happyhorse-reference-to-video`: create 3-15 second videos from a prompt and 1-9 ordered reference images.
69
- - `happyhorse-video-edit`: edit one 3-60 second source video using a prompt and up to 5 reference images.
70
+ - `happyhorse-edit-video`: edit one 3-60 second source video using a prompt and up to 5 reference images.
70
71
 
71
72
  ## Routing
72
73
 
@@ -75,8 +76,8 @@ Image-to-video tasks use `client.imageToVideo` with `model: 'happyhorse-image-to
75
76
  - SDK docs: https://runapi.ai/docs#sdk-happyhorse
76
77
  - SDK repository: https://github.com/runapi-ai/happyhorse-sdk
77
78
  - Image-to-video pricing and rate limits: https://runapi.ai/models/happyhorse/image-to-video
78
- - Reference-to-video pricing and rate limits: https://runapi.ai/models/happyhorse/reference-to-video
79
- - Edit-video pricing and rate limits: https://runapi.ai/models/happyhorse/video-edit
79
+ - Character pricing and rate limits: https://runapi.ai/models/happyhorse/character
80
+ - Edit-video pricing and rate limits: https://runapi.ai/models/happyhorse/edit-video
80
81
  - Pricing and rate limits: https://runapi.ai/models/happyhorse/text-to-video
81
82
  - Provider comparison: https://runapi.ai/providers/alibaba
82
83
  - Browse all RunAPI models and skills: https://runapi.ai/models
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: happyhorse
3
- description: Generate text, image, reference-to-video, or edit-video clips with HappyHorse through RunAPI. Use when the user asks an agent to create video from text, a first-frame image, reference images, or an edited source video with HappyHorse. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.
3
+ description: Generate text, image, or edit-video clips with HappyHorse through RunAPI. Use when the user asks an agent to create video from text, a first-frame image, ordered reference images, or an edited source video with HappyHorse. Default to the RunAPI CLI for one-off generation; use SDKs only when the user is integrating RunAPI into an app or backend.
4
4
  documentation: https://runapi.ai/models/happyhorse.md
5
5
  provider_page: https://runapi.ai/providers/alibaba.md
6
6
  catalog: https://runapi.ai/models.md
@@ -18,16 +18,16 @@ metadata:
18
18
  envVars:
19
19
  - name: RUNAPI_API_KEY
20
20
  required: false
21
- description: Optional RunAPI API key; agents should prefer environment auth or saved CLI config. Browser login is interactive fallback only.
21
+ description: Optional RunAPI API key; agents should prefer environment auth or saved CLI config. Browser login is interactive only.
22
22
  ---
23
23
 
24
24
  # HappyHorse on RunAPI
25
25
 
26
- Generate text, image, reference-to-video, or edit-video clips with HappyHorse through RunAPI. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
26
+ Generate text, image, or edit-video clips with HappyHorse through RunAPI. Text-to-video can also use ordered reference images through the character model. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
27
27
 
28
28
  ## Routing decision
29
29
 
30
- - One-off text, image, reference-to-video, or edit-video generation for the user -> use the CLI path with the `runapi` binary.
30
+ - One-off text, image, or edit-video generation for the user -> use the CLI path with the `runapi` binary.
31
31
  - Building an app, backend, worker, library, or production codebase -> use the SDK integration path.
32
32
 
33
33
  ## CLI path
@@ -40,7 +40,6 @@ Inspect the available commands and request fields with CLI help:
40
40
  runapi happyhorse --help
41
41
  runapi happyhorse text-to-video --help
42
42
  runapi happyhorse image-to-video --help
43
- runapi happyhorse reference-to-video --help
44
43
  runapi happyhorse edit-video --help
45
44
  ```
46
45
 
@@ -49,7 +48,6 @@ Run a one-off task:
49
48
  ```shell
50
49
  runapi happyhorse text-to-video --input-file request.json
51
50
  runapi happyhorse image-to-video --input-file request.json
52
- runapi happyhorse reference-to-video --input-file request.json
53
51
  runapi happyhorse edit-video --input-file request.json
54
52
  ```
55
53
 
@@ -60,16 +58,16 @@ runapi happyhorse text-to-video --async --input-file request.json
60
58
  runapi wait <task-id> --service happyhorse --action text-to-video
61
59
  ```
62
60
 
63
- For image-to-video, reference-to-video, and edit-video, use the same async pattern with `--action image-to-video`, `--action reference-to-video`, or `--action edit-video`.
61
+ For image-to-video and edit-video, use the same async pattern with `--action image-to-video` or `--action edit-video`.
64
62
 
65
- Available commands: `text-to-video`, `image-to-video`, `reference-to-video`, `edit-video`.
63
+ Available commands: `text-to-video`, `image-to-video`, `edit-video`.
66
64
 
67
65
  ## Variants
68
66
 
69
67
  - `happyhorse-text-to-video`: create 3-15 second videos from a text prompt with 720p or 1080p output.
68
+ - `happyhorse-character`: create 3-15 second text-to-video clips guided by 1-9 ordered reference images.
70
69
  - `happyhorse-image-to-video`: animate one first-frame image into a 3-15 second video with 720p or 1080p output.
71
- - `happyhorse-reference-to-video`: create 3-15 second videos from a prompt and 1-9 ordered reference images.
72
- - `happyhorse-video-edit`: edit one 3-60 second source video using a prompt and up to 5 reference images.
70
+ - `happyhorse-edit-video`: edit one 3-60 second source video using a prompt and up to 5 reference images.
73
71
 
74
72
  ## SDK integration path
75
73
 
@@ -83,8 +81,8 @@ When integrating HappyHorse into an app, backend, worker, or library, use a RunA
83
81
 
84
82
  - Model overview, pricing, and rate limits: https://runapi.ai/models/happyhorse.md
85
83
  - Text-to-video variant: https://runapi.ai/models/happyhorse/text-to-video.md
84
+ - Character variant: https://runapi.ai/models/happyhorse/character.md
86
85
  - Image-to-video variant: https://runapi.ai/models/happyhorse/image-to-video.md
87
- - Reference-to-video variant: https://runapi.ai/models/happyhorse/reference-to-video.md
88
- - Edit-video variant: https://runapi.ai/models/happyhorse/video-edit.md
86
+ - Edit-video variant: https://runapi.ai/models/happyhorse/edit-video.md
89
87
  - Provider comparison: https://runapi.ai/providers/alibaba.md
90
88
  - Full model catalog: https://runapi.ai/models.md