@design-edito/tools 0.1.51 → 0.1.53

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 (322) hide show
  1. package/agnostic/arrays/find-duplicates/index.js +1 -0
  2. package/agnostic/arrays/index.js +10 -9
  3. package/agnostic/arrays/is-array-of/index.js +1 -0
  4. package/agnostic/arrays/make/index.js +1 -0
  5. package/agnostic/arrays/random-pick/index.js +7 -6
  6. package/agnostic/arrays/shuffle/index.js +1 -0
  7. package/agnostic/booleans/index.js +1 -0
  8. package/agnostic/booleans/is-falsy/index.js +1 -0
  9. package/agnostic/css/bem/index.js +1 -0
  10. package/agnostic/css/generate-nice-color/index.js +1 -0
  11. package/agnostic/css/index.js +18 -17
  12. package/agnostic/css/is-valid-css-class-name/index.js +1 -0
  13. package/agnostic/css/styles-set/index.js +7 -6
  14. package/agnostic/errors/index.js +3 -2
  15. package/agnostic/errors/register/index.js +1 -0
  16. package/agnostic/errors/unknown-to-string/index.js +1 -0
  17. package/agnostic/html/get-node-ancestors/index.js +1 -0
  18. package/agnostic/html/get-position-inside-parent/index.js +1 -0
  19. package/agnostic/html/hyper-json/cast/index.js +3 -2
  20. package/agnostic/html/hyper-json/index.js +4 -3
  21. package/agnostic/html/hyper-json/method/index.js +1 -0
  22. package/agnostic/html/hyper-json/serialize/index.js +1 -0
  23. package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +3 -2
  24. package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +3 -2
  25. package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +3 -2
  26. package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +3 -2
  27. package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +3 -2
  28. package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +3 -2
  29. package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +3 -2
  30. package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +3 -2
  31. package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +3 -2
  32. package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +3 -2
  33. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +3 -2
  34. package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +3 -2
  35. package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +3 -2
  36. package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +3 -2
  37. package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +3 -2
  38. package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +3 -2
  39. package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +3 -2
  40. package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +3 -2
  41. package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +3 -2
  42. package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +3 -2
  43. package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +3 -2
  44. package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +3 -2
  45. package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +3 -2
  46. package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +3 -2
  47. package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +3 -2
  48. package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +3 -2
  49. package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +3 -2
  50. package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +3 -2
  51. package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +3 -2
  52. package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +3 -2
  53. package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +3 -2
  54. package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +3 -2
  55. package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +3 -2
  56. package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +3 -2
  57. package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +3 -2
  58. package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +3 -2
  59. package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +3 -2
  60. package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +3 -2
  61. package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +3 -2
  62. package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +3 -2
  63. package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +3 -2
  64. package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +3 -2
  65. package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +3 -2
  66. package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +3 -2
  67. package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +3 -2
  68. package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +3 -2
  69. package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +3 -2
  70. package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +3 -2
  71. package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +3 -2
  72. package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +3 -2
  73. package/agnostic/html/hyper-json/smart-tags/index.js +1 -0
  74. package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +1 -0
  75. package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +1 -0
  76. package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +3 -2
  77. package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +3 -2
  78. package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +3 -2
  79. package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +3 -2
  80. package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +3 -2
  81. package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +3 -2
  82. package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +1 -0
  83. package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +3 -2
  84. package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +3 -2
  85. package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +3 -2
  86. package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +3 -2
  87. package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -2
  88. package/agnostic/html/hyper-json/transformer/index.js +1 -0
  89. package/agnostic/html/hyper-json/tree/index.js +3 -2
  90. package/agnostic/html/hyper-json/types/index.js +1 -0
  91. package/agnostic/html/hyper-json/utils/index.js +3 -2
  92. package/agnostic/html/index.js +12 -11
  93. package/agnostic/html/insert-node/index.js +1 -0
  94. package/agnostic/html/placeholders/index.js +1 -0
  95. package/agnostic/html/replace-in-element/index.js +1 -0
  96. package/agnostic/html/sanitize/index.js +7 -6
  97. package/agnostic/html/selector-to-element/index.js +7 -6
  98. package/agnostic/html/string-to-nodes/index.js +8 -7
  99. package/agnostic/misc/assert/index.js +4 -3
  100. package/agnostic/misc/cast/index.js +1 -0
  101. package/agnostic/misc/crawler/index.js +1 -0
  102. package/agnostic/misc/crossenv/detect-runtime/index.js +1 -0
  103. package/agnostic/misc/crossenv/index.js +3 -2
  104. package/agnostic/misc/crossenv/types/index.js +1 -0
  105. package/agnostic/misc/crossenv/window/index.js +1 -0
  106. package/agnostic/misc/data-size/index.d.ts +14 -14
  107. package/agnostic/misc/data-size/index.js +2 -1
  108. package/agnostic/misc/elo/index.js +2 -0
  109. package/agnostic/misc/get-current-downlink/index.js +1 -0
  110. package/agnostic/misc/index.js +27 -26
  111. package/agnostic/misc/is-constructor-function/index.js +1 -0
  112. package/agnostic/misc/is-nullish/index.js +1 -0
  113. package/agnostic/misc/logs/index.js +1 -0
  114. package/agnostic/misc/logs/logger/index.js +1 -0
  115. package/agnostic/misc/logs/make-text-block/index.js +1 -0
  116. package/agnostic/misc/logs/styles/index.js +1 -0
  117. package/agnostic/misc/lorem-ipsum/index.js +14 -13
  118. package/agnostic/misc/outcome/index.js +1 -0
  119. package/agnostic/numbers/absolute-modulo/index.js +1 -0
  120. package/agnostic/numbers/clamp/index.js +1 -0
  121. package/agnostic/numbers/index.js +7 -6
  122. package/agnostic/numbers/interpolate/index.js +1 -0
  123. package/agnostic/numbers/responsive-harmonics/index.js +1 -0
  124. package/agnostic/numbers/round/index.js +1 -0
  125. package/agnostic/objects/deep-get-property/index.js +1 -0
  126. package/agnostic/objects/enums/index.js +1 -0
  127. package/agnostic/objects/enums/is-in-enum/index.js +1 -0
  128. package/agnostic/objects/flatten-getters/index.js +1 -0
  129. package/agnostic/objects/index.js +12 -11
  130. package/agnostic/objects/is-object/index.js +1 -0
  131. package/agnostic/objects/is-record/index.js +1 -0
  132. package/agnostic/objects/record-format/index.js +1 -0
  133. package/agnostic/objects/record-map/index.js +1 -0
  134. package/agnostic/objects/validation/index.js +1 -0
  135. package/agnostic/optim/index.js +1 -0
  136. package/agnostic/optim/memoize/index.js +1 -0
  137. package/agnostic/optim/throttle-debounce/index.js +1 -0
  138. package/agnostic/random/hex-char/index.js +1 -0
  139. package/agnostic/random/index.js +1 -0
  140. package/agnostic/random/random/index.js +1 -0
  141. package/agnostic/random/uuid/index.js +1 -0
  142. package/agnostic/regexps/index.js +2 -0
  143. package/agnostic/strings/char-codes/index.js +1 -0
  144. package/agnostic/strings/index.js +7 -6
  145. package/agnostic/strings/matches/index.js +1 -0
  146. package/agnostic/strings/normalize-indent/index.js +1 -0
  147. package/agnostic/strings/replace-all/index.js +1 -0
  148. package/agnostic/strings/to-alphanum/index.js +1 -0
  149. package/agnostic/strings/trim/index.js +1 -0
  150. package/agnostic/time/dates/format-date/index.js +1 -0
  151. package/agnostic/time/dates/index.js +1 -0
  152. package/agnostic/time/duration/index.js +1 -0
  153. package/agnostic/time/index.js +1 -0
  154. package/agnostic/time/timeout/index.js +1 -0
  155. package/agnostic/time/transitions/index.js +1 -0
  156. package/agnostic/time/wait/index.js +1 -0
  157. package/chunks/chunk-2KCKWG7R.js +104 -0
  158. package/chunks/chunk-2UJYUMTT.js +37 -0
  159. package/chunks/chunk-365LSZZ7.js +37 -0
  160. package/chunks/chunk-4FOK7DUZ.js +35 -0
  161. package/chunks/chunk-4LCL2RIC.js +209 -0
  162. package/chunks/chunk-4WOAFIVN.js +31 -0
  163. package/chunks/chunk-53MBV4TG.js +6212 -0
  164. package/chunks/chunk-57YCNOX7.js +15 -0
  165. package/chunks/chunk-5QVKJGTN.js +95 -0
  166. package/chunks/chunk-5ZTW4PHE.js +173 -0
  167. package/chunks/chunk-6GZXU2Z3.js +191 -0
  168. package/chunks/chunk-7QIYI4CK.js +209 -0
  169. package/chunks/chunk-AF2MI5O5.js +29 -0
  170. package/chunks/chunk-ARDAQZRR.js +239 -0
  171. package/chunks/chunk-BLAAWANI.js +191 -0
  172. package/chunks/chunk-BV67SWXG.js +20 -0
  173. package/chunks/chunk-CIJQHLIW.js +31 -0
  174. package/chunks/chunk-CRGU2EHQ.js +31 -0
  175. package/chunks/chunk-DHMARF6D.js +62 -0
  176. package/chunks/chunk-DHWHB53F.js +191 -0
  177. package/chunks/chunk-DMR2WE3C.js +62 -0
  178. package/chunks/chunk-DPBYDWV3.js +2369 -0
  179. package/chunks/chunk-ECKOTCS4.js +2369 -0
  180. package/chunks/chunk-EEIJDUNV.js +209 -0
  181. package/chunks/chunk-EIU72AEZ.js +31 -0
  182. package/chunks/chunk-F5GXXF3A.js +31 -0
  183. package/chunks/chunk-FG53JEP2.js +31 -0
  184. package/chunks/chunk-FTIDPZZ5.js +209 -0
  185. package/chunks/chunk-GARJTJ6V.js +6 -0
  186. package/chunks/chunk-GL54CDM2.js +20 -0
  187. package/chunks/chunk-GNZY3ZTH.js +14 -0
  188. package/chunks/chunk-GQMFBT5T.js +191 -0
  189. package/chunks/chunk-GWXVHCAB.js +31 -0
  190. package/chunks/chunk-I2ILSLBK.js +32 -0
  191. package/chunks/chunk-IGHRNHVK.js +16 -0
  192. package/chunks/chunk-IOWZMFCU.js +28 -0
  193. package/chunks/chunk-IPON4W2H.js +31 -0
  194. package/chunks/chunk-IUFAHY2R.js +38 -0
  195. package/chunks/chunk-JBSS64SA.js +6 -0
  196. package/chunks/chunk-JRXTMXKV.js +15967 -0
  197. package/chunks/chunk-KEYRP27F.js +191 -0
  198. package/chunks/chunk-KYMCGWPM.js +31 -0
  199. package/chunks/chunk-L5JWJRZ7.js +484 -0
  200. package/chunks/chunk-L7EUEQZP.js +0 -0
  201. package/chunks/chunk-LAA2DQDK.js +31 -0
  202. package/chunks/chunk-LATEK24U.js +31 -0
  203. package/chunks/chunk-LDLSU4OG.js +191 -0
  204. package/chunks/chunk-LWWXPVXY.js +25173 -0
  205. package/chunks/chunk-MMPJODO2.js +31 -0
  206. package/chunks/chunk-MY4VMHSH.js +191 -0
  207. package/chunks/chunk-MZ2RAM5Y.js +62 -0
  208. package/chunks/chunk-NGYJGQT3.js +25002 -0
  209. package/chunks/chunk-NIOOIUSD.js +104 -0
  210. package/chunks/chunk-NLHFSJYR.js +15 -0
  211. package/chunks/chunk-NQ5ESZNO.js +191 -0
  212. package/chunks/chunk-O6NULFZI.js +37 -0
  213. package/chunks/chunk-OVMNSJOW.js +6 -0
  214. package/chunks/chunk-PPK2JEO6.js +28 -0
  215. package/chunks/chunk-PVHLWKA6.js +31 -0
  216. package/chunks/chunk-QMWX2A56.js +56 -0
  217. package/chunks/chunk-QPBY235R.js +239 -0
  218. package/chunks/chunk-REBANVPP.js +104 -0
  219. package/chunks/chunk-RSMUYH5H.js +31 -0
  220. package/chunks/chunk-RTFKMYT7.js +2369 -0
  221. package/chunks/chunk-RVVJ4QD4.js +173 -0
  222. package/chunks/chunk-TSQVG7GA.js +31 -0
  223. package/chunks/chunk-TXOUGP37.js +62 -0
  224. package/chunks/chunk-UG36UPJK.js +31 -0
  225. package/chunks/chunk-UXM54YBI.js +68 -0
  226. package/chunks/chunk-VHFMQI7Z.js +20 -0
  227. package/chunks/chunk-VP3Y6EMX.js +190 -0
  228. package/chunks/chunk-WLHJM76F.js +2369 -0
  229. package/chunks/chunk-WNLP6R5Y.js +191 -0
  230. package/chunks/chunk-WQKFVIUF.js +37 -0
  231. package/chunks/chunk-WSFCRVEQ.js +9 -0
  232. package/chunks/chunk-WTPUSGMJ.js +104 -0
  233. package/chunks/chunk-XCBH6NLF.js +42 -0
  234. package/chunks/chunk-XETVQW6S.js +56 -0
  235. package/chunks/chunk-XT6XKGKK.js +20 -0
  236. package/chunks/chunk-YDNQHZRS.js +31 -0
  237. package/chunks/chunk-YHT73ULP.js +2369 -0
  238. package/chunks/chunk-YRSNU7IX.js +49 -0
  239. package/chunks/chunk-YVSS4IT2.js +37 -0
  240. package/chunks/chunk-YZDZQ7AZ.js +37 -0
  241. package/chunks/chunk-Z4SQDCFG.js +37 -0
  242. package/chunks/chunk-ZS5OHINP.js +31 -0
  243. package/components/Comp/index.js +2 -0
  244. package/node/@design-edito/index.d.ts +2 -0
  245. package/node/@design-edito/index.js +12 -0
  246. package/node/@design-edito/thumbnails/colors/index.d.ts +35 -0
  247. package/node/@design-edito/thumbnails/colors/index.js +29 -0
  248. package/node/@design-edito/thumbnails/common/index.d.ts +5 -0
  249. package/node/@design-edito/thumbnails/common/index.js +15 -0
  250. package/node/@design-edito/thumbnails/easings/index.d.ts +8 -0
  251. package/node/@design-edito/thumbnails/easings/index.js +21 -0
  252. package/node/@design-edito/thumbnails/index.d.ts +5 -0
  253. package/node/@design-edito/thumbnails/index.js +20 -0
  254. package/node/@design-edito/thumbnails/layout/index.d.ts +63 -0
  255. package/node/@design-edito/thumbnails/layout/index.js +31 -0
  256. package/node/@express/@multer/index.d.ts +22 -0
  257. package/node/@express/@multer/index.js +9 -0
  258. package/node/@express/index.d.ts +2 -0
  259. package/node/@express/index.js +9 -0
  260. package/node/@google-cloud/index.d.ts +2 -0
  261. package/node/@google-cloud/index.js +24 -0
  262. package/node/@google-cloud/storage/bucket/get-metadata/index.d.ts +18 -0
  263. package/node/@google-cloud/storage/bucket/get-metadata/index.js +9 -0
  264. package/node/@google-cloud/storage/bucket/index.d.ts +3 -0
  265. package/node/@google-cloud/storage/bucket/index.js +14 -0
  266. package/node/@google-cloud/storage/bucket/list/index.d.ts +17 -0
  267. package/node/@google-cloud/storage/bucket/list/index.js +9 -0
  268. package/node/@google-cloud/storage/file/copy/index.d.ts +21 -0
  269. package/node/@google-cloud/storage/file/copy/index.js +9 -0
  270. package/node/@google-cloud/storage/file/download/index.d.ts +20 -0
  271. package/node/@google-cloud/storage/file/download/index.js +9 -0
  272. package/node/@google-cloud/storage/file/erase/index.d.ts +20 -0
  273. package/node/@google-cloud/storage/file/erase/index.js +9 -0
  274. package/node/@google-cloud/storage/file/exists/index.d.ts +19 -0
  275. package/node/@google-cloud/storage/file/exists/index.js +9 -0
  276. package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +23 -0
  277. package/node/@google-cloud/storage/file/generate-signed-url/index.js +9 -0
  278. package/node/@google-cloud/storage/file/get-metadata/index.d.ts +22 -0
  279. package/node/@google-cloud/storage/file/get-metadata/index.js +9 -0
  280. package/node/@google-cloud/storage/file/get-permissions/index.d.ts +19 -0
  281. package/node/@google-cloud/storage/file/get-permissions/index.js +9 -0
  282. package/node/@google-cloud/storage/file/index.d.ts +12 -0
  283. package/node/@google-cloud/storage/file/index.js +50 -0
  284. package/node/@google-cloud/storage/file/move/index.d.ts +24 -0
  285. package/node/@google-cloud/storage/file/move/index.js +9 -0
  286. package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +26 -0
  287. package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +12 -0
  288. package/node/@google-cloud/storage/file/update-metadata/index.d.ts +24 -0
  289. package/node/@google-cloud/storage/file/update-metadata/index.js +9 -0
  290. package/node/@google-cloud/storage/file/upload/index.d.ts +21 -0
  291. package/node/@google-cloud/storage/file/upload/index.js +9 -0
  292. package/node/@google-cloud/storage/index.d.ts +3 -0
  293. package/node/@google-cloud/storage/index.js +27 -0
  294. package/node/encryption/buffer/index.d.ts +55 -0
  295. package/node/encryption/buffer/index.js +16 -0
  296. package/node/encryption/generate-key/index.d.ts +16 -0
  297. package/node/encryption/generate-key/index.js +7 -0
  298. package/node/encryption/index.d.ts +5 -0
  299. package/node/encryption/index.js +29 -0
  300. package/node/encryption/uint8-array/index.d.ts +57 -0
  301. package/node/encryption/uint8-array/index.js +15 -0
  302. package/node/files/index.d.ts +4 -6
  303. package/node/files/index.js +7 -7
  304. package/node/files/is-in-directory/index.js +1 -0
  305. package/node/files/read-write/index.d.ts +1 -1
  306. package/node/files/read-write/index.js +1 -0
  307. package/node/files/subpaths/index.js +1 -0
  308. package/node/images/exports/index.d.ts +15 -0
  309. package/node/images/exports/index.js +11 -0
  310. package/node/images/index.d.ts +4 -0
  311. package/node/images/index.js +24 -0
  312. package/node/images/prepare/index.d.ts +17 -0
  313. package/node/images/prepare/index.js +22 -0
  314. package/node/images/transform/area-composition/index.d.ts +60 -0
  315. package/node/images/transform/area-composition/index.js +16 -0
  316. package/node/images/transform/index.d.ts +30 -0
  317. package/node/images/transform/index.js +17 -0
  318. package/node/index.d.ts +8 -6
  319. package/node/process/index.d.ts +5 -7
  320. package/node/process/index.js +11 -9
  321. package/node/process/on-exit/index.js +1 -0
  322. package/package.json +15 -2
@@ -0,0 +1,20 @@
1
+ import { Bucket, FileOptions, DownloadOptions as GCSFileDownloadOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type DownloadOptions = {
4
+ fileOptions?: FileOptions;
5
+ downloadOptions?: GCSFileDownloadOptions;
6
+ };
7
+ /**
8
+ * Downloads a file from a specified Google Cloud Storage bucket.
9
+ *
10
+ * This function downloads a file from the given bucket and path, returning the file content as a `Buffer`.
11
+ * The download process can be customized using optional `fileOptions` and `downloadOptions`.
12
+ *
13
+ * @param {string} sourcePath - The path of the file to be downloaded in the bucket.
14
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object from which to download the file.
15
+ * @param {DownloadOptions} [options] - Optional configuration options for the download.
16
+ * @returns {Promise<Outcome.Either<Buffer, string>>} A promise that resolves to an `Outcome.Either`.
17
+ * - On success: `Outcome.makeSuccess(buffer)` containing the downloaded file's content as a `Buffer`.
18
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the download fails.
19
+ */
20
+ export declare function download(sourcePath: string, bucket: Bucket, options?: DownloadOptions): Promise<Outcome.Either<Buffer, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ download
3
+ } from "../../../../../chunks/chunk-LAA2DQDK.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ download
9
+ };
@@ -0,0 +1,20 @@
1
+ import { Bucket, FileOptions, DeleteFileOptions as GCSDeleteFileOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type EraseOptions = {
4
+ fileOptions?: FileOptions;
5
+ deleteOptions?: GCSDeleteFileOptions;
6
+ };
7
+ /**
8
+ * Erases a file from a specified Google Cloud Storage bucket.
9
+ *
10
+ * This function erases the file located at `sourcePath` in the given bucket.
11
+ * It can be customized using optional `fileOptions` and `eraseOptions` to modify how the file is erased.
12
+ *
13
+ * @param {string} sourcePath - The path of the file to be erased in the bucket.
14
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object from which to erase the file.
15
+ * @param {EraseOptions} [options] - Optional configuration options for the file deletion.
16
+ * @returns {Promise<Outcome.Either<true, string>>} A promise that resolves to an `Outcome.Either`.
17
+ * - On success: `Outcome.makeSuccess(true)` indicating the file was successfully erased.
18
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the erase operation fails.
19
+ */
20
+ export declare function erase(sourcePath: string, bucket: Bucket, options?: EraseOptions): Promise<Outcome.Either<true, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ erase
3
+ } from "../../../../../chunks/chunk-FG53JEP2.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ erase
9
+ };
@@ -0,0 +1,19 @@
1
+ import { Bucket, FileOptions, FileExistsOptions as GCSFileExistsOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type ExistsOptions = {
4
+ fileOptions?: FileOptions;
5
+ existsOptions?: GCSFileExistsOptions;
6
+ };
7
+ /**
8
+ * Checks if a file exists in the specified bucket.
9
+ *
10
+ * This function verifies whether a file at the given `sourcePath` exists in the bucket. It can be configured with options to customize the behavior of the check.
11
+ *
12
+ * @param {Bucket} bucket - The GCS bucket to check for the file existence.
13
+ * @param {string} sourcePath - The path of the file to check within the bucket.
14
+ * @param {ExistsOptions} [options] - Optional configuration for the file existence check.
15
+ * @param {FileOptions} [options.fileOptions] - Additional options for the file, such as custom metadata or ACL settings.
16
+ * @param {ExistsOptions} [options.existsOptions] - Options for controlling the `exists` method (if any).
17
+ * @returns {Promise<Outcome.Either<boolean, string>>} - Returns either a success with `true` or `false` indicating whether the file exists, or a failure with an error message.
18
+ */
19
+ export declare function exists(bucket: Bucket, sourcePath: string, options?: ExistsOptions): Promise<Outcome.Either<boolean, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ exists
3
+ } from "../../../../../chunks/chunk-CIJQHLIW.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ exists
9
+ };
@@ -0,0 +1,23 @@
1
+ import { Bucket, FileOptions, GetSignedUrlConfig } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type GenerateSignedUrlOptions = {
4
+ fileOptions?: FileOptions;
5
+ getSignedUrlOptions?: Omit<GetSignedUrlConfig, 'action' | 'expires'>;
6
+ };
7
+ /**
8
+ * Generates a signed URL that provides temporary access to a file in Google Cloud Storage.
9
+ *
10
+ * This function generates a signed URL for the file located at `sourcePath` in the given bucket. The signed URL
11
+ * allows users to perform an action on the file (e.g., `read`, `write`) for a limited time as defined by the `expiresOn` parameter.
12
+ * The behavior can be customized using optional `fileOptions` and `getSignedUrlOptions`.
13
+ *
14
+ * @param {string} sourcePath - The path of the file for which the signed URL is being generated.
15
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object containing the file.
16
+ * @param {GetSignedUrlConfig['action']} action - The action allowed by the signed URL (e.g., 'read', 'write', 'delete').
17
+ * @param {GetSignedUrlConfig['expires']} expiresOn - The expiration time of the signed URL, after which it is no longer valid.
18
+ * @param {GenerateSignedUrlOptions} [options] - Optional configuration options for generating the signed URL.
19
+ * @returns {Promise<Outcome.Either<string, string>>} A promise that resolves to an `Outcome.Either`.
20
+ * - On success: `Outcome.makeSuccess(url)` containing the generated signed URL.
21
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the signed URL generation fails.
22
+ */
23
+ export declare function generateSignedUrl(sourcePath: string, bucket: Bucket, action: GetSignedUrlConfig['action'], expiresOn: GetSignedUrlConfig['expires'], options?: GenerateSignedUrlOptions): Promise<Outcome.Either<string, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ generateSignedUrl
3
+ } from "../../../../../chunks/chunk-4FOK7DUZ.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ generateSignedUrl
9
+ };
@@ -0,0 +1,22 @@
1
+ import { Bucket, FileOptions, GetFileMetadataOptions as GCSGetFileMetadataOptions, FileMetadata } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type GetMetadataOptions = {
4
+ fileOptions?: FileOptions;
5
+ getFileMetadataOptions?: GCSGetFileMetadataOptions;
6
+ };
7
+ /**
8
+ * Retrieves the metadata of a file from a specified Google Cloud Storage bucket.
9
+ *
10
+ * This function fetches the metadata for a file located at `sourcePath` in the given bucket.
11
+ * It can be customized using optional `fileOptions` and `getFileMetadataOptions` to control the retrieval behavior.
12
+ *
13
+ * @param {string} sourcePath - The path of the file whose metadata is to be fetched.
14
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object containing the file whose metadata is being retrieved.
15
+ * @param {GetMetadataOptions} [options] - Optional configuration options for the file metadata retrieval.
16
+ * @returns {Promise<Outcome.Either<FileMetadata, string>>} A promise that resolves to an `Outcome.Either`.
17
+ * - On success: `Outcome.makeSuccess(metadata)` containing the file's metadata.
18
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the metadata retrieval fails.
19
+ *
20
+ * @throws {Error} Throws an error if the metadata retrieval operation fails (e.g., file not found, insufficient permissions, etc.).
21
+ */
22
+ export declare function getMetadata(sourcePath: string, bucket: Bucket, options?: GetMetadataOptions): Promise<Outcome.Either<FileMetadata, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ getMetadata
3
+ } from "../../../../../chunks/chunk-YDNQHZRS.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ getMetadata
9
+ };
@@ -0,0 +1,19 @@
1
+ import { Bucket, FileOptions, GetAclOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type GetPermissionsOptions = {
4
+ fileOptions?: FileOptions;
5
+ getAclOptions?: GetAclOptions;
6
+ };
7
+ /**
8
+ * Retrieves the access control list (ACL) for a file in Google Cloud Storage.
9
+ *
10
+ * This function fetches the ACL settings of a given file to determine the permissions assigned to different users or roles.
11
+ *
12
+ * @param {string} sourcePath - The path of the file whose permissions need to be retrieved.
13
+ * @param {Bucket} bucket - The Google Cloud Storage bucket containing the file.
14
+ * @param {GetPermissionsOptions} [options] - Optional configuration options for the file and ACL retrieval.
15
+ * @returns {Promise<Outcome.Either<any, string>>} A promise that resolves to an `Outcome.Either`.
16
+ * - On success: `Outcome.makeSuccess(acl)` containing the file's ACL settings.
17
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the ACL retrieval fails.
18
+ */
19
+ export declare function getPermissions(sourcePath: string, bucket: Bucket, options?: GetPermissionsOptions): Promise<Outcome.Either<any, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ getPermissions
3
+ } from "../../../../../chunks/chunk-F5GXXF3A.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ getPermissions
9
+ };
@@ -0,0 +1,12 @@
1
+ import * as Copy from './copy';
2
+ import * as Download from './download';
3
+ import * as Erase from './erase';
4
+ import * as Exists from './exists';
5
+ import * as GenerateSignedUrl from './generate-signed-url';
6
+ import * as GetMetaData from './get-metadata';
7
+ import * as GetPermissions from './get-permissions';
8
+ import * as Move from './move';
9
+ import * as RevokeSignedUrls from './revoke-signed-urls';
10
+ import * as UpdateMetadata from './update-metadata';
11
+ import * as Upload from './upload';
12
+ export { Copy, Download, Erase, Exists, GenerateSignedUrl, GetMetaData, GetPermissions, Move, RevokeSignedUrls, UpdateMetadata, Upload };
@@ -0,0 +1,50 @@
1
+ import "../../../../chunks/chunk-QMWX2A56.js";
2
+ import {
3
+ revoke_signed_urls_exports
4
+ } from "../../../../chunks/chunk-YZDZQ7AZ.js";
5
+ import {
6
+ upload_exports
7
+ } from "../../../../chunks/chunk-RSMUYH5H.js";
8
+ import {
9
+ move_exports
10
+ } from "../../../../chunks/chunk-I2ILSLBK.js";
11
+ import {
12
+ update_metadata_exports
13
+ } from "../../../../chunks/chunk-UG36UPJK.js";
14
+ import {
15
+ copy_exports
16
+ } from "../../../../chunks/chunk-PVHLWKA6.js";
17
+ import {
18
+ download_exports
19
+ } from "../../../../chunks/chunk-LAA2DQDK.js";
20
+ import {
21
+ erase_exports
22
+ } from "../../../../chunks/chunk-FG53JEP2.js";
23
+ import {
24
+ generate_signed_url_exports
25
+ } from "../../../../chunks/chunk-4FOK7DUZ.js";
26
+ import {
27
+ exists_exports
28
+ } from "../../../../chunks/chunk-CIJQHLIW.js";
29
+ import {
30
+ get_permissions_exports
31
+ } from "../../../../chunks/chunk-F5GXXF3A.js";
32
+ import {
33
+ get_metadata_exports
34
+ } from "../../../../chunks/chunk-YDNQHZRS.js";
35
+ import "../../../../chunks/chunk-JMU5PDBD.js";
36
+ import "../../../../chunks/chunk-FENXVJYO.js";
37
+ import "../../../../chunks/chunk-XCBH6NLF.js";
38
+ export {
39
+ copy_exports as Copy,
40
+ download_exports as Download,
41
+ erase_exports as Erase,
42
+ exists_exports as Exists,
43
+ generate_signed_url_exports as GenerateSignedUrl,
44
+ get_metadata_exports as GetMetaData,
45
+ get_permissions_exports as GetPermissions,
46
+ move_exports as Move,
47
+ revoke_signed_urls_exports as RevokeSignedUrls,
48
+ update_metadata_exports as UpdateMetadata,
49
+ upload_exports as Upload
50
+ };
@@ -0,0 +1,24 @@
1
+ import { Bucket, FileOptions, CopyOptions, DeleteFileOptions as GCSDeleteFileOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type MoveOptions = {
4
+ fileOptions?: FileOptions;
5
+ copyOptions?: CopyOptions;
6
+ deleteOptions?: GCSDeleteFileOptions;
7
+ };
8
+ /**
9
+ * Moves a file from one location to another within a Google Cloud Storage bucket.
10
+ *
11
+ * This function first copies the file located at `sourcePath` to `destinationPath`, then deletes the source file
12
+ * after the copy is successful. The process can be customized using optional `fileOptions`, `copyOptions`, and `deleteOptions`.
13
+ *
14
+ * @param {string} sourcePath - The path of the source file to be moved.
15
+ * @param {string} destinationPath - The destination path where the file will be moved to.
16
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object containing the file to be moved.
17
+ * @param {MoveOptions} [options] - Optional configuration options for the file move operation.
18
+ * @returns {Promise<Outcome.Either<true, string>>} A promise that resolves to an `Outcome.Either`.
19
+ * - On success: `Outcome.makeSuccess(true)` indicating the file was successfully moved.
20
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the move operation fails.
21
+ *
22
+ * @throws {Error} Throws an error if the move operation fails (e.g., source file not found, insufficient permissions, etc.).
23
+ */
24
+ export declare function move(sourcePath: string, destinationPath: string, bucket: Bucket, options?: MoveOptions): Promise<Outcome.Either<true, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ move
3
+ } from "../../../../../chunks/chunk-I2ILSLBK.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ move
9
+ };
@@ -0,0 +1,26 @@
1
+ import { Bucket } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ import { DownloadOptions } from '../download';
4
+ import { EraseOptions } from '../erase';
5
+ import { UploadOptions } from '../upload';
6
+ export type RevokeSignedUrlsOptions = {
7
+ downloadOptions?: DownloadOptions;
8
+ eraseOptions?: EraseOptions;
9
+ uploadOptions?: UploadOptions;
10
+ };
11
+ /**
12
+ * Revokes the signed URLs for a file in Google Cloud Storage by downloading the file,
13
+ * deleting it, and re-uploading it to effectively invalidate any previously generated signed URLs.
14
+ *
15
+ * This function first attempts to download the file from the bucket, then erases the file,
16
+ * and finally re-uploads the file to the same path. The re-upload effectively revokes any signed URLs that
17
+ * were generated for the file, as they are tied to the file's existence and content.
18
+ *
19
+ * @param {string} sourcePath - The path of the file for which the signed URLs are to be revoked.
20
+ * @param {Bucket} bucket - The Google Cloud Storage bucket containing the file.
21
+ * @param {RevokeSignedUrlsOptions} [options] - Optional configuration options for the file operations.
22
+ * @returns {Promise<Outcome.Either<true, string>>} A promise that resolves to an `Outcome.Either`.
23
+ * - On success: `Outcome.makeSuccess(true)` if the file has been successfully re-uploaded after deletion.
24
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if any of the steps (download, erase, or upload) fail.
25
+ */
26
+ export declare function revokeSignedUrls(sourcePath: string, bucket: Bucket, options?: RevokeSignedUrlsOptions): Promise<Outcome.Either<true, string>>;
@@ -0,0 +1,12 @@
1
+ import {
2
+ revokeSignedUrls
3
+ } from "../../../../../chunks/chunk-YZDZQ7AZ.js";
4
+ import "../../../../../chunks/chunk-RSMUYH5H.js";
5
+ import "../../../../../chunks/chunk-LAA2DQDK.js";
6
+ import "../../../../../chunks/chunk-FG53JEP2.js";
7
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
8
+ import "../../../../../chunks/chunk-FENXVJYO.js";
9
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
10
+ export {
11
+ revokeSignedUrls
12
+ };
@@ -0,0 +1,24 @@
1
+ import { Bucket, FileOptions, SetFileMetadataOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type UpdateFileMetadataOptions = {
4
+ fileOptions?: FileOptions;
5
+ metadataOptions?: SetFileMetadataOptions;
6
+ };
7
+ /**
8
+ * Updates the metadata of a file in a Google Cloud Storage bucket.
9
+ *
10
+ * This function allows updating the metadata of a file located at `sourcePath` in the given bucket.
11
+ * The metadata is updated according to the provided `metadata` object, which contains the new metadata key-value pairs.
12
+ * It can be customized using optional `fileOptions` and `metadataOptions` to control the update behavior.
13
+ *
14
+ * @param {string} sourcePath - The path of the file whose metadata is to be updated.
15
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object containing the file whose metadata is being updated.
16
+ * @param {Record<string, any>} metadata - The metadata object containing key-value pairs to be set on the file.
17
+ * @param {UpdateFileMetadataOptions} [options] - Optional configuration options for the metadata update operation.
18
+ * @returns {Promise<Outcome.Either<true, string>>} A promise that resolves to an `Outcome.Either`.
19
+ * - On success: `Outcome.makeSuccess(true)` indicating the metadata was successfully updated.
20
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the metadata update operation fails.
21
+ *
22
+ * @throws {Error} Throws an error if the metadata update operation fails (e.g., file not found, insufficient permissions, etc.).
23
+ */
24
+ export declare function updateFileMetadata(sourcePath: string, bucket: Bucket, metadata: Record<string, any>, options?: UpdateFileMetadataOptions): Promise<Outcome.Either<true, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ updateFileMetadata
3
+ } from "../../../../../chunks/chunk-UG36UPJK.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ updateFileMetadata
9
+ };
@@ -0,0 +1,21 @@
1
+ import { Bucket, FileOptions, SaveOptions } from '@google-cloud/storage';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ export type UploadOptions = {
4
+ fileOptions?: FileOptions;
5
+ saveOptions?: SaveOptions;
6
+ };
7
+ /**
8
+ * Uploads a file buffer to a specified Google Cloud Storage bucket.
9
+ *
10
+ * This function uploads the provided file buffer to the specified bucket at the given destination path.
11
+ * The upload can be customized using optional `fileOptions` and `saveOptions`.
12
+ *
13
+ * @param {Buffer} filebuffer - The file content to be uploaded.
14
+ * @param {string} destinationPath - The destination path where the file will be saved in the bucket.
15
+ * @param {Bucket} bucket - The Google Cloud Storage bucket object.
16
+ * @param {UploadOptions} [options] - Optional options to configure the upload process.
17
+ * @returns {Promise<Outcome.Either<true, string>>} A promise that resolves to an `Outcome.Either`.
18
+ * - On success: `Outcome.makeSuccess(true)` indicating the upload was successful.
19
+ * - On failure: `Outcome.makeFailure(errStr)` with an error message if the upload fails.
20
+ */
21
+ export declare function upload(filebuffer: Buffer, destinationPath: string, bucket: Bucket, options?: UploadOptions): Promise<Outcome.Either<true, string>>;
@@ -0,0 +1,9 @@
1
+ import {
2
+ upload
3
+ } from "../../../../../chunks/chunk-RSMUYH5H.js";
4
+ import "../../../../../chunks/chunk-JMU5PDBD.js";
5
+ import "../../../../../chunks/chunk-FENXVJYO.js";
6
+ import "../../../../../chunks/chunk-XCBH6NLF.js";
7
+ export {
8
+ upload
9
+ };
@@ -0,0 +1,3 @@
1
+ import * as Bucket from './bucket';
2
+ import * as File from './file';
3
+ export { Bucket, File };
@@ -0,0 +1,27 @@
1
+ import "../../../chunks/chunk-BV67SWXG.js";
2
+ import {
3
+ file_exports
4
+ } from "../../../chunks/chunk-QMWX2A56.js";
5
+ import "../../../chunks/chunk-YZDZQ7AZ.js";
6
+ import "../../../chunks/chunk-RSMUYH5H.js";
7
+ import "../../../chunks/chunk-I2ILSLBK.js";
8
+ import "../../../chunks/chunk-UG36UPJK.js";
9
+ import "../../../chunks/chunk-PVHLWKA6.js";
10
+ import "../../../chunks/chunk-LAA2DQDK.js";
11
+ import "../../../chunks/chunk-FG53JEP2.js";
12
+ import "../../../chunks/chunk-4FOK7DUZ.js";
13
+ import "../../../chunks/chunk-CIJQHLIW.js";
14
+ import "../../../chunks/chunk-F5GXXF3A.js";
15
+ import "../../../chunks/chunk-YDNQHZRS.js";
16
+ import {
17
+ bucket_exports
18
+ } from "../../../chunks/chunk-GL54CDM2.js";
19
+ import "../../../chunks/chunk-KYMCGWPM.js";
20
+ import "../../../chunks/chunk-AF2MI5O5.js";
21
+ import "../../../chunks/chunk-JMU5PDBD.js";
22
+ import "../../../chunks/chunk-FENXVJYO.js";
23
+ import "../../../chunks/chunk-XCBH6NLF.js";
24
+ export {
25
+ bucket_exports as Bucket,
26
+ file_exports as File
27
+ };
@@ -0,0 +1,55 @@
1
+ import { Readable } from 'node:stream';
2
+ import { Outcome } from '~/agnostic/misc/outcome';
3
+ import { EncryptDecryptOptions } from '../uint8-array';
4
+ /**
5
+ * Encrypts a `Buffer` by converting it to a `Uint8Array`, performing encryption, and then returning the result as a `Buffer`.
6
+ *
7
+ * @param {Buffer} inputBuffer - The input data to encrypt.
8
+ * @param {string} encryptionKey - The encryption key to use.
9
+ * @param {string} [algorithm='aes-256-gcm'] - The encryption algorithm to use. Defaults to 'aes-256-gcm'.
10
+ * @param {EncryptDecryptOptions} [options] - Optional options.
11
+ * @param {number} [options.ivLength=16] - The length of the initialization vector (IV). Defaults to 16 bytes.
12
+ *
13
+ * @returns {Outcome.Either<Buffer, string>} The result of the encryption. Success returns the encrypted data as a `Buffer` (with IV prepended), or failure returns an error message.
14
+ */
15
+ export declare function encryptBuffer(inputBuffer: Buffer, encryptionKey: string, algorithm?: string, options?: EncryptDecryptOptions): Outcome.Either<Buffer, string>;
16
+ /**
17
+ * Encrypts a `Buffer` using streams and returns a `Readable` stream containing the encrypted data.
18
+ * The `Readable` stream will emit encrypted data in chunks.
19
+ *
20
+ * @param {Buffer} inputBuffer - The input data to be encrypted.
21
+ * @param {string} encryptionKey - The encryption key to use for encryption.
22
+ * @param {string} [algorithm='aes-256-gcm'] - The encryption algorithm to use (default: 'aes-256-gcm').
23
+ * @param {EncryptDecryptOptions} [options] - Optional parameters for encryption, such as `ivLength`.
24
+ * @param {number} [options.ivLength=16] - The length of the initialization vector (IV) to use (default: 16).
25
+ *
26
+ * @returns {Outcome.Either<Readable, string>} - An `Outcome` containing either the `Readable` stream on success,
27
+ * or an error message on failure.
28
+ */
29
+ export declare function encryptBufferWithStream(inputBuffer: Buffer, encryptionKey: string, algorithm?: string, options?: EncryptDecryptOptions): Outcome.Either<Readable, string>;
30
+ /**
31
+ * Decrypts an encrypted `Buffer` by converting it to a `Uint8Array`, performing decryption, and then returning the result as a `Buffer`.
32
+ *
33
+ * @param {Buffer} encryptedBuffer - The encrypted data to decrypt.
34
+ * @param {string} encryptionKey - The encryption key to use.
35
+ * @param {string} [algorithm='aes-256-gcm'] - The encryption algorithm to use. Defaults to 'aes-256-gcm'.
36
+ * @param {EncryptDecryptOptions} [options] - Optional options.
37
+ * @param {number} [options.ivLength=16] - The length of the initialization vector (IV). Defaults to 16 bytes.
38
+ *
39
+ * @returns {Outcome.Either<Buffer, string>} The result of the decryption. Success returns the decrypted data as a `Buffer`, or failure returns an error message.
40
+ */
41
+ export declare function decryptBuffer(encryptedBuffer: Buffer, encryptionKey: string, algorithm?: string, options?: EncryptDecryptOptions): Outcome.Either<Buffer, string>;
42
+ /**
43
+ * Decrypts an encrypted `Buffer` using streams and returns a `Readable` stream containing the decrypted data.
44
+ * The `Readable` stream will emit decrypted data in chunks.
45
+ *
46
+ * @param {Buffer} encryptedBuffer - The encrypted data to be decrypted. The first `ivLength` bytes are treated as the initialization vector (IV).
47
+ * @param {string} encryptionKey - The encryption key to use for decryption.
48
+ * @param {string} [algorithm='aes-256-gcm'] - The decryption algorithm to use (default: 'aes-256-gcm').
49
+ * @param {EncryptDecryptOptions} [options] - Optional parameters for decryption, such as `ivLength`.
50
+ * @param {number} [options.ivLength=16] - The length of the initialization vector (IV) to use (default: 16).
51
+ *
52
+ * @returns {Outcome.Either<Readable, string>} - An `Outcome` containing either the `Readable` stream on success,
53
+ * or an error message on failure.
54
+ */
55
+ export declare function decryptBufferWithStream(encryptedBuffer: Buffer, encryptionKey: string, algorithm?: string, options?: EncryptDecryptOptions): Outcome.Either<Readable, string>;
@@ -0,0 +1,16 @@
1
+ import {
2
+ decryptBuffer,
3
+ decryptBufferWithStream,
4
+ encryptBuffer,
5
+ encryptBufferWithStream
6
+ } from "../../../chunks/chunk-IUFAHY2R.js";
7
+ import "../../../chunks/chunk-5QVKJGTN.js";
8
+ import "../../../chunks/chunk-JMU5PDBD.js";
9
+ import "../../../chunks/chunk-FENXVJYO.js";
10
+ import "../../../chunks/chunk-XCBH6NLF.js";
11
+ export {
12
+ decryptBuffer,
13
+ decryptBufferWithStream,
14
+ encryptBuffer,
15
+ encryptBufferWithStream
16
+ };
@@ -0,0 +1,16 @@
1
+ export type GenerateEncryptionKeyOptions = {
2
+ saltLength?: number;
3
+ iterations?: number;
4
+ };
5
+ /**
6
+ * Generates an encryption key from a passphrase using PBKDF2.
7
+ *
8
+ * @param {string} passphrase - The passphrase to derive the key from.
9
+ * @param {number} outputByteLength - The length of the output encryption key in bytes.
10
+ * @param {GenerateEncryptionKeyOptions} [options] - Optional options.
11
+ * @param {number} [options.saltLength=16] - The length of the salt in bytes. Defaults to 16 bytes.
12
+ * @param {number} [options.iterations=100000] - The number of PBKDF2 iterations. Defaults to 100,000 iterations.
13
+ *
14
+ * @returns {string} The derived encryption key and salt, concatenated as a string in the format `salt:encryptionKey`.
15
+ */
16
+ export declare function generateEncryptionKey(passphrase: string, outputByteLength: number, options?: GenerateEncryptionKeyOptions): string;
@@ -0,0 +1,7 @@
1
+ import {
2
+ generateEncryptionKey
3
+ } from "../../../chunks/chunk-GNZY3ZTH.js";
4
+ import "../../../chunks/chunk-XCBH6NLF.js";
5
+ export {
6
+ generateEncryptionKey
7
+ };
@@ -0,0 +1,5 @@
1
+ import { encryptBuffer, decryptBuffer, encryptBufferWithStream, decryptBufferWithStream } from './buffer';
2
+ import { generateEncryptionKey, GenerateEncryptionKeyOptions } from './generate-key';
3
+ import { EncryptDecryptOptions, encryptUint8Array, decryptUint8Array, encryptUint8ArrayWithStream, decryptUint8ArrayWithStream } from './uint8-array';
4
+ export { encryptBuffer, decryptBuffer, encryptBufferWithStream, decryptBufferWithStream, generateEncryptionKey, encryptUint8Array, decryptUint8Array, encryptUint8ArrayWithStream, decryptUint8ArrayWithStream };
5
+ export type { EncryptDecryptOptions, GenerateEncryptionKeyOptions };
@@ -0,0 +1,29 @@
1
+ import {
2
+ generateEncryptionKey
3
+ } from "../../chunks/chunk-GNZY3ZTH.js";
4
+ import {
5
+ decryptBuffer,
6
+ decryptBufferWithStream,
7
+ encryptBuffer,
8
+ encryptBufferWithStream
9
+ } from "../../chunks/chunk-IUFAHY2R.js";
10
+ import {
11
+ decryptUint8Array,
12
+ decryptUint8ArrayWithStream,
13
+ encryptUint8Array,
14
+ encryptUint8ArrayWithStream
15
+ } from "../../chunks/chunk-5QVKJGTN.js";
16
+ import "../../chunks/chunk-JMU5PDBD.js";
17
+ import "../../chunks/chunk-FENXVJYO.js";
18
+ import "../../chunks/chunk-XCBH6NLF.js";
19
+ export {
20
+ decryptBuffer,
21
+ decryptBufferWithStream,
22
+ decryptUint8Array,
23
+ decryptUint8ArrayWithStream,
24
+ encryptBuffer,
25
+ encryptBufferWithStream,
26
+ encryptUint8Array,
27
+ encryptUint8ArrayWithStream,
28
+ generateEncryptionKey
29
+ };