spitch 1.20.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 +29 -19
- package/README.md +40 -7
- package/client.d.mts +16 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +16 -4
- package/client.d.ts.map +1 -1
- package/client.js +14 -2
- package/client.js.map +1 -1
- package/client.mjs +16 -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 +143 -0
- package/resources/files.d.mts.map +1 -0
- package/resources/files.d.ts +143 -0
- package/resources/files.d.ts.map +1 -0
- package/resources/files.js +95 -0
- package/resources/files.js.map +1 -0
- package/resources/files.mjs +91 -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 +10 -6
- package/resources/speech.d.mts.map +1 -1
- package/resources/speech.d.ts +10 -6
- 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 +25 -6
- package/resources/text.d.mts.map +1 -1
- package/resources/text.d.ts +25 -6
- package/resources/text.d.ts.map +1 -1
- package/src/client.ts +59 -17
- 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 +205 -0
- package/src/resources/index.ts +13 -7
- package/src/resources/speech.ts +12 -7
- package/src/resources/text.ts +30 -7
- 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,143 @@
|
|
|
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 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
|
|
18
|
+
*/
|
|
19
|
+
list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FilesFilesCursor, File>;
|
|
20
|
+
/**
|
|
21
|
+
* Delete a file and its associated S3 object.
|
|
22
|
+
*
|
|
23
|
+
* Args: file_id: UUID of the file to delete identity: Authentication identity
|
|
24
|
+
* containing org_id db: Database session s3: S3 session for deleting objects
|
|
25
|
+
*
|
|
26
|
+
* Returns: dict: Success confirmation
|
|
27
|
+
*
|
|
28
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
29
|
+
*/
|
|
30
|
+
delete(fileID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Generate a pre-signed download URL for a file.
|
|
33
|
+
*
|
|
34
|
+
* Args: file_id: UUID of the file to download identity: Authentication identity
|
|
35
|
+
* containing org_id ttl: Time-to-live for the download URL in seconds (60-3600)
|
|
36
|
+
* db: Database session s3: S3 session for generating pre-signed URLs
|
|
37
|
+
*
|
|
38
|
+
* Returns: FileDownloadResponse: Contains file_id, download URL, and expiration
|
|
39
|
+
* time
|
|
40
|
+
*
|
|
41
|
+
* Raises: HTTPException: 404 if file not found, doesn't belong to org, or not
|
|
42
|
+
* ready
|
|
43
|
+
*/
|
|
44
|
+
download(fileID: string, query?: FileDownloadParams | null | undefined, options?: RequestOptions): APIPromise<FileDownloadResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Get metadata for a specific file.
|
|
47
|
+
*
|
|
48
|
+
* Args: file_id: UUID of the file to retrieve identity: Authentication identity
|
|
49
|
+
* containing org_id db: Database session
|
|
50
|
+
*
|
|
51
|
+
* Returns: FileMetaResponse: File metadata including upload information
|
|
52
|
+
*
|
|
53
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
54
|
+
* HTTPException: 500 if uploader information is corrupted
|
|
55
|
+
*/
|
|
56
|
+
get(fileID: string, options?: RequestOptions): APIPromise<File>;
|
|
57
|
+
/**
|
|
58
|
+
* Upload a file to the Spitch server.
|
|
59
|
+
*
|
|
60
|
+
* Args: file: The file to upload from the request identity: Authentication
|
|
61
|
+
* identity containing org_id and user_id db: Database session
|
|
62
|
+
*
|
|
63
|
+
* Returns: FileMetaResponse: Metadata for the uploaded file
|
|
64
|
+
*
|
|
65
|
+
* Raises: HTTPException: 500 if upload fails
|
|
66
|
+
*/
|
|
67
|
+
upload(body: FileUploadParams, options?: RequestOptions): APIPromise<File>;
|
|
68
|
+
/**
|
|
69
|
+
* Get storage usage statistics for the authenticated organization.
|
|
70
|
+
*
|
|
71
|
+
* Args: identity: Authentication identity containing org_id db: Database session
|
|
72
|
+
*
|
|
73
|
+
* Returns: FileUsage: Usage statistics including total/used bytes and file count
|
|
74
|
+
*
|
|
75
|
+
* Raises: HTTPException: 500 if unable to calculate usage
|
|
76
|
+
*/
|
|
77
|
+
usage(options?: RequestOptions): APIPromise<FileUsage>;
|
|
78
|
+
}
|
|
79
|
+
export type FilesFilesCursor = FilesCursor<File>;
|
|
80
|
+
/**
|
|
81
|
+
* description of a file. Attributes: file_id: unique identifier for the file.
|
|
82
|
+
* status: status of the file, `processing` or `ready` original_name: original name
|
|
83
|
+
* of the file. If the file was uploaded via API
|
|
84
|
+
*/
|
|
85
|
+
export interface File {
|
|
86
|
+
category: string | null;
|
|
87
|
+
content_type: string | null;
|
|
88
|
+
created_at: string;
|
|
89
|
+
file_id: string;
|
|
90
|
+
original_name: string | null;
|
|
91
|
+
size_bytes: number | null;
|
|
92
|
+
status: 'uploading' | 'ready';
|
|
93
|
+
uploaded_by?: string | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Storage usage information for an organization.
|
|
97
|
+
*
|
|
98
|
+
* Attributes: total: Human-readable total storage limit used: Human-readable used
|
|
99
|
+
* storage amount total_bytes: Total storage limit in bytes used_bytes: Used
|
|
100
|
+
* storage amount in bytes num_files: Number of files stored
|
|
101
|
+
*/
|
|
102
|
+
export interface FileUsage {
|
|
103
|
+
num_files: number;
|
|
104
|
+
total: string;
|
|
105
|
+
total_bytes: number;
|
|
106
|
+
used: string;
|
|
107
|
+
used_bytes: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Response model for listing files.
|
|
111
|
+
*
|
|
112
|
+
* Attributes: items: List of file metadata responses next_cursor: Optional cursor
|
|
113
|
+
* for pagination to get next page of results
|
|
114
|
+
*/
|
|
115
|
+
export interface Files {
|
|
116
|
+
items: Array<File>;
|
|
117
|
+
next_cursor?: string | null;
|
|
118
|
+
}
|
|
119
|
+
export type FileDeleteResponse = unknown;
|
|
120
|
+
/**
|
|
121
|
+
* Response model for file download URLs.
|
|
122
|
+
*
|
|
123
|
+
* Attributes: file_id: Unique identifier for the file url: Pre-signed download URL
|
|
124
|
+
* expires_at: When the download URL expires
|
|
125
|
+
*/
|
|
126
|
+
export interface FileDownloadResponse {
|
|
127
|
+
expires_at: string;
|
|
128
|
+
file_id: string;
|
|
129
|
+
url: string;
|
|
130
|
+
}
|
|
131
|
+
export interface FileListParams extends FilesCursorParams {
|
|
132
|
+
status?: 'uploading' | 'ready' | null;
|
|
133
|
+
}
|
|
134
|
+
export interface FileDownloadParams {
|
|
135
|
+
ttl?: number;
|
|
136
|
+
}
|
|
137
|
+
export interface FileUploadParams {
|
|
138
|
+
file: Uploadable;
|
|
139
|
+
}
|
|
140
|
+
export declare namespace Files {
|
|
141
|
+
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, };
|
|
142
|
+
}
|
|
143
|
+
//# 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,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EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,143 @@
|
|
|
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 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
|
|
18
|
+
*/
|
|
19
|
+
list(query?: FileListParams | null | undefined, options?: RequestOptions): PagePromise<FilesFilesCursor, File>;
|
|
20
|
+
/**
|
|
21
|
+
* Delete a file and its associated S3 object.
|
|
22
|
+
*
|
|
23
|
+
* Args: file_id: UUID of the file to delete identity: Authentication identity
|
|
24
|
+
* containing org_id db: Database session s3: S3 session for deleting objects
|
|
25
|
+
*
|
|
26
|
+
* Returns: dict: Success confirmation
|
|
27
|
+
*
|
|
28
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
29
|
+
*/
|
|
30
|
+
delete(fileID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Generate a pre-signed download URL for a file.
|
|
33
|
+
*
|
|
34
|
+
* Args: file_id: UUID of the file to download identity: Authentication identity
|
|
35
|
+
* containing org_id ttl: Time-to-live for the download URL in seconds (60-3600)
|
|
36
|
+
* db: Database session s3: S3 session for generating pre-signed URLs
|
|
37
|
+
*
|
|
38
|
+
* Returns: FileDownloadResponse: Contains file_id, download URL, and expiration
|
|
39
|
+
* time
|
|
40
|
+
*
|
|
41
|
+
* Raises: HTTPException: 404 if file not found, doesn't belong to org, or not
|
|
42
|
+
* ready
|
|
43
|
+
*/
|
|
44
|
+
download(fileID: string, query?: FileDownloadParams | null | undefined, options?: RequestOptions): APIPromise<FileDownloadResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Get metadata for a specific file.
|
|
47
|
+
*
|
|
48
|
+
* Args: file_id: UUID of the file to retrieve identity: Authentication identity
|
|
49
|
+
* containing org_id db: Database session
|
|
50
|
+
*
|
|
51
|
+
* Returns: FileMetaResponse: File metadata including upload information
|
|
52
|
+
*
|
|
53
|
+
* Raises: HTTPException: 404 if file not found or doesn't belong to org
|
|
54
|
+
* HTTPException: 500 if uploader information is corrupted
|
|
55
|
+
*/
|
|
56
|
+
get(fileID: string, options?: RequestOptions): APIPromise<File>;
|
|
57
|
+
/**
|
|
58
|
+
* Upload a file to the Spitch server.
|
|
59
|
+
*
|
|
60
|
+
* Args: file: The file to upload from the request identity: Authentication
|
|
61
|
+
* identity containing org_id and user_id db: Database session
|
|
62
|
+
*
|
|
63
|
+
* Returns: FileMetaResponse: Metadata for the uploaded file
|
|
64
|
+
*
|
|
65
|
+
* Raises: HTTPException: 500 if upload fails
|
|
66
|
+
*/
|
|
67
|
+
upload(body: FileUploadParams, options?: RequestOptions): APIPromise<File>;
|
|
68
|
+
/**
|
|
69
|
+
* Get storage usage statistics for the authenticated organization.
|
|
70
|
+
*
|
|
71
|
+
* Args: identity: Authentication identity containing org_id db: Database session
|
|
72
|
+
*
|
|
73
|
+
* Returns: FileUsage: Usage statistics including total/used bytes and file count
|
|
74
|
+
*
|
|
75
|
+
* Raises: HTTPException: 500 if unable to calculate usage
|
|
76
|
+
*/
|
|
77
|
+
usage(options?: RequestOptions): APIPromise<FileUsage>;
|
|
78
|
+
}
|
|
79
|
+
export type FilesFilesCursor = FilesCursor<File>;
|
|
80
|
+
/**
|
|
81
|
+
* description of a file. Attributes: file_id: unique identifier for the file.
|
|
82
|
+
* status: status of the file, `processing` or `ready` original_name: original name
|
|
83
|
+
* of the file. If the file was uploaded via API
|
|
84
|
+
*/
|
|
85
|
+
export interface File {
|
|
86
|
+
category: string | null;
|
|
87
|
+
content_type: string | null;
|
|
88
|
+
created_at: string;
|
|
89
|
+
file_id: string;
|
|
90
|
+
original_name: string | null;
|
|
91
|
+
size_bytes: number | null;
|
|
92
|
+
status: 'uploading' | 'ready';
|
|
93
|
+
uploaded_by?: string | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Storage usage information for an organization.
|
|
97
|
+
*
|
|
98
|
+
* Attributes: total: Human-readable total storage limit used: Human-readable used
|
|
99
|
+
* storage amount total_bytes: Total storage limit in bytes used_bytes: Used
|
|
100
|
+
* storage amount in bytes num_files: Number of files stored
|
|
101
|
+
*/
|
|
102
|
+
export interface FileUsage {
|
|
103
|
+
num_files: number;
|
|
104
|
+
total: string;
|
|
105
|
+
total_bytes: number;
|
|
106
|
+
used: string;
|
|
107
|
+
used_bytes: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Response model for listing files.
|
|
111
|
+
*
|
|
112
|
+
* Attributes: items: List of file metadata responses next_cursor: Optional cursor
|
|
113
|
+
* for pagination to get next page of results
|
|
114
|
+
*/
|
|
115
|
+
export interface Files {
|
|
116
|
+
items: Array<File>;
|
|
117
|
+
next_cursor?: string | null;
|
|
118
|
+
}
|
|
119
|
+
export type FileDeleteResponse = unknown;
|
|
120
|
+
/**
|
|
121
|
+
* Response model for file download URLs.
|
|
122
|
+
*
|
|
123
|
+
* Attributes: file_id: Unique identifier for the file url: Pre-signed download URL
|
|
124
|
+
* expires_at: When the download URL expires
|
|
125
|
+
*/
|
|
126
|
+
export interface FileDownloadResponse {
|
|
127
|
+
expires_at: string;
|
|
128
|
+
file_id: string;
|
|
129
|
+
url: string;
|
|
130
|
+
}
|
|
131
|
+
export interface FileListParams extends FilesCursorParams {
|
|
132
|
+
status?: 'uploading' | 'ready' | null;
|
|
133
|
+
}
|
|
134
|
+
export interface FileDownloadParams {
|
|
135
|
+
ttl?: number;
|
|
136
|
+
}
|
|
137
|
+
export interface FileUploadParams {
|
|
138
|
+
file: Uploadable;
|
|
139
|
+
}
|
|
140
|
+
export declare namespace Files {
|
|
141
|
+
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, };
|
|
142
|
+
}
|
|
143
|
+
//# 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;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;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAK,GAAE,cAAc,GAAG,IAAI,GAAG,SAAc,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gBAAgB,EAAE,IAAI,CAAC;IAItC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIrE;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAIn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,OAAO,EAAE,MAAM,CAAC;IAEhB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,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,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.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 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
|
|
21
|
+
*/
|
|
22
|
+
list(query = {}, options) {
|
|
23
|
+
return this._client.getAPIList('/v1/files', (pagination_1.FilesCursor), { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
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
|
|
34
|
+
*/
|
|
35
|
+
delete(fileID, options) {
|
|
36
|
+
return this._client.delete((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
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
|
|
50
|
+
*/
|
|
51
|
+
download(fileID, query = {}, options) {
|
|
52
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}/url`, { query, ...options });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
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
|
|
64
|
+
*/
|
|
65
|
+
get(fileID, options) {
|
|
66
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
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
|
|
77
|
+
*/
|
|
78
|
+
upload(body, options) {
|
|
79
|
+
return this._client.post('/v1/files', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
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
|
|
89
|
+
*/
|
|
90
|
+
usage(options) {
|
|
91
|
+
return this._client.get('/v1/files:usage', options);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.Files = Files;
|
|
95
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +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;IACpC;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAA2C,EAAE,EAC7C,OA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/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 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
|
|
18
|
+
*/
|
|
19
|
+
list(query = {}, options) {
|
|
20
|
+
return this._client.getAPIList('/v1/files', (FilesCursor), { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
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
|
|
31
|
+
*/
|
|
32
|
+
delete(fileID, options) {
|
|
33
|
+
return this._client.delete(path `/v1/files/${fileID}`, options);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
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
|
|
47
|
+
*/
|
|
48
|
+
download(fileID, query = {}, options) {
|
|
49
|
+
return this._client.get(path `/v1/files/${fileID}/url`, { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
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
|
|
61
|
+
*/
|
|
62
|
+
get(fileID, options) {
|
|
63
|
+
return this._client.get(path `/v1/files/${fileID}`, options);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
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
|
|
74
|
+
*/
|
|
75
|
+
upload(body, options) {
|
|
76
|
+
return this._client.post('/v1/files', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
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
|
|
86
|
+
*/
|
|
87
|
+
usage(options) {
|
|
88
|
+
return this._client.get('/v1/files:usage', options);
|
|
89
|
+
}
|
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AAG,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/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
|
@@ -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
|
|
@@ -10,14 +13,14 @@ export declare class Speech extends APIResource {
|
|
|
10
13
|
/**
|
|
11
14
|
* Transcribe
|
|
12
15
|
*/
|
|
13
|
-
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<
|
|
16
|
+
transcribe(body: SpeechTranscribeParams, options?: RequestOptions): APIPromise<Transcription>;
|
|
14
17
|
}
|
|
15
|
-
export interface
|
|
18
|
+
export interface Transcription {
|
|
16
19
|
request_id: string;
|
|
17
20
|
text: string;
|
|
18
|
-
timestamps?: Array<
|
|
21
|
+
timestamps?: Array<Transcription.Timestamp> | null;
|
|
19
22
|
}
|
|
20
|
-
export declare namespace
|
|
23
|
+
export declare namespace Transcription {
|
|
21
24
|
interface Timestamp {
|
|
22
25
|
end: number;
|
|
23
26
|
start: number;
|
|
@@ -28,17 +31,18 @@ export interface SpeechGenerateParams {
|
|
|
28
31
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
29
32
|
text: string;
|
|
30
33
|
voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
|
|
34
|
+
format?: 'wav' | 'mp3' | 'ogg_opus' | 'webm_opus' | 'flac' | 'pcm_s16le' | 'mulaw' | 'alaw';
|
|
31
35
|
model?: 'legacy' | null;
|
|
32
36
|
}
|
|
33
37
|
export interface SpeechTranscribeParams {
|
|
34
38
|
language: 'yo' | 'en' | 'ha' | 'ig' | 'am';
|
|
35
39
|
content?: Uploadable | null;
|
|
36
|
-
model?: 'mansa_v1' | 'legacy' | null;
|
|
40
|
+
model?: 'mansa_v1' | 'legacy' | 'human' | null;
|
|
37
41
|
special_words?: string | null;
|
|
38
42
|
timestamp?: 'sentence' | 'word' | 'none' | null;
|
|
39
43
|
url?: string | null;
|
|
40
44
|
}
|
|
41
45
|
export declare namespace Speech {
|
|
42
|
-
export { type
|
|
46
|
+
export { type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
|
|
43
47
|
}
|
|
44
48
|
//# 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;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,
|
|
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;;GAEG;AACH,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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