spitch 1.22.0 → 1.23.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 +13 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/files.d.mts +81 -12
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +81 -12
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +53 -6
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +53 -6
- package/resources/files.mjs.map +1 -1
- package/resources/speech.d.mts +3 -0
- package/resources/speech.d.mts.map +1 -1
- package/resources/speech.d.ts +3 -0
- package/resources/speech.d.ts.map +1 -1
- package/resources/speech.js +4 -1
- package/resources/speech.js.map +1 -1
- package/resources/speech.mjs +4 -1
- package/resources/speech.mjs.map +1 -1
- package/resources/text.d.mts +20 -1
- package/resources/text.d.mts.map +1 -1
- package/resources/text.d.ts +20 -1
- package/resources/text.d.ts.map +1 -1
- package/src/client.ts +3 -0
- package/src/resources/files.ts +81 -12
- package/src/resources/speech.ts +4 -1
- package/src/resources/text.ts +24 -1
- 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
package/resources/files.js
CHANGED
|
@@ -8,37 +8,84 @@ const uploads_1 = require("../internal/uploads.js");
|
|
|
8
8
|
const path_1 = require("../internal/utils/path.js");
|
|
9
9
|
class Files extends resource_1.APIResource {
|
|
10
10
|
/**
|
|
11
|
-
* Get
|
|
11
|
+
* Get a paginated list of files for the authenticated organization.
|
|
12
|
+
*
|
|
13
|
+
* Args: identity: Authentication identity containing org_id and user_id limit:
|
|
14
|
+
* Maximum number of files to return (max 100) status: Optional filter by file
|
|
15
|
+
* status (processing, ready, etc.) cursor: Optional pagination cursor for getting
|
|
16
|
+
* next page db: Database session
|
|
17
|
+
*
|
|
18
|
+
* Returns: ListFilesResponse: Paginated list of files with metadata
|
|
19
|
+
*
|
|
20
|
+
* Raises: HTTPException: 400 if cursor is invalid
|
|
12
21
|
*/
|
|
13
22
|
list(query = {}, options) {
|
|
14
23
|
return this._client.getAPIList('/v1/files', (pagination_1.FilesCursor), { query, ...options });
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
17
|
-
* Delete
|
|
26
|
+
* Delete a file and its associated S3 object.
|
|
27
|
+
*
|
|
28
|
+
* Args: file_id: UUID of the file to delete identity: Authentication identity
|
|
29
|
+
* containing org_id db: Database session s3: S3 session for deleting objects
|
|
30
|
+
*
|
|
31
|
+
* Returns: dict: Success confirmation
|
|
32
|
+
*
|
|
33
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
18
34
|
*/
|
|
19
35
|
delete(fileID, options) {
|
|
20
36
|
return this._client.delete((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
21
37
|
}
|
|
22
38
|
/**
|
|
23
|
-
*
|
|
39
|
+
* Generate a pre-signed download URL for a file.
|
|
40
|
+
*
|
|
41
|
+
* Args: file_id: UUID of the file to download identity: Authentication identity
|
|
42
|
+
* containing org_id ttl: Time-to-live for the download URL in seconds (60-3600)
|
|
43
|
+
* db: Database session s3: S3 session for generating pre-signed URLs
|
|
44
|
+
*
|
|
45
|
+
* Returns: FileDownloadResponse: Contains file_id, download URL, and expiration
|
|
46
|
+
* time
|
|
47
|
+
*
|
|
48
|
+
* Raises: HTTPException: 404 if file not found, doesn't belong to org, or not
|
|
49
|
+
* ready
|
|
24
50
|
*/
|
|
25
51
|
download(fileID, query = {}, options) {
|
|
26
52
|
return this._client.get((0, path_1.path) `/v1/files/${fileID}/url`, { query, ...options });
|
|
27
53
|
}
|
|
28
54
|
/**
|
|
29
|
-
* Get
|
|
55
|
+
* Get metadata for a specific file.
|
|
56
|
+
*
|
|
57
|
+
* Args: file_id: UUID of the file to retrieve identity: Authentication identity
|
|
58
|
+
* containing org_id db: Database session
|
|
59
|
+
*
|
|
60
|
+
* Returns: FileMetaResponse: File metadata including upload information
|
|
61
|
+
*
|
|
62
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
63
|
+
* HTTPException: 500 if uploader information is corrupted
|
|
30
64
|
*/
|
|
31
65
|
get(fileID, options) {
|
|
32
66
|
return this._client.get((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
33
67
|
}
|
|
34
68
|
/**
|
|
35
|
-
* Upload
|
|
69
|
+
* Upload a file to the Spitch server.
|
|
70
|
+
*
|
|
71
|
+
* Args: file: The file to upload from the request identity: Authentication
|
|
72
|
+
* identity containing org_id and user_id db: Database session
|
|
73
|
+
*
|
|
74
|
+
* Returns: FileMetaResponse: Metadata for the uploaded file
|
|
75
|
+
*
|
|
76
|
+
* Raises: HTTPException: 500 if upload fails
|
|
36
77
|
*/
|
|
37
78
|
upload(body, options) {
|
|
38
79
|
return this._client.post('/v1/files', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
39
80
|
}
|
|
40
81
|
/**
|
|
41
|
-
* Get
|
|
82
|
+
* Get storage usage statistics for the authenticated organization.
|
|
83
|
+
*
|
|
84
|
+
* Args: identity: Authentication identity containing org_id db: Database session
|
|
85
|
+
*
|
|
86
|
+
* Returns: FileUsage: Usage statistics including total/used bytes and file count
|
|
87
|
+
*
|
|
88
|
+
* Raises: HTTPException: 500 if unable to calculate usage
|
|
42
89
|
*/
|
|
43
90
|
usage(options) {
|
|
44
91
|
return this._client.get('/v1/files:usage', options);
|
package/resources/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAsF;AAGtF,oDAAkE;AAClE,oDAA8C;AAE9C,MAAa,KAAM,SAAQ,sBAAW;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AQG;IACH,KAAK,CAAC,OAAwB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACF;AAhGD,sBAgGC"}
|
package/resources/files.mjs
CHANGED
|
@@ -5,37 +5,84 @@ import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
|
5
5
|
import { path } from "../internal/utils/path.mjs";
|
|
6
6
|
export class Files extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Get
|
|
8
|
+
* Get a paginated list of files for the authenticated organization.
|
|
9
|
+
*
|
|
10
|
+
* Args: identity: Authentication identity containing org_id and user_id limit:
|
|
11
|
+
* Maximum number of files to return (max 100) status: Optional filter by file
|
|
12
|
+
* status (processing, ready, etc.) cursor: Optional pagination cursor for getting
|
|
13
|
+
* next page db: Database session
|
|
14
|
+
*
|
|
15
|
+
* Returns: ListFilesResponse: Paginated list of files with metadata
|
|
16
|
+
*
|
|
17
|
+
* Raises: HTTPException: 400 if cursor is invalid
|
|
9
18
|
*/
|
|
10
19
|
list(query = {}, options) {
|
|
11
20
|
return this._client.getAPIList('/v1/files', (FilesCursor), { query, ...options });
|
|
12
21
|
}
|
|
13
22
|
/**
|
|
14
|
-
* Delete
|
|
23
|
+
* Delete a file and its associated S3 object.
|
|
24
|
+
*
|
|
25
|
+
* Args: file_id: UUID of the file to delete identity: Authentication identity
|
|
26
|
+
* containing org_id db: Database session s3: S3 session for deleting objects
|
|
27
|
+
*
|
|
28
|
+
* Returns: dict: Success confirmation
|
|
29
|
+
*
|
|
30
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
15
31
|
*/
|
|
16
32
|
delete(fileID, options) {
|
|
17
33
|
return this._client.delete(path `/v1/files/${fileID}`, options);
|
|
18
34
|
}
|
|
19
35
|
/**
|
|
20
|
-
*
|
|
36
|
+
* Generate a pre-signed download URL for a file.
|
|
37
|
+
*
|
|
38
|
+
* Args: file_id: UUID of the file to download identity: Authentication identity
|
|
39
|
+
* containing org_id ttl: Time-to-live for the download URL in seconds (60-3600)
|
|
40
|
+
* db: Database session s3: S3 session for generating pre-signed URLs
|
|
41
|
+
*
|
|
42
|
+
* Returns: FileDownloadResponse: Contains file_id, download URL, and expiration
|
|
43
|
+
* time
|
|
44
|
+
*
|
|
45
|
+
* Raises: HTTPException: 404 if file not found, doesn't belong to org, or not
|
|
46
|
+
* ready
|
|
21
47
|
*/
|
|
22
48
|
download(fileID, query = {}, options) {
|
|
23
49
|
return this._client.get(path `/v1/files/${fileID}/url`, { query, ...options });
|
|
24
50
|
}
|
|
25
51
|
/**
|
|
26
|
-
* Get
|
|
52
|
+
* Get metadata for a specific file.
|
|
53
|
+
*
|
|
54
|
+
* Args: file_id: UUID of the file to retrieve identity: Authentication identity
|
|
55
|
+
* containing org_id db: Database session
|
|
56
|
+
*
|
|
57
|
+
* Returns: FileMetaResponse: File metadata including upload information
|
|
58
|
+
*
|
|
59
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
60
|
+
* HTTPException: 500 if uploader information is corrupted
|
|
27
61
|
*/
|
|
28
62
|
get(fileID, options) {
|
|
29
63
|
return this._client.get(path `/v1/files/${fileID}`, options);
|
|
30
64
|
}
|
|
31
65
|
/**
|
|
32
|
-
* Upload
|
|
66
|
+
* Upload a file to the Spitch server.
|
|
67
|
+
*
|
|
68
|
+
* Args: file: The file to upload from the request identity: Authentication
|
|
69
|
+
* identity containing org_id and user_id db: Database session
|
|
70
|
+
*
|
|
71
|
+
* Returns: FileMetaResponse: Metadata for the uploaded file
|
|
72
|
+
*
|
|
73
|
+
* Raises: HTTPException: 500 if upload fails
|
|
33
74
|
*/
|
|
34
75
|
upload(body, options) {
|
|
35
76
|
return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
36
77
|
}
|
|
37
78
|
/**
|
|
38
|
-
* Get
|
|
79
|
+
* Get storage usage statistics for the authenticated organization.
|
|
80
|
+
*
|
|
81
|
+
* Args: identity: Authentication identity containing org_id db: Database session
|
|
82
|
+
*
|
|
83
|
+
* Returns: FileUsage: Usage statistics including total/used bytes and file count
|
|
84
|
+
*
|
|
85
|
+
* Raises: HTTPException: 500 if unable to calculate usage
|
|
39
86
|
*/
|
|
40
87
|
usage(options) {
|
|
41
88
|
return this._client.get('/v1/files:usage', options);
|
package/resources/files.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,WAAW,EAAuC;OAGpD,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../src/resources/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,WAAW,EAAuC;OAGpD,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,WAAiB,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,MAAc,EACd,QAA+C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,MAAc,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAsB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAwB;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;CACF"}
|
package/resources/speech.d.mts
CHANGED
|
@@ -2,6 +2,9 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { type Uploadable } from "../core/uploads.mjs";
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* All speech-focused APIs (TTS and STT)
|
|
7
|
+
*/
|
|
5
8
|
export declare class Speech extends APIResource {
|
|
6
9
|
/**
|
|
7
10
|
* Synthesize
|
|
@@ -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;OAEnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,I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ACnC,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
|
@@ -2,6 +2,9 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { type Uploadable } from "../core/uploads.js";
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* All speech-focused APIs (TTS and STT)
|
|
7
|
+
*/
|
|
5
8
|
export declare class Speech extends APIResource {
|
|
6
9
|
/**
|
|
7
10
|
* Synthesize
|
|
@@ -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;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,M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AAG,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
|
@@ -5,6 +5,9 @@ exports.Speech = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const headers_1 = require("../internal/headers.js");
|
|
7
7
|
const uploads_1 = require("../internal/uploads.js");
|
|
8
|
+
/**
|
|
9
|
+
* All speech-focused APIs (TTS and STT)
|
|
10
|
+
*/
|
|
8
11
|
class Speech extends resource_1.APIResource {
|
|
9
12
|
/**
|
|
10
13
|
* Synthesize
|
|
@@ -13,7 +16,7 @@ class Speech extends resource_1.APIResource {
|
|
|
13
16
|
return this._client.post('/v1/speech', {
|
|
14
17
|
body,
|
|
15
18
|
...options,
|
|
16
|
-
headers: (0, headers_1.buildHeaders)([{ Accept: 'audio
|
|
19
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'audio/*' }, options?.headers]),
|
|
17
20
|
__binaryResponse: true,
|
|
18
21
|
});
|
|
19
22
|
}
|
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;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,
|
|
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;;GAEG;AACH,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,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChE,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
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
import { multipartFormRequestOptions } from "../internal/uploads.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* All speech-focused APIs (TTS and STT)
|
|
7
|
+
*/
|
|
5
8
|
export class Speech extends APIResource {
|
|
6
9
|
/**
|
|
7
10
|
* Synthesize
|
|
@@ -10,7 +13,7 @@ export class Speech extends APIResource {
|
|
|
10
13
|
return this._client.post('/v1/speech', {
|
|
11
14
|
body,
|
|
12
15
|
...options,
|
|
13
|
-
headers: buildHeaders([{ Accept: 'audio
|
|
16
|
+
headers: buildHeaders([{ Accept: 'audio/*' }, options?.headers]),
|
|
14
17
|
__binaryResponse: true,
|
|
15
18
|
});
|
|
16
19
|
}
|
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;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,
|
|
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;;GAEG;AACH,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,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChE,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
|
@@ -11,13 +11,29 @@ export declare class Text extends APIResource {
|
|
|
11
11
|
*/
|
|
12
12
|
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<Translation>;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Response model for text diacritization requests.
|
|
16
|
+
*
|
|
17
|
+
* Attributes:
|
|
18
|
+
* request_id: Unique identifier for the diacritization request
|
|
19
|
+
* text: Text with added diacritical marks for proper pronunciation
|
|
20
|
+
* language: Language code for the diacritized text
|
|
21
|
+
*/
|
|
14
22
|
export interface Diacritics {
|
|
15
23
|
request_id: string;
|
|
16
24
|
text: string;
|
|
17
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Translation result model.
|
|
28
|
+
*
|
|
29
|
+
* Attributes: request_id (UUID): Unique ID for this request. text: translated
|
|
30
|
+
* text. due_date: used when model is `human`. the date you can expect the
|
|
31
|
+
* translation to be delivered
|
|
32
|
+
*/
|
|
18
33
|
export interface Translation {
|
|
19
34
|
request_id: string;
|
|
20
35
|
text: string;
|
|
36
|
+
due_date?: string | null;
|
|
21
37
|
}
|
|
22
38
|
export interface TextToneMarkParams {
|
|
23
39
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
@@ -26,7 +42,10 @@ export interface TextToneMarkParams {
|
|
|
26
42
|
export interface TextTranslateParams {
|
|
27
43
|
source: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
28
44
|
target: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
29
|
-
|
|
45
|
+
file_id?: string | null;
|
|
46
|
+
instructions?: string | null;
|
|
47
|
+
model?: 'human' | 'auto';
|
|
48
|
+
text?: string | null;
|
|
30
49
|
}
|
|
31
50
|
export declare namespace Text {
|
|
32
51
|
export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
|
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,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;
|
|
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;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;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,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;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
|
@@ -11,13 +11,29 @@ export declare class Text extends APIResource {
|
|
|
11
11
|
*/
|
|
12
12
|
translate(body: TextTranslateParams, options?: RequestOptions): APIPromise<Translation>;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Response model for text diacritization requests.
|
|
16
|
+
*
|
|
17
|
+
* Attributes:
|
|
18
|
+
* request_id: Unique identifier for the diacritization request
|
|
19
|
+
* text: Text with added diacritical marks for proper pronunciation
|
|
20
|
+
* language: Language code for the diacritized text
|
|
21
|
+
*/
|
|
14
22
|
export interface Diacritics {
|
|
15
23
|
request_id: string;
|
|
16
24
|
text: string;
|
|
17
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Translation result model.
|
|
28
|
+
*
|
|
29
|
+
* Attributes: request_id (UUID): Unique ID for this request. text: translated
|
|
30
|
+
* text. due_date: used when model is `human`. the date you can expect the
|
|
31
|
+
* translation to be delivered
|
|
32
|
+
*/
|
|
18
33
|
export interface Translation {
|
|
19
34
|
request_id: string;
|
|
20
35
|
text: string;
|
|
36
|
+
due_date?: string | null;
|
|
21
37
|
}
|
|
22
38
|
export interface TextToneMarkParams {
|
|
23
39
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
@@ -26,7 +42,10 @@ export interface TextToneMarkParams {
|
|
|
26
42
|
export interface TextTranslateParams {
|
|
27
43
|
source: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
28
44
|
target: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
29
|
-
|
|
45
|
+
file_id?: string | null;
|
|
46
|
+
instructions?: string | null;
|
|
47
|
+
model?: 'human' | 'auto';
|
|
48
|
+
text?: string | null;
|
|
30
49
|
}
|
|
31
50
|
export declare namespace Text {
|
|
32
51
|
export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
|
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,UAAU,CAAC;IAIpF;;OAEG;IACH,SAAS,CAAC,IAAI,E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IAAI,GAAG,IAAI,CAAC;IAEzC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAEzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;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/src/client.ts
CHANGED
|
@@ -747,6 +747,9 @@ export class Spitch {
|
|
|
747
747
|
|
|
748
748
|
static toFile = Uploads.toFile;
|
|
749
749
|
|
|
750
|
+
/**
|
|
751
|
+
* All speech-focused APIs (TTS and STT)
|
|
752
|
+
*/
|
|
750
753
|
speech: API.Speech = new API.Speech(this);
|
|
751
754
|
text: API.Text = new API.Text(this);
|
|
752
755
|
files: API.Files = new API.Files(this);
|
package/src/resources/files.ts
CHANGED
|
@@ -10,7 +10,16 @@ import { path } from '../internal/utils/path';
|
|
|
10
10
|
|
|
11
11
|
export class Files extends APIResource {
|
|
12
12
|
/**
|
|
13
|
-
* Get
|
|
13
|
+
* Get a paginated list of files for the authenticated organization.
|
|
14
|
+
*
|
|
15
|
+
* Args: identity: Authentication identity containing org_id and user_id limit:
|
|
16
|
+
* Maximum number of files to return (max 100) status: Optional filter by file
|
|
17
|
+
* status (processing, ready, etc.) cursor: Optional pagination cursor for getting
|
|
18
|
+
* next page db: Database session
|
|
19
|
+
*
|
|
20
|
+
* Returns: ListFilesResponse: Paginated list of files with metadata
|
|
21
|
+
*
|
|
22
|
+
* Raises: HTTPException: 400 if cursor is invalid
|
|
14
23
|
*/
|
|
15
24
|
list(
|
|
16
25
|
query: FileListParams | null | undefined = {},
|
|
@@ -20,14 +29,31 @@ export class Files extends APIResource {
|
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
/**
|
|
23
|
-
* Delete
|
|
32
|
+
* Delete a file and its associated S3 object.
|
|
33
|
+
*
|
|
34
|
+
* Args: file_id: UUID of the file to delete identity: Authentication identity
|
|
35
|
+
* containing org_id db: Database session s3: S3 session for deleting objects
|
|
36
|
+
*
|
|
37
|
+
* Returns: dict: Success confirmation
|
|
38
|
+
*
|
|
39
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
24
40
|
*/
|
|
25
|
-
delete(fileID: string, options?: RequestOptions): APIPromise<
|
|
41
|
+
delete(fileID: string, options?: RequestOptions): APIPromise<unknown> {
|
|
26
42
|
return this._client.delete(path`/v1/files/${fileID}`, options);
|
|
27
43
|
}
|
|
28
44
|
|
|
29
45
|
/**
|
|
30
|
-
*
|
|
46
|
+
* Generate a pre-signed download URL for a file.
|
|
47
|
+
*
|
|
48
|
+
* Args: file_id: UUID of the file to download identity: Authentication identity
|
|
49
|
+
* containing org_id ttl: Time-to-live for the download URL in seconds (60-3600)
|
|
50
|
+
* db: Database session s3: S3 session for generating pre-signed URLs
|
|
51
|
+
*
|
|
52
|
+
* Returns: FileDownloadResponse: Contains file_id, download URL, and expiration
|
|
53
|
+
* time
|
|
54
|
+
*
|
|
55
|
+
* Raises: HTTPException: 404 if file not found, doesn't belong to org, or not
|
|
56
|
+
* ready
|
|
31
57
|
*/
|
|
32
58
|
download(
|
|
33
59
|
fileID: string,
|
|
@@ -38,21 +64,42 @@ export class Files extends APIResource {
|
|
|
38
64
|
}
|
|
39
65
|
|
|
40
66
|
/**
|
|
41
|
-
* Get
|
|
67
|
+
* Get metadata for a specific file.
|
|
68
|
+
*
|
|
69
|
+
* Args: file_id: UUID of the file to retrieve identity: Authentication identity
|
|
70
|
+
* containing org_id db: Database session
|
|
71
|
+
*
|
|
72
|
+
* Returns: FileMetaResponse: File metadata including upload information
|
|
73
|
+
*
|
|
74
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
75
|
+
* HTTPException: 500 if uploader information is corrupted
|
|
42
76
|
*/
|
|
43
77
|
get(fileID: string, options?: RequestOptions): APIPromise<File> {
|
|
44
78
|
return this._client.get(path`/v1/files/${fileID}`, options);
|
|
45
79
|
}
|
|
46
80
|
|
|
47
81
|
/**
|
|
48
|
-
* Upload
|
|
82
|
+
* Upload a file to the Spitch server.
|
|
83
|
+
*
|
|
84
|
+
* Args: file: The file to upload from the request identity: Authentication
|
|
85
|
+
* identity containing org_id and user_id db: Database session
|
|
86
|
+
*
|
|
87
|
+
* Returns: FileMetaResponse: Metadata for the uploaded file
|
|
88
|
+
*
|
|
89
|
+
* Raises: HTTPException: 500 if upload fails
|
|
49
90
|
*/
|
|
50
91
|
upload(body: FileUploadParams, options?: RequestOptions): APIPromise<File> {
|
|
51
92
|
return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
52
93
|
}
|
|
53
94
|
|
|
54
95
|
/**
|
|
55
|
-
* Get
|
|
96
|
+
* Get storage usage statistics for the authenticated organization.
|
|
97
|
+
*
|
|
98
|
+
* Args: identity: Authentication identity containing org_id db: Database session
|
|
99
|
+
*
|
|
100
|
+
* Returns: FileUsage: Usage statistics including total/used bytes and file count
|
|
101
|
+
*
|
|
102
|
+
* Raises: HTTPException: 500 if unable to calculate usage
|
|
56
103
|
*/
|
|
57
104
|
usage(options?: RequestOptions): APIPromise<FileUsage> {
|
|
58
105
|
return this._client.get('/v1/files:usage', options);
|
|
@@ -61,6 +108,11 @@ export class Files extends APIResource {
|
|
|
61
108
|
|
|
62
109
|
export type FilesFilesCursor = FilesCursor<File>;
|
|
63
110
|
|
|
111
|
+
/**
|
|
112
|
+
* description of a file. Attributes: file_id: unique identifier for the file.
|
|
113
|
+
* status: status of the file, `processing` or `ready` original_name: original name
|
|
114
|
+
* of the file. If the file was uploaded via API
|
|
115
|
+
*/
|
|
64
116
|
export interface File {
|
|
65
117
|
category: string | null;
|
|
66
118
|
|
|
@@ -74,11 +126,18 @@ export interface File {
|
|
|
74
126
|
|
|
75
127
|
size_bytes: number | null;
|
|
76
128
|
|
|
77
|
-
status:
|
|
129
|
+
status: 'uploading' | 'ready';
|
|
78
130
|
|
|
79
|
-
uploaded_by
|
|
131
|
+
uploaded_by?: string | null;
|
|
80
132
|
}
|
|
81
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Storage usage information for an organization.
|
|
136
|
+
*
|
|
137
|
+
* Attributes: total: Human-readable total storage limit used: Human-readable used
|
|
138
|
+
* storage amount total_bytes: Total storage limit in bytes used_bytes: Used
|
|
139
|
+
* storage amount in bytes num_files: Number of files stored
|
|
140
|
+
*/
|
|
82
141
|
export interface FileUsage {
|
|
83
142
|
num_files: number;
|
|
84
143
|
|
|
@@ -91,16 +150,26 @@ export interface FileUsage {
|
|
|
91
150
|
used_bytes: number;
|
|
92
151
|
}
|
|
93
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Response model for listing files.
|
|
155
|
+
*
|
|
156
|
+
* Attributes: items: List of file metadata responses next_cursor: Optional cursor
|
|
157
|
+
* for pagination to get next page of results
|
|
158
|
+
*/
|
|
94
159
|
export interface Files {
|
|
95
160
|
items: Array<File>;
|
|
96
161
|
|
|
97
162
|
next_cursor?: string | null;
|
|
98
163
|
}
|
|
99
164
|
|
|
100
|
-
export
|
|
101
|
-
status?: boolean;
|
|
102
|
-
}
|
|
165
|
+
export type FileDeleteResponse = unknown;
|
|
103
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Response model for file download URLs.
|
|
169
|
+
*
|
|
170
|
+
* Attributes: file_id: Unique identifier for the file url: Pre-signed download URL
|
|
171
|
+
* expires_at: When the download URL expires
|
|
172
|
+
*/
|
|
104
173
|
export interface FileDownloadResponse {
|
|
105
174
|
expires_at: string;
|
|
106
175
|
|
package/src/resources/speech.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { buildHeaders } from '../internal/headers';
|
|
|
7
7
|
import { RequestOptions } from '../internal/request-options';
|
|
8
8
|
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* All speech-focused APIs (TTS and STT)
|
|
12
|
+
*/
|
|
10
13
|
export class Speech extends APIResource {
|
|
11
14
|
/**
|
|
12
15
|
* Synthesize
|
|
@@ -15,7 +18,7 @@ export class Speech extends APIResource {
|
|
|
15
18
|
return this._client.post('/v1/speech', {
|
|
16
19
|
body,
|
|
17
20
|
...options,
|
|
18
|
-
headers: buildHeaders([{ Accept: 'audio
|
|
21
|
+
headers: buildHeaders([{ Accept: 'audio/*' }, options?.headers]),
|
|
19
22
|
__binaryResponse: true,
|
|
20
23
|
});
|
|
21
24
|
}
|
package/src/resources/text.ts
CHANGED
|
@@ -20,16 +20,33 @@ export class Text extends APIResource {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Response model for text diacritization requests.
|
|
25
|
+
*
|
|
26
|
+
* Attributes:
|
|
27
|
+
* request_id: Unique identifier for the diacritization request
|
|
28
|
+
* text: Text with added diacritical marks for proper pronunciation
|
|
29
|
+
* language: Language code for the diacritized text
|
|
30
|
+
*/
|
|
23
31
|
export interface Diacritics {
|
|
24
32
|
request_id: string;
|
|
25
33
|
|
|
26
34
|
text: string;
|
|
27
35
|
}
|
|
28
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Translation result model.
|
|
39
|
+
*
|
|
40
|
+
* Attributes: request_id (UUID): Unique ID for this request. text: translated
|
|
41
|
+
* text. due_date: used when model is `human`. the date you can expect the
|
|
42
|
+
* translation to be delivered
|
|
43
|
+
*/
|
|
29
44
|
export interface Translation {
|
|
30
45
|
request_id: string;
|
|
31
46
|
|
|
32
47
|
text: string;
|
|
48
|
+
|
|
49
|
+
due_date?: string | null;
|
|
33
50
|
}
|
|
34
51
|
|
|
35
52
|
export interface TextToneMarkParams {
|
|
@@ -43,7 +60,13 @@ export interface TextTranslateParams {
|
|
|
43
60
|
|
|
44
61
|
target: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
45
62
|
|
|
46
|
-
|
|
63
|
+
file_id?: string | null;
|
|
64
|
+
|
|
65
|
+
instructions?: string | null;
|
|
66
|
+
|
|
67
|
+
model?: 'human' | 'auto';
|
|
68
|
+
|
|
69
|
+
text?: string | null;
|
|
47
70
|
}
|
|
48
71
|
|
|
49
72
|
export declare namespace Text {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.23.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.23.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.23.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|