@uploadista/flow-videos-nodes 0.0.20 → 0.1.0

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.
@@ -1,22 +1,21 @@
1
1
 
2
- > @uploadista/flow-videos-nodes@0.0.20-beta.9 build /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes
2
+ > @uploadista/flow-videos-nodes@0.1.0 build /home/runner/work/uploadista-sdk/uploadista-sdk/packages/flow/videos/nodes
3
3
  > tsc --noEmit && tsdown
4
4
 
5
- ℹ tsdown v0.18.0 powered by rolldown v1.0.0-beta.53
6
- ℹ config file: /Users/denislaboureyras/Documents/uploadista/dev/uploadista-workspace/uploadista-sdk/packages/flow/videos/nodes/tsdown.config.ts
5
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
6
+ ℹ config file: /home/runner/work/uploadista-sdk/uploadista-sdk/packages/flow/videos/nodes/tsdown.config.ts
7
7
  ℹ entry: src/index.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ Cleaning 7 files
11
10
  ℹ [CJS] dist/index.cjs 5.29 kB │ gzip: 1.60 kB
12
11
  ℹ [CJS] 1 files, total: 5.29 kB
13
12
  ℹ [ESM] dist/index.mjs  4.91 kB │ gzip: 1.62 kB
14
- ℹ [ESM] dist/index.mjs.map 26.96 kB │ gzip: 5.12 kB
13
+ ℹ [ESM] dist/index.mjs.map 26.39 kB │ gzip: 5.07 kB
15
14
  ℹ [ESM] dist/index.d.mts.map  2.51 kB │ gzip: 0.78 kB
16
15
  ℹ [ESM] dist/index.d.mts 13.70 kB │ gzip: 2.07 kB
17
- ℹ [ESM] 4 files, total: 48.08 kB
18
- ✔ Build complete in 7775ms
16
+ ℹ [ESM] 4 files, total: 47.51 kB
17
+ ✔ Build complete in 28446ms
19
18
  ℹ [CJS] dist/index.d.cts.map  2.51 kB │ gzip: 0.78 kB
20
19
  ℹ [CJS] dist/index.d.cts 13.70 kB │ gzip: 2.07 kB
21
20
  ℹ [CJS] 2 files, total: 16.21 kB
22
- ✔ Build complete in 7776ms
21
+ ✔ Build complete in 28468ms
@@ -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;;EA8By06M,GAAA,EAAA,CAAA,IAAA,EAAA;IAAA,IAAA,oCAAA;;;;aAAA;;iEAAA,uBAAA,CAAA,UAAA;;;IA9Bz06M,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;;EAuEip1M,MAAA,CAAA,EApE9o1M,gBAoE8o1M;EAAA,IAAA,CAAA,EAnEhp1M,aAmEgp1M;oBAlEro1M;IACnB,MAAA,CAAA,OADkC,sBAAA,CAClC,YAAA;4BAAA,uBAAA,CAAA,UAAA;;;;;;IAAA,MAAA,EAAA,MAAA;IAAA,MAAA,CAAA,EAiEwp1M,MAjExp1M,CAAA,MAAA,EAAA,OAAA,CAAA;;iEAiEwp1M,uBAAA,CAAA,UAAA;;ICvG3o1M,KAAA,EAAA,MAAA;IAEN,QAAA,EAAA,MAAA;IACmC,KAAA,EAAA,OAAA;EAAgB,CAAA;EAAE,UAAA,CAAA,EA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mBAAA,qBAEN;;WAGG;EHqE8o1M,IAAA,CAAA,EGpEhp1M,aHoEgp1M;EAAA,eAAA,CAAA,EGnEro1M,eHmEqo1M;IGlExp1M,MAAA,CAAA,OADkC,sBAAA,CAClC,YAAA;4BAAA,uBAAA,CAAA,UAAA;;;;;;;IHCA,MAAA,CAAA,EGuF2/zM,MHvF3/zM,CAAA,MAAA,EAAA,OAAA,CAAA;IAAA,QAAA,EAAA,MAAA,GAAA,IAAA;iEGuF2/zM,uBAAA,CAAA,UAAA;;;IF7H9+zM,QAAA,EAAA,MAAA;IAEN,KAAA,EAAA,OAAA;EACmC,CAAA;EAAgB,UAAA,CAAA,EAAA,OAAE;EAAA,WAAA,CAAA,EAAA,OAAA;;;;;;;;;EAkE2g3M,IAAA,iCAAA;CAAA,iBAAA,aAAA,wCAAA,CAAA"}
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,C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1M,MFnIzr1M,CAAA,MAAA,EAAA,OAAA,CAAA;IAAA,QAAA,EAAA,MAAA,GAAA,IAAA;iEEmIyr1M,uBAAA,CAAA,UAAA;;;IDzK5q1M,QAAA,EAAA,MAAA;IAEN,KAAA,EAAA,OAAA;EACmC,CAAA;EAAgB,UAAA,CAAA,EAAA,OAAE;EAAA,WAAA,CAAA,EAAA,OAAA;;;;;;;;;EAsEw66M,IAAA,iCAAA;CAAA,uDAAA,wCAAA,CAAA;;;;;;;;;;;AFtFv+6M;;;;;;;;;;;;;;;;;;;;;;;;;;AC2CA;;;;;;;;;;;;iBGDgB,mBAAA,qBAEN;;WAGG;EHsEsm5M,IAAA,CAAA,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"}
@@ -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;;EA8By06M,GAAA,EAAA,CAAA,IAAA,EAAA;IAAA,IAAA,oCAAA;;;;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;;;;;;;;;EAkE2g3M,IAAA,iCAAA;CAAA,iBAAA,aAAA,wCAAA,CAAA"}
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,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;EAAA,IAAA,iCAAA;;;;;;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A,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"}
@@ -1 +1 @@
1
- {"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,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,OAGjCC,EACJ,IAAkB,WACd,WACA,EACE,EACA,WAGFC,EAAmC,CACvC,GAAGC,EACH,GAAG,GAAS,gBACb,CAGKC,EAA6C,GAAS,OACxD,CACE,GAAG,EAAQ,OACX,WACE,EAAQ,OAAO,aACb,GAAQ,GAAG,EAAI,OAAS,EAAO,MAAM,GAAG,EAAI,QAAU,EAAO,UAClE,CACD,IAAA,GAEJ,OAAO,MAAO,EAAoB,CAChC,KACA,KAAM,eACN,YAAa,2BACb,WAAY,eACZ,aAAc,EACd,WAAY,GAAS,WACrB,OAAQ,EACR,SAAU,eACV,WAAY,CAAE,MAAO,EAAO,MAAO,OAAQ,EAAO,OAAQ,CAC1D,KAAM,EACN,kBAEA,UAAY,GACV,EAAO,IAAI,EA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AY,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"}
1
+ {"version":3,"file":"index.mjs","names":["DEFAULT_VIDEO_STREAMING_CONFIG","DEFAULT_VIDEO_STREAMING_CONFIG"],"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,EAA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AAO,EAAgB,SAAS,mBAAoB,CACzD,KAAM,yCACN,QAAS,CAAE,SAAQ,CACpB,CAAC,CAAC,UAAU,CAGf,GACE,EAAO,WAAa,IAAA,IACpB,EAAO,UAAY,IAAA,IACnB,EAAO,WAAa,EAAO,QAAU,EAAO,UAE5C,OAAO,MAAO,EAAgB,SAAS,mBAAoB,CACzD,KAAM,mEACN,QAAS,CAAE,SAAQ,CACpB,CAAC,CAAC,UAAU,CAGf,GAAI,EAAO,WAAa,IAAA,IAAa,EAAO,UAAY,EACtD,OAAO,MAAO,EAAgB,SAAS,mBAAoB,CACzD,KAAM,kCACN,QAAS,CAAE,SAAQ,CACpB,CAAC,CAAC,UAAU,CAIf,IAAM,EAAoB,EAAa,mBAAqB,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.20",
4
+ "version": "0.1.0",
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.20"
17
+ "@uploadista/core": "0.1.0"
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.4",
26
- "effect": "3.19.12",
27
- "tsdown": "0.18.0",
28
- "vitest": "4.0.15",
29
- "zod": "4.2.0",
30
- "@uploadista/typescript-config": "0.0.20"
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"
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
  }
@@ -100,7 +100,8 @@ export function createVideoResizeNode(
100
100
  ...options.naming,
101
101
  autoSuffix:
102
102
  options.naming.autoSuffix ??
103
- ((ctx) => `${ctx.width ?? params.width}x${ctx.height ?? params.height}`),
103
+ ((ctx) =>
104
+ `${ctx.width ?? params.width}x${ctx.height ?? params.height}`),
104
105
  }
105
106
  : undefined;
106
107
 
@@ -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(file, namingContext, namingConfig);
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 {
@@ -128,7 +128,8 @@ export function createTranscodeVideoNode(
128
128
  const namingConfig: FileNamingConfig = {
129
129
  ...options.naming,
130
130
  autoSuffix:
131
- options.naming.autoSuffix ?? ((ctx) => ctx.format ?? params.format),
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(inputStream, params);
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 { TestUploadServer, TestVideoPlugin } from "@uploadista/core/testing";
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.merge(TestUploadServer, TestVideoPlugin);
15
+ const TestLayer = Layer.mergeAll(TestUploadEngine, TestVideoPlugin);
16
16
 
17
17
  // Helper to create test video file
18
18
  const createTestVideoFile = (): UploadFile => ({