@editframe/api 0.12.0-beta.2 → 0.12.0-beta.20
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/dist/ProgressIterator.d.ts +1 -1
- package/dist/ProgressIterator.js +14 -2
- package/dist/StreamEventSource.d.ts +2 -3
- package/dist/StreamEventSource.js +0 -2
- package/dist/client.d.ts +1 -1
- package/dist/index.d.ts +13 -10
- package/dist/index.js +5 -3
- package/dist/node.d.ts +6 -0
- package/dist/node.js +92 -0
- package/dist/resources/caption-file.d.ts +32 -4
- package/dist/resources/caption-file.js +9 -0
- package/dist/resources/image-file.d.ts +35 -11
- package/dist/resources/image-file.js +22 -4
- package/dist/resources/isobmff-file.d.ts +37 -4
- package/dist/resources/isobmff-file.js +20 -0
- package/dist/resources/isobmff-track.d.ts +277 -13
- package/dist/resources/isobmff-track.js +20 -18
- package/dist/resources/process-isobmff.d.ts +2 -2
- package/dist/resources/renders.d.ts +9 -8
- package/dist/resources/transcriptions.d.ts +4 -3
- package/dist/resources/unprocessed-file.d.ts +9 -8
- package/dist/resources/unprocessed-file.js +8 -8
- package/dist/resources/url-token.d.ts +1 -1
- package/dist/uploadChunks.d.ts +4 -1
- package/dist/utils/assertTypesMatch.d.ts +3 -0
- package/dist/utils/createReadableStreamFromReadable.d.ts +4 -0
- package/dist/utils/createReadableStreamFromReadable.js +82 -0
- package/docs/packages/api/docs/.nojekyll +1 -0
- package/docs/packages/api/docs/assets/highlight.css +71 -0
- package/docs/packages/api/docs/assets/icons.js +18 -0
- package/docs/packages/api/docs/assets/icons.svg +1 -0
- package/docs/packages/api/docs/assets/main.js +60 -0
- package/docs/packages/api/docs/assets/navigation.js +1 -0
- package/docs/packages/api/docs/assets/search.js +1 -0
- package/docs/packages/api/docs/assets/style.css +1493 -0
- package/docs/packages/api/docs/classes/Client.html +4 -0
- package/docs/packages/api/docs/functions/createCaptionFile.html +8 -0
- package/docs/packages/api/docs/functions/createISOBMFFFile.html +1 -0
- package/docs/packages/api/docs/functions/createISOBMFFTrack.html +1 -0
- package/docs/packages/api/docs/functions/createImageFile.html +1 -0
- package/docs/packages/api/docs/functions/createRender.html +1 -0
- package/docs/packages/api/docs/functions/createTranscription.html +1 -0
- package/docs/packages/api/docs/functions/createURLToken.html +1 -0
- package/docs/packages/api/docs/functions/createUnprocessedFile.html +1 -0
- package/docs/packages/api/docs/functions/getISOBMFFFileTranscription.html +1 -0
- package/docs/packages/api/docs/functions/getIsobmffProcessInfo.html +1 -0
- package/docs/packages/api/docs/functions/getIsobmffProcessProgress.html +1 -0
- package/docs/packages/api/docs/functions/getTranscriptionInfo.html +1 -0
- package/docs/packages/api/docs/functions/getTranscriptionProgress.html +1 -0
- package/docs/packages/api/docs/functions/lookupCaptionFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupISOBMFFFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupImageFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupRenderByMd5.html +1 -0
- package/docs/packages/api/docs/functions/lookupUnprocessedFileByMd5.html +1 -0
- package/docs/packages/api/docs/functions/processIsobmffFile.html +1 -0
- package/docs/packages/api/docs/functions/transcribeISOBMFFFile.html +1 -0
- package/docs/packages/api/docs/functions/uploadCaptionFile.html +1 -0
- package/docs/packages/api/docs/functions/uploadFragmentIndex.html +1 -0
- package/docs/packages/api/docs/functions/uploadISOBMFFTrack.html +1 -0
- package/docs/packages/api/docs/functions/uploadImageFile.html +1 -0
- package/docs/packages/api/docs/functions/uploadRender.html +1 -0
- package/docs/packages/api/docs/functions/uploadUnprocessedReadableStream.html +1 -0
- package/docs/packages/api/docs/index.html +39 -0
- package/docs/packages/api/docs/interfaces/CreateCaptionFileResult.html +4 -0
- package/docs/packages/api/docs/interfaces/CreateISOBMFFFileResult.html +5 -0
- package/docs/packages/api/docs/interfaces/CreateISOBMFFTrackResult.html +6 -0
- package/docs/packages/api/docs/interfaces/CreateImageFileResult.html +5 -0
- package/docs/packages/api/docs/interfaces/CreateRenderResult.html +4 -0
- package/docs/packages/api/docs/interfaces/CreateTranscriptionResult.html +3 -0
- package/docs/packages/api/docs/interfaces/CreateUnprocessedFileResult.html +6 -0
- package/docs/packages/api/docs/interfaces/GetISOBMFFFileTranscriptionResult.html +4 -0
- package/docs/packages/api/docs/interfaces/IsobmffProcessInfoResult.html +7 -0
- package/docs/packages/api/docs/interfaces/LookupCaptionFileByMd5Result.html +4 -0
- package/docs/packages/api/docs/interfaces/LookupISOBMFFFileByMd5Result.html +5 -0
- package/docs/packages/api/docs/interfaces/LookupImageFileByMd5Result.html +5 -0
- package/docs/packages/api/docs/interfaces/LookupRenderByMd5Result.html +4 -0
- package/docs/packages/api/docs/interfaces/LookupUnprocessedFileByMd5Result.html +6 -0
- package/docs/packages/api/docs/interfaces/ProcessIsobmffFileResult.html +2 -0
- package/docs/packages/api/docs/interfaces/TranscribeISOBMFFFileResult.html +4 -0
- package/docs/packages/api/docs/interfaces/TranscriptionInfoResult.html +3 -0
- package/docs/packages/api/docs/interfaces/URLTokenResult.html +2 -0
- package/docs/packages/api/docs/modules.html +54 -0
- package/docs/packages/api/docs/variables/CreateCaptionFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateISOBMFFFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateISOBMFFTrackPayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateImageFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateRenderPayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateTranscriptionPayload.html +1 -0
- package/docs/packages/api/docs/variables/CreateUnprocessedFilePayload.html +1 -0
- package/docs/packages/api/docs/variables/TranscribeISOBMFFFilePayload.html +1 -0
- package/package.json +12 -4
- package/src/resources/caption-file.test.ts +3 -3
- package/src/resources/caption-file.ts +31 -2
- package/src/resources/image-file.test.ts +6 -9
- package/src/resources/image-file.ts +32 -8
- package/src/resources/isobmff-file.test.ts +3 -3
- package/src/resources/isobmff-file.ts +58 -2
- package/src/resources/isobmff-track.test.ts +4 -4
- package/src/resources/isobmff-track.ts +33 -21
- package/src/resources/process-isobmff.test.ts +3 -3
- package/src/resources/process-isobmff.ts +2 -2
- package/src/resources/renders.test.ts +3 -3
- package/src/resources/renders.ts +3 -2
- package/src/resources/transcriptions.test.ts +2 -2
- package/src/resources/transcriptions.ts +7 -3
- package/src/resources/unprocessed-file.test.ts +8 -10
- package/src/resources/unprocessed-file.ts +21 -16
- package/src/resources/url-token.test.ts +3 -3
- package/src/resources/url-token.ts +1 -1
- package/src/utils/assertTypesMatch.ts +10 -0
- package/src/utils/createReadableStreamFromReadable.ts +117 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
3
|
-
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
|
+
declare const AudioTrackPayload: z.ZodObject<{
|
|
4
4
|
file_id: z.ZodString;
|
|
5
5
|
track_id: z.ZodNumber;
|
|
6
6
|
type: z.ZodLiteral<"audio">;
|
|
@@ -75,9 +75,9 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
75
75
|
codec_name: z.ZodString;
|
|
76
76
|
byte_size: z.ZodNumber;
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
codec_name: string;
|
|
78
79
|
type: "audio";
|
|
79
80
|
byte_size: number;
|
|
80
|
-
codec_name: string;
|
|
81
81
|
file_id: string;
|
|
82
82
|
track_id: number;
|
|
83
83
|
probe_info: {
|
|
@@ -105,9 +105,9 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
105
105
|
};
|
|
106
106
|
duration_ms: number;
|
|
107
107
|
}, {
|
|
108
|
+
codec_name: string;
|
|
108
109
|
type: "audio";
|
|
109
110
|
byte_size: number;
|
|
110
|
-
codec_name: string;
|
|
111
111
|
file_id: string;
|
|
112
112
|
track_id: number;
|
|
113
113
|
probe_info: {
|
|
@@ -134,7 +134,9 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
134
134
|
initial_padding?: number | undefined;
|
|
135
135
|
};
|
|
136
136
|
duration_ms: number;
|
|
137
|
-
}
|
|
137
|
+
}>;
|
|
138
|
+
export type AudioTrackPayload = z.infer<typeof AudioTrackPayload>;
|
|
139
|
+
declare const VideoTrackPayload: z.ZodObject<{
|
|
138
140
|
file_id: z.ZodString;
|
|
139
141
|
track_id: z.ZodNumber;
|
|
140
142
|
type: z.ZodLiteral<"video">;
|
|
@@ -159,8 +161,6 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
159
161
|
bit_rate: z.ZodOptional<z.ZodString>;
|
|
160
162
|
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
161
163
|
}, "strip", z.ZodTypeAny, {
|
|
162
|
-
height: number;
|
|
163
|
-
width: number;
|
|
164
164
|
index: number;
|
|
165
165
|
codec_name: string;
|
|
166
166
|
codec_long_name: string;
|
|
@@ -171,6 +171,8 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
171
171
|
avg_frame_rate: string;
|
|
172
172
|
time_base: string;
|
|
173
173
|
disposition: Record<string, unknown>;
|
|
174
|
+
width: number;
|
|
175
|
+
height: number;
|
|
174
176
|
coded_width: number;
|
|
175
177
|
coded_height: number;
|
|
176
178
|
start_pts?: number | undefined;
|
|
@@ -179,8 +181,64 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
179
181
|
duration?: number | undefined;
|
|
180
182
|
bit_rate?: string | undefined;
|
|
181
183
|
}, {
|
|
184
|
+
index: number;
|
|
185
|
+
codec_name: string;
|
|
186
|
+
codec_long_name: string;
|
|
187
|
+
codec_type: "video";
|
|
188
|
+
codec_tag_string: string;
|
|
189
|
+
codec_tag: string;
|
|
190
|
+
r_frame_rate: string;
|
|
191
|
+
avg_frame_rate: string;
|
|
192
|
+
time_base: string;
|
|
193
|
+
disposition: Record<string, unknown>;
|
|
194
|
+
width: number;
|
|
182
195
|
height: number;
|
|
196
|
+
coded_width: number;
|
|
197
|
+
coded_height: number;
|
|
198
|
+
start_pts?: number | undefined;
|
|
199
|
+
start_time?: number | undefined;
|
|
200
|
+
duration_ts?: number | undefined;
|
|
201
|
+
duration?: number | undefined;
|
|
202
|
+
bit_rate?: string | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
duration_ms: z.ZodNumber;
|
|
205
|
+
codec_name: z.ZodString;
|
|
206
|
+
byte_size: z.ZodNumber;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
codec_name: string;
|
|
209
|
+
type: "video";
|
|
210
|
+
byte_size: number;
|
|
211
|
+
file_id: string;
|
|
212
|
+
track_id: number;
|
|
213
|
+
probe_info: {
|
|
214
|
+
index: number;
|
|
215
|
+
codec_name: string;
|
|
216
|
+
codec_long_name: string;
|
|
217
|
+
codec_type: "video";
|
|
218
|
+
codec_tag_string: string;
|
|
219
|
+
codec_tag: string;
|
|
220
|
+
r_frame_rate: string;
|
|
221
|
+
avg_frame_rate: string;
|
|
222
|
+
time_base: string;
|
|
223
|
+
disposition: Record<string, unknown>;
|
|
183
224
|
width: number;
|
|
225
|
+
height: number;
|
|
226
|
+
coded_width: number;
|
|
227
|
+
coded_height: number;
|
|
228
|
+
start_pts?: number | undefined;
|
|
229
|
+
start_time?: number | undefined;
|
|
230
|
+
duration_ts?: number | undefined;
|
|
231
|
+
duration?: number | undefined;
|
|
232
|
+
bit_rate?: string | undefined;
|
|
233
|
+
};
|
|
234
|
+
duration_ms: number;
|
|
235
|
+
}, {
|
|
236
|
+
codec_name: string;
|
|
237
|
+
type: "video";
|
|
238
|
+
byte_size: number;
|
|
239
|
+
file_id: string;
|
|
240
|
+
track_id: number;
|
|
241
|
+
probe_info: {
|
|
184
242
|
index: number;
|
|
185
243
|
codec_name: string;
|
|
186
244
|
codec_long_name: string;
|
|
@@ -191,6 +249,8 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
191
249
|
avg_frame_rate: string;
|
|
192
250
|
time_base: string;
|
|
193
251
|
disposition: Record<string, unknown>;
|
|
252
|
+
width: number;
|
|
253
|
+
height: number;
|
|
194
254
|
coded_width: number;
|
|
195
255
|
coded_height: number;
|
|
196
256
|
start_pts?: number | undefined;
|
|
@@ -198,19 +258,219 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
198
258
|
duration_ts?: number | undefined;
|
|
199
259
|
duration?: number | undefined;
|
|
200
260
|
bit_rate?: string | undefined;
|
|
261
|
+
};
|
|
262
|
+
duration_ms: number;
|
|
263
|
+
}>;
|
|
264
|
+
export type VideoTrackPayload = z.infer<typeof VideoTrackPayload>;
|
|
265
|
+
export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
266
|
+
file_id: z.ZodString;
|
|
267
|
+
track_id: z.ZodNumber;
|
|
268
|
+
type: z.ZodLiteral<"audio">;
|
|
269
|
+
probe_info: z.ZodObject<{
|
|
270
|
+
index: z.ZodNumber;
|
|
271
|
+
codec_name: z.ZodString;
|
|
272
|
+
codec_long_name: z.ZodString;
|
|
273
|
+
codec_type: z.ZodLiteral<"audio">;
|
|
274
|
+
codec_tag_string: z.ZodString;
|
|
275
|
+
codec_tag: z.ZodString;
|
|
276
|
+
sample_fmt: z.ZodString;
|
|
277
|
+
sample_rate: z.ZodString;
|
|
278
|
+
channels: z.ZodNumber;
|
|
279
|
+
channel_layout: z.ZodString;
|
|
280
|
+
bits_per_sample: z.ZodNumber;
|
|
281
|
+
initial_padding: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
r_frame_rate: z.ZodString;
|
|
283
|
+
avg_frame_rate: z.ZodString;
|
|
284
|
+
time_base: z.ZodString;
|
|
285
|
+
start_pts: z.ZodNumber;
|
|
286
|
+
start_time: z.ZodNumber;
|
|
287
|
+
duration_ts: z.ZodNumber;
|
|
288
|
+
duration: z.ZodNumber;
|
|
289
|
+
bit_rate: z.ZodString;
|
|
290
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
291
|
+
}, "strip", z.ZodTypeAny, {
|
|
292
|
+
index: number;
|
|
293
|
+
codec_name: string;
|
|
294
|
+
codec_long_name: string;
|
|
295
|
+
codec_type: "audio";
|
|
296
|
+
codec_tag_string: string;
|
|
297
|
+
codec_tag: string;
|
|
298
|
+
sample_fmt: string;
|
|
299
|
+
sample_rate: string;
|
|
300
|
+
channels: number;
|
|
301
|
+
channel_layout: string;
|
|
302
|
+
bits_per_sample: number;
|
|
303
|
+
r_frame_rate: string;
|
|
304
|
+
avg_frame_rate: string;
|
|
305
|
+
time_base: string;
|
|
306
|
+
start_pts: number;
|
|
307
|
+
start_time: number;
|
|
308
|
+
duration_ts: number;
|
|
309
|
+
duration: number;
|
|
310
|
+
bit_rate: string;
|
|
311
|
+
disposition: Record<string, unknown>;
|
|
312
|
+
initial_padding?: number | undefined;
|
|
313
|
+
}, {
|
|
314
|
+
index: number;
|
|
315
|
+
codec_name: string;
|
|
316
|
+
codec_long_name: string;
|
|
317
|
+
codec_type: "audio";
|
|
318
|
+
codec_tag_string: string;
|
|
319
|
+
codec_tag: string;
|
|
320
|
+
sample_fmt: string;
|
|
321
|
+
sample_rate: string;
|
|
322
|
+
channels: number;
|
|
323
|
+
channel_layout: string;
|
|
324
|
+
bits_per_sample: number;
|
|
325
|
+
r_frame_rate: string;
|
|
326
|
+
avg_frame_rate: string;
|
|
327
|
+
time_base: string;
|
|
328
|
+
start_pts: number;
|
|
329
|
+
start_time: number;
|
|
330
|
+
duration_ts: number;
|
|
331
|
+
duration: number;
|
|
332
|
+
bit_rate: string;
|
|
333
|
+
disposition: Record<string, unknown>;
|
|
334
|
+
initial_padding?: number | undefined;
|
|
201
335
|
}>;
|
|
202
336
|
duration_ms: z.ZodNumber;
|
|
203
337
|
codec_name: z.ZodString;
|
|
204
338
|
byte_size: z.ZodNumber;
|
|
205
339
|
}, "strip", z.ZodTypeAny, {
|
|
206
|
-
|
|
340
|
+
codec_name: string;
|
|
341
|
+
type: "audio";
|
|
207
342
|
byte_size: number;
|
|
343
|
+
file_id: string;
|
|
344
|
+
track_id: number;
|
|
345
|
+
probe_info: {
|
|
346
|
+
index: number;
|
|
347
|
+
codec_name: string;
|
|
348
|
+
codec_long_name: string;
|
|
349
|
+
codec_type: "audio";
|
|
350
|
+
codec_tag_string: string;
|
|
351
|
+
codec_tag: string;
|
|
352
|
+
sample_fmt: string;
|
|
353
|
+
sample_rate: string;
|
|
354
|
+
channels: number;
|
|
355
|
+
channel_layout: string;
|
|
356
|
+
bits_per_sample: number;
|
|
357
|
+
r_frame_rate: string;
|
|
358
|
+
avg_frame_rate: string;
|
|
359
|
+
time_base: string;
|
|
360
|
+
start_pts: number;
|
|
361
|
+
start_time: number;
|
|
362
|
+
duration_ts: number;
|
|
363
|
+
duration: number;
|
|
364
|
+
bit_rate: string;
|
|
365
|
+
disposition: Record<string, unknown>;
|
|
366
|
+
initial_padding?: number | undefined;
|
|
367
|
+
};
|
|
368
|
+
duration_ms: number;
|
|
369
|
+
}, {
|
|
208
370
|
codec_name: string;
|
|
371
|
+
type: "audio";
|
|
372
|
+
byte_size: number;
|
|
209
373
|
file_id: string;
|
|
210
374
|
track_id: number;
|
|
211
375
|
probe_info: {
|
|
376
|
+
index: number;
|
|
377
|
+
codec_name: string;
|
|
378
|
+
codec_long_name: string;
|
|
379
|
+
codec_type: "audio";
|
|
380
|
+
codec_tag_string: string;
|
|
381
|
+
codec_tag: string;
|
|
382
|
+
sample_fmt: string;
|
|
383
|
+
sample_rate: string;
|
|
384
|
+
channels: number;
|
|
385
|
+
channel_layout: string;
|
|
386
|
+
bits_per_sample: number;
|
|
387
|
+
r_frame_rate: string;
|
|
388
|
+
avg_frame_rate: string;
|
|
389
|
+
time_base: string;
|
|
390
|
+
start_pts: number;
|
|
391
|
+
start_time: number;
|
|
392
|
+
duration_ts: number;
|
|
393
|
+
duration: number;
|
|
394
|
+
bit_rate: string;
|
|
395
|
+
disposition: Record<string, unknown>;
|
|
396
|
+
initial_padding?: number | undefined;
|
|
397
|
+
};
|
|
398
|
+
duration_ms: number;
|
|
399
|
+
}>, z.ZodObject<{
|
|
400
|
+
file_id: z.ZodString;
|
|
401
|
+
track_id: z.ZodNumber;
|
|
402
|
+
type: z.ZodLiteral<"video">;
|
|
403
|
+
probe_info: z.ZodObject<{
|
|
404
|
+
index: z.ZodNumber;
|
|
405
|
+
codec_name: z.ZodString;
|
|
406
|
+
codec_long_name: z.ZodString;
|
|
407
|
+
codec_type: z.ZodLiteral<"video">;
|
|
408
|
+
codec_tag_string: z.ZodString;
|
|
409
|
+
codec_tag: z.ZodString;
|
|
410
|
+
width: z.ZodNumber;
|
|
411
|
+
height: z.ZodNumber;
|
|
412
|
+
coded_width: z.ZodNumber;
|
|
413
|
+
coded_height: z.ZodNumber;
|
|
414
|
+
r_frame_rate: z.ZodString;
|
|
415
|
+
avg_frame_rate: z.ZodString;
|
|
416
|
+
time_base: z.ZodString;
|
|
417
|
+
start_pts: z.ZodOptional<z.ZodNumber>;
|
|
418
|
+
start_time: z.ZodOptional<z.ZodNumber>;
|
|
419
|
+
duration_ts: z.ZodOptional<z.ZodNumber>;
|
|
420
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
421
|
+
bit_rate: z.ZodOptional<z.ZodString>;
|
|
422
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
423
|
+
}, "strip", z.ZodTypeAny, {
|
|
424
|
+
index: number;
|
|
425
|
+
codec_name: string;
|
|
426
|
+
codec_long_name: string;
|
|
427
|
+
codec_type: "video";
|
|
428
|
+
codec_tag_string: string;
|
|
429
|
+
codec_tag: string;
|
|
430
|
+
r_frame_rate: string;
|
|
431
|
+
avg_frame_rate: string;
|
|
432
|
+
time_base: string;
|
|
433
|
+
disposition: Record<string, unknown>;
|
|
434
|
+
width: number;
|
|
212
435
|
height: number;
|
|
436
|
+
coded_width: number;
|
|
437
|
+
coded_height: number;
|
|
438
|
+
start_pts?: number | undefined;
|
|
439
|
+
start_time?: number | undefined;
|
|
440
|
+
duration_ts?: number | undefined;
|
|
441
|
+
duration?: number | undefined;
|
|
442
|
+
bit_rate?: string | undefined;
|
|
443
|
+
}, {
|
|
444
|
+
index: number;
|
|
445
|
+
codec_name: string;
|
|
446
|
+
codec_long_name: string;
|
|
447
|
+
codec_type: "video";
|
|
448
|
+
codec_tag_string: string;
|
|
449
|
+
codec_tag: string;
|
|
450
|
+
r_frame_rate: string;
|
|
451
|
+
avg_frame_rate: string;
|
|
452
|
+
time_base: string;
|
|
453
|
+
disposition: Record<string, unknown>;
|
|
213
454
|
width: number;
|
|
455
|
+
height: number;
|
|
456
|
+
coded_width: number;
|
|
457
|
+
coded_height: number;
|
|
458
|
+
start_pts?: number | undefined;
|
|
459
|
+
start_time?: number | undefined;
|
|
460
|
+
duration_ts?: number | undefined;
|
|
461
|
+
duration?: number | undefined;
|
|
462
|
+
bit_rate?: string | undefined;
|
|
463
|
+
}>;
|
|
464
|
+
duration_ms: z.ZodNumber;
|
|
465
|
+
codec_name: z.ZodString;
|
|
466
|
+
byte_size: z.ZodNumber;
|
|
467
|
+
}, "strip", z.ZodTypeAny, {
|
|
468
|
+
codec_name: string;
|
|
469
|
+
type: "video";
|
|
470
|
+
byte_size: number;
|
|
471
|
+
file_id: string;
|
|
472
|
+
track_id: number;
|
|
473
|
+
probe_info: {
|
|
214
474
|
index: number;
|
|
215
475
|
codec_name: string;
|
|
216
476
|
codec_long_name: string;
|
|
@@ -221,6 +481,8 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
221
481
|
avg_frame_rate: string;
|
|
222
482
|
time_base: string;
|
|
223
483
|
disposition: Record<string, unknown>;
|
|
484
|
+
width: number;
|
|
485
|
+
height: number;
|
|
224
486
|
coded_width: number;
|
|
225
487
|
coded_height: number;
|
|
226
488
|
start_pts?: number | undefined;
|
|
@@ -231,14 +493,12 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
231
493
|
};
|
|
232
494
|
duration_ms: number;
|
|
233
495
|
}, {
|
|
496
|
+
codec_name: string;
|
|
234
497
|
type: "video";
|
|
235
498
|
byte_size: number;
|
|
236
|
-
codec_name: string;
|
|
237
499
|
file_id: string;
|
|
238
500
|
track_id: number;
|
|
239
501
|
probe_info: {
|
|
240
|
-
height: number;
|
|
241
|
-
width: number;
|
|
242
502
|
index: number;
|
|
243
503
|
codec_name: string;
|
|
244
504
|
codec_long_name: string;
|
|
@@ -249,6 +509,8 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
249
509
|
avg_frame_rate: string;
|
|
250
510
|
time_base: string;
|
|
251
511
|
disposition: Record<string, unknown>;
|
|
512
|
+
width: number;
|
|
513
|
+
height: number;
|
|
252
514
|
coded_width: number;
|
|
253
515
|
coded_height: number;
|
|
254
516
|
start_pts?: number | undefined;
|
|
@@ -259,6 +521,7 @@ export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type",
|
|
|
259
521
|
};
|
|
260
522
|
duration_ms: number;
|
|
261
523
|
}>]>;
|
|
524
|
+
export type CreateISOBMFFTrackPayload = z.infer<typeof CreateISOBMFFTrackPayload>;
|
|
262
525
|
export interface CreateISOBMFFTrackResult {
|
|
263
526
|
next_byte: number;
|
|
264
527
|
byte_size: number;
|
|
@@ -266,5 +529,6 @@ export interface CreateISOBMFFTrackResult {
|
|
|
266
529
|
file_id: string;
|
|
267
530
|
complete: boolean;
|
|
268
531
|
}
|
|
269
|
-
export declare const createISOBMFFTrack: (client: Client, payload:
|
|
270
|
-
export declare const uploadISOBMFFTrack: (client: Client, fileId: string, trackId: number, fileStream: ReadableStream, trackSize: number) => import('../uploadChunks.
|
|
532
|
+
export declare const createISOBMFFTrack: (client: Client, payload: CreateISOBMFFTrackPayload) => Promise<CreateISOBMFFTrackResult>;
|
|
533
|
+
export declare const uploadISOBMFFTrack: (client: Client, fileId: string, trackId: number, fileStream: ReadableStream, trackSize: number) => import('../uploadChunks.js').IteratorWithPromise<import('../uploadChunks.js').UploadChunkEvent>;
|
|
534
|
+
export {};
|
|
@@ -47,25 +47,27 @@ const VideoStreamSchema = z.object({
|
|
|
47
47
|
});
|
|
48
48
|
const log = debug("ef:api:isobmff-track");
|
|
49
49
|
const MAX_TRACK_SIZE = 1024 * 1024 * 1024;
|
|
50
|
+
const AudioTrackPayload = z.object({
|
|
51
|
+
file_id: z.string(),
|
|
52
|
+
track_id: z.number().int(),
|
|
53
|
+
type: z.literal("audio"),
|
|
54
|
+
probe_info: AudioStreamSchema,
|
|
55
|
+
duration_ms: z.number().int(),
|
|
56
|
+
codec_name: z.string(),
|
|
57
|
+
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
58
|
+
});
|
|
59
|
+
const VideoTrackPayload = z.object({
|
|
60
|
+
file_id: z.string(),
|
|
61
|
+
track_id: z.number().int(),
|
|
62
|
+
type: z.literal("video"),
|
|
63
|
+
probe_info: VideoStreamSchema,
|
|
64
|
+
duration_ms: z.number().int(),
|
|
65
|
+
codec_name: z.string(),
|
|
66
|
+
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
67
|
+
});
|
|
50
68
|
const CreateISOBMFFTrackPayload = z.discriminatedUnion("type", [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
track_id: z.number().int(),
|
|
54
|
-
type: z.literal("audio"),
|
|
55
|
-
probe_info: AudioStreamSchema,
|
|
56
|
-
duration_ms: z.number().int(),
|
|
57
|
-
codec_name: z.string(),
|
|
58
|
-
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
59
|
-
}),
|
|
60
|
-
z.object({
|
|
61
|
-
file_id: z.string(),
|
|
62
|
-
track_id: z.number().int(),
|
|
63
|
-
type: z.literal("video"),
|
|
64
|
-
probe_info: VideoStreamSchema,
|
|
65
|
-
duration_ms: z.number().int(),
|
|
66
|
-
codec_name: z.string(),
|
|
67
|
-
byte_size: z.number().int().max(MAX_TRACK_SIZE)
|
|
68
|
-
})
|
|
69
|
+
AudioTrackPayload,
|
|
70
|
+
VideoTrackPayload
|
|
69
71
|
]);
|
|
70
72
|
const createISOBMFFTrack = async (client, payload) => {
|
|
71
73
|
log("Creating isobmff track", payload);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProgressIterator } from '../ProgressIterator.
|
|
2
|
-
import { Client } from '../client.
|
|
1
|
+
import { ProgressIterator } from '../ProgressIterator.js';
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
3
|
export interface IsobmffProcessInfoResult {
|
|
4
4
|
id: string;
|
|
5
5
|
created_at: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
3
|
export declare const CreateRenderPayload: z.ZodObject<{
|
|
4
4
|
md5: z.ZodString;
|
|
5
5
|
fps: z.ZodNumber;
|
|
@@ -9,22 +9,23 @@ export declare const CreateRenderPayload: z.ZodObject<{
|
|
|
9
9
|
duration_ms: z.ZodNumber;
|
|
10
10
|
strategy: z.ZodEnum<["v1", "v2"]>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
md5: string;
|
|
13
|
-
height: number;
|
|
14
12
|
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
md5: string;
|
|
15
|
+
strategy: "v1" | "v2";
|
|
15
16
|
duration_ms: number;
|
|
16
17
|
fps: number;
|
|
17
18
|
work_slice_ms: number;
|
|
18
|
-
strategy: "v1" | "v2";
|
|
19
19
|
}, {
|
|
20
|
-
md5: string;
|
|
21
|
-
height: number;
|
|
22
20
|
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
md5: string;
|
|
23
|
+
strategy: "v1" | "v2";
|
|
23
24
|
duration_ms: number;
|
|
24
25
|
fps: number;
|
|
25
26
|
work_slice_ms: number;
|
|
26
|
-
strategy: "v1" | "v2";
|
|
27
27
|
}>;
|
|
28
|
+
export type CreateRenderPayload = z.infer<typeof CreateRenderPayload>;
|
|
28
29
|
export interface CreateRenderResult {
|
|
29
30
|
id: string;
|
|
30
31
|
md5: string;
|
|
@@ -35,6 +36,6 @@ export interface LookupRenderByMd5Result {
|
|
|
35
36
|
md5: string;
|
|
36
37
|
status: "complete" | "created" | "failed" | "pending" | "rendering" | string;
|
|
37
38
|
}
|
|
38
|
-
export declare const createRender: (client: Client, payload:
|
|
39
|
+
export declare const createRender: (client: Client, payload: CreateRenderPayload) => Promise<CreateRenderResult>;
|
|
39
40
|
export declare const uploadRender: (client: Client, fileId: string, fileStream: ReadableStream, folderSize: number) => Promise<any>;
|
|
40
41
|
export declare const lookupRenderByMd5: (client: Client, md5: string) => Promise<LookupRenderByMd5Result | null>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CompletionIterator } from '../ProgressIterator.
|
|
3
|
-
import { Client } from '../client.
|
|
2
|
+
import { CompletionIterator } from '../ProgressIterator.js';
|
|
3
|
+
import { Client } from '../client.js';
|
|
4
4
|
export declare const CreateTranscriptionPayload: z.ZodObject<{
|
|
5
5
|
file_id: z.ZodString;
|
|
6
6
|
track_id: z.ZodNumber;
|
|
@@ -11,6 +11,7 @@ export declare const CreateTranscriptionPayload: z.ZodObject<{
|
|
|
11
11
|
file_id: string;
|
|
12
12
|
track_id: number;
|
|
13
13
|
}>;
|
|
14
|
+
export type CreateTranscriptionPayload = z.infer<typeof CreateTranscriptionPayload>;
|
|
14
15
|
export interface CreateTranscriptionResult {
|
|
15
16
|
id: string;
|
|
16
17
|
status: "complete" | "created" | "failed" | "pending" | "transcribing";
|
|
@@ -19,6 +20,6 @@ export interface TranscriptionInfoResult {
|
|
|
19
20
|
id: string;
|
|
20
21
|
status: "complete" | "created" | "failed" | "pending" | "transcribing";
|
|
21
22
|
}
|
|
22
|
-
export declare const createTranscription: (client: Client, payload:
|
|
23
|
+
export declare const createTranscription: (client: Client, payload: CreateTranscriptionPayload) => Promise<CreateTranscriptionResult>;
|
|
23
24
|
export declare const getTranscriptionProgress: (client: Client, id: string) => Promise<CompletionIterator>;
|
|
24
25
|
export declare const getTranscriptionInfo: (client: Client, id: string) => Promise<TranscriptionInfoResult>;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
3
|
export declare const CreateUnprocessedFilePayload: z.ZodObject<{
|
|
4
4
|
md5: z.ZodString;
|
|
5
5
|
filename: z.ZodString;
|
|
6
6
|
byte_size: z.ZodNumber;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
md5: string;
|
|
9
8
|
filename: string;
|
|
9
|
+
md5: string;
|
|
10
10
|
byte_size: number;
|
|
11
11
|
}, {
|
|
12
|
-
md5: string;
|
|
13
12
|
filename: string;
|
|
13
|
+
md5: string;
|
|
14
14
|
byte_size: number;
|
|
15
15
|
}>;
|
|
16
16
|
export declare const UpdateUnprocessedFilePayload: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
17
|
-
|
|
17
|
+
export type CreateUnprocessedFilePayload = z.infer<typeof CreateUnprocessedFilePayload>;
|
|
18
|
+
export interface UnprocessedFile {
|
|
18
19
|
byte_size: number;
|
|
19
20
|
next_byte: number;
|
|
20
21
|
complete: boolean;
|
|
21
22
|
id: string;
|
|
22
23
|
md5: string;
|
|
23
24
|
}
|
|
25
|
+
export type UnprocessedFileUploadDetails = Pick<UnprocessedFile, "id" | "byte_size">;
|
|
24
26
|
export interface CreateUnprocessedFileResult extends UnprocessedFile {
|
|
25
27
|
}
|
|
26
28
|
export interface LookupUnprocessedFileByMd5Result extends UnprocessedFile {
|
|
@@ -30,8 +32,7 @@ export interface UpdateUnprocessedFileResult extends UnprocessedFile {
|
|
|
30
32
|
export interface ProcessIsobmffFileResult {
|
|
31
33
|
id: string;
|
|
32
34
|
}
|
|
33
|
-
export declare const createUnprocessedFile: (client: Client, payload:
|
|
34
|
-
export declare const
|
|
35
|
+
export declare const createUnprocessedFile: (client: Client, payload: CreateUnprocessedFilePayload) => Promise<CreateUnprocessedFileResult>;
|
|
36
|
+
export declare const uploadUnprocessedReadableStream: (client: Client, uploadDetails: UnprocessedFileUploadDetails, fileStream: ReadableStream) => import('../uploadChunks.js').IteratorWithPromise<import('../uploadChunks.js').UploadChunkEvent>;
|
|
35
37
|
export declare const lookupUnprocessedFileByMd5: (client: Client, md5: string) => Promise<LookupUnprocessedFileByMd5Result | null>;
|
|
36
|
-
export declare const processIsobmffFile: (client: Client,
|
|
37
|
-
export {};
|
|
38
|
+
export declare const processIsobmffFile: (client: Client, id: string) => Promise<ProcessIsobmffFileResult>;
|
|
@@ -32,11 +32,11 @@ const createUnprocessedFile = async (client, payload) => {
|
|
|
32
32
|
`Failed to create unprocessed file ${response.status} ${response.statusText}`
|
|
33
33
|
);
|
|
34
34
|
};
|
|
35
|
-
const
|
|
36
|
-
log("Uploading unprocessed file",
|
|
35
|
+
const uploadUnprocessedReadableStream = (client, uploadDetails, fileStream) => {
|
|
36
|
+
log("Uploading unprocessed file", uploadDetails.id);
|
|
37
37
|
return uploadChunks(client, {
|
|
38
|
-
url: `/api/v1/unprocessed_files/${
|
|
39
|
-
fileSize,
|
|
38
|
+
url: `/api/v1/unprocessed_files/${uploadDetails.id}/upload`,
|
|
39
|
+
fileSize: uploadDetails.byte_size,
|
|
40
40
|
fileStream,
|
|
41
41
|
maxSize: MAX_FILE_SIZE
|
|
42
42
|
});
|
|
@@ -58,9 +58,9 @@ const lookupUnprocessedFileByMd5 = async (client, md5) => {
|
|
|
58
58
|
`Failed to lookup unprocessed file by md5 ${md5} ${response.status} ${response.statusText}`
|
|
59
59
|
);
|
|
60
60
|
};
|
|
61
|
-
const processIsobmffFile = async (client,
|
|
61
|
+
const processIsobmffFile = async (client, id) => {
|
|
62
62
|
const response = await client.authenticatedFetch(
|
|
63
|
-
`/api/v1/unprocessed_files/${
|
|
63
|
+
`/api/v1/unprocessed_files/${id}/isobmff`,
|
|
64
64
|
{
|
|
65
65
|
method: "POST"
|
|
66
66
|
}
|
|
@@ -69,7 +69,7 @@ const processIsobmffFile = async (client, unprocessedFileId) => {
|
|
|
69
69
|
return await response.json();
|
|
70
70
|
}
|
|
71
71
|
throw new Error(
|
|
72
|
-
`Failed to process isobmff file ${response.status} ${response.statusText}`
|
|
72
|
+
`Failed to process isobmff file ${id} ${response.status} ${response.statusText}`
|
|
73
73
|
);
|
|
74
74
|
};
|
|
75
75
|
export {
|
|
@@ -77,5 +77,5 @@ export {
|
|
|
77
77
|
createUnprocessedFile,
|
|
78
78
|
lookupUnprocessedFileByMd5,
|
|
79
79
|
processIsobmffFile,
|
|
80
|
-
|
|
80
|
+
uploadUnprocessedReadableStream
|
|
81
81
|
};
|
package/dist/uploadChunks.d.ts
CHANGED