@cartesia/cartesia-js 2.0.3 → 2.1.0-alpha0

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 (142) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +11 -6
  3. package/api/resources/apiStatus/client/Client.js +1 -1
  4. package/api/resources/datasets/client/Client.d.ts +70 -0
  5. package/api/resources/datasets/client/Client.js +261 -0
  6. package/api/resources/datasets/client/index.d.ts +1 -0
  7. package/api/resources/datasets/client/index.js +17 -0
  8. package/api/resources/datasets/client/requests/UploadDatasetFileRequest.d.ts +11 -0
  9. package/api/resources/datasets/client/requests/UploadDatasetFileRequest.js +5 -0
  10. package/api/resources/datasets/client/requests/index.d.ts +1 -0
  11. package/api/resources/datasets/client/requests/index.js +2 -0
  12. package/api/resources/datasets/index.d.ts +2 -0
  13. package/api/resources/datasets/index.js +18 -0
  14. package/api/resources/datasets/types/CreateDatasetRequest.d.ts +6 -0
  15. package/api/resources/datasets/types/CreateDatasetRequest.js +5 -0
  16. package/api/resources/datasets/types/Dataset.d.ts +8 -0
  17. package/api/resources/datasets/types/Dataset.js +5 -0
  18. package/api/resources/datasets/types/DatasetFile.d.ts +8 -0
  19. package/api/resources/datasets/types/DatasetFile.js +5 -0
  20. package/api/resources/datasets/types/FilePurpose.d.ts +7 -0
  21. package/api/resources/datasets/types/FilePurpose.js +9 -0
  22. package/api/resources/datasets/types/PaginatedDatasetFiles.d.ts +8 -0
  23. package/api/resources/datasets/types/PaginatedDatasetFiles.js +5 -0
  24. package/api/resources/datasets/types/PaginatedDatasets.d.ts +8 -0
  25. package/api/resources/datasets/types/PaginatedDatasets.js +5 -0
  26. package/api/resources/datasets/types/index.d.ts +6 -0
  27. package/api/resources/datasets/types/index.js +22 -0
  28. package/api/resources/index.d.ts +3 -0
  29. package/api/resources/index.js +4 -1
  30. package/api/resources/tts/client/Client.d.ts +1 -3
  31. package/api/resources/tts/client/Client.js +3 -3
  32. package/api/resources/voiceChanger/client/Client.d.ts +1 -2
  33. package/api/resources/voiceChanger/client/Client.js +3 -3
  34. package/api/resources/voices/client/Client.js +8 -8
  35. package/api/resources/voices/types/LocalizeDialect.d.ts +11 -11
  36. package/api/resources/voices/types/LocalizeDialect.js +0 -8
  37. package/api/resources/voices/types/LocalizeEnglishDialect.d.ts +11 -0
  38. package/api/resources/voices/types/LocalizeEnglishDialect.js +13 -0
  39. package/api/resources/voices/types/index.d.ts +1 -0
  40. package/api/resources/voices/types/index.js +1 -0
  41. package/core/fetcher/Fetcher.d.ts +1 -1
  42. package/core/fetcher/getResponseBody.js +3 -0
  43. package/core/index.d.ts +1 -1
  44. package/core/index.js +1 -1
  45. package/dist/Client.d.ts +3 -0
  46. package/dist/Client.js +11 -6
  47. package/dist/api/resources/apiStatus/client/Client.js +1 -1
  48. package/dist/api/resources/datasets/client/Client.d.ts +70 -0
  49. package/dist/api/resources/datasets/client/Client.js +261 -0
  50. package/dist/api/resources/datasets/client/index.d.ts +1 -0
  51. package/dist/api/resources/datasets/client/index.js +17 -0
  52. package/dist/api/resources/datasets/client/requests/UploadDatasetFileRequest.d.ts +11 -0
  53. package/dist/api/resources/datasets/client/requests/UploadDatasetFileRequest.js +5 -0
  54. package/dist/api/resources/datasets/client/requests/index.d.ts +1 -0
  55. package/dist/api/resources/datasets/client/requests/index.js +2 -0
  56. package/dist/api/resources/datasets/index.d.ts +2 -0
  57. package/dist/api/resources/datasets/index.js +18 -0
  58. package/dist/api/resources/datasets/types/CreateDatasetRequest.d.ts +6 -0
  59. package/dist/api/resources/datasets/types/CreateDatasetRequest.js +5 -0
  60. package/dist/api/resources/datasets/types/Dataset.d.ts +8 -0
  61. package/dist/api/resources/datasets/types/Dataset.js +5 -0
  62. package/dist/api/resources/datasets/types/DatasetFile.d.ts +8 -0
  63. package/dist/api/resources/datasets/types/DatasetFile.js +5 -0
  64. package/dist/api/resources/datasets/types/FilePurpose.d.ts +7 -0
  65. package/dist/api/resources/datasets/types/FilePurpose.js +9 -0
  66. package/dist/api/resources/datasets/types/PaginatedDatasetFiles.d.ts +8 -0
  67. package/dist/api/resources/datasets/types/PaginatedDatasetFiles.js +5 -0
  68. package/dist/api/resources/datasets/types/PaginatedDatasets.d.ts +8 -0
  69. package/dist/api/resources/datasets/types/PaginatedDatasets.js +5 -0
  70. package/dist/api/resources/datasets/types/index.d.ts +6 -0
  71. package/dist/api/resources/datasets/types/index.js +22 -0
  72. package/dist/api/resources/index.d.ts +3 -0
  73. package/dist/api/resources/index.js +4 -1
  74. package/dist/api/resources/tts/client/Client.d.ts +1 -3
  75. package/dist/api/resources/tts/client/Client.js +3 -3
  76. package/dist/api/resources/voiceChanger/client/Client.d.ts +1 -2
  77. package/dist/api/resources/voiceChanger/client/Client.js +3 -3
  78. package/dist/api/resources/voices/client/Client.js +8 -8
  79. package/dist/api/resources/voices/types/LocalizeDialect.d.ts +11 -11
  80. package/dist/api/resources/voices/types/LocalizeDialect.js +0 -8
  81. package/dist/api/resources/voices/types/LocalizeEnglishDialect.d.ts +11 -0
  82. package/dist/api/resources/voices/types/LocalizeEnglishDialect.js +13 -0
  83. package/dist/api/resources/voices/types/index.d.ts +1 -0
  84. package/dist/api/resources/voices/types/index.js +1 -0
  85. package/dist/core/fetcher/Fetcher.d.ts +1 -1
  86. package/dist/core/fetcher/getResponseBody.js +3 -0
  87. package/dist/core/index.d.ts +1 -1
  88. package/dist/core/index.js +1 -1
  89. package/dist/serialization/resources/datasets/index.d.ts +1 -0
  90. package/dist/serialization/resources/datasets/index.js +17 -0
  91. package/dist/serialization/resources/datasets/types/CreateDatasetRequest.d.ts +12 -0
  92. package/dist/serialization/resources/datasets/types/CreateDatasetRequest.js +33 -0
  93. package/dist/serialization/resources/datasets/types/Dataset.d.ts +14 -0
  94. package/dist/serialization/resources/datasets/types/Dataset.js +35 -0
  95. package/dist/serialization/resources/datasets/types/DatasetFile.d.ts +14 -0
  96. package/dist/serialization/resources/datasets/types/DatasetFile.js +35 -0
  97. package/dist/serialization/resources/datasets/types/FilePurpose.d.ts +10 -0
  98. package/dist/serialization/resources/datasets/types/FilePurpose.js +31 -0
  99. package/dist/serialization/resources/datasets/types/PaginatedDatasetFiles.d.ts +14 -0
  100. package/dist/serialization/resources/datasets/types/PaginatedDatasetFiles.js +35 -0
  101. package/dist/serialization/resources/datasets/types/PaginatedDatasets.d.ts +14 -0
  102. package/dist/serialization/resources/datasets/types/PaginatedDatasets.js +35 -0
  103. package/dist/serialization/resources/datasets/types/index.d.ts +6 -0
  104. package/dist/serialization/resources/datasets/types/index.js +22 -0
  105. package/dist/serialization/resources/index.d.ts +2 -0
  106. package/dist/serialization/resources/index.js +3 -1
  107. package/dist/serialization/resources/voices/types/LocalizeDialect.d.ts +2 -1
  108. package/dist/serialization/resources/voices/types/LocalizeDialect.js +2 -1
  109. package/dist/serialization/resources/voices/types/LocalizeEnglishDialect.d.ts +10 -0
  110. package/dist/serialization/resources/voices/types/LocalizeEnglishDialect.js +31 -0
  111. package/dist/serialization/resources/voices/types/index.d.ts +1 -0
  112. package/dist/serialization/resources/voices/types/index.js +1 -0
  113. package/dist/version.d.ts +1 -1
  114. package/dist/version.js +1 -1
  115. package/package.json +1 -1
  116. package/reference.md +204 -0
  117. package/serialization/resources/datasets/index.d.ts +1 -0
  118. package/serialization/resources/datasets/index.js +17 -0
  119. package/serialization/resources/datasets/types/CreateDatasetRequest.d.ts +12 -0
  120. package/serialization/resources/datasets/types/CreateDatasetRequest.js +33 -0
  121. package/serialization/resources/datasets/types/Dataset.d.ts +14 -0
  122. package/serialization/resources/datasets/types/Dataset.js +35 -0
  123. package/serialization/resources/datasets/types/DatasetFile.d.ts +14 -0
  124. package/serialization/resources/datasets/types/DatasetFile.js +35 -0
  125. package/serialization/resources/datasets/types/FilePurpose.d.ts +10 -0
  126. package/serialization/resources/datasets/types/FilePurpose.js +31 -0
  127. package/serialization/resources/datasets/types/PaginatedDatasetFiles.d.ts +14 -0
  128. package/serialization/resources/datasets/types/PaginatedDatasetFiles.js +35 -0
  129. package/serialization/resources/datasets/types/PaginatedDatasets.d.ts +14 -0
  130. package/serialization/resources/datasets/types/PaginatedDatasets.js +35 -0
  131. package/serialization/resources/datasets/types/index.d.ts +6 -0
  132. package/serialization/resources/datasets/types/index.js +22 -0
  133. package/serialization/resources/index.d.ts +2 -0
  134. package/serialization/resources/index.js +3 -1
  135. package/serialization/resources/voices/types/LocalizeDialect.d.ts +2 -1
  136. package/serialization/resources/voices/types/LocalizeDialect.js +2 -1
  137. package/serialization/resources/voices/types/LocalizeEnglishDialect.d.ts +10 -0
  138. package/serialization/resources/voices/types/LocalizeEnglishDialect.js +31 -0
  139. package/serialization/resources/voices/types/index.d.ts +1 -0
  140. package/serialization/resources/voices/types/index.js +1 -0
  141. package/version.d.ts +1 -1
  142. package/version.js +1 -1
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- /// <reference types="node" />
5
4
  import * as environments from "../../../../environments";
6
5
  import * as core from "../../../../core";
7
6
  import * as Cartesia from "../../../index";
8
- import * as stream from "stream";
9
7
  export declare namespace Tts {
10
8
  interface Options {
11
9
  environment?: core.Supplier<environments.CartesiaEnvironment | string>;
@@ -28,7 +26,7 @@ export declare namespace Tts {
28
26
  export declare class Tts {
29
27
  protected readonly _options: Tts.Options;
30
28
  constructor(_options?: Tts.Options);
31
- bytes(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<stream.Readable>;
29
+ bytes(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<ArrayBuffer>;
32
30
  sse(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<core.Stream<Cartesia.WebSocketResponse>>;
33
31
  protected _getCustomAuthorizationHeaders(): Promise<{
34
32
  "X-API-Key": string | undefined;
@@ -54,11 +54,11 @@ class Tts {
54
54
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
55
55
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/tts/bytes"),
56
56
  method: "POST",
57
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
57
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.4-alpha0", "User-Agent": "@cartesia/cartesia-js/2.0.4-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
58
58
  contentType: "application/json",
59
59
  requestType: "json",
60
60
  body: serializers.TtsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
61
- responseType: "streaming",
61
+ responseType: "arraybuffer",
62
62
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
63
63
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
64
64
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -93,7 +93,7 @@ class Tts {
93
93
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
94
94
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/tts/sse"),
95
95
  method: "POST",
96
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
96
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.4-alpha0", "User-Agent": "@cartesia/cartesia-js/2.0.4-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
97
97
  contentType: "application/json",
98
98
  requestType: "json",
99
99
  body: serializers.TtsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -7,7 +7,6 @@ import * as core from "../../../../core";
7
7
  import * as fs from "fs";
8
8
  import { Blob } from "buffer";
9
9
  import * as Cartesia from "../../../index";
10
- import * as stream from "stream";
11
10
  export declare namespace VoiceChanger {
12
11
  interface Options {
13
12
  environment?: core.Supplier<environments.CartesiaEnvironment | string>;
@@ -35,7 +34,7 @@ export declare class VoiceChanger {
35
34
  *
36
35
  * This endpoint is priced at 15 characters per second of input audio.
37
36
  */
38
- bytes(clip: File | fs.ReadStream | Blob, request: Cartesia.VoiceChangerBytesRequest, requestOptions?: VoiceChanger.RequestOptions): Promise<stream.Readable>;
37
+ bytes(clip: File | fs.ReadStream | Blob, request: Cartesia.VoiceChangerBytesRequest, requestOptions?: VoiceChanger.RequestOptions): Promise<ArrayBuffer>;
39
38
  sse(clip: File | fs.ReadStream | Blob, request: Cartesia.VoiceChangerSseRequest, requestOptions?: VoiceChanger.RequestOptions): Promise<core.Stream<Cartesia.StreamingResponse>>;
40
39
  protected _getCustomAuthorizationHeaders(): Promise<{
41
40
  "X-API-Key": string | undefined;
@@ -71,11 +71,11 @@ class VoiceChanger {
71
71
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
72
72
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voice-changer/bytes"),
73
73
  method: "POST",
74
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
74
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.4-alpha0", "User-Agent": "@cartesia/cartesia-js/2.0.4-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
75
75
  requestType: "file",
76
76
  duplex: _maybeEncodedRequest.duplex,
77
77
  body: _maybeEncodedRequest.body,
78
- responseType: "streaming",
78
+ responseType: "arraybuffer",
79
79
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
80
80
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
81
81
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -122,7 +122,7 @@ class VoiceChanger {
122
122
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
123
123
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voice-changer/sse"),
124
124
  method: "POST",
125
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
125
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.4-alpha0", "User-Agent": "@cartesia/cartesia-js/2.0.4-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
126
126
  requestType: "file",
127
127
  duplex: _maybeEncodedRequest.duplex,
128
128
  body: _maybeEncodedRequest.body,
@@ -60,7 +60,7 @@ class Voices {
60
60
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
61
61
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/"),
62
62
  method: "GET",
63
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
63
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
64
64
  contentType: "application/json",
65
65
  requestType: "json",
66
66
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -116,7 +116,7 @@ class Voices {
116
116
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
117
117
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/"),
118
118
  method: "POST",
119
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
119
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
120
120
  contentType: "application/json",
121
121
  requestType: "json",
122
122
  body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -167,7 +167,7 @@ class Voices {
167
167
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
168
168
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
169
169
  method: "DELETE",
170
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
170
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
171
171
  contentType: "application/json",
172
172
  requestType: "json",
173
173
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -215,7 +215,7 @@ class Voices {
215
215
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
216
216
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
217
217
  method: "PATCH",
218
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
218
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
219
219
  contentType: "application/json",
220
220
  requestType: "json",
221
221
  body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -266,7 +266,7 @@ class Voices {
266
266
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
267
267
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
268
268
  method: "GET",
269
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
269
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
270
270
  contentType: "application/json",
271
271
  requestType: "json",
272
272
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -321,7 +321,7 @@ class Voices {
321
321
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
322
322
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/localize"),
323
323
  method: "POST",
324
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
324
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
325
325
  contentType: "application/json",
326
326
  requestType: "json",
327
327
  body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -377,7 +377,7 @@ class Voices {
377
377
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
378
378
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/mix"),
379
379
  method: "POST",
380
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
380
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
381
381
  contentType: "application/json",
382
382
  requestType: "json",
383
383
  body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -464,7 +464,7 @@ class Voices {
464
464
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
465
465
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/clone"),
466
466
  method: "POST",
467
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
467
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
468
468
  requestType: "file",
469
469
  duplex: _maybeEncodedRequest.duplex,
470
470
  body: _maybeEncodedRequest.body,
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Cartesia from "../../../index";
4
5
  /**
5
- * The dialect to localize to. This is only available when language is set to English.
6
- *
7
- * Options: Australian (au), Indian (in), Southern American (so), UK (uk), US (us).
6
+ * The dialect to localize to.
8
7
  */
9
- export declare type LocalizeDialect = "au" | "in" | "so" | "uk" | "us";
10
- export declare const LocalizeDialect: {
11
- readonly Au: "au";
12
- readonly In: "in";
13
- readonly So: "so";
14
- readonly Uk: "uk";
15
- readonly Us: "us";
16
- };
8
+ export declare type LocalizeDialect =
9
+ /**
10
+ * Only available when language is set to English (`en`).
11
+ * */
12
+ Cartesia.LocalizeEnglishDialect
13
+ /**
14
+ * The standard dialect for the language.
15
+ * */
16
+ | "st";
@@ -3,11 +3,3 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LocalizeDialect = void 0;
7
- exports.LocalizeDialect = {
8
- Au: "au",
9
- In: "in",
10
- So: "so",
11
- Uk: "uk",
12
- Us: "us",
13
- };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type LocalizeEnglishDialect = "au" | "in" | "so" | "uk" | "us";
5
+ export declare const LocalizeEnglishDialect: {
6
+ readonly Au: "au";
7
+ readonly In: "in";
8
+ readonly So: "so";
9
+ readonly Uk: "uk";
10
+ readonly Us: "us";
11
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LocalizeEnglishDialect = void 0;
7
+ exports.LocalizeEnglishDialect = {
8
+ Au: "au",
9
+ In: "in",
10
+ So: "so",
11
+ Uk: "uk",
12
+ Us: "us",
13
+ };
@@ -5,6 +5,7 @@ export * from "./VoiceMetadata";
5
5
  export * from "./CreateVoiceRequest";
6
6
  export * from "./UpdateVoiceRequest";
7
7
  export * from "./LocalizeTargetLanguage";
8
+ export * from "./LocalizeEnglishDialect";
8
9
  export * from "./LocalizeDialect";
9
10
  export * from "./Gender";
10
11
  export * from "./LocalizeVoiceRequest";
@@ -21,6 +21,7 @@ __exportStar(require("./VoiceMetadata"), exports);
21
21
  __exportStar(require("./CreateVoiceRequest"), exports);
22
22
  __exportStar(require("./UpdateVoiceRequest"), exports);
23
23
  __exportStar(require("./LocalizeTargetLanguage"), exports);
24
+ __exportStar(require("./LocalizeEnglishDialect"), exports);
24
25
  __exportStar(require("./LocalizeDialect"), exports);
25
26
  __exportStar(require("./Gender"), exports);
26
27
  __exportStar(require("./LocalizeVoiceRequest"), exports);
@@ -13,7 +13,7 @@ export declare namespace Fetcher {
13
13
  withCredentials?: boolean;
14
14
  abortSignal?: AbortSignal;
15
15
  requestType?: "json" | "file" | "bytes";
16
- responseType?: "json" | "blob" | "sse" | "streaming" | "text";
16
+ responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arraybuffer";
17
17
  duplex?: "half";
18
18
  }
19
19
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
@@ -22,6 +22,9 @@ function getResponseBody(response, responseType) {
22
22
  else if (response.body != null && responseType === "streaming") {
23
23
  return (0, chooseStreamWrapper_1.chooseStreamWrapper)(response.body);
24
24
  }
25
+ else if (response.body != null && responseType === "arraybuffer") {
26
+ return yield response.arrayBuffer();
27
+ }
25
28
  else if (response.body != null && responseType === "text") {
26
29
  return yield response.text();
27
30
  }
package/core/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./fetcher";
2
2
  export * from "./runtime";
3
- export * from "./streaming-fetcher";
4
3
  export * from "./form-data-utils";
4
+ export * from "./streaming-fetcher";
5
5
  export * as serialization from "./schemas";
package/core/index.js CHANGED
@@ -29,6 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.serialization = void 0;
30
30
  __exportStar(require("./fetcher"), exports);
31
31
  __exportStar(require("./runtime"), exports);
32
- __exportStar(require("./streaming-fetcher"), exports);
33
32
  __exportStar(require("./form-data-utils"), exports);
33
+ __exportStar(require("./streaming-fetcher"), exports);
34
34
  exports.serialization = __importStar(require("./schemas"));
package/dist/Client.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
6
  import { ApiStatus } from "./api/resources/apiStatus/client/Client";
7
+ import { Datasets } from "./api/resources/datasets/client/Client";
7
8
  import { Tts } from "./api/resources/tts/client/Client";
8
9
  import { VoiceChanger } from "./api/resources/voiceChanger/client/Client";
9
10
  import { Voices } from "./api/resources/voices/client/Client";
@@ -31,6 +32,8 @@ export declare class CartesiaClient {
31
32
  constructor(_options?: CartesiaClient.Options);
32
33
  protected _apiStatus: ApiStatus | undefined;
33
34
  get apiStatus(): ApiStatus;
35
+ protected _datasets: Datasets | undefined;
36
+ get datasets(): Datasets;
34
37
  protected _tts: Tts | undefined;
35
38
  get tts(): Tts;
36
39
  protected _voiceChanger: VoiceChanger | undefined;
package/dist/Client.js CHANGED
@@ -5,9 +5,10 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CartesiaClient = void 0;
7
7
  const Client_1 = require("./api/resources/apiStatus/client/Client");
8
- const Client_2 = require("./api/resources/tts/client/Client");
9
- const Client_3 = require("./api/resources/voiceChanger/client/Client");
10
- const Client_4 = require("./api/resources/voices/client/Client");
8
+ const Client_2 = require("./api/resources/datasets/client/Client");
9
+ const Client_3 = require("./api/resources/tts/client/Client");
10
+ const Client_4 = require("./api/resources/voiceChanger/client/Client");
11
+ const Client_5 = require("./api/resources/voices/client/Client");
11
12
  class CartesiaClient {
12
13
  constructor(_options = {}) {
13
14
  this._options = _options;
@@ -16,17 +17,21 @@ class CartesiaClient {
16
17
  var _a;
17
18
  return ((_a = this._apiStatus) !== null && _a !== void 0 ? _a : (this._apiStatus = new Client_1.ApiStatus(this._options)));
18
19
  }
20
+ get datasets() {
21
+ var _a;
22
+ return ((_a = this._datasets) !== null && _a !== void 0 ? _a : (this._datasets = new Client_2.Datasets(this._options)));
23
+ }
19
24
  get tts() {
20
25
  var _a;
21
- return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_2.Tts(this._options)));
26
+ return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_3.Tts(this._options)));
22
27
  }
23
28
  get voiceChanger() {
24
29
  var _a;
25
- return ((_a = this._voiceChanger) !== null && _a !== void 0 ? _a : (this._voiceChanger = new Client_3.VoiceChanger(this._options)));
30
+ return ((_a = this._voiceChanger) !== null && _a !== void 0 ? _a : (this._voiceChanger = new Client_4.VoiceChanger(this._options)));
26
31
  }
27
32
  get voices() {
28
33
  var _a;
29
- return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_4.Voices(this._options)));
34
+ return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_5.Voices(this._options)));
30
35
  }
31
36
  }
32
37
  exports.CartesiaClient = CartesiaClient;
@@ -56,7 +56,7 @@ class ApiStatus {
56
56
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
57
57
  url: (_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production,
58
58
  method: "GET",
59
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.3", "User-Agent": "@cartesia/cartesia-js/2.0.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
59
+ headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
60
60
  contentType: "application/json",
61
61
  requestType: "json",
62
62
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -0,0 +1,70 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /// <reference types="node" />
5
+ import * as environments from "../../../../environments";
6
+ import * as core from "../../../../core";
7
+ import * as Cartesia from "../../../index";
8
+ import * as fs from "fs";
9
+ import { Blob } from "buffer";
10
+ export declare namespace Datasets {
11
+ interface Options {
12
+ environment?: core.Supplier<environments.CartesiaEnvironment | string>;
13
+ apiKey?: core.Supplier<string | undefined>;
14
+ /** Override the Cartesia-Version header */
15
+ cartesiaVersion?: "2024-06-10";
16
+ fetcher?: core.FetchFunction;
17
+ }
18
+ interface RequestOptions {
19
+ /** The maximum time to wait for a response in seconds. */
20
+ timeoutInSeconds?: number;
21
+ /** The number of times to retry the request. Defaults to 2. */
22
+ maxRetries?: number;
23
+ /** A hook to abort the request. */
24
+ abortSignal?: AbortSignal;
25
+ /** Override the Cartesia-Version header */
26
+ cartesiaVersion?: "2024-06-10";
27
+ }
28
+ }
29
+ export declare class Datasets {
30
+ protected readonly _options: Datasets.Options;
31
+ constructor(_options?: Datasets.Options);
32
+ /**
33
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
34
+ *
35
+ * @example
36
+ * await client.datasets.list()
37
+ */
38
+ list(requestOptions?: Datasets.RequestOptions): Promise<Cartesia.PaginatedDatasets>;
39
+ /**
40
+ * @param {Cartesia.CreateDatasetRequest} request
41
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @example
44
+ * await client.datasets.create({
45
+ * name: "string"
46
+ * })
47
+ */
48
+ create(request: Cartesia.CreateDatasetRequest, requestOptions?: Datasets.RequestOptions): Promise<Cartesia.Dataset>;
49
+ /**
50
+ * @param {string} id
51
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @example
54
+ * await client.datasets.listFiles("string")
55
+ */
56
+ listFiles(id: string, requestOptions?: Datasets.RequestOptions): Promise<Cartesia.PaginatedDatasetFiles>;
57
+ /**
58
+ * @param {File | fs.ReadStream | Blob} file
59
+ * @param {string} id
60
+ * @param {Cartesia.UploadDatasetFileRequest} request
61
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @example
64
+ * await client.datasets.uploadFile(fs.createReadStream("/path/to/your/file"), "string", {})
65
+ */
66
+ uploadFile(file: File | fs.ReadStream | Blob, id: string, request: Cartesia.UploadDatasetFileRequest, requestOptions?: Datasets.RequestOptions): Promise<void>;
67
+ protected _getCustomAuthorizationHeaders(): Promise<{
68
+ "X-API-Key": string | undefined;
69
+ }>;
70
+ }