spitch 1.19.0 → 1.22.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/CHANGELOG.md +22 -16
- package/README.md +50 -10
- package/client.d.mts +13 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -4
- package/client.d.ts.map +1 -1
- package/client.js +11 -2
- package/client.js.map +1 -1
- package/client.mjs +13 -4
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +54 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +54 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +101 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +95 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/internal/utils/values.js +3 -3
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +3 -3
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +14 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/files.d.mts +74 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +74 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +48 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +44 -0
- package/resources/files.mjs.map +1 -0
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/speech.d.mts +8 -8
- package/resources/speech.d.mts.map +1 -1
- package/resources/speech.d.ts +8 -8
- package/resources/speech.d.ts.map +1 -1
- package/resources/speech.js +7 -1
- package/resources/speech.js.map +1 -1
- package/resources/speech.mjs +7 -1
- package/resources/speech.mjs.map +1 -1
- package/resources/text.d.mts +5 -5
- package/resources/text.d.mts.map +1 -1
- package/resources/text.d.ts +5 -5
- package/resources/text.d.ts.map +1 -1
- package/src/client.ts +56 -19
- package/src/core/pagination.ts +157 -0
- package/src/index.ts +1 -0
- package/src/internal/to-file.ts +1 -1
- package/src/internal/utils/values.ts +3 -3
- package/src/pagination.ts +2 -0
- package/src/resources/files.ts +136 -0
- package/src/resources/index.ts +13 -8
- package/src/resources/speech.ts +16 -11
- package/src/resources/text.ts +6 -6
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { FilesCursor, type FilesCursorParams, PagePromise } from "../core/pagination.mjs";
|
|
4
|
+
import { type Uploadable } from "../core/uploads.mjs";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
+
export declare class Files extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Get Files
|
|
9
|
+
*/
|
|
10
|
+
list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FilesFilesCursor, File>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete File
|
|
13
|
+
*/
|
|
14
|
+
delete(fileID: string, options?: RequestOptions): APIPromise<FileDeleteResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Download File
|
|
17
|
+
*/
|
|
18
|
+
download(fileID: string, query?: FileDownloadParams | null | undefined, options?: RequestOptions): APIPromise<FileDownloadResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Get File
|
|
21
|
+
*/
|
|
22
|
+
get(fileID: string, options?: RequestOptions): APIPromise<File>;
|
|
23
|
+
/**
|
|
24
|
+
* Upload File
|
|
25
|
+
*/
|
|
26
|
+
upload(body: FileUploadParams, options?: RequestOptions): APIPromise<File>;
|
|
27
|
+
/**
|
|
28
|
+
* Get Usage
|
|
29
|
+
*/
|
|
30
|
+
usage(options?: RequestOptions): APIPromise<FileUsage>;
|
|
31
|
+
}
|
|
32
|
+
export type FilesFilesCursor = FilesCursor<File>;
|
|
33
|
+
export interface File {
|
|
34
|
+
category: string | null;
|
|
35
|
+
content_type: string | null;
|
|
36
|
+
created_at: string;
|
|
37
|
+
file_id: string;
|
|
38
|
+
original_name: string | null;
|
|
39
|
+
size_bytes: number | null;
|
|
40
|
+
status: string;
|
|
41
|
+
uploaded_by: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface FileUsage {
|
|
44
|
+
num_files: number;
|
|
45
|
+
total: string;
|
|
46
|
+
total_bytes: number;
|
|
47
|
+
used: string;
|
|
48
|
+
used_bytes: number;
|
|
49
|
+
}
|
|
50
|
+
export interface Files {
|
|
51
|
+
items: Array<File>;
|
|
52
|
+
next_cursor?: string | null;
|
|
53
|
+
}
|
|
54
|
+
export interface FileDeleteResponse {
|
|
55
|
+
status?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface FileDownloadResponse {
|
|
58
|
+
expires_at: string;
|
|
59
|
+
file_id: string;
|
|
60
|
+
url: string;
|
|
61
|
+
}
|
|
62
|
+
export interface FileListParams extends FilesCursorParams {
|
|
63
|
+
status?: 'uploading' | 'ready' | null;
|
|
64
|
+
}
|
|
65
|
+
export interface FileDownloadParams {
|
|
66
|
+
ttl?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface FileUploadParams {
|
|
69
|
+
file: Uploadable;
|
|
70
|
+
}
|
|
71
|
+
export declare namespace Files {
|
|
72
|
+
export { type File as File, type FileUsage as FileUsage, type Files as Files, type FileDeleteResponse as FileDeleteResponse, type FileDownloadResponse as FileDownloadResponse, type FilesFilesCursor as FilesFilesCursor, type FileListParams as FileListParams, type FileDownloadParams as FileDownloadParams, type FileUploadParams as FileUploadParams, };
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=files.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,WAAW,EAAE;OACpD,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC;IAItC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIhF;;OAEG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC;;OAEG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAI/D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAI1E;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,cAAc,G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K,IAAI,IAAI,IAAI,EACjB,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { FilesCursor, type FilesCursorParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { type Uploadable } from "../core/uploads.js";
|
|
5
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
+
export declare class Files extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Get Files
|
|
9
|
+
*/
|
|
10
|
+
list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FilesFilesCursor, File>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete File
|
|
13
|
+
*/
|
|
14
|
+
delete(fileID: string, options?: RequestOptions): APIPromise<FileDeleteResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Download File
|
|
17
|
+
*/
|
|
18
|
+
download(fileID: string, query?: FileDownloadParams | null | undefined, options?: RequestOptions): APIPromise<FileDownloadResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Get File
|
|
21
|
+
*/
|
|
22
|
+
get(fileID: string, options?: RequestOptions): APIPromise<File>;
|
|
23
|
+
/**
|
|
24
|
+
* Upload File
|
|
25
|
+
*/
|
|
26
|
+
upload(body: FileUploadParams, options?: RequestOptions): APIPromise<File>;
|
|
27
|
+
/**
|
|
28
|
+
* Get Usage
|
|
29
|
+
*/
|
|
30
|
+
usage(options?: RequestOptions): APIPromise<FileUsage>;
|
|
31
|
+
}
|
|
32
|
+
export type FilesFilesCursor = FilesCursor<File>;
|
|
33
|
+
export interface File {
|
|
34
|
+
category: string | null;
|
|
35
|
+
content_type: string | null;
|
|
36
|
+
created_at: string;
|
|
37
|
+
file_id: string;
|
|
38
|
+
original_name: string | null;
|
|
39
|
+
size_bytes: number | null;
|
|
40
|
+
status: string;
|
|
41
|
+
uploaded_by: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface FileUsage {
|
|
44
|
+
num_files: number;
|
|
45
|
+
total: string;
|
|
46
|
+
total_bytes: number;
|
|
47
|
+
used: string;
|
|
48
|
+
used_bytes: number;
|
|
49
|
+
}
|
|
50
|
+
export interface Files {
|
|
51
|
+
items: Array<File>;
|
|
52
|
+
next_cursor?: string | null;
|
|
53
|
+
}
|
|
54
|
+
export interface FileDeleteResponse {
|
|
55
|
+
status?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface FileDownloadResponse {
|
|
58
|
+
expires_at: string;
|
|
59
|
+
file_id: string;
|
|
60
|
+
url: string;
|
|
61
|
+
}
|
|
62
|
+
export interface FileListParams extends FilesCursorParams {
|
|
63
|
+
status?: 'uploading' | 'ready' | null;
|
|
64
|
+
}
|
|
65
|
+
export interface FileDownloadParams {
|
|
66
|
+
ttl?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface FileUploadParams {
|
|
69
|
+
file: Uploadable;
|
|
70
|
+
}
|
|
71
|
+
export declare namespace Files {
|
|
72
|
+
export { type File as File, type FileUsage as FileUsage, type Files as Files, type FileDeleteResponse as FileDeleteResponse, type FileDownloadResponse as FileDownloadResponse, type FilesFilesCursor as FilesFilesCursor, type FileListParams as FileListParams, type FileDownloadParams as FileDownloadParams, type FileUploadParams as FileUploadParams, };
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE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generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Files = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const uploads_1 = require("../internal/uploads.js");
|
|
8
|
+
const path_1 = require("../internal/utils/path.js");
|
|
9
|
+
class Files extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Get Files
|
|
12
|
+
*/
|
|
13
|
+
list(query = {}, options) {
|
|
14
|
+
return this._client.getAPIList('/v1/files', (pagination_1.FilesCursor), { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Delete File
|
|
18
|
+
*/
|
|
19
|
+
delete(fileID, options) {
|
|
20
|
+
return this._client.delete((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Download File
|
|
24
|
+
*/
|
|
25
|
+
download(fileID, query = {}, options) {
|
|
26
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}/url`, { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get File
|
|
30
|
+
*/
|
|
31
|
+
get(fileID, options) {
|
|
32
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Upload File
|
|
36
|
+
*/
|
|
37
|
+
upload(body, options) {
|
|
38
|
+
return this._client.post('/v1/files', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get Usage
|
|
42
|
+
*/
|
|
43
|
+
usage(options) {
|
|
44
|
+
return this._client.get('/v1/files:usage', options);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.Files = Files;
|
|
48
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 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OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACF;AAjDD,sBAiDC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { FilesCursor } from "../core/pagination.mjs";
|
|
4
|
+
import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
5
|
+
import { path } from "../internal/utils/path.mjs";
|
|
6
|
+
export class Files extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Get Files
|
|
9
|
+
*/
|
|
10
|
+
list(query = {}, options) {
|
|
11
|
+
return this._client.getAPIList('/v1/files', (FilesCursor), { query, ...options });
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Delete File
|
|
15
|
+
*/
|
|
16
|
+
delete(fileID, options) {
|
|
17
|
+
return this._client.delete(path `/v1/files/${fileID}`, options);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Download File
|
|
21
|
+
*/
|
|
22
|
+
download(fileID, query = {}, options) {
|
|
23
|
+
return this._client.get(path `/v1/files/${fileID}/url`, { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get File
|
|
27
|
+
*/
|
|
28
|
+
get(fileID, options) {
|
|
29
|
+
return this._client.get(path `/v1/files/${fileID}`, options);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Upload File
|
|
33
|
+
*/
|
|
34
|
+
upload(body, options) {
|
|
35
|
+
return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get Usage
|
|
39
|
+
*/
|
|
40
|
+
usage(options) {
|
|
41
|
+
return this._client.get('/v1/files:usage', options);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=files.mjs.map
|
|
@@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AAwB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACF"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { Files, type File, type FileUsage, type FileDeleteResponse, type FileDownloadResponse, type FileListParams, type FileDownloadParams, type FileUploadParams, type FilesFilesCursor, } from "./files.mjs";
|
|
2
|
+
export { Speech, type Transcription, type SpeechGenerateParams, type SpeechTranscribeParams } from "./speech.mjs";
|
|
3
|
+
export { Text, type Diacritics, type Translation, type TextToneMarkParams, type TextTranslateParams, } from "./text.mjs";
|
|
3
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB;OACM,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE;OACtF,EACL,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { Files, type File, type FileUsage, type FileDeleteResponse, type FileDownloadResponse, type FileListParams, type FileDownloadParams, type FileUploadParams, type FilesFilesCursor, } from "./files.js";
|
|
2
|
+
export { Speech, type Transcription, type SpeechGenerateParams, type SpeechTranscribeParams } from "./speech.js";
|
|
3
|
+
export { Text, type Diacritics, type Translation, type TextToneMarkParams, type TextTranslateParams, } from "./text.js";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,KAAK,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB;OACM,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE;OACtF,EACL,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB"}
|
package/resources/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Text = exports.Speech = void 0;
|
|
4
|
+
exports.Text = exports.Speech = exports.Files = void 0;
|
|
5
|
+
var files_1 = require("./files.js");
|
|
6
|
+
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
|
|
5
7
|
var speech_1 = require("./speech.js");
|
|
6
8
|
Object.defineProperty(exports, "Speech", { enumerable: true, get: function () { return speech_1.Speech; } });
|
|
7
9
|
var text_1 = require("./text.js");
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAUiB;AATf,8FAAA,KAAK,OAAA;AAUP,sCAA8G;AAArG,gGAAA,MAAM,OAAA;AACf,kCAMgB;AALd,4FAAA,IAAI,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export {
|
|
2
|
+
export { Files, } from "./files.mjs";
|
|
3
|
+
export { Speech } from "./speech.mjs";
|
|
3
4
|
export { Text, } from "./text.mjs";
|
|
4
5
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,KAAK,GASN;OACM,EAAE,MAAM,EAA8E;OACtF,EACL,IAAI,GAKL"}
|
package/resources/speech.d.mts
CHANGED
|
@@ -6,19 +6,18 @@ export declare class Speech extends APIResource {
|
|
|
6
6
|
/**
|
|
7
7
|
* Synthesize
|
|
8
8
|
*/
|
|
9
|
-
generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<
|
|
9
|
+
generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response>;
|
|
10
10
|
/**
|
|
11
11
|
* Transcribe
|
|
12
12
|
*/
|
|
13
|
-
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<
|
|
13
|
+
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<Transcription>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
16
|
-
export interface SpeechTranscribeResponse {
|
|
15
|
+
export interface Transcription {
|
|
17
16
|
request_id: string;
|
|
18
17
|
text: string;
|
|
19
|
-
timestamps?: Array<
|
|
18
|
+
timestamps?: Array<Transcription.Timestamp> | null;
|
|
20
19
|
}
|
|
21
|
-
export declare namespace
|
|
20
|
+
export declare namespace Transcription {
|
|
22
21
|
interface Timestamp {
|
|
23
22
|
end: number;
|
|
24
23
|
start: number;
|
|
@@ -29,17 +28,18 @@ export interface SpeechGenerateParams {
|
|
|
29
28
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
30
29
|
text: string;
|
|
31
30
|
voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
|
|
31
|
+
format?: 'wav' | 'mp3' | 'ogg_opus' | 'webm_opus' | 'flac' | 'pcm_s16le' | 'mulaw' | 'alaw';
|
|
32
32
|
model?: 'legacy' | null;
|
|
33
33
|
}
|
|
34
34
|
export interface SpeechTranscribeParams {
|
|
35
35
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
36
36
|
content?: Uploadable | null;
|
|
37
|
-
model?: 'mansa_v1' | 'legacy' | null;
|
|
37
|
+
model?: 'mansa_v1' | 'legacy' | 'human' | null;
|
|
38
38
|
special_words?: string | null;
|
|
39
39
|
timestamp?: 'sentence' | 'word' | 'none' | null;
|
|
40
40
|
url?: string | null;
|
|
41
41
|
}
|
|
42
42
|
export declare namespace Speech {
|
|
43
|
-
export { type
|
|
43
|
+
export { type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=speech.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.d.mts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"speech.d.mts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IASpF;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAM9F;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CACpD;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,SAAS;QACxB,GAAG,EAAE,MAAM,CAAC;QAEZ,KAAK,EAAE,MAAM,CAAC;QAEd,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3C,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EACD,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,CAAC;IAEd,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IAE5F,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3C,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAE5B,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IAE/C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAEhD,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
package/resources/speech.d.ts
CHANGED
|
@@ -6,19 +6,18 @@ export declare class Speech extends APIResource {
|
|
|
6
6
|
/**
|
|
7
7
|
* Synthesize
|
|
8
8
|
*/
|
|
9
|
-
generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<
|
|
9
|
+
generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response>;
|
|
10
10
|
/**
|
|
11
11
|
* Transcribe
|
|
12
12
|
*/
|
|
13
|
-
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<
|
|
13
|
+
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<Transcription>;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
16
|
-
export interface SpeechTranscribeResponse {
|
|
15
|
+
export interface Transcription {
|
|
17
16
|
request_id: string;
|
|
18
17
|
text: string;
|
|
19
|
-
timestamps?: Array<
|
|
18
|
+
timestamps?: Array<Transcription.Timestamp> | null;
|
|
20
19
|
}
|
|
21
|
-
export declare namespace
|
|
20
|
+
export declare namespace Transcription {
|
|
22
21
|
interface Timestamp {
|
|
23
22
|
end: number;
|
|
24
23
|
start: number;
|
|
@@ -29,17 +28,18 @@ export interface SpeechGenerateParams {
|
|
|
29
28
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
30
29
|
text: string;
|
|
31
30
|
voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
|
|
31
|
+
format?: 'wav' | 'mp3' | 'ogg_opus' | 'webm_opus' | 'flac' | 'pcm_s16le' | 'mulaw' | 'alaw';
|
|
32
32
|
model?: 'legacy' | null;
|
|
33
33
|
}
|
|
34
34
|
export interface SpeechTranscribeParams {
|
|
35
35
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
36
36
|
content?: Uploadable | null;
|
|
37
|
-
model?: 'mansa_v1' | 'legacy' | null;
|
|
37
|
+
model?: 'mansa_v1' | 'legacy' | 'human' | null;
|
|
38
38
|
special_words?: string | null;
|
|
39
39
|
timestamp?: 'sentence' | 'word' | 'none' | null;
|
|
40
40
|
url?: string | null;
|
|
41
41
|
}
|
|
42
42
|
export declare namespace Speech {
|
|
43
|
-
export { type
|
|
43
|
+
export { type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=speech.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC;IASpF;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;CAM9F;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CACpD;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,SAAS;QACxB,GAAG,EAAE,MAAM,CAAC;QAEZ,KAAK,EAAE,MAAM,CAAC;QAEd,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3C,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EACD,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,CAAC;IAEd,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IAE5F,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3C,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAE5B,KAAK,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;IAE/C,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAEhD,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
package/resources/speech.js
CHANGED
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Speech = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
6
7
|
const uploads_1 = require("../internal/uploads.js");
|
|
7
8
|
class Speech extends resource_1.APIResource {
|
|
8
9
|
/**
|
|
9
10
|
* Synthesize
|
|
10
11
|
*/
|
|
11
12
|
generate(body, options) {
|
|
12
|
-
return this._client.post('/v1/speech', {
|
|
13
|
+
return this._client.post('/v1/speech', {
|
|
14
|
+
body,
|
|
15
|
+
...options,
|
|
16
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'audio/wav' }, options?.headers]),
|
|
17
|
+
__binaryResponse: true,
|
|
18
|
+
});
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
21
|
* Transcribe
|
package/resources/speech.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;
|
|
1
|
+
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAAkE;AAElE,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,oBAAoB,EACpB,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF;AAtBD,wBAsBC"}
|
package/resources/speech.mjs
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
3
4
|
import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
4
5
|
export class Speech extends APIResource {
|
|
5
6
|
/**
|
|
6
7
|
* Synthesize
|
|
7
8
|
*/
|
|
8
9
|
generate(body, options) {
|
|
9
|
-
return this._client.post('/v1/speech', {
|
|
10
|
+
return this._client.post('/v1/speech', {
|
|
11
|
+
body,
|
|
12
|
+
...options,
|
|
13
|
+
headers: buildHeaders([{ Accept: 'audio/wav' }, options?.headers]),
|
|
14
|
+
__binaryResponse: true,
|
|
15
|
+
});
|
|
10
16
|
}
|
|
11
17
|
/**
|
|
12
18
|
* Transcribe
|
package/resources/speech.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;AAEtC,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,oBAAoB,EACpB,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF"}
|
package/resources/text.d.mts
CHANGED
|
@@ -5,17 +5,17 @@ export declare class Text extends APIResource {
|
|
|
5
5
|
/**
|
|
6
6
|
* Tone Mark
|
|
7
7
|
*/
|
|
8
|
-
toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<
|
|
8
|
+
toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics>;
|
|
9
9
|
/**
|
|
10
10
|
* Translate
|
|
11
11
|
*/
|
|
12
|
-
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<
|
|
12
|
+
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<Translation>;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface Diacritics {
|
|
15
15
|
request_id: string;
|
|
16
16
|
text: string;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface Translation {
|
|
19
19
|
request_id: string;
|
|
20
20
|
text: string;
|
|
21
21
|
}
|
|
@@ -29,6 +29,6 @@ export interface TextTranslateParams {
|
|
|
29
29
|
text: string;
|
|
30
30
|
}
|
|
31
31
|
export declare namespace Text {
|
|
32
|
-
export { type
|
|
32
|
+
export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=text.d.mts.map
|
package/resources/text.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.mts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"text.d.mts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIpF;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;CAGxF;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAEzC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAEzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
package/resources/text.d.ts
CHANGED
|
@@ -5,17 +5,17 @@ export declare class Text extends APIResource {
|
|
|
5
5
|
/**
|
|
6
6
|
* Tone Mark
|
|
7
7
|
*/
|
|
8
|
-
toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<
|
|
8
|
+
toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics>;
|
|
9
9
|
/**
|
|
10
10
|
* Translate
|
|
11
11
|
*/
|
|
12
|
-
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<
|
|
12
|
+
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<Translation>;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface Diacritics {
|
|
15
15
|
request_id: string;
|
|
16
16
|
text: string;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface Translation {
|
|
19
19
|
request_id: string;
|
|
20
20
|
text: string;
|
|
21
21
|
}
|
|
@@ -29,6 +29,6 @@ export interface TextTranslateParams {
|
|
|
29
29
|
text: string;
|
|
30
30
|
}
|
|
31
31
|
export declare namespace Text {
|
|
32
|
-
export { type
|
|
32
|
+
export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=text.d.ts.map
|
package/resources/text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,E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