@editframe/api 0.15.0-beta.19 → 0.15.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/index.d.ts +10 -10
- package/dist/index.js +4 -3
- package/dist/node.js +3 -2
- package/dist/resources/image-file.d.ts +1 -0
- package/dist/resources/image-file.js +4 -3
- package/package.json +2 -2
- package/src/resources/image-file.ts +3 -3
- package/types.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { createCaptionFile, CreateCaptionFilePayload,
|
|
2
|
-
export { createImageFile, CreateImageFilePayload,
|
|
3
|
-
export { createISOBMFFFile, CreateISOBMFFFilePayload,
|
|
4
|
-
export { createISOBMFFTrack, CreateISOBMFFTrackPayload,
|
|
5
|
-
export { createRender, CreateRenderPayload, type CreateRenderResult, uploadRender, type LookupRenderByMd5Result, lookupRenderByMd5, getRenderProgress, getRenderInfo, downloadRender, } 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';
|
|
1
|
+
export { createCaptionFile, CreateCaptionFilePayload, lookupCaptionFileByMd5, uploadCaptionFile, type CreateCaptionFileResult, type LookupCaptionFileByMd5Result, } from './resources/caption-file.js';
|
|
2
|
+
export { createImageFile, CreateImageFilePayload, getImageFileMetadata, ImageFileMimeTypes, lookupImageFileByMd5, uploadImageFile, type CreateImageFileResult, type GetImageFileMetadataResult, type LookupImageFileByMd5Result, } from './resources/image-file.js';
|
|
3
|
+
export { createISOBMFFFile, CreateISOBMFFFilePayload, getISOBMFFFileTranscription, lookupISOBMFFFileByMd5, transcribeISOBMFFFile, TranscribeISOBMFFFilePayload, uploadFragmentIndex, type CreateISOBMFFFileResult, type GetISOBMFFFileTranscriptionResult, type LookupISOBMFFFileByMd5Result, type TranscribeISOBMFFFileResult, } from './resources/isobmff-file.js';
|
|
4
|
+
export { AudioTrackPayload, createISOBMFFTrack, CreateISOBMFFTrackPayload, uploadISOBMFFTrack, VideoTrackPayload, type AudioStreamSchema, type CreateISOBMFFTrackResult, type VideoStreamSchema, } from './resources/isobmff-track.js';
|
|
9
5
|
export { getIsobmffProcessInfo, getIsobmffProcessProgress, type IsobmffProcessInfoResult, } from './resources/process-isobmff.js';
|
|
6
|
+
export { createRender, CreateRenderPayload, downloadRender, getRenderInfo, getRenderProgress, lookupRenderByMd5, uploadRender, type CreateRenderResult, type LookupRenderByMd5Result, } from './resources/renders.js';
|
|
7
|
+
export { createTranscription, CreateTranscriptionPayload, getTranscriptionInfo, getTranscriptionProgress, type CreateTranscriptionResult, type TranscriptionInfoResult, } from './resources/transcriptions.js';
|
|
8
|
+
export { createUnprocessedFile, CreateUnprocessedFilePayload, lookupUnprocessedFileByMd5, processIsobmffFile, uploadUnprocessedReadableStream, type CreateUnprocessedFileResult, type LookupUnprocessedFileByMd5Result, type ProcessIsobmffFileResult, type UnprocessedFile, type UnprocessedFileUploadDetails, } from './resources/unprocessed-file.js';
|
|
9
|
+
export { createURLToken, type URLTokenResult, } from './resources/url-token.js';
|
|
10
10
|
export { Client } from './client.js';
|
|
11
|
+
export type { CompletionIterator, ProgressIterator, } from './ProgressIterator.js';
|
|
11
12
|
export type { IteratorWithPromise, UploadChunkEvent } from './uploadChunks.js';
|
|
12
|
-
export type {
|
|
13
|
-
export type { StreamEventSource, ProgressEvent, CompletionEvent, StreamEventSourceEventMap, EventCallback, } from './StreamEventSource.js';
|
|
13
|
+
export type { CompletionEvent, EventCallback, ProgressEvent, StreamEventSource, StreamEventSourceEventMap, } from './StreamEventSource.js';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CreateCaptionFilePayload, createCaptionFile, lookupCaptionFileByMd5, uploadCaptionFile } from "./resources/caption-file.js";
|
|
2
|
-
import { CreateImageFilePayload, createImageFile, getImageFileMetadata, lookupImageFileByMd5, uploadImageFile } from "./resources/image-file.js";
|
|
2
|
+
import { CreateImageFilePayload, ImageFileMimeTypes, createImageFile, getImageFileMetadata, lookupImageFileByMd5, uploadImageFile } from "./resources/image-file.js";
|
|
3
3
|
import { CreateISOBMFFFilePayload, TranscribeISOBMFFFilePayload, createISOBMFFFile, getISOBMFFFileTranscription, lookupISOBMFFFileByMd5, transcribeISOBMFFFile, uploadFragmentIndex } from "./resources/isobmff-file.js";
|
|
4
4
|
import { AudioTrackPayload, CreateISOBMFFTrackPayload, VideoTrackPayload, createISOBMFFTrack, uploadISOBMFFTrack } from "./resources/isobmff-track.js";
|
|
5
|
+
import { getIsobmffProcessInfo, getIsobmffProcessProgress } from "./resources/process-isobmff.js";
|
|
5
6
|
import { CreateRenderPayload, createRender, downloadRender, getRenderInfo, getRenderProgress, lookupRenderByMd5, uploadRender } from "./resources/renders.js";
|
|
6
7
|
import { CreateTranscriptionPayload, createTranscription, getTranscriptionInfo, getTranscriptionProgress } from "./resources/transcriptions.js";
|
|
7
|
-
import { createURLToken } from "./resources/url-token.js";
|
|
8
8
|
import { CreateUnprocessedFilePayload, createUnprocessedFile, lookupUnprocessedFileByMd5, processIsobmffFile, uploadUnprocessedReadableStream } from "./resources/unprocessed-file.js";
|
|
9
|
-
import {
|
|
9
|
+
import { createURLToken } from "./resources/url-token.js";
|
|
10
10
|
import { Client } from "./client.js";
|
|
11
11
|
export {
|
|
12
12
|
AudioTrackPayload,
|
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
CreateRenderPayload,
|
|
19
19
|
CreateTranscriptionPayload,
|
|
20
20
|
CreateUnprocessedFilePayload,
|
|
21
|
+
ImageFileMimeTypes,
|
|
21
22
|
TranscribeISOBMFFFilePayload,
|
|
22
23
|
VideoTrackPayload,
|
|
23
24
|
createCaptionFile,
|
package/dist/node.js
CHANGED
|
@@ -3,17 +3,17 @@ import { basename } from "node:path";
|
|
|
3
3
|
import mime from "mime";
|
|
4
4
|
import { md5FilePath } from "@editframe/assets";
|
|
5
5
|
import { createImageFile, CreateImageFilePayload } from "./resources/image-file.js";
|
|
6
|
-
import { getImageFileMetadata, lookupImageFileByMd5, uploadImageFile } from "./resources/image-file.js";
|
|
6
|
+
import { ImageFileMimeTypes, getImageFileMetadata, lookupImageFileByMd5, uploadImageFile } from "./resources/image-file.js";
|
|
7
7
|
import { createUnprocessedFile, uploadUnprocessedReadableStream } from "./resources/unprocessed-file.js";
|
|
8
8
|
import { CreateUnprocessedFilePayload, lookupUnprocessedFileByMd5, processIsobmffFile } from "./resources/unprocessed-file.js";
|
|
9
9
|
import { createReadableStreamFromReadable } from "./utils/createReadableStreamFromReadable.js";
|
|
10
10
|
import { CreateCaptionFilePayload, createCaptionFile, lookupCaptionFileByMd5, uploadCaptionFile } from "./resources/caption-file.js";
|
|
11
11
|
import { CreateISOBMFFFilePayload, TranscribeISOBMFFFilePayload, createISOBMFFFile, getISOBMFFFileTranscription, lookupISOBMFFFileByMd5, transcribeISOBMFFFile, uploadFragmentIndex } from "./resources/isobmff-file.js";
|
|
12
12
|
import { AudioTrackPayload, CreateISOBMFFTrackPayload, VideoTrackPayload, createISOBMFFTrack, uploadISOBMFFTrack } from "./resources/isobmff-track.js";
|
|
13
|
+
import { getIsobmffProcessInfo, getIsobmffProcessProgress } from "./resources/process-isobmff.js";
|
|
13
14
|
import { CreateRenderPayload, createRender, downloadRender, getRenderInfo, getRenderProgress, lookupRenderByMd5, uploadRender } from "./resources/renders.js";
|
|
14
15
|
import { CreateTranscriptionPayload, createTranscription, getTranscriptionInfo, getTranscriptionProgress } from "./resources/transcriptions.js";
|
|
15
16
|
import { createURLToken } from "./resources/url-token.js";
|
|
16
|
-
import { getIsobmffProcessInfo, getIsobmffProcessProgress } from "./resources/process-isobmff.js";
|
|
17
17
|
import { Client } from "./client.js";
|
|
18
18
|
const createImageFileFromPath = async (client, path) => {
|
|
19
19
|
const fileInfo = await stat(path);
|
|
@@ -61,6 +61,7 @@ export {
|
|
|
61
61
|
CreateRenderPayload,
|
|
62
62
|
CreateTranscriptionPayload,
|
|
63
63
|
CreateUnprocessedFilePayload,
|
|
64
|
+
ImageFileMimeTypes,
|
|
64
65
|
TranscribeISOBMFFFilePayload,
|
|
65
66
|
VideoTrackPayload,
|
|
66
67
|
createCaptionFile,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Client } from '../client.js';
|
|
3
|
+
export declare const ImageFileMimeTypes: z.ZodEnum<["image/jpeg", "image/png", "image/jpg", "image/webp"]>;
|
|
3
4
|
export declare const CreateImageFilePayload: z.ZodEffects<z.ZodObject<{
|
|
4
5
|
/**
|
|
5
6
|
* The md5 hash of the image file.
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
import { uploadChunks } from "../uploadChunks.js";
|
|
5
5
|
const log = debug("ef:api:image-file");
|
|
6
6
|
const MAX_IMAGE_SIZE = 1024 * 1024 * 16;
|
|
7
|
-
const
|
|
7
|
+
const ImageFileMimeTypes = z.enum([
|
|
8
8
|
"image/jpeg",
|
|
9
9
|
"image/png",
|
|
10
10
|
"image/jpg",
|
|
@@ -26,7 +26,7 @@ const CreateImageFilePayload = z.object({
|
|
|
26
26
|
/**
|
|
27
27
|
* The mime type of the image file. Optional if the filename has a known file extension.
|
|
28
28
|
*/
|
|
29
|
-
mime_type:
|
|
29
|
+
mime_type: ImageFileMimeTypes.optional(),
|
|
30
30
|
/**
|
|
31
31
|
* The filename of the image file.
|
|
32
32
|
*/
|
|
@@ -37,7 +37,7 @@ const CreateImageFilePayload = z.object({
|
|
|
37
37
|
byte_size: z.number().int().max(MAX_IMAGE_SIZE)
|
|
38
38
|
}).superRefine((data, ctx) => {
|
|
39
39
|
const mimeType = mime.lookup(data.filename);
|
|
40
|
-
const parsedMimeType =
|
|
40
|
+
const parsedMimeType = ImageFileMimeTypes.safeParse(mimeType).data;
|
|
41
41
|
if (parsedMimeType) {
|
|
42
42
|
data.mime_type = parsedMimeType;
|
|
43
43
|
}
|
|
@@ -106,6 +106,7 @@ const lookupImageFileByMd5 = async (client, md5) => {
|
|
|
106
106
|
};
|
|
107
107
|
export {
|
|
108
108
|
CreateImageFilePayload,
|
|
109
|
+
ImageFileMimeTypes,
|
|
109
110
|
createImageFile,
|
|
110
111
|
getImageFileMetadata,
|
|
111
112
|
lookupImageFileByMd5,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/api",
|
|
3
|
-
"version": "0.15.0-beta.
|
|
3
|
+
"version": "0.15.0-beta.20",
|
|
4
4
|
"description": "API functions for EditFrame",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vite-plugin-dts": "^4.0.3"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@editframe/assets": "0.15.0-beta.
|
|
48
|
+
"@editframe/assets": "0.15.0-beta.20",
|
|
49
49
|
"@vitejs/plugin-react": "^4.3.4",
|
|
50
50
|
"debug": "^4.3.5",
|
|
51
51
|
"eventsource-parser": "^3.0.0",
|
|
@@ -9,7 +9,7 @@ const log = debug("ef:api:image-file");
|
|
|
9
9
|
|
|
10
10
|
const MAX_IMAGE_SIZE = 1024 * 1024 * 16; // 16MB
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
export const ImageFileMimeTypes = z.enum([
|
|
13
13
|
"image/jpeg",
|
|
14
14
|
"image/png",
|
|
15
15
|
"image/jpg",
|
|
@@ -33,7 +33,7 @@ export const CreateImageFilePayload = z
|
|
|
33
33
|
/**
|
|
34
34
|
* The mime type of the image file. Optional if the filename has a known file extension.
|
|
35
35
|
*/
|
|
36
|
-
mime_type:
|
|
36
|
+
mime_type: ImageFileMimeTypes.optional(),
|
|
37
37
|
/**
|
|
38
38
|
* The filename of the image file.
|
|
39
39
|
*/
|
|
@@ -45,7 +45,7 @@ export const CreateImageFilePayload = z
|
|
|
45
45
|
})
|
|
46
46
|
.superRefine((data, ctx) => {
|
|
47
47
|
const mimeType = mime.lookup(data.filename);
|
|
48
|
-
const parsedMimeType =
|
|
48
|
+
const parsedMimeType = ImageFileMimeTypes.safeParse(mimeType).data;
|
|
49
49
|
|
|
50
50
|
if (parsedMimeType) {
|
|
51
51
|
data.mime_type = parsedMimeType;
|