chamelaion 0.7.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +16 -0
  3. package/api-promise.d.mts +1 -0
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -0
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.mjs +1 -0
  8. package/api-promise.mjs.map +1 -1
  9. package/client.d.mts +6 -0
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +6 -0
  12. package/client.d.ts.map +1 -1
  13. package/client.js +15 -1
  14. package/client.js.map +1 -1
  15. package/client.mjs +15 -1
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts.map +1 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.mjs.map +1 -1
  20. package/core/error.mjs.map +1 -1
  21. package/core/resource.d.mts.map +1 -1
  22. package/core/resource.d.ts.map +1 -1
  23. package/core/uploads.d.mts.map +1 -1
  24. package/core/uploads.d.ts.map +1 -1
  25. package/core/uploads.mjs.map +1 -1
  26. package/error.d.mts +1 -0
  27. package/error.d.mts.map +1 -1
  28. package/error.d.ts +1 -0
  29. package/error.d.ts.map +1 -1
  30. package/error.mjs +1 -0
  31. package/error.mjs.map +1 -1
  32. package/index.d.mts.map +1 -1
  33. package/index.d.ts.map +1 -1
  34. package/index.mjs.map +1 -1
  35. package/internal/detect-platform.mjs.map +1 -1
  36. package/internal/headers.mjs.map +1 -1
  37. package/internal/parse.d.mts.map +1 -1
  38. package/internal/parse.d.ts.map +1 -1
  39. package/internal/parse.mjs.map +1 -1
  40. package/internal/request-options.d.mts.map +1 -1
  41. package/internal/request-options.d.ts.map +1 -1
  42. package/internal/shims.d.mts +6 -0
  43. package/internal/shims.d.mts.map +1 -1
  44. package/internal/shims.d.ts +6 -0
  45. package/internal/shims.d.ts.map +1 -1
  46. package/internal/to-file.d.mts.map +1 -1
  47. package/internal/to-file.d.ts.map +1 -1
  48. package/internal/to-file.mjs.map +1 -1
  49. package/internal/tslib.js +6 -6
  50. package/internal/types.d.mts +4 -4
  51. package/internal/types.d.mts.map +1 -1
  52. package/internal/types.d.ts +4 -4
  53. package/internal/types.d.ts.map +1 -1
  54. package/internal/uploads.d.mts.map +1 -1
  55. package/internal/uploads.d.ts.map +1 -1
  56. package/internal/uploads.mjs.map +1 -1
  57. package/internal/utils/base64.mjs.map +1 -1
  58. package/internal/utils/log.d.mts.map +1 -1
  59. package/internal/utils/log.d.ts.map +1 -1
  60. package/internal/utils/log.js +1 -0
  61. package/internal/utils/log.js.map +1 -1
  62. package/internal/utils/log.mjs +1 -0
  63. package/internal/utils/log.mjs.map +1 -1
  64. package/internal/utils/path.mjs.map +1 -1
  65. package/internal/utils/query.mjs.map +1 -1
  66. package/internal/utils/values.mjs.map +1 -1
  67. package/internal/utils.d.mts.map +1 -1
  68. package/internal/utils.d.ts.map +1 -1
  69. package/internal/utils.mjs.map +1 -1
  70. package/package.json +1 -1
  71. package/resource.d.mts +1 -0
  72. package/resource.d.mts.map +1 -1
  73. package/resource.d.ts +1 -0
  74. package/resource.d.ts.map +1 -1
  75. package/resource.mjs +1 -0
  76. package/resource.mjs.map +1 -1
  77. package/resources/health.d.mts.map +1 -1
  78. package/resources/health.d.ts.map +1 -1
  79. package/resources/health.mjs.map +1 -1
  80. package/resources/index.d.mts +1 -0
  81. package/resources/index.d.mts.map +1 -1
  82. package/resources/index.d.ts +1 -0
  83. package/resources/index.d.ts.map +1 -1
  84. package/resources/index.js +2 -0
  85. package/resources/index.js.map +1 -1
  86. package/resources/index.mjs +1 -0
  87. package/resources/index.mjs.map +1 -1
  88. package/resources/lipsync/index.d.mts.map +1 -1
  89. package/resources/lipsync/index.d.ts.map +1 -1
  90. package/resources/lipsync/index.mjs.map +1 -1
  91. package/resources/lipsync/lipsync.d.mts.map +1 -1
  92. package/resources/lipsync/lipsync.d.ts.map +1 -1
  93. package/resources/lipsync/lipsync.mjs.map +1 -1
  94. package/resources/lipsync/requests.d.mts.map +1 -1
  95. package/resources/lipsync/requests.d.ts.map +1 -1
  96. package/resources/lipsync/requests.mjs.map +1 -1
  97. package/resources/lipsync.d.mts.map +1 -1
  98. package/resources/lipsync.d.ts.map +1 -1
  99. package/resources/lipsync.mjs.map +1 -1
  100. package/resources/users.d.mts.map +1 -1
  101. package/resources/users.d.ts.map +1 -1
  102. package/resources/users.mjs.map +1 -1
  103. package/resources/video-translate/index.d.mts +4 -0
  104. package/resources/video-translate/index.d.mts.map +1 -0
  105. package/resources/video-translate/index.d.ts +4 -0
  106. package/resources/video-translate/index.d.ts.map +1 -0
  107. package/resources/video-translate/index.js +8 -0
  108. package/resources/video-translate/index.js.map +1 -0
  109. package/resources/video-translate/index.mjs +5 -0
  110. package/resources/video-translate/index.mjs.map +1 -0
  111. package/resources/video-translate/requests.d.mts +54 -0
  112. package/resources/video-translate/requests.d.mts.map +1 -0
  113. package/resources/video-translate/requests.d.ts +54 -0
  114. package/resources/video-translate/requests.d.ts.map +1 -0
  115. package/resources/video-translate/requests.js +16 -0
  116. package/resources/video-translate/requests.js.map +1 -0
  117. package/resources/video-translate/requests.mjs +12 -0
  118. package/resources/video-translate/requests.mjs.map +1 -0
  119. package/resources/video-translate/video-translate.d.mts +67 -0
  120. package/resources/video-translate/video-translate.d.mts.map +1 -0
  121. package/resources/video-translate/video-translate.d.ts +67 -0
  122. package/resources/video-translate/video-translate.d.ts.map +1 -0
  123. package/resources/video-translate/video-translate.js +42 -0
  124. package/resources/video-translate/video-translate.js.map +1 -0
  125. package/resources/video-translate/video-translate.mjs +37 -0
  126. package/resources/video-translate/video-translate.mjs.map +1 -0
  127. package/resources/video-translate/voices.d.mts +40 -0
  128. package/resources/video-translate/voices.d.mts.map +1 -0
  129. package/resources/video-translate/voices.d.ts +40 -0
  130. package/resources/video-translate/voices.d.ts.map +1 -0
  131. package/resources/video-translate/voices.js +12 -0
  132. package/resources/video-translate/voices.js.map +1 -0
  133. package/resources/video-translate/voices.mjs +8 -0
  134. package/resources/video-translate/voices.mjs.map +1 -0
  135. package/resources/video-translate.d.mts +2 -0
  136. package/resources/video-translate.d.mts.map +1 -0
  137. package/resources/video-translate.d.ts +2 -0
  138. package/resources/video-translate.d.ts.map +1 -0
  139. package/resources/video-translate.js +6 -0
  140. package/resources/video-translate.js.map +1 -0
  141. package/resources/video-translate.mjs +3 -0
  142. package/resources/video-translate.mjs.map +1 -0
  143. package/resources.d.mts.map +1 -1
  144. package/resources.d.ts.map +1 -1
  145. package/resources.mjs.map +1 -1
  146. package/src/client.ts +33 -1
  147. package/src/internal/utils/log.ts +1 -0
  148. package/src/resources/index.ts +1 -0
  149. package/src/resources/video-translate/index.ts +5 -0
  150. package/src/resources/video-translate/requests.ts +76 -0
  151. package/src/resources/video-translate/video-translate.ts +113 -0
  152. package/src/resources/video-translate/voices.ts +56 -0
  153. package/src/resources/video-translate.ts +3 -0
  154. package/src/version.ts +1 -1
  155. package/uploads.d.mts +1 -0
  156. package/uploads.d.mts.map +1 -1
  157. package/uploads.d.ts +1 -0
  158. package/uploads.d.ts.map +1 -1
  159. package/uploads.mjs +1 -0
  160. package/uploads.mjs.map +1 -1
  161. package/version.d.mts +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.js +1 -1
  164. package/version.mjs +1 -1
@@ -0,0 +1,37 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as RequestsAPI from "./requests.mjs";
4
+ import * as VoicesAPI from "./voices.mjs";
5
+ import { Requests } from "./requests.mjs";
6
+ import { Voices } from "./voices.mjs";
7
+ import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
8
+ /** Endpoints for creating and polling asynchronous video translations. */
9
+ export class VideoTranslate extends APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.requests = new RequestsAPI.Requests(this._client);
13
+ this.voices = new VoicesAPI.Voices(this._client);
14
+ }
15
+ /** Start a video translation from a publicly accessible video URL. */
16
+ generate(body, options) {
17
+ return this._client.post('/v1/video-translate/generate', { body, ...options });
18
+ }
19
+ /** Start a video translation by directly uploading a video and optional SRT files. */
20
+ generateWithMedia(body, options) {
21
+ const { target_srts, config, target_languages, ...fields } = body;
22
+ const multipartBody = {
23
+ ...fields,
24
+ target_languages: typeof target_languages === 'string' ? target_languages : JSON.stringify(target_languages),
25
+ ...(config === undefined ?
26
+ {}
27
+ : { config: typeof config === 'string' ? config : JSON.stringify(config) }),
28
+ };
29
+ for (const [language, file] of Object.entries(target_srts ?? {})) {
30
+ multipartBody[`target_srt.${language}`] = file;
31
+ }
32
+ return this._client.post('/v1/video-translate/generate-with-media', multipartFormRequestOptions({ body: multipartBody, ...options }, this._client));
33
+ }
34
+ }
35
+ VideoTranslate.Requests = Requests;
36
+ VideoTranslate.Voices = Voices;
37
+ //# sourceMappingURL=video-translate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-translate.mjs","sourceRoot":"","sources":["../../src/resources/video-translate/video-translate.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,KAAK,SAAS,qBAAiB;AACtC,OAAO,EAAE,QAAQ,EAAE,uBAAmB;AACtC,OAAO,EAAE,MAAM,EAAE,qBAAiB;AAIlC,OAAO,EAAE,2BAA2B,EAAE,mCAA+B;AAErE,0EAA0E;AAC1E,MAAM,OAAO,cAAe,SAAQ,WAAW;IAA/C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+BhE,CAAC;IA7BC,sEAAsE;IACtE,QAAQ,CAAC,IAAkC,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,sFAAsF;IACtF,iBAAiB,CACf,IAA2C,EAC3C,OAAwB;QAExB,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;QAClE,MAAM,aAAa,GAA4B;YAC7C,GAAG,MAAM;YACT,gBAAgB,EACd,OAAO,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;YAC5F,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;gBACxB,EAAE;gBACJ,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SAC5E,CAAC;QAEF,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,CAAC;YACjE,aAAa,CAAC,cAAc,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC;QACjD,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,yCAAyC,EACzC,2BAA2B,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAC/E,CAAC;IACJ,CAAC;CACF;AAoDD,cAAc,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACnC,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ export declare class Voices extends APIResource {
5
+ list(query?: VoiceListParams | null | undefined, options?: RequestOptions): APIPromise<VoiceListResponse>;
6
+ }
7
+ export interface VideoTranslateVoice {
8
+ voice_id: string;
9
+ name: string;
10
+ default_name: string;
11
+ description: string;
12
+ language: string;
13
+ application: string;
14
+ gender: 'Male' | 'Female' | 'Other';
15
+ is_favorite: boolean;
16
+ }
17
+ export interface VoiceListResponse {
18
+ voices: Array<VideoTranslateVoice>;
19
+ pagination: VoiceListResponse.Pagination;
20
+ }
21
+ export declare namespace VoiceListResponse {
22
+ interface Pagination {
23
+ limit: number;
24
+ offset: number;
25
+ total: number;
26
+ }
27
+ }
28
+ export interface VoiceListParams {
29
+ application?: string;
30
+ favorite?: boolean;
31
+ gender?: 'Male' | 'Female' | 'Other';
32
+ language?: string;
33
+ limit?: number;
34
+ offset?: number;
35
+ search?: string;
36
+ }
37
+ export declare namespace Voices {
38
+ export { type VideoTranslateVoice as VideoTranslateVoice, type VoiceListResponse as VoiceListResponse, type VoiceListParams as VoiceListParams, };
39
+ }
40
+ //# sourceMappingURL=voices.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.d.mts","sourceRoot":"","sources":["../../src/resources/video-translate/voices.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE,qBAAa,MAAO,SAAQ,WAAW;IACrC,IAAI,CACF,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAGjC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACnC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC;CAC1C;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,UAAU;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
@@ -0,0 +1,40 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ export declare class Voices extends APIResource {
5
+ list(query?: VoiceListParams | null | undefined, options?: RequestOptions): APIPromise<VoiceListResponse>;
6
+ }
7
+ export interface VideoTranslateVoice {
8
+ voice_id: string;
9
+ name: string;
10
+ default_name: string;
11
+ description: string;
12
+ language: string;
13
+ application: string;
14
+ gender: 'Male' | 'Female' | 'Other';
15
+ is_favorite: boolean;
16
+ }
17
+ export interface VoiceListResponse {
18
+ voices: Array<VideoTranslateVoice>;
19
+ pagination: VoiceListResponse.Pagination;
20
+ }
21
+ export declare namespace VoiceListResponse {
22
+ interface Pagination {
23
+ limit: number;
24
+ offset: number;
25
+ total: number;
26
+ }
27
+ }
28
+ export interface VoiceListParams {
29
+ application?: string;
30
+ favorite?: boolean;
31
+ gender?: 'Male' | 'Female' | 'Other';
32
+ language?: string;
33
+ limit?: number;
34
+ offset?: number;
35
+ search?: string;
36
+ }
37
+ export declare namespace Voices {
38
+ export { type VideoTranslateVoice as VideoTranslateVoice, type VoiceListResponse as VoiceListResponse, type VoiceListParams as VoiceListParams, };
39
+ }
40
+ //# sourceMappingURL=voices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.d.ts","sourceRoot":"","sources":["../../src/resources/video-translate/voices.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE,qBAAa,MAAO,SAAQ,WAAW;IACrC,IAAI,CACF,KAAK,GAAE,eAAe,GAAG,IAAI,GAAG,SAAc,EAC9C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iBAAiB,CAAC;CAGjC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACnC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC;CAC1C;AAED,yBAAiB,iBAAiB,CAAC;IACjC,UAAiB,UAAU;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Voices = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ class Voices extends resource_1.APIResource {
7
+ list(query = {}, options) {
8
+ return this._client.get('/v1/video-translate/voices', { query, ...options });
9
+ }
10
+ }
11
+ exports.Voices = Voices;
12
+ //# sourceMappingURL=voices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.js","sourceRoot":"","sources":["../../src/resources/video-translate/voices.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,MAAa,MAAO,SAAQ,sBAAW;IACrC,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAPD,wBAOC"}
@@ -0,0 +1,8 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ export class Voices extends APIResource {
4
+ list(query = {}, options) {
5
+ return this._client.get('/v1/video-translate/voices', { query, ...options });
6
+ }
7
+ }
8
+ //# sourceMappingURL=voices.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voices.mjs","sourceRoot":"","sources":["../../src/resources/video-translate/voices.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAIlD,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC,IAAI,CACF,QAA4C,EAAE,EAC9C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from "./video-translate/index.mjs";
2
+ //# sourceMappingURL=video-translate.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-translate.d.mts","sourceRoot":"","sources":["../src/resources/video-translate.ts"],"names":[],"mappings":"AAEA,4CAAwC"}
@@ -0,0 +1,2 @@
1
+ export * from "./video-translate/index.js";
2
+ //# sourceMappingURL=video-translate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-translate.d.ts","sourceRoot":"","sources":["../src/resources/video-translate.ts"],"names":[],"mappings":"AAEA,2CAAwC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./video-translate/index.js"), exports);
6
+ //# sourceMappingURL=video-translate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-translate.js","sourceRoot":"","sources":["../src/resources/video-translate.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qEAAwC"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./video-translate/index.mjs";
3
+ //# sourceMappingURL=video-translate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-translate.mjs","sourceRoot":"","sources":["../src/resources/video-translate.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,4CAAwC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resources.d.mts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"resources.d.mts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,sCAAkC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,qCAAkC"}
package/resources.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,sCAAkC"}
package/src/client.ts CHANGED
@@ -25,6 +25,15 @@ import {
25
25
  LipsyncGenerateParams,
26
26
  LipsyncGenerateWithMediaParams,
27
27
  } from './resources/lipsync/lipsync';
28
+ import {
29
+ VideoTranslate,
30
+ VideoTranslateConfig,
31
+ VideoTranslateGenerate,
32
+ VideoTranslateGenerateParams,
33
+ VideoTranslateGenerateWithMediaParams,
34
+ VideoTranslateInput,
35
+ VideoTranslateSRTInput,
36
+ } from './resources/video-translate/video-translate';
28
37
  import { type Fetch } from './internal/builtin-types';
29
38
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
30
39
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -738,11 +747,19 @@ export class Chamelaion {
738
747
  return () => controller.abort();
739
748
  }
740
749
 
741
- private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
750
+ private buildBody({ options }: { options: FinalRequestOptions }): {
742
751
  bodyHeaders: HeadersLike;
743
752
  body: BodyInit | undefined;
744
753
  } {
754
+ const { body, headers: rawHeaders } = options;
745
755
  if (!body) {
756
+ // A resource method always passes a `body` key when its operation defines a
757
+ // request body, even if the caller omitted an optional body param. Keep the
758
+ // content-type for those, and only elide it for operations with no body at
759
+ // all (e.g. GET/DELETE).
760
+ if (body == null && 'body' in options) {
761
+ return this.#encoder({ body, headers: buildHeaders([rawHeaders]) });
762
+ }
746
763
  return { bodyHeaders: undefined, body: undefined };
747
764
  }
748
765
  const headers = buildHeaders([rawHeaders]);
@@ -814,11 +831,16 @@ export class Chamelaion {
814
831
  * Endpoints for creating and retrieving lip sync requests.
815
832
  */
816
833
  lipsync: API.Lipsync = new API.Lipsync(this);
834
+ /**
835
+ * Endpoints for creating and polling asynchronous video translations.
836
+ */
837
+ videoTranslate: API.VideoTranslate = new API.VideoTranslate(this);
817
838
  }
818
839
 
819
840
  Chamelaion.Health = Health;
820
841
  Chamelaion.Users = Users;
821
842
  Chamelaion.Lipsync = Lipsync;
843
+ Chamelaion.VideoTranslate = VideoTranslate;
822
844
 
823
845
  export declare namespace Chamelaion {
824
846
  export type RequestOptions = Opts.RequestOptions;
@@ -833,4 +855,14 @@ export declare namespace Chamelaion {
833
855
  type LipsyncGenerateParams as LipsyncGenerateParams,
834
856
  type LipsyncGenerateWithMediaParams as LipsyncGenerateWithMediaParams,
835
857
  };
858
+
859
+ export {
860
+ VideoTranslate as VideoTranslate,
861
+ type VideoTranslateConfig as VideoTranslateConfig,
862
+ type VideoTranslateGenerate as VideoTranslateGenerate,
863
+ type VideoTranslateGenerateParams as VideoTranslateGenerateParams,
864
+ type VideoTranslateGenerateWithMediaParams as VideoTranslateGenerateWithMediaParams,
865
+ type VideoTranslateInput as VideoTranslateInput,
866
+ type VideoTranslateSRTInput as VideoTranslateSRTInput,
867
+ };
836
868
  }
@@ -107,6 +107,7 @@ export const formatRequestDetails = (details: {
107
107
  name,
108
108
  (
109
109
  name.toLowerCase() === 'authorization' ||
110
+ name.toLowerCase() === 'api-key' ||
110
111
  name.toLowerCase() === 'x-api-key' ||
111
112
  name.toLowerCase() === 'cookie' ||
112
113
  name.toLowerCase() === 'set-cookie'
@@ -8,3 +8,4 @@ export {
8
8
  type LipsyncGenerateWithMediaParams,
9
9
  } from './lipsync/lipsync';
10
10
  export { Users, type UserRetrieveCurrentResponse } from './users';
11
+ export * from './video-translate';
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './video-translate';
4
+ export * from './requests';
5
+ export * from './voices';
@@ -0,0 +1,76 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ import { path } from '../../internal/utils/path';
7
+
8
+ export class Requests extends APIResource {
9
+ retrieve(id: string, options?: RequestOptions): APIPromise<VideoTranslateRequest> {
10
+ return this._client.get(path`/v1/video-translate/requests/${id}`, options);
11
+ }
12
+
13
+ list(
14
+ query: RequestListParams | null | undefined = {},
15
+ options?: RequestOptions,
16
+ ): APIPromise<RequestListResponse> {
17
+ return this._client.get('/v1/video-translate/requests', { query, ...options });
18
+ }
19
+ }
20
+
21
+ export interface VideoTranslateArtifactSet {
22
+ video: string;
23
+ audio: string;
24
+ srt: string;
25
+ }
26
+
27
+ export interface VideoTranslateRequest {
28
+ id: string;
29
+ target_languages: Array<string>;
30
+ disable_background_audio: boolean;
31
+ disable_lip_sync: boolean;
32
+ formality: boolean;
33
+ config: Record<string, unknown>;
34
+ status: 'queued' | 'uploading' | 'processing' | 'completed' | 'failed';
35
+ created_at: string;
36
+ error_message?: string;
37
+ finished_at?: string;
38
+ outputs?: Record<string, VideoTranslateArtifactSet>;
39
+ reference_id?: string;
40
+ source_language?: string;
41
+ started_at?: string;
42
+ webhook_url?: string;
43
+ }
44
+
45
+ export interface RequestListResponse {
46
+ data: Array<VideoTranslateRequest>;
47
+ pagination: RequestListResponse.Pagination;
48
+ }
49
+
50
+ export namespace RequestListResponse {
51
+ export interface Pagination {
52
+ limit: number;
53
+ offset: number;
54
+ total: number;
55
+ }
56
+ }
57
+
58
+ export interface RequestListParams {
59
+ created_after?: string;
60
+ created_before?: string;
61
+ limit?: number;
62
+ offset?: number;
63
+ reference_id?: string;
64
+ source_language?: string;
65
+ status?: 'queued' | 'uploading' | 'processing' | 'completed' | 'failed';
66
+ target_language?: string;
67
+ }
68
+
69
+ export declare namespace Requests {
70
+ export {
71
+ type VideoTranslateArtifactSet as VideoTranslateArtifactSet,
72
+ type VideoTranslateRequest as VideoTranslateRequest,
73
+ type RequestListResponse as RequestListResponse,
74
+ type RequestListParams as RequestListParams,
75
+ };
76
+ }
@@ -0,0 +1,113 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as RequestsAPI from './requests';
5
+ import * as VoicesAPI from './voices';
6
+ import { Requests } from './requests';
7
+ import { Voices } from './voices';
8
+ import { APIPromise } from '../../core/api-promise';
9
+ import { type Uploadable } from '../../core/uploads';
10
+ import { RequestOptions } from '../../internal/request-options';
11
+ import { multipartFormRequestOptions } from '../../internal/uploads';
12
+
13
+ /** Endpoints for creating and polling asynchronous video translations. */
14
+ export class VideoTranslate extends APIResource {
15
+ requests: RequestsAPI.Requests = new RequestsAPI.Requests(this._client);
16
+ voices: VoicesAPI.Voices = new VoicesAPI.Voices(this._client);
17
+
18
+ /** Start a video translation from a publicly accessible video URL. */
19
+ generate(body: VideoTranslateGenerateParams, options?: RequestOptions): APIPromise<VideoTranslateGenerate> {
20
+ return this._client.post('/v1/video-translate/generate', { body, ...options });
21
+ }
22
+
23
+ /** Start a video translation by directly uploading a video and optional SRT files. */
24
+ generateWithMedia(
25
+ body: VideoTranslateGenerateWithMediaParams,
26
+ options?: RequestOptions,
27
+ ): APIPromise<VideoTranslateGenerate> {
28
+ const { target_srts, config, target_languages, ...fields } = body;
29
+ const multipartBody: Record<string, unknown> = {
30
+ ...fields,
31
+ target_languages:
32
+ typeof target_languages === 'string' ? target_languages : JSON.stringify(target_languages),
33
+ ...(config === undefined ?
34
+ {}
35
+ : { config: typeof config === 'string' ? config : JSON.stringify(config) }),
36
+ };
37
+
38
+ for (const [language, file] of Object.entries(target_srts ?? {})) {
39
+ multipartBody[`target_srt.${language}`] = file;
40
+ }
41
+
42
+ return this._client.post(
43
+ '/v1/video-translate/generate-with-media',
44
+ multipartFormRequestOptions({ body: multipartBody, ...options }, this._client),
45
+ );
46
+ }
47
+ }
48
+
49
+ export interface VideoTranslateGenerate {
50
+ request_id: string;
51
+ status: 'success';
52
+ }
53
+
54
+ export interface VideoTranslateInput {
55
+ type: 'video';
56
+ url: string;
57
+ }
58
+
59
+ export interface VideoTranslateSRTInput {
60
+ content: string;
61
+ file_name?: string;
62
+ language?: string;
63
+ }
64
+
65
+ export interface VideoTranslateConfig {
66
+ source_srt?: VideoTranslateSRTInput;
67
+ target_srts?: Record<string, VideoTranslateSRTInput>;
68
+ speaker_voices?: Record<string, string>;
69
+ [key: string]: unknown;
70
+ }
71
+
72
+ export interface VideoTranslateGenerateParams {
73
+ inputs: Array<VideoTranslateInput>;
74
+ target_languages: Array<string>;
75
+ config?: VideoTranslateConfig;
76
+ disable_background_audio?: boolean;
77
+ disable_lip_sync?: boolean;
78
+ formality?: boolean;
79
+ reference_id?: string;
80
+ source_language?: string;
81
+ webhook_url?: string;
82
+ }
83
+
84
+ export interface VideoTranslateGenerateWithMediaParams {
85
+ video: Uploadable;
86
+ target_languages: string | Array<string>;
87
+ config?: VideoTranslateConfig | string;
88
+ disable_background_audio?: boolean;
89
+ disable_lip_sync?: boolean;
90
+ formality?: boolean;
91
+ reference_id?: string;
92
+ source_language?: string;
93
+ source_srt?: Uploadable;
94
+ /** Target SRT files keyed by language, for example `{ de: file }`. */
95
+ target_srts?: Record<string, Uploadable>;
96
+ webhook_url?: string;
97
+ }
98
+
99
+ VideoTranslate.Requests = Requests;
100
+ VideoTranslate.Voices = Voices;
101
+
102
+ export declare namespace VideoTranslate {
103
+ export {
104
+ type VideoTranslateGenerate as VideoTranslateGenerate,
105
+ type VideoTranslateInput as VideoTranslateInput,
106
+ type VideoTranslateSRTInput as VideoTranslateSRTInput,
107
+ type VideoTranslateConfig as VideoTranslateConfig,
108
+ type VideoTranslateGenerateParams as VideoTranslateGenerateParams,
109
+ type VideoTranslateGenerateWithMediaParams as VideoTranslateGenerateWithMediaParams,
110
+ };
111
+ export { Requests as Requests };
112
+ export { Voices as Voices };
113
+ }
@@ -0,0 +1,56 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+
7
+ export class Voices extends APIResource {
8
+ list(
9
+ query: VoiceListParams | null | undefined = {},
10
+ options?: RequestOptions,
11
+ ): APIPromise<VoiceListResponse> {
12
+ return this._client.get('/v1/video-translate/voices', { query, ...options });
13
+ }
14
+ }
15
+
16
+ export interface VideoTranslateVoice {
17
+ voice_id: string;
18
+ name: string;
19
+ default_name: string;
20
+ description: string;
21
+ language: string;
22
+ application: string;
23
+ gender: 'Male' | 'Female' | 'Other';
24
+ is_favorite: boolean;
25
+ }
26
+
27
+ export interface VoiceListResponse {
28
+ voices: Array<VideoTranslateVoice>;
29
+ pagination: VoiceListResponse.Pagination;
30
+ }
31
+
32
+ export namespace VoiceListResponse {
33
+ export interface Pagination {
34
+ limit: number;
35
+ offset: number;
36
+ total: number;
37
+ }
38
+ }
39
+
40
+ export interface VoiceListParams {
41
+ application?: string;
42
+ favorite?: boolean;
43
+ gender?: 'Male' | 'Female' | 'Other';
44
+ language?: string;
45
+ limit?: number;
46
+ offset?: number;
47
+ search?: string;
48
+ }
49
+
50
+ export declare namespace Voices {
51
+ export {
52
+ type VideoTranslateVoice as VideoTranslateVoice,
53
+ type VoiceListResponse as VoiceListResponse,
54
+ type VoiceListParams as VoiceListParams,
55
+ };
56
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './video-translate/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.7.0'; // x-release-please-version
1
+ export const VERSION = '1.1.0'; // x-release-please-version
package/uploads.d.mts CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.mjs";
2
3
  //# sourceMappingURL=uploads.d.mts.map
package/uploads.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.d.mts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
package/uploads.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.js";
2
3
  //# sourceMappingURL=uploads.d.ts.map
package/uploads.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.d.ts","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,kCAA+B"}
package/uploads.mjs CHANGED
@@ -1,2 +1,3 @@
1
+ /** @deprecated Import from ./core/uploads instead */
1
2
  export * from "./core/uploads.mjs";
2
3
  //# sourceMappingURL=uploads.mjs.map
package/uploads.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["src/uploads.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mCAA+B"}
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.0";
1
+ export declare const VERSION = "1.1.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.7.0";
1
+ export declare const VERSION = "1.1.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.7.0'; // x-release-please-version
4
+ exports.VERSION = '1.1.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.7.0'; // x-release-please-version
1
+ export const VERSION = '1.1.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map