@nodaro/shared 3.32.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.
Files changed (136) hide show
  1. package/dist/{chunk-ISJDAFKS.js → chunk-23FJQTEA.js} +8 -8
  2. package/dist/{chunk-ISJDAFKS.js.map → chunk-23FJQTEA.js.map} +1 -1
  3. package/dist/{chunk-VWGNPMJZ.cjs → chunk-2NQLSLSN.cjs} +5 -5
  4. package/dist/{chunk-VWGNPMJZ.cjs.map → chunk-2NQLSLSN.cjs.map} +1 -1
  5. package/dist/{chunk-IEBZHTPE.js → chunk-5RYLK3MQ.js} +28 -15
  6. package/dist/chunk-5RYLK3MQ.js.map +1 -0
  7. package/dist/{chunk-Z4AZW6FY.js → chunk-6WZ2VN7V.js} +5 -5
  8. package/dist/{chunk-Z4AZW6FY.js.map → chunk-6WZ2VN7V.js.map} +1 -1
  9. package/dist/{chunk-6DKDOWBL.js → chunk-7Z5LUTGU.js} +3 -3
  10. package/dist/{chunk-6DKDOWBL.js.map → chunk-7Z5LUTGU.js.map} +1 -1
  11. package/dist/{chunk-3CUFITU7.js → chunk-BG5D5CZ6.js} +67 -50
  12. package/dist/chunk-BG5D5CZ6.js.map +1 -0
  13. package/dist/{chunk-XAMC4S53.js → chunk-CUH22J4D.js} +3 -3
  14. package/dist/{chunk-XAMC4S53.js.map → chunk-CUH22J4D.js.map} +1 -1
  15. package/dist/{chunk-E2TGXG6X.cjs → chunk-D26ENTN2.cjs} +43 -43
  16. package/dist/{chunk-E2TGXG6X.cjs.map → chunk-D26ENTN2.cjs.map} +1 -1
  17. package/dist/{chunk-AVQK77G6.cjs → chunk-D6GNRSCV.cjs} +67 -50
  18. package/dist/chunk-D6GNRSCV.cjs.map +1 -0
  19. package/dist/{chunk-KHCBJ7KD.js → chunk-FT5CF6IA.js} +3 -3
  20. package/dist/{chunk-KHCBJ7KD.js.map → chunk-FT5CF6IA.js.map} +1 -1
  21. package/dist/{chunk-JX5YZ4DH.cjs → chunk-HC7VKIV5.cjs} +38 -38
  22. package/dist/{chunk-JX5YZ4DH.cjs.map → chunk-HC7VKIV5.cjs.map} +1 -1
  23. package/dist/{chunk-S5DMKUWK.cjs → chunk-HKFMXNVQ.cjs} +11 -11
  24. package/dist/{chunk-S5DMKUWK.cjs.map → chunk-HKFMXNVQ.cjs.map} +1 -1
  25. package/dist/{chunk-O5MP52U2.cjs → chunk-HRXEZ3SX.cjs} +4 -4
  26. package/dist/{chunk-O5MP52U2.cjs.map → chunk-HRXEZ3SX.cjs.map} +1 -1
  27. package/dist/{chunk-RJL7RCEM.cjs → chunk-HUR6ZJ7S.cjs} +6 -6
  28. package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
  29. package/dist/{chunk-QELDJGDK.cjs → chunk-JFS3NWZ5.cjs} +4 -4
  30. package/dist/{chunk-QELDJGDK.cjs.map → chunk-JFS3NWZ5.cjs.map} +1 -1
  31. package/dist/{chunk-5AUSSJIM.cjs → chunk-K3LLGRK7.cjs} +175 -2
  32. package/dist/chunk-K3LLGRK7.cjs.map +1 -0
  33. package/dist/{chunk-J6KHW2E5.cjs → chunk-M7GQBRZU.cjs} +16 -16
  34. package/dist/{chunk-J6KHW2E5.cjs.map → chunk-M7GQBRZU.cjs.map} +1 -1
  35. package/dist/{chunk-5U7VLG43.js → chunk-OTATNBMD.js} +3 -3
  36. package/dist/chunk-OTATNBMD.js.map +1 -0
  37. package/dist/{chunk-LPW3XNC2.js → chunk-OZSACQ2V.js} +3 -3
  38. package/dist/{chunk-LPW3XNC2.js.map → chunk-OZSACQ2V.js.map} +1 -1
  39. package/dist/{chunk-VIWSWVAW.js → chunk-PHZ23DP3.js} +3 -3
  40. package/dist/{chunk-VIWSWVAW.js.map → chunk-PHZ23DP3.js.map} +1 -1
  41. package/dist/{chunk-ZT77RY6R.js → chunk-PVJBAPYJ.js} +4 -4
  42. package/dist/{chunk-ZT77RY6R.js.map → chunk-PVJBAPYJ.js.map} +1 -1
  43. package/dist/{chunk-AROWPFO2.js → chunk-PXFQVLBX.js} +7 -4
  44. package/dist/chunk-PXFQVLBX.js.map +1 -0
  45. package/dist/{chunk-Q4CDQ2KO.js → chunk-QA3MVQ32.js} +4 -4
  46. package/dist/{chunk-Q4CDQ2KO.js.map → chunk-QA3MVQ32.js.map} +1 -1
  47. package/dist/{chunk-NB72XWXQ.cjs → chunk-SAW5OK36.cjs} +6 -6
  48. package/dist/{chunk-NB72XWXQ.cjs.map → chunk-SAW5OK36.cjs.map} +1 -1
  49. package/dist/{chunk-YHRG7UOC.js → chunk-SFW3UB2P.js} +4 -4
  50. package/dist/{chunk-YHRG7UOC.js.map → chunk-SFW3UB2P.js.map} +1 -1
  51. package/dist/chunk-TU33KYKW.cjs +25 -0
  52. package/dist/{chunk-WNG7HRVA.cjs.map → chunk-TU33KYKW.cjs.map} +1 -1
  53. package/dist/{chunk-QNGNOU4Z.js → chunk-UCFWI6D4.js} +3 -3
  54. package/dist/{chunk-QNGNOU4Z.js.map → chunk-UCFWI6D4.js.map} +1 -1
  55. package/dist/{chunk-RN3RMBJZ.js → chunk-UTQSSKSG.js} +4 -4
  56. package/dist/{chunk-RN3RMBJZ.js.map → chunk-UTQSSKSG.js.map} +1 -1
  57. package/dist/{chunk-NT6IJH4L.cjs → chunk-VA42637J.cjs} +61 -47
  58. package/dist/chunk-VA42637J.cjs.map +1 -0
  59. package/dist/{chunk-ULXI7A6Q.cjs → chunk-VNQRI2RO.cjs} +11 -11
  60. package/dist/{chunk-ULXI7A6Q.cjs.map → chunk-VNQRI2RO.cjs.map} +1 -1
  61. package/dist/{chunk-O7PUQLJ3.cjs → chunk-VXPLKQWY.cjs} +11 -8
  62. package/dist/chunk-VXPLKQWY.cjs.map +1 -0
  63. package/dist/{chunk-6IJOPRZP.cjs → chunk-WD6HJRBG.cjs} +21 -21
  64. package/dist/{chunk-6IJOPRZP.cjs.map → chunk-WD6HJRBG.cjs.map} +1 -1
  65. package/dist/{chunk-EK362Q45.cjs → chunk-WKOIGLQX.cjs} +8 -8
  66. package/dist/{chunk-EK362Q45.cjs.map → chunk-WKOIGLQX.cjs.map} +1 -1
  67. package/dist/{chunk-LKAIXWK3.js → chunk-XGFTL5XY.js} +3 -3
  68. package/dist/{chunk-LKAIXWK3.js.map → chunk-XGFTL5XY.js.map} +1 -1
  69. package/dist/{chunk-JSNV5O2F.cjs → chunk-ZL7UM6PU.cjs} +4 -4
  70. package/dist/{chunk-JSNV5O2F.cjs.map → chunk-ZL7UM6PU.cjs.map} +1 -1
  71. package/dist/{chunk-C57NEO3X.js → chunk-ZO5PBBFX.js} +173 -3
  72. package/dist/chunk-ZO5PBBFX.js.map +1 -0
  73. package/dist/entries/apps.cjs +42 -42
  74. package/dist/entries/apps.d.cts +10 -1
  75. package/dist/entries/apps.d.ts +10 -1
  76. package/dist/entries/apps.js +7 -7
  77. package/dist/entries/credits.cjs +155 -151
  78. package/dist/entries/credits.d.cts +41 -10
  79. package/dist/entries/credits.d.ts +41 -10
  80. package/dist/entries/credits.js +7 -7
  81. package/dist/entries/model-catalog.cjs +75 -63
  82. package/dist/entries/model-catalog.d.cts +2 -2
  83. package/dist/entries/model-catalog.d.ts +2 -2
  84. package/dist/entries/model-catalog.js +4 -4
  85. package/dist/entries/models.cjs +209 -209
  86. package/dist/entries/models.d.cts +3 -3
  87. package/dist/entries/models.d.ts +3 -3
  88. package/dist/entries/models.js +4 -4
  89. package/dist/entries/nodes.cjs +200 -200
  90. package/dist/entries/nodes.d.cts +1 -1
  91. package/dist/entries/nodes.d.ts +1 -1
  92. package/dist/entries/nodes.js +8 -8
  93. package/dist/entries/pipeline.cjs +149 -149
  94. package/dist/entries/pipeline.d.cts +6 -6
  95. package/dist/entries/pipeline.d.ts +6 -6
  96. package/dist/entries/pipeline.js +3 -3
  97. package/dist/entries/ugc.cjs +71 -71
  98. package/dist/entries/ugc.js +4 -4
  99. package/dist/entries/video.cjs +115 -115
  100. package/dist/entries/video.js +4 -4
  101. package/dist/entries/workflow.cjs +95 -95
  102. package/dist/entries/workflow.d.cts +13 -3
  103. package/dist/entries/workflow.d.ts +13 -3
  104. package/dist/entries/workflow.js +1 -1
  105. package/dist/index.cjs +1087 -1071
  106. package/dist/index.d.cts +4 -4
  107. package/dist/index.d.ts +4 -4
  108. package/dist/index.js +18 -18
  109. package/dist/{model-catalog-flJYaa-g.d.ts → model-catalog-V-ZNzRSd.d.cts} +91 -1
  110. package/dist/{model-catalog-flJYaa-g.d.cts → model-catalog-V-ZNzRSd.d.ts} +91 -1
  111. package/dist/{presentation-utils-BIqiCzSA.d.cts → presentation-utils-D0kxsWf9.d.cts} +2 -0
  112. package/dist/{presentation-utils-BdiObtwq.d.ts → presentation-utils-pZwlEAzo.d.ts} +2 -0
  113. package/dist/{scene-node-types-DjenYFLO.d.ts → scene-node-types-C3kl_zyK.d.cts} +1 -1
  114. package/dist/{scene-node-types-DjenYFLO.d.cts → scene-node-types-C3kl_zyK.d.ts} +1 -1
  115. package/package.json +1 -1
  116. package/src/__tests__/model-makers.test.ts +76 -0
  117. package/src/__tests__/presentation-utils.test.ts +15 -0
  118. package/src/__tests__/private-host.test.ts +53 -0
  119. package/src/component-types.ts +9 -0
  120. package/src/credit-identifiers.ts +62 -17
  121. package/src/entries/credits.ts +1 -0
  122. package/src/entries/model-catalog.ts +6 -0
  123. package/src/model-catalog.ts +207 -0
  124. package/src/presentation-utils.ts +7 -0
  125. package/src/private-host.ts +89 -59
  126. package/dist/chunk-3CUFITU7.js.map +0 -1
  127. package/dist/chunk-5AUSSJIM.cjs.map +0 -1
  128. package/dist/chunk-5U7VLG43.js.map +0 -1
  129. package/dist/chunk-AROWPFO2.js.map +0 -1
  130. package/dist/chunk-AVQK77G6.cjs.map +0 -1
  131. package/dist/chunk-C57NEO3X.js.map +0 -1
  132. package/dist/chunk-IEBZHTPE.js.map +0 -1
  133. package/dist/chunk-NT6IJH4L.cjs.map +0 -1
  134. package/dist/chunk-O7PUQLJ3.cjs.map +0 -1
  135. package/dist/chunk-RJL7RCEM.cjs.map +0 -1
  136. package/dist/chunk-WNG7HRVA.cjs +0 -25
@@ -1823,58 +1823,75 @@ function getStrategy(id) {
1823
1823
  }
1824
1824
 
1825
1825
  // src/private-host.ts
1826
+ function isPrivateOrReservedIPv4(a, b, c) {
1827
+ if (a === 0) return true;
1828
+ if (a === 127) return true;
1829
+ if (a === 10) return true;
1830
+ if (a === 172 && b >= 16 && b <= 31) return true;
1831
+ if (a === 192 && b === 168) return true;
1832
+ if (a === 169 && b === 254) return true;
1833
+ if (a === 100 && b >= 64 && b <= 127) return true;
1834
+ if (a === 198 && (b === 18 || b === 19)) return true;
1835
+ if (a === 192 && b === 0 && c === 0) return true;
1836
+ if (a >= 224) return true;
1837
+ return false;
1838
+ }
1839
+ function embeddedIPv4IsPrivate(hi, lo) {
1840
+ return isPrivateOrReservedIPv4(hi >> 8, hi & 255, lo >> 8);
1841
+ }
1842
+ function ipv6Groups(ip) {
1843
+ let text = ip.toLowerCase();
1844
+ const zone = text.indexOf("%");
1845
+ if (zone >= 0) text = text.slice(0, zone);
1846
+ if (!text.includes(":") || !/^[0-9a-f:.]+$/.test(text)) return null;
1847
+ const lastColon = text.lastIndexOf(":");
1848
+ const last = text.slice(lastColon + 1);
1849
+ if (last.includes(".")) {
1850
+ const parts = last.split(".");
1851
+ if (parts.length !== 4 || parts.some((p) => !/^\d{1,3}$/.test(p) || Number(p) > 255)) return null;
1852
+ const [a, b, c, d] = parts.map(Number);
1853
+ text = `${text.slice(0, lastColon + 1)}${(a << 8 | b).toString(16)}:${(c << 8 | d).toString(16)}`;
1854
+ }
1855
+ const halves = text.split("::");
1856
+ if (halves.length > 2) return null;
1857
+ const groupsOf = (part) => part === "" ? [] : part.split(":");
1858
+ const head = groupsOf(halves[0] ?? "");
1859
+ const tail = halves.length === 2 ? groupsOf(halves[1] ?? "") : [];
1860
+ if ([...head, ...tail].some((g) => !/^[0-9a-f]{1,4}$/.test(g))) return null;
1861
+ if (halves.length === 1) {
1862
+ return head.length === 8 ? head.map((g) => parseInt(g, 16)) : null;
1863
+ }
1864
+ const missing = 8 - head.length - tail.length;
1865
+ if (missing < 1) return null;
1866
+ return [...head, ...Array(missing).fill("0"), ...tail].map((g) => parseInt(g, 16));
1867
+ }
1868
+ function isPrivateOrReservedIPv6(g) {
1869
+ const zeroThrough = (n) => g.slice(0, n).every((x) => x === 0);
1870
+ const [g0 = 0, g1 = 0, g2 = 0, g3 = 0, , g5 = 0, g6 = 0, g7 = 0] = g;
1871
+ if (zeroThrough(8)) return true;
1872
+ if (zeroThrough(7) && g7 === 1) return true;
1873
+ if (zeroThrough(5) && g5 === 65535) return embeddedIPv4IsPrivate(g6, g7);
1874
+ if (zeroThrough(6)) return embeddedIPv4IsPrivate(g6, g7);
1875
+ if (g0 === 100 && g1 === 65435 && g.slice(2, 6).every((x) => x === 0)) {
1876
+ return embeddedIPv4IsPrivate(g6, g7);
1877
+ }
1878
+ if (g0 === 100 && g1 === 65435 && g2 === 1) return true;
1879
+ if (g0 === 8194) return embeddedIPv4IsPrivate(g1, g2);
1880
+ if (g0 === 8193 && g1 === 0) return true;
1881
+ if ((g0 & 65024) === 64512) return true;
1882
+ if ((g0 & 65472) === 65152) return true;
1883
+ if ((g0 & 65472) === 65216) return true;
1884
+ if ((g0 & 65280) === 65280) return true;
1885
+ return false;
1886
+ }
1826
1887
  function isPrivateOrReservedIP(ip) {
1827
1888
  const v4 = ip.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
1828
1889
  if (v4) {
1829
- const a = Number(v4[1]);
1830
- const b = Number(v4[2]);
1831
- if (a === 0) return true;
1832
- if (a === 127) return true;
1833
- if (a === 10) return true;
1834
- if (a === 172 && b >= 16 && b <= 31) return true;
1835
- if (a === 192 && b === 168) return true;
1836
- if (a === 169 && b === 254) return true;
1837
- if (a === 100 && b >= 64 && b <= 127) return true;
1838
- if (a === 198 && (b === 18 || b === 19)) return true;
1839
- if (a >= 224) return true;
1840
- return false;
1841
- }
1842
- const lower = ip.toLowerCase();
1843
- if (lower === "::" || lower === "::1") return true;
1844
- if (lower.startsWith("fe80:") || lower.startsWith("fe80::")) return true;
1845
- if (/^f[cd]/.test(lower)) return true;
1846
- if (lower.startsWith("ff")) return true;
1847
- if (lower.startsWith("::ffff:")) {
1848
- const tail = lower.slice(7);
1849
- if (tail.includes(".")) {
1850
- return isPrivateOrReservedIP(tail);
1851
- }
1852
- const parts = tail.split(":");
1853
- if (parts.length === 2) {
1854
- const hi = parseInt(parts[0] || "0", 16);
1855
- const lo = parseInt(parts[1] || "0", 16);
1856
- if (Number.isFinite(hi) && Number.isFinite(lo)) {
1857
- const ipv4 = `${hi >> 8 & 255}.${hi & 255}.${lo >> 8 & 255}.${lo & 255}`;
1858
- return isPrivateOrReservedIP(ipv4);
1859
- }
1860
- }
1861
- return true;
1890
+ return isPrivateOrReservedIPv4(Number(v4[1]), Number(v4[2]), Number(v4[3]));
1862
1891
  }
1863
- if (lower.startsWith("::") && lower !== "::" && lower !== "::1") {
1864
- const tail = lower.slice(2);
1865
- if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(tail)) {
1866
- return isPrivateOrReservedIP(tail);
1867
- }
1868
- const parts = tail.split(":");
1869
- if (parts.length === 2 && /^[0-9a-f]{1,4}$/.test(parts[0]) && /^[0-9a-f]{1,4}$/.test(parts[1])) {
1870
- const hi = parseInt(parts[0], 16);
1871
- const lo = parseInt(parts[1], 16);
1872
- if (Number.isFinite(hi) && Number.isFinite(lo)) {
1873
- return isPrivateOrReservedIP(`${hi >> 8 & 255}.${hi & 255}.${lo >> 8 & 255}.${lo & 255}`);
1874
- }
1875
- }
1876
- }
1877
- return false;
1892
+ if (!ip.includes(":")) return false;
1893
+ const groups = ipv6Groups(ip);
1894
+ return groups === null ? true : isPrivateOrReservedIPv6(groups);
1878
1895
  }
1879
1896
  function isLocalOrPrivateHostname(hostname) {
1880
1897
  const host = hostname.toLowerCase().replace(/^\[|\]$/g, "").replace(/\.$/, "");
@@ -1996,5 +2013,5 @@ exports.timezoneOffsetMinutes = timezoneOffsetMinutes;
1996
2013
  exports.validateSubWorkflowRoutes = validateSubWorkflowRoutes;
1997
2014
  exports.variantJobId = variantJobId;
1998
2015
  exports.zipMergeLists = zipMergeLists;
1999
- //# sourceMappingURL=chunk-AVQK77G6.cjs.map
2000
- //# sourceMappingURL=chunk-AVQK77G6.cjs.map
2016
+ //# sourceMappingURL=chunk-D6GNRSCV.cjs.map
2017
+ //# sourceMappingURL=chunk-D6GNRSCV.cjs.map