@runapi.ai/happyhorse 0.2.6 → 0.2.8

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, and edit-video workflows that need JSON request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
3
+ The HappyHorse JavaScript SDK is the language-specific package for HappyHorse on RunAPI. Use this package for video generation, animation, and video editing workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in JavaScript.
4
4
 
5
5
  ## Install
6
6
 
package/dist/index.js CHANGED
@@ -41,6 +41,125 @@ var import_core4 = require("@runapi.ai/core");
41
41
  // src/resources/edit-video.ts
42
42
  var import_core = require("@runapi.ai/core");
43
43
  var import_internal = require("@runapi.ai/core/internal");
44
+
45
+ // src/contract_gen.ts
46
+ var contract = {
47
+ "edit-video": {
48
+ "models": [
49
+ "happyhorse-edit-video"
50
+ ],
51
+ "fields_by_model": {
52
+ "happyhorse-edit-video": {
53
+ "audio_setting": {
54
+ "enum": [
55
+ "auto",
56
+ "original"
57
+ ]
58
+ },
59
+ "output_resolution": {
60
+ "enum": [
61
+ "720p",
62
+ "1080p"
63
+ ]
64
+ },
65
+ "reference_image_urls": {
66
+ "max_items": 5
67
+ },
68
+ "seed": {
69
+ "type": "integer"
70
+ },
71
+ "source_video_url": {
72
+ "required": true
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "image-to-video": {
78
+ "models": [
79
+ "happyhorse-image-to-video"
80
+ ],
81
+ "fields_by_model": {
82
+ "happyhorse-image-to-video": {
83
+ "duration_seconds": {
84
+ "type": "integer"
85
+ },
86
+ "first_frame_image_url": {
87
+ "required": true
88
+ },
89
+ "output_resolution": {
90
+ "enum": [
91
+ "720p",
92
+ "1080p"
93
+ ]
94
+ },
95
+ "seed": {
96
+ "type": "integer"
97
+ }
98
+ }
99
+ }
100
+ },
101
+ "text-to-video": {
102
+ "models": [
103
+ "happyhorse-character",
104
+ "happyhorse-text-to-video"
105
+ ],
106
+ "fields_by_model": {
107
+ "happyhorse-character": {
108
+ "aspect_ratio": {
109
+ "enum": [
110
+ "16:9",
111
+ "9:16",
112
+ "1:1",
113
+ "4:3",
114
+ "3:4"
115
+ ]
116
+ },
117
+ "duration_seconds": {
118
+ "type": "integer"
119
+ },
120
+ "output_resolution": {
121
+ "enum": [
122
+ "720p",
123
+ "1080p"
124
+ ]
125
+ },
126
+ "reference_image_urls": {
127
+ "required": true,
128
+ "min_items": 1,
129
+ "max_items": 9
130
+ },
131
+ "seed": {
132
+ "type": "integer"
133
+ }
134
+ },
135
+ "happyhorse-text-to-video": {
136
+ "aspect_ratio": {
137
+ "enum": [
138
+ "16:9",
139
+ "9:16",
140
+ "1:1",
141
+ "4:3",
142
+ "3:4"
143
+ ]
144
+ },
145
+ "duration_seconds": {
146
+ "type": "integer"
147
+ },
148
+ "output_resolution": {
149
+ "enum": [
150
+ "720p",
151
+ "1080p"
152
+ ]
153
+ },
154
+ "seed": {
155
+ "type": "integer"
156
+ }
157
+ }
158
+ }
159
+ }
160
+ };
161
+
162
+ // src/resources/edit-video.ts
44
163
  var ENDPOINT = "/api/v1/happyhorse/edit_video";
45
164
  var EditVideo = class {
46
165
  constructor(http) {
@@ -68,8 +187,10 @@ var EditVideo = class {
68
187
  * @returns The task creation result with id.
69
188
  */
70
189
  async create(params, options) {
190
+ const body = (0, import_core.compactParams)(params);
191
+ (0, import_core.validateParams)(contract["edit-video"], body);
71
192
  return this.http.request("POST", ENDPOINT, {
72
- body: (0, import_core.compactParams)(params),
193
+ body,
73
194
  ...options
74
195
  });
75
196
  }
@@ -114,8 +235,10 @@ var ImageToVideo = class {
114
235
  * @returns The task creation result with id.
115
236
  */
116
237
  async create(params, options) {
238
+ const body = (0, import_core2.compactParams)(params);
239
+ (0, import_core2.validateParams)(contract["image-to-video"], body);
117
240
  return this.http.request("POST", ENDPOINT2, {
118
- body: (0, import_core2.compactParams)(params),
241
+ body,
119
242
  ...options
120
243
  });
121
244
  }
@@ -160,8 +283,10 @@ var TextToVideo = class {
160
283
  * @returns The task creation result with id.
161
284
  */
162
285
  async create(params, options) {
286
+ const body = (0, import_core3.compactParams)(params);
287
+ (0, import_core3.validateParams)(contract["text-to-video"], body);
163
288
  return this.http.request("POST", ENDPOINT3, {
164
- body: (0, import_core3.compactParams)(params),
289
+ body,
165
290
  ...options
166
291
  });
167
292
  }
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/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 { BaseClient, 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\n/**\n * HappyHorse video generation and editing API client.\n *\n * @example\n * ```typescript\n * const client = new HappyHorseClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'happyhorse-text-to-video',\n * prompt: 'A horse galloping across a sunset beach',\n * });\n * ```\n */\nexport class HappyHorseClient extends BaseClient {\n /** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\n public readonly textToVideo: TextToVideo;\n /** Animate a still first-frame image into video, guided by an optional text prompt. */\n public readonly imageToVideo: ImageToVideo;\n /** Transform an existing video with a text prompt and optional reference images. */\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n this.imageToVideo = new ImageToVideo(this.http);\n this.editVideo = new EditVideo(this.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\n/** Transform an existing video with a text prompt and optional reference images. Use audio_setting to control whether original audio is preserved. */\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit-video task and wait until complete.\n * @param params Edit-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an edit-video task; returns immediately with a task id.\n * @param params Edit-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\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 /**\n * Fetch the current status of an edit-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit-video task status.\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\n/** Animate a still first-frame image into video, guided by an optional text prompt. */\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an image-to-video task and wait until complete.\n * @param params Image-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an image-to-video task; returns immediately with a task id.\n * @param params Image-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\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 /**\n * Fetch the current status of an image-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image-to-video task status.\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\n/** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text-to-video task and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\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 /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video task status.\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,eAA+C;;;ACC/C,kBAA8B;AAC9B,sBAAkC;AAQlC,IAAM,WAAW;AAGV,IAAM,YAAN,MAAgB;AAAA,EACrB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,WAA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A6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,MAAM,IAAI,QAA2B,SAAkF;AACrH,UAAM,EAAE,GAAG,IAAI,MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,oCAAuC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACzF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAA2B,SAAuD;AAC7F,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D,UAAM,4BAAc,MAAM;AAAA,MAC1B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAwD;AAC5E,WAAO,KAAK,KAAK,QAA6B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI,WAAW,CAAC,CAAC;AAAA,EACzF;AACF;;;AHnCO,IAAM,mBAAN,cAA+B,wBAAW;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AD7BA,IAAAC,eAYO;","names":["import_core","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/contract_gen.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 { BaseClient, 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\n/**\n * HappyHorse video generation and editing API client.\n *\n * @example\n * ```typescript\n * const client = new HappyHorseClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'happyhorse-text-to-video',\n * prompt: 'A horse galloping across a sunset beach',\n * });\n * ```\n */\nexport class HappyHorseClient extends BaseClient {\n /** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\n public readonly textToVideo: TextToVideo;\n /** Animate a still first-frame image into video, guided by an optional text prompt. */\n public readonly imageToVideo: ImageToVideo;\n /** Transform an existing video with a text prompt and optional reference images. */\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n this.imageToVideo = new ImageToVideo(this.http);\n this.editVideo = new EditVideo(this.http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedEditVideoResponse,\n EditVideoParams,\n EditVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/edit_video';\n\n/** Transform an existing video with a text prompt and optional reference images. Use audio_setting to control whether original audio is preserved. */\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit-video task and wait until complete.\n * @param params Edit-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an edit-video task; returns immediately with a task id.\n * @param params Edit-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: EditVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an edit-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit-video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditVideoResponse> {\n return this.http.request<EditVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export const contract = {\n \"edit-video\": {\n \"models\": [\n \"happyhorse-edit-video\"\n ],\n \"fields_by_model\": {\n \"happyhorse-edit-video\": {\n \"audio_setting\": {\n \"enum\": [\n \"auto\",\n \"original\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"reference_image_urls\": {\n \"max_items\": 5\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_video_url\": {\n \"required\": true\n }\n }\n }\n },\n \"image-to-video\": {\n \"models\": [\n \"happyhorse-image-to-video\"\n ],\n \"fields_by_model\": {\n \"happyhorse-image-to-video\": {\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"happyhorse-character\",\n \"happyhorse-text-to-video\"\n ],\n \"fields_by_model\": {\n \"happyhorse-character\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\",\n \"4:3\",\n \"3:4\"\n ]\n },\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"reference_image_urls\": {\n \"required\": true,\n \"min_items\": 1,\n \"max_items\": 9\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"happyhorse-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\",\n \"4:3\",\n \"3:4\"\n ]\n },\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/image_to_video';\n\n/** Animate a still first-frame image into video, guided by an optional text prompt. */\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an image-to-video task and wait until complete.\n * @param params Image-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an image-to-video task; returns immediately with a task id.\n * @param params Image-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['image-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image-to-video task status.\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, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/text_to_video';\n\n/** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text-to-video task and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video task status.\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,eAA+C;;;ACC/C,kBAA8C;AAC9C,sBAAkC;;;ACF3B,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,yBAAyB;AAAA,QACvB,iBAAiB;AAAA,UACf,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,wBAAwB;AAAA,UACtB,aAAa;AAAA,QACf;AAAA,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,6BAA6B;AAAA,QAC3B,oBAAoB;AAAA,UAClB,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,UACvB,YAAY;AAAA,QACd;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV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AAK,IAAI;AAC9C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AD7BA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core","import_internal","ENDPOINT","import_core"]}
package/dist/index.mjs CHANGED
@@ -2,8 +2,127 @@
2
2
  import { BaseClient } from "@runapi.ai/core";
3
3
 
4
4
  // src/resources/edit-video.ts
5
- import { compactParams } from "@runapi.ai/core";
5
+ import { compactParams, validateParams } from "@runapi.ai/core";
6
6
  import { pollUntilComplete } from "@runapi.ai/core/internal";
7
+
8
+ // src/contract_gen.ts
9
+ var contract = {
10
+ "edit-video": {
11
+ "models": [
12
+ "happyhorse-edit-video"
13
+ ],
14
+ "fields_by_model": {
15
+ "happyhorse-edit-video": {
16
+ "audio_setting": {
17
+ "enum": [
18
+ "auto",
19
+ "original"
20
+ ]
21
+ },
22
+ "output_resolution": {
23
+ "enum": [
24
+ "720p",
25
+ "1080p"
26
+ ]
27
+ },
28
+ "reference_image_urls": {
29
+ "max_items": 5
30
+ },
31
+ "seed": {
32
+ "type": "integer"
33
+ },
34
+ "source_video_url": {
35
+ "required": true
36
+ }
37
+ }
38
+ }
39
+ },
40
+ "image-to-video": {
41
+ "models": [
42
+ "happyhorse-image-to-video"
43
+ ],
44
+ "fields_by_model": {
45
+ "happyhorse-image-to-video": {
46
+ "duration_seconds": {
47
+ "type": "integer"
48
+ },
49
+ "first_frame_image_url": {
50
+ "required": true
51
+ },
52
+ "output_resolution": {
53
+ "enum": [
54
+ "720p",
55
+ "1080p"
56
+ ]
57
+ },
58
+ "seed": {
59
+ "type": "integer"
60
+ }
61
+ }
62
+ }
63
+ },
64
+ "text-to-video": {
65
+ "models": [
66
+ "happyhorse-character",
67
+ "happyhorse-text-to-video"
68
+ ],
69
+ "fields_by_model": {
70
+ "happyhorse-character": {
71
+ "aspect_ratio": {
72
+ "enum": [
73
+ "16:9",
74
+ "9:16",
75
+ "1:1",
76
+ "4:3",
77
+ "3:4"
78
+ ]
79
+ },
80
+ "duration_seconds": {
81
+ "type": "integer"
82
+ },
83
+ "output_resolution": {
84
+ "enum": [
85
+ "720p",
86
+ "1080p"
87
+ ]
88
+ },
89
+ "reference_image_urls": {
90
+ "required": true,
91
+ "min_items": 1,
92
+ "max_items": 9
93
+ },
94
+ "seed": {
95
+ "type": "integer"
96
+ }
97
+ },
98
+ "happyhorse-text-to-video": {
99
+ "aspect_ratio": {
100
+ "enum": [
101
+ "16:9",
102
+ "9:16",
103
+ "1:1",
104
+ "4:3",
105
+ "3:4"
106
+ ]
107
+ },
108
+ "duration_seconds": {
109
+ "type": "integer"
110
+ },
111
+ "output_resolution": {
112
+ "enum": [
113
+ "720p",
114
+ "1080p"
115
+ ]
116
+ },
117
+ "seed": {
118
+ "type": "integer"
119
+ }
120
+ }
121
+ }
122
+ }
123
+ };
124
+
125
+ // src/resources/edit-video.ts
7
126
  var ENDPOINT = "/api/v1/happyhorse/edit_video";
8
127
  var EditVideo = class {
9
128
  constructor(http) {
@@ -31,8 +150,10 @@ var EditVideo = class {
31
150
  * @returns The task creation result with id.
32
151
  */
33
152
  async create(params, options) {
153
+ const body = compactParams(params);
154
+ validateParams(contract["edit-video"], body);
34
155
  return this.http.request("POST", ENDPOINT, {
35
- body: compactParams(params),
156
+ body,
36
157
  ...options
37
158
  });
38
159
  }
@@ -48,7 +169,7 @@ var EditVideo = class {
48
169
  };
49
170
 
50
171
  // src/resources/image-to-video.ts
51
- import { compactParams as compactParams2 } from "@runapi.ai/core";
172
+ import { compactParams as compactParams2, validateParams as validateParams2 } from "@runapi.ai/core";
52
173
  import { pollUntilComplete as pollUntilComplete2 } from "@runapi.ai/core/internal";
53
174
  var ENDPOINT2 = "/api/v1/happyhorse/image_to_video";
54
175
  var ImageToVideo = class {
@@ -77,8 +198,10 @@ var ImageToVideo = class {
77
198
  * @returns The task creation result with id.
78
199
  */
79
200
  async create(params, options) {
201
+ const body = compactParams2(params);
202
+ validateParams2(contract["image-to-video"], body);
80
203
  return this.http.request("POST", ENDPOINT2, {
81
- body: compactParams2(params),
204
+ body,
82
205
  ...options
83
206
  });
84
207
  }
@@ -94,7 +217,7 @@ var ImageToVideo = class {
94
217
  };
95
218
 
96
219
  // src/resources/text-to-video.ts
97
- import { compactParams as compactParams3 } from "@runapi.ai/core";
220
+ import { compactParams as compactParams3, validateParams as validateParams3 } from "@runapi.ai/core";
98
221
  import { pollUntilComplete as pollUntilComplete3 } from "@runapi.ai/core/internal";
99
222
  var ENDPOINT3 = "/api/v1/happyhorse/text_to_video";
100
223
  var TextToVideo = class {
@@ -123,8 +246,10 @@ var TextToVideo = class {
123
246
  * @returns The task creation result with id.
124
247
  */
125
248
  async create(params, options) {
249
+ const body = compactParams3(params);
250
+ validateParams3(contract["text-to-video"], body);
126
251
  return this.http.request("POST", ENDPOINT3, {
127
- body: compactParams3(params),
252
+ body,
128
253
  ...options
129
254
  });
130
255
  }
@@ -1 +1 @@
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 { BaseClient, 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\n/**\n * HappyHorse video generation and editing API client.\n *\n * @example\n * ```typescript\n * const client = new HappyHorseClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'happyhorse-text-to-video',\n * prompt: 'A horse galloping across a sunset beach',\n * });\n * ```\n */\nexport class HappyHorseClient extends BaseClient {\n /** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\n public readonly textToVideo: TextToVideo;\n /** Animate a still first-frame image into video, guided by an optional text prompt. */\n public readonly imageToVideo: ImageToVideo;\n /** Transform an existing video with a text prompt and optional reference images. */\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n this.imageToVideo = new ImageToVideo(this.http);\n this.editVideo = new EditVideo(this.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\n/** Transform an existing video with a text prompt and optional reference images. Use audio_setting to control whether original audio is preserved. */\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit-video task and wait until complete.\n * @param params Edit-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an edit-video task; returns immediately with a task id.\n * @param params Edit-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\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 /**\n * Fetch the current status of an edit-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit-video task status.\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\n/** Animate a still first-frame image into video, guided by an optional text prompt. */\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an image-to-video task and wait until complete.\n * @param params Image-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an image-to-video task; returns immediately with a task id.\n * @param params Image-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\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 /**\n * Fetch the current status of an image-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image-to-video task status.\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\n/** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text-to-video task and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\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 /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video task status.\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,kBAAsC;;;ACC/C,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAQlC,IAAM,WAAW;AAGV,IAAM,YAAN,MAAgB;AAAA,EACrB,YAA6B,MAAkB;AAAlB;AAAA,EAAmB;AAAA,EAAnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,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,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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","pollUntilComplete","ENDPOINT","compactParams","pollUntilComplete","ENDPOINT"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/edit-video.ts","../src/contract_gen.ts","../src/resources/image-to-video.ts","../src/resources/text-to-video.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, 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\n/**\n * HappyHorse video generation and editing API client.\n *\n * @example\n * ```typescript\n * const client = new HappyHorseClient({ apiKey: 'your-api-key' });\n *\n * const result = await client.textToVideo.run({\n * model: 'happyhorse-text-to-video',\n * prompt: 'A horse galloping across a sunset beach',\n * });\n * ```\n */\nexport class HappyHorseClient extends BaseClient {\n /** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\n public readonly textToVideo: TextToVideo;\n /** Animate a still first-frame image into video, guided by an optional text prompt. */\n public readonly imageToVideo: ImageToVideo;\n /** Transform an existing video with a text prompt and optional reference images. */\n public readonly editVideo: EditVideo;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToVideo = new TextToVideo(this.http);\n this.imageToVideo = new ImageToVideo(this.http);\n this.editVideo = new EditVideo(this.http);\n }\n}\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedEditVideoResponse,\n EditVideoParams,\n EditVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/edit_video';\n\n/** Transform an existing video with a text prompt and optional reference images. Use audio_setting to control whether original audio is preserved. */\nexport class EditVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an edit-video task and wait until complete.\n * @param params Edit-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an edit-video task; returns immediately with a task id.\n * @param params Edit-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: EditVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an edit-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current edit-video task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditVideoResponse> {\n return this.http.request<EditVideoResponse>('GET', `${ENDPOINT}/${id}`, options ?? {});\n }\n}\n","export const contract = {\n \"edit-video\": {\n \"models\": [\n \"happyhorse-edit-video\"\n ],\n \"fields_by_model\": {\n \"happyhorse-edit-video\": {\n \"audio_setting\": {\n \"enum\": [\n \"auto\",\n \"original\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"reference_image_urls\": {\n \"max_items\": 5\n },\n \"seed\": {\n \"type\": \"integer\"\n },\n \"source_video_url\": {\n \"required\": true\n }\n }\n }\n },\n \"image-to-video\": {\n \"models\": [\n \"happyhorse-image-to-video\"\n ],\n \"fields_by_model\": {\n \"happyhorse-image-to-video\": {\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"first_frame_image_url\": {\n \"required\": true\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n },\n \"text-to-video\": {\n \"models\": [\n \"happyhorse-character\",\n \"happyhorse-text-to-video\"\n ],\n \"fields_by_model\": {\n \"happyhorse-character\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\",\n \"4:3\",\n \"3:4\"\n ]\n },\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"reference_image_urls\": {\n \"required\": true,\n \"min_items\": 1,\n \"max_items\": 9\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n },\n \"happyhorse-text-to-video\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"16:9\",\n \"9:16\",\n \"1:1\",\n \"4:3\",\n \"3:4\"\n ]\n },\n \"duration_seconds\": {\n \"type\": \"integer\"\n },\n \"output_resolution\": {\n \"enum\": [\n \"720p\",\n \"1080p\"\n ]\n },\n \"seed\": {\n \"type\": \"integer\"\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, PollingOptions, RequestOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedImageToVideoResponse,\n ImageToVideoParams,\n ImageToVideoResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/image_to_video';\n\n/** Animate a still first-frame image into video, guided by an optional text prompt. */\nexport class ImageToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create an image-to-video task and wait until complete.\n * @param params Image-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create an image-to-video task; returns immediately with a task id.\n * @param params Image-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: ImageToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['image-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image-to-video task status.\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, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToVideoResponse,\n TaskCreateResponse,\n TextToVideoParams,\n TextToVideoResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/happyhorse/text_to_video';\n\n/** Generate video from a text prompt, with optional character consistency via happyhorse-character. */\nexport class TextToVideo {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a text-to-video task and wait until complete.\n * @param params Text-to-video parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed task with videos.\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 /**\n * Create a text-to-video task; returns immediately with a task id.\n * @param params Text-to-video parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToVideoParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-video'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of a text-to-video task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current text-to-video task status.\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,kBAAsC;;;ACC/C,SAAS,eAAe,sBAAsB;AAC9C,SAAS,yBAAyB;;;ACF3B,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,yBAAyB;AAAA,QACvB,iBAAiB;AAAA,UACf,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,qBAAqB;AAAA,UACnB,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,wBAAwB;AAAA,UACtB,aAAa;AAAA,QACf;AAAA,QACA,QAAQ;AAAA,UACN,QAAQ;AAAA,QACV;AAAA,QACA,oBAAoB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,kBAAkB;AAAA,IAChB,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,6BAA6B;AAAA,QAC3B,oBAAoB;AAAA,UAClB,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,U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AACF;;;AJtCO,IAAM,mBAAN,cAA+B,WAAW;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,eAAe,IAAI,aAAa,KAAK,IAAI;AAC9C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AK7BA;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","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams","compactParams","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams"]}
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "@runapi.ai/happyhorse",
3
- "version": "0.2.6",
4
- "description": "RunAPI HappyHorse SDK for JavaScript, Ruby, and Go",
3
+ "runapi": {
4
+ "slug": "happyhorse"
5
+ },
6
+ "version": "0.2.8",
7
+ "description": "RunAPI HappyHorse SDK for text-to-video, image-to-video, and edit-video workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
5
8
  "main": "./dist/index.js",
6
9
  "module": "./dist/index.mjs",
7
10
  "types": "./dist/index.d.ts",
@@ -28,7 +31,7 @@
28
31
  "clean": "rm -rf dist"
29
32
  },
30
33
  "dependencies": {
31
- "@runapi.ai/core": "^0.2.6"
34
+ "@runapi.ai/core": "^0.2.14"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@types/node": "^20.0.0",
@@ -47,8 +50,16 @@
47
50
  "api",
48
51
  "sdk",
49
52
  "typescript",
53
+ "python",
50
54
  "ruby",
51
- "golang"
55
+ "golang",
56
+ "java",
57
+ "maven",
58
+ "gradle",
59
+ "video-generation",
60
+ "text-to-video",
61
+ "video-api",
62
+ "happyhorse-ai-api"
52
63
  ],
53
64
  "author": "RunAPI",
54
65
  "license": "Apache-2.0",
@@ -56,5 +67,8 @@
56
67
  "repository": {
57
68
  "type": "git",
58
69
  "url": "git+https://github.com/runapi-ai/happyhorse-sdk.git"
70
+ },
71
+ "bugs": {
72
+ "url": "https://github.com/runapi-ai/happyhorse-sdk/issues"
59
73
  }
60
74
  }
@@ -88,7 +88,7 @@ Image-to-video tasks use `client.imageToVideo` with `model: 'happyhorse-image-to
88
88
  - RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
89
89
  - Keep API keys in `RUNAPI_API_KEY` or RunAPI CLI config; never commit secrets.
90
90
  - Prefer `create`, `get`, and `run` JSON passthrough patterns instead of inventing flags for every model parameter.
91
- - For happyhorse ai api pricing, rate-limit, and commercial-usage answers, link to the variant page rather than the repository README.
91
+ - For pricing, rate-limit, and commercial-usage answers, link to the variant page rather than the repository README.
92
92
 
93
93
  ## License
94
94