@audialize/sdk 0.1.0 → 1.0.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/README.md +32 -0
- package/dist/index.cjs +807 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +506 -3
- package/dist/index.d.ts +506 -3
- package/dist/index.js +765 -9
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ interface HttpClientOptions {
|
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
timeout?: number;
|
|
5
5
|
maxRetries?: number;
|
|
6
|
+
defaultHeaders?: Record<string, string>;
|
|
6
7
|
fetch?: typeof fetch;
|
|
7
8
|
}
|
|
8
9
|
declare class HttpClient {
|
|
@@ -10,16 +11,199 @@ declare class HttpClient {
|
|
|
10
11
|
private readonly baseUrl;
|
|
11
12
|
private readonly timeout;
|
|
12
13
|
private readonly maxRetries;
|
|
14
|
+
private readonly defaultHeaders;
|
|
13
15
|
private readonly fetchImpl;
|
|
14
16
|
constructor(options: HttpClientOptions);
|
|
15
17
|
request<T>(path: string, options?: RequestInit): Promise<T>;
|
|
18
|
+
requestRaw(path: string, options?: RequestInit): Promise<Response>;
|
|
19
|
+
private execute;
|
|
16
20
|
private handleErrorResponse;
|
|
17
21
|
private delay;
|
|
18
22
|
private getBackoffDelay;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
type
|
|
25
|
+
declare const DOMAIN_ENTITY_KINDS: readonly ["job", "live_session", "highlight_run", "dubbing_run", "clip_artifact", "commentary_run", "artifact", "export_package"];
|
|
26
|
+
type DomainEntityKind = (typeof DOMAIN_ENTITY_KINDS)[number];
|
|
27
|
+
declare const CAPABILITY_READINESS_STATES: readonly ["unavailable", "queued", "processing", "partial", "review_required", "ready", "failed"];
|
|
28
|
+
type CapabilityReadinessState = (typeof CAPABILITY_READINESS_STATES)[number];
|
|
29
|
+
declare const CANONICAL_JOB_STATUSES: readonly ["created", "queued", "processing", "completed", "failed", "cancelled"];
|
|
30
|
+
type CanonicalJobStatus = (typeof CANONICAL_JOB_STATUSES)[number];
|
|
31
|
+
declare const LEGACY_JOB_STATUSES: readonly ["pending", "processing", "completed", "failed", "created", "uploaded", "initializing", "transcribing", "translating", "paused"];
|
|
32
|
+
type LegacyJobStatus = (typeof LEGACY_JOB_STATUSES)[number];
|
|
33
|
+
type CompatibleJobStatus = CanonicalJobStatus | LegacyJobStatus;
|
|
34
|
+
declare const LEGACY_TO_CANONICAL_JOB_STATUS: Record<LegacyJobStatus, CanonicalJobStatus>;
|
|
35
|
+
declare const CANONICAL_JOB_CURRENT_STEPS: readonly ["awaiting_upload", "initializing", "extracting_audio", "transcribing", "translating", "generating_subtitles", "generating_summary", "generating_dubbing", "packaging_exports", "finalizing"];
|
|
36
|
+
type CanonicalJobCurrentStep = (typeof CANONICAL_JOB_CURRENT_STEPS)[number];
|
|
37
|
+
declare const LEGACY_JOB_CURRENT_STEPS: readonly ["initializing", "extracting_audio", "transcribing", "translating", "cleaning_subtitles", "generating_summary", "completing"];
|
|
38
|
+
type LegacyJobCurrentStep = (typeof LEGACY_JOB_CURRENT_STEPS)[number];
|
|
39
|
+
type CompatibleJobCurrentStep = CanonicalJobCurrentStep | LegacyJobCurrentStep;
|
|
40
|
+
declare const LEGACY_TO_CANONICAL_JOB_CURRENT_STEP: Record<LegacyJobCurrentStep, CanonicalJobCurrentStep>;
|
|
41
|
+
declare const LIVE_SESSION_STATUSES: readonly ["scheduled", "starting", "live", "finalizing", "completed", "failed", "cancelled"];
|
|
42
|
+
type LiveSessionStatus = (typeof LIVE_SESSION_STATUSES)[number];
|
|
43
|
+
declare const LIVE_SESSION_CURRENT_STEPS: readonly ["provisioning_stream", "connecting_inputs", "capturing_audio", "transcribing_live", "translating_live", "publishing_live_subtitles", "finalizing_session", "archiving_outputs"];
|
|
44
|
+
type LiveSessionCurrentStep = (typeof LIVE_SESSION_CURRENT_STEPS)[number];
|
|
45
|
+
declare const HIGHLIGHT_RUN_STATUSES: readonly ["queued", "processing", "completed", "failed", "cancelled"];
|
|
46
|
+
type HighlightRunStatus = (typeof HIGHLIGHT_RUN_STATUSES)[number];
|
|
47
|
+
declare const HIGHLIGHT_RUN_CURRENT_STEPS: readonly ["loading_source_context", "detecting_candidates", "scoring_candidates", "selecting_moments", "rendering_clips", "indexing_results"];
|
|
48
|
+
type HighlightRunCurrentStep = (typeof HIGHLIGHT_RUN_CURRENT_STEPS)[number];
|
|
49
|
+
declare const DUBBING_RUN_STATUSES: readonly ["queued", "processing", "partial", "completed", "failed", "cancelled"];
|
|
50
|
+
type DubbingRunStatus = (typeof DUBBING_RUN_STATUSES)[number];
|
|
51
|
+
declare const DUBBING_RUN_CURRENT_STEPS: readonly ["loading_source_media", "requesting_dubbing", "dubbing_languages", "storing_dubbed_artifacts", "finalizing_outputs"];
|
|
52
|
+
type DubbingRunCurrentStep = (typeof DUBBING_RUN_CURRENT_STEPS)[number];
|
|
53
|
+
declare const CLIP_ARTIFACT_STATUSES: readonly ["queued", "processing", "review_required", "ready", "failed", "cancelled"];
|
|
54
|
+
type ClipArtifactStatus = (typeof CLIP_ARTIFACT_STATUSES)[number];
|
|
55
|
+
declare const CLIP_ARTIFACT_CURRENT_STEPS: readonly ["queued_for_render", "extracting_media_window", "rendering_clip", "burning_subtitles", "rendering_variant", "generating_thumbnail", "awaiting_review", "publishing_clip"];
|
|
56
|
+
type ClipArtifactCurrentStep = (typeof CLIP_ARTIFACT_CURRENT_STEPS)[number];
|
|
57
|
+
declare const COMMENTARY_RUN_STATUSES: readonly ["queued", "processing", "review_required", "completed", "failed", "cancelled"];
|
|
58
|
+
type CommentaryRunStatus = (typeof COMMENTARY_RUN_STATUSES)[number];
|
|
59
|
+
declare const COMMENTARY_RUN_CURRENT_STEPS: readonly ["loading_context", "assembling_prompt", "generating_outputs", "normalizing_outputs", "awaiting_review", "publishing_outputs"];
|
|
60
|
+
type CommentaryRunCurrentStep = (typeof COMMENTARY_RUN_CURRENT_STEPS)[number];
|
|
61
|
+
declare const ARTIFACT_STATUSES: readonly ["unavailable", "queued", "processing", "partial", "review_required", "ready", "failed", "cancelled"];
|
|
62
|
+
type ArtifactStatus = (typeof ARTIFACT_STATUSES)[number];
|
|
63
|
+
declare const ARTIFACT_TYPES: readonly ["source_media", "extracted_audio", "transcript_json", "subtitle_json", "subtitle_srt", "subtitle_vtt", "subtitle_ttml", "subtitle_stl", "summary_text", "summary_json", "dubbed_audio", "highlight_clip", "highlight_clip_subtitled", "social_variant", "thumbnail_image", "commentary_text", "commentary_json", "export_bundle", "live_segment", "quality_report"];
|
|
64
|
+
type ArtifactType = (typeof ARTIFACT_TYPES)[number];
|
|
65
|
+
declare const ARTIFACT_FORMATS: readonly ["json", "txt", "md", "srt", "vtt", "ttml", "xml", "stl", "wav", "mp3", "mp4", "jpg", "png", "zip"];
|
|
66
|
+
type ArtifactFormat = (typeof ARTIFACT_FORMATS)[number];
|
|
67
|
+
declare const ARTIFACT_REVIEW_STATUSES: readonly ["not_required", "pending", "approved", "rejected"];
|
|
68
|
+
type ArtifactReviewStatus = (typeof ARTIFACT_REVIEW_STATUSES)[number];
|
|
69
|
+
declare const ARTIFACT_CURRENT_STEPS: readonly ["awaiting_source", "generating", "validating", "awaiting_review", "publishing", "indexed"];
|
|
70
|
+
type ArtifactCurrentStep = (typeof ARTIFACT_CURRENT_STEPS)[number];
|
|
71
|
+
declare const EXPORT_PACKAGE_STATUSES: readonly ["queued", "processing", "partial", "ready", "failed", "cancelled"];
|
|
72
|
+
type ExportPackageStatus = (typeof EXPORT_PACKAGE_STATUSES)[number];
|
|
73
|
+
declare const EXPORT_PACKAGE_FORMATS: readonly ["zip", "manifest", "deliverable_bundle"];
|
|
74
|
+
type ExportPackageFormat = (typeof EXPORT_PACKAGE_FORMATS)[number];
|
|
75
|
+
declare const EXPORT_PACKAGE_CURRENT_STEPS: readonly ["collecting_artifacts", "validating_contents", "packaging_bundle", "publishing_package", "indexed"];
|
|
76
|
+
type ExportPackageCurrentStep = (typeof EXPORT_PACKAGE_CURRENT_STEPS)[number];
|
|
77
|
+
interface EntityReference<TKind extends DomainEntityKind = DomainEntityKind> {
|
|
78
|
+
id: string;
|
|
79
|
+
kind: TKind;
|
|
80
|
+
}
|
|
81
|
+
type SourceEntityKind = 'job' | 'live_session';
|
|
82
|
+
type CommentarySourceKind = SourceEntityKind | 'highlight_run' | 'clip_artifact';
|
|
83
|
+
type ArtifactOwnerKind = CommentarySourceKind | 'commentary_run' | 'dubbing_run' | 'export_package';
|
|
84
|
+
type SourceEntityReference<TKind extends SourceEntityKind = SourceEntityKind> = EntityReference<TKind>;
|
|
85
|
+
type CommentarySourceReference<TKind extends CommentarySourceKind = CommentarySourceKind> = EntityReference<TKind>;
|
|
86
|
+
type ArtifactOwnerReference<TKind extends ArtifactOwnerKind = ArtifactOwnerKind> = EntityReference<TKind>;
|
|
87
|
+
interface BaseDomainEntity<TKind extends DomainEntityKind, TStatus extends string, TStep extends string> {
|
|
88
|
+
id: string;
|
|
89
|
+
kind: TKind;
|
|
90
|
+
status: TStatus;
|
|
91
|
+
currentStep: TStep | null;
|
|
92
|
+
progress: number | null;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
startedAt?: string | null;
|
|
96
|
+
completedAt?: string | null;
|
|
97
|
+
failedAt?: string | null;
|
|
98
|
+
cancelledAt?: string | null;
|
|
99
|
+
retryCount?: number;
|
|
100
|
+
errorCode?: string | null;
|
|
101
|
+
errorMessage?: string | null;
|
|
102
|
+
}
|
|
103
|
+
interface JobCapabilityReadiness {
|
|
104
|
+
subtitles: CapabilityReadinessState;
|
|
105
|
+
summary: CapabilityReadinessState;
|
|
106
|
+
dubbing: CapabilityReadinessState;
|
|
107
|
+
highlights: CapabilityReadinessState;
|
|
108
|
+
commentary: CapabilityReadinessState;
|
|
109
|
+
exports: CapabilityReadinessState;
|
|
110
|
+
}
|
|
111
|
+
interface CanonicalJob extends BaseDomainEntity<'job', CanonicalJobStatus, CanonicalJobCurrentStep> {
|
|
112
|
+
jobId: string;
|
|
113
|
+
fileName: string;
|
|
114
|
+
sourceLanguage: string | null;
|
|
115
|
+
targetLanguages: string[];
|
|
116
|
+
sourceMediaArtifactId?: string | null;
|
|
117
|
+
readiness: JobCapabilityReadiness;
|
|
118
|
+
highlightRunIds?: string[];
|
|
119
|
+
commentaryRunIds?: string[];
|
|
120
|
+
artifactIds?: string[];
|
|
121
|
+
exportPackageIds?: string[];
|
|
122
|
+
rerunOfJobId?: string | null;
|
|
123
|
+
}
|
|
124
|
+
interface LiveSession extends BaseDomainEntity<'live_session', LiveSessionStatus, LiveSessionCurrentStep> {
|
|
125
|
+
sessionId: string;
|
|
126
|
+
title: string;
|
|
127
|
+
sourceLanguage: string | null;
|
|
128
|
+
targetLanguages: string[];
|
|
129
|
+
derivedJobId?: string | null;
|
|
130
|
+
artifactIds?: string[];
|
|
131
|
+
readiness: CapabilityReadinessState;
|
|
132
|
+
}
|
|
133
|
+
interface HighlightRun extends BaseDomainEntity<'highlight_run', HighlightRunStatus, HighlightRunCurrentStep> {
|
|
134
|
+
runId: string;
|
|
135
|
+
source: SourceEntityReference;
|
|
136
|
+
clipArtifactIds: string[];
|
|
137
|
+
candidateCount?: number;
|
|
138
|
+
selectedCount?: number;
|
|
139
|
+
profile?: 'default' | 'sport' | 'interview' | 'documentary' | 'social' | null;
|
|
140
|
+
readiness: CapabilityReadinessState;
|
|
141
|
+
}
|
|
142
|
+
interface DubbingRun extends BaseDomainEntity<'dubbing_run', DubbingRunStatus, DubbingRunCurrentStep> {
|
|
143
|
+
runId: string;
|
|
144
|
+
source: SourceEntityReference<'job'>;
|
|
145
|
+
targetLanguages: string[];
|
|
146
|
+
completedLanguages?: string[];
|
|
147
|
+
failedLanguages?: string[];
|
|
148
|
+
artifactIds?: string[];
|
|
149
|
+
error?: string;
|
|
150
|
+
readiness: CapabilityReadinessState;
|
|
151
|
+
}
|
|
152
|
+
interface ClipArtifact extends BaseDomainEntity<'clip_artifact', ClipArtifactStatus, ClipArtifactCurrentStep> {
|
|
153
|
+
clipId: string;
|
|
154
|
+
highlightRunId: string;
|
|
155
|
+
source: SourceEntityReference;
|
|
156
|
+
startMs: number;
|
|
157
|
+
endMs: number;
|
|
158
|
+
artifactIds?: string[];
|
|
159
|
+
renderStatus?: 'completed' | 'failed' | 'processing' | null;
|
|
160
|
+
thumbnailPath?: string | null;
|
|
161
|
+
readiness: CapabilityReadinessState;
|
|
162
|
+
}
|
|
163
|
+
interface CommentaryRun extends BaseDomainEntity<'commentary_run', CommentaryRunStatus, CommentaryRunCurrentStep> {
|
|
164
|
+
runId: string;
|
|
165
|
+
source: CommentarySourceReference;
|
|
166
|
+
outputKinds: string[];
|
|
167
|
+
artifactIds?: string[];
|
|
168
|
+
readiness: CapabilityReadinessState;
|
|
169
|
+
}
|
|
170
|
+
interface Artifact extends BaseDomainEntity<'artifact', ArtifactStatus, ArtifactCurrentStep> {
|
|
171
|
+
artifactId: string;
|
|
172
|
+
owner: ArtifactOwnerReference;
|
|
173
|
+
artifactType: ArtifactType;
|
|
174
|
+
language?: string | null;
|
|
175
|
+
format?: ArtifactFormat | null;
|
|
176
|
+
storageKey?: string | null;
|
|
177
|
+
storagePath?: string | null;
|
|
178
|
+
bucketName?: string | null;
|
|
179
|
+
mimeType?: string | null;
|
|
180
|
+
sizeBytes?: number | null;
|
|
181
|
+
checksum?: string | null;
|
|
182
|
+
reviewStatus?: ArtifactReviewStatus | null;
|
|
183
|
+
variantLabel?: string | null;
|
|
184
|
+
readiness: CapabilityReadinessState;
|
|
185
|
+
}
|
|
186
|
+
interface ExportPackage extends BaseDomainEntity<'export_package', ExportPackageStatus, ExportPackageCurrentStep> {
|
|
187
|
+
exportPackageId: string;
|
|
188
|
+
owner: SourceEntityReference;
|
|
189
|
+
artifactIds: string[];
|
|
190
|
+
packageFormat: ExportPackageFormat;
|
|
191
|
+
readiness: CapabilityReadinessState;
|
|
192
|
+
}
|
|
193
|
+
declare const JOB_STATUS_TRANSITIONS: Record<CanonicalJobStatus, readonly CanonicalJobStatus[]>;
|
|
194
|
+
declare const LIVE_SESSION_STATUS_TRANSITIONS: Record<LiveSessionStatus, readonly LiveSessionStatus[]>;
|
|
195
|
+
declare const HIGHLIGHT_RUN_STATUS_TRANSITIONS: Record<HighlightRunStatus, readonly HighlightRunStatus[]>;
|
|
196
|
+
declare const DUBBING_RUN_STATUS_TRANSITIONS: Record<DubbingRunStatus, readonly DubbingRunStatus[]>;
|
|
197
|
+
declare const CLIP_ARTIFACT_STATUS_TRANSITIONS: Record<ClipArtifactStatus, readonly ClipArtifactStatus[]>;
|
|
198
|
+
declare const COMMENTARY_RUN_STATUS_TRANSITIONS: Record<CommentaryRunStatus, readonly CommentaryRunStatus[]>;
|
|
199
|
+
declare const ARTIFACT_STATUS_TRANSITIONS: Record<ArtifactStatus, readonly ArtifactStatus[]>;
|
|
200
|
+
declare const EXPORT_PACKAGE_STATUS_TRANSITIONS: Record<ExportPackageStatus, readonly ExportPackageStatus[]>;
|
|
201
|
+
declare function normalizeJobStatus(status: CompatibleJobStatus): CanonicalJobStatus;
|
|
202
|
+
declare function normalizeJobCurrentStep(step: CompatibleJobCurrentStep): CanonicalJobCurrentStep;
|
|
203
|
+
declare function isValidTransition<TStatus extends string>(transitionMap: Record<TStatus, readonly TStatus[]>, from: TStatus, to: TStatus): boolean;
|
|
204
|
+
|
|
205
|
+
type JobStatus = CompatibleJobStatus;
|
|
206
|
+
type JobStep = CompatibleJobCurrentStep;
|
|
23
207
|
interface Job {
|
|
24
208
|
jobId: string;
|
|
25
209
|
fileName: string;
|
|
@@ -31,6 +215,44 @@ interface Job {
|
|
|
31
215
|
updatedAt: string;
|
|
32
216
|
error?: string;
|
|
33
217
|
}
|
|
218
|
+
interface CreateJobOptions {
|
|
219
|
+
fileName: string;
|
|
220
|
+
languages: string[];
|
|
221
|
+
sourceLanguage?: string;
|
|
222
|
+
}
|
|
223
|
+
interface CreateJobResponse {
|
|
224
|
+
jobId: string;
|
|
225
|
+
success?: boolean;
|
|
226
|
+
message?: string;
|
|
227
|
+
}
|
|
228
|
+
interface DeleteJobResponse {
|
|
229
|
+
success?: boolean;
|
|
230
|
+
message?: string;
|
|
231
|
+
[key: string]: unknown;
|
|
232
|
+
}
|
|
233
|
+
type JobControlAction = 'pause' | 'resume' | 'stop' | 'restart';
|
|
234
|
+
interface PauseResumeJobRequest {
|
|
235
|
+
action: JobControlAction;
|
|
236
|
+
}
|
|
237
|
+
interface SubmitJobFeedbackRequest {
|
|
238
|
+
language: string;
|
|
239
|
+
segmentIndex: number;
|
|
240
|
+
rating: number;
|
|
241
|
+
reason?: string;
|
|
242
|
+
}
|
|
243
|
+
interface GenerateJobQualityInsightsRequest {
|
|
244
|
+
language?: string;
|
|
245
|
+
metrics: Record<string, unknown>;
|
|
246
|
+
}
|
|
247
|
+
interface JobOperationResponse {
|
|
248
|
+
[key: string]: unknown;
|
|
249
|
+
}
|
|
250
|
+
interface StartJobRequest {
|
|
251
|
+
[key: string]: unknown;
|
|
252
|
+
}
|
|
253
|
+
interface StartJobResponse {
|
|
254
|
+
[key: string]: unknown;
|
|
255
|
+
}
|
|
34
256
|
|
|
35
257
|
interface ListOptions {
|
|
36
258
|
limit?: number;
|
|
@@ -41,6 +263,180 @@ interface PagedResponse<T> {
|
|
|
41
263
|
nextPageToken?: string;
|
|
42
264
|
}
|
|
43
265
|
|
|
266
|
+
type ReleaseStage = 'ga' | 'beta' | 'internal';
|
|
267
|
+
type CapabilityKey = 'highlights' | 'commentary' | 'exports' | 'dubbing';
|
|
268
|
+
interface CapabilityReadinessEntry {
|
|
269
|
+
capability: CapabilityKey;
|
|
270
|
+
readiness: CapabilityReadinessState;
|
|
271
|
+
releaseStage: ReleaseStage;
|
|
272
|
+
latestRunId?: string;
|
|
273
|
+
latestUpdatedAt?: string;
|
|
274
|
+
}
|
|
275
|
+
interface JobCapabilityReadinessResponse {
|
|
276
|
+
jobId: string;
|
|
277
|
+
capabilities: CapabilityReadinessEntry[];
|
|
278
|
+
}
|
|
279
|
+
interface StartJobCapabilityRunRequest {
|
|
280
|
+
config?: Record<string, unknown>;
|
|
281
|
+
}
|
|
282
|
+
interface StartJobCapabilityRunResponse {
|
|
283
|
+
jobId: string;
|
|
284
|
+
capability: CapabilityKey;
|
|
285
|
+
runId: string;
|
|
286
|
+
releaseStage: ReleaseStage;
|
|
287
|
+
}
|
|
288
|
+
interface ListJobArtifactsOptions {
|
|
289
|
+
type?: string;
|
|
290
|
+
language?: string;
|
|
291
|
+
status?: string;
|
|
292
|
+
}
|
|
293
|
+
interface ListJobExportPackagesOptions {
|
|
294
|
+
status?: ExportPackage['status'];
|
|
295
|
+
packageFormat?: ExportPackageFormat;
|
|
296
|
+
}
|
|
297
|
+
interface ListArtifactsOptions {
|
|
298
|
+
limit?: number;
|
|
299
|
+
pageToken?: string;
|
|
300
|
+
ownerKind?: ArtifactOwnerKind;
|
|
301
|
+
ownerId?: string;
|
|
302
|
+
type?: string;
|
|
303
|
+
language?: string;
|
|
304
|
+
status?: string;
|
|
305
|
+
releaseStage?: ReleaseStage;
|
|
306
|
+
}
|
|
307
|
+
interface ListCommentaryRunsOptions extends ListOptions {
|
|
308
|
+
sourceKind?: CommentarySourceKind;
|
|
309
|
+
sourceId?: string;
|
|
310
|
+
status?: CommentaryRun['status'];
|
|
311
|
+
}
|
|
312
|
+
interface ListLiveSessionsOptions extends ListOptions {
|
|
313
|
+
status?: LiveSession['status'];
|
|
314
|
+
}
|
|
315
|
+
interface ListExportPackagesOptions extends ListOptions {
|
|
316
|
+
ownerKind?: 'job' | 'live_session';
|
|
317
|
+
ownerId?: string;
|
|
318
|
+
status?: ExportPackage['status'];
|
|
319
|
+
packageFormat?: ExportPackageFormat;
|
|
320
|
+
}
|
|
321
|
+
type ArtifactListResponse = PagedResponse<Artifact>;
|
|
322
|
+
interface CreateHighlightRunRequest {
|
|
323
|
+
source: {
|
|
324
|
+
kind: 'job' | 'live_session';
|
|
325
|
+
id: string;
|
|
326
|
+
};
|
|
327
|
+
profile?: string;
|
|
328
|
+
requestedClipCount?: number;
|
|
329
|
+
}
|
|
330
|
+
interface ListHighlightRunsOptions {
|
|
331
|
+
sourceKind?: 'job' | 'live_session';
|
|
332
|
+
sourceId?: string;
|
|
333
|
+
status?: string;
|
|
334
|
+
}
|
|
335
|
+
type HighlightRunListResponse = PagedResponse<HighlightRun>;
|
|
336
|
+
type ClipArtifactListResponse = PagedResponse<ClipArtifact>;
|
|
337
|
+
interface CreateClipVariantRequest {
|
|
338
|
+
variantId: string;
|
|
339
|
+
profile?: string;
|
|
340
|
+
}
|
|
341
|
+
interface ClipApprovalRequest {
|
|
342
|
+
decision: 'approve' | 'reject';
|
|
343
|
+
note?: string;
|
|
344
|
+
}
|
|
345
|
+
interface ClipApprovalResponse {
|
|
346
|
+
clipId: string;
|
|
347
|
+
status: ClipArtifact['status'];
|
|
348
|
+
}
|
|
349
|
+
interface ClipSocialExportResponse {
|
|
350
|
+
clipId: string;
|
|
351
|
+
triggered: number;
|
|
352
|
+
languages: string[];
|
|
353
|
+
}
|
|
354
|
+
interface CreateLiveSessionRequest {
|
|
355
|
+
title: string;
|
|
356
|
+
sourceLanguage?: string;
|
|
357
|
+
targetLanguages: string[];
|
|
358
|
+
sourceUrl?: string;
|
|
359
|
+
}
|
|
360
|
+
type LiveSessionListResponse = PagedResponse<LiveSession>;
|
|
361
|
+
interface RollingSubtitleSegment {
|
|
362
|
+
segmentId: string;
|
|
363
|
+
language: string;
|
|
364
|
+
startMs: number;
|
|
365
|
+
endMs: number;
|
|
366
|
+
text: string;
|
|
367
|
+
publishedAt: string;
|
|
368
|
+
artifactId?: string;
|
|
369
|
+
storagePath?: string;
|
|
370
|
+
}
|
|
371
|
+
type RollingSubtitleSegmentListResponse = PagedResponse<RollingSubtitleSegment>;
|
|
372
|
+
interface PublishRollingSubtitleSegmentInput {
|
|
373
|
+
language?: string;
|
|
374
|
+
startMs: number;
|
|
375
|
+
endMs: number;
|
|
376
|
+
text: string;
|
|
377
|
+
}
|
|
378
|
+
interface PublishRollingSubtitlesRequest {
|
|
379
|
+
segments: PublishRollingSubtitleSegmentInput[];
|
|
380
|
+
}
|
|
381
|
+
interface PublishRollingSubtitlesResponse {
|
|
382
|
+
session: LiveSession;
|
|
383
|
+
items: RollingSubtitleSegment[];
|
|
384
|
+
}
|
|
385
|
+
interface StopLiveSessionRequest {
|
|
386
|
+
finalize?: boolean;
|
|
387
|
+
}
|
|
388
|
+
interface CreateCommentaryRunRequest {
|
|
389
|
+
source: {
|
|
390
|
+
kind: CommentarySourceKind;
|
|
391
|
+
id: string;
|
|
392
|
+
};
|
|
393
|
+
outputKinds: string[];
|
|
394
|
+
templateId?: string;
|
|
395
|
+
}
|
|
396
|
+
type CommentaryRunListResponse = PagedResponse<CommentaryRun>;
|
|
397
|
+
interface CommentaryOutputItem {
|
|
398
|
+
outputId: string;
|
|
399
|
+
kind: string;
|
|
400
|
+
title?: string;
|
|
401
|
+
artifactId?: string;
|
|
402
|
+
textPreview?: string;
|
|
403
|
+
createdAt: string;
|
|
404
|
+
}
|
|
405
|
+
type CommentaryOutputListResponse = PagedResponse<CommentaryOutputItem>;
|
|
406
|
+
interface SignedArtifactUrlResponse {
|
|
407
|
+
artifactId: string;
|
|
408
|
+
url: string;
|
|
409
|
+
expiresAt: string;
|
|
410
|
+
}
|
|
411
|
+
interface SignedExportPackageUrlResponse {
|
|
412
|
+
exportPackageId: string;
|
|
413
|
+
url: string;
|
|
414
|
+
expiresAt: string;
|
|
415
|
+
}
|
|
416
|
+
interface CreateJobWithCapabilitiesRequest {
|
|
417
|
+
job: {
|
|
418
|
+
fileName: string;
|
|
419
|
+
languages: string[];
|
|
420
|
+
sourceLanguage?: string;
|
|
421
|
+
};
|
|
422
|
+
requestedCapabilities?: CapabilityKey[];
|
|
423
|
+
}
|
|
424
|
+
interface CreateJobWithCapabilitiesResponse {
|
|
425
|
+
job: Job;
|
|
426
|
+
capabilities: CapabilityReadinessEntry[];
|
|
427
|
+
releaseStage: ReleaseStage;
|
|
428
|
+
}
|
|
429
|
+
type ListJobArtifactsResponse = PagedResponse<Artifact>;
|
|
430
|
+
type ListJobHighlightRunsResponse = PagedResponse<HighlightRun>;
|
|
431
|
+
type ListJobCommentaryRunsResponse = PagedResponse<CommentaryRun>;
|
|
432
|
+
type ListJobExportPackagesResponse = PagedResponse<ExportPackage>;
|
|
433
|
+
type ExportPackageListResponse = PagedResponse<ExportPackage>;
|
|
434
|
+
interface ListDubbingRunsOptions extends ListOptions {
|
|
435
|
+
sourceId?: string;
|
|
436
|
+
status?: DubbingRun['status'];
|
|
437
|
+
}
|
|
438
|
+
type DubbingRunListResponse = PagedResponse<DubbingRun>;
|
|
439
|
+
|
|
44
440
|
interface PollOptions {
|
|
45
441
|
interval?: number;
|
|
46
442
|
maxInterval?: number;
|
|
@@ -77,7 +473,33 @@ interface WaitForCompletionOptions extends PollOptions {
|
|
|
77
473
|
declare class JobsResource {
|
|
78
474
|
private readonly client;
|
|
79
475
|
constructor(client: HttpClient);
|
|
476
|
+
start(request: StartJobRequest): Promise<StartJobResponse>;
|
|
477
|
+
create(options: CreateJobOptions): Promise<CreateJobResponse>;
|
|
478
|
+
updateSubtitles(jobId: string, payload: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
479
|
+
updateSubtitlesForLanguage(jobId: string, language: string, body: string, contentType: string): Promise<{
|
|
480
|
+
body: string;
|
|
481
|
+
contentType: string;
|
|
482
|
+
statusCode: number;
|
|
483
|
+
}>;
|
|
484
|
+
getSubtitles(jobId: string, language: string): Promise<Record<string, unknown>>;
|
|
485
|
+
getSummary(jobId: string, language?: string): Promise<Record<string, unknown>>;
|
|
486
|
+
generateSummary(jobId: string, payload: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
487
|
+
cleanSubtitles(jobId: string, payload: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
488
|
+
getThumbnail(jobId: string): Promise<Record<string, unknown>>;
|
|
489
|
+
getVideo(jobId: string): Promise<Record<string, unknown>>;
|
|
490
|
+
getAudio(jobId: string, language: string): Promise<Response>;
|
|
491
|
+
updateSpeakerNames(payload: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
492
|
+
pauseResume(jobId: string, payload: PauseResumeJobRequest): Promise<JobOperationResponse>;
|
|
493
|
+
submitFeedback(jobId: string, payload: SubmitJobFeedbackRequest): Promise<JobOperationResponse>;
|
|
494
|
+
generateQualityAiInsights(jobId: string, payload: GenerateJobQualityInsightsRequest): Promise<JobOperationResponse>;
|
|
80
495
|
get(jobId: string): Promise<Job>;
|
|
496
|
+
delete(jobId: string): Promise<DeleteJobResponse>;
|
|
497
|
+
getCapabilityReadiness(jobId: string): Promise<JobCapabilityReadinessResponse>;
|
|
498
|
+
listArtifacts(jobId: string, options?: ListJobArtifactsOptions): Promise<ListJobArtifactsResponse>;
|
|
499
|
+
startCapabilityRun(jobId: string, capability: CapabilityKey, request?: StartJobCapabilityRunRequest): Promise<StartJobCapabilityRunResponse>;
|
|
500
|
+
listHighlights(jobId: string): Promise<ListJobHighlightRunsResponse>;
|
|
501
|
+
listCommentary(jobId: string): Promise<ListJobCommentaryRunsResponse>;
|
|
502
|
+
listExports(jobId: string, options?: ListJobExportPackagesOptions): Promise<ListJobExportPackagesResponse>;
|
|
81
503
|
list(options?: ListOptions): Promise<PagedResponse<Job>>;
|
|
82
504
|
/**
|
|
83
505
|
* Polls until the job reaches `completed` or `failed`, then returns the final job.
|
|
@@ -91,6 +513,63 @@ declare class JobsResource {
|
|
|
91
513
|
poll(jobId: string, options?: PollOptions): JobPoller;
|
|
92
514
|
}
|
|
93
515
|
|
|
516
|
+
declare class HighlightsResource {
|
|
517
|
+
private readonly client;
|
|
518
|
+
constructor(client: HttpClient);
|
|
519
|
+
create(request: CreateHighlightRunRequest): Promise<HighlightRun>;
|
|
520
|
+
list(options?: ListHighlightRunsOptions): Promise<HighlightRunListResponse>;
|
|
521
|
+
get(runId: string): Promise<HighlightRun>;
|
|
522
|
+
listClips(runId: string): Promise<ClipArtifactListResponse>;
|
|
523
|
+
getClip(clipId: string): Promise<ClipArtifact>;
|
|
524
|
+
createVariant(clipId: string, request: CreateClipVariantRequest): Promise<ClipArtifact>;
|
|
525
|
+
approve(clipId: string, request: ClipApprovalRequest): Promise<ClipApprovalResponse>;
|
|
526
|
+
socialExport(clipId: string): Promise<ClipSocialExportResponse>;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
declare class LiveSessionsResource {
|
|
530
|
+
private readonly client;
|
|
531
|
+
constructor(client: HttpClient);
|
|
532
|
+
create(request: CreateLiveSessionRequest): Promise<LiveSession>;
|
|
533
|
+
list(options?: ListLiveSessionsOptions): Promise<LiveSessionListResponse>;
|
|
534
|
+
get(sessionId: string): Promise<LiveSession>;
|
|
535
|
+
getRollingSubtitles(sessionId: string): Promise<RollingSubtitleSegmentListResponse>;
|
|
536
|
+
publishRollingSubtitles(sessionId: string, request: PublishRollingSubtitlesRequest): Promise<PublishRollingSubtitlesResponse>;
|
|
537
|
+
stop(sessionId: string, request?: StopLiveSessionRequest): Promise<LiveSession>;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
declare class CommentaryResource {
|
|
541
|
+
private readonly client;
|
|
542
|
+
constructor(client: HttpClient);
|
|
543
|
+
create(request: CreateCommentaryRunRequest): Promise<CommentaryRun>;
|
|
544
|
+
list(options?: ListCommentaryRunsOptions): Promise<CommentaryRunListResponse>;
|
|
545
|
+
get(runId: string): Promise<CommentaryRun>;
|
|
546
|
+
listOutputs(runId: string): Promise<CommentaryOutputListResponse>;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
declare class DubbingResource {
|
|
550
|
+
private readonly client;
|
|
551
|
+
constructor(client: HttpClient);
|
|
552
|
+
list(options?: ListDubbingRunsOptions): Promise<DubbingRunListResponse>;
|
|
553
|
+
get(runId: string): Promise<DubbingRun>;
|
|
554
|
+
getForJob(jobId: string): Promise<DubbingRun>;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
declare class ArtifactsResource {
|
|
558
|
+
private readonly client;
|
|
559
|
+
constructor(client: HttpClient);
|
|
560
|
+
list(options?: ListArtifactsOptions): Promise<ArtifactListResponse>;
|
|
561
|
+
get(artifactId: string): Promise<Artifact>;
|
|
562
|
+
createSignedUrl(artifactId: string): Promise<SignedArtifactUrlResponse>;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
declare class ExportPackagesResource {
|
|
566
|
+
private readonly client;
|
|
567
|
+
constructor(client: HttpClient);
|
|
568
|
+
list(options?: ListExportPackagesOptions): Promise<ExportPackageListResponse>;
|
|
569
|
+
get(exportPackageId: string): Promise<ExportPackage>;
|
|
570
|
+
createSignedUrl(exportPackageId: string): Promise<SignedExportPackageUrlResponse>;
|
|
571
|
+
}
|
|
572
|
+
|
|
94
573
|
interface Language {
|
|
95
574
|
code: string;
|
|
96
575
|
name: string;
|
|
@@ -163,6 +642,22 @@ interface CompleteMultipartUploadResponse {
|
|
|
163
642
|
success: boolean;
|
|
164
643
|
jobId: string;
|
|
165
644
|
}
|
|
645
|
+
type PresignedUrlRequestType = 'upload' | 'download' | 'thumbnail' | 'complete-multipart';
|
|
646
|
+
interface PresignedUrlRequest {
|
|
647
|
+
type: PresignedUrlRequestType;
|
|
648
|
+
[key: string]: unknown;
|
|
649
|
+
}
|
|
650
|
+
interface PresignedUrlResponse {
|
|
651
|
+
url?: string;
|
|
652
|
+
uploadUrl?: string;
|
|
653
|
+
presignedUrl?: string;
|
|
654
|
+
downloadUrl?: string;
|
|
655
|
+
key?: string;
|
|
656
|
+
filename?: string;
|
|
657
|
+
jobId?: string;
|
|
658
|
+
success?: boolean;
|
|
659
|
+
[key: string]: unknown;
|
|
660
|
+
}
|
|
166
661
|
|
|
167
662
|
type FileInput = string | Buffer | Blob | File | ReadableStream;
|
|
168
663
|
/** Default file size above which multipart upload is used (100 MB). */
|
|
@@ -178,6 +673,7 @@ interface MultipartUploadOptions extends UploadOptions {
|
|
|
178
673
|
declare class FilesResource {
|
|
179
674
|
private readonly client;
|
|
180
675
|
constructor(client: HttpClient);
|
|
676
|
+
createPresignedUrl(request: PresignedUrlRequest): Promise<PresignedUrlResponse>;
|
|
181
677
|
upload(file: FileInput, options: SingleUploadOptions): Promise<{
|
|
182
678
|
jobId: string;
|
|
183
679
|
}>;
|
|
@@ -205,10 +701,17 @@ interface AudiolizeClientOptions {
|
|
|
205
701
|
baseUrl?: string;
|
|
206
702
|
timeout?: number;
|
|
207
703
|
maxRetries?: number;
|
|
704
|
+
defaultHeaders?: Record<string, string>;
|
|
208
705
|
}
|
|
209
706
|
declare class AudiolizeClient {
|
|
210
707
|
private readonly http;
|
|
211
708
|
readonly jobs: JobsResource;
|
|
709
|
+
readonly highlights: HighlightsResource;
|
|
710
|
+
readonly liveSessions: LiveSessionsResource;
|
|
711
|
+
readonly commentary: CommentaryResource;
|
|
712
|
+
readonly dubbing: DubbingResource;
|
|
713
|
+
readonly artifacts: ArtifactsResource;
|
|
714
|
+
readonly exportPackages: ExportPackagesResource;
|
|
212
715
|
readonly languages: LanguagesResource;
|
|
213
716
|
readonly subtitles: SubtitlesResource;
|
|
214
717
|
readonly files: FilesResource;
|
|
@@ -275,4 +778,4 @@ interface RetryOptions {
|
|
|
275
778
|
*/
|
|
276
779
|
declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
277
780
|
|
|
278
|
-
export { AudiolizeApiError, AudiolizeClient, type AudiolizeClientOptions, AudiolizeError, AudiolizeTimeoutError, AudiolizeUploadError, AudiolizeValidationError, AuthenticationError, AuthorizationError, type CompleteMultipartUploadResponse, DEFAULT_MULTIPART_THRESHOLD, type FileInput, FilesResource, type Job, type JobContext, JobPoller, type JobStatus, type JobStep, JobsResource, type Language, LanguagesResource, type ListOptions, type LocalizeOptions, type LocalizeResult, type MultipartUploadOptions, NotFoundError, type PagedResponse, PaywallError, type PollOptions, type PresignedMultipartUploadResponse, type PresignedUploadResponse, RateLimitError, type RetryOptions, ServerError, type SingleUploadOptions, type SubtitleCue, type SubtitleFormat, type SubtitleResult, SubtitlesResource, type TranscriptionOptions, type UploadOptions, type WaitForCompletionOptions, getBackoffDelay, localize, withRetry };
|
|
781
|
+
export { ARTIFACT_CURRENT_STEPS, ARTIFACT_FORMATS, ARTIFACT_REVIEW_STATUSES, ARTIFACT_STATUSES, ARTIFACT_STATUS_TRANSITIONS, ARTIFACT_TYPES, type Artifact, type ArtifactCurrentStep, type ArtifactFormat, type ArtifactListResponse, type ArtifactOwnerKind, type ArtifactOwnerReference, type ArtifactReviewStatus, type ArtifactStatus, type ArtifactType, ArtifactsResource, AudiolizeApiError, AudiolizeClient, type AudiolizeClientOptions, AudiolizeError, AudiolizeTimeoutError, AudiolizeUploadError, AudiolizeValidationError, AuthenticationError, AuthorizationError, type BaseDomainEntity, CANONICAL_JOB_CURRENT_STEPS, CANONICAL_JOB_STATUSES, CAPABILITY_READINESS_STATES, CLIP_ARTIFACT_CURRENT_STEPS, CLIP_ARTIFACT_STATUSES, CLIP_ARTIFACT_STATUS_TRANSITIONS, COMMENTARY_RUN_CURRENT_STEPS, COMMENTARY_RUN_STATUSES, COMMENTARY_RUN_STATUS_TRANSITIONS, type CanonicalJob, type CanonicalJobCurrentStep, type CanonicalJobStatus, type CapabilityKey, type CapabilityReadinessEntry, type CapabilityReadinessState, type ClipApprovalRequest, type ClipApprovalResponse, type ClipArtifact, type ClipArtifactCurrentStep, type ClipArtifactListResponse, type ClipArtifactStatus, type ClipSocialExportResponse, type CommentaryOutputItem, type CommentaryOutputListResponse, CommentaryResource, type CommentaryRun, type CommentaryRunCurrentStep, type CommentaryRunListResponse, type CommentaryRunStatus, type CommentarySourceKind, type CommentarySourceReference, type CompatibleJobCurrentStep, type CompatibleJobStatus, type CompleteMultipartUploadResponse, type CreateClipVariantRequest, type CreateCommentaryRunRequest, type CreateHighlightRunRequest, type CreateJobOptions, type CreateJobResponse, type CreateJobWithCapabilitiesRequest, type CreateJobWithCapabilitiesResponse, type CreateLiveSessionRequest, DEFAULT_MULTIPART_THRESHOLD, DOMAIN_ENTITY_KINDS, DUBBING_RUN_CURRENT_STEPS, DUBBING_RUN_STATUSES, DUBBING_RUN_STATUS_TRANSITIONS, type DeleteJobResponse, type DomainEntityKind, DubbingResource, type DubbingRun, type DubbingRunCurrentStep, type DubbingRunListResponse, type DubbingRunStatus, EXPORT_PACKAGE_CURRENT_STEPS, EXPORT_PACKAGE_FORMATS, EXPORT_PACKAGE_STATUSES, EXPORT_PACKAGE_STATUS_TRANSITIONS, type EntityReference, type ExportPackage, type ExportPackageCurrentStep, type ExportPackageFormat, type ExportPackageListResponse, type ExportPackageStatus, ExportPackagesResource, type FileInput, FilesResource, type GenerateJobQualityInsightsRequest, HIGHLIGHT_RUN_CURRENT_STEPS, HIGHLIGHT_RUN_STATUSES, HIGHLIGHT_RUN_STATUS_TRANSITIONS, type HighlightRun, type HighlightRunCurrentStep, type HighlightRunListResponse, type HighlightRunStatus, HighlightsResource, JOB_STATUS_TRANSITIONS, type Job, type JobCapabilityReadiness, type JobCapabilityReadinessResponse, type JobContext, type JobControlAction, type JobOperationResponse, JobPoller, type JobStatus, type JobStep, JobsResource, LEGACY_JOB_CURRENT_STEPS, LEGACY_JOB_STATUSES, LEGACY_TO_CANONICAL_JOB_CURRENT_STEP, LEGACY_TO_CANONICAL_JOB_STATUS, LIVE_SESSION_CURRENT_STEPS, LIVE_SESSION_STATUSES, LIVE_SESSION_STATUS_TRANSITIONS, type Language, LanguagesResource, type LegacyJobCurrentStep, type LegacyJobStatus, type ListArtifactsOptions, type ListCommentaryRunsOptions, type ListDubbingRunsOptions, type ListExportPackagesOptions, type ListHighlightRunsOptions, type ListJobArtifactsOptions, type ListJobArtifactsResponse, type ListJobCommentaryRunsResponse, type ListJobExportPackagesOptions, type ListJobExportPackagesResponse, type ListJobHighlightRunsResponse, type ListLiveSessionsOptions, type ListOptions, type LiveSession, type LiveSessionCurrentStep, type LiveSessionListResponse, type LiveSessionStatus, LiveSessionsResource, type LocalizeOptions, type LocalizeResult, type MultipartUploadOptions, NotFoundError, type PagedResponse, type PauseResumeJobRequest, PaywallError, type PollOptions, type PresignedMultipartUploadResponse, type PresignedUploadResponse, type PresignedUrlRequest, type PresignedUrlRequestType, type PresignedUrlResponse, type PublishRollingSubtitleSegmentInput, type PublishRollingSubtitlesRequest, type PublishRollingSubtitlesResponse, RateLimitError, type ReleaseStage, type RetryOptions, type RollingSubtitleSegment, type RollingSubtitleSegmentListResponse, ServerError, type SignedArtifactUrlResponse, type SignedExportPackageUrlResponse, type SingleUploadOptions, type SourceEntityKind, type SourceEntityReference, type StartJobCapabilityRunRequest, type StartJobCapabilityRunResponse, type StartJobRequest, type StartJobResponse, type StopLiveSessionRequest, type SubmitJobFeedbackRequest, type SubtitleCue, type SubtitleFormat, type SubtitleResult, SubtitlesResource, type TranscriptionOptions, type UploadOptions, type WaitForCompletionOptions, getBackoffDelay, isValidTransition, localize, normalizeJobCurrentStep, normalizeJobStatus, withRetry };
|