@nodaro/sdk 2.28.0 → 2.31.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 (716) hide show
  1. package/README.md +33 -2
  2. package/dist/chunk-2DZWWIJ4.cjs +32 -0
  3. package/dist/chunk-2DZWWIJ4.cjs.map +1 -0
  4. package/dist/chunk-34PU2DAT.cjs +118 -0
  5. package/dist/chunk-34PU2DAT.cjs.map +1 -0
  6. package/dist/chunk-37Y5QAVA.js +3 -0
  7. package/dist/chunk-37Y5QAVA.js.map +1 -0
  8. package/dist/chunk-37YCKZX4.cjs +4 -0
  9. package/dist/chunk-37YCKZX4.cjs.map +1 -0
  10. package/dist/chunk-3B47IHB3.cjs +65 -0
  11. package/dist/chunk-3B47IHB3.cjs.map +1 -0
  12. package/dist/chunk-3BELHJBN.cjs +4 -0
  13. package/dist/chunk-3BELHJBN.cjs.map +1 -0
  14. package/dist/chunk-3PPSGM5X.js +3 -0
  15. package/dist/chunk-3PPSGM5X.js.map +1 -0
  16. package/dist/chunk-3QBH2VE2.cjs +80 -0
  17. package/dist/chunk-3QBH2VE2.cjs.map +1 -0
  18. package/dist/chunk-3QFTP5P5.js +102 -0
  19. package/dist/chunk-3QFTP5P5.js.map +1 -0
  20. package/dist/chunk-43FVH6LJ.cjs +123 -0
  21. package/dist/chunk-43FVH6LJ.cjs.map +1 -0
  22. package/dist/chunk-43NO4SGC.cjs +4 -0
  23. package/dist/chunk-43NO4SGC.cjs.map +1 -0
  24. package/dist/chunk-45CK55BH.cjs +4 -0
  25. package/dist/chunk-45CK55BH.cjs.map +1 -0
  26. package/dist/chunk-4NLVBYMW.js +280 -0
  27. package/dist/chunk-4NLVBYMW.js.map +1 -0
  28. package/dist/chunk-4WRDR4GN.js +102 -0
  29. package/dist/chunk-4WRDR4GN.js.map +1 -0
  30. package/dist/chunk-4WWSHV5G.cjs +4 -0
  31. package/dist/chunk-4WWSHV5G.cjs.map +1 -0
  32. package/dist/chunk-53SXNN3A.js +80 -0
  33. package/dist/chunk-53SXNN3A.js.map +1 -0
  34. package/dist/chunk-5ALNFATQ.cjs +27 -0
  35. package/dist/chunk-5ALNFATQ.cjs.map +1 -0
  36. package/dist/chunk-5UQNMNUE.cjs +4 -0
  37. package/dist/chunk-5UQNMNUE.cjs.map +1 -0
  38. package/dist/chunk-5WAI7VGO.js +184 -0
  39. package/dist/chunk-5WAI7VGO.js.map +1 -0
  40. package/dist/chunk-65E3JBFZ.js +52 -0
  41. package/dist/chunk-65E3JBFZ.js.map +1 -0
  42. package/dist/chunk-6JFNBAKV.js +3 -0
  43. package/dist/chunk-6JFNBAKV.js.map +1 -0
  44. package/dist/chunk-6OC6OKLY.cjs +4 -0
  45. package/dist/chunk-6OC6OKLY.cjs.map +1 -0
  46. package/dist/chunk-6OGGJQVA.js +25 -0
  47. package/dist/chunk-6OGGJQVA.js.map +1 -0
  48. package/dist/chunk-7A7HYFGM.js +3 -0
  49. package/dist/chunk-7A7HYFGM.js.map +1 -0
  50. package/dist/chunk-7ISSKQ6S.cjs +106 -0
  51. package/dist/chunk-7ISSKQ6S.cjs.map +1 -0
  52. package/dist/chunk-7LSFG2AF.js +194 -0
  53. package/dist/chunk-7LSFG2AF.js.map +1 -0
  54. package/dist/chunk-7MYKT2L4.cjs +4 -0
  55. package/dist/chunk-7MYKT2L4.cjs.map +1 -0
  56. package/dist/chunk-7QOCWJKD.cjs +25 -0
  57. package/dist/chunk-7QOCWJKD.cjs.map +1 -0
  58. package/dist/chunk-A2ZAFAWC.cjs +4 -0
  59. package/dist/chunk-A2ZAFAWC.cjs.map +1 -0
  60. package/dist/chunk-A3S55XGF.cjs +54 -0
  61. package/dist/chunk-A3S55XGF.cjs.map +1 -0
  62. package/dist/chunk-A3THLBFG.js +3 -0
  63. package/dist/chunk-A3THLBFG.js.map +1 -0
  64. package/dist/chunk-AJVSMNPZ.js +78 -0
  65. package/dist/chunk-AJVSMNPZ.js.map +1 -0
  66. package/dist/chunk-ALSLZG3U.js +124 -0
  67. package/dist/chunk-ALSLZG3U.js.map +1 -0
  68. package/dist/chunk-ALUUBPDG.cjs +4 -0
  69. package/dist/chunk-ALUUBPDG.cjs.map +1 -0
  70. package/dist/chunk-AO3W45LT.cjs +4 -0
  71. package/dist/chunk-AO3W45LT.cjs.map +1 -0
  72. package/dist/chunk-AUDHV3OE.js +3 -0
  73. package/dist/chunk-AUDHV3OE.js.map +1 -0
  74. package/dist/chunk-BAL576G2.cjs +4 -0
  75. package/dist/chunk-BAL576G2.cjs.map +1 -0
  76. package/dist/chunk-BFMKPELU.cjs +212 -0
  77. package/dist/chunk-BFMKPELU.cjs.map +1 -0
  78. package/dist/chunk-BKP6F2IX.js +3 -0
  79. package/dist/chunk-BKP6F2IX.js.map +1 -0
  80. package/dist/chunk-BLA44UCM.js +32 -0
  81. package/dist/chunk-BLA44UCM.js.map +1 -0
  82. package/dist/chunk-BPWUWUZ3.cjs +20 -0
  83. package/dist/chunk-BPWUWUZ3.cjs.map +1 -0
  84. package/dist/chunk-BRV7Z4GD.cjs +17 -0
  85. package/dist/chunk-BRV7Z4GD.cjs.map +1 -0
  86. package/dist/chunk-BU5A6K4C.js +122 -0
  87. package/dist/chunk-BU5A6K4C.js.map +1 -0
  88. package/dist/chunk-C22RJDW3.js +3 -0
  89. package/dist/chunk-C22RJDW3.js.map +1 -0
  90. package/dist/chunk-CGNVHN4V.js +3 -0
  91. package/dist/chunk-CGNVHN4V.js.map +1 -0
  92. package/dist/chunk-CJFIOVBA.js +3 -0
  93. package/dist/chunk-CJFIOVBA.js.map +1 -0
  94. package/dist/chunk-CJLLIVSB.cjs +4 -0
  95. package/dist/chunk-CJLLIVSB.cjs.map +1 -0
  96. package/dist/chunk-CK3AMMSC.js +194 -0
  97. package/dist/chunk-CK3AMMSC.js.map +1 -0
  98. package/dist/chunk-COCKKMNP.cjs +205 -0
  99. package/dist/chunk-COCKKMNP.cjs.map +1 -0
  100. package/dist/chunk-CR5E2SF3.cjs +212 -0
  101. package/dist/chunk-CR5E2SF3.cjs.map +1 -0
  102. package/dist/chunk-CRCPRZFN.js +3 -0
  103. package/dist/chunk-CRCPRZFN.js.map +1 -0
  104. package/dist/chunk-CYRFD6KR.cjs +4 -0
  105. package/dist/chunk-CYRFD6KR.cjs.map +1 -0
  106. package/dist/chunk-D3PW7AHZ.js +3 -0
  107. package/dist/chunk-D3PW7AHZ.js.map +1 -0
  108. package/dist/chunk-DKEYSJCE.cjs +82 -0
  109. package/dist/chunk-DKEYSJCE.cjs.map +1 -0
  110. package/dist/chunk-DPSMVOM3.js +15 -0
  111. package/dist/chunk-DPSMVOM3.js.map +1 -0
  112. package/dist/chunk-E2ZXHS6E.js +20 -0
  113. package/dist/chunk-E2ZXHS6E.js.map +1 -0
  114. package/dist/chunk-E37CVHWW.js +33 -0
  115. package/dist/chunk-E37CVHWW.js.map +1 -0
  116. package/dist/chunk-E5BM4BLO.js +78 -0
  117. package/dist/chunk-E5BM4BLO.js.map +1 -0
  118. package/dist/chunk-EHRWTYGR.cjs +4 -0
  119. package/dist/chunk-EHRWTYGR.cjs.map +1 -0
  120. package/dist/chunk-EJSGJDZY.js +212 -0
  121. package/dist/chunk-EJSGJDZY.js.map +1 -0
  122. package/dist/chunk-ELSOVJPF.js +3 -0
  123. package/dist/chunk-ELSOVJPF.js.map +1 -0
  124. package/dist/chunk-ERLXU47J.js +29 -0
  125. package/dist/chunk-ERLXU47J.js.map +1 -0
  126. package/dist/chunk-ES2E65HT.js +3 -0
  127. package/dist/chunk-ES2E65HT.js.map +1 -0
  128. package/dist/chunk-EXLAHZKF.js +3 -0
  129. package/dist/chunk-EXLAHZKF.js.map +1 -0
  130. package/dist/chunk-FHEYAW5H.js +3 -0
  131. package/dist/chunk-FHEYAW5H.js.map +1 -0
  132. package/dist/chunk-GA4LZZKQ.cjs +104 -0
  133. package/dist/chunk-GA4LZZKQ.cjs.map +1 -0
  134. package/dist/chunk-GAZJ2PA3.js +3 -0
  135. package/dist/chunk-GAZJ2PA3.js.map +1 -0
  136. package/dist/chunk-GB6C5OEZ.cjs +32 -0
  137. package/dist/chunk-GB6C5OEZ.cjs.map +1 -0
  138. package/dist/chunk-GD24ZRFD.js +3 -0
  139. package/dist/chunk-GD24ZRFD.js.map +1 -0
  140. package/dist/chunk-GI7LROLL.cjs +4 -0
  141. package/dist/chunk-GI7LROLL.cjs.map +1 -0
  142. package/dist/chunk-GRFLPEM2.cjs +16 -0
  143. package/dist/chunk-GRFLPEM2.cjs.map +1 -0
  144. package/dist/chunk-GVIFLUYZ.cjs +40 -0
  145. package/dist/chunk-GVIFLUYZ.cjs.map +1 -0
  146. package/dist/chunk-H7VQTG4M.js +35 -0
  147. package/dist/chunk-H7VQTG4M.js.map +1 -0
  148. package/dist/chunk-HAKYPZLB.cjs +242 -0
  149. package/dist/chunk-HAKYPZLB.cjs.map +1 -0
  150. package/dist/chunk-HFBR6G36.js +3 -0
  151. package/dist/chunk-HFBR6G36.js.map +1 -0
  152. package/dist/chunk-HGCVWOGK.cjs +209 -0
  153. package/dist/chunk-HGCVWOGK.cjs.map +1 -0
  154. package/dist/chunk-HLHR3R4P.js +3 -0
  155. package/dist/chunk-HLHR3R4P.js.map +1 -0
  156. package/dist/chunk-HRXXGGSJ.js +3 -0
  157. package/dist/chunk-HRXXGGSJ.js.map +1 -0
  158. package/dist/chunk-I3TYBAOX.js +3 -0
  159. package/dist/chunk-I3TYBAOX.js.map +1 -0
  160. package/dist/chunk-I4A5VJRL.js +352 -0
  161. package/dist/chunk-I4A5VJRL.js.map +1 -0
  162. package/dist/chunk-I6CXC345.js +102 -0
  163. package/dist/chunk-I6CXC345.js.map +1 -0
  164. package/dist/chunk-IGOPUMEX.cjs +4 -0
  165. package/dist/chunk-IGOPUMEX.cjs.map +1 -0
  166. package/dist/chunk-IHKIYVZQ.js +30 -0
  167. package/dist/chunk-IHKIYVZQ.js.map +1 -0
  168. package/dist/chunk-IMC2M5YM.cjs +12 -0
  169. package/dist/chunk-IMC2M5YM.cjs.map +1 -0
  170. package/dist/chunk-IQ6KWSXP.js +3 -0
  171. package/dist/chunk-IQ6KWSXP.js.map +1 -0
  172. package/dist/chunk-IS26FJO7.cjs +4 -0
  173. package/dist/chunk-IS26FJO7.cjs.map +1 -0
  174. package/dist/chunk-J4WFSKY6.js +50 -0
  175. package/dist/chunk-J4WFSKY6.js.map +1 -0
  176. package/dist/chunk-J5LGGCAS.cjs +126 -0
  177. package/dist/chunk-J5LGGCAS.cjs.map +1 -0
  178. package/dist/chunk-JDEZHITT.js +43 -0
  179. package/dist/chunk-JDEZHITT.js.map +1 -0
  180. package/dist/chunk-JGS6YBDW.js +260 -0
  181. package/dist/chunk-JGS6YBDW.js.map +1 -0
  182. package/dist/chunk-JMOKD6ZP.js +46 -0
  183. package/dist/chunk-JMOKD6ZP.js.map +1 -0
  184. package/dist/chunk-JOX5BJ6K.cjs +4 -0
  185. package/dist/chunk-JOX5BJ6K.cjs.map +1 -0
  186. package/dist/chunk-JTAW54UM.js +116 -0
  187. package/dist/chunk-JTAW54UM.js.map +1 -0
  188. package/dist/chunk-K4RQOSJH.js +203 -0
  189. package/dist/chunk-K4RQOSJH.js.map +1 -0
  190. package/dist/chunk-KAIE6WJB.cjs +4 -0
  191. package/dist/chunk-KAIE6WJB.cjs.map +1 -0
  192. package/dist/chunk-KEDPGWIK.cjs +4 -0
  193. package/dist/chunk-KEDPGWIK.cjs.map +1 -0
  194. package/dist/chunk-KG4R454Z.js +18 -0
  195. package/dist/chunk-KG4R454Z.js.map +1 -0
  196. package/dist/chunk-KGKCAGRD.cjs +22 -0
  197. package/dist/chunk-KGKCAGRD.cjs.map +1 -0
  198. package/dist/chunk-KNMW722T.cjs +48 -0
  199. package/dist/chunk-KNMW722T.cjs.map +1 -0
  200. package/dist/chunk-KTTL7BND.cjs +4 -0
  201. package/dist/chunk-KTTL7BND.cjs.map +1 -0
  202. package/dist/chunk-KXEWTYS4.cjs +80 -0
  203. package/dist/chunk-KXEWTYS4.cjs.map +1 -0
  204. package/dist/chunk-KZQKFBRN.js +3 -0
  205. package/dist/chunk-KZQKFBRN.js.map +1 -0
  206. package/dist/chunk-LAWYFC4G.cjs +37 -0
  207. package/dist/chunk-LAWYFC4G.cjs.map +1 -0
  208. package/dist/chunk-LHP2CWHD.js +228 -0
  209. package/dist/chunk-LHP2CWHD.js.map +1 -0
  210. package/dist/chunk-LHRQXWI5.js +3 -0
  211. package/dist/chunk-LHRQXWI5.js.map +1 -0
  212. package/dist/chunk-LKH5M44B.cjs +114 -0
  213. package/dist/chunk-LKH5M44B.cjs.map +1 -0
  214. package/dist/chunk-LLNNHLCE.cjs +4 -0
  215. package/dist/chunk-LLNNHLCE.cjs.map +1 -0
  216. package/dist/chunk-LWZLWSXD.cjs +4 -0
  217. package/dist/chunk-LWZLWSXD.cjs.map +1 -0
  218. package/dist/chunk-M6Y5TOYE.js +3 -0
  219. package/dist/chunk-M6Y5TOYE.js.map +1 -0
  220. package/dist/chunk-MBFUMWI5.cjs +31 -0
  221. package/dist/chunk-MBFUMWI5.cjs.map +1 -0
  222. package/dist/chunk-MEKI37WI.js +3 -0
  223. package/dist/chunk-MEKI37WI.js.map +1 -0
  224. package/dist/chunk-MQ74AKA2.cjs +200 -0
  225. package/dist/chunk-MQ74AKA2.cjs.map +1 -0
  226. package/dist/chunk-N6GLZOE4.cjs +282 -0
  227. package/dist/chunk-N6GLZOE4.cjs.map +1 -0
  228. package/dist/chunk-NBVARNVA.cjs +38 -0
  229. package/dist/chunk-NBVARNVA.cjs.map +1 -0
  230. package/dist/chunk-NCCBS6GU.js +42 -0
  231. package/dist/chunk-NCCBS6GU.js.map +1 -0
  232. package/dist/chunk-NGKODS3J.cjs +52 -0
  233. package/dist/chunk-NGKODS3J.cjs.map +1 -0
  234. package/dist/chunk-NJVSKUL2.cjs +4 -0
  235. package/dist/chunk-NJVSKUL2.cjs.map +1 -0
  236. package/dist/chunk-NLQQHJ25.cjs +104 -0
  237. package/dist/chunk-NLQQHJ25.cjs.map +1 -0
  238. package/dist/chunk-NNHWH7ER.js +181 -0
  239. package/dist/chunk-NNHWH7ER.js.map +1 -0
  240. package/dist/chunk-NX67YIF3.js +3 -0
  241. package/dist/chunk-NX67YIF3.js.map +1 -0
  242. package/dist/chunk-OA6FWYZF.cjs +4 -0
  243. package/dist/chunk-OA6FWYZF.cjs.map +1 -0
  244. package/dist/chunk-OJDBSKC2.js +3 -0
  245. package/dist/chunk-OJDBSKC2.js.map +1 -0
  246. package/dist/chunk-OLPA44QJ.js +3 -0
  247. package/dist/chunk-OLPA44QJ.js.map +1 -0
  248. package/dist/chunk-OMH7ATOQ.js +3 -0
  249. package/dist/chunk-OMH7ATOQ.js.map +1 -0
  250. package/dist/chunk-OPR4TULG.js +3 -0
  251. package/dist/chunk-OPR4TULG.js.map +1 -0
  252. package/dist/chunk-OSX2GVZ2.cjs +34 -0
  253. package/dist/chunk-OSX2GVZ2.cjs.map +1 -0
  254. package/dist/chunk-OXQKE5EG.cjs +282 -0
  255. package/dist/chunk-OXQKE5EG.cjs.map +1 -0
  256. package/dist/chunk-P6E4QDJN.js +30 -0
  257. package/dist/chunk-P6E4QDJN.js.map +1 -0
  258. package/dist/chunk-PEMLIAPZ.cjs +64 -0
  259. package/dist/chunk-PEMLIAPZ.cjs.map +1 -0
  260. package/dist/chunk-PGYQ754I.js +3 -0
  261. package/dist/chunk-PGYQ754I.js.map +1 -0
  262. package/dist/chunk-PHKYIWE4.cjs +16 -0
  263. package/dist/chunk-PHKYIWE4.cjs.map +1 -0
  264. package/dist/chunk-PMTM26LL.js +3 -0
  265. package/dist/chunk-PMTM26LL.js.map +1 -0
  266. package/dist/chunk-PY4OEKNX.cjs +4 -0
  267. package/dist/chunk-PY4OEKNX.cjs.map +1 -0
  268. package/dist/chunk-PZS2EXDR.cjs +4 -0
  269. package/dist/chunk-PZS2EXDR.cjs.map +1 -0
  270. package/dist/chunk-QITJGSFA.js +210 -0
  271. package/dist/chunk-QITJGSFA.js.map +1 -0
  272. package/dist/chunk-QRHJEITQ.cjs +4 -0
  273. package/dist/chunk-QRHJEITQ.cjs.map +1 -0
  274. package/dist/chunk-QUFU5RJ7.cjs +4 -0
  275. package/dist/chunk-QUFU5RJ7.cjs.map +1 -0
  276. package/dist/chunk-QVQCKOBM.js +3 -0
  277. package/dist/chunk-QVQCKOBM.js.map +1 -0
  278. package/dist/chunk-R63TTR35.cjs +200 -0
  279. package/dist/chunk-R63TTR35.cjs.map +1 -0
  280. package/dist/chunk-RA42NMWV.cjs +4 -0
  281. package/dist/chunk-RA42NMWV.cjs.map +1 -0
  282. package/dist/chunk-RAZN6C5R.cjs +12 -0
  283. package/dist/chunk-RAZN6C5R.cjs.map +1 -0
  284. package/dist/chunk-REUFPWM7.cjs +233 -0
  285. package/dist/chunk-REUFPWM7.cjs.map +1 -0
  286. package/dist/chunk-RHETJOUM.cjs +4 -0
  287. package/dist/chunk-RHETJOUM.cjs.map +1 -0
  288. package/dist/chunk-RJIJVVXS.js +3 -0
  289. package/dist/chunk-RJIJVVXS.js.map +1 -0
  290. package/dist/chunk-RKVRCNMB.js +3 -0
  291. package/dist/chunk-RKVRCNMB.js.map +1 -0
  292. package/dist/chunk-SBV5MWEL.cjs +53 -0
  293. package/dist/chunk-SBV5MWEL.cjs.map +1 -0
  294. package/dist/chunk-SFB4YLCS.js +121 -0
  295. package/dist/chunk-SFB4YLCS.js.map +1 -0
  296. package/dist/chunk-SLPD47SR.js +3 -0
  297. package/dist/chunk-SLPD47SR.js.map +1 -0
  298. package/dist/chunk-SS3B6PHT.cjs +35 -0
  299. package/dist/chunk-SS3B6PHT.cjs.map +1 -0
  300. package/dist/chunk-SUCHGNYT.js +3 -0
  301. package/dist/chunk-SUCHGNYT.js.map +1 -0
  302. package/dist/chunk-SYVNY3AH.cjs +44 -0
  303. package/dist/chunk-SYVNY3AH.cjs.map +1 -0
  304. package/dist/chunk-T3SYREY4.js +29 -0
  305. package/dist/chunk-T3SYREY4.js.map +1 -0
  306. package/dist/chunk-T7N7DFQJ.js +198 -0
  307. package/dist/chunk-T7N7DFQJ.js.map +1 -0
  308. package/dist/chunk-TRCENAIY.cjs +4 -0
  309. package/dist/chunk-TRCENAIY.cjs.map +1 -0
  310. package/dist/chunk-TVENC6PH.js +186 -0
  311. package/dist/chunk-TVENC6PH.js.map +1 -0
  312. package/dist/chunk-U4T3Z3K7.cjs +325 -0
  313. package/dist/chunk-U4T3Z3K7.cjs.map +1 -0
  314. package/dist/chunk-UI2NXUML.cjs +187 -0
  315. package/dist/chunk-UI2NXUML.cjs.map +1 -0
  316. package/dist/chunk-UIFFNTUX.js +3 -0
  317. package/dist/chunk-UIFFNTUX.js.map +1 -0
  318. package/dist/chunk-V4GPQ6Y2.js +3 -0
  319. package/dist/chunk-V4GPQ6Y2.js.map +1 -0
  320. package/dist/chunk-VGTRKXF2.js +93 -0
  321. package/dist/chunk-VGTRKXF2.js.map +1 -0
  322. package/dist/chunk-VGWOIWRQ.cjs +202 -0
  323. package/dist/chunk-VGWOIWRQ.cjs.map +1 -0
  324. package/dist/chunk-VLCNNA76.cjs +4 -0
  325. package/dist/chunk-VLCNNA76.cjs.map +1 -0
  326. package/dist/chunk-VPAUN75Q.js +3 -0
  327. package/dist/chunk-VPAUN75Q.js.map +1 -0
  328. package/dist/chunk-VT237QF2.js +3 -0
  329. package/dist/chunk-VT237QF2.js.map +1 -0
  330. package/dist/chunk-VV4TZG5S.js +321 -0
  331. package/dist/chunk-VV4TZG5S.js.map +1 -0
  332. package/dist/chunk-VYK6MBL4.cjs +4 -0
  333. package/dist/chunk-VYK6MBL4.cjs.map +1 -0
  334. package/dist/chunk-W33CKW6Q.cjs +4 -0
  335. package/dist/chunk-W33CKW6Q.cjs.map +1 -0
  336. package/dist/chunk-W5VHATSR.cjs +31 -0
  337. package/dist/chunk-W5VHATSR.cjs.map +1 -0
  338. package/dist/chunk-W7YI5UT3.js +3 -0
  339. package/dist/chunk-W7YI5UT3.js.map +1 -0
  340. package/dist/chunk-WEQWU2IC.js +34 -0
  341. package/dist/chunk-WEQWU2IC.js.map +1 -0
  342. package/dist/chunk-WK4VXPPZ.cjs +104 -0
  343. package/dist/chunk-WK4VXPPZ.cjs.map +1 -0
  344. package/dist/chunk-WSA4LMWR.cjs +96 -0
  345. package/dist/chunk-WSA4LMWR.cjs.map +1 -0
  346. package/dist/chunk-WUIEZ6Z4.cjs +360 -0
  347. package/dist/chunk-WUIEZ6Z4.cjs.map +1 -0
  348. package/dist/chunk-WUKIJJG2.cjs +45 -0
  349. package/dist/chunk-WUKIJJG2.cjs.map +1 -0
  350. package/dist/chunk-WVFAQBS7.js +29 -0
  351. package/dist/chunk-WVFAQBS7.js.map +1 -0
  352. package/dist/chunk-X7RDNMN7.js +3 -0
  353. package/dist/chunk-X7RDNMN7.js.map +1 -0
  354. package/dist/chunk-X7XP5WBP.cjs +4 -0
  355. package/dist/chunk-X7XP5WBP.cjs.map +1 -0
  356. package/dist/chunk-XQAIEPAZ.js +104 -0
  357. package/dist/chunk-XQAIEPAZ.js.map +1 -0
  358. package/dist/chunk-XWKNE6DH.cjs +4 -0
  359. package/dist/chunk-XWKNE6DH.cjs.map +1 -0
  360. package/dist/chunk-Y6V6CBY5.js +23 -0
  361. package/dist/chunk-Y6V6CBY5.js.map +1 -0
  362. package/dist/chunk-Y6VDCZPB.js +62 -0
  363. package/dist/chunk-Y6VDCZPB.js.map +1 -0
  364. package/dist/chunk-YDRXBRW2.cjs +184 -0
  365. package/dist/chunk-YDRXBRW2.cjs.map +1 -0
  366. package/dist/chunk-YFS2LMG4.cjs +124 -0
  367. package/dist/chunk-YFS2LMG4.cjs.map +1 -0
  368. package/dist/chunk-YN6CBIIB.js +63 -0
  369. package/dist/chunk-YN6CBIIB.js.map +1 -0
  370. package/dist/chunk-YOJ2XNQX.cjs +4 -0
  371. package/dist/chunk-YOJ2XNQX.cjs.map +1 -0
  372. package/dist/chunk-YOOZB4RL.js +3 -0
  373. package/dist/chunk-YOOZB4RL.js.map +1 -0
  374. package/dist/chunk-YVU2M7MI.js +34 -0
  375. package/dist/chunk-YVU2M7MI.js.map +1 -0
  376. package/dist/chunk-YXBZRB5H.cjs +4 -0
  377. package/dist/chunk-YXBZRB5H.cjs.map +1 -0
  378. package/dist/chunk-Z3ZKFI2M.js +43 -0
  379. package/dist/chunk-Z3ZKFI2M.js.map +1 -0
  380. package/dist/chunk-Z5GLY4R3.js +112 -0
  381. package/dist/chunk-Z5GLY4R3.js.map +1 -0
  382. package/dist/chunk-Z5OMWAQX.js +3 -0
  383. package/dist/chunk-Z5OMWAQX.js.map +1 -0
  384. package/dist/chunk-Z7LGWNI7.js +38 -0
  385. package/dist/chunk-Z7LGWNI7.js.map +1 -0
  386. package/dist/chunk-ZCWKX4V6.cjs +38 -0
  387. package/dist/chunk-ZCWKX4V6.cjs.map +1 -0
  388. package/dist/chunk-ZE5RISBZ.cjs +4 -0
  389. package/dist/chunk-ZE5RISBZ.cjs.map +1 -0
  390. package/dist/chunk-ZH4F2P2G.js +3 -0
  391. package/dist/chunk-ZH4F2P2G.js.map +1 -0
  392. package/dist/chunk-ZJGFLJ2Z.cjs +4 -0
  393. package/dist/chunk-ZJGFLJ2Z.cjs.map +1 -0
  394. package/dist/chunk-ZKBHD27K.cjs +4 -0
  395. package/dist/chunk-ZKBHD27K.cjs.map +1 -0
  396. package/dist/chunk-ZQPLRNKX.cjs +4 -0
  397. package/dist/chunk-ZQPLRNKX.cjs.map +1 -0
  398. package/dist/chunk-ZQQABQMH.cjs +31 -0
  399. package/dist/chunk-ZQQABQMH.cjs.map +1 -0
  400. package/dist/chunk-ZXJQSFIA.js +200 -0
  401. package/dist/chunk-ZXJQSFIA.js.map +1 -0
  402. package/dist/developer-apps-zSQXWmEG.d.cts +294 -0
  403. package/dist/developer-apps-zSQXWmEG.d.ts +294 -0
  404. package/dist/entries/apps.cjs +13 -0
  405. package/dist/entries/apps.cjs.map +1 -0
  406. package/dist/entries/apps.d.cts +300 -0
  407. package/dist/entries/apps.d.ts +300 -0
  408. package/dist/entries/apps.js +4 -0
  409. package/dist/entries/apps.js.map +1 -0
  410. package/dist/entries/audio.cjs +13 -0
  411. package/dist/entries/audio.cjs.map +1 -0
  412. package/dist/entries/audio.d.cts +200 -0
  413. package/dist/entries/audio.d.ts +200 -0
  414. package/dist/entries/audio.js +4 -0
  415. package/dist/entries/audio.js.map +1 -0
  416. package/dist/entries/billing.cjs +13 -0
  417. package/dist/entries/billing.cjs.map +1 -0
  418. package/dist/entries/billing.d.cts +208 -0
  419. package/dist/entries/billing.d.ts +208 -0
  420. package/dist/entries/billing.js +4 -0
  421. package/dist/entries/billing.js.map +1 -0
  422. package/dist/entries/catalogs.cjs +13 -0
  423. package/dist/entries/catalogs.cjs.map +1 -0
  424. package/dist/entries/catalogs.d.cts +82 -0
  425. package/dist/entries/catalogs.d.ts +82 -0
  426. package/dist/entries/catalogs.js +4 -0
  427. package/dist/entries/catalogs.js.map +1 -0
  428. package/dist/entries/characters.cjs +45 -0
  429. package/dist/entries/characters.cjs.map +1 -0
  430. package/dist/entries/characters.d.cts +741 -0
  431. package/dist/entries/characters.d.ts +741 -0
  432. package/dist/entries/characters.js +4 -0
  433. package/dist/entries/characters.js.map +1 -0
  434. package/dist/entries/client.cjs +78 -0
  435. package/dist/entries/client.cjs.map +1 -0
  436. package/dist/entries/client.d.cts +147 -0
  437. package/dist/entries/client.d.ts +147 -0
  438. package/dist/entries/client.js +53 -0
  439. package/dist/entries/client.js.map +1 -0
  440. package/dist/entries/collections.cjs +13 -0
  441. package/dist/entries/collections.cjs.map +1 -0
  442. package/dist/entries/collections.d.cts +77 -0
  443. package/dist/entries/collections.d.ts +77 -0
  444. package/dist/entries/collections.js +4 -0
  445. package/dist/entries/collections.js.map +1 -0
  446. package/dist/entries/community.cjs +13 -0
  447. package/dist/entries/community.cjs.map +1 -0
  448. package/dist/entries/community.d.cts +87 -0
  449. package/dist/entries/community.d.ts +87 -0
  450. package/dist/entries/community.js +4 -0
  451. package/dist/entries/community.js.map +1 -0
  452. package/dist/entries/competitors.cjs +13 -0
  453. package/dist/entries/competitors.cjs.map +1 -0
  454. package/dist/entries/competitors.d.cts +96 -0
  455. package/dist/entries/competitors.d.ts +96 -0
  456. package/dist/entries/competitors.js +4 -0
  457. package/dist/entries/competitors.js.map +1 -0
  458. package/dist/entries/copilot.cjs +15 -0
  459. package/dist/entries/copilot.cjs.map +1 -0
  460. package/dist/entries/copilot.d.cts +296 -0
  461. package/dist/entries/copilot.d.ts +296 -0
  462. package/dist/entries/copilot.js +6 -0
  463. package/dist/entries/copilot.js.map +1 -0
  464. package/dist/entries/core.cjs +26 -0
  465. package/dist/entries/core.cjs.map +1 -0
  466. package/dist/entries/core.d.cts +3 -0
  467. package/dist/entries/core.d.ts +3 -0
  468. package/dist/entries/core.js +5 -0
  469. package/dist/entries/core.js.map +1 -0
  470. package/dist/entries/creatures.cjs +29 -0
  471. package/dist/entries/creatures.cjs.map +1 -0
  472. package/dist/entries/creatures.d.cts +594 -0
  473. package/dist/entries/creatures.d.ts +594 -0
  474. package/dist/entries/creatures.js +4 -0
  475. package/dist/entries/creatures.js.map +1 -0
  476. package/dist/entries/credits.cjs +13 -0
  477. package/dist/entries/credits.cjs.map +1 -0
  478. package/dist/entries/credits.d.cts +229 -0
  479. package/dist/entries/credits.d.ts +229 -0
  480. package/dist/entries/credits.js +4 -0
  481. package/dist/entries/credits.js.map +1 -0
  482. package/dist/entries/developer-apps.cjs +13 -0
  483. package/dist/entries/developer-apps.cjs.map +1 -0
  484. package/dist/entries/developer-apps.d.cts +3 -0
  485. package/dist/entries/developer-apps.d.ts +3 -0
  486. package/dist/entries/developer-apps.js +4 -0
  487. package/dist/entries/developer-apps.js.map +1 -0
  488. package/dist/entries/edit.cjs +34 -0
  489. package/dist/entries/edit.cjs.map +1 -0
  490. package/dist/entries/edit.d.cts +705 -0
  491. package/dist/entries/edit.d.ts +705 -0
  492. package/dist/entries/edit.js +5 -0
  493. package/dist/entries/edit.js.map +1 -0
  494. package/dist/entries/errors.cjs +93 -0
  495. package/dist/entries/errors.cjs.map +1 -0
  496. package/dist/entries/errors.d.cts +338 -0
  497. package/dist/entries/errors.d.ts +338 -0
  498. package/dist/entries/errors.js +4 -0
  499. package/dist/entries/errors.js.map +1 -0
  500. package/dist/entries/executions.cjs +21 -0
  501. package/dist/entries/executions.cjs.map +1 -0
  502. package/dist/entries/executions.d.cts +120 -0
  503. package/dist/entries/executions.d.ts +120 -0
  504. package/dist/entries/executions.js +4 -0
  505. package/dist/entries/executions.js.map +1 -0
  506. package/dist/entries/gallery.cjs +13 -0
  507. package/dist/entries/gallery.cjs.map +1 -0
  508. package/dist/entries/gallery.d.cts +85 -0
  509. package/dist/entries/gallery.d.ts +85 -0
  510. package/dist/entries/gallery.js +4 -0
  511. package/dist/entries/gallery.js.map +1 -0
  512. package/dist/entries/jobs.cjs +13 -0
  513. package/dist/entries/jobs.cjs.map +1 -0
  514. package/dist/entries/jobs.d.cts +252 -0
  515. package/dist/entries/jobs.d.ts +252 -0
  516. package/dist/entries/jobs.js +4 -0
  517. package/dist/entries/jobs.js.map +1 -0
  518. package/dist/entries/library.cjs +13 -0
  519. package/dist/entries/library.cjs.map +1 -0
  520. package/dist/entries/library.d.cts +109 -0
  521. package/dist/entries/library.d.ts +109 -0
  522. package/dist/entries/library.js +4 -0
  523. package/dist/entries/library.js.map +1 -0
  524. package/dist/entries/llm.cjs +13 -0
  525. package/dist/entries/llm.cjs.map +1 -0
  526. package/dist/entries/llm.d.cts +98 -0
  527. package/dist/entries/llm.d.ts +98 -0
  528. package/dist/entries/llm.js +4 -0
  529. package/dist/entries/llm.js.map +1 -0
  530. package/dist/entries/locations.cjs +25 -0
  531. package/dist/entries/locations.cjs.map +1 -0
  532. package/dist/entries/locations.d.cts +573 -0
  533. package/dist/entries/locations.d.ts +573 -0
  534. package/dist/entries/locations.js +4 -0
  535. package/dist/entries/locations.js.map +1 -0
  536. package/dist/entries/media.cjs +15 -0
  537. package/dist/entries/media.cjs.map +1 -0
  538. package/dist/entries/media.d.cts +548 -0
  539. package/dist/entries/media.d.ts +548 -0
  540. package/dist/entries/media.js +6 -0
  541. package/dist/entries/media.js.map +1 -0
  542. package/dist/entries/models.cjs +13 -0
  543. package/dist/entries/models.cjs.map +1 -0
  544. package/dist/entries/models.d.cts +92 -0
  545. package/dist/entries/models.d.ts +92 -0
  546. package/dist/entries/models.js +4 -0
  547. package/dist/entries/models.js.map +1 -0
  548. package/dist/entries/moodboards.cjs +21 -0
  549. package/dist/entries/moodboards.cjs.map +1 -0
  550. package/dist/entries/moodboards.d.cts +77 -0
  551. package/dist/entries/moodboards.d.ts +77 -0
  552. package/dist/entries/moodboards.js +4 -0
  553. package/dist/entries/moodboards.js.map +1 -0
  554. package/dist/entries/node-presets.cjs +13 -0
  555. package/dist/entries/node-presets.cjs.map +1 -0
  556. package/dist/entries/node-presets.d.cts +217 -0
  557. package/dist/entries/node-presets.d.ts +217 -0
  558. package/dist/entries/node-presets.js +4 -0
  559. package/dist/entries/node-presets.js.map +1 -0
  560. package/dist/entries/nodes.cjs +22 -0
  561. package/dist/entries/nodes.cjs.map +1 -0
  562. package/dist/entries/nodes.d.cts +18 -0
  563. package/dist/entries/nodes.d.ts +18 -0
  564. package/dist/entries/nodes.js +5 -0
  565. package/dist/entries/nodes.js.map +1 -0
  566. package/dist/entries/oauth.cjs +13 -0
  567. package/dist/entries/oauth.cjs.map +1 -0
  568. package/dist/entries/oauth.d.cts +69 -0
  569. package/dist/entries/oauth.d.ts +69 -0
  570. package/dist/entries/oauth.js +4 -0
  571. package/dist/entries/oauth.js.map +1 -0
  572. package/dist/entries/objects.cjs +29 -0
  573. package/dist/entries/objects.cjs.map +1 -0
  574. package/dist/entries/objects.d.cts +544 -0
  575. package/dist/entries/objects.d.ts +544 -0
  576. package/dist/entries/objects.js +4 -0
  577. package/dist/entries/objects.js.map +1 -0
  578. package/dist/entries/organizations.cjs +21 -0
  579. package/dist/entries/organizations.cjs.map +1 -0
  580. package/dist/entries/organizations.d.cts +164 -0
  581. package/dist/entries/organizations.d.ts +164 -0
  582. package/dist/entries/organizations.js +4 -0
  583. package/dist/entries/organizations.js.map +1 -0
  584. package/dist/entries/palettes.cjs +21 -0
  585. package/dist/entries/palettes.cjs.map +1 -0
  586. package/dist/entries/palettes.d.cts +69 -0
  587. package/dist/entries/palettes.d.ts +69 -0
  588. package/dist/entries/palettes.js +4 -0
  589. package/dist/entries/palettes.js.map +1 -0
  590. package/dist/entries/picker-catalogs.cjs +13 -0
  591. package/dist/entries/picker-catalogs.cjs.map +1 -0
  592. package/dist/entries/picker-catalogs.d.cts +148 -0
  593. package/dist/entries/picker-catalogs.d.ts +148 -0
  594. package/dist/entries/picker-catalogs.js +4 -0
  595. package/dist/entries/picker-catalogs.js.map +1 -0
  596. package/dist/entries/pipelines.cjs +13 -0
  597. package/dist/entries/pipelines.cjs.map +1 -0
  598. package/dist/entries/pipelines.d.cts +255 -0
  599. package/dist/entries/pipelines.d.ts +255 -0
  600. package/dist/entries/pipelines.js +4 -0
  601. package/dist/entries/pipelines.js.map +1 -0
  602. package/dist/entries/projects.cjs +13 -0
  603. package/dist/entries/projects.cjs.map +1 -0
  604. package/dist/entries/projects.d.cts +49 -0
  605. package/dist/entries/projects.d.ts +49 -0
  606. package/dist/entries/projects.js +4 -0
  607. package/dist/entries/projects.js.map +1 -0
  608. package/dist/entries/prompt-helper.cjs +13 -0
  609. package/dist/entries/prompt-helper.cjs.map +1 -0
  610. package/dist/entries/prompt-helper.d.cts +73 -0
  611. package/dist/entries/prompt-helper.d.ts +73 -0
  612. package/dist/entries/prompt-helper.js +4 -0
  613. package/dist/entries/prompt-helper.js.map +1 -0
  614. package/dist/entries/recast.cjs +17 -0
  615. package/dist/entries/recast.cjs.map +1 -0
  616. package/dist/entries/recast.d.cts +229 -0
  617. package/dist/entries/recast.d.ts +229 -0
  618. package/dist/entries/recast.js +4 -0
  619. package/dist/entries/recast.js.map +1 -0
  620. package/dist/entries/reduce.cjs +13 -0
  621. package/dist/entries/reduce.cjs.map +1 -0
  622. package/dist/entries/reduce.d.cts +56 -0
  623. package/dist/entries/reduce.d.ts +56 -0
  624. package/dist/entries/reduce.js +4 -0
  625. package/dist/entries/reduce.js.map +1 -0
  626. package/dist/entries/saved-posts.cjs +13 -0
  627. package/dist/entries/saved-posts.cjs.map +1 -0
  628. package/dist/entries/saved-posts.d.cts +33 -0
  629. package/dist/entries/saved-posts.d.ts +33 -0
  630. package/dist/entries/saved-posts.js +4 -0
  631. package/dist/entries/saved-posts.js.map +1 -0
  632. package/dist/entries/scene3d.cjs +17 -0
  633. package/dist/entries/scene3d.cjs.map +1 -0
  634. package/dist/entries/scene3d.d.cts +131 -0
  635. package/dist/entries/scene3d.d.ts +131 -0
  636. package/dist/entries/scene3d.js +4 -0
  637. package/dist/entries/scene3d.js.map +1 -0
  638. package/dist/entries/sessions.cjs +13 -0
  639. package/dist/entries/sessions.cjs.map +1 -0
  640. package/dist/entries/sessions.d.cts +122 -0
  641. package/dist/entries/sessions.d.ts +122 -0
  642. package/dist/entries/sessions.js +4 -0
  643. package/dist/entries/sessions.js.map +1 -0
  644. package/dist/entries/shots.cjs +13 -0
  645. package/dist/entries/shots.cjs.map +1 -0
  646. package/dist/entries/shots.d.cts +78 -0
  647. package/dist/entries/shots.d.ts +78 -0
  648. package/dist/entries/shots.js +4 -0
  649. package/dist/entries/shots.js.map +1 -0
  650. package/dist/entries/studio.cjs +22 -0
  651. package/dist/entries/studio.cjs.map +1 -0
  652. package/dist/entries/studio.d.cts +281 -0
  653. package/dist/entries/studio.d.ts +281 -0
  654. package/dist/entries/studio.js +5 -0
  655. package/dist/entries/studio.js.map +1 -0
  656. package/dist/entries/templates.cjs +13 -0
  657. package/dist/entries/templates.cjs.map +1 -0
  658. package/dist/entries/templates.d.cts +110 -0
  659. package/dist/entries/templates.d.ts +110 -0
  660. package/dist/entries/templates.js +4 -0
  661. package/dist/entries/templates.js.map +1 -0
  662. package/dist/entries/tutorials.cjs +13 -0
  663. package/dist/entries/tutorials.cjs.map +1 -0
  664. package/dist/entries/tutorials.d.cts +63 -0
  665. package/dist/entries/tutorials.d.ts +63 -0
  666. package/dist/entries/tutorials.js +4 -0
  667. package/dist/entries/tutorials.js.map +1 -0
  668. package/dist/entries/uploads.cjs +13 -0
  669. package/dist/entries/uploads.cjs.map +1 -0
  670. package/dist/entries/uploads.d.cts +44 -0
  671. package/dist/entries/uploads.d.ts +44 -0
  672. package/dist/entries/uploads.js +4 -0
  673. package/dist/entries/uploads.js.map +1 -0
  674. package/dist/entries/video-pro.cjs +13 -0
  675. package/dist/entries/video-pro.cjs.map +1 -0
  676. package/dist/entries/video-pro.d.cts +60 -0
  677. package/dist/entries/video-pro.d.ts +60 -0
  678. package/dist/entries/video-pro.js +4 -0
  679. package/dist/entries/video-pro.js.map +1 -0
  680. package/dist/entries/voices.cjs +13 -0
  681. package/dist/entries/voices.cjs.map +1 -0
  682. package/dist/entries/voices.d.cts +498 -0
  683. package/dist/entries/voices.d.ts +498 -0
  684. package/dist/entries/voices.js +4 -0
  685. package/dist/entries/voices.js.map +1 -0
  686. package/dist/entries/webhooks.cjs +21 -0
  687. package/dist/entries/webhooks.cjs.map +1 -0
  688. package/dist/entries/webhooks.d.cts +64 -0
  689. package/dist/entries/webhooks.d.ts +64 -0
  690. package/dist/entries/webhooks.js +4 -0
  691. package/dist/entries/webhooks.js.map +1 -0
  692. package/dist/entries/workflows.cjs +13 -0
  693. package/dist/entries/workflows.cjs.map +1 -0
  694. package/dist/entries/workflows.d.cts +393 -0
  695. package/dist/entries/workflows.d.ts +393 -0
  696. package/dist/entries/workflows.js +4 -0
  697. package/dist/entries/workflows.js.map +1 -0
  698. package/dist/entries/workspaces.cjs +13 -0
  699. package/dist/entries/workspaces.cjs.map +1 -0
  700. package/dist/entries/workspaces.d.cts +124 -0
  701. package/dist/entries/workspaces.d.ts +124 -0
  702. package/dist/entries/workspaces.js +4 -0
  703. package/dist/entries/workspaces.js.map +1 -0
  704. package/dist/index.cjs +501 -4618
  705. package/dist/index.cjs.map +1 -1
  706. package/dist/index.d.cts +66 -9651
  707. package/dist/index.d.ts +66 -9651
  708. package/dist/index.js +100 -4511
  709. package/dist/index.js.map +1 -1
  710. package/dist/nodes-BPvrAoUs.d.cts +1264 -0
  711. package/dist/nodes-C2zu3uqn.d.ts +1264 -0
  712. package/dist/studio-productions-DUHvdSvk.d.cts +572 -0
  713. package/dist/studio-productions-vbCNSbtf.d.ts +572 -0
  714. package/dist/webhooks-BJawEIz8.d.ts +198 -0
  715. package/dist/webhooks-Dn_DtNTD.d.cts +198 -0
  716. package/package.json +253 -3
@@ -0,0 +1,104 @@
1
+ 'use strict';
2
+
3
+ // src/resources/collections.ts
4
+ var CollectionsResource = class {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ client;
9
+ /** `GET /v1/collections` → your collections with their record counts, whether the server has collections at all, and your caps. */
10
+ list() {
11
+ return this.client.request("GET", "/v1/collections");
12
+ }
13
+ /** `GET /v1/collections/:id` → one collection. */
14
+ get(id) {
15
+ return this.client.request("GET", `/v1/collections/${encodeURIComponent(id)}`);
16
+ }
17
+ /** `POST /v1/collections` → a new collection (`409 name_taken` when you have one by that name, `403 collection_limit_reached` at your cap). */
18
+ create(input) {
19
+ return this.client.request("POST", "/v1/collections", { body: input });
20
+ }
21
+ /** `PATCH /v1/collections/:id` → rename or re-describe a collection. */
22
+ update(id, input) {
23
+ return this.client.request("PATCH", `/v1/collections/${encodeURIComponent(id)}`, { body: input });
24
+ }
25
+ /** `DELETE /v1/collections/:id` → remove a collection and every record in it. */
26
+ async delete(id) {
27
+ await this.client.request("DELETE", `/v1/collections/${encodeURIComponent(id)}`);
28
+ }
29
+ /**
30
+ * `GET /v1/collections/:id/records` → the records, newest first (`order: "oldest"`
31
+ * flips it). Narrow with `q` (words), `since` / `until` (ISO) and `usage`
32
+ * (`all`, `unused` — not used yet — or `used`); page with `cursor` / `limit`
33
+ * (1-100, default 50). Each record carries `usedAt` / `usedBy`, and its
34
+ * `source` the saving workflow's name and project when it is yours.
35
+ */
36
+ records(id, params = {}) {
37
+ return this.client.request("GET", `/v1/collections/${encodeURIComponent(id)}/records`, {
38
+ query: {
39
+ q: params.q,
40
+ since: params.since,
41
+ until: params.until,
42
+ usage: params.usage,
43
+ status: params.status,
44
+ order: params.order,
45
+ cursor: params.cursor,
46
+ offset: params.offset,
47
+ limit: params.limit
48
+ }
49
+ });
50
+ }
51
+ /** `POST /v1/collections/:id/records/:recordId/restore` → bring a record back from the Trash; the record. */
52
+ restoreRecord(id, recordId) {
53
+ return this.client.request("POST", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}/restore`);
54
+ }
55
+ /** `POST /v1/collections/:id/records/bulk` → move up to 100 records to the Trash, bring them back, or delete records already in the Trash for good, in one call. */
56
+ bulkRecords(id, input) {
57
+ return this.client.request("POST", `/v1/collections/${encodeURIComponent(id)}/records/bulk`, { body: input });
58
+ }
59
+ /**
60
+ * `PATCH /v1/collections/:id/records/:recordId` → mark a record used (or not
61
+ * used again). `source` says who is marking it (defaults to the API). A
62
+ * server before the usage release answers `503 not_available`.
63
+ */
64
+ setUsed(id, recordId, used, source) {
65
+ return this.client.request("PATCH", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}`, {
66
+ body: { used, ...source ? { source } : {} }
67
+ });
68
+ }
69
+ /**
70
+ * `POST /v1/collections/:id/records` → save one record. Give the fields, or
71
+ * `item` (any JSON — a feed post, a search result) and let the server map it;
72
+ * explicit fields win. `outcome` is `inserted`, `duplicate` (the same link or
73
+ * dedupe key is already there — the existing record comes back) or `replayed`
74
+ * (a write with the same `idempotencyKey` already happened).
75
+ */
76
+ addRecord(id, input, opts = {}) {
77
+ return this.client.request("POST", `/v1/collections/${encodeURIComponent(id)}/records`, {
78
+ body: input,
79
+ ...opts.idempotencyKey ? { headers: { "Idempotency-Key": opts.idempotencyKey } } : {}
80
+ });
81
+ }
82
+ /**
83
+ * `DELETE /v1/collections/:id/records/:recordId` → the record moves to the
84
+ * collection's Trash (`restoreRecord` brings it back; `deleteRecordForever`
85
+ * removes it for good).
86
+ */
87
+ async deleteRecord(id, recordId) {
88
+ await this.client.request("DELETE", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}`);
89
+ }
90
+ /** `DELETE /v1/collections/:id/records/:recordId/permanent` → a record already in the Trash is deleted for good (`409 not_in_trash` for a live one). */
91
+ async deleteRecordForever(id, recordId) {
92
+ await this.client.request("DELETE", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}/permanent`);
93
+ }
94
+ /** `GET /v1/collections/:id/export` → the whole collection as CSV (default) or JSON text, newest first; `since`, `until`, `usage` and `q` narrow it. */
95
+ export(id, params = {}) {
96
+ return this.client.requestText("GET", `/v1/collections/${encodeURIComponent(id)}/export`, {
97
+ query: { format: params.format, since: params.since, until: params.until, usage: params.usage, q: params.q }
98
+ });
99
+ }
100
+ };
101
+
102
+ exports.CollectionsResource = CollectionsResource;
103
+ //# sourceMappingURL=chunk-WK4VXPPZ.cjs.map
104
+ //# sourceMappingURL=chunk-WK4VXPPZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/resources/collections.ts"],"names":[],"mappings":";;;AA6BO,IAAM,sBAAN,MAA0B;AAAA,EAC/B,YAAoB,MAAA,EAA0B;AAA1B,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAA2B;AAAA,EAA3B,MAAA;AAAA;AAAA,EAGpB,IAAA,GAAuC;AACrC,IAAA,OAAO,IAAA,CAAK,MAAA,CAAO,OAAA,CAA+B,KAAA,EAAO,iBAAiB,CAAA;AAAA,EAC5E;AAAA;AAAA,EAGA,IAAI,EAAA,EAAiC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAO,OAAA,CAAoB,KAAA,EAAO,mBAAmB,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAE,CAAA;AAAA,EAC3F;AAAA;AAAA,EAGA,OAAO,KAAA,EAAmD;AACxD,IAAA,OAAO,IAAA,CAAK,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;AAC9D,IAAA,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA,CAA2B,QAAA,EAAU,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,EAAE,CAAC,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAE,CAAA;AAAA,EAC5I;AAAA;AAAA,EAGA,MAAM,mBAAA,CAAoB,EAAA,EAAY,QAAA,EAAiC;AACrE,IAAA,MAAM,IAAA,CAAK,MAAA,CAAO,OAAA,CAA2B,QAAA,EAAU,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,EAAE,CAAC,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,UAAA,CAAY,CAAA;AAAA,EACtJ;AAAA;AAAA,EAGA,MAAA,CAAO,EAAA,EAAY,MAAA,GAAmH,EAAC,EAAoB;AACzJ,IAAA,OAAO,IAAA,CAAK,OAAO,WAAA,CAAY,KAAA,EAAO,mBAAmB,kBAAA,CAAmB,EAAE,CAAC,CAAA,OAAA,CAAA,EAAW;AAAA,MACxF,OAAO,EAAE,MAAA,EAAQ,MAAA,CAAO,MAAA,EAAQ,OAAO,MAAA,CAAO,KAAA,EAAO,KAAA,EAAO,MAAA,CAAO,OAAO,KAAA,EAAO,MAAA,CAAO,KAAA,EAAO,CAAA,EAAG,OAAO,CAAA;AAAE,KAC5G,CAAA;AAAA,EACH;AACF","file":"chunk-WK4VXPPZ.cjs","sourcesContent":["import type { NodaroClientCore } from \"../core.js\"\nimport type {\n AddCollectionRecordInput,\n AddCollectionRecordResult,\n BulkCollectionRecordsInput,\n BulkCollectionRecordsResult,\n Collection,\n CollectionExportFormat,\n CollectionRecord,\n CollectionRecordSource,\n CollectionUsage,\n CreateCollectionInput,\n ListCollectionRecordsParams,\n ListCollectionRecordsResult,\n ListCollectionsResult,\n UpdateCollectionInput,\n} from \"@nodaro/shared/nodes\"\n\n/**\n * Collections — where a workflow's records live.\n *\n * A collection is a named set of records (a title, a text, a link, media\n * links, extra fields) that the Save to Collection node writes one record per\n * item into and the Read Collection node reads back; this resource browses,\n * searches, adds, removes and exports them from code. Text and links only,\n * never files. The same link saved twice is one record. Past the plan's cap the\n * oldest records are evicted after a write (the answer says how many).\n * OAuth app tokens need `assets:read` for reads and `assets:write` for writes.\n */\nexport class CollectionsResource {\n constructor(private client: NodaroClientCore) {}\n\n /** `GET /v1/collections` → your collections with their record counts, whether the server has collections at all, and your caps. */\n list(): Promise<ListCollectionsResult> {\n return this.client.request<ListCollectionsResult>(\"GET\", \"/v1/collections\")\n }\n\n /** `GET /v1/collections/:id` → one collection. */\n get(id: string): Promise<Collection> {\n return this.client.request<Collection>(\"GET\", `/v1/collections/${encodeURIComponent(id)}`)\n }\n\n /** `POST /v1/collections` → a new collection (`409 name_taken` when you have one by that name, `403 collection_limit_reached` at your cap). */\n create(input: CreateCollectionInput): Promise<Collection> {\n return this.client.request<Collection>(\"POST\", \"/v1/collections\", { body: input })\n }\n\n /** `PATCH /v1/collections/:id` → rename or re-describe a collection. */\n update(id: string, input: UpdateCollectionInput): Promise<Collection> {\n return this.client.request<Collection>(\"PATCH\", `/v1/collections/${encodeURIComponent(id)}`, { body: input })\n }\n\n /** `DELETE /v1/collections/:id` → remove a collection and every record in it. */\n async delete(id: string): Promise<void> {\n await this.client.request<{ success: true }>(\"DELETE\", `/v1/collections/${encodeURIComponent(id)}`)\n }\n\n /**\n * `GET /v1/collections/:id/records` → the records, newest first (`order: \"oldest\"`\n * flips it). Narrow with `q` (words), `since` / `until` (ISO) and `usage`\n * (`all`, `unused` — not used yet — or `used`); page with `cursor` / `limit`\n * (1-100, default 50). Each record carries `usedAt` / `usedBy`, and its\n * `source` the saving workflow's name and project when it is yours.\n */\n records(id: string, params: ListCollectionRecordsParams = {}): Promise<ListCollectionRecordsResult> {\n return this.client.request<ListCollectionRecordsResult>(\"GET\", `/v1/collections/${encodeURIComponent(id)}/records`, {\n query: {\n q: params.q,\n since: params.since,\n until: params.until,\n usage: params.usage,\n status: params.status,\n order: params.order,\n cursor: params.cursor,\n offset: params.offset,\n limit: params.limit,\n },\n })\n }\n\n /** `POST /v1/collections/:id/records/:recordId/restore` → bring a record back from the Trash; the record. */\n restoreRecord(id: string, recordId: string): Promise<CollectionRecord> {\n return this.client.request<CollectionRecord>(\"POST\", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}/restore`)\n }\n\n /** `POST /v1/collections/:id/records/bulk` → move up to 100 records to the Trash, bring them back, or delete records already in the Trash for good, in one call. */\n bulkRecords(id: string, input: BulkCollectionRecordsInput): Promise<BulkCollectionRecordsResult> {\n return this.client.request<BulkCollectionRecordsResult>(\"POST\", `/v1/collections/${encodeURIComponent(id)}/records/bulk`, { body: input })\n }\n\n /**\n * `PATCH /v1/collections/:id/records/:recordId` → mark a record used (or not\n * used again). `source` says who is marking it (defaults to the API). A\n * server before the usage release answers `503 not_available`.\n */\n setUsed(id: string, recordId: string, used: boolean, source?: CollectionRecordSource): Promise<CollectionRecord> {\n return this.client.request<CollectionRecord>(\"PATCH\", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}`, {\n body: { used, ...(source ? { source } : {}) },\n })\n }\n\n /**\n * `POST /v1/collections/:id/records` → save one record. Give the fields, or\n * `item` (any JSON — a feed post, a search result) and let the server map it;\n * explicit fields win. `outcome` is `inserted`, `duplicate` (the same link or\n * dedupe key is already there — the existing record comes back) or `replayed`\n * (a write with the same `idempotencyKey` already happened).\n */\n addRecord(id: string, input: AddCollectionRecordInput, opts: { idempotencyKey?: string } = {}): Promise<AddCollectionRecordResult> {\n return this.client.request<AddCollectionRecordResult>(\"POST\", `/v1/collections/${encodeURIComponent(id)}/records`, {\n body: input,\n ...(opts.idempotencyKey ? { headers: { \"Idempotency-Key\": opts.idempotencyKey } } : {}),\n })\n }\n\n /**\n * `DELETE /v1/collections/:id/records/:recordId` → the record moves to the\n * collection's Trash (`restoreRecord` brings it back; `deleteRecordForever`\n * removes it for good).\n */\n async deleteRecord(id: string, recordId: string): Promise<void> {\n await this.client.request<{ success: true }>(\"DELETE\", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}`)\n }\n\n /** `DELETE /v1/collections/:id/records/:recordId/permanent` → a record already in the Trash is deleted for good (`409 not_in_trash` for a live one). */\n async deleteRecordForever(id: string, recordId: string): Promise<void> {\n await this.client.request<{ success: true }>(\"DELETE\", `/v1/collections/${encodeURIComponent(id)}/records/${encodeURIComponent(recordId)}/permanent`)\n }\n\n /** `GET /v1/collections/:id/export` → the whole collection as CSV (default) or JSON text, newest first; `since`, `until`, `usage` and `q` narrow it. */\n export(id: string, params: { format?: CollectionExportFormat; since?: string; until?: string; usage?: CollectionUsage; q?: string } = {}): Promise<string> {\n return this.client.requestText(\"GET\", `/v1/collections/${encodeURIComponent(id)}/export`, {\n query: { format: params.format, since: params.since, until: params.until, usage: params.usage, q: params.q },\n })\n }\n}\n"]}
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ // src/webhook-signature.ts
4
+ var WebhookSignatureError = class extends Error {
5
+ code;
6
+ constructor(code, message) {
7
+ super(message);
8
+ this.name = "WebhookSignatureError";
9
+ this.code = code;
10
+ }
11
+ };
12
+ var DEFAULT_TOLERANCE_SECONDS = 300;
13
+ var HEX_SIGNATURE = /^[0-9a-f]{64}$/;
14
+ function toBytes(payload) {
15
+ if (typeof payload === "string") return new TextEncoder().encode(payload);
16
+ if (payload instanceof Uint8Array) return payload;
17
+ return new Uint8Array(payload);
18
+ }
19
+ function hexToBytes(hex) {
20
+ const out = new Uint8Array(hex.length / 2);
21
+ for (let i = 0; i < out.length; i++) out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
22
+ return out;
23
+ }
24
+ function constantTimeEqual(a, b) {
25
+ if (a.length !== b.length) return false;
26
+ let diff = 0;
27
+ for (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i];
28
+ return diff === 0;
29
+ }
30
+ function parseHeader(raw) {
31
+ let timestamp = null;
32
+ const signatures = [];
33
+ for (const part of raw.split(",")) {
34
+ const eq = part.indexOf("=");
35
+ if (eq <= 0) continue;
36
+ const key = part.slice(0, eq).trim();
37
+ const value = part.slice(eq + 1).trim();
38
+ if (key === "t") {
39
+ if (!/^\d{1,15}$/.test(value)) {
40
+ throw new WebhookSignatureError("malformed_header", "Nodaro-Signature has no valid timestamp (t=)");
41
+ }
42
+ timestamp = Number(value);
43
+ } else if (key === "v1") {
44
+ signatures.push(value.toLowerCase());
45
+ }
46
+ }
47
+ if (timestamp === null) throw new WebhookSignatureError("malformed_header", "Nodaro-Signature has no timestamp (t=)");
48
+ if (signatures.length === 0) throw new WebhookSignatureError("malformed_header", "Nodaro-Signature has no v1 signature");
49
+ return { timestamp, signatures };
50
+ }
51
+ async function verifyWebhookSignature(options) {
52
+ const { payload, secret } = options;
53
+ const tolerance = options.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;
54
+ if (typeof tolerance !== "number" || !Number.isFinite(tolerance) || tolerance < 0) {
55
+ throw new RangeError("toleranceSeconds must be a finite number of seconds, 0 or more");
56
+ }
57
+ if (!secret) throw new WebhookSignatureError("missing_secret", "No signing secret was given");
58
+ const header = typeof options.header === "string" ? options.header : options.header?.[0];
59
+ if (!header || !header.trim()) throw new WebhookSignatureError("missing_header", "The request has no Nodaro-Signature header");
60
+ const { timestamp, signatures } = parseHeader(header);
61
+ const subtle = globalThis.crypto?.subtle;
62
+ if (!subtle) throw new WebhookSignatureError("crypto_unavailable", "Web Crypto (crypto.subtle) is not available in this runtime");
63
+ const body = toBytes(payload);
64
+ const prefix = new TextEncoder().encode(`${timestamp}.`);
65
+ const message = new Uint8Array(prefix.length + body.length);
66
+ message.set(prefix, 0);
67
+ message.set(body, prefix.length);
68
+ const key = await subtle.importKey("raw", new TextEncoder().encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
69
+ const expected = new Uint8Array(await subtle.sign("HMAC", key, message));
70
+ let matched = false;
71
+ for (const candidate of signatures) {
72
+ const wellFormed = HEX_SIGNATURE.test(candidate);
73
+ const bytes = wellFormed ? hexToBytes(candidate) : new Uint8Array(expected.length);
74
+ if (constantTimeEqual(bytes, expected) && wellFormed) matched = true;
75
+ }
76
+ if (!matched) throw new WebhookSignatureError("signature_mismatch", "The Nodaro-Signature does not match the body");
77
+ if (tolerance > 0) {
78
+ const now = Math.floor(Date.now() / 1e3);
79
+ if (Math.abs(now - timestamp) > tolerance) {
80
+ throw new WebhookSignatureError(
81
+ "timestamp_outside_tolerance",
82
+ `The signature's timestamp is more than ${tolerance} seconds from now`
83
+ );
84
+ }
85
+ }
86
+ try {
87
+ return JSON.parse(new TextDecoder().decode(body));
88
+ } catch {
89
+ throw new WebhookSignatureError("invalid_payload", "The signed body is not JSON");
90
+ }
91
+ }
92
+
93
+ exports.WebhookSignatureError = WebhookSignatureError;
94
+ exports.verifyWebhookSignature = verifyWebhookSignature;
95
+ //# sourceMappingURL=chunk-WSA4LMWR.cjs.map
96
+ //# sourceMappingURL=chunk-WSA4LMWR.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/webhook-signature.ts"],"names":[],"mappings":";;;AA0BO,IAAM,qBAAA,GAAN,cAAoC,KAAA,CAAM;AAAA,EACtC,IAAA;AAAA,EAET,WAAA,CAAY,MAAiC,OAAA,EAAiB;AAC5D,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,uBAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AAAA,EACd;AACF;AAkBA,IAAM,yBAAA,GAA4B,GAAA;AAClC,IAAM,aAAA,GAAgB,gBAAA;AAEtB,SAAS,QAAQ,OAAA,EAAwD;AACvE,EAAA,IAAI,OAAO,YAAY,QAAA,EAAU,OAAO,IAAI,WAAA,EAAY,CAAE,OAAO,OAAO,CAAA;AACxE,EAAA,IAAI,OAAA,YAAmB,YAAY,OAAO,OAAA;AAC1C,EAAA,OAAO,IAAI,WAAW,OAAO,CAAA;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,EAAS,MAAM,IAAI,qBAAA,CAAsB,sBAAsB,8CAA8C,CAAA;AAElH,EAAA,IAAI,YAAY,CAAA,EAAG;AACjB,IAAA,MAAM,MAAM,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,GAAA,KAAQ,GAAI,CAAA;AACxC,IAAA,IAAI,IAAA,CAAK,GAAA,CAAI,GAAA,GAAM,SAAS,IAAI,SAAA,EAAW;AACzC,MAAA,MAAM,IAAI,qBAAA;AAAA,QACR,6BAAA;AAAA,QACA,0CAA0C,SAAS,CAAA,iBAAA;AAAA,OACrD;AAAA,IACF;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,OAAO,KAAK,KAAA,CAAM,IAAI,aAAY,CAAE,MAAA,CAAO,IAAI,CAAC,CAAA;AAAA,EAClD,CAAA,CAAA,MAAQ;AACN,IAAA,MAAM,IAAI,qBAAA,CAAsB,iBAAA,EAAmB,6BAA6B,CAAA;AAAA,EAClF;AACF","file":"chunk-WSA4LMWR.cjs","sourcesContent":["/**\n * Verifying a Nodaro webhook on the receiving side.\n *\n * Every delivery carries\n *\n * Nodaro-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<raw body>\")>\n *\n * where `secret` is the endpoint's whole signing secret (`whsec_…`, as\n * `client.webhooks.create()` / `rotateSecret()` returned it) used as the\n * UTF-8 key, and the message is the timestamp, a dot, and the exact body\n * bytes received. Pure Web Crypto (`crypto.subtle`): runs in Node 20+, Deno,\n * Bun, Cloudflare Workers, Vercel Edge and browsers. The comparison is\n * constant-time.\n */\nimport type { WebhookEvent } from \"./resources/webhooks.js\"\n\nexport type WebhookSignatureErrorCode =\n | \"missing_secret\"\n | \"missing_header\"\n | \"malformed_header\"\n | \"signature_mismatch\"\n | \"timestamp_outside_tolerance\"\n | \"invalid_payload\"\n | \"crypto_unavailable\"\n\n/** Thrown by {@link verifyWebhookSignature}: refuse the request (a 400 is fine). */\nexport class WebhookSignatureError extends Error {\n readonly code: WebhookSignatureErrorCode\n\n constructor(code: WebhookSignatureErrorCode, message: string) {\n super(message)\n this.name = \"WebhookSignatureError\"\n this.code = code\n }\n}\n\nexport interface VerifyWebhookSignatureOptions {\n /** The raw request body, exactly as received — not re-serialized JSON. */\n payload: string | Uint8Array | ArrayBuffer\n /** The `Nodaro-Signature` header (the first value, if it came more than once). */\n header: string | readonly string[] | null | undefined\n /** The endpoint's signing secret (`whsec_…`). */\n secret: string\n /**\n * Refuse a signature older or newer than this many seconds (replay\n * protection). Default 300. `0` turns the check off — not recommended.\n * Anything that is not a finite number ≥ 0 throws a `RangeError` rather\n * than quietly turning the check off.\n */\n toleranceSeconds?: number\n}\n\nconst DEFAULT_TOLERANCE_SECONDS = 300\nconst HEX_SIGNATURE = /^[0-9a-f]{64}$/\n\nfunction toBytes(payload: string | Uint8Array | ArrayBuffer): Uint8Array {\n if (typeof payload === \"string\") return new TextEncoder().encode(payload)\n if (payload instanceof Uint8Array) return payload\n return new Uint8Array(payload)\n}\n\nfunction hexToBytes(hex: string): Uint8Array {\n const out = new Uint8Array(hex.length / 2)\n for (let i = 0; i < out.length; i++) out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16)\n return out\n}\n\n/** Compares every byte whatever it finds, so the time taken says nothing. */\nfunction constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false\n let diff = 0\n for (let i = 0; i < a.length; i++) diff |= a[i]! ^ b[i]!\n return diff === 0\n}\n\nfunction parseHeader(raw: string): { timestamp: number; signatures: string[] } {\n let timestamp: number | null = null\n const signatures: string[] = []\n for (const part of raw.split(\",\")) {\n const eq = part.indexOf(\"=\")\n if (eq <= 0) continue\n const key = part.slice(0, eq).trim()\n const value = part.slice(eq + 1).trim()\n if (key === \"t\") {\n if (!/^\\d{1,15}$/.test(value)) {\n throw new WebhookSignatureError(\"malformed_header\", \"Nodaro-Signature has no valid timestamp (t=)\")\n }\n timestamp = Number(value)\n } else if (key === \"v1\") {\n signatures.push(value.toLowerCase())\n }\n }\n if (timestamp === null) throw new WebhookSignatureError(\"malformed_header\", \"Nodaro-Signature has no timestamp (t=)\")\n if (signatures.length === 0) throw new WebhookSignatureError(\"malformed_header\", \"Nodaro-Signature has no v1 signature\")\n return { timestamp, signatures }\n}\n\n/**\n * Check a webhook request's `Nodaro-Signature` and return its event.\n * Throws {@link WebhookSignatureError} (with a `code`) when it does not check out.\n *\n * Act on the event this returns — its `id` (to de-duplicate) and `type` (to\n * route) — never on the `Nodaro-Delivery` / `Nodaro-Event` headers: only the\n * timestamp and the body are signed. During a secret rotation's grace the\n * header carries a `v1=` for each secret; either matching is enough.\n *\n * ```ts\n * const event = await verifyWebhookSignature({\n * payload: rawBody,\n * header: request.headers.get(\"nodaro-signature\"),\n * secret: process.env.NODARO_WEBHOOK_SECRET!,\n * })\n * if (event.type === \"job.completed\") console.info(event.data.job.output_data)\n * ```\n */\nexport async function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): Promise<WebhookEvent> {\n const { payload, secret } = options\n const tolerance = options.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS\n if (typeof tolerance !== \"number\" || !Number.isFinite(tolerance) || tolerance < 0) {\n // A programming error, not a request to refuse: say so instead of\n // quietly accepting replays (NaN or a negative would skip the check).\n throw new RangeError(\"toleranceSeconds must be a finite number of seconds, 0 or more\")\n }\n if (!secret) throw new WebhookSignatureError(\"missing_secret\", \"No signing secret was given\")\n\n const header = typeof options.header === \"string\" ? options.header : options.header?.[0]\n if (!header || !header.trim()) throw new WebhookSignatureError(\"missing_header\", \"The request has no Nodaro-Signature header\")\n const { timestamp, signatures } = parseHeader(header)\n\n const subtle = globalThis.crypto?.subtle\n if (!subtle) throw new WebhookSignatureError(\"crypto_unavailable\", \"Web Crypto (crypto.subtle) is not available in this runtime\")\n\n const body = toBytes(payload)\n const prefix = new TextEncoder().encode(`${timestamp}.`)\n const message = new Uint8Array(prefix.length + body.length)\n message.set(prefix, 0)\n message.set(body, prefix.length)\n\n const key = await subtle.importKey(\"raw\", new TextEncoder().encode(secret), { name: \"HMAC\", hash: \"SHA-256\" }, false, [\"sign\"])\n const expected = new Uint8Array(await subtle.sign(\"HMAC\", key, message))\n\n let matched = false\n for (const candidate of signatures) {\n // A candidate that is not 64 hex characters cannot match; it is still\n // compared (as a zero buffer) so every candidate costs the same.\n const wellFormed = HEX_SIGNATURE.test(candidate)\n const bytes = wellFormed ? hexToBytes(candidate) : new Uint8Array(expected.length)\n if (constantTimeEqual(bytes, expected) && wellFormed) matched = true\n }\n if (!matched) throw new WebhookSignatureError(\"signature_mismatch\", \"The Nodaro-Signature does not match the body\")\n\n if (tolerance > 0) {\n const now = Math.floor(Date.now() / 1000)\n if (Math.abs(now - timestamp) > tolerance) {\n throw new WebhookSignatureError(\n \"timestamp_outside_tolerance\",\n `The signature's timestamp is more than ${tolerance} seconds from now`,\n )\n }\n }\n\n try {\n return JSON.parse(new TextDecoder().decode(body)) as WebhookEvent\n } catch {\n throw new WebhookSignatureError(\"invalid_payload\", \"The signed body is not JSON\")\n }\n}\n"]}
@@ -0,0 +1,360 @@
1
+ 'use strict';
2
+
3
+ var chunkN6GLZOE4_cjs = require('./chunk-N6GLZOE4.cjs');
4
+ var edl = require('@nodaro/shared/edl');
5
+ var nodes = require('@nodaro/shared/nodes');
6
+
7
+ // src/resources/edit-use-case-inputs.ts
8
+ var TRAILER_FORMATS = ["9:16", "1:1", "4:5", "16:9"];
9
+ var CLIP_PACK_MIN_TARGET_SEC = 5;
10
+ var CLIP_PACK_MAX_TARGET_SEC = 180;
11
+ function tightenBody(input) {
12
+ const { mediaUrl, ...rest } = input;
13
+ return { mediaUrls: [mediaUrl], ...Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0)) };
14
+ }
15
+ function chaptersBody(input) {
16
+ return {
17
+ mediaUrls: [input.mediaUrl],
18
+ ...input.planTier !== void 0 ? { planTier: input.planTier } : {},
19
+ ...input.instructions !== void 0 ? { instructions: input.instructions } : {},
20
+ ...input.styleGuide !== void 0 ? { styleGuide: input.styleGuide } : {}
21
+ };
22
+ }
23
+ function trailerBody(input) {
24
+ return {
25
+ mediaUrls: [input.mediaUrl],
26
+ ...input.introCardUrl !== void 0 ? { introCardUrl: input.introCardUrl } : {},
27
+ // An empty list is sent as is: the route refuses it (at least one format).
28
+ ...input.formats !== void 0 ? { formats: input.formats } : {},
29
+ ...input.reviewBeforeRender !== void 0 ? { reviewBeforeRender: input.reviewBeforeRender } : {},
30
+ ...input.planTier !== void 0 ? { planTier: input.planTier } : {},
31
+ ...input.instructions !== void 0 ? { instructions: input.instructions } : {},
32
+ ...input.styleGuide !== void 0 ? { styleGuide: input.styleGuide } : {}
33
+ };
34
+ }
35
+ function clipPackBody(input) {
36
+ const { mediaUrl, ...rest } = input;
37
+ return { mediaUrls: [mediaUrl], ...Object.fromEntries(Object.entries(rest).filter(([, v]) => v !== void 0)) };
38
+ }
39
+ var continuePathOf = (type) => `/v1/${type}/continue`;
40
+ function idempotencyHeaders(options) {
41
+ return options?.idempotencyKey ? { headers: { "Idempotency-Key": options.idempotencyKey } } : {};
42
+ }
43
+ var EditResource = class {
44
+ constructor(client) {
45
+ this.client = client;
46
+ }
47
+ client;
48
+ /**
49
+ * Detect silence ranges in an audio/video source (`POST /v1/silence-detect`).
50
+ * Keyless — one ffmpeg pass over the source's audio proxy.
51
+ */
52
+ silenceDetect(input) {
53
+ return this.client.request("POST", "/v1/silence-detect", {
54
+ body: {
55
+ audioUrl: input.audioUrl,
56
+ ...input.thresholdDb !== void 0 ? { thresholdDb: input.thresholdDb } : {},
57
+ ...input.minSilenceMs !== void 0 ? { minSilenceMs: input.minSilenceMs } : {},
58
+ ...input.padMs !== void 0 ? { padMs: input.padMs } : {},
59
+ ...input.workflowId !== void 0 ? { workflowId: input.workflowId } : {}
60
+ }
61
+ });
62
+ }
63
+ /**
64
+ * Measure how far apart the clocks of 2–6 recordings of one conversation are
65
+ * (`POST /v1/audio-sync`), by cross-correlating their audio — keyless, one
66
+ * ffmpeg decode per source. The finished job's `output_data.json` is an
67
+ * {@link AudioSyncResult}. A malformed request (fewer than 2 or more than 6
68
+ * sources, a repeated id, a `reference` that is not one of the ids) throws a
69
+ * typed `NodaroError` (400, `code: "validation_error"`) before any credits
70
+ * are reserved.
71
+ */
72
+ audioSync(input) {
73
+ return this.client.request("POST", "/v1/audio-sync", {
74
+ body: {
75
+ sources: input.sources.map((s) => ({ id: s.id, url: s.url })),
76
+ ...input.reference !== void 0 ? { reference: input.reference } : {},
77
+ ...input.workflowId !== void 0 ? { workflowId: input.workflowId } : {}
78
+ }
79
+ });
80
+ }
81
+ /**
82
+ * Which camera each speaker is on, from the cameras' own microphones (`POST
83
+ * /v1/speaker-map`), keyless. `output_data.json` is a `SpeakerMapResult`: pass
84
+ * it to {@link cameraSwitch} as `speakerMapResult`. A malformed request throws
85
+ * a `NodaroError` (400 `validation_error`; 422 `no_speakers` for a transcript
86
+ * with no speaker labels) before any credits are reserved.
87
+ */
88
+ speakerMap(input) {
89
+ return this.client.request("POST", "/v1/speaker-map", {
90
+ body: {
91
+ sources: input.sources.map((s) => ({ id: s.id, url: s.url, ...s.kind ? { kind: s.kind } : {} })),
92
+ transcript: input.transcript,
93
+ ...input.offsets !== void 0 ? { offsets: input.offsets } : {},
94
+ ...input.masterSourceId !== void 0 ? { masterSourceId: input.masterSourceId } : {},
95
+ ...input.wideSourceId !== void 0 ? { wideSourceId: input.wideSourceId } : {},
96
+ ...input.marginDb !== void 0 ? { marginDb: input.marginDb } : {},
97
+ ...input.workflowId !== void 0 ? { workflowId: input.workflowId } : {}
98
+ }
99
+ });
100
+ }
101
+ /**
102
+ * Render an edit decision list into a video or audio cut (`POST /v1/apply-edl`).
103
+ * The EDL is validated at ingress — an unresolvable source or a picture-less
104
+ * segment on a video edit throws a typed `NodaroError` (400, `code:
105
+ * "invalid_edl"`) before any credits are reserved.
106
+ */
107
+ applyEdl(input) {
108
+ return this.client.request("POST", "/v1/apply-edl", {
109
+ body: {
110
+ edl: input.edl,
111
+ ...input.sources !== void 0 ? { sources: input.sources } : {},
112
+ ...input.transcript !== void 0 ? { transcript: input.transcript } : {},
113
+ ...input.output !== void 0 ? { output: input.output } : {},
114
+ ...input.quality !== void 0 ? { quality: input.quality } : {},
115
+ ...input.crossfadeMs !== void 0 ? { crossfadeMs: input.crossfadeMs } : {},
116
+ ...input.clipKey !== void 0 ? { clipKey: input.clipKey } : {},
117
+ ...input.planBasis !== void 0 ? { planBasis: input.planBasis } : {},
118
+ ...input.workflowId !== void 0 ? { workflowId: input.workflowId } : {}
119
+ }
120
+ });
121
+ }
122
+ /**
123
+ * Tighten Episode (`POST /v1/tighten-episode`): tighten a podcast recording
124
+ * in one call — transcribe, cut the silences and filler, render, with
125
+ * optional captions, music and framing. Answers the run's job to poll; its
126
+ * `output_data` holds the episode. The run is priced as its steps at their own
127
+ * rates plus the listed per-run fee. Quote it first with
128
+ * {@link estimateTightenEpisode}.
129
+ */
130
+ tightenEpisode(input, options) {
131
+ return this.client.request("POST", "/v1/tighten-episode", { body: tightenBody(input), ...idempotencyHeaders(options) });
132
+ }
133
+ /**
134
+ * What a Tighten Episode run is estimated at (`POST /v1/tighten-episode/estimate`):
135
+ * its steps at their own rates plus its per-run fee. Nothing is created or
136
+ * charged. The estimate leans high: the render is priced at the recording's
137
+ * full length, while the charge follows the minutes actually rendered.
138
+ */
139
+ estimateTightenEpisode(input) {
140
+ return this.client.request("POST", "/v1/tighten-episode/estimate", { body: tightenBody(input) });
141
+ }
142
+ /**
143
+ * Chapters (`POST /v1/episode-chapters`): transcribe a recording and list its
144
+ * chapters in one call. Answers the run's job to poll; the finished job's
145
+ * `output_data.text` is the list as show notes (one `0:00 Title` line per
146
+ * chapter; once a chapter starts at 1:00:00 or later, every line is
147
+ * `H:MM:SS`), `output_data.json` the list itself (`{ startMs, title }[]`, the
148
+ * same rows; the first starts at 0). A run that finds no chapters fails,
149
+ * and its fee is refunded. Priced as its steps at their own rates plus the
150
+ * listed per-run fee; quote it first with {@link estimateEpisodeChapters}.
151
+ */
152
+ episodeChapters(input, options) {
153
+ return this.client.request("POST", "/v1/episode-chapters", { body: chaptersBody(input), ...idempotencyHeaders(options) });
154
+ }
155
+ /**
156
+ * What a Chapters run is estimated at (`POST /v1/episode-chapters/estimate`):
157
+ * its steps at their own rates plus its per-run fee. Nothing is created or
158
+ * charged. A recording whose length cannot be read is estimated at the
159
+ * 180-minute ceiling.
160
+ */
161
+ estimateEpisodeChapters(input) {
162
+ return this.client.request("POST", "/v1/episode-chapters/estimate", { body: chaptersBody(input) });
163
+ }
164
+ /**
165
+ * Trailer (`POST /v1/episode-trailer`): cut a 20–40 s trailer of a recording
166
+ * and deliver it in each chosen format (padded, never cropped), optionally
167
+ * after an intro card, in one call. The finished job's `output_data.formats`
168
+ * is `{ format, url }[]` in format order, the first also `output_data.videoUrl`;
169
+ * a format that failed is named in `output_data.failedFormats` (the run keeps
170
+ * the others). With `reviewBeforeRender` the run stops at a preview
171
+ * (`videoUrl`, no formats yet). Priced as its steps at their own rates plus
172
+ * the listed per-run fee; quote it first with {@link estimateEpisodeTrailer}.
173
+ */
174
+ episodeTrailer(input, options) {
175
+ return this.client.request("POST", "/v1/episode-trailer", { body: trailerBody(input), ...idempotencyHeaders(options) });
176
+ }
177
+ /**
178
+ * What a Trailer run is estimated at (`POST /v1/episode-trailer/estimate`):
179
+ * its steps at their own rates plus its per-run fee. Nothing is created or
180
+ * charged. The trailer is quoted at 40 seconds, the longest trailer the
181
+ * plan cuts; a Render final is quoted on the trailer the run cut (with the
182
+ * review's edits), plus the intro card.
183
+ */
184
+ estimateEpisodeTrailer(input) {
185
+ return this.client.request("POST", "/v1/episode-trailer/estimate", { body: trailerBody(input) });
186
+ }
187
+ /**
188
+ * Clip Pack (`POST /v1/clip-pack`): cut a recording into a pack of short
189
+ * clips in one call — the plan finds the best moments (`count`, default 8,
190
+ * of about `targetDurationSec`, default 60), each is rendered (framed 9:16
191
+ * with the speakers stacked by default; `framing: null` keeps the
192
+ * recording's shape) and captioned. An audio recording makes audio clips.
193
+ * The finished job's `output_data.clips` is `{ url, title?, hook?, clipKey,
194
+ * thumbnailUrl?, captionsFailed? }[]` in plan order, the first also
195
+ * `output_data.videoUrl` (`audioUrl` for audio clips). Every clip is tried:
196
+ * one that cannot be rendered is skipped, not charged and counted on
197
+ * `failedClips` (the pack keeps the others and its fee); a clip whose
198
+ * captions failed comes uncaptioned (`captionsFailed`, counted on
199
+ * `failedCaptions`). When no clip renders the run fails and its fee is
200
+ * refunded. With `reviewBeforeRender` the run stops at previews; Render
201
+ * final ({@link continueUseCase}) renders only the clips the edit keeps.
202
+ * Priced as its steps at their own rates plus the listed per-run fee;
203
+ * quote it first with {@link estimateClipPack}.
204
+ */
205
+ clipPack(input, options) {
206
+ return this.client.request("POST", "/v1/clip-pack", { body: clipPackBody(input), ...idempotencyHeaders(options) });
207
+ }
208
+ /**
209
+ * What a Clip Pack run is estimated at (`POST /v1/clip-pack/estimate`): its
210
+ * steps at their own rates plus its per-run fee. Nothing is created or
211
+ * charged. Each clip is quoted at twice the target length (the plan may cut
212
+ * a clip longer than asked); the charge follows each clip's real length.
213
+ */
214
+ estimateClipPack(input) {
215
+ return this.client.request("POST", "/v1/clip-pack/estimate", { body: clipPackBody(input) });
216
+ }
217
+ /**
218
+ * Continue a use-case run as a new job (`POST /v1/<type>/continue`, the
219
+ * run's own type: `input.nodeType`, else the type the job records, read with
220
+ * `GET /v1/jobs/:id`; when that read cannot tell, this rejects with a
221
+ * `NodaroError` coded `use_case_type_unknown` — pass `nodeType` then):
222
+ * `"from-failed"` keeps the steps that finished and runs the rest (the fee
223
+ * is held again; the failed run's was refunded);
224
+ * `"render-final"` renders the full-quality result after a review-on preview,
225
+ * with the preview's settings and no fee. A refusal that names another job
226
+ * (`already_running`, `continuation_superseded`,
227
+ * `render_final_already_rendered`) throws a `ContinuationRefusedError`
228
+ * carrying that `jobId`.
229
+ */
230
+ async continueUseCase(input, options) {
231
+ if (input.nodeType !== void 0 && !nodes.isUseCaseNodeType(input.nodeType)) {
232
+ throw new chunkN6GLZOE4_cjs.NodaroError(
233
+ `continueUseCase: nodeType "${String(input.nodeType)}" is not a use-case node type (${nodes.USE_CASE_NODE_TYPES.join(", ")})`,
234
+ "invalid_node_type",
235
+ 400
236
+ );
237
+ }
238
+ const type = input.nodeType ?? await this.runTypeOf(input.jobId);
239
+ return this.client.request("POST", continuePathOf(type), {
240
+ body: { jobId: input.jobId, mode: input.mode, ...input.editedEdl !== void 0 ? { editedEdl: input.editedEdl } : {} },
241
+ ...idempotencyHeaders(options)
242
+ });
243
+ }
244
+ /**
245
+ * The use-case type a run records (`input_data.type`, else its `job_type`).
246
+ * When the key lacks the `jobs:read` scope (403 naming that scope) or the job
247
+ * names no use-case type, the type cannot be read: this rejects with a
248
+ * `NodaroError` (`use_case_type_unknown`, 400) asking for `nodeType`, and
249
+ * nothing is posted (decided 2026-10-18: no route is guessed for the run).
250
+ * Any other failure of the read, any other 403 included, is thrown as is.
251
+ */
252
+ async runTypeOf(jobId) {
253
+ const unknown = () => new chunkN6GLZOE4_cjs.NodaroError("continueUseCase: the run's node type cannot be read \u2014 pass nodeType", "use_case_type_unknown", 400);
254
+ let row;
255
+ try {
256
+ row = (await this.client.request("GET", `/v1/jobs/${encodeURIComponent(jobId)}`)).data;
257
+ } catch (err) {
258
+ if (err instanceof chunkN6GLZOE4_cjs.ForbiddenError && err.missingScope === "jobs:read") throw unknown();
259
+ throw err;
260
+ }
261
+ const input = row?.input_data;
262
+ const recorded = input && typeof input === "object" && !Array.isArray(input) ? input.type : void 0;
263
+ const type = typeof recorded === "string" && recorded.length > 0 ? recorded : row?.job_type;
264
+ if (!nodes.isUseCaseNodeType(type)) throw unknown();
265
+ return type;
266
+ }
267
+ /**
268
+ * Plan a transcript-driven cut (`POST /v1/edit-plan`). Reads a timed
269
+ * transcript (plus optional silence ranges) and the media sources, and plans
270
+ * the edit. The finished job's `output_data` holds the plan: an `Edl`
271
+ * (`"tighten"` or `"trailer"`), an {@link EdlClipSet} (`"clips"`), or a
272
+ * {@link ChapterSet} (`"chapters"`) — normalize it with {@link unwrapEditPlanOutput}.
273
+ *
274
+ * On a self-hosted install the request relays to nodaro.ai and needs the
275
+ * install connected (a 503 `code: "nodaro_connection_required"` otherwise);
276
+ * on nodaro.ai it runs directly.
277
+ */
278
+ editPlan(input) {
279
+ const planned = edl.resolveEditPlanSources(input.sources, {
280
+ offsets: input.offsets,
281
+ transcriptSourceId: input.transcriptSourceId
282
+ });
283
+ if (!planned.ok) {
284
+ const message = planned.issues.map((issue) => edl.describeAudioSyncOffsetIssue(issue)).join("; ");
285
+ return Promise.reject(new chunkN6GLZOE4_cjs.NodaroError(`editPlan: ${message}`, "edit_plan_sources", 400));
286
+ }
287
+ const transcript = planned.transcriptSourceId ? { ...input.transcript, sourceId: planned.transcriptSourceId } : input.transcript;
288
+ return this.client.request("POST", "/v1/edit-plan", {
289
+ body: {
290
+ mode: input.mode,
291
+ planTier: input.planTier,
292
+ transcript,
293
+ sources: planned.sources,
294
+ ...input.silence !== void 0 ? { silence: input.silence } : {},
295
+ ...input.instructions !== void 0 ? { instructions: input.instructions } : {},
296
+ ...input.styleGuide !== void 0 ? { styleGuide: input.styleGuide } : {},
297
+ ...input.count !== void 0 ? { count: input.count } : {},
298
+ ...input.targetDurationSec !== void 0 ? { targetDurationSec: input.targetDurationSec } : {},
299
+ ...input.targetAspect !== void 0 ? { targetAspect: input.targetAspect } : {},
300
+ ...input.platform !== void 0 ? { platform: input.platform } : {},
301
+ ...input.workflowId !== void 0 ? { workflowId: input.workflowId } : {}
302
+ }
303
+ });
304
+ }
305
+ /**
306
+ * Camera Switch (podcast B5): choose which camera shows each cut of `edl`
307
+ * by who is speaking — the sound never changes. Cloud edition; a flat
308
+ * price. The finished job's `output_data.json` is the switched EDL (feed it
309
+ * to {@link applyEdl}) and `output_data.transcript` the transcript with
310
+ * `speakerNames` applied. A transcript with no speaker labels rejects with
311
+ * a {@link NodaroError} (`code: "no_speakers"`) before any request or charge.
312
+ */
313
+ cameraSwitch(input) {
314
+ if (edl.transcriptSpeakerLabels(input.transcript).length === 0) {
315
+ return Promise.reject(new chunkN6GLZOE4_cjs.NodaroError(
316
+ "cameraSwitch: the transcript has no speaker labels \u2014 transcribe with speaker detection on",
317
+ "no_speakers",
318
+ 422
319
+ ));
320
+ }
321
+ const result = input.speakerMapResult;
322
+ if (result !== void 0 && !edl.speakerMapResultOf(result)) return Promise.reject(new chunkN6GLZOE4_cjs.NodaroError("cameraSwitch: speakerMapResult is not a Speaker Map result \u2014 pass that job's output_data.json", "not_a_speaker_map", 400));
323
+ const speakerMap = result !== void 0 ? edl.cameraSwitchSpeakerMap({ speakerMap: input.speakerMap }, input.edl, input.transcript, { speakerMap: result }) : input.speakerMap;
324
+ return this.client.request("POST", "/v1/camera-switch", {
325
+ body: {
326
+ edl: input.edl,
327
+ transcript: input.transcript,
328
+ ...speakerMap !== void 0 ? { speakerMap } : {},
329
+ ...input.speakerNames !== void 0 ? { speakerNames: input.speakerNames } : {},
330
+ ...input.minShotMs !== void 0 ? { minShotMs: input.minShotMs } : {},
331
+ ...input.leadMs !== void 0 ? { leadMs: input.leadMs } : {},
332
+ ...input.maxShotMs !== void 0 ? { maxShotMs: input.maxShotMs } : {},
333
+ ...input.wideEvery !== void 0 ? { wideEvery: input.wideEvery } : {},
334
+ ...input.layoutHints !== void 0 ? { layoutHints: input.layoutHints } : {},
335
+ ...input.workflowId !== void 0 ? { workflowId: input.workflowId } : {}
336
+ }
337
+ });
338
+ }
339
+ /**
340
+ * Remap a transcript through an EDL — a PURE client-side transform (NO
341
+ * request). Returns a new transcript whose word (and segment) timings are on
342
+ * the EDL's rendered output clock, dropping words that fall in cut regions and
343
+ * clipping straddlers. Runs `@nodaro/shared`'s canonical
344
+ * `remapTranscriptThroughEdl`, the same remap `applyEdl` performs server-side.
345
+ */
346
+ remapTranscript(edl$1, transcript) {
347
+ return edl.remapTranscriptThroughEdl(edl$1, transcript);
348
+ }
349
+ };
350
+
351
+ Object.defineProperty(exports, "USE_CASE_NODE_TYPES", {
352
+ enumerable: true,
353
+ get: function () { return nodes.USE_CASE_NODE_TYPES; }
354
+ });
355
+ exports.CLIP_PACK_MAX_TARGET_SEC = CLIP_PACK_MAX_TARGET_SEC;
356
+ exports.CLIP_PACK_MIN_TARGET_SEC = CLIP_PACK_MIN_TARGET_SEC;
357
+ exports.EditResource = EditResource;
358
+ exports.TRAILER_FORMATS = TRAILER_FORMATS;
359
+ //# sourceMappingURL=chunk-WUIEZ6Z4.cjs.map
360
+ //# sourceMappingURL=chunk-WUIEZ6Z4.cjs.map