diffio 0.4.63 → 1.0.1
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/README.md +208 -296
- package/dist/Client.d.ts +85 -148
- package/dist/Client.js +73 -798
- package/dist/api/resources/account.d.ts +38 -0
- package/dist/api/resources/account.js +96 -0
- package/dist/api/resources/editing.d.ts +54 -0
- package/dist/api/resources/editing.js +168 -0
- package/dist/api/resources/generations.d.ts +52 -0
- package/dist/api/resources/generations.js +145 -0
- package/dist/api/resources/index.d.ts +5 -7
- package/dist/api/resources/index.js +18 -15
- package/dist/api/resources/models.d.ts +9 -0
- package/dist/api/resources/models.js +23 -0
- package/dist/api/resources/projects.d.ts +51 -0
- package/dist/api/resources/projects.js +128 -0
- package/dist/api/types.d.ts +423 -222
- package/dist/api/types.js +2 -0
- package/dist/core/edgeUpload.d.ts +39 -39
- package/dist/core/edgeUpload.js +170 -125
- package/dist/core/files.d.ts +15 -0
- package/dist/core/files.js +121 -0
- package/dist/core/node.d.ts +7 -0
- package/dist/core/node.js +17 -0
- package/dist/core/pagination.d.ts +33 -0
- package/dist/core/pagination.js +64 -0
- package/dist/core/poll.d.ts +23 -0
- package/dist/core/poll.js +30 -0
- package/dist/core/retry.d.ts +8 -7
- package/dist/core/retry.js +39 -25
- package/dist/core/transport.d.ts +75 -0
- package/dist/core/transport.js +220 -0
- package/dist/core/url.d.ts +10 -0
- package/dist/core/url.js +38 -0
- package/dist/core/webhookSignature.d.ts +20 -0
- package/dist/core/webhookSignature.js +147 -0
- package/dist/errors/index.d.ts +60 -18
- package/dist/errors/index.js +61 -13
- package/dist/index.d.ts +8 -1
- package/dist/index.js +9 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -7
- package/dist/BaseClient.d.ts +0 -26
- package/dist/BaseClient.js +0 -17
- package/dist/api/resources/account/client/Client.d.ts +0 -15
- package/dist/api/resources/account/client/Client.js +0 -15
- package/dist/api/resources/apiKeys/client/Client.d.ts +0 -27
- package/dist/api/resources/apiKeys/client/Client.js +0 -21
- package/dist/api/resources/audioIsolation/client/Client.d.ts +0 -43
- package/dist/api/resources/audioIsolation/client/Client.js +0 -33
- package/dist/api/resources/generations/client/Client.d.ts +0 -48
- package/dist/api/resources/generations/client/Client.js +0 -36
- package/dist/api/resources/projects/client/Client.d.ts +0 -21
- package/dist/api/resources/projects/client/Client.js +0 -19
- package/dist/api/resources/usage/client/Client.d.ts +0 -11
- package/dist/api/resources/usage/client/Client.js +0 -12
- package/dist/api/resources/webhooks/client/Client.d.ts +0 -29
- package/dist/api/resources/webhooks/client/Client.js +0 -76
- package/dist/api/serialization.d.ts +0 -21
- package/dist/api/serialization.js +0 -274
package/dist/api/types.d.ts
CHANGED
|
@@ -1,230 +1,431 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
export type WebhookEventType = "generation.queued" | "generation.processing" | "generation.failed" | "generation.completed";
|
|
15
|
-
export type GenerationWebhookStatus = "queued" | "processing" | "error" | "complete";
|
|
16
|
-
export type TranscriptionStatus = "pending" | "available" | "unavailable";
|
|
17
|
-
export interface GenerationTranscription {
|
|
18
|
-
status: TranscriptionStatus;
|
|
19
|
-
}
|
|
20
|
-
/** Warning codes the SDK knows; warnings with other codes are left out of parsed responses. */
|
|
21
|
-
export type GenerationWarningCode = "unsupported_language";
|
|
22
|
-
/** Something about a generation's recording to know about; the generation still runs. */
|
|
23
|
-
export interface GenerationWarning {
|
|
24
|
-
/** `unsupported_language`: the transcript has speech in a language Diffio does not support yet. */
|
|
25
|
-
code: GenerationWarningCode;
|
|
26
|
-
/** ISO 639-1 base codes such as `ja`, the language with the most words first. */
|
|
27
|
-
languages: string[];
|
|
28
|
-
/** A readable explanation, for example that the result probably won't be usable. */
|
|
1
|
+
export type { ListResponse } from "../core/pagination";
|
|
2
|
+
/** Shape of a v2 error body. The SDK throws it as DiffioApiError. */
|
|
3
|
+
export interface ErrorBody {
|
|
4
|
+
error: {
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
request_id: string | null;
|
|
8
|
+
details?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** The `error` of a failed project, export or assistant turn. */
|
|
12
|
+
export interface ResourceError {
|
|
13
|
+
code: string;
|
|
29
14
|
message: string;
|
|
30
15
|
}
|
|
31
|
-
/** The
|
|
32
|
-
export interface
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
export interface
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
export interface
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
16
|
+
/** The `error` of a failed generation. */
|
|
17
|
+
export interface GenerationError extends ResourceError {
|
|
18
|
+
retryable: boolean;
|
|
19
|
+
explanation: string | null;
|
|
20
|
+
}
|
|
21
|
+
export type ModelStatus = "hosted" | "alias" | "retired";
|
|
22
|
+
/** Hosted names and the tier aliases that always mean the current model of a tier. Any string is accepted. */
|
|
23
|
+
export type ModelName = "diffio-flash" | "diffio-pro" | "diffio-4.7-flash" | "diffio-4.7-pro" | (string & {});
|
|
24
|
+
export interface Model {
|
|
25
|
+
id: string;
|
|
26
|
+
object: "model";
|
|
27
|
+
status: ModelStatus;
|
|
28
|
+
label: string | null;
|
|
29
|
+
served_by: string;
|
|
30
|
+
price_per_hour_usd: number;
|
|
31
|
+
}
|
|
32
|
+
export type ProjectStatus = "awaiting_upload" | "preparing" | "ready" | "failed";
|
|
33
|
+
/** `generation` on `POST /projects`: request the first restore now; it starts once the upload is ready. */
|
|
34
|
+
export interface ProjectGenerationCreate {
|
|
35
|
+
model: ModelName;
|
|
36
|
+
label?: string;
|
|
37
|
+
sampling?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export interface ProjectCreateParams {
|
|
40
|
+
/** File name with a media extension (`.mp3`, `.wav`, `.mp4`, ...). */
|
|
41
|
+
file_name: string;
|
|
42
|
+
content_type?: string;
|
|
43
|
+
size_bytes?: number;
|
|
44
|
+
/** Up to 50 string values; keys up to 40 characters, values up to 500. */
|
|
45
|
+
metadata?: Record<string, string>;
|
|
46
|
+
generation?: ProjectGenerationCreate;
|
|
47
|
+
/**
|
|
48
|
+
* Not a body field: the SDK sends it as the `Diffio-End-User` header (same as `options.endUser`).
|
|
49
|
+
*/
|
|
50
|
+
end_user?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface UploadRequest {
|
|
53
|
+
method: "POST" | "PUT";
|
|
54
|
+
url: string;
|
|
55
|
+
headers: Record<string, string>;
|
|
56
|
+
body: Record<string, unknown> | null;
|
|
57
|
+
returns: string[];
|
|
58
|
+
description: string;
|
|
59
|
+
}
|
|
60
|
+
/** Where and how to send the media bytes: Diffio's media host, in parts. `projects.upload` does all of it. */
|
|
61
|
+
export interface ProjectUpload {
|
|
62
|
+
upload_session_id: string;
|
|
63
|
+
edge_base_url: string;
|
|
64
|
+
upload_token: string;
|
|
65
|
+
part_size_bytes: number;
|
|
66
|
+
max_bytes: number;
|
|
67
|
+
expires_at: string;
|
|
68
|
+
requests: {
|
|
69
|
+
start: UploadRequest;
|
|
70
|
+
part: UploadRequest;
|
|
71
|
+
complete: UploadRequest;
|
|
72
|
+
abort?: UploadRequest;
|
|
73
|
+
[name: string]: UploadRequest | undefined;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export interface Project {
|
|
77
|
+
id: string;
|
|
78
|
+
object: "project";
|
|
79
|
+
status: ProjectStatus;
|
|
80
|
+
file_name: string | null;
|
|
81
|
+
content_type: string | null;
|
|
82
|
+
size_bytes: number | null;
|
|
83
|
+
duration_seconds: number | null;
|
|
84
|
+
has_video: boolean;
|
|
85
|
+
end_user: string | null;
|
|
86
|
+
metadata: Record<string, string>;
|
|
87
|
+
generation_count: number;
|
|
88
|
+
video_preview_status: "preparing" | "ready" | "failed" | null;
|
|
89
|
+
latest_generation: Generation | null;
|
|
90
|
+
share_id: string | null;
|
|
91
|
+
created_at: string | null;
|
|
92
|
+
updated_at: string | null;
|
|
93
|
+
error: ResourceError | null;
|
|
94
|
+
}
|
|
95
|
+
/** A project as `POST /projects` and `POST /projects/{id}/upload` answer it. */
|
|
96
|
+
export interface ProjectWithUpload extends Project {
|
|
97
|
+
upload: ProjectUpload | null;
|
|
98
|
+
}
|
|
99
|
+
export interface ProjectDeleted {
|
|
100
|
+
id: string;
|
|
101
|
+
object: "project";
|
|
102
|
+
deleted: true;
|
|
103
|
+
deleted_generations: number;
|
|
104
|
+
deleted_media_objects: number;
|
|
105
|
+
}
|
|
106
|
+
export interface ListParams {
|
|
107
|
+
/** 1 to 100, default 20. */
|
|
108
|
+
limit?: number;
|
|
109
|
+
/** The previous page's `next_cursor`. */
|
|
110
|
+
cursor?: string;
|
|
111
|
+
}
|
|
112
|
+
export type GenerationStatus = "queued" | "processing" | "complete" | "failed";
|
|
113
|
+
export interface GenerationCreateParams {
|
|
114
|
+
model: ModelName;
|
|
115
|
+
label?: string;
|
|
116
|
+
sampling?: Record<string, unknown>;
|
|
117
|
+
}
|
|
100
118
|
export interface GenerationStageProgress {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export interface
|
|
119
|
+
overall_percent?: number;
|
|
120
|
+
stage_percent?: number;
|
|
121
|
+
bytes_done?: number;
|
|
122
|
+
bytes_total?: number;
|
|
123
|
+
available_through_seconds?: number;
|
|
124
|
+
duration_seconds?: number;
|
|
125
|
+
[key: string]: unknown;
|
|
126
|
+
}
|
|
127
|
+
export interface GenerationQueue {
|
|
110
128
|
position: number | null;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
129
|
+
connected_workers: number | null;
|
|
130
|
+
idle_workers: number | null;
|
|
131
|
+
busy_workers: number | null;
|
|
132
|
+
wait_reason: "all_busy" | "no_workers" | "next_in_line" | null;
|
|
133
|
+
message: string | null;
|
|
134
|
+
[key: string]: unknown;
|
|
135
|
+
}
|
|
136
|
+
export interface GenerationWarning {
|
|
137
|
+
code: string;
|
|
138
|
+
languages?: string[];
|
|
115
139
|
message: string;
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
}
|
|
142
|
+
export interface GenerationEdit {
|
|
143
|
+
edit_count: number | null;
|
|
144
|
+
max_windows: number | null;
|
|
145
|
+
windows: number | null;
|
|
146
|
+
windows_done: number | null;
|
|
147
|
+
retry_windows?: number | null;
|
|
148
|
+
ranges: Array<{
|
|
149
|
+
start: number;
|
|
150
|
+
end: number;
|
|
151
|
+
}>;
|
|
152
|
+
billable_seconds: number | null;
|
|
153
|
+
cut_seconds: number | null;
|
|
154
|
+
request_id: string | null;
|
|
155
|
+
language: string | null;
|
|
156
|
+
tighten: {
|
|
157
|
+
close_removed_gaps: boolean;
|
|
158
|
+
max_pause_seconds: number | null;
|
|
159
|
+
} | null;
|
|
160
|
+
[key: string]: unknown;
|
|
116
161
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
queue
|
|
131
|
-
/** Independent of media completion; omitted by older API versions. */
|
|
132
|
-
transcription?: GenerationTranscription;
|
|
133
|
-
/** Empty until the transcript is ready, and when older API versions omit it. */
|
|
162
|
+
/** Names `files_available` and `GET .../media` can list. */
|
|
163
|
+
export type GenerationFileName = "original" | "audio" | "audio_mixed" | "video" | "hls_master" | "hls_restored" | "hls_original" | "video_hls" | "waveform_restored" | "waveform_original" | "transcript" | "edited_transcript" | "stems_manifest" | "metadata" | (string & {});
|
|
164
|
+
export interface Generation {
|
|
165
|
+
id: string;
|
|
166
|
+
object: "generation";
|
|
167
|
+
project_id: string;
|
|
168
|
+
status: GenerationStatus;
|
|
169
|
+
model: string | null;
|
|
170
|
+
requested_model: string | null;
|
|
171
|
+
substituted: boolean;
|
|
172
|
+
price_per_hour_usd: number | null;
|
|
173
|
+
stage: string | null;
|
|
174
|
+
stage_progress: GenerationStageProgress | null;
|
|
175
|
+
queue: GenerationQueue | null;
|
|
134
176
|
warnings: GenerationWarning[];
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
export interface
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
export interface
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
export interface
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
177
|
+
label: string | null;
|
|
178
|
+
kind: "restore" | "edit";
|
|
179
|
+
source_generation_id: string | null;
|
|
180
|
+
edit: GenerationEdit | null;
|
|
181
|
+
transcript_editable: boolean;
|
|
182
|
+
duration_seconds: number | null;
|
|
183
|
+
quality_score: number | null;
|
|
184
|
+
transcription_status: "preparing" | "ready" | "failed" | null;
|
|
185
|
+
files_available: GenerationFileName[];
|
|
186
|
+
error: GenerationError | null;
|
|
187
|
+
stems_status: "preparing" | "ready" | "failed" | null;
|
|
188
|
+
created_at: string | null;
|
|
189
|
+
updated_at: string | null;
|
|
190
|
+
}
|
|
191
|
+
export interface GenerationMediaParams {
|
|
192
|
+
/** 4 to 3600: a preview grant names only playlists and other preview-readable files. */
|
|
193
|
+
preview_seconds?: number;
|
|
194
|
+
}
|
|
195
|
+
export interface GenerationMedia {
|
|
196
|
+
object: "generation_media";
|
|
197
|
+
project_id: string;
|
|
198
|
+
generation_id: string;
|
|
199
|
+
status: GenerationStatus;
|
|
200
|
+
/** File name -> URL. URLs need no API key and stop working at `expires_at` (6 hours). */
|
|
201
|
+
files: Partial<Record<GenerationFileName, string>>;
|
|
202
|
+
base_url: string;
|
|
203
|
+
expires_at: string;
|
|
204
|
+
preview_seconds: number | null;
|
|
205
|
+
}
|
|
206
|
+
export interface TranscriptWordInput {
|
|
207
|
+
id?: string;
|
|
208
|
+
text?: string;
|
|
209
|
+
word?: string;
|
|
210
|
+
start?: number | null;
|
|
211
|
+
end?: number | null;
|
|
212
|
+
probability?: number | null;
|
|
213
|
+
speaker?: string;
|
|
214
|
+
language?: string;
|
|
215
|
+
changed?: boolean;
|
|
216
|
+
regenerate?: boolean;
|
|
217
|
+
[key: string]: unknown;
|
|
218
|
+
}
|
|
219
|
+
export interface TranscriptEditCreateParams {
|
|
220
|
+
/** The whole transcript after editing, in order; `text: ""` removes a word. */
|
|
221
|
+
words?: TranscriptWordInput[];
|
|
222
|
+
tighten?: {
|
|
223
|
+
close_removed_gaps?: boolean;
|
|
224
|
+
max_pause_seconds?: number;
|
|
225
|
+
};
|
|
226
|
+
/** Your own id, echoed as `edit.request_id` (`[A-Za-z0-9_-]{1,64}`). Not an idempotency key. */
|
|
227
|
+
request_id?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface TranscriptEditEstimate {
|
|
230
|
+
object: "transcript_edit_estimate";
|
|
231
|
+
project_id: string;
|
|
232
|
+
generation_id: string;
|
|
233
|
+
edit_count: number | null;
|
|
234
|
+
max_windows: number | null;
|
|
235
|
+
window_seconds: number;
|
|
236
|
+
max_billable_seconds: number;
|
|
237
|
+
}
|
|
238
|
+
export interface GenerationMix {
|
|
239
|
+
object: "generation_mix";
|
|
240
|
+
project_id: string;
|
|
241
|
+
generation_id: string;
|
|
242
|
+
background_gain: number;
|
|
243
|
+
leveling: boolean;
|
|
244
|
+
revision: string;
|
|
245
|
+
stems_revision: string | null;
|
|
246
|
+
}
|
|
247
|
+
export interface GenerationMixSaveParams {
|
|
248
|
+
/** 0 = speech only, 1 = all of the background. */
|
|
249
|
+
background_gain: number;
|
|
250
|
+
leveling?: boolean;
|
|
251
|
+
/** The `revision` you read; a stale one is refused with 409 `revision_conflict`. */
|
|
252
|
+
revision?: string;
|
|
253
|
+
}
|
|
254
|
+
export type ExportArtifact = "speech" | "background" | "mix" | "both" | "original";
|
|
255
|
+
export type ExportFormat = "wav" | "mp3" | "m4a" | "mp4" | "zip";
|
|
256
|
+
export interface GenerationExportCreateParams {
|
|
257
|
+
artifact: ExportArtifact;
|
|
258
|
+
format: ExportFormat;
|
|
259
|
+
inline?: boolean;
|
|
260
|
+
background_gain?: number;
|
|
261
|
+
leveling?: boolean;
|
|
262
|
+
/** Download name without extension, up to 200 characters. */
|
|
263
|
+
file_name?: string;
|
|
264
|
+
}
|
|
265
|
+
export interface GenerationExportGetParams {
|
|
266
|
+
file_name?: string;
|
|
267
|
+
}
|
|
268
|
+
export interface GenerationExport {
|
|
269
|
+
object: "generation_export";
|
|
270
|
+
id: string;
|
|
271
|
+
project_id: string;
|
|
272
|
+
generation_id: string;
|
|
273
|
+
status: "queued" | "processing" | "ready" | "failed";
|
|
274
|
+
artifact: string | null;
|
|
275
|
+
format: string | null;
|
|
276
|
+
background_gain: number | null;
|
|
277
|
+
leveling: boolean;
|
|
278
|
+
inline: boolean;
|
|
279
|
+
url: string | null;
|
|
280
|
+
error: ResourceError | null;
|
|
281
|
+
}
|
|
282
|
+
export interface TranscriptWord {
|
|
283
|
+
id: string;
|
|
284
|
+
text: string;
|
|
285
|
+
start: number | null;
|
|
286
|
+
end: number | null;
|
|
287
|
+
probability: number | null;
|
|
288
|
+
speaker?: string;
|
|
289
|
+
language?: string;
|
|
290
|
+
[key: string]: unknown;
|
|
291
|
+
}
|
|
292
|
+
export interface TranscriptGetParams {
|
|
293
|
+
preview_seconds?: number;
|
|
294
|
+
}
|
|
295
|
+
export interface Transcript {
|
|
296
|
+
object: "transcript";
|
|
297
|
+
project_id: string;
|
|
298
|
+
generation_id: string;
|
|
299
|
+
text: string;
|
|
300
|
+
words: TranscriptWord[];
|
|
301
|
+
preview_seconds: number | null;
|
|
302
|
+
truncated: boolean;
|
|
303
|
+
}
|
|
304
|
+
export interface TranscriptDraft {
|
|
305
|
+
object: "transcript_draft";
|
|
306
|
+
project_id: string;
|
|
307
|
+
generation_id: string;
|
|
308
|
+
revision: string;
|
|
309
|
+
data: Record<string, unknown> | null;
|
|
310
|
+
created_at: string | null;
|
|
311
|
+
updated_at: string | null;
|
|
312
|
+
}
|
|
313
|
+
export interface TranscriptDraftSaveParams {
|
|
314
|
+
data: Record<string, unknown>;
|
|
315
|
+
revision?: string;
|
|
316
|
+
}
|
|
317
|
+
export interface TranscriptDraftDeleteParams {
|
|
318
|
+
revision?: string;
|
|
319
|
+
}
|
|
320
|
+
export interface TranscriptDraftDeleted {
|
|
321
|
+
object: "transcript_draft";
|
|
322
|
+
project_id: string;
|
|
323
|
+
generation_id: string;
|
|
324
|
+
deleted: true;
|
|
325
|
+
revision: string;
|
|
326
|
+
}
|
|
327
|
+
export interface TranscriptAssistantMessage {
|
|
328
|
+
role: "user" | "assistant";
|
|
329
|
+
content: string;
|
|
330
|
+
}
|
|
331
|
+
export interface TranscriptAssistantTurnCreateParams {
|
|
332
|
+
messages: TranscriptAssistantMessage[];
|
|
333
|
+
words?: TranscriptWordInput[];
|
|
334
|
+
selection?: {
|
|
335
|
+
word_ids: string[];
|
|
336
|
+
} | null;
|
|
337
|
+
playhead_seconds?: number | null;
|
|
338
|
+
source?: string;
|
|
339
|
+
}
|
|
340
|
+
export interface TranscriptAssistantTurn {
|
|
341
|
+
object: "transcript_assistant_turn";
|
|
342
|
+
id: string;
|
|
343
|
+
project_id: string;
|
|
344
|
+
generation_id: string;
|
|
345
|
+
status: "processing" | "complete" | "failed";
|
|
346
|
+
created_at: string | null;
|
|
347
|
+
completed_at: string | null;
|
|
348
|
+
error: ResourceError | null;
|
|
349
|
+
reply?: string;
|
|
350
|
+
proposals?: Array<Record<string, unknown>>;
|
|
351
|
+
moments?: Array<Record<string, unknown>>;
|
|
352
|
+
unclear_word_ids?: string[];
|
|
353
|
+
speaker_turns?: Array<Record<string, unknown>>;
|
|
354
|
+
shortening?: Record<string, unknown> | null;
|
|
355
|
+
feedback_offer?: Record<string, unknown> | null;
|
|
356
|
+
notices?: string[];
|
|
357
|
+
windows_total?: number;
|
|
358
|
+
[key: string]: unknown;
|
|
359
|
+
}
|
|
360
|
+
export interface ProjectSharePublishParams {
|
|
361
|
+
/** Pin a finished generation; default is the project's newest finished one. */
|
|
362
|
+
generation_id?: string;
|
|
363
|
+
preview_seconds?: number;
|
|
364
|
+
}
|
|
365
|
+
export interface ProjectShare {
|
|
366
|
+
object: "project_share";
|
|
367
|
+
id: string;
|
|
368
|
+
project_id: string;
|
|
369
|
+
generation_id: string | null;
|
|
370
|
+
file_name: string | null;
|
|
371
|
+
content_type: string | null;
|
|
372
|
+
created_at: string | null;
|
|
373
|
+
has_video: boolean;
|
|
374
|
+
duration_seconds: number | null;
|
|
375
|
+
preview_seconds: number | null;
|
|
376
|
+
files: Partial<Record<GenerationFileName, string>>;
|
|
377
|
+
base_url: string | null;
|
|
378
|
+
}
|
|
379
|
+
export interface ProjectShareRevoked {
|
|
380
|
+
object: "project_share";
|
|
381
|
+
id: string | null;
|
|
382
|
+
project_id: string;
|
|
383
|
+
deleted: true;
|
|
384
|
+
}
|
|
385
|
+
export interface UsageParams {
|
|
386
|
+
/** ISO 8601 date or datetime; default the start of this month (UTC). */
|
|
387
|
+
start?: string;
|
|
388
|
+
/** ISO 8601 date or datetime; default now. At most 366 days after `start`. */
|
|
389
|
+
end?: string;
|
|
390
|
+
}
|
|
391
|
+
export interface UsageByModel {
|
|
392
|
+
model: string;
|
|
393
|
+
generations: number;
|
|
394
|
+
billable_seconds: number;
|
|
395
|
+
list_price_usd: number;
|
|
396
|
+
}
|
|
397
|
+
export interface Usage {
|
|
398
|
+
object: "usage";
|
|
399
|
+
start: string | null;
|
|
400
|
+
end: string | null;
|
|
401
|
+
end_user: string | null;
|
|
402
|
+
generations: number;
|
|
403
|
+
billable_seconds: number;
|
|
404
|
+
list_price_usd: number;
|
|
405
|
+
by_model: UsageByModel[];
|
|
406
|
+
}
|
|
407
|
+
export interface WebhookPortal {
|
|
408
|
+
object: "webhook_portal";
|
|
409
|
+
url: string;
|
|
410
|
+
event_types: WebhookEventType[];
|
|
411
|
+
}
|
|
412
|
+
export type WebhookEventType = "generation.completed" | "generation.failed" | "generation.stems_ready" | "generation.stems_failed" | "export.ready" | "export.failed" | "transcript_assistant_turn.completed" | "transcript_assistant_turn.failed" | "project.ready" | "project.failed";
|
|
413
|
+
export interface WebhookEventData {
|
|
414
|
+
object: "generation" | "generation_export" | "transcript_assistant_turn" | "project" | (string & {});
|
|
415
|
+
id: string;
|
|
416
|
+
project_id?: string;
|
|
417
|
+
generation_id?: string;
|
|
418
|
+
end_user?: string | null;
|
|
419
|
+
status?: string;
|
|
420
|
+
kind?: "restore" | "edit";
|
|
421
|
+
error_code?: string;
|
|
422
|
+
stems_status?: string;
|
|
423
|
+
[key: string]: unknown;
|
|
424
|
+
}
|
|
425
|
+
/** A verified webhook delivery: `{"type", "id", "created_at", "data"}`. De-duplicate on `id`. */
|
|
426
|
+
export interface WebhookEvent {
|
|
427
|
+
type: WebhookEventType | (string & {});
|
|
428
|
+
id: string;
|
|
429
|
+
created_at: string;
|
|
430
|
+
data: WebhookEventData;
|
|
230
431
|
}
|
package/dist/api/types.js
CHANGED