@uploadista/flow-videos-nodes 0.0.20-beta.9 → 0.1.0-beta.5
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/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-check.log +6 -0
- package/.turbo/turbo-test.log +150 -0
- package/README.md +4 -5
- package/dist/index.d.cts +39 -39
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/resize-node.ts +2 -1
- package/src/thumbnail-node.ts +5 -1
- package/src/transcode-node.ts +6 -2
- package/tests/video-nodes.test.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @uploadista/flow-videos-nodes@0.0
|
|
3
|
+
> @uploadista/flow-videos-nodes@0.1.0-beta.4 build /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes
|
|
4
4
|
> tsc --noEmit && tsdown
|
|
5
5
|
|
|
6
|
-
[34mℹ[39m tsdown [2mv0.
|
|
6
|
+
[34mℹ[39m tsdown [2mv0.19.0[22m powered by rolldown [2mv1.0.0-beta.59[22m
|
|
7
7
|
[34mℹ[39m config file: [4m/Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes/tsdown.config.ts[24m
|
|
8
8
|
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
9
9
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.cjs[22m [2m5.29 kB[22m [2m│ gzip: 1.60 kB[22m
|
|
13
13
|
[34mℹ[39m [33m[CJS][39m 1 files, total: 5.29 kB
|
|
14
14
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.mjs[22m [2m 4.91 kB[22m [2m│ gzip: 1.62 kB[22m
|
|
15
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22mindex.mjs.map [2m26.
|
|
15
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mindex.mjs.map [2m26.39 kB[22m [2m│ gzip: 5.07 kB[22m
|
|
16
16
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22mindex.d.mts.map [2m 2.51 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
17
17
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m13.70 kB[22m [2m│ gzip: 2.07 kB[22m
|
|
18
|
-
[34mℹ[39m [34m[ESM][39m 4 files, total:
|
|
19
|
-
[32m✔[39m Build complete in [
|
|
18
|
+
[34mℹ[39m [34m[ESM][39m 4 files, total: 47.51 kB
|
|
19
|
+
[32m✔[39m Build complete in [32m5066ms[39m
|
|
20
20
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22mindex.d.cts.map [2m 2.51 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
21
21
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m13.70 kB[22m [2m│ gzip: 2.07 kB[22m
|
|
22
22
|
[34mℹ[39m [33m[CJS][39m 2 files, total: 16.21 kB
|
|
23
|
-
[32m✔[39m Build complete in [
|
|
23
|
+
[32m✔[39m Build complete in [32m5067ms[39m
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @uploadista/flow-videos-nodes@0.1.0-beta.2 check /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes
|
|
4
|
+
> biome check --write ./src
|
|
5
|
+
|
|
6
|
+
[0m[34mChecked [0m[0m[34m6[0m[0m[34m [0m[0m[34mfiles[0m[0m[34m in [0m[0m[34m251[0m[0m[2m[34mms[0m[0m[34m.[0m[0m[34m No fixes applied.[0m
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @uploadista/flow-videos-nodes@0.1.0-beta.2 test /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes
|
|
4
|
+
> vitest run
|
|
5
|
+
|
|
6
|
+
[?25l
|
|
7
|
+
[1m[46m RUN [49m[22m [36mv4.0.17 [39m[90m/Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes[39m
|
|
8
|
+
|
|
9
|
+
[?2026h
|
|
10
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
11
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
12
|
+
[2m Start at [22m16:51:02
|
|
13
|
+
[2m Duration [22m924ms
|
|
14
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
15
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m [queued][22m
|
|
16
|
+
|
|
17
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
18
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
19
|
+
[2m Start at [22m16:51:02
|
|
20
|
+
[2m Duration [22m1.33s
|
|
21
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
22
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m [queued][22m
|
|
23
|
+
|
|
24
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
25
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
26
|
+
[2m Start at [22m16:51:02
|
|
27
|
+
[2m Duration [22m1.93s
|
|
28
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
29
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m [queued][22m
|
|
30
|
+
|
|
31
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
32
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
33
|
+
[2m Start at [22m16:51:02
|
|
34
|
+
[2m Duration [22m2.90s
|
|
35
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
36
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m [queued][22m
|
|
37
|
+
|
|
38
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
39
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
40
|
+
[2m Start at [22m16:51:02
|
|
41
|
+
[2m Duration [22m3.91s
|
|
42
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
43
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m [queued][22m
|
|
44
|
+
|
|
45
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
46
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
47
|
+
[2m Start at [22m16:51:02
|
|
48
|
+
[2m Duration [22m4.93s
|
|
49
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
50
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m [queued][22m
|
|
51
|
+
|
|
52
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
53
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (0)[39m
|
|
54
|
+
[2m Start at [22m16:51:02
|
|
55
|
+
[2m Duration [22m5.95s
|
|
56
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
57
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 0/17[22m
|
|
58
|
+
|
|
59
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
60
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (17)[39m
|
|
61
|
+
[2m Start at [22m16:51:02
|
|
62
|
+
[2m Duration [22m6.36s
|
|
63
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
64
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 0/17[22m
|
|
65
|
+
|
|
66
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
67
|
+
[2m Tests [22m[1m[32m0 passed[39m[22m[90m (17)[39m
|
|
68
|
+
[2m Start at [22m16:51:02
|
|
69
|
+
[2m Duration [22m6.96s
|
|
70
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
71
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 2/17[22m
|
|
72
|
+
|
|
73
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
74
|
+
[2m Tests [22m[1m[32m2 passed[39m[22m[90m (17)[39m
|
|
75
|
+
[2m Start at [22m16:51:02
|
|
76
|
+
[2m Duration [22m7.17s
|
|
77
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
78
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 5/17[22m
|
|
79
|
+
|
|
80
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
81
|
+
[2m Tests [22m[1m[32m5 passed[39m[22m[90m (17)[39m
|
|
82
|
+
[2m Start at [22m16:51:02
|
|
83
|
+
[2m Duration [22m7.57s
|
|
84
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
85
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 6/17[22m
|
|
86
|
+
|
|
87
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
88
|
+
[2m Tests [22m[1m[32m6 passed[39m[22m[90m (17)[39m
|
|
89
|
+
[2m Start at [22m16:51:02
|
|
90
|
+
[2m Duration [22m7.67s
|
|
91
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
92
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 7/17[22m
|
|
93
|
+
|
|
94
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
95
|
+
[2m Tests [22m[1m[32m7 passed[39m[22m[90m (17)[39m
|
|
96
|
+
[2m Start at [22m16:51:02
|
|
97
|
+
[2m Duration [22m7.77s
|
|
98
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
99
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 10/17[22m
|
|
100
|
+
|
|
101
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
102
|
+
[2m Tests [22m[1m[32m10 passed[39m[22m[90m (17)[39m
|
|
103
|
+
[2m Start at [22m16:51:02
|
|
104
|
+
[2m Duration [22m7.97s
|
|
105
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
106
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 11/17[22m
|
|
107
|
+
|
|
108
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
109
|
+
[2m Tests [22m[1m[32m11 passed[39m[22m[90m (17)[39m
|
|
110
|
+
[2m Start at [22m16:51:02
|
|
111
|
+
[2m Duration [22m8.07s
|
|
112
|
+
[?2026l[?2026h[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K
|
|
113
|
+
[1m[33m ❯ [39m[22mtests/video-nodes.test.ts[2m 16/17[22m
|
|
114
|
+
|
|
115
|
+
[2m Test Files [22m[1m[32m0 passed[39m[22m[90m (1)[39m
|
|
116
|
+
[2m Tests [22m[1m[32m16 passed[39m[22m[90m (17)[39m
|
|
117
|
+
[2m Start at [22m16:51:02
|
|
118
|
+
[2m Duration [22m8.17s
|
|
119
|
+
[?2026l[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K[1A[K [32m✓[39m tests/video-nodes.test.ts [2m([22m[2m17 tests[22m[2m)[22m[33m 1830[2mms[22m[39m
|
|
120
|
+
[32m✓[39m Video Flow Nodes [2m(17)[22m
|
|
121
|
+
[32m✓[39m DescribeVideoNode [2m(2)[22m
|
|
122
|
+
[33m[2m✓[22m[39m should execute without errors [33m 561[2mms[22m[39m
|
|
123
|
+
[32m✓[39m should pass through original video bytes[32m 85[2mms[22m[39m
|
|
124
|
+
[32m✓[39m TranscodeVideoNode [2m(3)[22m
|
|
125
|
+
[32m✓[39m should transcode video to WebM[32m 8[2mms[22m[39m
|
|
126
|
+
[32m✓[39m should transcode video to MOV[32m 71[2mms[22m[39m
|
|
127
|
+
[33m[2m✓[22m[39m should transcode video to AVI [33m 396[2mms[22m[39m
|
|
128
|
+
[32m✓[39m ResizeVideoNode [2m(3)[22m
|
|
129
|
+
[32m✓[39m should resize video to 720p[32m 139[2mms[22m[39m
|
|
130
|
+
[32m✓[39m should resize video to 1080p[32m 5[2mms[22m[39m
|
|
131
|
+
[32m✓[39m should resize video with only width specified[32m 4[2mms[22m[39m
|
|
132
|
+
[32m✓[39m ThumbnailNode [2m(3)[22m
|
|
133
|
+
[32m✓[39m should extract frame as JPEG thumbnail[32m 99[2mms[22m[39m
|
|
134
|
+
[32m✓[39m should extract frame as PNG thumbnail[32m 156[2mms[22m[39m
|
|
135
|
+
[32m✓[39m should default to JPEG format[32m 31[2mms[22m[39m
|
|
136
|
+
[32m✓[39m TrimVideoNode [2m(3)[22m
|
|
137
|
+
[32m✓[39m should trim video with endTime[32m 12[2mms[22m[39m
|
|
138
|
+
[32m✓[39m should trim video with duration[32m 9[2mms[22m[39m
|
|
139
|
+
[32m✓[39m should trim from start to end of video[32m 42[2mms[22m[39m
|
|
140
|
+
[32m✓[39m Video transformation chains [2m(3)[22m
|
|
141
|
+
[32m✓[39m should chain transcode and resize operations[32m 43[2mms[22m[39m
|
|
142
|
+
[32m✓[39m should chain trim and thumbnail operations[32m 146[2mms[22m[39m
|
|
143
|
+
[32m✓[39m should handle describe followed by transcode[32m 11[2mms[22m[39m
|
|
144
|
+
|
|
145
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
146
|
+
[2m Tests [22m [1m[32m17 passed[39m[22m[90m (17)[39m
|
|
147
|
+
[2m Start at [22m 16:51:02
|
|
148
|
+
[2m Duration [22m 8.35s[2m (transform 1.20s, setup 0ms, import 5.09s, tests 1.83s, environment 0ms)[22m
|
|
149
|
+
|
|
150
|
+
[?25h
|
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@ Video processing nodes for Uploadista flows. Transcode, resize, trim, and extrac
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @uploadista/flow-videos-nodes @uploadista/flow-videos-
|
|
8
|
+
npm install @uploadista/flow-videos-nodes @uploadista/flow-videos-av-node
|
|
9
9
|
# or
|
|
10
|
-
pnpm add @uploadista/flow-videos-nodes @uploadista/flow-videos-
|
|
10
|
+
pnpm add @uploadista/flow-videos-nodes @uploadista/flow-videos-av-node
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
@@ -208,9 +208,8 @@ All video transform nodes support three processing modes:
|
|
|
208
208
|
|
|
209
209
|
## Requirements
|
|
210
210
|
|
|
211
|
-
- Node.js environment
|
|
212
|
-
-
|
|
213
|
-
- See [@uploadista/flow-videos-ffmpeg](../ffmpeg/README.md) for installation instructions
|
|
211
|
+
- Node.js environment
|
|
212
|
+
- See [@uploadista/flow-videos-av-node](../av-node/README.md) for video processing plugin setup (includes bundled FFmpeg)
|
|
214
213
|
|
|
215
214
|
## License
|
|
216
215
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _uploadista_core_flow3 from "@uploadista/core/flow";
|
|
2
2
|
import { DescribeVideoMetadata, ExtractFrameVideoParams, ExtractFrameVideoParams as ExtractFrameVideoParams$1, FileNamingConfig, ResizeVideoParams, ResizeVideoParams as ResizeVideoParams$1, StreamingConfig, TranscodeVideoParams, TranscodeVideoParams as TranscodeVideoParams$1, TransformMode, TrimVideoParams, TrimVideoParams as TrimVideoParams$1, VideoPlugin } from "@uploadista/core/flow";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
3
|
+
import * as _uploadista_core_types5 from "@uploadista/core/types";
|
|
4
|
+
import * as zod_v4_core1 from "zod/v4/core";
|
|
5
|
+
import * as zod1 from "zod";
|
|
6
6
|
import * as _uploadista_core_errors0 from "@uploadista/core/errors";
|
|
7
7
|
import { UploadistaError } from "@uploadista/core/errors";
|
|
8
8
|
import * as _uploadista_core_upload0 from "@uploadista/core/upload";
|
|
@@ -27,17 +27,17 @@ import { Effect } from "effect";
|
|
|
27
27
|
*/
|
|
28
28
|
declare function createDescribeVideoNode(id: string, options?: {
|
|
29
29
|
keepOutput?: boolean;
|
|
30
|
-
}): Effect.Effect<
|
|
31
|
-
inputSchema:
|
|
32
|
-
outputSchema:
|
|
30
|
+
}): Effect.Effect<_uploadista_core_flow3.FlowNodeData & {
|
|
31
|
+
inputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
32
|
+
outputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
33
33
|
run: (args: {
|
|
34
|
-
data:
|
|
34
|
+
data: _uploadista_core_types5.UploadFile;
|
|
35
35
|
jobId: string;
|
|
36
36
|
storageId: string;
|
|
37
37
|
flowId: string;
|
|
38
38
|
inputs?: Record<string, unknown>;
|
|
39
39
|
clientId: string | null;
|
|
40
|
-
}) => Effect.Effect<
|
|
40
|
+
}) => Effect.Effect<_uploadista_core_flow3.NodeExecutionResult<_uploadista_core_types5.UploadFile>, _uploadista_core_errors0.UploadistaError, never>;
|
|
41
41
|
condition?: {
|
|
42
42
|
field: string;
|
|
43
43
|
operator: string;
|
|
@@ -51,9 +51,9 @@ declare function createDescribeVideoNode(id: string, options?: {
|
|
|
51
51
|
retryDelay?: number;
|
|
52
52
|
exponentialBackoff?: boolean;
|
|
53
53
|
};
|
|
54
|
-
circuitBreaker?:
|
|
54
|
+
circuitBreaker?: _uploadista_core_flow3.FlowCircuitBreakerConfig;
|
|
55
55
|
} & {
|
|
56
|
-
type:
|
|
56
|
+
type: _uploadista_core_flow3.NodeType;
|
|
57
57
|
}, _uploadista_core_errors0.UploadistaError, VideoPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/resize-node.d.ts
|
|
@@ -110,17 +110,17 @@ declare function createVideoResizeNode(id: string, params: ResizeVideoParams$1,
|
|
|
110
110
|
naming?: FileNamingConfig;
|
|
111
111
|
mode?: TransformMode;
|
|
112
112
|
streamingConfig?: StreamingConfig;
|
|
113
|
-
}): Effect.Effect<
|
|
114
|
-
inputSchema:
|
|
115
|
-
outputSchema:
|
|
113
|
+
}): Effect.Effect<_uploadista_core_flow3.FlowNodeData & {
|
|
114
|
+
inputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
115
|
+
outputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
116
116
|
run: (args: {
|
|
117
|
-
data:
|
|
117
|
+
data: _uploadista_core_types5.UploadFile;
|
|
118
118
|
jobId: string;
|
|
119
119
|
storageId: string;
|
|
120
120
|
flowId: string;
|
|
121
121
|
inputs?: Record<string, unknown>;
|
|
122
122
|
clientId: string | null;
|
|
123
|
-
}) => Effect.Effect<
|
|
123
|
+
}) => Effect.Effect<_uploadista_core_flow3.NodeExecutionResult<_uploadista_core_types5.UploadFile>, _uploadista_core_errors0.UploadistaError, never>;
|
|
124
124
|
condition?: {
|
|
125
125
|
field: string;
|
|
126
126
|
operator: string;
|
|
@@ -134,9 +134,9 @@ declare function createVideoResizeNode(id: string, params: ResizeVideoParams$1,
|
|
|
134
134
|
retryDelay?: number;
|
|
135
135
|
exponentialBackoff?: boolean;
|
|
136
136
|
};
|
|
137
|
-
circuitBreaker?:
|
|
137
|
+
circuitBreaker?: _uploadista_core_flow3.FlowCircuitBreakerConfig;
|
|
138
138
|
} & {
|
|
139
|
-
type:
|
|
139
|
+
type: _uploadista_core_flow3.NodeType;
|
|
140
140
|
}, _uploadista_core_errors0.UploadistaError, VideoPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region src/thumbnail-node.d.ts
|
|
@@ -166,17 +166,17 @@ declare function createVideoResizeNode(id: string, params: ResizeVideoParams$1,
|
|
|
166
166
|
declare function createVideoThumbnailNode(id: string, params: ExtractFrameVideoParams$1, options?: {
|
|
167
167
|
keepOutput?: boolean;
|
|
168
168
|
naming?: FileNamingConfig;
|
|
169
|
-
}): Effect.Effect<
|
|
170
|
-
inputSchema:
|
|
171
|
-
outputSchema:
|
|
169
|
+
}): Effect.Effect<_uploadista_core_flow3.FlowNodeData & {
|
|
170
|
+
inputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
171
|
+
outputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
172
172
|
run: (args: {
|
|
173
|
-
data:
|
|
173
|
+
data: _uploadista_core_types5.UploadFile;
|
|
174
174
|
jobId: string;
|
|
175
175
|
storageId: string;
|
|
176
176
|
flowId: string;
|
|
177
177
|
inputs?: Record<string, unknown>;
|
|
178
178
|
clientId: string | null;
|
|
179
|
-
}) => Effect.Effect<
|
|
179
|
+
}) => Effect.Effect<_uploadista_core_flow3.NodeExecutionResult<_uploadista_core_types5.UploadFile>, _uploadista_core_errors0.UploadistaError, never>;
|
|
180
180
|
condition?: {
|
|
181
181
|
field: string;
|
|
182
182
|
operator: string;
|
|
@@ -190,9 +190,9 @@ declare function createVideoThumbnailNode(id: string, params: ExtractFrameVideoP
|
|
|
190
190
|
retryDelay?: number;
|
|
191
191
|
exponentialBackoff?: boolean;
|
|
192
192
|
};
|
|
193
|
-
circuitBreaker?:
|
|
193
|
+
circuitBreaker?: _uploadista_core_flow3.FlowCircuitBreakerConfig;
|
|
194
194
|
} & {
|
|
195
|
-
type:
|
|
195
|
+
type: _uploadista_core_flow3.NodeType;
|
|
196
196
|
}, _uploadista_core_errors0.UploadistaError, VideoPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region src/transcode-node.d.ts
|
|
@@ -248,17 +248,17 @@ declare function createTranscodeVideoNode(id: string, params: TranscodeVideoPara
|
|
|
248
248
|
naming?: FileNamingConfig;
|
|
249
249
|
mode?: TransformMode;
|
|
250
250
|
streamingConfig?: StreamingConfig;
|
|
251
|
-
}): Effect.Effect<
|
|
252
|
-
inputSchema:
|
|
253
|
-
outputSchema:
|
|
251
|
+
}): Effect.Effect<_uploadista_core_flow3.FlowNodeData & {
|
|
252
|
+
inputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
253
|
+
outputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
254
254
|
run: (args: {
|
|
255
|
-
data:
|
|
255
|
+
data: _uploadista_core_types5.UploadFile;
|
|
256
256
|
jobId: string;
|
|
257
257
|
storageId: string;
|
|
258
258
|
flowId: string;
|
|
259
259
|
inputs?: Record<string, unknown>;
|
|
260
260
|
clientId: string | null;
|
|
261
|
-
}) => Effect.Effect<
|
|
261
|
+
}) => Effect.Effect<_uploadista_core_flow3.NodeExecutionResult<_uploadista_core_types5.UploadFile>, _uploadista_core_errors0.UploadistaError, never>;
|
|
262
262
|
condition?: {
|
|
263
263
|
field: string;
|
|
264
264
|
operator: string;
|
|
@@ -272,9 +272,9 @@ declare function createTranscodeVideoNode(id: string, params: TranscodeVideoPara
|
|
|
272
272
|
retryDelay?: number;
|
|
273
273
|
exponentialBackoff?: boolean;
|
|
274
274
|
};
|
|
275
|
-
circuitBreaker?:
|
|
275
|
+
circuitBreaker?: _uploadista_core_flow3.FlowCircuitBreakerConfig;
|
|
276
276
|
} & {
|
|
277
|
-
type:
|
|
277
|
+
type: _uploadista_core_flow3.NodeType;
|
|
278
278
|
}, _uploadista_core_errors0.UploadistaError, VideoPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region src/trim-node.d.ts
|
|
@@ -329,17 +329,17 @@ declare function createTrimVideoNode(id: string, params: TrimVideoParams$1, opti
|
|
|
329
329
|
naming?: FileNamingConfig;
|
|
330
330
|
mode?: TransformMode;
|
|
331
331
|
streamingConfig?: StreamingConfig;
|
|
332
|
-
}): Effect.Effect<
|
|
333
|
-
inputSchema:
|
|
334
|
-
outputSchema:
|
|
332
|
+
}): Effect.Effect<_uploadista_core_flow3.FlowNodeData & {
|
|
333
|
+
inputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
334
|
+
outputSchema: zod1.ZodType<_uploadista_core_types5.UploadFile, unknown, zod_v4_core1.$ZodTypeInternals<_uploadista_core_types5.UploadFile, unknown>>;
|
|
335
335
|
run: (args: {
|
|
336
|
-
data:
|
|
336
|
+
data: _uploadista_core_types5.UploadFile;
|
|
337
337
|
jobId: string;
|
|
338
338
|
storageId: string;
|
|
339
339
|
flowId: string;
|
|
340
340
|
inputs?: Record<string, unknown>;
|
|
341
341
|
clientId: string | null;
|
|
342
|
-
}) => Effect.Effect<
|
|
342
|
+
}) => Effect.Effect<_uploadista_core_flow3.NodeExecutionResult<_uploadista_core_types5.UploadFile>, UploadistaError, never>;
|
|
343
343
|
condition?: {
|
|
344
344
|
field: string;
|
|
345
345
|
operator: string;
|
|
@@ -353,9 +353,9 @@ declare function createTrimVideoNode(id: string, params: TrimVideoParams$1, opti
|
|
|
353
353
|
retryDelay?: number;
|
|
354
354
|
exponentialBackoff?: boolean;
|
|
355
355
|
};
|
|
356
|
-
circuitBreaker?:
|
|
356
|
+
circuitBreaker?: _uploadista_core_flow3.FlowCircuitBreakerConfig;
|
|
357
357
|
} & {
|
|
358
|
-
type:
|
|
358
|
+
type: _uploadista_core_flow3.NodeType;
|
|
359
359
|
}, UploadistaError, VideoPlugin | _uploadista_core_upload0.UploadEngine>;
|
|
360
360
|
//#endregion
|
|
361
361
|
export { type DescribeVideoMetadata, type ExtractFrameVideoParams, type ResizeVideoParams, type TranscodeVideoParams, type TrimVideoParams, createDescribeVideoNode, createTranscodeVideoNode, createTrimVideoNode, createVideoResizeNode, createVideoThumbnailNode };
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/describe-video-node.ts","../src/resize-node.ts","../src/thumbnail-node.ts","../src/transcode-node.ts","../src/trim-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;iBAAgB,uBAAA;;IAEoB,MAAA,CAAA,OAFG,sBAAA,CAEH,YAAA;4BAAA,uBAAA,CAAA,UAAA;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/describe-video-node.ts","../src/resize-node.ts","../src/thumbnail-node.ts","../src/transcode-node.ts","../src/trim-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;iBAAgB,uBAAA;;IAEoB,MAAA,CAAA,OAFG,sBAAA,CAEH,YAAA;4BAAA,uBAAA,CAAA,UAAA;;EA8B+y+M,GAAA,EAAA,CAAA,IAAA,EAAA;IAAA,IAAA,oCAAA;;;;aAAA;;iEAAA,uBAAA,CAAA,UAAA;;;IA9B/y+M,QAAA,EAAA,MAAA;IAAA,KAAA,EAAA,OAAA;;;;ECyCpB,QAAA,CAAA,EAAA,OAAA;EAEN,KAAA,CAAA,EAAA;IAGG,UAAA,CAAA,EAAA,MAAA;IACF,UAAA,CAAA,EAAA,MAAA;IACW,kBAAA,CAAA,EAAA,OAAA;EAAe,CAAA;EAClC,cAAA,CAAA,iDAAA;;;;;;;;;;;;;;;ADnDH;;;;;;;;;;;;;;;;;;;;;;;;;;AC2CA;;;;;;;;;;;;;iBAAgB,qBAAA,qBAEN;;EAwEym5M,MAAA,CAAA,EArEtm5M,gBAqEsm5M;EAAA,IAAA,CAAA,EApExm5M,aAoEwm5M;oBAnE7l5M;IACnB,MAAA,CAAA,OADkC,sBAAA,CAClC,YAAA;4BAAA,uBAAA,CAAA,UAAA;;;;;;IAAA,MAAA,EAAA,MAAA;IAAA,MAAA,CAAA,EAkEgn5M,MAlEhn5M,CAAA,MAAA,EAAA,OAAA,CAAA;;iEAkEgn5M,uBAAA,CAAA,UAAA;;ICxGnm5M,KAAA,EAAA,MAAA;IAEN,QAAA,EAAA,MAAA;IACmC,KAAA,EAAA,OAAA;EAAgB,CAAA;EAAE,UAAA,CAAA,EAAA,OAAA;;;;;;;;;CAsEw66M,GAAA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A,EGrExm5M,aHqEwm5M;EAAA,eAAA,CAAA,EGpE7l5M,eHoE6l5M;IGnEhn5M,MAAA,CAAA,OADkC,sBAAA,CAClC,YAAA;4BAAA,uBAAA,CAAA,UAAA;;;;;;;IHCA,MAAA,CAAA,EGuFi+3M,MHvFj+3M,CAAA,MAAA,EAAA,OAAA,CAAA;IAAA,QAAA,EAAA,MAAA,GAAA,IAAA;iEGuFi+3M,uBAAA,CAAA,UAAA;;;IF7Hp93M,QAAA,EAAA,MAAA;IAEN,KAAA,EAAA,OAAA;EACmC,CAAA;EAAgB,UAAA,CAAA,EAAA,OAAE;EAAA,WAAA,CAAA,EAAA,OAAA;;;;;;;;;EAsEw66M,IAAA,iCAAA;CAAA,iBAAA,aAAA,wCAAA,CAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/describe-video-node.ts","../src/resize-node.ts","../src/thumbnail-node.ts","../src/transcode-node.ts","../src/trim-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;iBAAgB,uBAAA;;IAEoB,MAAA,CAAA,OAFG,sBAAA,CAEH,YAAA;4BAAA,uBAAA,CAAA,UAAA;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/describe-video-node.ts","../src/resize-node.ts","../src/thumbnail-node.ts","../src/transcode-node.ts","../src/trim-node.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;iBAAgB,uBAAA;;IAEoB,MAAA,CAAA,OAFG,sBAAA,CAEH,YAAA;4BAAA,uBAAA,CAAA,UAAA;;EA8B+y+M,GAAA,EAAA,CAAA,IAAA,EAAA;IAAA,IAAA,oCAAA;;;;aAAA;;iEAAA,uBAAA,CAAA,UAAA;;;IA9B/y+M,QAAA,EAAA,MAAA;IAAA,KAAA,EAAA,OAAA;;;;ECyCpB,QAAA,CAAA,EAA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
{"version":3,"file":"index.mjs","names":["DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig","effectiveMode: TransformMode","streamingConfig: StreamingConfig","DEFAULT_VIDEO_STREAMING_CONFIG","namingConfig: FileNamingConfig | undefined","newFileName: string | undefined","namingConfig: FileNamingConfig","DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig","formatToMimeType: Record<TranscodeVideoParams[\"format\"], string>","formatToExtension: Record<TranscodeVideoParams[\"format\"], string>","effectiveMode: TransformMode","streamingConfig: StreamingConfig","DEFAULT_VIDEO_STREAMING_CONFIG","newFileName: string | undefined","namingConfig: FileNamingConfig","DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig","effectiveMode: TransformMode","streamingConfig: StreamingConfig","namingConfig: FileNamingConfig | undefined"],"sources":["../src/describe-video-node.ts","../src/resize-node.ts","../src/thumbnail-node.ts","../src/transcode-node.ts","../src/trim-node.ts"],"sourcesContent":["import {\n createTransformNode,\n STORAGE_OUTPUT_TYPE_ID,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n/**\n * Creates a Describe Video metadata extraction node\n *\n * Extracts comprehensive metadata from the video file including duration,\n * resolution, codec, bitrate, and audio information. The metadata is stored\n * in the file context for downstream nodes while passing through the original bytes.\n *\n * @param id - Unique node identifier\n * @returns Effect that resolves to the configured node\n *\n * @example\n * ```typescript\n * const node = yield* createDescribeVideoNode(\"describe-1\");\n * ```\n */\nexport function createDescribeVideoNode(\n id: string,\n options?: { keepOutput?: boolean },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n return yield* createTransformNode({\n id,\n name: \"Describe Video\",\n description:\n \"Extracts video metadata (duration, resolution, codec, etc.)\",\n nodeTypeId: \"describe-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n transform: (inputBytes, file) =>\n Effect.gen(function* () {\n // Extract metadata\n const metadata = yield* videoService.describe(inputBytes);\n\n // Store metadata in file context for downstream nodes\n return {\n bytes: inputBytes, // Pass through original bytes unchanged\n metadata: {\n ...file.metadata,\n videoInfo: metadata,\n },\n };\n }),\n });\n });\n}\n","import {\n createTransformNode,\n type FileNamingConfig,\n type ResizeVideoParams,\n STORAGE_OUTPUT_TYPE_ID,\n type StreamingConfig,\n type TransformMode,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n// Default streaming config for video processing\nconst DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig = {\n fileSizeThreshold: 10_000_000, // 10MB threshold for video\n chunkSize: 1_048_576, // 1MB chunks\n};\n\n/**\n * Creates a Resize video processing node\n *\n * Changes video resolution while optionally maintaining aspect ratio.\n *\n * Supports both buffered and streaming modes for memory-efficient processing\n * of large videos. In streaming mode, the output is streamed directly to storage,\n * reducing peak memory usage.\n *\n * @param id - Unique node identifier\n * @param params - Resize parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `${width}x${height}`)\n * @param options.mode - Transform mode: \"buffered\", \"streaming\", or \"auto\" (default)\n * @param options.streamingConfig - Streaming configuration (file size threshold, chunk size)\n *\n * @example\n * ```typescript\n * // Auto mode (default) - uses streaming for files > 10MB, otherwise buffered\n * const node = yield* createVideoResizeNode(\"resize-1\", {\n * width: 1280,\n * height: 720,\n * aspectRatio: \"keep\",\n * scaling: \"bicubic\"\n * }, {\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force buffered mode for small files\n * const nodeBuffered = yield* createVideoResizeNode(\"resize-2\", {\n * width: 1920,\n * height: 1080\n * }, {\n * mode: \"buffered\",\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force streaming mode for memory efficiency\n * const nodeStreaming = yield* createVideoResizeNode(\"resize-3\", {\n * width: 1280,\n * height: 720\n * }, {\n * mode: \"streaming\",\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createVideoResizeNode(\n id: string,\n params: ResizeVideoParams,\n options?: {\n keepOutput?: boolean;\n naming?: FileNamingConfig;\n mode?: TransformMode;\n streamingConfig?: StreamingConfig;\n },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n // Determine if streaming is available and requested\n const supportsStreaming = videoService.supportsStreaming ?? false;\n const requestedMode = options?.mode ?? \"auto\";\n\n // If streaming requested but not supported, fall back to buffered\n const effectiveMode: TransformMode =\n requestedMode === \"buffered\"\n ? \"buffered\"\n : supportsStreaming\n ? requestedMode\n : \"buffered\";\n\n // Use video-specific streaming config as default\n const streamingConfig: StreamingConfig = {\n ...DEFAULT_VIDEO_STREAMING_CONFIG,\n ...options?.streamingConfig,\n };\n\n // Build naming config with auto suffix for video resize\n const namingConfig: FileNamingConfig | undefined = options?.naming\n ? {\n ...options.naming,\n autoSuffix:\n options.naming.autoSuffix ??\n ((ctx) => `${ctx.width ?? params.width}x${ctx.height ?? params.height}`),\n }\n : undefined;\n\n return yield* createTransformNode({\n id,\n name: \"Resize Video\",\n description: \"Changes video resolution\",\n nodeTypeId: \"resize-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n naming: namingConfig,\n nodeType: \"resize-video\",\n namingVars: { width: params.width, height: params.height },\n mode: effectiveMode,\n streamingConfig,\n // Buffered transform\n transform: (inputBytes) =>\n Effect.map(videoService.resize(inputBytes, params), (resizedBytes) => ({\n bytes: resizedBytes,\n })),\n // Streaming transform\n streamingTransform: videoService.resizeStream\n ? (inputStream) =>\n Effect.gen(function* () {\n const resizeStreamFn = videoService.resizeStream;\n if (!resizeStreamFn) {\n throw new Error(\"resizeStream not available\");\n }\n const outputStream = yield* resizeStreamFn(inputStream, params);\n return { stream: outputStream };\n })\n : undefined,\n });\n });\n}\n","import {\n applyFileNaming,\n buildNamingContext,\n createTransformNode,\n type ExtractFrameVideoParams,\n type FileNamingConfig,\n getBaseName,\n STORAGE_OUTPUT_TYPE_ID,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n/**\n * Creates a Thumbnail generation node\n *\n * Extracts a single frame from the video as an image (JPEG or PNG).\n *\n * @param id - Unique node identifier\n * @param params - Frame extraction parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `thumb`)\n *\n * @example\n * ```typescript\n * // With auto-naming: \"video.mp4\" -> \"video-thumb.jpg\"\n * const node = yield* createVideoThumbnailNode(\"thumbnail-1\", {\n * timestamp: 15,\n * format: \"jpeg\",\n * quality: 85\n * }, {\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createVideoThumbnailNode(\n id: string,\n params: ExtractFrameVideoParams,\n options?: { keepOutput?: boolean; naming?: FileNamingConfig },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n const format = params.format || \"jpeg\";\n\n return yield* createTransformNode({\n id,\n name: \"Generate Thumbnail\",\n description: \"Extracts a frame from video as an image\",\n nodeTypeId: \"thumbnail-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n // Note: naming is handled in transform since format changes extension\n nodeType: \"thumbnail\",\n namingVars: { format },\n transform: (inputBytes, file) =>\n Effect.map(\n videoService.extractFrame(inputBytes, params),\n (imageBytes) => {\n // Map output to image MIME type and extension\n const mimeType = format === \"png\" ? \"image/png\" : \"image/jpeg\";\n const extension = format === \"png\" ? \"png\" : \"jpg\";\n\n // Get original fileName\n const fileName = file.metadata?.fileName;\n let newFileName: string | undefined;\n\n if (fileName && typeof fileName === \"string\") {\n // Apply naming if configured\n if (options?.naming) {\n const namingConfig: FileNamingConfig = {\n ...options.naming,\n autoSuffix: options.naming.autoSuffix ?? (() => \"thumb\"),\n };\n const namingContext = buildNamingContext(\n file,\n {\n flowId: file.flow?.flowId ?? \"\",\n jobId: file.flow?.jobId ?? \"\",\n nodeId: id,\n nodeType: \"thumbnail\",\n },\n { format },\n );\n // Apply naming to get base name with suffix\n const namedFile = applyFileNaming(file, namingContext, namingConfig);\n // Replace extension with image extension\n newFileName = `${getBaseName(namedFile)}.${extension}`;\n } else {\n // No naming config, just update extension\n newFileName = fileName.replace(/\\.[^.]+$/, `.${extension}`);\n }\n }\n\n return {\n bytes: imageBytes,\n type: mimeType,\n fileName: newFileName,\n };\n },\n ),\n });\n });\n}\n","import {\n applyFileNaming,\n buildNamingContext,\n createTransformNode,\n type FileNamingConfig,\n getBaseName,\n STORAGE_OUTPUT_TYPE_ID,\n type StreamingConfig,\n type TranscodeVideoParams,\n type TransformMode,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n// Default streaming config for video processing\nconst DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig = {\n fileSizeThreshold: 10_000_000, // 10MB threshold for video\n chunkSize: 1_048_576, // 1MB chunks\n};\n\n// Map video format to MIME type\nconst formatToMimeType: Record<TranscodeVideoParams[\"format\"], string> = {\n mp4: \"video/mp4\",\n webm: \"video/webm\",\n mov: \"video/quicktime\",\n avi: \"video/x-msvideo\",\n};\n\n// Map video format to file extension\nconst formatToExtension: Record<TranscodeVideoParams[\"format\"], string> = {\n mp4: \"mp4\",\n webm: \"webm\",\n mov: \"mov\",\n avi: \"avi\",\n};\n\n/**\n * Creates a Transcode video processing node\n *\n * Converts video to specified format and codec, optionally adjusting bitrates.\n *\n * Supports both buffered and streaming modes for memory-efficient processing\n * of large videos. In streaming mode, the output is streamed directly to storage,\n * reducing peak memory usage.\n *\n * @param id - Unique node identifier\n * @param params - Transcode parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `${format}`)\n * @param options.mode - Transform mode: \"buffered\", \"streaming\", or \"auto\" (default)\n * @param options.streamingConfig - Streaming configuration (file size threshold, chunk size)\n *\n * @example\n * ```typescript\n * // Auto mode (default) - uses streaming for files > 10MB, otherwise buffered\n * const node = yield* createTranscodeVideoNode(\"transcode-1\", {\n * format: \"webm\",\n * codec: \"vp9\",\n * videoBitrate: \"1000k\"\n * }, {\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force buffered mode for small files\n * const nodeBuffered = yield* createTranscodeVideoNode(\"transcode-2\", {\n * format: \"mp4\",\n * codec: \"h264\"\n * }, {\n * mode: \"buffered\",\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force streaming mode for memory efficiency\n * const nodeStreaming = yield* createTranscodeVideoNode(\"transcode-3\", {\n * format: \"mp4\",\n * codec: \"h264\"\n * }, {\n * mode: \"streaming\",\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createTranscodeVideoNode(\n id: string,\n params: TranscodeVideoParams,\n options?: {\n keepOutput?: boolean;\n naming?: FileNamingConfig;\n mode?: TransformMode;\n streamingConfig?: StreamingConfig;\n },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n // Determine if streaming is available and requested\n const supportsStreaming = videoService.supportsStreaming ?? false;\n const requestedMode = options?.mode ?? \"auto\";\n\n // If streaming requested but not supported, fall back to buffered\n const effectiveMode: TransformMode =\n requestedMode === \"buffered\"\n ? \"buffered\"\n : supportsStreaming\n ? requestedMode\n : \"buffered\";\n\n // Use video-specific streaming config as default\n const streamingConfig: StreamingConfig = {\n ...DEFAULT_VIDEO_STREAMING_CONFIG,\n ...options?.streamingConfig,\n };\n\n // Helper to build output metadata\n const buildOutputMetadata = (file: {\n metadata?: Record<string, unknown>;\n flow?: { flowId?: string; jobId?: string };\n }) => {\n const newType = formatToMimeType[params.format];\n const newExtension = formatToExtension[params.format];\n\n const fileName = file.metadata?.fileName;\n let newFileName: string | undefined;\n\n if (fileName && typeof fileName === \"string\") {\n if (options?.naming) {\n const namingConfig: FileNamingConfig = {\n ...options.naming,\n autoSuffix:\n options.naming.autoSuffix ?? ((ctx) => ctx.format ?? params.format),\n };\n const namingContext = buildNamingContext(\n file as Parameters<typeof buildNamingContext>[0],\n {\n flowId: file.flow?.flowId ?? \"\",\n jobId: file.flow?.jobId ?? \"\",\n nodeId: id,\n nodeType: \"transcode\",\n },\n { format: params.format },\n );\n const namedFile = applyFileNaming(\n file as Parameters<typeof applyFileNaming>[0],\n namingContext,\n namingConfig,\n );\n newFileName = `${getBaseName(namedFile)}.${newExtension}`;\n } else {\n newFileName = fileName.replace(/\\.[^.]+$/, `.${newExtension}`);\n }\n }\n\n return { newType, newFileName };\n };\n\n return yield* createTransformNode({\n id,\n name: \"Transcode\",\n description: \"Converts video to specified format and codec\",\n nodeTypeId: \"transcode-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n nodeType: \"transcode\",\n namingVars: { format: params.format },\n mode: effectiveMode,\n streamingConfig,\n // Buffered transform\n transform: (inputBytes, file) =>\n Effect.map(\n videoService.transcode(inputBytes, params),\n (transcodedBytes) => {\n const { newType, newFileName } = buildOutputMetadata(file);\n return {\n bytes: transcodedBytes,\n type: newType,\n fileName: newFileName,\n };\n },\n ),\n // Streaming transform\n streamingTransform: videoService.transcodeStream\n ? (inputStream, file) =>\n Effect.gen(function* () {\n const transcodeStreamFn = videoService.transcodeStream;\n if (!transcodeStreamFn) {\n throw new Error(\"transcodeStream not available\");\n }\n const outputStream = yield* transcodeStreamFn(inputStream, params);\n const { newType, newFileName } = buildOutputMetadata(file);\n return {\n stream: outputStream,\n type: newType,\n fileName: newFileName,\n };\n })\n : undefined,\n });\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n createTransformNode,\n type FileNamingConfig,\n STORAGE_OUTPUT_TYPE_ID,\n type StreamingConfig,\n type TransformMode,\n type TrimVideoParams,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n// Default streaming config for video processing\nconst DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig = {\n fileSizeThreshold: 10_000_000, // 10MB threshold for video\n chunkSize: 1_048_576, // 1MB chunks\n};\n\n/**\n * Creates a Trim video processing node\n *\n * Extracts a segment from the video by time range.\n *\n * Supports both buffered and streaming modes for memory-efficient processing\n * of large videos. In streaming mode, the output is streamed directly to storage,\n * reducing peak memory usage.\n *\n * @param id - Unique node identifier\n * @param params - Trim parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `trimmed`)\n * @param options.mode - Transform mode: \"buffered\", \"streaming\", or \"auto\" (default)\n * @param options.streamingConfig - Streaming configuration (file size threshold, chunk size)\n *\n * @example\n * ```typescript\n * // Auto mode (default) - uses streaming for files > 10MB, otherwise buffered\n * const node = yield* createTrimVideoNode(\"trim-1\", {\n * startTime: 10,\n * endTime: 30\n * }, {\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force buffered mode for small files\n * const nodeBuffered = yield* createTrimVideoNode(\"trim-2\", {\n * startTime: 0,\n * duration: 60\n * }, {\n * mode: \"buffered\",\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force streaming mode for memory efficiency\n * const nodeStreaming = yield* createTrimVideoNode(\"trim-3\", {\n * startTime: 5,\n * endTime: 25\n * }, {\n * mode: \"streaming\",\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createTrimVideoNode(\n id: string,\n params: TrimVideoParams,\n options?: {\n keepOutput?: boolean;\n naming?: FileNamingConfig;\n mode?: TransformMode;\n streamingConfig?: StreamingConfig;\n },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n // Validate params\n if (params.endTime !== undefined && params.endTime <= params.startTime) {\n return yield* UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"endTime must be greater than startTime\",\n details: { params },\n }).toEffect();\n }\n\n if (\n params.duration !== undefined &&\n params.endTime !== undefined &&\n params.duration !== params.endTime - params.startTime\n ) {\n return yield* UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"Cannot specify both endTime and duration with conflicting values\",\n details: { params },\n }).toEffect();\n }\n\n if (params.duration !== undefined && params.duration <= 0) {\n return yield* UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"duration must be greater than 0\",\n details: { params },\n }).toEffect();\n }\n\n // Determine if streaming is available and requested\n const supportsStreaming = videoService.supportsStreaming ?? false;\n const requestedMode = options?.mode ?? \"auto\";\n\n // If streaming requested but not supported, fall back to buffered\n const effectiveMode: TransformMode =\n requestedMode === \"buffered\"\n ? \"buffered\"\n : supportsStreaming\n ? requestedMode\n : \"buffered\";\n\n // Use video-specific streaming config as default\n const streamingConfig: StreamingConfig = {\n ...DEFAULT_VIDEO_STREAMING_CONFIG,\n ...options?.streamingConfig,\n };\n\n // Build naming config with auto suffix for trim\n const namingConfig: FileNamingConfig | undefined = options?.naming\n ? {\n ...options.naming,\n autoSuffix: options.naming.autoSuffix ?? (() => \"trimmed\"),\n }\n : undefined;\n\n return yield* createTransformNode({\n id,\n name: \"Trim Video\",\n description: \"Extracts a segment from the video\",\n nodeTypeId: \"trim-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n naming: namingConfig,\n nodeType: \"trim\",\n mode: effectiveMode,\n streamingConfig,\n // Buffered transform\n transform: (inputBytes) =>\n Effect.map(videoService.trim(inputBytes, params), (trimmedBytes) => ({\n bytes: trimmedBytes,\n })),\n // Streaming transform\n streamingTransform: videoService.trimStream\n ? (inputStream) =>\n Effect.gen(function* () {\n const trimStreamFn = videoService.trimStream;\n if (!trimStreamFn) {\n throw new Error(\"trimStream not available\");\n }\n const outputStream = yield* trimStreamFn(inputStream, params);\n return { stream: outputStream };\n })\n : undefined,\n });\n });\n}\n"],"mappings":"iQAsBA,SAAgB,EACd,EACA,EACA,CACA,OAAO,EAAO,IAAI,WAAa,CAC7B,IAAM,EAAe,MAAO,EAE5B,OAAO,MAAO,EAAoB,CAChC,KACA,KAAM,iBACN,YACE,8DACF,WAAY,iBACZ,aAAc,EACd,WAAY,GAAS,WACrB,WAAY,EAAY,IACtB,EAAO,IAAI,WAAa,CAEtB,IAAM,EAAW,MAAO,EAAa,SAAS,EA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],"sources":["../src/describe-video-node.ts","../src/resize-node.ts","../src/thumbnail-node.ts","../src/transcode-node.ts","../src/trim-node.ts"],"sourcesContent":["import {\n createTransformNode,\n STORAGE_OUTPUT_TYPE_ID,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n/**\n * Creates a Describe Video metadata extraction node\n *\n * Extracts comprehensive metadata from the video file including duration,\n * resolution, codec, bitrate, and audio information. The metadata is stored\n * in the file context for downstream nodes while passing through the original bytes.\n *\n * @param id - Unique node identifier\n * @returns Effect that resolves to the configured node\n *\n * @example\n * ```typescript\n * const node = yield* createDescribeVideoNode(\"describe-1\");\n * ```\n */\nexport function createDescribeVideoNode(\n id: string,\n options?: { keepOutput?: boolean },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n return yield* createTransformNode({\n id,\n name: \"Describe Video\",\n description:\n \"Extracts video metadata (duration, resolution, codec, etc.)\",\n nodeTypeId: \"describe-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n transform: (inputBytes, file) =>\n Effect.gen(function* () {\n // Extract metadata\n const metadata = yield* videoService.describe(inputBytes);\n\n // Store metadata in file context for downstream nodes\n return {\n bytes: inputBytes, // Pass through original bytes unchanged\n metadata: {\n ...file.metadata,\n videoInfo: metadata,\n },\n };\n }),\n });\n });\n}\n","import {\n createTransformNode,\n type FileNamingConfig,\n type ResizeVideoParams,\n STORAGE_OUTPUT_TYPE_ID,\n type StreamingConfig,\n type TransformMode,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n// Default streaming config for video processing\nconst DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig = {\n fileSizeThreshold: 10_000_000, // 10MB threshold for video\n chunkSize: 1_048_576, // 1MB chunks\n};\n\n/**\n * Creates a Resize video processing node\n *\n * Changes video resolution while optionally maintaining aspect ratio.\n *\n * Supports both buffered and streaming modes for memory-efficient processing\n * of large videos. In streaming mode, the output is streamed directly to storage,\n * reducing peak memory usage.\n *\n * @param id - Unique node identifier\n * @param params - Resize parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `${width}x${height}`)\n * @param options.mode - Transform mode: \"buffered\", \"streaming\", or \"auto\" (default)\n * @param options.streamingConfig - Streaming configuration (file size threshold, chunk size)\n *\n * @example\n * ```typescript\n * // Auto mode (default) - uses streaming for files > 10MB, otherwise buffered\n * const node = yield* createVideoResizeNode(\"resize-1\", {\n * width: 1280,\n * height: 720,\n * aspectRatio: \"keep\",\n * scaling: \"bicubic\"\n * }, {\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force buffered mode for small files\n * const nodeBuffered = yield* createVideoResizeNode(\"resize-2\", {\n * width: 1920,\n * height: 1080\n * }, {\n * mode: \"buffered\",\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force streaming mode for memory efficiency\n * const nodeStreaming = yield* createVideoResizeNode(\"resize-3\", {\n * width: 1280,\n * height: 720\n * }, {\n * mode: \"streaming\",\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createVideoResizeNode(\n id: string,\n params: ResizeVideoParams,\n options?: {\n keepOutput?: boolean;\n naming?: FileNamingConfig;\n mode?: TransformMode;\n streamingConfig?: StreamingConfig;\n },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n // Determine if streaming is available and requested\n const supportsStreaming = videoService.supportsStreaming ?? false;\n const requestedMode = options?.mode ?? \"auto\";\n\n // If streaming requested but not supported, fall back to buffered\n const effectiveMode: TransformMode =\n requestedMode === \"buffered\"\n ? \"buffered\"\n : supportsStreaming\n ? requestedMode\n : \"buffered\";\n\n // Use video-specific streaming config as default\n const streamingConfig: StreamingConfig = {\n ...DEFAULT_VIDEO_STREAMING_CONFIG,\n ...options?.streamingConfig,\n };\n\n // Build naming config with auto suffix for video resize\n const namingConfig: FileNamingConfig | undefined = options?.naming\n ? {\n ...options.naming,\n autoSuffix:\n options.naming.autoSuffix ??\n ((ctx) =>\n `${ctx.width ?? params.width}x${ctx.height ?? params.height}`),\n }\n : undefined;\n\n return yield* createTransformNode({\n id,\n name: \"Resize Video\",\n description: \"Changes video resolution\",\n nodeTypeId: \"resize-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n naming: namingConfig,\n nodeType: \"resize-video\",\n namingVars: { width: params.width, height: params.height },\n mode: effectiveMode,\n streamingConfig,\n // Buffered transform\n transform: (inputBytes) =>\n Effect.map(videoService.resize(inputBytes, params), (resizedBytes) => ({\n bytes: resizedBytes,\n })),\n // Streaming transform\n streamingTransform: videoService.resizeStream\n ? (inputStream) =>\n Effect.gen(function* () {\n const resizeStreamFn = videoService.resizeStream;\n if (!resizeStreamFn) {\n throw new Error(\"resizeStream not available\");\n }\n const outputStream = yield* resizeStreamFn(inputStream, params);\n return { stream: outputStream };\n })\n : undefined,\n });\n });\n}\n","import {\n applyFileNaming,\n buildNamingContext,\n createTransformNode,\n type ExtractFrameVideoParams,\n type FileNamingConfig,\n getBaseName,\n STORAGE_OUTPUT_TYPE_ID,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n/**\n * Creates a Thumbnail generation node\n *\n * Extracts a single frame from the video as an image (JPEG or PNG).\n *\n * @param id - Unique node identifier\n * @param params - Frame extraction parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `thumb`)\n *\n * @example\n * ```typescript\n * // With auto-naming: \"video.mp4\" -> \"video-thumb.jpg\"\n * const node = yield* createVideoThumbnailNode(\"thumbnail-1\", {\n * timestamp: 15,\n * format: \"jpeg\",\n * quality: 85\n * }, {\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createVideoThumbnailNode(\n id: string,\n params: ExtractFrameVideoParams,\n options?: { keepOutput?: boolean; naming?: FileNamingConfig },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n const format = params.format || \"jpeg\";\n\n return yield* createTransformNode({\n id,\n name: \"Generate Thumbnail\",\n description: \"Extracts a frame from video as an image\",\n nodeTypeId: \"thumbnail-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n // Note: naming is handled in transform since format changes extension\n nodeType: \"thumbnail\",\n namingVars: { format },\n transform: (inputBytes, file) =>\n Effect.map(\n videoService.extractFrame(inputBytes, params),\n (imageBytes) => {\n // Map output to image MIME type and extension\n const mimeType = format === \"png\" ? \"image/png\" : \"image/jpeg\";\n const extension = format === \"png\" ? \"png\" : \"jpg\";\n\n // Get original fileName\n const fileName = file.metadata?.fileName;\n let newFileName: string | undefined;\n\n if (fileName && typeof fileName === \"string\") {\n // Apply naming if configured\n if (options?.naming) {\n const namingConfig: FileNamingConfig = {\n ...options.naming,\n autoSuffix: options.naming.autoSuffix ?? (() => \"thumb\"),\n };\n const namingContext = buildNamingContext(\n file,\n {\n flowId: file.flow?.flowId ?? \"\",\n jobId: file.flow?.jobId ?? \"\",\n nodeId: id,\n nodeType: \"thumbnail\",\n },\n { format },\n );\n // Apply naming to get base name with suffix\n const namedFile = applyFileNaming(\n file,\n namingContext,\n namingConfig,\n );\n // Replace extension with image extension\n newFileName = `${getBaseName(namedFile)}.${extension}`;\n } else {\n // No naming config, just update extension\n newFileName = fileName.replace(/\\.[^.]+$/, `.${extension}`);\n }\n }\n\n return {\n bytes: imageBytes,\n type: mimeType,\n fileName: newFileName,\n };\n },\n ),\n });\n });\n}\n","import {\n applyFileNaming,\n buildNamingContext,\n createTransformNode,\n type FileNamingConfig,\n getBaseName,\n STORAGE_OUTPUT_TYPE_ID,\n type StreamingConfig,\n type TranscodeVideoParams,\n type TransformMode,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n// Default streaming config for video processing\nconst DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig = {\n fileSizeThreshold: 10_000_000, // 10MB threshold for video\n chunkSize: 1_048_576, // 1MB chunks\n};\n\n// Map video format to MIME type\nconst formatToMimeType: Record<TranscodeVideoParams[\"format\"], string> = {\n mp4: \"video/mp4\",\n webm: \"video/webm\",\n mov: \"video/quicktime\",\n avi: \"video/x-msvideo\",\n};\n\n// Map video format to file extension\nconst formatToExtension: Record<TranscodeVideoParams[\"format\"], string> = {\n mp4: \"mp4\",\n webm: \"webm\",\n mov: \"mov\",\n avi: \"avi\",\n};\n\n/**\n * Creates a Transcode video processing node\n *\n * Converts video to specified format and codec, optionally adjusting bitrates.\n *\n * Supports both buffered and streaming modes for memory-efficient processing\n * of large videos. In streaming mode, the output is streamed directly to storage,\n * reducing peak memory usage.\n *\n * @param id - Unique node identifier\n * @param params - Transcode parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `${format}`)\n * @param options.mode - Transform mode: \"buffered\", \"streaming\", or \"auto\" (default)\n * @param options.streamingConfig - Streaming configuration (file size threshold, chunk size)\n *\n * @example\n * ```typescript\n * // Auto mode (default) - uses streaming for files > 10MB, otherwise buffered\n * const node = yield* createTranscodeVideoNode(\"transcode-1\", {\n * format: \"webm\",\n * codec: \"vp9\",\n * videoBitrate: \"1000k\"\n * }, {\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force buffered mode for small files\n * const nodeBuffered = yield* createTranscodeVideoNode(\"transcode-2\", {\n * format: \"mp4\",\n * codec: \"h264\"\n * }, {\n * mode: \"buffered\",\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force streaming mode for memory efficiency\n * const nodeStreaming = yield* createTranscodeVideoNode(\"transcode-3\", {\n * format: \"mp4\",\n * codec: \"h264\"\n * }, {\n * mode: \"streaming\",\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createTranscodeVideoNode(\n id: string,\n params: TranscodeVideoParams,\n options?: {\n keepOutput?: boolean;\n naming?: FileNamingConfig;\n mode?: TransformMode;\n streamingConfig?: StreamingConfig;\n },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n // Determine if streaming is available and requested\n const supportsStreaming = videoService.supportsStreaming ?? false;\n const requestedMode = options?.mode ?? \"auto\";\n\n // If streaming requested but not supported, fall back to buffered\n const effectiveMode: TransformMode =\n requestedMode === \"buffered\"\n ? \"buffered\"\n : supportsStreaming\n ? requestedMode\n : \"buffered\";\n\n // Use video-specific streaming config as default\n const streamingConfig: StreamingConfig = {\n ...DEFAULT_VIDEO_STREAMING_CONFIG,\n ...options?.streamingConfig,\n };\n\n // Helper to build output metadata\n const buildOutputMetadata = (file: {\n metadata?: Record<string, unknown>;\n flow?: { flowId?: string; jobId?: string };\n }) => {\n const newType = formatToMimeType[params.format];\n const newExtension = formatToExtension[params.format];\n\n const fileName = file.metadata?.fileName;\n let newFileName: string | undefined;\n\n if (fileName && typeof fileName === \"string\") {\n if (options?.naming) {\n const namingConfig: FileNamingConfig = {\n ...options.naming,\n autoSuffix:\n options.naming.autoSuffix ??\n ((ctx) => ctx.format ?? params.format),\n };\n const namingContext = buildNamingContext(\n file as Parameters<typeof buildNamingContext>[0],\n {\n flowId: file.flow?.flowId ?? \"\",\n jobId: file.flow?.jobId ?? \"\",\n nodeId: id,\n nodeType: \"transcode\",\n },\n { format: params.format },\n );\n const namedFile = applyFileNaming(\n file as Parameters<typeof applyFileNaming>[0],\n namingContext,\n namingConfig,\n );\n newFileName = `${getBaseName(namedFile)}.${newExtension}`;\n } else {\n newFileName = fileName.replace(/\\.[^.]+$/, `.${newExtension}`);\n }\n }\n\n return { newType, newFileName };\n };\n\n return yield* createTransformNode({\n id,\n name: \"Transcode\",\n description: \"Converts video to specified format and codec\",\n nodeTypeId: \"transcode-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n nodeType: \"transcode\",\n namingVars: { format: params.format },\n mode: effectiveMode,\n streamingConfig,\n // Buffered transform\n transform: (inputBytes, file) =>\n Effect.map(\n videoService.transcode(inputBytes, params),\n (transcodedBytes) => {\n const { newType, newFileName } = buildOutputMetadata(file);\n return {\n bytes: transcodedBytes,\n type: newType,\n fileName: newFileName,\n };\n },\n ),\n // Streaming transform\n streamingTransform: videoService.transcodeStream\n ? (inputStream, file) =>\n Effect.gen(function* () {\n const transcodeStreamFn = videoService.transcodeStream;\n if (!transcodeStreamFn) {\n throw new Error(\"transcodeStream not available\");\n }\n const outputStream = yield* transcodeStreamFn(\n inputStream,\n params,\n );\n const { newType, newFileName } = buildOutputMetadata(file);\n return {\n stream: outputStream,\n type: newType,\n fileName: newFileName,\n };\n })\n : undefined,\n });\n });\n}\n","import { UploadistaError } from \"@uploadista/core/errors\";\nimport {\n createTransformNode,\n type FileNamingConfig,\n STORAGE_OUTPUT_TYPE_ID,\n type StreamingConfig,\n type TransformMode,\n type TrimVideoParams,\n VideoPlugin,\n} from \"@uploadista/core/flow\";\nimport { Effect } from \"effect\";\n\n// Default streaming config for video processing\nconst DEFAULT_VIDEO_STREAMING_CONFIG: StreamingConfig = {\n fileSizeThreshold: 10_000_000, // 10MB threshold for video\n chunkSize: 1_048_576, // 1MB chunks\n};\n\n/**\n * Creates a Trim video processing node\n *\n * Extracts a segment from the video by time range.\n *\n * Supports both buffered and streaming modes for memory-efficient processing\n * of large videos. In streaming mode, the output is streamed directly to storage,\n * reducing peak memory usage.\n *\n * @param id - Unique node identifier\n * @param params - Trim parameters\n * @param options - Optional configuration\n * @param options.keepOutput - Whether to keep output in flow results\n * @param options.naming - File naming configuration (auto suffix: `trimmed`)\n * @param options.mode - Transform mode: \"buffered\", \"streaming\", or \"auto\" (default)\n * @param options.streamingConfig - Streaming configuration (file size threshold, chunk size)\n *\n * @example\n * ```typescript\n * // Auto mode (default) - uses streaming for files > 10MB, otherwise buffered\n * const node = yield* createTrimVideoNode(\"trim-1\", {\n * startTime: 10,\n * endTime: 30\n * }, {\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force buffered mode for small files\n * const nodeBuffered = yield* createTrimVideoNode(\"trim-2\", {\n * startTime: 0,\n * duration: 60\n * }, {\n * mode: \"buffered\",\n * naming: { mode: \"auto\" }\n * });\n *\n * // Force streaming mode for memory efficiency\n * const nodeStreaming = yield* createTrimVideoNode(\"trim-3\", {\n * startTime: 5,\n * endTime: 25\n * }, {\n * mode: \"streaming\",\n * naming: { mode: \"auto\" }\n * });\n * ```\n */\nexport function createTrimVideoNode(\n id: string,\n params: TrimVideoParams,\n options?: {\n keepOutput?: boolean;\n naming?: FileNamingConfig;\n mode?: TransformMode;\n streamingConfig?: StreamingConfig;\n },\n) {\n return Effect.gen(function* () {\n const videoService = yield* VideoPlugin;\n\n // Validate params\n if (params.endTime !== undefined && params.endTime <= params.startTime) {\n return yield* UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"endTime must be greater than startTime\",\n details: { params },\n }).toEffect();\n }\n\n if (\n params.duration !== undefined &&\n params.endTime !== undefined &&\n params.duration !== params.endTime - params.startTime\n ) {\n return yield* UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"Cannot specify both endTime and duration with conflicting values\",\n details: { params },\n }).toEffect();\n }\n\n if (params.duration !== undefined && params.duration <= 0) {\n return yield* UploadistaError.fromCode(\"VALIDATION_ERROR\", {\n body: \"duration must be greater than 0\",\n details: { params },\n }).toEffect();\n }\n\n // Determine if streaming is available and requested\n const supportsStreaming = videoService.supportsStreaming ?? false;\n const requestedMode = options?.mode ?? \"auto\";\n\n // If streaming requested but not supported, fall back to buffered\n const effectiveMode: TransformMode =\n requestedMode === \"buffered\"\n ? \"buffered\"\n : supportsStreaming\n ? requestedMode\n : \"buffered\";\n\n // Use video-specific streaming config as default\n const streamingConfig: StreamingConfig = {\n ...DEFAULT_VIDEO_STREAMING_CONFIG,\n ...options?.streamingConfig,\n };\n\n // Build naming config with auto suffix for trim\n const namingConfig: FileNamingConfig | undefined = options?.naming\n ? {\n ...options.naming,\n autoSuffix: options.naming.autoSuffix ?? (() => \"trimmed\"),\n }\n : undefined;\n\n return yield* createTransformNode({\n id,\n name: \"Trim Video\",\n description: \"Extracts a segment from the video\",\n nodeTypeId: \"trim-video\",\n outputTypeId: STORAGE_OUTPUT_TYPE_ID,\n keepOutput: options?.keepOutput,\n naming: namingConfig,\n nodeType: \"trim\",\n mode: effectiveMode,\n streamingConfig,\n // Buffered transform\n transform: (inputBytes) =>\n Effect.map(videoService.trim(inputBytes, params), (trimmedBytes) => ({\n bytes: trimmedBytes,\n })),\n // Streaming transform\n streamingTransform: videoService.trimStream\n ? (inputStream) =>\n Effect.gen(function* () {\n const trimStreamFn = videoService.trimStream;\n if (!trimStreamFn) {\n throw new Error(\"trimStream not available\");\n }\n const outputStream = yield* trimStreamFn(inputStream, params);\n return { stream: outputStream };\n })\n : undefined,\n });\n });\n}\n"],"mappings":"iQAsBA,SAAgB,EACd,EACA,EACA,CACA,OAAO,EAAO,IAAI,WAAa,CAC7B,IAAM,EAAe,MAAO,EAE5B,OAAO,MAAO,EAAoB,CAChC,KACA,KAAM,iBACN,YACE,8DACF,WAAY,iBACZ,aAAc,EACd,WAAY,GAAS,WACrB,WAAY,EAAY,IACtB,EAAO,IAAI,WAAa,CAEtB,IAAM,EAAW,MAAO,EAAa,SAAS,EAAW,CAGzD,MAAO,CACL,MAAO,EACP,SAAU,CACR,GAAG,EAAK,SACR,UAAW,EACZ,CACF,EACD,CACL,CAAC,EACF,CCxCJ,MAAMA,EAAkD,CACtD,kBAAmB,IACnB,UAAW,QACZ,CAkDD,SAAgB,EACd,EACA,EACA,EAMA,CACA,OAAO,EAAO,IAAI,WAAa,CAC7B,IAAM,EAAe,MAAO,EAGtB,EAAoB,EAAa,mBAAqB,GACtD,EAAgB,GAAS,MAAQ,OAGjC,EACJ,IAAkB,WACd,WACA,EACE,EACA,WAGF,EAAmC,CACvC,GAAGA,EACH,GAAG,GAAS,gBACb,CAGK,EAA6C,GAAS,OACxD,CACE,GAAG,EAAQ,OACX,WACE,EAAQ,OAAO,aACb,GACA,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,GACtD,EAAgB,GAAS,MAAQ,OAGjC,EACJ,IAAkB,WACd,WACA,EACE,EACA,WAGF,EAAmC,CACvC,GAAG,EACH,GAAG,GAAS,gBACb,CAGK,EAA6C,GAAS,OACxD,CACE,GAAG,EAAQ,OACX,WAAY,EAAQ,OAAO,iBAAqB,WACjD,CACD,IAAA,GAEJ,OAAO,MAAO,EAAoB,CAChC,KACA,KAAM,aACN,YAAa,oCACb,WAAY,aACZ,aAAc,EACd,WAAY,GAAS,WACrB,OAAQ,EACR,SAAU,OACV,KAAM,EACN,kBAEA,UAAY,GACV,EAAO,IAAI,EAAa,KAAK,EAAY,EAAO,CAAG,IAAkB,CACnE,MAAO,EACR,EAAE,CAEL,mBAAoB,EAAa,WAC5B,GACC,EAAO,IAAI,WAAa,CACtB,IAAM,EAAe,EAAa,WAClC,GAAI,CAAC,EACH,MAAU,MAAM,2BAA2B,CAG7C,MAAO,CAAE,OADY,MAAO,EAAa,EAAa,EAAO,CAC9B,EAC/B,CACJ,IAAA,GACL,CAAC,EACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uploadista/flow-videos-nodes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0-beta.5",
|
|
5
5
|
"description": "Video processing nodes for Uploadista Flow",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Uploadista",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@uploadista/core": "0.0
|
|
17
|
+
"@uploadista/core": "0.1.0-beta.5"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"effect": "^3.0.0",
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@effect/vitest": "0.27.0",
|
|
25
|
-
"@types/node": "24.10.
|
|
26
|
-
"effect": "3.19.
|
|
27
|
-
"tsdown": "0.
|
|
28
|
-
"vitest": "4.0.
|
|
29
|
-
"zod": "4.
|
|
30
|
-
"@uploadista/typescript-config": "0.0
|
|
25
|
+
"@types/node": "24.10.8",
|
|
26
|
+
"effect": "3.19.14",
|
|
27
|
+
"tsdown": "0.19.0",
|
|
28
|
+
"vitest": "4.0.17",
|
|
29
|
+
"zod": "4.3.5",
|
|
30
|
+
"@uploadista/typescript-config": "0.1.0-beta.5"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsc --noEmit && tsdown",
|
|
34
34
|
"format": "biome format --write ./src",
|
|
35
35
|
"lint": "biome lint --write ./src",
|
|
36
36
|
"check": "biome check --write ./src",
|
|
37
|
-
"test": "vitest",
|
|
37
|
+
"test": "vitest run",
|
|
38
38
|
"test:run": "vitest run",
|
|
39
39
|
"test:watch": "vitest watch"
|
|
40
40
|
}
|
package/src/resize-node.ts
CHANGED
|
@@ -100,7 +100,8 @@ export function createVideoResizeNode(
|
|
|
100
100
|
...options.naming,
|
|
101
101
|
autoSuffix:
|
|
102
102
|
options.naming.autoSuffix ??
|
|
103
|
-
((ctx) =>
|
|
103
|
+
((ctx) =>
|
|
104
|
+
`${ctx.width ?? params.width}x${ctx.height ?? params.height}`),
|
|
104
105
|
}
|
|
105
106
|
: undefined;
|
|
106
107
|
|
package/src/thumbnail-node.ts
CHANGED
|
@@ -83,7 +83,11 @@ export function createVideoThumbnailNode(
|
|
|
83
83
|
{ format },
|
|
84
84
|
);
|
|
85
85
|
// Apply naming to get base name with suffix
|
|
86
|
-
const namedFile = applyFileNaming(
|
|
86
|
+
const namedFile = applyFileNaming(
|
|
87
|
+
file,
|
|
88
|
+
namingContext,
|
|
89
|
+
namingConfig,
|
|
90
|
+
);
|
|
87
91
|
// Replace extension with image extension
|
|
88
92
|
newFileName = `${getBaseName(namedFile)}.${extension}`;
|
|
89
93
|
} else {
|
package/src/transcode-node.ts
CHANGED
|
@@ -128,7 +128,8 @@ export function createTranscodeVideoNode(
|
|
|
128
128
|
const namingConfig: FileNamingConfig = {
|
|
129
129
|
...options.naming,
|
|
130
130
|
autoSuffix:
|
|
131
|
-
options.naming.autoSuffix ??
|
|
131
|
+
options.naming.autoSuffix ??
|
|
132
|
+
((ctx) => ctx.format ?? params.format),
|
|
132
133
|
};
|
|
133
134
|
const namingContext = buildNamingContext(
|
|
134
135
|
file as Parameters<typeof buildNamingContext>[0],
|
|
@@ -186,7 +187,10 @@ export function createTranscodeVideoNode(
|
|
|
186
187
|
if (!transcodeStreamFn) {
|
|
187
188
|
throw new Error("transcodeStream not available");
|
|
188
189
|
}
|
|
189
|
-
const outputStream = yield* transcodeStreamFn(
|
|
190
|
+
const outputStream = yield* transcodeStreamFn(
|
|
191
|
+
inputStream,
|
|
192
|
+
params,
|
|
193
|
+
);
|
|
190
194
|
const { newType, newFileName } = buildOutputMetadata(file);
|
|
191
195
|
return {
|
|
192
196
|
stream: outputStream,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TestUploadEngine, TestVideoPlugin } from "@uploadista/core/testing";
|
|
2
2
|
import type { UploadFile } from "@uploadista/core/types";
|
|
3
3
|
import { it as effectIt } from "@effect/vitest";
|
|
4
4
|
import { Effect, Layer } from "effect";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "../src";
|
|
13
13
|
|
|
14
14
|
// Combined test layer with all required dependencies
|
|
15
|
-
const TestLayer = Layer.
|
|
15
|
+
const TestLayer = Layer.mergeAll(TestUploadEngine, TestVideoPlugin);
|
|
16
16
|
|
|
17
17
|
// Helper to create test video file
|
|
18
18
|
const createTestVideoFile = (): UploadFile => ({
|