@editframe/api 0.7.0-beta.5 → 0.7.0-beta.8
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/client.cjs +1 -0
- package/dist/client.js +1 -0
- package/dist/resources/caption-file.cjs +1 -2
- package/dist/resources/caption-file.js +1 -2
- package/dist/resources/image-file.cjs +1 -2
- package/dist/resources/image-file.js +1 -2
- package/dist/resources/isobmff-file.cjs +1 -2
- package/dist/resources/isobmff-file.js +1 -2
- package/dist/resources/isobmff-track.cjs +1 -2
- package/dist/resources/isobmff-track.js +1 -2
- package/dist/resources/renders.cjs +1 -2
- package/dist/resources/renders.js +1 -2
- package/package.json +2 -2
- package/src/resources/caption-file.ts +1 -2
- package/src/resources/image-file.ts +1 -2
- package/src/resources/isobmff-file.ts +1 -2
- package/src/resources/isobmff-track.ts +1 -2
- package/src/resources/renders.ts +1 -2
- package/src/util/nodeStreamToWebStream.ts +1 -1
- package/dist/util/nodeStreamToWebStream.cjs +0 -21
- package/dist/util/nodeStreamToWebStream.js +0 -21
package/dist/client.cjs
CHANGED
package/dist/client.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const zod = require("zod");
|
|
4
4
|
const debug = require("debug");
|
|
5
|
-
const nodeStreamToWebStream = require("../util/nodeStreamToWebStream.cjs");
|
|
6
5
|
const log = debug("ef:api:caption-file");
|
|
7
6
|
const CreateCaptionFilePayload = zod.z.object({
|
|
8
7
|
id: zod.z.string(),
|
|
@@ -36,7 +35,7 @@ const uploadCaptionFile = async (client, fileId, fileStream) => {
|
|
|
36
35
|
`/api/video2/caption_files/${fileId}/upload`,
|
|
37
36
|
{
|
|
38
37
|
method: "POST",
|
|
39
|
-
body:
|
|
38
|
+
body: fileStream
|
|
40
39
|
}
|
|
41
40
|
);
|
|
42
41
|
log("Caption file uploaded", fileIndex);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream.js";
|
|
4
3
|
const log = debug("ef:api:caption-file");
|
|
5
4
|
const CreateCaptionFilePayload = z.object({
|
|
6
5
|
id: z.string(),
|
|
@@ -34,7 +33,7 @@ const uploadCaptionFile = async (client, fileId, fileStream) => {
|
|
|
34
33
|
`/api/video2/caption_files/${fileId}/upload`,
|
|
35
34
|
{
|
|
36
35
|
method: "POST",
|
|
37
|
-
body:
|
|
36
|
+
body: fileStream
|
|
38
37
|
}
|
|
39
38
|
);
|
|
40
39
|
log("Caption file uploaded", fileIndex);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const zod = require("zod");
|
|
4
4
|
const debug = require("debug");
|
|
5
|
-
const nodeStreamToWebStream = require("../util/nodeStreamToWebStream.cjs");
|
|
6
5
|
const log = debug("ef:api:image-file");
|
|
7
6
|
const CreateImageFilePayload = zod.z.object({
|
|
8
7
|
id: zod.z.string(),
|
|
@@ -35,7 +34,7 @@ const uploadImageFile = async (client, fileId, fileStream) => {
|
|
|
35
34
|
`/api/video2/image_files/${fileId}/upload`,
|
|
36
35
|
{
|
|
37
36
|
method: "POST",
|
|
38
|
-
body:
|
|
37
|
+
body: fileStream
|
|
39
38
|
}
|
|
40
39
|
);
|
|
41
40
|
switch (fileIndex.status) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream.js";
|
|
4
3
|
const log = debug("ef:api:image-file");
|
|
5
4
|
const CreateImageFilePayload = z.object({
|
|
6
5
|
id: z.string(),
|
|
@@ -33,7 +32,7 @@ const uploadImageFile = async (client, fileId, fileStream) => {
|
|
|
33
32
|
`/api/video2/image_files/${fileId}/upload`,
|
|
34
33
|
{
|
|
35
34
|
method: "POST",
|
|
36
|
-
body:
|
|
35
|
+
body: fileStream
|
|
37
36
|
}
|
|
38
37
|
);
|
|
39
38
|
switch (fileIndex.status) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const zod = require("zod");
|
|
4
4
|
const debug = require("debug");
|
|
5
|
-
const nodeStreamToWebStream = require("../util/nodeStreamToWebStream.cjs");
|
|
6
5
|
const log = debug("ef:api:isobmff-file");
|
|
7
6
|
const CreateISOBMFFFilePayload = zod.z.object({
|
|
8
7
|
id: zod.z.string(),
|
|
@@ -36,7 +35,7 @@ const uploadFragmentIndex = async (client, fileId, fileStream) => {
|
|
|
36
35
|
`/api/video2/isobmff_files/${fileId}/index/upload`,
|
|
37
36
|
{
|
|
38
37
|
method: "POST",
|
|
39
|
-
body:
|
|
38
|
+
body: fileStream
|
|
40
39
|
}
|
|
41
40
|
);
|
|
42
41
|
log("Fragment index uploaded", fileIndex);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream.js";
|
|
4
3
|
const log = debug("ef:api:isobmff-file");
|
|
5
4
|
const CreateISOBMFFFilePayload = z.object({
|
|
6
5
|
id: z.string(),
|
|
@@ -34,7 +33,7 @@ const uploadFragmentIndex = async (client, fileId, fileStream) => {
|
|
|
34
33
|
`/api/video2/isobmff_files/${fileId}/index/upload`,
|
|
35
34
|
{
|
|
36
35
|
method: "POST",
|
|
37
|
-
body:
|
|
36
|
+
body: fileStream
|
|
38
37
|
}
|
|
39
38
|
);
|
|
40
39
|
log("Fragment index uploaded", fileIndex);
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const zod = require("zod");
|
|
4
4
|
const debug = require("debug");
|
|
5
5
|
const assets = require("@editframe/assets");
|
|
6
|
-
const nodeStreamToWebStream = require("../util/nodeStreamToWebStream.cjs");
|
|
7
6
|
const log = debug("ef:api:isobmff-track");
|
|
8
7
|
const CreateISOBMFFTrackPayload = zod.z.discriminatedUnion("type", [
|
|
9
8
|
zod.z.object({
|
|
@@ -52,7 +51,7 @@ const uploadISOBMFFTrack = async (client, fileId, trackId, fileStream) => {
|
|
|
52
51
|
`/api/video2/isobmff_tracks/${fileId}/${trackId}/upload`,
|
|
53
52
|
{
|
|
54
53
|
method: "POST",
|
|
55
|
-
body:
|
|
54
|
+
body: fileStream
|
|
56
55
|
}
|
|
57
56
|
);
|
|
58
57
|
log("ISOBMFF track uploaded", trackIndex);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import debug from "debug";
|
|
3
3
|
import { AudioStreamSchema, VideoStreamSchema } from "@editframe/assets";
|
|
4
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream.js";
|
|
5
4
|
const log = debug("ef:api:isobmff-track");
|
|
6
5
|
const CreateISOBMFFTrackPayload = z.discriminatedUnion("type", [
|
|
7
6
|
z.object({
|
|
@@ -50,7 +49,7 @@ const uploadISOBMFFTrack = async (client, fileId, trackId, fileStream) => {
|
|
|
50
49
|
`/api/video2/isobmff_tracks/${fileId}/${trackId}/upload`,
|
|
51
50
|
{
|
|
52
51
|
method: "POST",
|
|
53
|
-
body:
|
|
52
|
+
body: fileStream
|
|
54
53
|
}
|
|
55
54
|
);
|
|
56
55
|
log("ISOBMFF track uploaded", trackIndex);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const zod = require("zod");
|
|
4
4
|
const debug = require("debug");
|
|
5
|
-
const nodeStreamToWebStream = require("../util/nodeStreamToWebStream.cjs");
|
|
6
5
|
const log = debug("ef:api:renders");
|
|
7
6
|
const CreateRenderPayload = zod.z.object({
|
|
8
7
|
id: zod.z.string().uuid(),
|
|
@@ -37,7 +36,7 @@ const uploadRender = async (client, fileId, fileStream) => {
|
|
|
37
36
|
`/api/video2/renders/${fileId}/upload`,
|
|
38
37
|
{
|
|
39
38
|
method: "POST",
|
|
40
|
-
body:
|
|
39
|
+
body: fileStream
|
|
41
40
|
}
|
|
42
41
|
);
|
|
43
42
|
log("Render uploaded", fileIndex);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import debug from "debug";
|
|
3
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream.js";
|
|
4
3
|
const log = debug("ef:api:renders");
|
|
5
4
|
const CreateRenderPayload = z.object({
|
|
6
5
|
id: z.string().uuid(),
|
|
@@ -35,7 +34,7 @@ const uploadRender = async (client, fileId, fileStream) => {
|
|
|
35
34
|
`/api/video2/renders/${fileId}/upload`,
|
|
36
35
|
{
|
|
37
36
|
method: "POST",
|
|
38
|
-
body:
|
|
37
|
+
body: fileStream
|
|
39
38
|
}
|
|
40
39
|
);
|
|
41
40
|
log("Render uploaded", fileIndex);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/api",
|
|
3
|
-
"version": "0.7.0-beta.
|
|
3
|
+
"version": "0.7.0-beta.8",
|
|
4
4
|
"description": "API functions for EditFrame",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite-tsconfig-paths": "^4.3.2"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@editframe/assets": "0.7.0-beta.
|
|
33
|
+
"@editframe/assets": "0.7.0-beta.8",
|
|
34
34
|
"debug": "^4.3.5",
|
|
35
35
|
"zod": "^3.23.8"
|
|
36
36
|
}
|
|
@@ -4,7 +4,6 @@ import { z } from "zod";
|
|
|
4
4
|
import debug from "debug";
|
|
5
5
|
|
|
6
6
|
import type { Client } from "../client";
|
|
7
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream";
|
|
8
7
|
|
|
9
8
|
const log = debug("ef:api:caption-file");
|
|
10
9
|
|
|
@@ -55,7 +54,7 @@ export const uploadCaptionFile = async (
|
|
|
55
54
|
`/api/video2/caption_files/${fileId}/upload`,
|
|
56
55
|
{
|
|
57
56
|
method: "POST",
|
|
58
|
-
body:
|
|
57
|
+
body: fileStream,
|
|
59
58
|
},
|
|
60
59
|
);
|
|
61
60
|
log("Caption file uploaded", fileIndex);
|
|
@@ -4,7 +4,6 @@ import { z } from "zod";
|
|
|
4
4
|
import debug from "debug";
|
|
5
5
|
|
|
6
6
|
import type { Client } from "../client";
|
|
7
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream";
|
|
8
7
|
|
|
9
8
|
const log = debug("ef:api:image-file");
|
|
10
9
|
|
|
@@ -54,7 +53,7 @@ export const uploadImageFile = async (
|
|
|
54
53
|
`/api/video2/image_files/${fileId}/upload`,
|
|
55
54
|
{
|
|
56
55
|
method: "POST",
|
|
57
|
-
body:
|
|
56
|
+
body: fileStream,
|
|
58
57
|
},
|
|
59
58
|
);
|
|
60
59
|
switch (fileIndex.status) {
|
|
@@ -4,7 +4,6 @@ import { z } from "zod";
|
|
|
4
4
|
import debug from "debug";
|
|
5
5
|
|
|
6
6
|
import type { Client } from "../client";
|
|
7
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream";
|
|
8
7
|
|
|
9
8
|
const log = debug("ef:api:isobmff-file");
|
|
10
9
|
|
|
@@ -56,7 +55,7 @@ export const uploadFragmentIndex = async (
|
|
|
56
55
|
`/api/video2/isobmff_files/${fileId}/index/upload`,
|
|
57
56
|
{
|
|
58
57
|
method: "POST",
|
|
59
|
-
body:
|
|
58
|
+
body: fileStream,
|
|
60
59
|
},
|
|
61
60
|
);
|
|
62
61
|
|
|
@@ -6,7 +6,6 @@ import debug from "debug";
|
|
|
6
6
|
import { AudioStreamSchema, VideoStreamSchema } from "@editframe/assets";
|
|
7
7
|
|
|
8
8
|
import type { Client } from "../client";
|
|
9
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream";
|
|
10
9
|
|
|
11
10
|
const log = debug("ef:api:isobmff-track");
|
|
12
11
|
|
|
@@ -75,7 +74,7 @@ export const uploadISOBMFFTrack = async (
|
|
|
75
74
|
`/api/video2/isobmff_tracks/${fileId}/${trackId}/upload`,
|
|
76
75
|
{
|
|
77
76
|
method: "POST",
|
|
78
|
-
body:
|
|
77
|
+
body: fileStream,
|
|
79
78
|
},
|
|
80
79
|
);
|
|
81
80
|
|
package/src/resources/renders.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { z } from "zod";
|
|
|
4
4
|
import debug from "debug";
|
|
5
5
|
|
|
6
6
|
import type { Client } from "../client";
|
|
7
|
-
import { nodeStreamToWebStream } from "../util/nodeStreamToWebStream";
|
|
8
7
|
|
|
9
8
|
const log = debug("ef:api:renders");
|
|
10
9
|
|
|
@@ -56,7 +55,7 @@ export const uploadRender = async (
|
|
|
56
55
|
`/api/video2/renders/${fileId}/upload`,
|
|
57
56
|
{
|
|
58
57
|
method: "POST",
|
|
59
|
-
body:
|
|
58
|
+
body: fileStream,
|
|
60
59
|
},
|
|
61
60
|
);
|
|
62
61
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Readable } from "node:stream";
|
|
2
2
|
|
|
3
|
-
export const nodeStreamToWebStream = (nodeStream: Readable):
|
|
3
|
+
export const nodeStreamToWebStream = (nodeStream: Readable): BodyInit => {
|
|
4
4
|
return new ReadableStream({
|
|
5
5
|
start(controller) {
|
|
6
6
|
nodeStream.on("data", (chunk) => {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const nodeStreamToWebStream = (nodeStream) => {
|
|
4
|
-
return new ReadableStream({
|
|
5
|
-
start(controller) {
|
|
6
|
-
nodeStream.on("data", (chunk) => {
|
|
7
|
-
controller.enqueue(chunk);
|
|
8
|
-
});
|
|
9
|
-
nodeStream.on("end", () => {
|
|
10
|
-
controller.close();
|
|
11
|
-
});
|
|
12
|
-
nodeStream.on("error", (err) => {
|
|
13
|
-
controller.error(err);
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
cancel() {
|
|
17
|
-
nodeStream.destroy();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
exports.nodeStreamToWebStream = nodeStreamToWebStream;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const nodeStreamToWebStream = (nodeStream) => {
|
|
2
|
-
return new ReadableStream({
|
|
3
|
-
start(controller) {
|
|
4
|
-
nodeStream.on("data", (chunk) => {
|
|
5
|
-
controller.enqueue(chunk);
|
|
6
|
-
});
|
|
7
|
-
nodeStream.on("end", () => {
|
|
8
|
-
controller.close();
|
|
9
|
-
});
|
|
10
|
-
nodeStream.on("error", (err) => {
|
|
11
|
-
controller.error(err);
|
|
12
|
-
});
|
|
13
|
-
},
|
|
14
|
-
cancel() {
|
|
15
|
-
nodeStream.destroy();
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
nodeStreamToWebStream
|
|
21
|
-
};
|