@nodaro/shared 3.31.0 → 3.33.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/README.md +17 -0
- package/dist/chunk-23FJQTEA.js +1604 -0
- package/dist/chunk-23FJQTEA.js.map +1 -0
- package/dist/chunk-2NIQO2J3.cjs +54 -0
- package/dist/chunk-2NIQO2J3.cjs.map +1 -0
- package/dist/chunk-2NQLSLSN.cjs +19 -0
- package/dist/chunk-2NQLSLSN.cjs.map +1 -0
- package/dist/chunk-2OJIVO7R.cjs +32 -0
- package/dist/chunk-2OJIVO7R.cjs.map +1 -0
- package/dist/chunk-2RF4Z7KG.cjs +803 -0
- package/dist/chunk-2RF4Z7KG.cjs.map +1 -0
- package/dist/chunk-3RYKIUAE.js +86 -0
- package/dist/chunk-3RYKIUAE.js.map +1 -0
- package/dist/chunk-44I73CQS.cjs +194 -0
- package/dist/chunk-44I73CQS.cjs.map +1 -0
- package/dist/chunk-5PC6JBGJ.cjs +1419 -0
- package/dist/chunk-5PC6JBGJ.cjs.map +1 -0
- package/dist/chunk-5RU2HCW2.js +30 -0
- package/dist/chunk-5RU2HCW2.js.map +1 -0
- package/dist/chunk-5RYLK3MQ.js +267 -0
- package/dist/chunk-5RYLK3MQ.js.map +1 -0
- package/dist/chunk-5THUHJ3E.js +46 -0
- package/dist/chunk-5THUHJ3E.js.map +1 -0
- package/dist/chunk-6DAWSVX2.cjs +103 -0
- package/dist/chunk-6DAWSVX2.cjs.map +1 -0
- package/dist/chunk-6WZ2VN7V.js +920 -0
- package/dist/chunk-6WZ2VN7V.js.map +1 -0
- package/dist/chunk-7G7G42KS.js +86 -0
- package/dist/chunk-7G7G42KS.js.map +1 -0
- package/dist/chunk-7Z5LUTGU.js +1567 -0
- package/dist/chunk-7Z5LUTGU.js.map +1 -0
- package/dist/chunk-AINCI23X.js +2171 -0
- package/dist/chunk-AINCI23X.js.map +1 -0
- package/dist/chunk-BG5D5CZ6.js +1922 -0
- package/dist/chunk-BG5D5CZ6.js.map +1 -0
- package/dist/chunk-CK3GK34R.js +1381 -0
- package/dist/chunk-CK3GK34R.js.map +1 -0
- package/dist/chunk-CUH22J4D.js +17 -0
- package/dist/chunk-CUH22J4D.js.map +1 -0
- package/dist/chunk-D26ENTN2.cjs +1770 -0
- package/dist/chunk-D26ENTN2.cjs.map +1 -0
- package/dist/chunk-D6GNRSCV.cjs +2017 -0
- package/dist/chunk-D6GNRSCV.cjs.map +1 -0
- package/dist/chunk-FBV5DF6D.js +95 -0
- package/dist/chunk-FBV5DF6D.js.map +1 -0
- package/dist/chunk-FG4E7MTG.cjs +4 -0
- package/dist/chunk-FG4E7MTG.cjs.map +1 -0
- package/dist/chunk-FT5CF6IA.js +42 -0
- package/dist/chunk-FT5CF6IA.js.map +1 -0
- package/dist/chunk-G6IIVKMO.js +26 -0
- package/dist/chunk-G6IIVKMO.js.map +1 -0
- package/dist/chunk-HC7VKIV5.cjs +430 -0
- package/dist/chunk-HC7VKIV5.cjs.map +1 -0
- package/dist/chunk-HGC5JNVA.cjs +1503 -0
- package/dist/chunk-HGC5JNVA.cjs.map +1 -0
- package/dist/chunk-HKFMXNVQ.cjs +1273 -0
- package/dist/chunk-HKFMXNVQ.cjs.map +1 -0
- package/dist/chunk-HRXEZ3SX.cjs +526 -0
- package/dist/chunk-HRXEZ3SX.cjs.map +1 -0
- package/dist/chunk-HSHCCBIV.js +255 -0
- package/dist/chunk-HSHCCBIV.js.map +1 -0
- package/dist/chunk-HUR6ZJ7S.cjs +159 -0
- package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
- package/dist/chunk-J7BMO73N.cjs +114 -0
- package/dist/chunk-J7BMO73N.cjs.map +1 -0
- package/dist/chunk-JFS3NWZ5.cjs +1714 -0
- package/dist/chunk-JFS3NWZ5.cjs.map +1 -0
- package/dist/chunk-JL4C5VJ7.cjs +488 -0
- package/dist/chunk-JL4C5VJ7.cjs.map +1 -0
- package/dist/chunk-JSGIEF6Z.cjs +1087 -0
- package/dist/chunk-JSGIEF6Z.cjs.map +1 -0
- package/dist/chunk-JWA5SGCS.js +203 -0
- package/dist/chunk-JWA5SGCS.js.map +1 -0
- package/dist/chunk-K3LLGRK7.cjs +3545 -0
- package/dist/chunk-K3LLGRK7.cjs.map +1 -0
- package/dist/chunk-KU6S7IYV.cjs +210 -0
- package/dist/chunk-KU6S7IYV.cjs.map +1 -0
- package/dist/chunk-M36G6SRP.js +447 -0
- package/dist/chunk-M36G6SRP.js.map +1 -0
- package/dist/chunk-M7GQBRZU.cjs +1963 -0
- package/dist/chunk-M7GQBRZU.cjs.map +1 -0
- package/dist/chunk-MRXGWL42.cjs +4 -0
- package/dist/chunk-MRXGWL42.cjs.map +1 -0
- package/dist/chunk-NEJ2PV4C.cjs +211 -0
- package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
- package/dist/chunk-OTATNBMD.js +141 -0
- package/dist/chunk-OTATNBMD.js.map +1 -0
- package/dist/chunk-OZSACQ2V.js +471 -0
- package/dist/chunk-OZSACQ2V.js.map +1 -0
- package/dist/chunk-PHZ23DP3.js +1782 -0
- package/dist/chunk-PHZ23DP3.js.map +1 -0
- package/dist/chunk-PQHS255G.js +1369 -0
- package/dist/chunk-PQHS255G.js.map +1 -0
- package/dist/chunk-PRYE7AZQ.cjs +1227 -0
- package/dist/chunk-PRYE7AZQ.cjs.map +1 -0
- package/dist/chunk-PVJBAPYJ.js +404 -0
- package/dist/chunk-PVJBAPYJ.js.map +1 -0
- package/dist/chunk-PXFQVLBX.js +776 -0
- package/dist/chunk-PXFQVLBX.js.map +1 -0
- package/dist/chunk-QA3MVQ32.js +21 -0
- package/dist/chunk-QA3MVQ32.js.map +1 -0
- package/dist/chunk-QJRP44ZO.js +769 -0
- package/dist/chunk-QJRP44ZO.js.map +1 -0
- package/dist/chunk-SAW5OK36.cjs +54 -0
- package/dist/chunk-SAW5OK36.cjs.map +1 -0
- package/dist/chunk-SES6GDBQ.cjs +624 -0
- package/dist/chunk-SES6GDBQ.cjs.map +1 -0
- package/dist/chunk-SFW3UB2P.js +31 -0
- package/dist/chunk-SFW3UB2P.js.map +1 -0
- package/dist/chunk-TNPDV7I4.cjs +2346 -0
- package/dist/chunk-TNPDV7I4.cjs.map +1 -0
- package/dist/chunk-TU33KYKW.cjs +25 -0
- package/dist/chunk-TU33KYKW.cjs.map +1 -0
- package/dist/chunk-TZBIY5C3.js +187 -0
- package/dist/chunk-TZBIY5C3.js.map +1 -0
- package/dist/chunk-TZE673G6.js +3 -0
- package/dist/chunk-TZE673G6.js.map +1 -0
- package/dist/chunk-UCFWI6D4.js +29 -0
- package/dist/chunk-UCFWI6D4.js.map +1 -0
- package/dist/chunk-UTQSSKSG.js +1164 -0
- package/dist/chunk-UTQSSKSG.js.map +1 -0
- package/dist/chunk-VA42637J.cjs +287 -0
- package/dist/chunk-VA42637J.cjs.map +1 -0
- package/dist/chunk-VNQRI2RO.cjs +1047 -0
- package/dist/chunk-VNQRI2RO.cjs.map +1 -0
- package/dist/chunk-VXPLKQWY.cjs +821 -0
- package/dist/chunk-VXPLKQWY.cjs.map +1 -0
- package/dist/chunk-WD6HJRBG.cjs +197 -0
- package/dist/chunk-WD6HJRBG.cjs.map +1 -0
- package/dist/chunk-WDIBOWAA.js +1054 -0
- package/dist/chunk-WDIBOWAA.js.map +1 -0
- package/dist/chunk-WKOIGLQX.cjs +38 -0
- package/dist/chunk-WKOIGLQX.cjs.map +1 -0
- package/dist/chunk-WNVQ3SMB.cjs +96 -0
- package/dist/chunk-WNVQ3SMB.cjs.map +1 -0
- package/dist/chunk-WRSWH7US.cjs +285 -0
- package/dist/chunk-WRSWH7US.cjs.map +1 -0
- package/dist/chunk-XGFTL5XY.js +181 -0
- package/dist/chunk-XGFTL5XY.js.map +1 -0
- package/dist/chunk-XNISPHTZ.js +1039 -0
- package/dist/chunk-XNISPHTZ.js.map +1 -0
- package/dist/chunk-Y2PM3FFL.js +3 -0
- package/dist/chunk-Y2PM3FFL.js.map +1 -0
- package/dist/chunk-YBPBK5KI.js +1030 -0
- package/dist/chunk-YBPBK5KI.js.map +1 -0
- package/dist/chunk-YWNYGYI7.cjs +31 -0
- package/dist/chunk-YWNYGYI7.cjs.map +1 -0
- package/dist/chunk-YYV35XOS.js +122 -0
- package/dist/chunk-YYV35XOS.js.map +1 -0
- package/dist/chunk-Z2OL5AJD.cjs +133 -0
- package/dist/chunk-Z2OL5AJD.cjs.map +1 -0
- package/dist/chunk-ZDFHA2EC.js +572 -0
- package/dist/chunk-ZDFHA2EC.js.map +1 -0
- package/dist/chunk-ZL7UM6PU.cjs +34 -0
- package/dist/chunk-ZL7UM6PU.cjs.map +1 -0
- package/dist/chunk-ZNZDQAXN.js +175 -0
- package/dist/chunk-ZNZDQAXN.js.map +1 -0
- package/dist/chunk-ZO5PBBFX.js +3497 -0
- package/dist/chunk-ZO5PBBFX.js.map +1 -0
- package/dist/chunk-ZRL2UFTH.cjs +1073 -0
- package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
- package/dist/entries/apps.cjs +155 -0
- package/dist/entries/apps.cjs.map +1 -0
- package/dist/entries/apps.d.cts +292 -0
- package/dist/entries/apps.d.ts +292 -0
- package/dist/entries/apps.js +10 -0
- package/dist/entries/apps.js.map +1 -0
- package/dist/entries/captions.cjs +124 -0
- package/dist/entries/captions.cjs.map +1 -0
- package/dist/entries/captions.d.cts +354 -0
- package/dist/entries/captions.d.ts +354 -0
- package/dist/entries/captions.js +3 -0
- package/dist/entries/captions.js.map +1 -0
- package/dist/entries/catalogs.cjs +165 -0
- package/dist/entries/catalogs.cjs.map +1 -0
- package/dist/entries/catalogs.d.cts +385 -0
- package/dist/entries/catalogs.d.ts +385 -0
- package/dist/entries/catalogs.js +4 -0
- package/dist/entries/catalogs.js.map +1 -0
- package/dist/entries/credits.cjs +596 -0
- package/dist/entries/credits.cjs.map +1 -0
- package/dist/entries/credits.d.cts +1460 -0
- package/dist/entries/credits.d.ts +1460 -0
- package/dist/entries/credits.js +11 -0
- package/dist/entries/credits.js.map +1 -0
- package/dist/entries/edl.cjs +409 -0
- package/dist/entries/edl.cjs.map +1 -0
- package/dist/entries/edl.d.cts +1199 -0
- package/dist/entries/edl.d.ts +1199 -0
- package/dist/entries/edl.js +4 -0
- package/dist/entries/edl.js.map +1 -0
- package/dist/entries/entities.cjs +530 -0
- package/dist/entries/entities.cjs.map +1 -0
- package/dist/entries/entities.d.cts +1371 -0
- package/dist/entries/entities.d.ts +1371 -0
- package/dist/entries/entities.js +5 -0
- package/dist/entries/entities.js.map +1 -0
- package/dist/entries/i18n.cjs +48 -0
- package/dist/entries/i18n.cjs.map +1 -0
- package/dist/entries/i18n.d.cts +69 -0
- package/dist/entries/i18n.d.ts +69 -0
- package/dist/entries/i18n.js +3 -0
- package/dist/entries/i18n.js.map +1 -0
- package/dist/entries/llm-models.cjs +177 -0
- package/dist/entries/llm-models.cjs.map +1 -0
- package/dist/entries/llm-models.d.cts +435 -0
- package/dist/entries/llm-models.d.ts +435 -0
- package/dist/entries/llm-models.js +4 -0
- package/dist/entries/llm-models.js.map +1 -0
- package/dist/entries/media.cjs +335 -0
- package/dist/entries/media.cjs.map +1 -0
- package/dist/entries/media.d.cts +518 -0
- package/dist/entries/media.d.ts +518 -0
- package/dist/entries/media.js +6 -0
- package/dist/entries/media.js.map +1 -0
- package/dist/entries/model-catalog.cjs +259 -0
- package/dist/entries/model-catalog.cjs.map +1 -0
- package/dist/entries/model-catalog.d.cts +202 -0
- package/dist/entries/model-catalog.d.ts +202 -0
- package/dist/entries/model-catalog.js +6 -0
- package/dist/entries/model-catalog.js.map +1 -0
- package/dist/entries/models.cjs +833 -0
- package/dist/entries/models.cjs.map +1 -0
- package/dist/entries/models.d.cts +287 -0
- package/dist/entries/models.d.ts +287 -0
- package/dist/entries/models.js +8 -0
- package/dist/entries/models.js.map +1 -0
- package/dist/entries/nodes.cjs +789 -0
- package/dist/entries/nodes.cjs.map +1 -0
- package/dist/entries/nodes.d.cts +1600 -0
- package/dist/entries/nodes.d.ts +1600 -0
- package/dist/entries/nodes.js +16 -0
- package/dist/entries/nodes.js.map +1 -0
- package/dist/entries/organizations.cjs +80 -0
- package/dist/entries/organizations.cjs.map +1 -0
- package/dist/entries/organizations.d.cts +466 -0
- package/dist/entries/organizations.d.ts +466 -0
- package/dist/entries/organizations.js +3 -0
- package/dist/entries/organizations.js.map +1 -0
- package/dist/entries/pipeline.cjs +594 -0
- package/dist/entries/pipeline.cjs.map +1 -0
- package/dist/entries/pipeline.d.cts +2617 -0
- package/dist/entries/pipeline.d.ts +2617 -0
- package/dist/entries/pipeline.js +5 -0
- package/dist/entries/pipeline.js.map +1 -0
- package/dist/entries/scene3d.cjs +704 -0
- package/dist/entries/scene3d.cjs.map +1 -0
- package/dist/entries/scene3d.d.cts +4284 -0
- package/dist/entries/scene3d.d.ts +4284 -0
- package/dist/entries/scene3d.js +3 -0
- package/dist/entries/scene3d.js.map +1 -0
- package/dist/entries/social.cjs +714 -0
- package/dist/entries/social.cjs.map +1 -0
- package/dist/entries/social.d.cts +1366 -0
- package/dist/entries/social.d.ts +1366 -0
- package/dist/entries/social.js +5 -0
- package/dist/entries/social.js.map +1 -0
- package/dist/entries/types.cjs +13 -0
- package/dist/entries/types.cjs.map +1 -0
- package/dist/entries/types.d.cts +162 -0
- package/dist/entries/types.d.ts +162 -0
- package/dist/entries/types.js +4 -0
- package/dist/entries/types.js.map +1 -0
- package/dist/entries/ugc.cjs +279 -0
- package/dist/entries/ugc.cjs.map +1 -0
- package/dist/entries/ugc.d.cts +575 -0
- package/dist/entries/ugc.d.ts +575 -0
- package/dist/entries/ugc.js +6 -0
- package/dist/entries/ugc.js.map +1 -0
- package/dist/entries/video.cjs +549 -0
- package/dist/entries/video.cjs.map +1 -0
- package/dist/entries/video.d.cts +1791 -0
- package/dist/entries/video.d.ts +1791 -0
- package/dist/entries/video.js +8 -0
- package/dist/entries/video.js.map +1 -0
- package/dist/entries/workflow.cjs +574 -0
- package/dist/entries/workflow.cjs.map +1 -0
- package/dist/entries/workflow.d.cts +1743 -0
- package/dist/entries/workflow.d.ts +1743 -0
- package/dist/entries/workflow.js +5 -0
- package/dist/entries/workflow.js.map +1 -0
- package/dist/fan-out-meta-Bu6VyXcZ.d.cts +19 -0
- package/dist/fan-out-meta-Bu6VyXcZ.d.ts +19 -0
- package/dist/gemini-omni-voices-zeRXxSbZ.d.cts +174 -0
- package/dist/gemini-omni-voices-zeRXxSbZ.d.ts +174 -0
- package/dist/image-overlay-layers-CyBfRhxJ.d.cts +208 -0
- package/dist/image-overlay-layers-CyBfRhxJ.d.ts +208 -0
- package/dist/index.cjs +7747 -27084
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -24198
- package/dist/index.d.ts +32 -24198
- package/dist/index.js +40 -25220
- package/dist/index.js.map +1 -1
- package/dist/model-catalog-V-ZNzRSd.d.cts +651 -0
- package/dist/model-catalog-V-ZNzRSd.d.ts +651 -0
- package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
- package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
- package/dist/presentation-utils-D0kxsWf9.d.cts +92 -0
- package/dist/presentation-utils-pZwlEAzo.d.ts +92 -0
- package/dist/scene-node-types-C3kl_zyK.d.cts +1949 -0
- package/dist/scene-node-types-C3kl_zyK.d.ts +1949 -0
- package/dist/supported-fonts-CRoF1gOy.d.cts +16 -0
- package/dist/supported-fonts-CRoF1gOy.d.ts +16 -0
- package/dist/types-BRlFPEru.d.cts +511 -0
- package/dist/types-BRlFPEru.d.ts +511 -0
- package/dist/types-DffyGSy5.d.cts +67 -0
- package/dist/types-DffyGSy5.d.ts +67 -0
- package/package.json +102 -1
- package/src/__tests__/add-captions-plan.test.ts +6 -2
- package/src/__tests__/caption-edge-dash.test.ts +23 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +4625 -0
- package/src/__tests__/input-field-extra-keys.test.ts +1 -0
- package/src/__tests__/model-makers.test.ts +76 -0
- package/src/__tests__/no-internal-imports.test.ts +1 -1
- package/src/__tests__/node-aspect-ratio.test.ts +25 -0
- package/src/__tests__/node-runtime-keys.test.ts +9 -0
- package/src/__tests__/package-entries.test.ts +50 -0
- package/src/__tests__/pitch-tempo-pricing.test.ts +21 -0
- package/src/__tests__/presentation-utils.test.ts +15 -0
- package/src/__tests__/preview-gate-use-case.test.ts +151 -0
- package/src/__tests__/private-host.test.ts +53 -0
- package/src/__tests__/run-continuation.test.ts +7 -1
- package/src/__tests__/site-capture-node.test.ts +58 -0
- package/src/__tests__/ugc-lane-wires.test.ts +228 -0
- package/src/__tests__/ugc-node-wires.test.ts +9 -3
- package/src/__tests__/ugc-run-state.test.ts +5 -4
- package/src/__tests__/video-analysis-catalog-sync.test.ts +1 -1
- package/src/__tests__/video-analysis-pricing.test.ts +6 -6
- package/src/__tests__/voice-changer-pro-quote.test.ts +79 -0
- package/src/add-captions-plan.ts +9 -3
- package/src/caption-edge-dash.ts +33 -0
- package/src/component-types.ts +9 -0
- package/src/credit-estimators/index.ts +22 -1
- package/src/credit-estimators/pitch-tempo.ts +15 -1
- package/src/credit-estimators/speech.ts +72 -4
- package/src/credit-estimators/unit-quote.ts +52 -0
- package/src/credit-estimators/video-sfx.ts +15 -0
- package/src/credit-estimators/voice-changer-pro-quote.ts +138 -0
- package/src/credit-identifiers.ts +62 -17
- package/src/entity-image-handle.ts +2 -0
- package/src/entries/apps.ts +63 -0
- package/src/entries/captions.ts +34 -0
- package/src/entries/catalogs.ts +65 -0
- package/src/entries/credits.ts +105 -0
- package/src/entries/edl.ts +42 -0
- package/src/entries/entities.ts +144 -0
- package/src/entries/i18n.ts +31 -0
- package/src/entries/llm-models.ts +63 -0
- package/src/entries/media.ts +36 -0
- package/src/entries/model-catalog.ts +95 -0
- package/src/entries/models.ts +266 -0
- package/src/entries/nodes.ts +245 -0
- package/src/entries/organizations.ts +9 -0
- package/src/entries/pipeline.ts +43 -0
- package/src/entries/scene3d.ts +27 -0
- package/src/entries/social.ts +297 -0
- package/src/entries/types.ts +26 -0
- package/src/entries/ugc.ts +14 -0
- package/src/entries/video.ts +59 -0
- package/src/entries/workflow.ts +172 -0
- package/src/fan-out-rows.ts +2 -0
- package/src/index.ts +25 -1845
- package/src/json-kinds.ts +4 -0
- package/src/model-catalog.ts +243 -34
- package/src/node-mappable-fields.ts +1 -0
- package/src/node-run-routes.ts +2 -0
- package/src/node-runtime-keys.ts +8 -0
- package/src/normalize-node-params.ts +30 -0
- package/src/presentation-utils.ts +12 -0
- package/src/preview-gate.ts +92 -14
- package/src/private-host.ts +89 -59
- package/src/producer-types.ts +16 -2
- package/src/run-continuation.ts +21 -0
- package/src/site-capture-node.ts +82 -0
- package/src/ugc-lane-wires.ts +246 -0
- package/src/ugc-node-wires.ts +37 -7
- package/src/ugc-run-state.ts +5 -3
- package/src/video-analysis-pricing.ts +31 -29
|
@@ -6,6 +6,7 @@ import { INPUT_FIELD_EXTRA_KEYS, INPUT_FIELD_MAP, UGC_OVERRIDABLE_FIELDS, getInp
|
|
|
6
6
|
/** The keys the node actually reads (its data fields). PR B's UgcCreatorData must keep these names. */
|
|
7
7
|
const NODE_READS: Record<string, readonly string[]> = {
|
|
8
8
|
"ugc-creator": ["source", "gender", "photoUrl", "categoryOverride", "seed", "keepResult", "result"],
|
|
9
|
+
"ugc-script": ["targetDurationSec", "language", "keepResult", "result"],
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
describe("INPUT_FIELD_EXTRA_KEYS (spec §6.6)", () => {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { MODEL_CATALOG, MODEL_MAKERS, isModelMakerId, modelMakerOf } from "../model-catalog.js"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Every catalog model names the company that made it (`maker`), served on
|
|
6
|
+
* `GET /v1/models` as `maker: { id, name }` and used to pick the maker's mark
|
|
7
|
+
* (`logoUrl`). The field is required on `ModelCatalogEntry`, so a new model
|
|
8
|
+
* without one does not compile; these cases also cover entries built at run
|
|
9
|
+
* time and keep the registry and the catalog in step.
|
|
10
|
+
*/
|
|
11
|
+
describe("model makers", () => {
|
|
12
|
+
it("every catalog model names a maker from the registry", () => {
|
|
13
|
+
const unknown = Object.values(MODEL_CATALOG)
|
|
14
|
+
.filter((m) => !isModelMakerId(m.maker))
|
|
15
|
+
.map((m) => `${m.id}: ${String(m.maker)}`)
|
|
16
|
+
expect(unknown).toEqual([])
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it("every registered maker makes at least one catalog model", () => {
|
|
20
|
+
const used = new Set<string>(Object.values(MODEL_CATALOG).map((m) => m.maker))
|
|
21
|
+
expect(Object.keys(MODEL_MAKERS).filter((id) => !used.has(id))).toEqual([])
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it("maker ids are lowercase slugs, and every maker has a name", () => {
|
|
25
|
+
for (const [id, maker] of Object.entries(MODEL_MAKERS)) {
|
|
26
|
+
expect(id).toMatch(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
27
|
+
expect(maker.name.trim().length, id).toBeGreaterThan(0)
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it("all the models of one family come from one maker", () => {
|
|
32
|
+
// `family` is the vendor / lab grouping clients filter on; a family whose
|
|
33
|
+
// models name two makers is almost always a copied entry that kept the
|
|
34
|
+
// other company's maker.
|
|
35
|
+
const makersByFamily = new Map<string, Set<string>>()
|
|
36
|
+
for (const m of Object.values(MODEL_CATALOG)) {
|
|
37
|
+
const makers = makersByFamily.get(m.family) ?? new Set<string>()
|
|
38
|
+
makers.add(m.maker)
|
|
39
|
+
makersByFamily.set(m.family, makers)
|
|
40
|
+
}
|
|
41
|
+
const split = [...makersByFamily]
|
|
42
|
+
.filter(([, makers]) => makers.size > 1)
|
|
43
|
+
.map(([family, makers]) => `${family}: ${[...makers].join(", ")}`)
|
|
44
|
+
expect(split).toEqual([])
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it("a family named after a lab, a product line or a cloud brand resolves to the company behind it", () => {
|
|
48
|
+
expect(MODEL_CATALOG["z-image"]!.maker).toBe("alibaba") // Tongyi-MAI (Alibaba's Tongyi Lab)
|
|
49
|
+
expect(MODEL_CATALOG["happyhorse"]!.maker).toBe("alibaba")
|
|
50
|
+
expect(MODEL_CATALOG["video-depth-anything"]!.maker).toBe("bytedance")
|
|
51
|
+
expect(MODEL_CATALOG["depth-anything-frames"]!.maker).toBe("bytedance")
|
|
52
|
+
expect(MODEL_CATALOG["volcengine-lipsync"]!.maker).toBe("bytedance") // Volcano Engine
|
|
53
|
+
expect(MODEL_CATALOG["infinitalk"]!.maker).toBe("meituan") // MeiGen-AI
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it("modelMakerOf serves the maker's id and the company's name", () => {
|
|
57
|
+
expect(modelMakerOf(MODEL_CATALOG["veo3"]!)).toEqual({ id: "google", name: "Google" })
|
|
58
|
+
expect(modelMakerOf(MODEL_CATALOG["flux"]!)).toEqual({ id: "black-forest-labs", name: "Black Forest Labs" })
|
|
59
|
+
expect(modelMakerOf(MODEL_CATALOG["seedance-2"]!)).toEqual({ id: "bytedance", name: "ByteDance" })
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
it("modelMakerOf never throws: an entry built at run time without a known maker has none", () => {
|
|
63
|
+
expect(modelMakerOf({ maker: "acme" as never })).toBeUndefined()
|
|
64
|
+
expect(modelMakerOf({ maker: undefined as never })).toBeUndefined()
|
|
65
|
+
expect(modelMakerOf({ maker: "toString" as never })).toBeUndefined()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it("isModelMakerId accepts only the registry's own ids", () => {
|
|
69
|
+
expect(isModelMakerId("google")).toBe(true)
|
|
70
|
+
expect(isModelMakerId("Google")).toBe(false)
|
|
71
|
+
expect(isModelMakerId("toString")).toBe(false)
|
|
72
|
+
expect(isModelMakerId("")).toBe(false)
|
|
73
|
+
expect(isModelMakerId(42)).toBe(false)
|
|
74
|
+
expect(isModelMakerId(undefined)).toBe(false)
|
|
75
|
+
})
|
|
76
|
+
})
|
|
@@ -19,7 +19,7 @@ function walk(dir: string): string[] {
|
|
|
19
19
|
describe("Apache boundary", () => {
|
|
20
20
|
it("no shared source file imports @nodaro/prompts", () => {
|
|
21
21
|
const offenders = walk(join(__dirname, ".."))
|
|
22
|
-
.filter((f) => /from\s+["']@nodaro\/prompts["']/.test(readFileSync(f, "utf8")))
|
|
22
|
+
.filter((f) => /from\s+["']@nodaro\/prompts(?:\/[\w-]+)?["']/.test(readFileSync(f, "utf8")))
|
|
23
23
|
expect(offenders).toEqual([])
|
|
24
24
|
})
|
|
25
25
|
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
import { nodeAspectRatio, PHOTO_AUTO_ASPECT_NODE_TYPES } from "../normalize-node-params.js"
|
|
3
|
+
|
|
4
|
+
describe("nodeAspectRatio — unset is Auto on the photo-Auto nodes", () => {
|
|
5
|
+
it("fills auto for an unset or blank ratio on Generate Image and Modify Image", () => {
|
|
6
|
+
for (const type of PHOTO_AUTO_ASPECT_NODE_TYPES) {
|
|
7
|
+
expect(nodeAspectRatio(type, undefined)).toBe("auto")
|
|
8
|
+
expect(nodeAspectRatio(type, "")).toBe("auto")
|
|
9
|
+
expect(nodeAspectRatio(type, " ")).toBe("auto")
|
|
10
|
+
expect(nodeAspectRatio(type, null)).toBe("auto")
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it("returns a set ratio untouched", () => {
|
|
15
|
+
expect(nodeAspectRatio("modify-image", "3:4")).toBe("3:4")
|
|
16
|
+
expect(nodeAspectRatio("generate-image", "auto")).toBe("auto")
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it("leaves every other node type alone", () => {
|
|
20
|
+
expect(nodeAspectRatio("image-to-image", undefined)).toBeUndefined()
|
|
21
|
+
expect(nodeAspectRatio("edit-image", undefined)).toBeUndefined()
|
|
22
|
+
expect(nodeAspectRatio(undefined, undefined)).toBeUndefined()
|
|
23
|
+
expect(nodeAspectRatio("image-to-image", "1:1")).toBe("1:1")
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -73,6 +73,15 @@ describe("TRANSIENT_RUNTIME_KEYS", () => {
|
|
|
73
73
|
})
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
+
describe("a use-case node's continuation", () => {
|
|
77
|
+
it("is one run's, never saved: a save strips it, so a saved one cannot turn a later run into a continuation", () => {
|
|
78
|
+
expect(EXECUTION_DATA_KEYS.has("useCaseContinue")).toBe(true)
|
|
79
|
+
expect(TRANSIENT_RUNTIME_KEYS.has("useCaseContinue")).toBe(true)
|
|
80
|
+
const [saved] = stripTransientRuntimeData([{ data: { useCaseContinue: { mode: "from-failed", jobId: "j1" }, captions: true } }])
|
|
81
|
+
expect(saved!.data).toEqual({ captions: true })
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
|
|
76
85
|
describe("EXECUTION_DATA_KEYS", () => {
|
|
77
86
|
it("files the clear-results watermark as runtime bookkeeping — never preset / template / copilot-visible config", () => {
|
|
78
87
|
expect(EXECUTION_DATA_KEYS.has("resultsClearedAt")).toBe(true)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The subpath entries of @nodaro/shared (`@nodaro/shared/<entry>`, one per
|
|
3
|
+
* domain in src/entries/) — additive to the root, which stays the union of them.
|
|
4
|
+
*
|
|
5
|
+
* External consumers pin older versions and import only the root, so the root
|
|
6
|
+
* may only grow (baseline: fixtures/root-exports.baseline.json). Most checks
|
|
7
|
+
* read the BUILT dist, which is what consumers load — CI builds the packages
|
|
8
|
+
* before this suite runs; locally run `npm run build:packages` first.
|
|
9
|
+
*
|
|
10
|
+
* The checks live in tools/package-entries/entries-guard.mjs (shared with
|
|
11
|
+
* @nodaro/prompts); each returns the problems it found.
|
|
12
|
+
*/
|
|
13
|
+
import path from "node:path"
|
|
14
|
+
import { fileURLToPath } from "node:url"
|
|
15
|
+
import { describe, expect, it } from "vitest"
|
|
16
|
+
// @ts-expect-error — untyped .mjs tooling module
|
|
17
|
+
import * as guard from "../../../../tools/package-entries/entries-guard.mjs"
|
|
18
|
+
|
|
19
|
+
const PKG_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..")
|
|
20
|
+
const PKG = "@nodaro/shared"
|
|
21
|
+
|
|
22
|
+
describe("@nodaro/shared subpath entries", () => {
|
|
23
|
+
it("src/index.ts only re-exports every entry in src/entries/", () => {
|
|
24
|
+
expect(guard.indexShapeErrors(PKG_DIR)).toEqual([])
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it("package.json exports = the unchanged root + one subpath per entry", () => {
|
|
28
|
+
expect(guard.exportsMapErrors(PKG_DIR)).toEqual([])
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it("every exports target is built", () => {
|
|
32
|
+
expect(guard.distFileErrors(PKG_DIR)).toEqual([])
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it("the root still exports every baseline name (types d.ts + d.cts, values ESM + CJS)", async () => {
|
|
36
|
+
expect(await guard.rootAdditiveErrors(PKG_DIR)).toEqual([])
|
|
37
|
+
}, 60_000)
|
|
38
|
+
|
|
39
|
+
it("the root's names are exactly the union of the entries' names, each with one owner", () => {
|
|
40
|
+
expect(guard.unionErrors(PKG_DIR, {})).toEqual([])
|
|
41
|
+
}, 60_000)
|
|
42
|
+
|
|
43
|
+
it("each subpath's types resolve from a consumer (bundler + NodeNext)", () => {
|
|
44
|
+
expect(guard.typeResolutionErrors(PKG_DIR, PKG)).toEqual([])
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it("each subpath loads ALONE by package name (fresh process, ESM + CJS) and shares the root's instances", async () => {
|
|
48
|
+
expect(await guard.consumerLoadErrors(PKG_DIR, PKG)).toEqual([])
|
|
49
|
+
}, 120_000)
|
|
50
|
+
})
|
|
@@ -60,3 +60,24 @@ describe("pitch-tempo pricing", () => {
|
|
|
60
60
|
expect(semitonesToPitchRatio(3)).toBeCloseTo(1.189207, 6)
|
|
61
61
|
})
|
|
62
62
|
})
|
|
63
|
+
|
|
64
|
+
// A quote before a run names the id the run reserves for a known length, and
|
|
65
|
+
// the most a run can be charged for an unknown one (decided 2026-10-13): the
|
|
66
|
+
// run measures the file before it reserves and refuses one it cannot measure.
|
|
67
|
+
describe("the quote of an input of unknown length", () => {
|
|
68
|
+
it("Pitch & Tempo: a known length's started minutes, else 30 minutes", async () => {
|
|
69
|
+
const { pitchTempoQuoteCreditId } = await import("../index.js")
|
|
70
|
+
expect(pitchTempoQuoteCreditId(190)).toBe("pitch-tempo:4m")
|
|
71
|
+
expect(pitchTempoQuoteCreditId(45)).toBe("pitch-tempo:1m")
|
|
72
|
+
for (const unknown of [undefined, null, 0, -3, Number.NaN]) expect(pitchTempoQuoteCreditId(unknown)).toBe("pitch-tempo:30m")
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it("Video SFX: a known length's row, else the 300-second row", async () => {
|
|
76
|
+
const { videoSfxQuoteCreditId, videoSfxCreditId } = await import("../index.js")
|
|
77
|
+
expect(videoSfxQuoteCreditId(12)).toBe("replicate-mmaudio:15s")
|
|
78
|
+
expect(videoSfxQuoteCreditId(12)).toBe(videoSfxCreditId(12))
|
|
79
|
+
for (const unknown of [undefined, null, 0, Number.NaN]) expect(videoSfxQuoteCreditId(unknown)).toBe("replicate-mmaudio:300s")
|
|
80
|
+
// The charge of an unmeasurable clip stays the 8-second row — never above the quote.
|
|
81
|
+
expect(videoSfxCreditId(undefined)).toBe("replicate-mmaudio:8s")
|
|
82
|
+
})
|
|
83
|
+
})
|
|
@@ -1314,3 +1314,18 @@ describe("mergeNodeInputOverrides", () => {
|
|
|
1314
1314
|
expect(overrides).toEqual({ extractedAudioUrl: "https://cdn/new.mp3" })
|
|
1315
1315
|
})
|
|
1316
1316
|
})
|
|
1317
|
+
|
|
1318
|
+
describe("mergeNodeInputOverrides — a null override clears the field", () => {
|
|
1319
|
+
// JSON cannot carry `undefined`, so an app card that clears a lever (a resolution the new model has no
|
|
1320
|
+
// such lever for, Draft turned off) sends null. The run must then have NO value there — neither null nor
|
|
1321
|
+
// the publisher's saved one.
|
|
1322
|
+
it("removes the key from the merged data", () => {
|
|
1323
|
+
const merged = mergeNodeInputOverrides("video-to-video", { provider: "wan", v2vResolution: "720p", draft: true }, { provider: "runway-aleph", v2vResolution: null, draft: null })
|
|
1324
|
+
expect(merged).toEqual({ provider: "runway-aleph" })
|
|
1325
|
+
expect(Object.hasOwn(merged, "v2vResolution")).toBe(false)
|
|
1326
|
+
})
|
|
1327
|
+
|
|
1328
|
+
it("leaves every other override as it was", () => {
|
|
1329
|
+
expect(mergeNodeInputOverrides("text-to-speech", { stability: 0.5 }, { stability: 0 })).toEqual({ stability: 0 })
|
|
1330
|
+
})
|
|
1331
|
+
})
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest"
|
|
2
|
+
// Through the package index: both engines and the editor read the hold from here.
|
|
3
|
+
import {
|
|
4
|
+
PREVIEW_RENDER_NODE_TYPES,
|
|
5
|
+
REVIEW_HOLDING_USE_CASE_TYPES,
|
|
6
|
+
isPreviewHoldingType,
|
|
7
|
+
previewStops,
|
|
8
|
+
rendersAsPreview,
|
|
9
|
+
withRunOverrides,
|
|
10
|
+
PREVIEW_REVIEW_REQUIRED,
|
|
11
|
+
PREVIEW_REVIEW_REQUIRED_REVIEW_ON,
|
|
12
|
+
PREVIEW_REVIEW_REQUIRED_MIXED,
|
|
13
|
+
PREVIEW_RENDER_NESTED,
|
|
14
|
+
PREVIEW_RENDER_NESTED_REVIEW_ON,
|
|
15
|
+
PREVIEW_RENDER_NESTED_MIXED,
|
|
16
|
+
isPreviewRefusalCode,
|
|
17
|
+
} from "../index.js"
|
|
18
|
+
|
|
19
|
+
const rec = { id: "rec", type: "upload-video", data: {} }
|
|
20
|
+
const t1 = (data: Record<string, unknown>) => ({ id: "t1", type: "tighten-episode", data })
|
|
21
|
+
const fmt = { id: "fmt", type: "social-media-format", data: {} }
|
|
22
|
+
const post = { id: "post", type: "webhook-output", data: {} }
|
|
23
|
+
const edges = [
|
|
24
|
+
{ source: "rec", target: "t1" },
|
|
25
|
+
{ source: "t1", target: "fmt", sourceHandle: "media" },
|
|
26
|
+
{ source: "fmt", target: "post" },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
describe("a review-on use-case node holds what follows it until its Render final", () => {
|
|
30
|
+
it("is a preview-holding type without joining the render set", () => {
|
|
31
|
+
expect([...REVIEW_HOLDING_USE_CASE_TYPES]).toEqual(["tighten-episode"])
|
|
32
|
+
expect(isPreviewHoldingType("tighten-episode")).toBe(true)
|
|
33
|
+
expect(isPreviewHoldingType("apply-edl")).toBe(true)
|
|
34
|
+
expect(isPreviewHoldingType("speaker-view")).toBe(true)
|
|
35
|
+
expect(isPreviewHoldingType("social-media-format")).toBe(false)
|
|
36
|
+
expect(isPreviewHoldingType(undefined)).toBe(false)
|
|
37
|
+
expect(isPreviewHoldingType(null)).toBe(false)
|
|
38
|
+
expect(PREVIEW_RENDER_NODE_TYPES.has("tighten-episode")).toBe(false)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it("review on: holds its descendants when it executes", () => {
|
|
42
|
+
const stops = previewStops([rec, t1({ reviewBeforeRender: true }), fmt, post], edges)
|
|
43
|
+
expect(stops.previewRenderIds).toEqual(["t1"])
|
|
44
|
+
expect([...stops.gatedNodeIds].sort()).toEqual(["fmt", "post"])
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it("review off: holds nothing", () => {
|
|
48
|
+
expect(previewStops([rec, t1({}), fmt, post], edges).gatedNodeIds.size).toBe(0)
|
|
49
|
+
expect(previewStops([rec, t1({ reviewBeforeRender: false }), fmt, post], edges).gatedNodeIds.size).toBe(0)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("a quality field on the node does not decide it: review does", () => {
|
|
53
|
+
expect(rendersAsPreview(t1({ quality: "proxy" }))).toBe(false)
|
|
54
|
+
expect(rendersAsPreview(t1({ reviewBeforeRender: true, quality: "final" }))).toBe(true)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it("its Render final (a render-final continuation naming its run) releases them", () => {
|
|
58
|
+
const node = t1({ reviewBeforeRender: true, useCaseContinue: { mode: "render-final", jobId: "job-1" } })
|
|
59
|
+
expect(rendersAsPreview(node)).toBe(false)
|
|
60
|
+
expect(previewStops([rec, node, fmt, post], edges).gatedNodeIds.size).toBe(0)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it("the continuation set as a run override releases them too", () => {
|
|
64
|
+
const graph = withRunOverrides([rec, t1({ reviewBeforeRender: true }), fmt, post], {
|
|
65
|
+
t1: { useCaseContinue: { mode: "render-final", jobId: "job-1" } },
|
|
66
|
+
})
|
|
67
|
+
expect(previewStops(graph, edges).gatedNodeIds.size).toBe(0)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it("a continuation the node would not run as one still holds: no run named, or a continue from a failure", () => {
|
|
71
|
+
// The executor runs a fresh review-on run when the continuation names no
|
|
72
|
+
// run, so what follows would build on its preview.
|
|
73
|
+
expect(rendersAsPreview(t1({ reviewBeforeRender: true, useCaseContinue: { mode: "render-final" } }))).toBe(true)
|
|
74
|
+
expect(rendersAsPreview(t1({ reviewBeforeRender: true, useCaseContinue: { mode: "render-final", jobId: 7 } }))).toBe(true)
|
|
75
|
+
// A continue from a failure finishes the run it continues: a review-on run's preview.
|
|
76
|
+
expect(rendersAsPreview(t1({ reviewBeforeRender: true, useCaseContinue: { mode: "from-failed", jobId: "job-1" } }))).toBe(true)
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it("not executing, a saved Preview take holds them (the run view, a continuation of something else)", () => {
|
|
80
|
+
const stops = previewStops([rec, t1({ reviewBeforeRender: true }), fmt, post], edges, {
|
|
81
|
+
executes: () => false,
|
|
82
|
+
savedRenders: {
|
|
83
|
+
output: (d) => ((d as { reviewBeforeRender?: boolean }).reviewBeforeRender ? { quality: "proxy" } : undefined),
|
|
84
|
+
batch: () => undefined,
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
expect(stops.savedPreviewRenderIds).toEqual(["t1"])
|
|
88
|
+
expect([...stops.gatedNodeIds].sort()).toEqual(["fmt", "post"])
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it("not executing, a saved Final take holds nothing", () => {
|
|
92
|
+
const stops = previewStops([rec, t1({ reviewBeforeRender: true }), fmt, post], edges, {
|
|
93
|
+
executes: () => false,
|
|
94
|
+
savedRenders: { output: () => ({ quality: "final" }), batch: () => undefined },
|
|
95
|
+
})
|
|
96
|
+
expect(stops.gatedNodeIds.size).toBe(0)
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
describe("the preview refusal codes", () => {
|
|
101
|
+
it("six codes, one predicate: the render's two (and every older row's) plus a review-on and a mixed one of each", () => {
|
|
102
|
+
const codes = [
|
|
103
|
+
PREVIEW_REVIEW_REQUIRED,
|
|
104
|
+
PREVIEW_REVIEW_REQUIRED_REVIEW_ON,
|
|
105
|
+
PREVIEW_REVIEW_REQUIRED_MIXED,
|
|
106
|
+
PREVIEW_RENDER_NESTED,
|
|
107
|
+
PREVIEW_RENDER_NESTED_REVIEW_ON,
|
|
108
|
+
PREVIEW_RENDER_NESTED_MIXED,
|
|
109
|
+
]
|
|
110
|
+
expect(new Set(codes).size).toBe(6)
|
|
111
|
+
for (const code of codes) {
|
|
112
|
+
expect(code).toMatch(/^[a-z_]+$/)
|
|
113
|
+
expect(isPreviewRefusalCode(code)).toBe(true)
|
|
114
|
+
}
|
|
115
|
+
expect(PREVIEW_REVIEW_REQUIRED).toBe("preview_review_required")
|
|
116
|
+
expect(PREVIEW_RENDER_NESTED).toBe("preview_render_nested")
|
|
117
|
+
for (const other of ["continuation_not_found", "", undefined, null, 7]) expect(isPreviewRefusalCode(other)).toBe(false)
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
describe("a continuation saved on the graph is never a run's (the engine's rule, in the shared funnel)", () => {
|
|
122
|
+
const saved = (cont: Record<string, unknown>) => [rec, t1({ reviewBeforeRender: true, useCaseContinue: cont }), fmt, post]
|
|
123
|
+
|
|
124
|
+
it("a saved render-final naming a run, with no override: dropped — the node is a Preview and holds what follows", () => {
|
|
125
|
+
const graph = withRunOverrides(saved({ mode: "render-final", jobId: "job-old" }), undefined)
|
|
126
|
+
const node = graph.find((n) => n.id === "t1")!
|
|
127
|
+
expect(node.data).not.toHaveProperty("useCaseContinue")
|
|
128
|
+
expect(rendersAsPreview(node)).toBe(true)
|
|
129
|
+
expect([...previewStops(graph, edges).gatedNodeIds].sort()).toEqual(["fmt", "post"])
|
|
130
|
+
// Overrides for other nodes drop it too.
|
|
131
|
+
expect(withRunOverrides(saved({ mode: "render-final", jobId: "job-old" }), { fmt: { x: 1 } }).find((n) => n.id === "t1")!.data).not.toHaveProperty("useCaseContinue")
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it("this run's own override still sets it, over a stale saved one", () => {
|
|
135
|
+
const graph = withRunOverrides(saved({ mode: "from-failed", jobId: "job-old" }), { t1: { useCaseContinue: { mode: "render-final", jobId: "job-1" } } })
|
|
136
|
+
const node = graph.find((n) => n.id === "t1")!
|
|
137
|
+
expect((node.data as Record<string, unknown>).useCaseContinue).toEqual({ mode: "render-final", jobId: "job-1" })
|
|
138
|
+
expect(rendersAsPreview(node)).toBe(false)
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
it("is applied once, to the saved graph: a second pass drops the continuation the first set", () => {
|
|
142
|
+
const once = withRunOverrides(saved({}), { t1: { useCaseContinue: { mode: "render-final", jobId: "job-1" } } })
|
|
143
|
+
expect(withRunOverrides(once, undefined).find((n) => n.id === "t1")!.data).not.toHaveProperty("useCaseContinue")
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
it("a node with neither an override nor a saved run-only field is returned as is", () => {
|
|
147
|
+
const nodes = [rec, t1({ reviewBeforeRender: true }), fmt]
|
|
148
|
+
const out = withRunOverrides(nodes, undefined)
|
|
149
|
+
out.forEach((n, i) => expect(n).toBe(nodes[i]))
|
|
150
|
+
})
|
|
151
|
+
})
|
|
@@ -10,6 +10,59 @@ describe("isPrivateOrReservedIP", () => {
|
|
|
10
10
|
it("passes public addresses", () => {
|
|
11
11
|
for (const ip of ["8.8.8.8", "93.184.216.34", "172.32.0.1", "2606:4700::1"]) expect(isPrivateOrReservedIP(ip), ip).toBe(false)
|
|
12
12
|
})
|
|
13
|
+
|
|
14
|
+
it("refuses the whole of link-local fe80::/10 (fe80:: to febf::) and the old site-local fec0::/10", () => {
|
|
15
|
+
for (const ip of ["fe80::1", "fe90::1", "fea0::abcd", "febf:ffff::1", "FE85::1", "fe80::1%eth0", "fec0::1", "feff::1"]) {
|
|
16
|
+
expect(isPrivateOrReservedIP(ip), ip).toBe(true)
|
|
17
|
+
}
|
|
18
|
+
expect(isPrivateOrReservedIP("fe7f::1")).toBe(false) // just below fe80::/10
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it("judges an IPv6 address that carries an IPv4 one by the IPv4 it reaches (NAT64, 6to4, mapped, compatible)", () => {
|
|
22
|
+
for (const ip of [
|
|
23
|
+
"64:ff9b::a9fe:a9fe", // NAT64 → 169.254.169.254
|
|
24
|
+
"64:ff9b::7f00:1", // NAT64 → 127.0.0.1
|
|
25
|
+
"64:ff9b::10.0.0.1", // NAT64, dotted tail
|
|
26
|
+
"2002:a9fe:a9fe::1", // 6to4 → 169.254.169.254
|
|
27
|
+
"2002:c0a8:0101::", // 6to4 → 192.168.1.1
|
|
28
|
+
"::ffff:a9fe:a9fe",
|
|
29
|
+
"0:0:0:0:0:ffff:127.0.0.1",
|
|
30
|
+
"::2", // IPv4-compatible 0.0.0.2
|
|
31
|
+
]) {
|
|
32
|
+
expect(isPrivateOrReservedIP(ip), ip).toBe(true)
|
|
33
|
+
}
|
|
34
|
+
for (const ip of ["64:ff9b::808:808", "64:ff9b::8.8.8.8", "2002:808:808::1", "::ffff:808:808"]) {
|
|
35
|
+
expect(isPrivateOrReservedIP(ip), ip).toBe(false)
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it("refuses local-use NAT64 and Teredo", () => {
|
|
40
|
+
for (const ip of ["64:ff9b:1::1", "2001:0:4136:e378:8000:63bf:3fff:fdd2", "2001::1"]) {
|
|
41
|
+
expect(isPrivateOrReservedIP(ip), ip).toBe(true)
|
|
42
|
+
}
|
|
43
|
+
expect(isPrivateOrReservedIP("2001:4860:4860::8888")).toBe(false) // a public 2001: address
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it("refuses the IETF protocol block of IPv4", () => {
|
|
47
|
+
expect(isPrivateOrReservedIP("192.0.0.170")).toBe(true)
|
|
48
|
+
expect(isPrivateOrReservedIP("192.0.1.1")).toBe(false)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
// Unroutable, so no SSRF target — and the same rule decides which client
|
|
52
|
+
// addresses the server trusts and keys rate limits on, where these stand in
|
|
53
|
+
// for public addresses (client-address.ts). Refusing them would make a
|
|
54
|
+
// documentation address an "unknown" client.
|
|
55
|
+
it("does not refuse the documentation blocks", () => {
|
|
56
|
+
for (const ip of ["192.0.2.1", "198.51.100.7", "203.0.113.9", "2001:db8::1", "2001:db8:abcd:12::1"]) {
|
|
57
|
+
expect(isPrivateOrReservedIP(ip), ip).toBe(false)
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it("fails closed on something with a colon that is not an IPv6 address", () => {
|
|
62
|
+
for (const ip of ["::ffff:zzzz", "1:2:3", "1::2::3", "::ffff:300.1.1.1", "1:2:3:4:5:6:7:8:9"]) {
|
|
63
|
+
expect(isPrivateOrReservedIP(ip), ip).toBe(true)
|
|
64
|
+
}
|
|
65
|
+
})
|
|
13
66
|
})
|
|
14
67
|
|
|
15
68
|
describe("isLocalOrPrivateHostname", () => {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest"
|
|
2
2
|
import {
|
|
3
3
|
CONTINUATION_NOT_COMPLETED,
|
|
4
|
+
CONTINUATION_NOT_FAILED,
|
|
4
5
|
CONTINUATION_NOT_FOUND,
|
|
5
6
|
CONTINUATION_SUBSET_REQUIRED,
|
|
7
|
+
CONTINUATION_SUPERSEDED,
|
|
6
8
|
CONTINUATION_VERSION_MISMATCH,
|
|
7
9
|
CONTINUATION_WORKFLOW_MISMATCH,
|
|
8
10
|
RUN_CONTINUATION_CODES,
|
|
@@ -15,15 +17,19 @@ describe("run continuation refusal codes", () => {
|
|
|
15
17
|
expect(CONTINUATION_VERSION_MISMATCH).toBe("continuation_version_mismatch")
|
|
16
18
|
expect(CONTINUATION_NOT_COMPLETED).toBe("continuation_not_completed")
|
|
17
19
|
expect(CONTINUATION_SUBSET_REQUIRED).toBe("continuation_subset_required")
|
|
20
|
+
expect(CONTINUATION_NOT_FAILED).toBe("continuation_not_failed")
|
|
21
|
+
expect(CONTINUATION_SUPERSEDED).toBe("continuation_superseded")
|
|
18
22
|
})
|
|
19
23
|
|
|
20
24
|
it("lists every code once", () => {
|
|
21
|
-
expect(new Set(RUN_CONTINUATION_CODES).size).toBe(
|
|
25
|
+
expect(new Set(RUN_CONTINUATION_CODES).size).toBe(7)
|
|
22
26
|
expect([...RUN_CONTINUATION_CODES].sort()).toEqual(
|
|
23
27
|
[
|
|
24
28
|
CONTINUATION_NOT_COMPLETED,
|
|
29
|
+
CONTINUATION_NOT_FAILED,
|
|
25
30
|
CONTINUATION_NOT_FOUND,
|
|
26
31
|
CONTINUATION_SUBSET_REQUIRED,
|
|
32
|
+
CONTINUATION_SUPERSEDED,
|
|
27
33
|
CONTINUATION_VERSION_MISMATCH,
|
|
28
34
|
CONTINUATION_WORKFLOW_MISMATCH,
|
|
29
35
|
].sort(),
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { siteCaptureMaxStills, siteCaptureNodeOutputs, siteCapturePageUrl, siteCaptureStillUrls, siteCaptureStills } from "../site-capture-node.js"
|
|
3
|
+
|
|
4
|
+
const CAPTURE = {
|
|
5
|
+
pageUrl: "https://example.com/",
|
|
6
|
+
title: "Example",
|
|
7
|
+
fullPage: { url: "https://cdn.example/full.jpg", width: 412, height: 6000, truncated: false },
|
|
8
|
+
stills: [
|
|
9
|
+
{ index: 1, sectionOrder: 3, label: "Pricing", category: "pricing", url: "https://cdn.example/1.png" },
|
|
10
|
+
{ index: 0, sectionOrder: 0, label: "Hero", category: "hero", url: "https://cdn.example/0.png" },
|
|
11
|
+
{ index: 2, sectionOrder: 5, label: "Broken", category: "other", url: "" },
|
|
12
|
+
],
|
|
13
|
+
facts: ["$12 per month"],
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
describe("siteCapturePageUrl — the page a run captures", () => {
|
|
17
|
+
it("is the address typed on the node", () => expect(siteCapturePageUrl(" example.com/pricing ", "https://other.com")).toBe("example.com/pricing"))
|
|
18
|
+
it("else the first web address in the wired text, without trailing punctuation", () =>
|
|
19
|
+
expect(siteCapturePageUrl("", "Look at https://acme.io/pricing, then https://b.io.")).toBe("https://acme.io/pricing"))
|
|
20
|
+
it("else the wired text's first word (the route normalises or refuses it)", () => expect(siteCapturePageUrl(undefined, "acme.io is the site")).toBe("acme.io"))
|
|
21
|
+
it("else nothing", () => {
|
|
22
|
+
expect(siteCapturePageUrl("", " ")).toBe("")
|
|
23
|
+
expect(siteCapturePageUrl(undefined, undefined)).toBe("")
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe("siteCaptureMaxStills — the route's bounds", () => {
|
|
28
|
+
it.each([
|
|
29
|
+
[undefined, 8],
|
|
30
|
+
["5", 8],
|
|
31
|
+
[Number.NaN, 8],
|
|
32
|
+
[1, 3],
|
|
33
|
+
[5.4, 5],
|
|
34
|
+
[12, 8],
|
|
35
|
+
])("%j → %i", (value, stills) => expect(siteCaptureMaxStills(value)).toBe(stills))
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
describe("the capture's outputs", () => {
|
|
39
|
+
it("lists the stills in page order and drops one with no address; the full page is never one of them", () => {
|
|
40
|
+
expect(siteCaptureStills(CAPTURE).map((s) => s.label)).toEqual(["Hero", "Pricing"])
|
|
41
|
+
expect(siteCaptureStillUrls(CAPTURE)).toEqual(["https://cdn.example/0.png", "https://cdn.example/1.png"])
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it("hands on the capture as json, its first still as the image and every still as the list", () => {
|
|
45
|
+
expect(siteCaptureNodeOutputs(CAPTURE)).toEqual({
|
|
46
|
+
json: CAPTURE,
|
|
47
|
+
imageUrl: "https://cdn.example/0.png",
|
|
48
|
+
listResults: ["https://cdn.example/0.png", "https://cdn.example/1.png"],
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("a capture with no still hands on its json only; anything that is not a capture hands on nothing", () => {
|
|
53
|
+
expect(siteCaptureNodeOutputs({ ...CAPTURE, stills: [] })).toEqual({ json: { ...CAPTURE, stills: [] } })
|
|
54
|
+
expect(siteCaptureNodeOutputs(null)).toEqual({})
|
|
55
|
+
expect(siteCaptureNodeOutputs([CAPTURE])).toEqual({})
|
|
56
|
+
expect(siteCaptureStills("nope")).toEqual([])
|
|
57
|
+
})
|
|
58
|
+
})
|