@nodaro/shared 3.61.0 → 3.63.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.
- package/dist/{chunk-4KYLNTR7.cjs → chunk-2PU3AGGS.cjs} +27 -4
- package/dist/chunk-2PU3AGGS.cjs.map +1 -0
- package/dist/{chunk-43TGSZRJ.js → chunk-2QKF7M2Z.js} +3 -3
- package/dist/{chunk-43TGSZRJ.js.map → chunk-2QKF7M2Z.js.map} +1 -1
- package/dist/{chunk-B6BG3LV2.js → chunk-34QLPTSA.js} +3 -3
- package/dist/{chunk-B6BG3LV2.js.map → chunk-34QLPTSA.js.map} +1 -1
- package/dist/chunk-3K24DWOH.js +453 -0
- package/dist/chunk-3K24DWOH.js.map +1 -0
- package/dist/{chunk-IRQ3SPX7.js → chunk-4DVWXEB6.js} +23 -4
- package/dist/chunk-4DVWXEB6.js.map +1 -0
- package/dist/{chunk-ZES6EZC4.js → chunk-4MMZD63H.js} +3 -3
- package/dist/{chunk-ZES6EZC4.js.map → chunk-4MMZD63H.js.map} +1 -1
- package/dist/{chunk-MQZRQ5LM.cjs → chunk-63H4C56Q.cjs} +8 -8
- package/dist/{chunk-MQZRQ5LM.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
- package/dist/{chunk-IVXSNW2B.cjs → chunk-6BZC2ZHC.cjs} +18 -332
- package/dist/chunk-6BZC2ZHC.cjs.map +1 -0
- package/dist/{chunk-M3SXUUWC.cjs → chunk-6FQBKI2A.cjs} +4 -11
- package/dist/chunk-6FQBKI2A.cjs.map +1 -0
- package/dist/{chunk-673E4KYC.js → chunk-6M563QE6.js} +134 -8
- package/dist/chunk-6M563QE6.js.map +1 -0
- package/dist/chunk-6TGB7ECA.cjs +48 -0
- package/dist/chunk-6TGB7ECA.cjs.map +1 -0
- package/dist/{chunk-XUJC6GHE.cjs → chunk-6XUG4L7X.cjs} +6 -6
- package/dist/{chunk-XUJC6GHE.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
- package/dist/{chunk-XZKFZMRT.cjs → chunk-77WU3V3J.cjs} +6 -6
- package/dist/{chunk-XZKFZMRT.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
- package/dist/{chunk-ZFJN23V4.cjs → chunk-A2PX5IRC.cjs} +4 -4
- package/dist/{chunk-ZFJN23V4.cjs.map → chunk-A2PX5IRC.cjs.map} +1 -1
- package/dist/{chunk-ZDBPQBAA.js → chunk-AE3AAJ4O.js} +3 -3
- package/dist/{chunk-ZDBPQBAA.js.map → chunk-AE3AAJ4O.js.map} +1 -1
- package/dist/chunk-ALRXY4QH.cjs +13 -0
- package/dist/chunk-ALRXY4QH.cjs.map +1 -0
- package/dist/{chunk-UARGJ5IZ.js → chunk-BMJVKYVB.js} +56 -12
- package/dist/chunk-BMJVKYVB.js.map +1 -0
- package/dist/{chunk-6XVHYD5R.js → chunk-CLAKSLXF.js} +4 -9
- package/dist/chunk-CLAKSLXF.js.map +1 -0
- package/dist/chunk-CTANEPMY.js +61 -0
- package/dist/chunk-CTANEPMY.js.map +1 -0
- package/dist/chunk-CZ5IQB3L.js +42 -0
- package/dist/chunk-CZ5IQB3L.js.map +1 -0
- package/dist/{chunk-WGKAOUEQ.cjs → chunk-D34K455O.cjs} +3 -2
- package/dist/chunk-D34K455O.cjs.map +1 -0
- package/dist/chunk-EPXGG27L.js +331 -0
- package/dist/chunk-EPXGG27L.js.map +1 -0
- package/dist/{chunk-3M4BNKFJ.cjs → chunk-F6WGGYQW.cjs} +167 -3
- package/dist/chunk-F6WGGYQW.cjs.map +1 -0
- package/dist/{chunk-7FCTCWHD.js → chunk-FXGNRYQQ.js} +3 -3
- package/dist/{chunk-7FCTCWHD.js.map → chunk-FXGNRYQQ.js.map} +1 -1
- package/dist/{chunk-ZNM2LW3D.cjs → chunk-GMBDLNLD.cjs} +105 -56
- package/dist/chunk-GMBDLNLD.cjs.map +1 -0
- package/dist/{chunk-NJVOJXBS.cjs → chunk-GSKLPI3J.cjs} +104 -49
- package/dist/chunk-GSKLPI3J.cjs.map +1 -0
- package/dist/{chunk-EWS2VFO4.js → chunk-HBXF6RUU.js} +4 -4
- package/dist/{chunk-EWS2VFO4.js.map → chunk-HBXF6RUU.js.map} +1 -1
- package/dist/{chunk-MOMFX32D.js → chunk-HWQ2SYNA.js} +194 -325
- package/dist/chunk-HWQ2SYNA.js.map +1 -0
- package/dist/{chunk-SCMTN57Y.js → chunk-IY3Y462W.js} +3 -3
- package/dist/{chunk-SCMTN57Y.js.map → chunk-IY3Y462W.js.map} +1 -1
- package/dist/{chunk-ZZGQRRN7.js → chunk-KCZHQH2O.js} +6 -306
- package/dist/chunk-KCZHQH2O.js.map +1 -0
- package/dist/{chunk-XROE3CAS.cjs → chunk-KHH54GRP.cjs} +120 -79
- package/dist/chunk-KHH54GRP.cjs.map +1 -0
- package/dist/{chunk-FVVD6XY2.js → chunk-KL6GAYTT.js} +13 -4
- package/dist/chunk-KL6GAYTT.js.map +1 -0
- package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
- package/dist/chunk-KMGCHV6O.js.map +1 -0
- package/dist/{chunk-FMXFHJWX.cjs → chunk-L2TVY6XN.cjs} +4 -4
- package/dist/{chunk-FMXFHJWX.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
- package/dist/{chunk-FQXRYPCX.cjs → chunk-LH72PQO2.cjs} +505 -68
- package/dist/chunk-LH72PQO2.cjs.map +1 -0
- package/dist/chunk-LMAQUR55.cjs +506 -0
- package/dist/chunk-LMAQUR55.cjs.map +1 -0
- package/dist/{chunk-F5YEMSNK.cjs → chunk-M5OCFGHF.cjs} +571 -30
- package/dist/chunk-M5OCFGHF.cjs.map +1 -0
- package/dist/{chunk-VOWJCUMR.js → chunk-MD4XHED4.js} +3 -3
- package/dist/{chunk-VOWJCUMR.js.map → chunk-MD4XHED4.js.map} +1 -1
- package/dist/chunk-N5HH46JF.cjs +68 -0
- package/dist/chunk-N5HH46JF.cjs.map +1 -0
- package/dist/{chunk-G4XWVWRI.js → chunk-NIAFR5EE.js} +5 -4
- package/dist/chunk-NIAFR5EE.js.map +1 -0
- package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
- package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
- package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
- package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
- package/dist/{chunk-SWVGHAYO.js → chunk-O7RZRUMZ.js} +110 -74
- package/dist/chunk-O7RZRUMZ.js.map +1 -0
- package/dist/{chunk-LLOIAGFB.js → chunk-OV3JTKBY.js} +449 -51
- package/dist/chunk-OV3JTKBY.js.map +1 -0
- package/dist/{chunk-A3FHTSLB.js → chunk-PSKZKLDG.js} +550 -31
- package/dist/chunk-PSKZKLDG.js.map +1 -0
- package/dist/{chunk-VB2ARGQ6.js → chunk-RGNHHIMN.js} +3 -3
- package/dist/chunk-RGNHHIMN.js.map +1 -0
- package/dist/chunk-SMOO5FAH.js +10 -0
- package/dist/chunk-SMOO5FAH.js.map +1 -0
- package/dist/{chunk-5XRRENHD.cjs → chunk-TM5JYSJF.cjs} +170 -17
- package/dist/chunk-TM5JYSJF.cjs.map +1 -0
- package/dist/{chunk-PONP5J5E.cjs → chunk-V24EPI5N.cjs} +13 -3
- package/dist/chunk-V24EPI5N.cjs.map +1 -0
- package/dist/{chunk-RQ4F3AJH.cjs → chunk-V5EEQR2U.cjs} +21 -21
- package/dist/{chunk-RQ4F3AJH.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
- package/dist/chunk-WZVIBAKN.cjs +351 -0
- package/dist/chunk-WZVIBAKN.cjs.map +1 -0
- package/dist/{chunk-5M43XMRB.cjs → chunk-X5BAFW3Q.cjs} +8 -8
- package/dist/{chunk-5M43XMRB.cjs.map → chunk-X5BAFW3Q.cjs.map} +1 -1
- package/dist/{chunk-RUHKBEFF.js → chunk-XBTYGQ6Z.js} +63 -10
- package/dist/chunk-XBTYGQ6Z.js.map +1 -0
- package/dist/{chunk-JHTT2V4A.cjs → chunk-XGGZWA4A.cjs} +118 -52
- package/dist/chunk-XGGZWA4A.cjs.map +1 -0
- package/dist/{chunk-5I4T4QR5.cjs → chunk-XGVJGNZW.cjs} +5 -5
- package/dist/{chunk-5I4T4QR5.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
- package/dist/{chunk-7ARKVJTN.cjs → chunk-Y35JQPT6.cjs} +228 -383
- package/dist/chunk-Y35JQPT6.cjs.map +1 -0
- package/dist/{chunk-AFQFGZN7.cjs → chunk-Y4GCJJPF.cjs} +8 -6
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-C77F4ZTL.js → chunk-YUER7TJG.js} +3 -3
- package/dist/{chunk-C77F4ZTL.js.map → chunk-YUER7TJG.js.map} +1 -1
- package/dist/{chunk-HGI2VKIV.js → chunk-YX6TFX7H.js} +67 -14
- package/dist/chunk-YX6TFX7H.js.map +1 -0
- package/dist/{chunk-TWF2OSH4.cjs → chunk-ZPE2ZTJ4.cjs} +4 -4
- package/dist/{chunk-TWF2OSH4.cjs.map → chunk-ZPE2ZTJ4.cjs.map} +1 -1
- package/dist/entries/apps.cjs +44 -44
- package/dist/entries/apps.js +9 -9
- package/dist/entries/credits.cjs +286 -153
- package/dist/entries/credits.d.cts +254 -5
- package/dist/entries/credits.d.ts +254 -5
- package/dist/entries/credits.js +14 -9
- package/dist/entries/entities.cjs +188 -143
- package/dist/entries/entities.d.cts +122 -1
- package/dist/entries/entities.d.ts +122 -1
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +85 -5
- package/dist/entries/llm-models.d.ts +85 -5
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +92 -87
- package/dist/entries/media.d.cts +19 -1
- package/dist/entries/media.d.ts +19 -1
- package/dist/entries/media.js +3 -2
- package/dist/entries/model-catalog.cjs +211 -103
- package/dist/entries/model-catalog.d.cts +135 -19
- package/dist/entries/model-catalog.d.ts +135 -19
- package/dist/entries/model-catalog.js +5 -5
- package/dist/entries/models.cjs +504 -295
- package/dist/entries/models.d.cts +71 -4
- package/dist/entries/models.d.ts +71 -4
- package/dist/entries/models.js +7 -6
- package/dist/entries/nodes.cjs +249 -233
- package/dist/entries/nodes.d.cts +35 -6
- package/dist/entries/nodes.d.ts +35 -6
- package/dist/entries/nodes.js +10 -10
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +3 -2
- package/dist/entries/pipeline.d.ts +3 -2
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/runtime-config.cjs +29 -29
- package/dist/entries/runtime-config.d.cts +10 -7
- package/dist/entries/runtime-config.d.ts +10 -7
- package/dist/entries/runtime-config.js +1 -1
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +8 -0
- package/dist/entries/types.d.ts +8 -0
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +316 -208
- package/dist/entries/video.d.cts +490 -99
- package/dist/entries/video.d.ts +490 -99
- package/dist/entries/video.js +8 -4
- package/dist/entries/workflow.cjs +102 -102
- package/dist/entries/workflow.d.cts +5 -4
- package/dist/entries/workflow.d.ts +5 -4
- package/dist/entries/workflow.js +2 -2
- package/dist/{gpt-image-2-6-BeZdT-pW.d.cts → gpt-image-2-6-jIRQBRag.d.cts} +6 -0
- package/dist/{gpt-image-2-6-BeZdT-pW.d.ts → gpt-image-2-6-jIRQBRag.d.ts} +6 -0
- package/dist/index.cjs +2727 -2092
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +30 -27
- package/dist/{model-catalog-BgSvskgY.d.ts → model-catalog-C_Eo35tL.d.cts} +158 -14
- package/dist/{model-catalog-BgSvskgY.d.cts → model-catalog-C_Eo35tL.d.ts} +158 -14
- package/dist/{model-constants-DHd9jwQ7.d.cts → model-constants-Bg4ccSQb.d.ts} +427 -34
- package/dist/{model-constants-DHd9jwQ7.d.ts → model-constants-DWcxOmaY.d.cts} +427 -34
- package/package.json +1 -1
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +194 -0
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +118 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +68 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +4 -1
- package/src/__tests__/grok-video-15-catalog.test.ts +189 -0
- package/src/__tests__/gvp-supported-providers.test.ts +32 -4
- package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
- package/src/__tests__/lip-sync-levers.test.ts +31 -0
- package/src/__tests__/llm-models.test.ts +132 -3
- package/src/__tests__/llm-price-key.test.ts +152 -1
- package/src/__tests__/minimax-h3-image.test.ts +140 -0
- package/src/__tests__/model-makers.test.ts +49 -11
- package/src/__tests__/model-tree.test.ts +13 -0
- package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
- package/src/__tests__/normalize-node-params.test.ts +25 -0
- package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
- package/src/__tests__/prompt-length-limits.test.ts +4 -0
- package/src/__tests__/retired-video-provider.test.ts +15 -5
- package/src/__tests__/seedance-25-catalog-modes.test.ts +1 -1
- package/src/__tests__/seedance-task-type.test.ts +188 -0
- package/src/__tests__/seedream-5-5.test.ts +117 -0
- package/src/__tests__/transcribe-capabilities.test.ts +39 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/unit-contract-compose.test.ts +27 -1
- package/src/__tests__/unit-contracts.test.ts +20 -6
- package/src/__tests__/upscale-factors.test.ts +107 -0
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-character-refs.test.ts +20 -2
- package/src/__tests__/video-collapse-parity.test.ts +19 -0
- package/src/__tests__/video-overlay-geometry.test.ts +68 -0
- package/src/__tests__/video-overlay-layer-plan.test.ts +3 -4
- package/src/__tests__/video-overlay-layouts.test.ts +529 -0
- package/src/__tests__/video-overlay-pricing.test.ts +61 -0
- package/src/__tests__/video-overlay-validate.test.ts +128 -0
- package/src/__tests__/video-overlay-wired-kind.test.ts +207 -0
- package/src/__tests__/video-overlay.test.ts +280 -194
- package/src/__tests__/video-ref-limits.test.ts +2 -1
- package/src/__tests__/video-reference-only.test.ts +6 -2
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-start-frame-only.test.ts +98 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/__tests__/wired-character-names.test.ts +220 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/index.ts +18 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-estimators/video-overlay.ts +70 -0
- package/src/credit-identifiers.ts +183 -16
- package/src/entity-image-url.ts +21 -0
- package/src/entries/credits.ts +26 -1
- package/src/entries/entities.ts +14 -0
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +44 -1
- package/src/entries/models.ts +69 -0
- package/src/entries/nodes.ts +4 -0
- package/src/entries/video.ts +7 -1
- package/src/freecut-protocol.ts +8 -0
- package/src/generated/unit-contracts.ts +8 -1
- package/src/gpt-image-2-6.ts +6 -0
- package/src/input-image-pricing.ts +76 -0
- package/src/lip-sync-levers.ts +56 -0
- package/src/lip-sync-pricing.ts +91 -1
- package/src/llm-models.ts +249 -4
- package/src/mask-composite.ts +11 -0
- package/src/minimax-h3-image.ts +61 -0
- package/src/model-catalog.ts +604 -40
- package/src/model-constants.ts +860 -55
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +15 -2
- package/src/node-execution-state.ts +4 -3
- package/src/normalize-node-params.ts +49 -1
- package/src/producer-types.ts +23 -1
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/seedance-task-type.ts +37 -0
- package/src/seedream-5-5.ts +45 -0
- package/src/transcribe-preflight.ts +58 -7
- package/src/unit-contract-compose.ts +4 -1
- package/src/upscale-factors.ts +111 -0
- package/src/video-character-refs.ts +7 -4
- package/src/video-duration.ts +9 -0
- package/src/video-overlay-geometry.ts +99 -0
- package/src/video-overlay-input.ts +25 -0
- package/src/video-overlay-layout-ids.ts +48 -0
- package/src/video-overlay-layouts.ts +315 -0
- package/src/video-overlay-validate.ts +223 -0
- package/src/video-overlay-video-layers.ts +304 -0
- package/src/video-overlay.ts +165 -297
- package/src/video-ui-defaults.ts +11 -7
- package/src/video-upscale-params.ts +67 -0
- package/src/wired-character-names.ts +202 -0
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-4KYLNTR7.cjs.map +0 -1
- package/dist/chunk-5XRRENHD.cjs.map +0 -1
- package/dist/chunk-673E4KYC.js.map +0 -1
- package/dist/chunk-6XVHYD5R.js.map +0 -1
- package/dist/chunk-7ARKVJTN.cjs.map +0 -1
- package/dist/chunk-7WGKP3EU.js +0 -23
- package/dist/chunk-7WGKP3EU.js.map +0 -1
- package/dist/chunk-A3FHTSLB.js.map +0 -1
- package/dist/chunk-AFQFGZN7.cjs.map +0 -1
- package/dist/chunk-F5YEMSNK.cjs.map +0 -1
- package/dist/chunk-FQXRYPCX.cjs.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-FVVD6XY2.js.map +0 -1
- package/dist/chunk-G4XWVWRI.js.map +0 -1
- package/dist/chunk-HGI2VKIV.js.map +0 -1
- package/dist/chunk-IRQ3SPX7.js.map +0 -1
- package/dist/chunk-IVXSNW2B.cjs.map +0 -1
- package/dist/chunk-JHTT2V4A.cjs.map +0 -1
- package/dist/chunk-KHZAQGRP.js +0 -17
- package/dist/chunk-KHZAQGRP.js.map +0 -1
- package/dist/chunk-LLOIAGFB.js.map +0 -1
- package/dist/chunk-M3SXUUWC.cjs.map +0 -1
- package/dist/chunk-MOMFX32D.js.map +0 -1
- package/dist/chunk-NCOGGRRP.cjs +0 -27
- package/dist/chunk-NCOGGRRP.cjs.map +0 -1
- package/dist/chunk-NJVOJXBS.cjs.map +0 -1
- package/dist/chunk-PONP5J5E.cjs.map +0 -1
- package/dist/chunk-RUHKBEFF.js.map +0 -1
- package/dist/chunk-SWVGHAYO.js.map +0 -1
- package/dist/chunk-UARGJ5IZ.js.map +0 -1
- package/dist/chunk-VB2ARGQ6.js.map +0 -1
- package/dist/chunk-WGKAOUEQ.cjs.map +0 -1
- package/dist/chunk-XROE3CAS.cjs.map +0 -1
- package/dist/chunk-ZLDFPVVI.cjs +0 -19
- package/dist/chunk-ZLDFPVVI.cjs.map +0 -1
- package/dist/chunk-ZNM2LW3D.cjs.map +0 -1
- package/dist/chunk-ZZGQRRN7.js.map +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { assembleVideoOverlayRequest, expandVideoOverlayLayer, expandVideoOverlayPresets, type VideoOverlayLayerInput } from "../video-overlay.js"
|
|
3
|
+
import { formatVideoOverlayError, hasDrawableVideoOverlayBox, validateVideoOverlayRequest, type VideoOverlayIssue } from "../video-overlay-validate.js"
|
|
4
|
+
|
|
5
|
+
const IMG = "https://cdn.example/a.png"
|
|
6
|
+
|
|
7
|
+
describe("hasDrawableVideoOverlayBox", () => {
|
|
8
|
+
it("a complete (expanded) layer is drawable", () => {
|
|
9
|
+
expect(hasDrawableVideoOverlayBox(expandVideoOverlayLayer({ imageUrl: IMG, start: 0 }))).toBe(true)
|
|
10
|
+
expect(hasDrawableVideoOverlayBox(expandVideoOverlayLayer({ imageUrl: IMG, start: 0, preset: "card" }))).toBe(true)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it("a stored partial box is not — the expansion leaves it as written, the geometry would throw", () => {
|
|
14
|
+
const noAnchor = { imageUrl: IMG, start: 0, width: 40 }
|
|
15
|
+
const nullAnchor = { imageUrl: IMG, start: 0, anchor: null, width: 30 }
|
|
16
|
+
expect(expandVideoOverlayLayer(noAnchor)).toBe(noAnchor)
|
|
17
|
+
expect(hasDrawableVideoOverlayBox(noAnchor)).toBe(false)
|
|
18
|
+
expect(hasDrawableVideoOverlayBox(nullAnchor)).toBe(false)
|
|
19
|
+
expect(hasDrawableVideoOverlayBox({ imageUrl: IMG, start: 0, anchor: "center" })).toBe(false)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it("an unknown anchor, a non-finite width or an out-of-range field is not", () => {
|
|
23
|
+
const ok = expandVideoOverlayLayer({ imageUrl: IMG, start: 0 })
|
|
24
|
+
expect(hasDrawableVideoOverlayBox({ ...ok, anchor: "middle" })).toBe(false)
|
|
25
|
+
expect(hasDrawableVideoOverlayBox({ ...ok, width: Number.NaN })).toBe(false)
|
|
26
|
+
expect(hasDrawableVideoOverlayBox({ ...ok, width: "40" })).toBe(false)
|
|
27
|
+
expect(hasDrawableVideoOverlayBox({ ...ok, x: 500 })).toBe(false)
|
|
28
|
+
expect(hasDrawableVideoOverlayBox(null)).toBe(false)
|
|
29
|
+
expect(hasDrawableVideoOverlayBox("layer")).toBe(false)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it("agrees with the validator: whatever it passes is drawable", () => {
|
|
33
|
+
const layers = [
|
|
34
|
+
expandVideoOverlayLayer({ imageUrl: IMG, start: 0, anchor: "top-left", width: 30 }),
|
|
35
|
+
expandVideoOverlayLayer({ imageUrl: IMG, start: 0, preset: "full-frame" }),
|
|
36
|
+
]
|
|
37
|
+
expect(validateVideoOverlayRequest({ layers }).ok).toBe(true)
|
|
38
|
+
for (const l of layers) expect(hasDrawableVideoOverlayBox(l)).toBe(true)
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe("validateVideoOverlayRequest (§3.5)", () => {
|
|
43
|
+
const ok = { imageUrl: IMG, start: 0 }
|
|
44
|
+
const fail = (body: Parameters<typeof validateVideoOverlayRequest>[0]) => validateVideoOverlayRequest(body) as VideoOverlayIssue
|
|
45
|
+
it("returns a code, the 0-based layer, the slot when present, and params — never English", () => {
|
|
46
|
+
const r = fail({ layers: [ok, ok, { imageUrl: IMG, start: 5, end: 4 }] })
|
|
47
|
+
expect(r).toEqual({ ok: false, code: "end_before_start", layer: 2, params: { start: 5, end: 4 } })
|
|
48
|
+
expect(formatVideoOverlayError(r)).toBe("layers[2]: end (4 s) must be after start (5 s)")
|
|
49
|
+
const s = fail({ layers: [{ imageUrl: IMG, start: 5, end: 4, slot: 3 }] })
|
|
50
|
+
expect(formatVideoOverlayError(s)).toBe("Layer 3: end (4 s) must be after start (5 s)")
|
|
51
|
+
})
|
|
52
|
+
it("layer count 1..20", () => {
|
|
53
|
+
expect(fail({ layers: [] }).code).toBe("no_layers")
|
|
54
|
+
const many = fail({ layers: Array.from({ length: 21 }, () => ok) })
|
|
55
|
+
expect(many.code).toBe("too_many_layers")
|
|
56
|
+
expect(formatVideoOverlayError(many)).toBe("At most 20 layers (got 21)")
|
|
57
|
+
})
|
|
58
|
+
it("times finite within 0..3600", () => {
|
|
59
|
+
expect(fail({ layers: [{ imageUrl: IMG, start: -1 }] }).code).toBe("time_out_of_range")
|
|
60
|
+
expect(fail({ layers: [{ imageUrl: IMG, start: 0, end: 3601 }] }).code).toBe("time_out_of_range")
|
|
61
|
+
expect(fail({ layers: [{ imageUrl: IMG, start: Number.POSITIVE_INFINITY }] }).code).toBe("time_out_of_range")
|
|
62
|
+
})
|
|
63
|
+
it("a no-preset partial box is incomplete_box; no preset and no box is fine before AND after expansion (D8)", () => {
|
|
64
|
+
const partial = fail({ layers: [{ start: 0, width: 40 }] })
|
|
65
|
+
expect(partial.code).toBe("incomplete_box")
|
|
66
|
+
expect(formatVideoOverlayError(partial)).toBe("layers[0]: anchor and width are required without a preset")
|
|
67
|
+
expect(validateVideoOverlayRequest({ layers: [{ imageUrl: IMG, start: 0 }] })).toEqual({ ok: true })
|
|
68
|
+
expect(validateVideoOverlayRequest({ layers: expandVideoOverlayPresets([{ imageUrl: IMG, start: 0 }]) })).toEqual({ ok: true })
|
|
69
|
+
expect(validateVideoOverlayRequest({ layers: [{ imageUrl: IMG, start: 0, preset: "card", width: 50 }] })).toEqual({ ok: true })
|
|
70
|
+
})
|
|
71
|
+
it("a present box / look field outside VIDEO_OVERLAY_BOUNDS or its enum / type is field_out_of_bounds (spec §4.4, the DAG path's only check)", () => {
|
|
72
|
+
const code = (extra: Record<string, unknown>) => {
|
|
73
|
+
const r = validateVideoOverlayRequest({ layers: [ok, { imageUrl: IMG, start: 0, anchor: "center", width: 30, ...extra } as VideoOverlayLayerInput] })
|
|
74
|
+
return r.ok ? "ok" : ([r.code, r.layer, r.params.field] as const)
|
|
75
|
+
}
|
|
76
|
+
expect(code({ width: 500, height: 100, fit: "cover" })).toEqual(["field_out_of_bounds", 1, "width"])
|
|
77
|
+
expect(code({ width: 101 })).toEqual(["field_out_of_bounds", 1, "width"])
|
|
78
|
+
expect(code({ width: "50" })).toEqual(["field_out_of_bounds", 1, "width"])
|
|
79
|
+
expect(code({ x: -101 })).toEqual(["field_out_of_bounds", 1, "x"])
|
|
80
|
+
expect(code({ height: 0 })).toEqual(["field_out_of_bounds", 1, "height"])
|
|
81
|
+
expect(code({ y: Number.NaN })).toEqual(["field_out_of_bounds", 1, "y"])
|
|
82
|
+
expect(code({ opacity: 5 })).toEqual(["field_out_of_bounds", 1, "opacity"])
|
|
83
|
+
expect(code({ opacity: 9 })).toEqual(["field_out_of_bounds", 1, "opacity"])
|
|
84
|
+
expect(code({ zIndex: 2.5 })).toEqual(["field_out_of_bounds", 1, "zIndex"])
|
|
85
|
+
expect(code({ zIndex: -3 })).toEqual(["field_out_of_bounds", 1, "zIndex"])
|
|
86
|
+
expect(code({ anchor: 7 })).toEqual(["field_out_of_bounds", 1, "anchor"])
|
|
87
|
+
expect(code({ anchor: "middle" })).toEqual(["field_out_of_bounds", 1, "anchor"])
|
|
88
|
+
expect(code({ fit: "stretch" })).toEqual(["field_out_of_bounds", 1, "fit"])
|
|
89
|
+
expect(code({ animate: "yes" })).toEqual(["field_out_of_bounds", 1, "animate"])
|
|
90
|
+
// null reads as absent; the bounds themselves are inclusive
|
|
91
|
+
expect(code({ height: null, zIndex: null, opacity: null })).toBe("ok")
|
|
92
|
+
expect(code({ x: -100, y: 100, width: 100, height: 1, opacity: 0, zIndex: 100, fit: "cover", animate: false })).toBe("ok")
|
|
93
|
+
})
|
|
94
|
+
it("field_out_of_bounds carries the slot, a symbolic range, and renders one English line", () => {
|
|
95
|
+
const r = fail({ layers: [{ imageUrl: IMG, start: 0, anchor: "center", width: 30, zIndex: 2.5, slot: 4 }] })
|
|
96
|
+
expect(r).toEqual({ ok: false, code: "field_out_of_bounds", layer: 0, slot: 4, params: { field: "zIndex", allowed: "integers 0..100" } })
|
|
97
|
+
expect(formatVideoOverlayError(r)).toBe("Layer 4: zIndex is out of range (allowed: integers 0..100)")
|
|
98
|
+
expect(fail({ layers: [{ imageUrl: IMG, start: 0, anchor: "center", width: 30, fit: "stretch" } as unknown as VideoOverlayLayerInput] }).params).toEqual({ field: "fit", allowed: "contain, cover" })
|
|
99
|
+
})
|
|
100
|
+
it("the bounds verdict is the same before and after the expansion (§3.5 order-independence)", () => {
|
|
101
|
+
const bad = [{ imageUrl: IMG, start: 0, preset: "card" as const, width: 500 }]
|
|
102
|
+
expect(fail({ layers: bad }).code).toBe("field_out_of_bounds")
|
|
103
|
+
expect(fail({ layers: expandVideoOverlayPresets(bad) }).code).toBe("field_out_of_bounds")
|
|
104
|
+
const good = [{ imageUrl: IMG, start: 0, preset: "card" as const }]
|
|
105
|
+
expect(validateVideoOverlayRequest({ layers: good })).toEqual({ ok: true })
|
|
106
|
+
expect(validateVideoOverlayRequest({ layers: expandVideoOverlayPresets(good) })).toEqual({ ok: true })
|
|
107
|
+
const noBoxBadLook = [{ imageUrl: IMG, start: 0, opacity: 5 }]
|
|
108
|
+
expect(fail({ layers: noBoxBadLook }).code).toBe("field_out_of_bounds")
|
|
109
|
+
expect(fail({ layers: expandVideoOverlayPresets(noBoxBadLook) }).code).toBe("field_out_of_bounds")
|
|
110
|
+
})
|
|
111
|
+
it("an assembled JSON-written layer with an unbounded box is refused before it reaches the geometry (the DAG path)", () => {
|
|
112
|
+
const req = assembleVideoOverlayRequest({
|
|
113
|
+
videoUrl: "v",
|
|
114
|
+
data: { layers: [{ anchor: "center", width: 100000, height: 100, fit: "cover", start: 0 } as VideoOverlayLayerInput] },
|
|
115
|
+
wiredImageUrls: [IMG],
|
|
116
|
+
})
|
|
117
|
+
expect(validateVideoOverlayRequest(req)).toMatchObject({ ok: false, code: "field_out_of_bounds", slot: 1, params: { field: "width" } })
|
|
118
|
+
const anchor = assembleVideoOverlayRequest({ videoUrl: "v", data: { layers: [{ anchor: 7, width: 30, start: 0 } as unknown as VideoOverlayLayerInput] }, wiredImageUrls: [IMG] })
|
|
119
|
+
expect(validateVideoOverlayRequest(anchor)).toMatchObject({ ok: false, code: "field_out_of_bounds", params: { field: "anchor" } })
|
|
120
|
+
})
|
|
121
|
+
it("every layer needs an image", () => {
|
|
122
|
+
expect(fail({ layers: [{ start: 0 }] }).code).toBe("layer_without_image")
|
|
123
|
+
})
|
|
124
|
+
it("baseFit / backgroundColor only with an outputAspect", () => {
|
|
125
|
+
expect(fail({ layers: [ok], baseFit: "contain" }).code).toBe("fit_without_aspect")
|
|
126
|
+
expect(validateVideoOverlayRequest({ layers: [ok], outputAspect: "9:16", baseFit: "contain", backgroundColor: "#ff0000" })).toEqual({ ok: true })
|
|
127
|
+
})
|
|
128
|
+
})
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a source wired to a Video Overlay layer handle draws as — the ONE rule
|
|
3
|
+
* both engines call (`videoOverlayWiredLayerKind`), step by step:
|
|
4
|
+
* 1. the medium the wire is known to carry: a pip row of its own, a declared
|
|
5
|
+
* port medium, or the source's effective type for that handle;
|
|
6
|
+
* 2. the producer sets, for a single-medium producer only;
|
|
7
|
+
* 3. the URL path's extension;
|
|
8
|
+
* 4. an image.
|
|
9
|
+
*/
|
|
10
|
+
import { describe, it, expect } from "vitest"
|
|
11
|
+
import { declaredOutputMediaType, listColumnMediaType, videoOverlayWireMediumBeforeRun as beforeRun, videoOverlayWiredLayerKind as kind } from "../video-overlay-video-layers.js"
|
|
12
|
+
import { DYNAMIC_PRODUCER_TYPES, IMAGE_PRODUCER_TYPES, VIDEO_PRODUCER_TYPES } from "../producer-types.js"
|
|
13
|
+
|
|
14
|
+
const NO_EXT = "https://cdn.example/signed/abc?token=1"
|
|
15
|
+
const MP4 = "https://cdn.example/a.mp4"
|
|
16
|
+
const PNG = "https://cdn.example/a.png"
|
|
17
|
+
|
|
18
|
+
describe("videoOverlayWiredLayerKind — 1. the medium the wire is known to carry", () => {
|
|
19
|
+
it("3D Render Pro: its stills pip is an image, its video pip a video — whatever the URL says", () => {
|
|
20
|
+
expect(kind({ type: "pro-3d-render", handle: "stills" }, MP4)).toBe("image")
|
|
21
|
+
expect(kind({ type: "pro-3d-render", handle: "stills" }, NO_EXT)).toBe("image")
|
|
22
|
+
expect(kind({ type: "pro-3d-render", handle: "video" }, NO_EXT)).toBe("video")
|
|
23
|
+
expect(kind({ type: "pro-3d-render", handle: "video" }, PNG)).toBe("video")
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it("a dynamic producer's video pip is a video, whatever its file is named; its other pips follow the file", () => {
|
|
27
|
+
const videoPips = [
|
|
28
|
+
["adjust-volume", "video-out"], ["pitch-tempo", "video-out"], ["voice-changer", "video"],
|
|
29
|
+
["voice-changer-pro", "video"], ["dubbing", "video"], ["split-media", "video"],
|
|
30
|
+
] as const
|
|
31
|
+
for (const [type, handle] of videoPips) {
|
|
32
|
+
expect(DYNAMIC_PRODUCER_TYPES.has(type)).toBe(true)
|
|
33
|
+
expect(kind({ type, handle }, NO_EXT)).toBe("video")
|
|
34
|
+
expect(kind({ type, handle }, MP4)).toBe("video")
|
|
35
|
+
}
|
|
36
|
+
expect(kind({ type: "adjust-volume", handle: "audio-out" }, NO_EXT)).toBe("image")
|
|
37
|
+
expect(kind({ type: "dubbing", handle: "audio" }, MP4)).toBe("video")
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it("a declared port medium (a component's or sub-workflow's) decides, before the URL", () => {
|
|
41
|
+
expect(kind({ type: "component", handle: "out_clip", declaredMediaType: "video" }, NO_EXT)).toBe("video")
|
|
42
|
+
expect(kind({ type: "sub-workflow", handle: "out_p", declaredMediaType: "video" }, PNG)).toBe("video")
|
|
43
|
+
expect(kind({ type: "sub-workflow", handle: "out_p", declaredMediaType: "image" }, MP4)).toBe("image")
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it("a declared medium that is neither (audio, text, any) decides nothing", () => {
|
|
47
|
+
expect(kind({ type: "sub-workflow", handle: "out_p", declaredMediaType: "any" }, MP4)).toBe("video")
|
|
48
|
+
expect(kind({ type: "sub-workflow", handle: "out_p", declaredMediaType: "audio" }, NO_EXT)).toBe("image")
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it("an aggregate lane carries its lane's medium", () => {
|
|
52
|
+
expect(kind({ type: "collect", handle: "out-video" }, NO_EXT)).toBe("video")
|
|
53
|
+
expect(kind({ type: "group", handle: "out-video" }, NO_EXT)).toBe("video")
|
|
54
|
+
expect(kind({ type: "collect", handle: "out-image" }, MP4)).toBe("image")
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it("a scraper's typed pips, an entity's image pip and an image output pip carry their medium", () => {
|
|
58
|
+
expect(kind({ type: "meta-ads-scrape", handle: "video" }, NO_EXT)).toBe("video")
|
|
59
|
+
expect(kind({ type: "instagram-scrape", handle: "image" }, MP4)).toBe("image")
|
|
60
|
+
expect(kind({ type: "character", handle: "image" }, MP4)).toBe("image")
|
|
61
|
+
expect(kind({ type: "ugc-creator", handle: "image" }, MP4)).toBe("image")
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
describe("videoOverlayWiredLayerKind — 2. a single-medium producer", () => {
|
|
66
|
+
it("a video producer is a video, an image producer an image", () => {
|
|
67
|
+
expect(kind({ type: "generate-video" }, NO_EXT)).toBe("video")
|
|
68
|
+
expect(kind({ type: "upload-video", handle: "video" }, PNG)).toBe("video")
|
|
69
|
+
expect(kind({ type: "generate-image" }, MP4)).toBe("image")
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it("a producer in both sets decides nothing on a pip with no row of its own: the URL does", () => {
|
|
73
|
+
const both = [...VIDEO_PRODUCER_TYPES].filter((t) => IMAGE_PRODUCER_TYPES.has(t))
|
|
74
|
+
expect(both).toContain("pro-3d-render")
|
|
75
|
+
for (const type of both) {
|
|
76
|
+
expect(kind({ type, handle: "composition" }, MP4)).toBe("video")
|
|
77
|
+
expect(kind({ type }, PNG)).toBe("image")
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it("a dynamic producer decides nothing: the URL does", () => {
|
|
82
|
+
for (const type of DYNAMIC_PRODUCER_TYPES) {
|
|
83
|
+
expect(kind({ type }, MP4)).toBe("video")
|
|
84
|
+
expect(kind({ type }, NO_EXT)).toBe("image")
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
describe("videoOverlayWiredLayerKind — 3. the URL, then 4. an image", () => {
|
|
90
|
+
it("a source of no known kind reads by its path, and is an image otherwise", () => {
|
|
91
|
+
expect(kind({ type: "some-future-node", handle: "out" }, "https://x/a.webm?sig=1")).toBe("video")
|
|
92
|
+
expect(kind({ type: "some-future-node" }, NO_EXT)).toBe("image")
|
|
93
|
+
expect(kind({}, NO_EXT)).toBe("image")
|
|
94
|
+
expect(kind({ type: null, handle: null, declaredMediaType: null }, MP4)).toBe("video")
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
describe("declaredOutputMediaType — the medium a component / sub-workflow port declares", () => {
|
|
99
|
+
it("a sub-workflow's output port, by `out_<port>`", () => {
|
|
100
|
+
const data = { routeSnapshot: { outputPorts: [{ id: "p1", mediaType: "video" }, { id: "p2", mediaType: "image" }] } }
|
|
101
|
+
expect(declaredOutputMediaType("sub-workflow", data, "out_p1")).toBe("video")
|
|
102
|
+
expect(declaredOutputMediaType("sub-workflow", data, "out_p2")).toBe("image")
|
|
103
|
+
expect(declaredOutputMediaType("sub-workflow", data, "out_p3")).toBeUndefined()
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it("a component's output, from its route snapshot, else its metadata", () => {
|
|
107
|
+
const meta = { componentMetadata: { outputs: [{ id: "clip", type: "video" }] } }
|
|
108
|
+
expect(declaredOutputMediaType("component", meta, "out_clip")).toBe("video")
|
|
109
|
+
expect(declaredOutputMediaType("component", { ...meta, routeSnapshot: { outputPorts: [{ id: "clip", mediaType: "image" }] } }, "out_clip")).toBe("image")
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it("a sub-workflow input port, by its own id", () => {
|
|
113
|
+
expect(declaredOutputMediaType("sub-workflow-input", { ports: [{ id: "in1", mediaType: "video" }] }, "in1")).toBe("video")
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
it("a List's column type is not a port declaration", () => {
|
|
117
|
+
expect(declaredOutputMediaType("list", { columns: [{ handleId: "c", type: "video-url" }] }, "c")).toBeUndefined()
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
it("anything else, or malformed data, declares nothing", () => {
|
|
121
|
+
expect(declaredOutputMediaType("generate-video", { routeSnapshot: { outputPorts: [{ id: "p", mediaType: "video" }] } }, "out_p")).toBeUndefined()
|
|
122
|
+
expect(declaredOutputMediaType("sub-workflow", { routeSnapshot: { outputPorts: [{ id: "p", mediaType: "video" }] } }, null)).toBeUndefined()
|
|
123
|
+
expect(declaredOutputMediaType("sub-workflow", { routeSnapshot: { outputPorts: "p" } }, "out_p")).toBeUndefined()
|
|
124
|
+
expect(declaredOutputMediaType("sub-workflow", { routeSnapshot: { outputPorts: [null, 7, { id: "p", mediaType: 3 }] } }, "out_p")).toBeUndefined()
|
|
125
|
+
expect(declaredOutputMediaType("component", null, "out_p")).toBeUndefined()
|
|
126
|
+
expect(declaredOutputMediaType(undefined, {}, "out_p")).toBeUndefined()
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
describe("listColumnMediaType — what a List column's type declares", () => {
|
|
131
|
+
it("the column the pip names, else the first (the one a List's own `list` pip carries)", () => {
|
|
132
|
+
const data = { columns: [{ id: "a", handleId: "col_a", type: "image-url" }, { id: "b", handleId: "col_b", type: "video-url" }, { id: "c", handleId: "col_c", type: "text" }] }
|
|
133
|
+
expect(listColumnMediaType("list", data, "col_a")).toBe("image")
|
|
134
|
+
expect(listColumnMediaType("list", data, "col_b")).toBe("video")
|
|
135
|
+
expect(listColumnMediaType("list", data, "list")).toBe("image")
|
|
136
|
+
expect(listColumnMediaType("list", data, "col_c")).toBeUndefined()
|
|
137
|
+
expect(listColumnMediaType("list", { columns: [{ handleId: "x", type: "audio-url" }] }, "x")).toBe("audio")
|
|
138
|
+
})
|
|
139
|
+
it("nothing for another source, legacy items, or malformed data", () => {
|
|
140
|
+
expect(listColumnMediaType("sub-workflow", { columns: [{ handleId: "x", type: "video-url" }] }, "x")).toBeUndefined()
|
|
141
|
+
expect(listColumnMediaType("list", { items: "https://x/a.mp4" }, "list")).toBeUndefined()
|
|
142
|
+
expect(listColumnMediaType("list", { columns: "image-url" }, "list")).toBeUndefined()
|
|
143
|
+
expect(listColumnMediaType("list", null, "list")).toBeUndefined()
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
describe("videoOverlayWiredLayerKind — a List column's type ranks below the URL's extension", () => {
|
|
148
|
+
const videoColumn = { type: "list", handle: "list", columnMediaType: "video" }
|
|
149
|
+
const imageColumn = { type: "list", handle: "list", columnMediaType: "image" }
|
|
150
|
+
it("a recognisable extension wins: a .png in a video-url column is an image, an .mp4 in an image-url column a video", () => {
|
|
151
|
+
expect(kind(videoColumn, PNG)).toBe("image")
|
|
152
|
+
expect(kind(videoColumn, "https://x/a.JPG?sig=1")).toBe("image")
|
|
153
|
+
expect(kind(imageColumn, MP4)).toBe("video")
|
|
154
|
+
})
|
|
155
|
+
it("the column type fills the gap for a link with no recognisable extension", () => {
|
|
156
|
+
expect(kind(videoColumn, NO_EXT)).toBe("video")
|
|
157
|
+
expect(kind(imageColumn, NO_EXT)).toBe("image")
|
|
158
|
+
expect(kind({ type: "list", handle: "list", columnMediaType: "audio" }, NO_EXT)).toBe("image")
|
|
159
|
+
})
|
|
160
|
+
it("a producer, a pip row or a declared port still decides before the file", () => {
|
|
161
|
+
expect(kind({ type: "upload-image", columnMediaType: "video" }, NO_EXT)).toBe("image")
|
|
162
|
+
expect(kind({ type: "sub-workflow", handle: "out_p", declaredMediaType: "image", columnMediaType: "video" }, MP4)).toBe("image")
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
describe("videoOverlayWireMediumBeforeRun — what a wire hands a Video Overlay, as far as it is known before the run", () => {
|
|
167
|
+
it("a layer wire whose source decides by itself: the producer, a pip row, a declared port", () => {
|
|
168
|
+
expect(beforeRun({ type: "upload-video" })).toBe("video")
|
|
169
|
+
expect(beforeRun({ type: "upload-image" })).toBe("image")
|
|
170
|
+
expect(beforeRun({ type: "pro-3d-render", handle: "stills" })).toBe("image")
|
|
171
|
+
expect(beforeRun({ type: "sub-workflow", handle: "out_p", declaredMediaType: "video" })).toBe("video")
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
it("a layer wire whose kind follows its file: the known files decide (extension, then column type), else it is not known", () => {
|
|
175
|
+
expect(beforeRun({ type: "list", handle: "list" })).toBe("unknown")
|
|
176
|
+
// A declared column type alone does not decide: an extension in a cell outranks it.
|
|
177
|
+
expect(beforeRun({ type: "list", handle: "list", columnMediaType: "image" })).toBe("unknown")
|
|
178
|
+
expect(beforeRun({ type: "list", handle: "list" }, { knownUrls: [PNG, "https://x/b.jpg"] })).toBe("image")
|
|
179
|
+
expect(beforeRun({ type: "list", handle: "list" }, { knownUrls: [PNG, MP4] })).toBe("video")
|
|
180
|
+
expect(beforeRun({ type: "list", handle: "list", columnMediaType: "video" }, { knownUrls: [PNG] })).toBe("image")
|
|
181
|
+
expect(beforeRun({ type: "list", handle: "list", columnMediaType: "video" }, { knownUrls: [NO_EXT] })).toBe("video")
|
|
182
|
+
expect(beforeRun({ type: "text", handle: "text" })).toBe("unknown")
|
|
183
|
+
expect(beforeRun({ type: "sub-workflow", handle: "out_p" })).toBe("unknown")
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
it("never disagrees with the run's rule once the file is known", () => {
|
|
187
|
+
const sources = [
|
|
188
|
+
{ type: "list" }, { type: "list", columnMediaType: "video" }, { type: "list", columnMediaType: "image" },
|
|
189
|
+
{ type: "upload-image" }, { type: "upload-video" }, { type: "pro-3d-render", handle: "video" },
|
|
190
|
+
]
|
|
191
|
+
for (const source of sources) {
|
|
192
|
+
for (const url of [PNG, MP4, NO_EXT]) expect(beforeRun(source, { knownUrls: [url] })).toBe(kind(source, url))
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
it("on the plan handle only a plan pip row answers image: UGC Cards' plan is its card images", () => {
|
|
197
|
+
expect(beforeRun({ type: "ugc-cards", handle: "layerPlan" }, { target: "plan" })).toBe("image")
|
|
198
|
+
expect(beforeRun({ type: "ugc-cards", handle: "captionPlan" }, { target: "plan" })).toBe("unknown")
|
|
199
|
+
// A declared image port, an image producer, an image List column, a layer pip row: what a FILE is, not a plan's layers.
|
|
200
|
+
expect(beforeRun({ type: "sub-workflow", handle: "out_p", declaredMediaType: "image" }, { target: "plan" })).toBe("unknown")
|
|
201
|
+
expect(beforeRun({ type: "upload-image" }, { target: "plan" })).toBe("unknown")
|
|
202
|
+
expect(beforeRun({ type: "list", handle: "list", columnMediaType: "image" }, { target: "plan", knownUrls: [PNG] })).toBe("unknown")
|
|
203
|
+
expect(beforeRun({ type: "pro-3d-render", handle: "stills" }, { target: "plan" })).toBe("unknown")
|
|
204
|
+
expect(beforeRun({ type: "text", handle: "text" }, { target: "plan" })).toBe("unknown")
|
|
205
|
+
expect(beforeRun({ type: "upload-video" }, { target: "plan" })).toBe("video")
|
|
206
|
+
})
|
|
207
|
+
})
|