@cartesia/cartesia-js 2.1.9 → 2.2.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.
- package/Client.d.ts +3 -3
- package/Client.js +3 -3
- package/README.md +3 -3
- package/api/resources/apiStatus/client/Client.js +1 -1
- package/api/resources/auth/client/Client.d.ts +51 -0
- package/api/resources/auth/client/Client.js +126 -0
- package/api/resources/auth/client/index.d.ts +1 -0
- package/api/resources/auth/types/TokenGrant.d.ts +7 -0
- package/api/resources/auth/types/TokenRequest.d.ts +10 -0
- package/api/resources/auth/types/TokenResponse.d.ts +7 -0
- package/api/resources/auth/types/index.d.ts +3 -0
- package/{dist/api/resources/datasets/client → api/resources/auth/types}/index.js +3 -1
- package/api/resources/index.d.ts +2 -3
- package/api/resources/index.js +3 -4
- package/api/resources/infill/client/Client.d.ts +1 -1
- package/api/resources/infill/client/Client.js +2 -2
- package/api/resources/infill/client/requests/InfillBytesRequest.d.ts +2 -2
- package/api/resources/tts/types/Emotion.d.ts +6 -1
- package/api/resources/tts/types/Emotion.js +5 -0
- package/api/resources/tts/types/FlushId.d.ts +2 -2
- package/api/resources/tts/types/GenerationRequest.d.ts +3 -1
- package/api/resources/tts/types/TtsRequest.d.ts +1 -1
- package/api/resources/tts/types/WebSocketTtsRequest.d.ts +2 -1
- package/api/resources/voices/client/Client.js +8 -8
- package/core/websocket/ws.d.ts +1 -0
- package/core/websocket/ws.js +1 -1
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +3 -3
- package/dist/api/resources/apiStatus/client/Client.js +1 -1
- package/dist/api/resources/auth/client/Client.d.ts +51 -0
- package/dist/api/resources/auth/client/Client.js +126 -0
- package/dist/api/resources/auth/client/index.d.ts +1 -0
- package/dist/api/resources/auth/types/TokenGrant.d.ts +7 -0
- package/dist/api/resources/auth/types/TokenRequest.d.ts +10 -0
- package/dist/api/resources/auth/types/TokenResponse.d.ts +7 -0
- package/dist/api/resources/auth/types/index.d.ts +3 -0
- package/{api/resources/datasets/client → dist/api/resources/auth/types}/index.js +3 -1
- package/dist/api/resources/index.d.ts +2 -3
- package/dist/api/resources/index.js +3 -4
- package/dist/api/resources/infill/client/Client.d.ts +1 -1
- package/dist/api/resources/infill/client/Client.js +2 -2
- package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +2 -2
- package/dist/api/resources/tts/types/Emotion.d.ts +6 -1
- package/dist/api/resources/tts/types/Emotion.js +5 -0
- package/dist/api/resources/tts/types/FlushId.d.ts +2 -2
- package/dist/api/resources/tts/types/GenerationRequest.d.ts +3 -1
- package/dist/api/resources/tts/types/TtsRequest.d.ts +1 -1
- package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +2 -1
- package/dist/api/resources/voices/client/Client.js +8 -8
- package/dist/core/websocket/ws.d.ts +1 -0
- package/dist/core/websocket/ws.js +1 -1
- package/dist/serialization/resources/{datasets/types/Dataset.d.ts → auth/types/TokenGrant.d.ts} +3 -5
- package/{serialization/resources/datasets/types/FilePurpose.js → dist/serialization/resources/auth/types/TokenGrant.js} +4 -2
- package/dist/serialization/resources/auth/types/TokenRequest.d.ts +14 -0
- package/dist/serialization/resources/{datasets/types/DatasetFile.js → auth/types/TokenRequest.js} +5 -5
- package/{serialization/resources/datasets/types/Dataset.d.ts → dist/serialization/resources/auth/types/TokenResponse.d.ts} +3 -5
- package/dist/serialization/resources/{datasets/types/CreateDatasetRequest.js → auth/types/TokenResponse.js} +3 -3
- package/dist/serialization/resources/auth/types/index.d.ts +3 -0
- package/dist/serialization/resources/auth/types/index.js +19 -0
- package/dist/serialization/resources/index.d.ts +2 -2
- package/dist/serialization/resources/index.js +3 -3
- package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/dist/serialization/resources/tts/types/Emotion.js +5 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +1 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.js +1 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +1 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/Websocket.js +8 -2
- package/package.json +1 -1
- package/reference.md +15 -85
- package/{dist/serialization/resources/datasets/types/CreateDatasetRequest.d.ts → serialization/resources/auth/types/TokenGrant.d.ts} +3 -3
- package/{dist/serialization/resources/datasets/types/FilePurpose.js → serialization/resources/auth/types/TokenGrant.js} +4 -2
- package/serialization/resources/auth/types/TokenRequest.d.ts +14 -0
- package/{dist/serialization/resources/datasets/types/Dataset.js → serialization/resources/auth/types/TokenRequest.js} +5 -5
- package/serialization/resources/{datasets/types/CreateDatasetRequest.d.ts → auth/types/TokenResponse.d.ts} +3 -3
- package/serialization/resources/{datasets/types/CreateDatasetRequest.js → auth/types/TokenResponse.js} +3 -3
- package/serialization/resources/auth/types/index.d.ts +3 -0
- package/serialization/resources/auth/types/index.js +19 -0
- package/serialization/resources/index.d.ts +2 -2
- package/serialization/resources/index.js +3 -3
- package/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/serialization/resources/tts/types/Emotion.js +5 -0
- package/serialization/resources/tts/types/GenerationRequest.d.ts +1 -0
- package/serialization/resources/tts/types/GenerationRequest.js +1 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +1 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/Websocket.js +8 -2
- package/api/resources/datasets/client/Client.d.ts +0 -70
- package/api/resources/datasets/client/Client.js +0 -268
- package/api/resources/datasets/client/index.d.ts +0 -1
- package/api/resources/datasets/client/requests/UploadDatasetFileRequest.d.ts +0 -7
- package/api/resources/datasets/client/requests/index.d.ts +0 -1
- package/api/resources/datasets/types/CreateDatasetRequest.d.ts +0 -6
- package/api/resources/datasets/types/Dataset.d.ts +0 -8
- package/api/resources/datasets/types/DatasetFile.d.ts +0 -8
- package/api/resources/datasets/types/FilePurpose.d.ts +0 -7
- package/api/resources/datasets/types/FilePurpose.js +0 -9
- package/api/resources/datasets/types/PaginatedDatasetFiles.d.ts +0 -8
- package/api/resources/datasets/types/PaginatedDatasets.d.ts +0 -8
- package/api/resources/datasets/types/index.d.ts +0 -6
- package/api/resources/datasets/types/index.js +0 -22
- package/dist/api/resources/datasets/client/Client.d.ts +0 -70
- package/dist/api/resources/datasets/client/Client.js +0 -268
- package/dist/api/resources/datasets/client/index.d.ts +0 -1
- package/dist/api/resources/datasets/client/requests/UploadDatasetFileRequest.d.ts +0 -7
- package/dist/api/resources/datasets/client/requests/UploadDatasetFileRequest.js +0 -5
- package/dist/api/resources/datasets/client/requests/index.d.ts +0 -1
- package/dist/api/resources/datasets/types/CreateDatasetRequest.d.ts +0 -6
- package/dist/api/resources/datasets/types/CreateDatasetRequest.js +0 -5
- package/dist/api/resources/datasets/types/Dataset.d.ts +0 -8
- package/dist/api/resources/datasets/types/Dataset.js +0 -5
- package/dist/api/resources/datasets/types/DatasetFile.d.ts +0 -8
- package/dist/api/resources/datasets/types/DatasetFile.js +0 -5
- package/dist/api/resources/datasets/types/FilePurpose.d.ts +0 -7
- package/dist/api/resources/datasets/types/FilePurpose.js +0 -9
- package/dist/api/resources/datasets/types/PaginatedDatasetFiles.d.ts +0 -8
- package/dist/api/resources/datasets/types/PaginatedDatasetFiles.js +0 -5
- package/dist/api/resources/datasets/types/PaginatedDatasets.d.ts +0 -8
- package/dist/api/resources/datasets/types/PaginatedDatasets.js +0 -5
- package/dist/api/resources/datasets/types/index.d.ts +0 -6
- package/dist/api/resources/datasets/types/index.js +0 -22
- package/dist/serialization/resources/datasets/types/DatasetFile.d.ts +0 -14
- package/dist/serialization/resources/datasets/types/FilePurpose.d.ts +0 -10
- package/dist/serialization/resources/datasets/types/PaginatedDatasetFiles.d.ts +0 -14
- package/dist/serialization/resources/datasets/types/PaginatedDatasetFiles.js +0 -45
- package/dist/serialization/resources/datasets/types/PaginatedDatasets.d.ts +0 -14
- package/dist/serialization/resources/datasets/types/PaginatedDatasets.js +0 -45
- package/dist/serialization/resources/datasets/types/index.d.ts +0 -6
- package/dist/serialization/resources/datasets/types/index.js +0 -22
- package/serialization/resources/datasets/types/Dataset.js +0 -45
- package/serialization/resources/datasets/types/DatasetFile.d.ts +0 -14
- package/serialization/resources/datasets/types/DatasetFile.js +0 -45
- package/serialization/resources/datasets/types/FilePurpose.d.ts +0 -10
- package/serialization/resources/datasets/types/PaginatedDatasetFiles.d.ts +0 -14
- package/serialization/resources/datasets/types/PaginatedDatasetFiles.js +0 -45
- package/serialization/resources/datasets/types/PaginatedDatasets.d.ts +0 -14
- package/serialization/resources/datasets/types/PaginatedDatasets.js +0 -45
- package/serialization/resources/datasets/types/index.d.ts +0 -6
- package/serialization/resources/datasets/types/index.js +0 -22
- /package/api/resources/{datasets/client/requests → auth/client}/index.js +0 -0
- /package/api/resources/{datasets → auth}/index.d.ts +0 -0
- /package/api/resources/{datasets → auth}/index.js +0 -0
- /package/api/resources/{datasets/client/requests/UploadDatasetFileRequest.js → auth/types/TokenGrant.js} +0 -0
- /package/api/resources/{datasets/types/CreateDatasetRequest.js → auth/types/TokenRequest.js} +0 -0
- /package/api/resources/{datasets/types/Dataset.js → auth/types/TokenResponse.js} +0 -0
- /package/dist/api/resources/{datasets/client/requests → auth/client}/index.js +0 -0
- /package/dist/api/resources/{datasets → auth}/index.d.ts +0 -0
- /package/dist/api/resources/{datasets → auth}/index.js +0 -0
- /package/{api/resources/datasets/types/DatasetFile.js → dist/api/resources/auth/types/TokenGrant.js} +0 -0
- /package/{api/resources/datasets/types/PaginatedDatasetFiles.js → dist/api/resources/auth/types/TokenRequest.js} +0 -0
- /package/{api/resources/datasets/types/PaginatedDatasets.js → dist/api/resources/auth/types/TokenResponse.js} +0 -0
- /package/dist/serialization/resources/{datasets → auth}/index.d.ts +0 -0
- /package/dist/serialization/resources/{datasets → auth}/index.js +0 -0
- /package/serialization/resources/{datasets → auth}/index.d.ts +0 -0
- /package/serialization/resources/{datasets → auth}/index.js +0 -0
package/dist/serialization/resources/{datasets/types/Dataset.d.ts → auth/types/TokenGrant.d.ts}
RENAMED
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
import * as serializers from "../../../index";
|
|
5
5
|
import * as Cartesia from "../../../../api/index";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const
|
|
8
|
-
export declare namespace
|
|
7
|
+
export declare const TokenGrant: core.serialization.ObjectSchema<serializers.TokenGrant.Raw, Cartesia.TokenGrant>;
|
|
8
|
+
export declare namespace TokenGrant {
|
|
9
9
|
interface Raw {
|
|
10
|
-
|
|
11
|
-
name: string;
|
|
12
|
-
created_at: string;
|
|
10
|
+
tts: boolean;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -36,6 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.TokenGrant = void 0;
|
|
40
40
|
const core = __importStar(require("../../../../core"));
|
|
41
|
-
exports.
|
|
41
|
+
exports.TokenGrant = core.serialization.object({
|
|
42
|
+
tts: core.serialization.boolean(),
|
|
43
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
import { TokenGrant } from "./TokenGrant";
|
|
8
|
+
export declare const TokenRequest: core.serialization.ObjectSchema<serializers.TokenRequest.Raw, Cartesia.TokenRequest>;
|
|
9
|
+
export declare namespace TokenRequest {
|
|
10
|
+
interface Raw {
|
|
11
|
+
grants: TokenGrant.Raw;
|
|
12
|
+
expires_in?: number | null;
|
|
13
|
+
}
|
|
14
|
+
}
|
package/dist/serialization/resources/{datasets/types/DatasetFile.js → auth/types/TokenRequest.js}
RENAMED
|
@@ -36,10 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.TokenRequest = void 0;
|
|
40
40
|
const core = __importStar(require("../../../../core"));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const TokenGrant_1 = require("./TokenGrant");
|
|
42
|
+
exports.TokenRequest = core.serialization.object({
|
|
43
|
+
grants: TokenGrant_1.TokenGrant,
|
|
44
|
+
expiresIn: core.serialization.property("expires_in", core.serialization.number().optional()),
|
|
45
45
|
});
|
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
import * as serializers from "../../../index";
|
|
5
5
|
import * as Cartesia from "../../../../api/index";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const
|
|
8
|
-
export declare namespace
|
|
7
|
+
export declare const TokenResponse: core.serialization.ObjectSchema<serializers.TokenResponse.Raw, Cartesia.TokenResponse>;
|
|
8
|
+
export declare namespace TokenResponse {
|
|
9
9
|
interface Raw {
|
|
10
|
-
|
|
11
|
-
name: string;
|
|
12
|
-
created_at: string;
|
|
10
|
+
token: string;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.TokenResponse = void 0;
|
|
40
40
|
const core = __importStar(require("../../../../core"));
|
|
41
|
-
exports.
|
|
42
|
-
|
|
41
|
+
exports.TokenResponse = core.serialization.object({
|
|
42
|
+
token: core.serialization.string(),
|
|
43
43
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TokenGrant"), exports);
|
|
18
|
+
__exportStar(require("./TokenRequest"), exports);
|
|
19
|
+
__exportStar(require("./TokenResponse"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as apiStatus from "./apiStatus";
|
|
2
2
|
export * from "./apiStatus/types";
|
|
3
|
-
export * as
|
|
4
|
-
export * from "./
|
|
3
|
+
export * as auth from "./auth";
|
|
4
|
+
export * from "./auth/types";
|
|
5
5
|
export * as embedding from "./embedding";
|
|
6
6
|
export * from "./embedding/types";
|
|
7
7
|
export * as tts from "./tts";
|
|
@@ -36,11 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.voices = exports.voiceChanger = exports.tts = exports.embedding = exports.
|
|
39
|
+
exports.voices = exports.voiceChanger = exports.tts = exports.embedding = exports.auth = exports.apiStatus = void 0;
|
|
40
40
|
exports.apiStatus = __importStar(require("./apiStatus"));
|
|
41
41
|
__exportStar(require("./apiStatus/types"), exports);
|
|
42
|
-
exports.
|
|
43
|
-
__exportStar(require("./
|
|
42
|
+
exports.auth = __importStar(require("./auth"));
|
|
43
|
+
__exportStar(require("./auth/types"), exports);
|
|
44
44
|
exports.embedding = __importStar(require("./embedding"));
|
|
45
45
|
__exportStar(require("./embedding/types"), exports);
|
|
46
46
|
exports.tts = __importStar(require("./tts"));
|
|
@@ -6,5 +6,5 @@ import * as Cartesia from "../../../../api/index";
|
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
7
|
export declare const Emotion: core.serialization.Schema<serializers.Emotion.Raw, Cartesia.Emotion>;
|
|
8
8
|
export declare namespace Emotion {
|
|
9
|
-
type Raw = "anger:lowest" | "anger:low" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:low" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity:high" | "curiosity:highest";
|
|
9
|
+
type Raw = "anger:lowest" | "anger:low" | "anger" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:low" | "surprise" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
|
|
10
10
|
}
|
|
@@ -41,22 +41,27 @@ const core = __importStar(require("../../../../core"));
|
|
|
41
41
|
exports.Emotion = core.serialization.enum_([
|
|
42
42
|
"anger:lowest",
|
|
43
43
|
"anger:low",
|
|
44
|
+
"anger",
|
|
44
45
|
"anger:high",
|
|
45
46
|
"anger:highest",
|
|
46
47
|
"positivity:lowest",
|
|
47
48
|
"positivity:low",
|
|
49
|
+
"positivity",
|
|
48
50
|
"positivity:high",
|
|
49
51
|
"positivity:highest",
|
|
50
52
|
"surprise:lowest",
|
|
51
53
|
"surprise:low",
|
|
54
|
+
"surprise",
|
|
52
55
|
"surprise:high",
|
|
53
56
|
"surprise:highest",
|
|
54
57
|
"sadness:lowest",
|
|
55
58
|
"sadness:low",
|
|
59
|
+
"sadness",
|
|
56
60
|
"sadness:high",
|
|
57
61
|
"sadness:highest",
|
|
58
62
|
"curiosity:lowest",
|
|
59
63
|
"curiosity:low",
|
|
64
|
+
"curiosity",
|
|
60
65
|
"curiosity:high",
|
|
61
66
|
"curiosity:highest",
|
|
62
67
|
]);
|
|
@@ -54,4 +54,5 @@ exports.GenerationRequest = core.serialization.object({
|
|
|
54
54
|
flush: core.serialization.boolean().optional(),
|
|
55
55
|
addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
|
|
56
56
|
addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
|
|
57
|
+
useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
|
|
57
58
|
});
|
|
@@ -17,6 +17,7 @@ export declare namespace WebSocketTtsRequest {
|
|
|
17
17
|
language?: string | null;
|
|
18
18
|
add_timestamps?: boolean | null;
|
|
19
19
|
add_phoneme_timestamps?: boolean | null;
|
|
20
|
+
use_original_timestamps?: boolean | null;
|
|
20
21
|
continue?: boolean | null;
|
|
21
22
|
context_id?: string | null;
|
|
22
23
|
}
|
|
@@ -49,6 +49,7 @@ exports.WebSocketTtsRequest = core.serialization.object({
|
|
|
49
49
|
language: core.serialization.string().optional(),
|
|
50
50
|
addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
|
|
51
51
|
addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
|
|
52
|
+
useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
|
|
52
53
|
continue: core.serialization.boolean().optional(),
|
|
53
54
|
contextId: core.serialization.property("context_id", core.serialization.string().optional()),
|
|
54
55
|
});
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.
|
|
1
|
+
export declare const SDK_VERSION = "2.2.0";
|
package/dist/version.js
CHANGED
|
@@ -181,9 +181,15 @@ class Websocket {
|
|
|
181
181
|
var _a;
|
|
182
182
|
const baseUrl = ((_a = (yield core.Supplier.get(this.options.environment))) !== null && _a !== void 0 ? _a : environments.CartesiaEnvironment.Production).replace(/^https?:\/\//, "");
|
|
183
183
|
const params = {
|
|
184
|
-
|
|
185
|
-
cartesia_version: this.options.cartesiaVersion,
|
|
184
|
+
cartesia_version: this.options.cartesiaVersion || "2024-06-10",
|
|
186
185
|
};
|
|
186
|
+
const apiKey = yield core.Supplier.get(this.options.apiKey);
|
|
187
|
+
if (apiKey) {
|
|
188
|
+
params.api_key = apiKey;
|
|
189
|
+
}
|
|
190
|
+
else if (options.accessToken) {
|
|
191
|
+
params.access_token = options.accessToken;
|
|
192
|
+
}
|
|
187
193
|
return `wss://${baseUrl}/tts/websocket${qs_1.default.stringify(params, { addQueryPrefix: true })}`;
|
|
188
194
|
}), undefined, options);
|
|
189
195
|
this.socket.reconnect();
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -42,30 +42,13 @@ await client.apiStatus.get();
|
|
|
42
42
|
</dl>
|
|
43
43
|
</details>
|
|
44
44
|
|
|
45
|
-
##
|
|
45
|
+
## Auth
|
|
46
46
|
|
|
47
|
-
<details><summary><code>client.
|
|
47
|
+
<details><summary><code>client.auth.<a href="/src/api/resources/auth/client/Client.ts">accessToken</a>({ ...params }) -> Cartesia.TokenResponse</code></summary>
|
|
48
48
|
<dl>
|
|
49
49
|
<dd>
|
|
50
50
|
|
|
51
|
-
####
|
|
52
|
-
|
|
53
|
-
<dl>
|
|
54
|
-
<dd>
|
|
55
|
-
|
|
56
|
-
<dl>
|
|
57
|
-
<dd>
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
await client.datasets.list();
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
</dd>
|
|
64
|
-
</dl>
|
|
65
|
-
</dd>
|
|
66
|
-
</dl>
|
|
67
|
-
|
|
68
|
-
#### ⚙️ Parameters
|
|
51
|
+
#### 📝 Description
|
|
69
52
|
|
|
70
53
|
<dl>
|
|
71
54
|
<dd>
|
|
@@ -73,21 +56,13 @@ await client.datasets.list();
|
|
|
73
56
|
<dl>
|
|
74
57
|
<dd>
|
|
75
58
|
|
|
76
|
-
|
|
59
|
+
Generates a new Access Token for the client. These tokens are short-lived and should be used to make requests to the API from authenticated clients.
|
|
77
60
|
|
|
78
61
|
</dd>
|
|
79
62
|
</dl>
|
|
80
63
|
</dd>
|
|
81
64
|
</dl>
|
|
82
65
|
|
|
83
|
-
</dd>
|
|
84
|
-
</dl>
|
|
85
|
-
</details>
|
|
86
|
-
|
|
87
|
-
<details><summary><code>client.datasets.<a href="/src/api/resources/datasets/client/Client.ts">create</a>({ ...params }) -> Cartesia.Dataset</code></summary>
|
|
88
|
-
<dl>
|
|
89
|
-
<dd>
|
|
90
|
-
|
|
91
66
|
#### 🔌 Usage
|
|
92
67
|
|
|
93
68
|
<dl>
|
|
@@ -97,8 +72,11 @@ await client.datasets.list();
|
|
|
97
72
|
<dd>
|
|
98
73
|
|
|
99
74
|
```typescript
|
|
100
|
-
await client.
|
|
101
|
-
|
|
75
|
+
await client.auth.accessToken({
|
|
76
|
+
grants: {
|
|
77
|
+
tts: true,
|
|
78
|
+
},
|
|
79
|
+
expiresIn: 60,
|
|
102
80
|
});
|
|
103
81
|
```
|
|
104
82
|
|
|
@@ -115,55 +93,7 @@ await client.datasets.create({
|
|
|
115
93
|
<dl>
|
|
116
94
|
<dd>
|
|
117
95
|
|
|
118
|
-
**request:** `Cartesia.
|
|
119
|
-
|
|
120
|
-
</dd>
|
|
121
|
-
</dl>
|
|
122
|
-
|
|
123
|
-
<dl>
|
|
124
|
-
<dd>
|
|
125
|
-
|
|
126
|
-
**requestOptions:** `Datasets.RequestOptions`
|
|
127
|
-
|
|
128
|
-
</dd>
|
|
129
|
-
</dl>
|
|
130
|
-
</dd>
|
|
131
|
-
</dl>
|
|
132
|
-
|
|
133
|
-
</dd>
|
|
134
|
-
</dl>
|
|
135
|
-
</details>
|
|
136
|
-
|
|
137
|
-
<details><summary><code>client.datasets.<a href="/src/api/resources/datasets/client/Client.ts">listFiles</a>(id) -> Cartesia.PaginatedDatasetFiles</code></summary>
|
|
138
|
-
<dl>
|
|
139
|
-
<dd>
|
|
140
|
-
|
|
141
|
-
#### 🔌 Usage
|
|
142
|
-
|
|
143
|
-
<dl>
|
|
144
|
-
<dd>
|
|
145
|
-
|
|
146
|
-
<dl>
|
|
147
|
-
<dd>
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
await client.datasets.listFiles("id");
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
</dd>
|
|
154
|
-
</dl>
|
|
155
|
-
</dd>
|
|
156
|
-
</dl>
|
|
157
|
-
|
|
158
|
-
#### ⚙️ Parameters
|
|
159
|
-
|
|
160
|
-
<dl>
|
|
161
|
-
<dd>
|
|
162
|
-
|
|
163
|
-
<dl>
|
|
164
|
-
<dd>
|
|
165
|
-
|
|
166
|
-
**id:** `string`
|
|
96
|
+
**request:** `Cartesia.TokenRequest`
|
|
167
97
|
|
|
168
98
|
</dd>
|
|
169
99
|
</dl>
|
|
@@ -171,7 +101,7 @@ await client.datasets.listFiles("id");
|
|
|
171
101
|
<dl>
|
|
172
102
|
<dd>
|
|
173
103
|
|
|
174
|
-
**requestOptions:** `
|
|
104
|
+
**requestOptions:** `Auth.RequestOptions`
|
|
175
105
|
|
|
176
106
|
</dd>
|
|
177
107
|
</dl>
|
|
@@ -200,7 +130,7 @@ Generate audio that smoothly connects two existing audio segments. This is usefu
|
|
|
200
130
|
|
|
201
131
|
**The cost is 1 credit per character of the infill text plus a fixed cost of 300 credits.**
|
|
202
132
|
|
|
203
|
-
|
|
133
|
+
Infilling is only available on `sonic-2` at this time.
|
|
204
134
|
|
|
205
135
|
At least one of `left_audio` or `right_audio` must be provided.
|
|
206
136
|
|
|
@@ -227,7 +157,7 @@ As with all generative models, there's some inherent variability, but here's som
|
|
|
227
157
|
|
|
228
158
|
```typescript
|
|
229
159
|
await client.infill.bytes(fs.createReadStream("/path/to/your/file"), fs.createReadStream("/path/to/your/file"), {
|
|
230
|
-
modelId: "sonic-
|
|
160
|
+
modelId: "sonic-2",
|
|
231
161
|
language: "en",
|
|
232
162
|
transcript: "middle segment",
|
|
233
163
|
voiceId: "694f9389-aac1-45b6-b726-9d9369183238",
|
|
@@ -303,7 +233,7 @@ await client.infill.bytes(fs.createReadStream("/path/to/your/file"), fs.createRe
|
|
|
303
233
|
|
|
304
234
|
```typescript
|
|
305
235
|
await client.tts.bytes({
|
|
306
|
-
modelId: "sonic",
|
|
236
|
+
modelId: "sonic-2",
|
|
307
237
|
transcript: "Hello, world!",
|
|
308
238
|
voice: {
|
|
309
239
|
mode: "id",
|
|
@@ -364,7 +294,7 @@ await client.tts.bytes({
|
|
|
364
294
|
|
|
365
295
|
```typescript
|
|
366
296
|
const response = await client.tts.sse({
|
|
367
|
-
modelId: "sonic",
|
|
297
|
+
modelId: "sonic-2",
|
|
368
298
|
transcript: "Hello, world!",
|
|
369
299
|
voice: {
|
|
370
300
|
mode: "id",
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import * as serializers from "../../../index";
|
|
5
5
|
import * as Cartesia from "../../../../api/index";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const
|
|
8
|
-
export declare namespace
|
|
7
|
+
export declare const TokenGrant: core.serialization.ObjectSchema<serializers.TokenGrant.Raw, Cartesia.TokenGrant>;
|
|
8
|
+
export declare namespace TokenGrant {
|
|
9
9
|
interface Raw {
|
|
10
|
-
|
|
10
|
+
tts: boolean;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -36,6 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.TokenGrant = void 0;
|
|
40
40
|
const core = __importStar(require("../../../../core"));
|
|
41
|
-
exports.
|
|
41
|
+
exports.TokenGrant = core.serialization.object({
|
|
42
|
+
tts: core.serialization.boolean(),
|
|
43
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as serializers from "../../../index";
|
|
5
|
+
import * as Cartesia from "../../../../api/index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
import { TokenGrant } from "./TokenGrant";
|
|
8
|
+
export declare const TokenRequest: core.serialization.ObjectSchema<serializers.TokenRequest.Raw, Cartesia.TokenRequest>;
|
|
9
|
+
export declare namespace TokenRequest {
|
|
10
|
+
interface Raw {
|
|
11
|
+
grants: TokenGrant.Raw;
|
|
12
|
+
expires_in?: number | null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -36,10 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.TokenRequest = void 0;
|
|
40
40
|
const core = __importStar(require("../../../../core"));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const TokenGrant_1 = require("./TokenGrant");
|
|
42
|
+
exports.TokenRequest = core.serialization.object({
|
|
43
|
+
grants: TokenGrant_1.TokenGrant,
|
|
44
|
+
expiresIn: core.serialization.property("expires_in", core.serialization.number().optional()),
|
|
45
45
|
});
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import * as serializers from "../../../index";
|
|
5
5
|
import * as Cartesia from "../../../../api/index";
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
|
-
export declare const
|
|
8
|
-
export declare namespace
|
|
7
|
+
export declare const TokenResponse: core.serialization.ObjectSchema<serializers.TokenResponse.Raw, Cartesia.TokenResponse>;
|
|
8
|
+
export declare namespace TokenResponse {
|
|
9
9
|
interface Raw {
|
|
10
|
-
|
|
10
|
+
token: string;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.TokenResponse = void 0;
|
|
40
40
|
const core = __importStar(require("../../../../core"));
|
|
41
|
-
exports.
|
|
42
|
-
|
|
41
|
+
exports.TokenResponse = core.serialization.object({
|
|
42
|
+
token: core.serialization.string(),
|
|
43
43
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./TokenGrant"), exports);
|
|
18
|
+
__exportStar(require("./TokenRequest"), exports);
|
|
19
|
+
__exportStar(require("./TokenResponse"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as apiStatus from "./apiStatus";
|
|
2
2
|
export * from "./apiStatus/types";
|
|
3
|
-
export * as
|
|
4
|
-
export * from "./
|
|
3
|
+
export * as auth from "./auth";
|
|
4
|
+
export * from "./auth/types";
|
|
5
5
|
export * as embedding from "./embedding";
|
|
6
6
|
export * from "./embedding/types";
|
|
7
7
|
export * as tts from "./tts";
|
|
@@ -36,11 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.voices = exports.voiceChanger = exports.tts = exports.embedding = exports.
|
|
39
|
+
exports.voices = exports.voiceChanger = exports.tts = exports.embedding = exports.auth = exports.apiStatus = void 0;
|
|
40
40
|
exports.apiStatus = __importStar(require("./apiStatus"));
|
|
41
41
|
__exportStar(require("./apiStatus/types"), exports);
|
|
42
|
-
exports.
|
|
43
|
-
__exportStar(require("./
|
|
42
|
+
exports.auth = __importStar(require("./auth"));
|
|
43
|
+
__exportStar(require("./auth/types"), exports);
|
|
44
44
|
exports.embedding = __importStar(require("./embedding"));
|
|
45
45
|
__exportStar(require("./embedding/types"), exports);
|
|
46
46
|
exports.tts = __importStar(require("./tts"));
|
|
@@ -6,5 +6,5 @@ import * as Cartesia from "../../../../api/index";
|
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
7
|
export declare const Emotion: core.serialization.Schema<serializers.Emotion.Raw, Cartesia.Emotion>;
|
|
8
8
|
export declare namespace Emotion {
|
|
9
|
-
type Raw = "anger:lowest" | "anger:low" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:low" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity:high" | "curiosity:highest";
|
|
9
|
+
type Raw = "anger:lowest" | "anger:low" | "anger" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:low" | "surprise" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
|
|
10
10
|
}
|
|
@@ -41,22 +41,27 @@ const core = __importStar(require("../../../../core"));
|
|
|
41
41
|
exports.Emotion = core.serialization.enum_([
|
|
42
42
|
"anger:lowest",
|
|
43
43
|
"anger:low",
|
|
44
|
+
"anger",
|
|
44
45
|
"anger:high",
|
|
45
46
|
"anger:highest",
|
|
46
47
|
"positivity:lowest",
|
|
47
48
|
"positivity:low",
|
|
49
|
+
"positivity",
|
|
48
50
|
"positivity:high",
|
|
49
51
|
"positivity:highest",
|
|
50
52
|
"surprise:lowest",
|
|
51
53
|
"surprise:low",
|
|
54
|
+
"surprise",
|
|
52
55
|
"surprise:high",
|
|
53
56
|
"surprise:highest",
|
|
54
57
|
"sadness:lowest",
|
|
55
58
|
"sadness:low",
|
|
59
|
+
"sadness",
|
|
56
60
|
"sadness:high",
|
|
57
61
|
"sadness:highest",
|
|
58
62
|
"curiosity:lowest",
|
|
59
63
|
"curiosity:low",
|
|
64
|
+
"curiosity",
|
|
60
65
|
"curiosity:high",
|
|
61
66
|
"curiosity:highest",
|
|
62
67
|
]);
|
|
@@ -54,4 +54,5 @@ exports.GenerationRequest = core.serialization.object({
|
|
|
54
54
|
flush: core.serialization.boolean().optional(),
|
|
55
55
|
addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
|
|
56
56
|
addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
|
|
57
|
+
useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
|
|
57
58
|
});
|