@editframe/api 0.12.0-beta.15 → 0.12.0-beta.18
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 +1 -2
- package/dist/client.d.ts +1 -1
- package/dist/index.d.ts +13 -10
- package/dist/node.d.ts +5 -5
- package/dist/resources/caption-file.d.ts +30 -2
- package/dist/resources/caption-file.js +9 -0
- package/dist/resources/image-file.d.ts +22 -3
- package/dist/resources/image-file.js +18 -0
- package/dist/resources/isobmff-file.d.ts +23 -3
- package/dist/resources/isobmff-track.d.ts +267 -3
- package/dist/resources/isobmff-track.js +20 -18
- package/dist/resources/process-isobmff.d.ts +2 -2
- package/dist/resources/renders.d.ts +3 -2
- package/dist/resources/transcriptions.d.ts +4 -3
- package/dist/resources/unprocessed-file.d.ts +5 -5
- package/dist/resources/url-token.d.ts +1 -1
- package/dist/uploadChunks.d.ts +4 -1
- 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 +6 -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 +3 -3
- package/src/resources/image-file.ts +23 -3
- package/src/resources/isobmff-file.test.ts +3 -3
- package/src/resources/isobmff-file.ts +27 -3
- 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 +3 -3
- package/src/resources/unprocessed-file.ts +8 -4
- package/src/resources/url-token.test.ts +3 -3
- package/src/resources/url-token.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompleteEvent, ProgressEvent, StreamEventSource } from './StreamEventSource.
|
|
1
|
+
import { CompleteEvent, ProgressEvent, StreamEventSource } from './StreamEventSource.js';
|
|
2
2
|
declare abstract class BaseEventIterator<T extends CompleteEvent | any> implements AsyncIterable<T> {
|
|
3
3
|
protected eventSource: StreamEventSource;
|
|
4
4
|
protected queue: T[];
|
package/dist/ProgressIterator.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
const promiseWithResolvers = () => {
|
|
2
|
+
if (typeof Promise.withResolvers === "function") {
|
|
3
|
+
return Promise.withResolvers();
|
|
4
|
+
}
|
|
5
|
+
let resolve;
|
|
6
|
+
let reject;
|
|
7
|
+
const promise = new Promise((res, rej) => {
|
|
8
|
+
resolve = res;
|
|
9
|
+
reject = rej;
|
|
10
|
+
});
|
|
11
|
+
return { promise, resolve, reject };
|
|
12
|
+
};
|
|
1
13
|
class BaseEventIterator {
|
|
2
14
|
constructor(eventSource) {
|
|
3
15
|
this.queue = [];
|
|
4
16
|
this.index = 0;
|
|
5
17
|
this.isComplete = false;
|
|
6
|
-
this.resolversNext =
|
|
18
|
+
this.resolversNext = promiseWithResolvers();
|
|
7
19
|
this.eventSource = eventSource;
|
|
8
20
|
}
|
|
9
21
|
async whenComplete() {
|
|
@@ -14,7 +26,7 @@ class BaseEventIterator {
|
|
|
14
26
|
push(event) {
|
|
15
27
|
this.queue.push(event);
|
|
16
28
|
this.resolversNext.resolve();
|
|
17
|
-
this.resolversNext =
|
|
29
|
+
this.resolversNext = promiseWithResolvers();
|
|
18
30
|
}
|
|
19
31
|
get queueLength() {
|
|
20
32
|
return this.queue.length - this.index;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type EventCallback<T> = (event: T) => void;
|
|
1
|
+
export type EventCallback<T> = (event: T) => void;
|
|
2
2
|
export type StreamEventSourceEventMap = {
|
|
3
3
|
progress: ProgressEvent;
|
|
4
4
|
complete: CompleteEvent;
|
|
@@ -47,4 +47,3 @@ export declare class StreamEventSource {
|
|
|
47
47
|
private startReading;
|
|
48
48
|
close(): void;
|
|
49
49
|
}
|
|
50
|
-
export {};
|
package/dist/client.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export { createCaptionFile, CreateCaptionFilePayload, type CreateCaptionFileResult, uploadCaptionFile, type LookupCaptionFileByMd5Result, lookupCaptionFileByMd5, } from './resources/caption-file.
|
|
2
|
-
export { createImageFile, CreateImageFilePayload, type CreateImageFileResult, uploadImageFile, type LookupImageFileByMd5Result, lookupImageFileByMd5, } from './resources/image-file.
|
|
3
|
-
export { createISOBMFFFile, CreateISOBMFFFilePayload, type CreateISOBMFFFileResult, uploadFragmentIndex, type LookupISOBMFFFileByMd5Result, lookupISOBMFFFileByMd5, type GetISOBMFFFileTranscriptionResult, getISOBMFFFileTranscription, type TranscribeISOBMFFFileResult, transcribeISOBMFFFile, TranscribeISOBMFFFilePayload, } from './resources/isobmff-file.
|
|
4
|
-
export { createISOBMFFTrack, CreateISOBMFFTrackPayload, type CreateISOBMFFTrackResult, uploadISOBMFFTrack, } from './resources/isobmff-track.
|
|
5
|
-
export { createRender, CreateRenderPayload, type CreateRenderResult, uploadRender, type LookupRenderByMd5Result, lookupRenderByMd5, } from './resources/renders.
|
|
6
|
-
export { createTranscription, CreateTranscriptionPayload, type CreateTranscriptionResult, getTranscriptionInfo, getTranscriptionProgress, type TranscriptionInfoResult, } from './resources/transcriptions.
|
|
7
|
-
export { createURLToken, type URLTokenResult, } from './resources/url-token.
|
|
8
|
-
export { createUnprocessedFile, CreateUnprocessedFilePayload, type CreateUnprocessedFileResult, uploadUnprocessedReadableStream, type LookupUnprocessedFileByMd5Result, lookupUnprocessedFileByMd5, processIsobmffFile, type ProcessIsobmffFileResult, } from './resources/unprocessed-file.
|
|
9
|
-
export { getIsobmffProcessInfo, getIsobmffProcessProgress, type IsobmffProcessInfoResult, } from './resources/process-isobmff.
|
|
10
|
-
export { Client } from './client.
|
|
1
|
+
export { createCaptionFile, CreateCaptionFilePayload, type CreateCaptionFileResult, uploadCaptionFile, type LookupCaptionFileByMd5Result, lookupCaptionFileByMd5, } from './resources/caption-file.js';
|
|
2
|
+
export { createImageFile, CreateImageFilePayload, type CreateImageFileResult, uploadImageFile, type LookupImageFileByMd5Result, lookupImageFileByMd5, } from './resources/image-file.js';
|
|
3
|
+
export { createISOBMFFFile, CreateISOBMFFFilePayload, type CreateISOBMFFFileResult, uploadFragmentIndex, type LookupISOBMFFFileByMd5Result, lookupISOBMFFFileByMd5, type GetISOBMFFFileTranscriptionResult, getISOBMFFFileTranscription, type TranscribeISOBMFFFileResult, transcribeISOBMFFFile, TranscribeISOBMFFFilePayload, } from './resources/isobmff-file.js';
|
|
4
|
+
export { createISOBMFFTrack, CreateISOBMFFTrackPayload, type CreateISOBMFFTrackResult, uploadISOBMFFTrack, } from './resources/isobmff-track.js';
|
|
5
|
+
export { createRender, CreateRenderPayload, type CreateRenderResult, uploadRender, type LookupRenderByMd5Result, lookupRenderByMd5, } from './resources/renders.js';
|
|
6
|
+
export { createTranscription, CreateTranscriptionPayload, type CreateTranscriptionResult, getTranscriptionInfo, getTranscriptionProgress, type TranscriptionInfoResult, } from './resources/transcriptions.js';
|
|
7
|
+
export { createURLToken, type URLTokenResult, } from './resources/url-token.js';
|
|
8
|
+
export { createUnprocessedFile, CreateUnprocessedFilePayload, type CreateUnprocessedFileResult, uploadUnprocessedReadableStream, type LookupUnprocessedFileByMd5Result, lookupUnprocessedFileByMd5, processIsobmffFile, type ProcessIsobmffFileResult, type UnprocessedFileUploadDetails, type UnprocessedFile, } from './resources/unprocessed-file.js';
|
|
9
|
+
export { getIsobmffProcessInfo, getIsobmffProcessProgress, type IsobmffProcessInfoResult, } from './resources/process-isobmff.js';
|
|
10
|
+
export { Client } from './client.js';
|
|
11
|
+
export type { IteratorWithPromise, UploadChunkEvent } from './uploadChunks.js';
|
|
12
|
+
export type { ProgressIterator, CompletionIterator, } from './ProgressIterator.js';
|
|
13
|
+
export type { StreamEventSource, ProgressEvent, CompletionEvent, StreamEventSourceEventMap, EventCallback, } from './StreamEventSource.js';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Client } from './client.
|
|
2
|
-
import { UnprocessedFileUploadDetails } from './resources/unprocessed-file.
|
|
3
|
-
export declare const createImageFileFromPath: (client: Client, path: string) => Promise<import('./index.
|
|
4
|
-
export declare const createUnprocessedFileFromPath: (client: Client, path: string) => Promise<import('./index.
|
|
1
|
+
import { Client } from './client.js';
|
|
2
|
+
import { UnprocessedFileUploadDetails } from './resources/unprocessed-file.js';
|
|
3
|
+
export declare const createImageFileFromPath: (client: Client, path: string) => Promise<import('./index.js').CreateImageFileResult>;
|
|
4
|
+
export declare const createUnprocessedFileFromPath: (client: Client, path: string) => Promise<import('./index.js').CreateUnprocessedFileResult>;
|
|
5
5
|
export declare const uploadUnprocessedFile: (client: Client, uploadDetails: UnprocessedFileUploadDetails, path: string) => Promise<import('./uploadChunks.ts').IteratorWithPromise<import('./uploadChunks.ts').UploadChunkEvent>>;
|
|
6
|
-
export * from './index.
|
|
6
|
+
export * from './index.js';
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
3
|
export declare const CreateCaptionFilePayload: z.ZodObject<{
|
|
4
|
+
/**
|
|
5
|
+
* The md5 hash of the caption file
|
|
6
|
+
*/
|
|
4
7
|
md5: z.ZodString;
|
|
8
|
+
/**
|
|
9
|
+
* The filename of the caption file
|
|
10
|
+
*/
|
|
5
11
|
filename: z.ZodString;
|
|
12
|
+
/**
|
|
13
|
+
* The size of the caption file in bytes
|
|
14
|
+
*/
|
|
6
15
|
byte_size: z.ZodNumber;
|
|
7
16
|
}, "strip", z.ZodTypeAny, {
|
|
8
17
|
filename: string;
|
|
@@ -13,14 +22,33 @@ export declare const CreateCaptionFilePayload: z.ZodObject<{
|
|
|
13
22
|
md5: string;
|
|
14
23
|
byte_size: number;
|
|
15
24
|
}>;
|
|
25
|
+
export type CreateCaptionFilePayload = z.infer<typeof CreateCaptionFilePayload>;
|
|
16
26
|
export interface CreateCaptionFileResult {
|
|
27
|
+
/**
|
|
28
|
+
* Whether the caption file is complete
|
|
29
|
+
*/
|
|
17
30
|
complete: boolean | null;
|
|
31
|
+
/**
|
|
32
|
+
* The id of the caption file
|
|
33
|
+
*/
|
|
18
34
|
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* The md5 hash of the caption file
|
|
37
|
+
*/
|
|
19
38
|
md5: string;
|
|
20
39
|
}
|
|
21
40
|
export interface LookupCaptionFileByMd5Result {
|
|
41
|
+
/**
|
|
42
|
+
* Whether the caption file is complete
|
|
43
|
+
*/
|
|
22
44
|
complete: boolean | null;
|
|
45
|
+
/**
|
|
46
|
+
* The id of the caption file
|
|
47
|
+
*/
|
|
23
48
|
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* The md5 hash of the caption file
|
|
51
|
+
*/
|
|
24
52
|
md5: string;
|
|
25
53
|
}
|
|
26
54
|
/**
|
|
@@ -40,6 +68,6 @@ export interface LookupCaptionFileByMd5Result {
|
|
|
40
68
|
* @resource
|
|
41
69
|
* @beta
|
|
42
70
|
*/
|
|
43
|
-
export declare const createCaptionFile: (client: Client, payload:
|
|
71
|
+
export declare const createCaptionFile: (client: Client, payload: CreateCaptionFilePayload) => Promise<CreateCaptionFileResult>;
|
|
44
72
|
export declare const uploadCaptionFile: (client: Client, fileId: string, fileStream: ReadableStream, fileSize: number) => Promise<any>;
|
|
45
73
|
export declare const lookupCaptionFileByMd5: (client: Client, md5: string) => Promise<LookupCaptionFileByMd5Result | null>;
|
|
@@ -3,8 +3,17 @@ import { z } from "zod";
|
|
|
3
3
|
const log = debug("ef:api:caption-file");
|
|
4
4
|
const MAX_CAPTION_SIZE = 1024 * 1024 * 2;
|
|
5
5
|
const CreateCaptionFilePayload = z.object({
|
|
6
|
+
/**
|
|
7
|
+
* The md5 hash of the caption file
|
|
8
|
+
*/
|
|
6
9
|
md5: z.string(),
|
|
10
|
+
/**
|
|
11
|
+
* The filename of the caption file
|
|
12
|
+
*/
|
|
7
13
|
filename: z.string(),
|
|
14
|
+
/**
|
|
15
|
+
* The size of the caption file in bytes
|
|
16
|
+
*/
|
|
8
17
|
byte_size: z.number().int().max(MAX_CAPTION_SIZE)
|
|
9
18
|
});
|
|
10
19
|
const restrictSize = (size) => {
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
3
|
export declare const CreateImageFilePayload: z.ZodObject<{
|
|
4
|
+
/**
|
|
5
|
+
* The md5 hash of the image file.
|
|
6
|
+
*/
|
|
4
7
|
md5: z.ZodString;
|
|
8
|
+
/**
|
|
9
|
+
* The height of the image file in pixels.
|
|
10
|
+
*/
|
|
5
11
|
height: z.ZodNumber;
|
|
12
|
+
/**
|
|
13
|
+
* The width of the image file in pixels.
|
|
14
|
+
*/
|
|
6
15
|
width: z.ZodNumber;
|
|
16
|
+
/**
|
|
17
|
+
* The mime type of the image file.
|
|
18
|
+
*/
|
|
7
19
|
mime_type: z.ZodEnum<["image/jpeg", "image/png", "image/jpg", "image/webp"]>;
|
|
20
|
+
/**
|
|
21
|
+
* The filename of the image file.
|
|
22
|
+
*/
|
|
8
23
|
filename: z.ZodString;
|
|
24
|
+
/**
|
|
25
|
+
* The byte size of the image file.
|
|
26
|
+
*/
|
|
9
27
|
byte_size: z.ZodNumber;
|
|
10
28
|
}, "strip", z.ZodTypeAny, {
|
|
11
29
|
width: number;
|
|
@@ -22,6 +40,7 @@ export declare const CreateImageFilePayload: z.ZodObject<{
|
|
|
22
40
|
mime_type: "image/jpeg" | "image/png" | "image/jpg" | "image/webp";
|
|
23
41
|
byte_size: number;
|
|
24
42
|
}>;
|
|
43
|
+
export type CreateImageFilePayload = z.infer<typeof CreateImageFilePayload>;
|
|
25
44
|
export interface CreateImageFileResult {
|
|
26
45
|
complete: boolean | null;
|
|
27
46
|
byte_size: number;
|
|
@@ -34,9 +53,9 @@ export interface LookupImageFileByMd5Result {
|
|
|
34
53
|
id: string;
|
|
35
54
|
md5: string;
|
|
36
55
|
}
|
|
37
|
-
export declare const createImageFile: (client: Client, payload:
|
|
56
|
+
export declare const createImageFile: (client: Client, payload: CreateImageFilePayload) => Promise<CreateImageFileResult>;
|
|
38
57
|
export declare const uploadImageFile: (client: Client, uploadDetails: {
|
|
39
58
|
id: string;
|
|
40
59
|
byte_size: number;
|
|
41
|
-
}, fileStream: ReadableStream) => import('../uploadChunks.
|
|
60
|
+
}, fileStream: ReadableStream) => import('../uploadChunks.js').IteratorWithPromise<import('../uploadChunks.js').UploadChunkEvent>;
|
|
42
61
|
export declare const lookupImageFileByMd5: (client: Client, md5: string) => Promise<LookupImageFileByMd5Result | null>;
|
|
@@ -4,11 +4,29 @@ import { uploadChunks } from "../uploadChunks.js";
|
|
|
4
4
|
const log = debug("ef:api:image-file");
|
|
5
5
|
const MAX_IMAGE_SIZE = 1024 * 1024 * 16;
|
|
6
6
|
const CreateImageFilePayload = z.object({
|
|
7
|
+
/**
|
|
8
|
+
* The md5 hash of the image file.
|
|
9
|
+
*/
|
|
7
10
|
md5: z.string(),
|
|
11
|
+
/**
|
|
12
|
+
* The height of the image file in pixels.
|
|
13
|
+
*/
|
|
8
14
|
height: z.number().int(),
|
|
15
|
+
/**
|
|
16
|
+
* The width of the image file in pixels.
|
|
17
|
+
*/
|
|
9
18
|
width: z.number().int(),
|
|
19
|
+
/**
|
|
20
|
+
* The mime type of the image file.
|
|
21
|
+
*/
|
|
10
22
|
mime_type: z.enum(["image/jpeg", "image/png", "image/jpg", "image/webp"]),
|
|
23
|
+
/**
|
|
24
|
+
* The filename of the image file.
|
|
25
|
+
*/
|
|
11
26
|
filename: z.string(),
|
|
27
|
+
/**
|
|
28
|
+
* The byte size of the image file.
|
|
29
|
+
*/
|
|
12
30
|
byte_size: z.number().int().max(MAX_IMAGE_SIZE)
|
|
13
31
|
});
|
|
14
32
|
const createImageFile = async (client, payload) => {
|
|
@@ -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 CreateISOBMFFFilePayload: z.ZodObject<{
|
|
4
4
|
md5: z.ZodString;
|
|
5
5
|
filename: z.ZodString;
|
|
@@ -10,14 +10,33 @@ export declare const CreateISOBMFFFilePayload: z.ZodObject<{
|
|
|
10
10
|
filename: string;
|
|
11
11
|
md5: string;
|
|
12
12
|
}>;
|
|
13
|
+
export type CreateISOBMFFFilePayload = z.infer<typeof CreateISOBMFFFilePayload>;
|
|
13
14
|
export interface CreateISOBMFFFileResult {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the fragment index is complete. The fragment index is used internally by editframe to efficiently seek within files.
|
|
17
|
+
*/
|
|
14
18
|
fragment_index_complete: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The filename of the isobmff file
|
|
21
|
+
*/
|
|
15
22
|
filename: string;
|
|
23
|
+
/**
|
|
24
|
+
* The id of the isobmff file
|
|
25
|
+
*/
|
|
16
26
|
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* The md5 hash of the isobmff file
|
|
29
|
+
*/
|
|
17
30
|
md5: string;
|
|
18
31
|
}
|
|
19
32
|
export interface LookupISOBMFFFileByMd5Result {
|
|
33
|
+
/**
|
|
34
|
+
* Whether the fragment index is complete
|
|
35
|
+
*/
|
|
20
36
|
fragment_index_complete: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The filename of the isobmff file
|
|
39
|
+
*/
|
|
21
40
|
filename: string;
|
|
22
41
|
id: string;
|
|
23
42
|
md5: string;
|
|
@@ -29,7 +48,7 @@ export interface GetISOBMFFFileTranscriptionResult {
|
|
|
29
48
|
duration_ms: number;
|
|
30
49
|
};
|
|
31
50
|
}
|
|
32
|
-
export declare const createISOBMFFFile: (client: Client, payload:
|
|
51
|
+
export declare const createISOBMFFFile: (client: Client, payload: CreateISOBMFFFilePayload) => Promise<CreateISOBMFFFileResult>;
|
|
33
52
|
export declare const uploadFragmentIndex: (client: Client, fileId: string, fileStream: ReadableStream, fileSize: number) => Promise<any>;
|
|
34
53
|
export declare const lookupISOBMFFFileByMd5: (client: Client, md5: string) => Promise<LookupISOBMFFFileByMd5Result | null>;
|
|
35
54
|
export declare const getISOBMFFFileTranscription: (client: Client, id: string) => Promise<GetISOBMFFFileTranscriptionResult | null>;
|
|
@@ -40,9 +59,10 @@ export declare const TranscribeISOBMFFFilePayload: z.ZodObject<{
|
|
|
40
59
|
}, {
|
|
41
60
|
trackId?: string | undefined;
|
|
42
61
|
}>;
|
|
62
|
+
export type TranscribeISOBMFFFilePayload = z.infer<typeof TranscribeISOBMFFFilePayload>;
|
|
43
63
|
export interface TranscribeISOBMFFFileResult {
|
|
44
64
|
id: string;
|
|
45
65
|
file_id: string;
|
|
46
66
|
track_id: number;
|
|
47
67
|
}
|
|
48
|
-
export declare const transcribeISOBMFFFile: (client: Client, id: string, payload?:
|
|
68
|
+
export declare const transcribeISOBMFFFile: (client: Client, id: string, payload?: TranscribeISOBMFFFilePayload) => Promise<TranscribeISOBMFFFileResult>;
|
|
@@ -1,5 +1,267 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Client } from '../client.
|
|
2
|
+
import { Client } from '../client.js';
|
|
3
|
+
declare const AudioTrackPayload: z.ZodObject<{
|
|
4
|
+
file_id: z.ZodString;
|
|
5
|
+
track_id: z.ZodNumber;
|
|
6
|
+
type: z.ZodLiteral<"audio">;
|
|
7
|
+
probe_info: z.ZodObject<{
|
|
8
|
+
index: z.ZodNumber;
|
|
9
|
+
codec_name: z.ZodString;
|
|
10
|
+
codec_long_name: z.ZodString;
|
|
11
|
+
codec_type: z.ZodLiteral<"audio">;
|
|
12
|
+
codec_tag_string: z.ZodString;
|
|
13
|
+
codec_tag: z.ZodString;
|
|
14
|
+
sample_fmt: z.ZodString;
|
|
15
|
+
sample_rate: z.ZodString;
|
|
16
|
+
channels: z.ZodNumber;
|
|
17
|
+
channel_layout: z.ZodString;
|
|
18
|
+
bits_per_sample: z.ZodNumber;
|
|
19
|
+
initial_padding: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
r_frame_rate: z.ZodString;
|
|
21
|
+
avg_frame_rate: z.ZodString;
|
|
22
|
+
time_base: z.ZodString;
|
|
23
|
+
start_pts: z.ZodNumber;
|
|
24
|
+
start_time: z.ZodNumber;
|
|
25
|
+
duration_ts: z.ZodNumber;
|
|
26
|
+
duration: z.ZodNumber;
|
|
27
|
+
bit_rate: z.ZodString;
|
|
28
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
index: number;
|
|
31
|
+
codec_name: string;
|
|
32
|
+
codec_long_name: string;
|
|
33
|
+
codec_type: "audio";
|
|
34
|
+
codec_tag_string: string;
|
|
35
|
+
codec_tag: string;
|
|
36
|
+
sample_fmt: string;
|
|
37
|
+
sample_rate: string;
|
|
38
|
+
channels: number;
|
|
39
|
+
channel_layout: string;
|
|
40
|
+
bits_per_sample: number;
|
|
41
|
+
r_frame_rate: string;
|
|
42
|
+
avg_frame_rate: string;
|
|
43
|
+
time_base: string;
|
|
44
|
+
start_pts: number;
|
|
45
|
+
start_time: number;
|
|
46
|
+
duration_ts: number;
|
|
47
|
+
duration: number;
|
|
48
|
+
bit_rate: string;
|
|
49
|
+
disposition: Record<string, unknown>;
|
|
50
|
+
initial_padding?: number | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
index: number;
|
|
53
|
+
codec_name: string;
|
|
54
|
+
codec_long_name: string;
|
|
55
|
+
codec_type: "audio";
|
|
56
|
+
codec_tag_string: string;
|
|
57
|
+
codec_tag: string;
|
|
58
|
+
sample_fmt: string;
|
|
59
|
+
sample_rate: string;
|
|
60
|
+
channels: number;
|
|
61
|
+
channel_layout: string;
|
|
62
|
+
bits_per_sample: number;
|
|
63
|
+
r_frame_rate: string;
|
|
64
|
+
avg_frame_rate: string;
|
|
65
|
+
time_base: string;
|
|
66
|
+
start_pts: number;
|
|
67
|
+
start_time: number;
|
|
68
|
+
duration_ts: number;
|
|
69
|
+
duration: number;
|
|
70
|
+
bit_rate: string;
|
|
71
|
+
disposition: Record<string, unknown>;
|
|
72
|
+
initial_padding?: number | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
duration_ms: z.ZodNumber;
|
|
75
|
+
codec_name: z.ZodString;
|
|
76
|
+
byte_size: z.ZodNumber;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
codec_name: string;
|
|
79
|
+
type: "audio";
|
|
80
|
+
byte_size: number;
|
|
81
|
+
file_id: string;
|
|
82
|
+
track_id: number;
|
|
83
|
+
probe_info: {
|
|
84
|
+
index: number;
|
|
85
|
+
codec_name: string;
|
|
86
|
+
codec_long_name: string;
|
|
87
|
+
codec_type: "audio";
|
|
88
|
+
codec_tag_string: string;
|
|
89
|
+
codec_tag: string;
|
|
90
|
+
sample_fmt: string;
|
|
91
|
+
sample_rate: string;
|
|
92
|
+
channels: number;
|
|
93
|
+
channel_layout: string;
|
|
94
|
+
bits_per_sample: number;
|
|
95
|
+
r_frame_rate: string;
|
|
96
|
+
avg_frame_rate: string;
|
|
97
|
+
time_base: string;
|
|
98
|
+
start_pts: number;
|
|
99
|
+
start_time: number;
|
|
100
|
+
duration_ts: number;
|
|
101
|
+
duration: number;
|
|
102
|
+
bit_rate: string;
|
|
103
|
+
disposition: Record<string, unknown>;
|
|
104
|
+
initial_padding?: number | undefined;
|
|
105
|
+
};
|
|
106
|
+
duration_ms: number;
|
|
107
|
+
}, {
|
|
108
|
+
codec_name: string;
|
|
109
|
+
type: "audio";
|
|
110
|
+
byte_size: number;
|
|
111
|
+
file_id: string;
|
|
112
|
+
track_id: number;
|
|
113
|
+
probe_info: {
|
|
114
|
+
index: number;
|
|
115
|
+
codec_name: string;
|
|
116
|
+
codec_long_name: string;
|
|
117
|
+
codec_type: "audio";
|
|
118
|
+
codec_tag_string: string;
|
|
119
|
+
codec_tag: string;
|
|
120
|
+
sample_fmt: string;
|
|
121
|
+
sample_rate: string;
|
|
122
|
+
channels: number;
|
|
123
|
+
channel_layout: string;
|
|
124
|
+
bits_per_sample: number;
|
|
125
|
+
r_frame_rate: string;
|
|
126
|
+
avg_frame_rate: string;
|
|
127
|
+
time_base: string;
|
|
128
|
+
start_pts: number;
|
|
129
|
+
start_time: number;
|
|
130
|
+
duration_ts: number;
|
|
131
|
+
duration: number;
|
|
132
|
+
bit_rate: string;
|
|
133
|
+
disposition: Record<string, unknown>;
|
|
134
|
+
initial_padding?: number | undefined;
|
|
135
|
+
};
|
|
136
|
+
duration_ms: number;
|
|
137
|
+
}>;
|
|
138
|
+
export type AudioTrackPayload = z.infer<typeof AudioTrackPayload>;
|
|
139
|
+
declare const VideoTrackPayload: z.ZodObject<{
|
|
140
|
+
file_id: z.ZodString;
|
|
141
|
+
track_id: z.ZodNumber;
|
|
142
|
+
type: z.ZodLiteral<"video">;
|
|
143
|
+
probe_info: z.ZodObject<{
|
|
144
|
+
index: z.ZodNumber;
|
|
145
|
+
codec_name: z.ZodString;
|
|
146
|
+
codec_long_name: z.ZodString;
|
|
147
|
+
codec_type: z.ZodLiteral<"video">;
|
|
148
|
+
codec_tag_string: z.ZodString;
|
|
149
|
+
codec_tag: z.ZodString;
|
|
150
|
+
width: z.ZodNumber;
|
|
151
|
+
height: z.ZodNumber;
|
|
152
|
+
coded_width: z.ZodNumber;
|
|
153
|
+
coded_height: z.ZodNumber;
|
|
154
|
+
r_frame_rate: z.ZodString;
|
|
155
|
+
avg_frame_rate: z.ZodString;
|
|
156
|
+
time_base: z.ZodString;
|
|
157
|
+
start_pts: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
start_time: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
duration_ts: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
bit_rate: z.ZodOptional<z.ZodString>;
|
|
162
|
+
disposition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
index: number;
|
|
165
|
+
codec_name: string;
|
|
166
|
+
codec_long_name: string;
|
|
167
|
+
codec_type: "video";
|
|
168
|
+
codec_tag_string: string;
|
|
169
|
+
codec_tag: string;
|
|
170
|
+
r_frame_rate: string;
|
|
171
|
+
avg_frame_rate: string;
|
|
172
|
+
time_base: string;
|
|
173
|
+
disposition: Record<string, unknown>;
|
|
174
|
+
width: number;
|
|
175
|
+
height: number;
|
|
176
|
+
coded_width: number;
|
|
177
|
+
coded_height: number;
|
|
178
|
+
start_pts?: number | undefined;
|
|
179
|
+
start_time?: number | undefined;
|
|
180
|
+
duration_ts?: number | undefined;
|
|
181
|
+
duration?: number | undefined;
|
|
182
|
+
bit_rate?: string | undefined;
|
|
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;
|
|
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>;
|
|
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: {
|
|
242
|
+
index: number;
|
|
243
|
+
codec_name: string;
|
|
244
|
+
codec_long_name: string;
|
|
245
|
+
codec_type: "video";
|
|
246
|
+
codec_tag_string: string;
|
|
247
|
+
codec_tag: string;
|
|
248
|
+
r_frame_rate: string;
|
|
249
|
+
avg_frame_rate: string;
|
|
250
|
+
time_base: string;
|
|
251
|
+
disposition: Record<string, unknown>;
|
|
252
|
+
width: number;
|
|
253
|
+
height: number;
|
|
254
|
+
coded_width: number;
|
|
255
|
+
coded_height: number;
|
|
256
|
+
start_pts?: number | undefined;
|
|
257
|
+
start_time?: number | undefined;
|
|
258
|
+
duration_ts?: number | undefined;
|
|
259
|
+
duration?: number | undefined;
|
|
260
|
+
bit_rate?: string | undefined;
|
|
261
|
+
};
|
|
262
|
+
duration_ms: number;
|
|
263
|
+
}>;
|
|
264
|
+
export type VideoTrackPayload = z.infer<typeof VideoTrackPayload>;
|
|
3
265
|
export declare const CreateISOBMFFTrackPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
4
266
|
file_id: z.ZodString;
|
|
5
267
|
track_id: z.ZodNumber;
|
|
@@ -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;
|