@design-edito/tools 0.1.71 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agnostic/arrays/find-duplicates/index.js +1 -1
- package/agnostic/arrays/index.js +8 -8
- package/agnostic/arrays/is-array-of/index.js +1 -1
- package/agnostic/arrays/make/index.js +1 -1
- package/agnostic/arrays/random-pick/index.js +5 -5
- package/agnostic/arrays/shuffle/index.js +1 -1
- package/agnostic/booleans/index.js +1 -1
- package/agnostic/booleans/is-falsy/index.js +1 -1
- package/agnostic/colors/complement-color/index.js +1 -1
- package/agnostic/colors/hex-to-rgb/index.js +1 -1
- package/agnostic/colors/hsl-to-rgb/index.js +1 -1
- package/agnostic/colors/index.js +12 -12
- package/agnostic/colors/lighten-color/index.js +3 -3
- package/agnostic/colors/rgb-to-hex/index.js +1 -1
- package/agnostic/colors/rgb-to-hsl/index.js +1 -1
- package/agnostic/colors/saturate-color/index.js +3 -3
- package/agnostic/css/bem/index.js +1 -1
- package/agnostic/css/generate-nice-color/index.js +1 -1
- package/agnostic/css/index.js +12 -12
- package/agnostic/css/is-valid-css-class-name/index.js +1 -1
- package/agnostic/css/styles-set/index.js +5 -5
- package/agnostic/errors/index.js +1 -1
- package/agnostic/errors/register/index.js +1 -1
- package/agnostic/errors/unknown-to-string/index.js +1 -1
- package/agnostic/html/get-node-ancestors/index.js +1 -1
- package/agnostic/html/get-position-inside-parent/index.js +1 -1
- package/agnostic/html/hyper-json/cast/index.js +5 -5
- package/agnostic/html/hyper-json/index.js +6 -6
- package/agnostic/html/hyper-json/method/index.js +1 -1
- package/agnostic/html/hyper-json/serialize/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/add/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/any/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/array/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/boolean/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +5 -5
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +5 -5
- package/agnostic/html/hyper-json/transformer/index.js +1 -1
- package/agnostic/html/hyper-json/tree/index.js +5 -5
- package/agnostic/html/hyper-json/types/index.js +1 -1
- package/agnostic/html/hyper-json/utils/index.js +5 -5
- package/agnostic/html/index.js +17 -17
- package/agnostic/html/insert-node/index.js +1 -1
- package/agnostic/html/placeholders/index.js +1 -1
- package/agnostic/html/replace-in-element/index.js +1 -1
- package/agnostic/html/sanitize/index.js +5 -5
- package/agnostic/html/selector-to-element/index.js +5 -5
- package/agnostic/html/string-to-nodes/index.js +6 -6
- package/agnostic/misc/assert/index.js +1 -1
- package/agnostic/misc/cast/index.js +1 -1
- package/agnostic/misc/crawler/index.js +1 -1
- package/agnostic/misc/crossenv/detect-runtime/index.js +1 -1
- package/agnostic/misc/crossenv/index.js +3 -3
- package/agnostic/misc/crossenv/types/index.js +1 -1
- package/agnostic/misc/crossenv/window/index.js +1 -1
- package/agnostic/misc/data-size/index.js +2 -2
- package/agnostic/misc/elo/index.js +1 -1
- package/agnostic/misc/get-current-downlink/index.js +1 -1
- package/agnostic/misc/index.js +17 -17
- package/agnostic/misc/is-constructor-function/index.js +1 -1
- package/agnostic/misc/is-nullish/index.js +1 -1
- package/agnostic/misc/logs/index.js +1 -1
- package/agnostic/misc/logs/logger/index.js +1 -1
- package/agnostic/misc/logs/make-text-block/index.js +1 -1
- package/agnostic/misc/logs/styles/index.js +1 -1
- package/agnostic/misc/lorem-ipsum/index.js +9 -9
- package/agnostic/misc/normalize-extension/index.js +1 -1
- package/agnostic/misc/outcome/index.js +1 -1
- package/agnostic/numbers/absolute-modulo/index.js +1 -1
- package/agnostic/numbers/clamp/index.js +1 -1
- package/agnostic/numbers/index.js +6 -6
- package/agnostic/numbers/interpolate/index.js +1 -1
- package/agnostic/numbers/responsive-harmonics/index.js +1 -1
- package/agnostic/numbers/round/index.js +1 -1
- package/agnostic/objects/deep-get-property/index.js +1 -1
- package/agnostic/objects/enums/index.js +1 -1
- package/agnostic/objects/enums/is-in-enum/index.js +1 -1
- package/agnostic/objects/flatten-getters/index.js +1 -1
- package/agnostic/objects/index.js +10 -10
- package/agnostic/objects/is-object/index.js +1 -1
- package/agnostic/objects/is-record/index.js +1 -1
- package/agnostic/objects/record-format/index.js +1 -1
- package/agnostic/objects/record-map/index.js +1 -1
- package/agnostic/objects/validation/index.js +1 -1
- package/agnostic/optim/index.js +4 -4
- package/agnostic/optim/memoize/index.js +1 -1
- package/agnostic/optim/throttle-debounce/index.js +1 -1
- package/agnostic/random/hex-char/index.js +1 -1
- package/agnostic/random/index.js +1 -1
- package/agnostic/random/random/index.js +1 -1
- package/agnostic/random/uuid/index.js +1 -1
- package/agnostic/regexps/index.js +1 -1
- package/agnostic/sanitization/index.js +4 -1280
- package/agnostic/strings/char-codes/index.js +1 -1
- package/agnostic/strings/index.js +8 -8
- package/agnostic/strings/matches/index.js +1 -1
- package/agnostic/strings/normalize-indent/index.js +1 -1
- package/agnostic/strings/replace-all/index.js +1 -1
- package/agnostic/strings/to-alphanum/index.js +1 -1
- package/agnostic/strings/trim/index.js +1 -1
- package/agnostic/time/dates/format-date/index.js +1 -1
- package/agnostic/time/dates/index.js +1 -1
- package/agnostic/time/duration/index.js +1 -1
- package/agnostic/time/index.js +9 -9
- package/agnostic/time/timeout/index.js +1 -1
- package/agnostic/time/transitions/index.js +1 -1
- package/agnostic/time/wait/index.js +1 -1
- package/chunks/chunk-24ZUWYIR.js +42 -0
- package/chunks/chunk-2JH4TCT2.js +34 -0
- package/chunks/chunk-2RUBEK4A.js +2456 -0
- package/chunks/chunk-2VJ4QISD.js +28 -0
- package/chunks/chunk-2VXYXVV2.js +164 -0
- package/chunks/chunk-32FNUJVW.js +31 -0
- package/chunks/chunk-36CTYZYA.js +28 -0
- package/chunks/chunk-37TRFYZT.js +35 -0
- package/chunks/chunk-3CGRUS5C.js +37 -0
- package/chunks/chunk-3CLGBOHN.js +29 -0
- package/chunks/chunk-3DL3U7UR.js +40 -0
- package/chunks/chunk-3G7KHSKB.js +60 -0
- package/chunks/chunk-3TKBCG7Y.js +40 -0
- package/chunks/chunk-42K3MQQ5.js +31 -0
- package/chunks/chunk-4A2IILES.js +16 -0
- package/chunks/chunk-4WM6K5IZ.js +30 -0
- package/chunks/chunk-4XBUJAQU.js +71 -0
- package/chunks/chunk-4XSDRT23.js +67 -0
- package/chunks/chunk-55EDDDIA.js +16 -0
- package/chunks/chunk-56OEXCBD.js +60 -0
- package/chunks/chunk-5YIC7NDS.js +18 -0
- package/chunks/chunk-5ZJ3KJPK.js +44 -0
- package/chunks/chunk-646R6BQZ.js +42 -0
- package/chunks/chunk-6ET4XJLF.js +40 -0
- package/chunks/chunk-6IYUA43Q.js +43 -0
- package/chunks/chunk-6NLNUGBI.js +42 -0
- package/chunks/chunk-6PIGLFM3.js +191 -0
- package/chunks/chunk-6SXCNPJ2.js +177 -0
- package/chunks/chunk-766BSKLU.js +2456 -0
- package/chunks/chunk-7J7CYOXU.js +36 -0
- package/chunks/chunk-A5XT7AXP.js +151 -0
- package/chunks/chunk-AHSYVIOF.js +18 -0
- package/chunks/chunk-ANPXBD2G.js +35 -0
- package/chunks/chunk-B446JIN3.js +29 -0
- package/chunks/chunk-BD56ZAYF.js +28 -0
- package/chunks/chunk-BE7OXZRK.js +42 -0
- package/chunks/chunk-BQMQIW77.js +69 -0
- package/chunks/chunk-BSUQNHAM.js +44 -0
- package/chunks/chunk-BWYH445G.js +43 -0
- package/chunks/chunk-C6QTHDDM.js +52 -0
- package/chunks/chunk-CA3UPHYO.js +42 -0
- package/chunks/chunk-CHUOCTRP.js +26 -0
- package/chunks/chunk-CNYSX2L2.js +38 -0
- package/chunks/chunk-CVDCTI7F.js +47 -0
- package/chunks/chunk-CWZFRUBS.js +41 -0
- package/chunks/chunk-DABLUUMY.js +24 -0
- package/chunks/chunk-DAOJPBZ6.js +18 -0
- package/chunks/chunk-DHCDZVLA.js +19 -0
- package/chunks/chunk-DPQRXSZH.js +42 -0
- package/chunks/chunk-DTETQT5O.js +15 -0
- package/chunks/chunk-E3F7QTXR.js +141 -0
- package/chunks/chunk-EOTOFHUR.js +42 -0
- package/chunks/chunk-F6CB5TEO.js +151 -0
- package/chunks/chunk-FB3GNE2B.js +48 -0
- package/chunks/chunk-FD5WR2A5.js +63 -0
- package/chunks/chunk-FE4DECBU.js +42 -0
- package/chunks/chunk-FF5NURFO.js +32 -0
- package/chunks/chunk-FJ3NTVCG.js +18 -0
- package/chunks/chunk-FNJX5BML.js +23 -0
- package/chunks/chunk-FS6LRTDK.js +42 -0
- package/chunks/chunk-G5RRNREY.js +37 -0
- package/chunks/chunk-GRDFCI63.js +21 -0
- package/chunks/chunk-H4LW6FP3.js +42 -0
- package/chunks/chunk-H5O26IRG.js +28 -0
- package/chunks/chunk-HFV7VACE.js +191 -0
- package/chunks/chunk-HGSQCJ55.js +65 -0
- package/chunks/chunk-HRNDUTZE.js +46 -0
- package/chunks/chunk-HWEGQVBQ.js +32 -0
- package/chunks/chunk-HWVEI3RH.js +31 -0
- package/chunks/chunk-IIMP6YT7.js +56 -0
- package/chunks/chunk-INGSSBWK.js +40 -0
- package/chunks/chunk-IPLOZP7L.js +20 -0
- package/chunks/chunk-IUURENUN.js +22 -0
- package/chunks/chunk-IV75M3KE.js +38 -0
- package/chunks/chunk-IWWAMCNR.js +16 -0
- package/chunks/chunk-IWZAUQGO.js +40 -0
- package/chunks/chunk-JUF5GSDE.js +37 -0
- package/chunks/chunk-JWF5EKM2.js +127 -0
- package/chunks/chunk-KBFSUJ57.js +40 -0
- package/chunks/chunk-KJAEVOIW.js +42 -0
- package/chunks/chunk-LFSYWGO5.js +31 -0
- package/chunks/chunk-LMPEBXSU.js +31 -0
- package/chunks/chunk-MAOVZE34.js +20 -0
- package/chunks/chunk-N2T672IG.js +62 -0
- package/chunks/chunk-N32W4UQ6.js +16 -0
- package/chunks/chunk-NMYVJJXV.js +47 -0
- package/chunks/chunk-NOLQR5RW.js +42 -0
- package/chunks/chunk-OA7Y2A5T.js +42 -0
- package/chunks/chunk-OD7GR6ZF.js +56 -0
- package/chunks/chunk-ON6LC3HE.js +84 -0
- package/chunks/chunk-PAIUCLVK.js +35 -0
- package/chunks/chunk-QCOO4PV5.js +54 -0
- package/chunks/chunk-QDVDHFMZ.js +39 -0
- package/chunks/chunk-QH64MYGA.js +45 -0
- package/chunks/chunk-QLDN574K.js +39 -0
- package/chunks/chunk-QLOMT4DL.js +21 -0
- package/chunks/chunk-QPHK5QI7.js +4072 -0
- package/chunks/chunk-QVPS2BCJ.js +29 -0
- package/chunks/chunk-QWFEYLHG.js +79 -0
- package/chunks/chunk-QWZ4ZNFA.js +63 -0
- package/chunks/chunk-RTUTFCLC.js +40 -0
- package/chunks/chunk-RWO53U4X.js +39 -0
- package/chunks/chunk-SA2IY5LN.js +35 -0
- package/chunks/chunk-SX4DSRPU.js +24 -0
- package/chunks/chunk-TGVYEQIA.js +38 -0
- package/chunks/chunk-UBCUVSEV.js +35 -0
- package/chunks/chunk-UK2F7CWI.js +29 -0
- package/chunks/chunk-UK4HNSEJ.js +42 -0
- package/chunks/chunk-V3GX7SIJ.js +28 -0
- package/chunks/chunk-V3L55I2S.js +43 -0
- package/chunks/chunk-VROZGPC5.js +45 -0
- package/chunks/chunk-W3RXHN5I.js +38 -0
- package/chunks/chunk-WAHPAZQS.js +60 -0
- package/chunks/chunk-WHAUJMMG.js +32 -0
- package/chunks/chunk-WJ3XV35I.js +28 -0
- package/chunks/chunk-WJYMX7SS.js +21 -0
- package/chunks/chunk-X33GT7VY.js +28 -0
- package/chunks/chunk-XFMKYZKH.js +164 -0
- package/chunks/chunk-XRUSQWPJ.js +173 -0
- package/chunks/chunk-YKPA3MQL.js +31 -0
- package/chunks/chunk-YY6DTDMO.js +177 -0
- package/chunks/chunk-ZEZCYPLQ.js +43 -0
- package/chunks/chunk-ZJTWDCNZ.js +34 -0
- package/chunks/chunk-ZSUG52DO.js +40 -0
- package/components/Comp/index.js +1 -1
- package/node/@aws-s3/index.js +15 -5
- package/node/@aws-s3/storage/directory/copy-dir/index.d.ts +35 -0
- package/node/@aws-s3/storage/directory/copy-dir/index.js +9 -0
- package/node/@aws-s3/storage/directory/index.d.ts +5 -0
- package/node/@aws-s3/storage/directory/index.js +22 -0
- package/node/@aws-s3/storage/directory/list/index.d.ts +17 -0
- package/node/@aws-s3/storage/directory/list/index.js +9 -0
- package/node/@aws-s3/storage/directory/move-dir/index.d.ts +33 -0
- package/node/@aws-s3/storage/directory/move-dir/index.js +9 -0
- package/node/@aws-s3/storage/directory/remove-dir/index.d.ts +31 -0
- package/node/@aws-s3/storage/directory/remove-dir/index.js +9 -0
- package/node/@aws-s3/storage/file/copy/index.d.ts +30 -0
- package/node/@aws-s3/storage/file/copy/index.js +9 -0
- package/node/@aws-s3/storage/file/download/index.d.ts +15 -15
- package/node/@aws-s3/storage/file/download/index.js +2 -2
- package/node/@aws-s3/storage/file/exists/index.d.ts +23 -0
- package/node/@aws-s3/storage/file/exists/index.js +9 -0
- package/node/@aws-s3/storage/file/index.d.ts +6 -1
- package/node/@aws-s3/storage/file/index.js +25 -5
- package/node/@aws-s3/storage/file/move/index.d.ts +33 -0
- package/node/@aws-s3/storage/file/move/index.js +9 -0
- package/node/@aws-s3/storage/file/remove/index.d.ts +17 -0
- package/node/@aws-s3/storage/file/remove/index.js +9 -0
- package/node/@aws-s3/storage/file/stat/index.d.ts +24 -0
- package/node/@aws-s3/storage/file/stat/index.js +9 -0
- package/node/@aws-s3/storage/file/upload/index.d.ts +13 -19
- package/node/@aws-s3/storage/file/upload/index.js +2 -2
- package/node/@aws-s3/storage/index.d.ts +2 -1
- package/node/@aws-s3/storage/index.js +18 -5
- package/node/@design-edito/index.js +1 -1
- package/node/@express/@multer/index.js +2 -2
- package/node/@express/index.js +2 -2
- package/node/@google-cloud/index.js +22 -17
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +2 -2
- package/node/@google-cloud/storage/bucket/index.d.ts +4 -2
- package/node/@google-cloud/storage/bucket/index.js +15 -7
- package/node/@google-cloud/storage/directory/copy-dir/index.d.ts +22 -0
- package/node/@google-cloud/storage/directory/copy-dir/index.js +9 -0
- package/node/@google-cloud/storage/directory/index.d.ts +5 -0
- package/node/@google-cloud/storage/directory/index.js +22 -0
- package/node/@google-cloud/storage/directory/list/index.d.ts +17 -0
- package/node/@google-cloud/storage/directory/list/index.js +9 -0
- package/node/@google-cloud/storage/directory/move-dir/index.d.ts +31 -0
- package/node/@google-cloud/storage/directory/move-dir/index.js +9 -0
- package/node/@google-cloud/storage/directory/remove-dir/index.d.ts +31 -0
- package/node/@google-cloud/storage/directory/remove-dir/index.js +9 -0
- package/node/@google-cloud/storage/file/copy/index.d.ts +21 -10
- package/node/@google-cloud/storage/file/copy/index.js +2 -2
- package/node/@google-cloud/storage/file/download/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/download/index.js +2 -2
- package/node/@google-cloud/storage/file/exists/index.js +2 -2
- package/node/@google-cloud/storage/file/generate-signed-url/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/generate-signed-url/index.js +2 -2
- package/node/@google-cloud/storage/file/get-metadata/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/get-metadata/index.js +2 -2
- package/node/@google-cloud/storage/file/get-permissions/index.d.ts +2 -2
- package/node/@google-cloud/storage/file/get-permissions/index.js +2 -2
- package/node/@google-cloud/storage/file/index.d.ts +3 -2
- package/node/@google-cloud/storage/file/index.js +26 -22
- package/node/@google-cloud/storage/file/move/index.d.ts +24 -12
- package/node/@google-cloud/storage/file/move/index.js +2 -2
- package/node/@google-cloud/storage/file/remove/index.d.ts +24 -0
- package/node/@google-cloud/storage/file/remove/index.js +9 -0
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.d.ts +6 -6
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +5 -5
- package/node/@google-cloud/storage/file/stat/index.d.ts +25 -0
- package/node/@google-cloud/storage/file/stat/index.js +9 -0
- package/node/@google-cloud/storage/file/update-metadata/index.d.ts +3 -3
- package/node/@google-cloud/storage/file/update-metadata/index.js +2 -2
- package/node/@google-cloud/storage/file/upload/index.d.ts +5 -6
- package/node/@google-cloud/storage/file/upload/index.js +2 -2
- package/node/@google-cloud/storage/index.d.ts +2 -1
- package/node/@google-cloud/storage/index.js +25 -17
- package/node/cloud-storage/clients/index.d.ts +13 -0
- package/node/cloud-storage/clients/index.js +13 -0
- package/node/cloud-storage/index.d.ts +2 -4
- package/node/cloud-storage/index.js +60 -24
- package/node/cloud-storage/operations/copy-dir/index.d.ts +15 -0
- package/node/cloud-storage/operations/copy-dir/index.js +14 -0
- package/node/cloud-storage/operations/copy-file/index.d.ts +15 -0
- package/node/cloud-storage/operations/copy-file/index.js +14 -0
- package/node/cloud-storage/operations/download-file/index.d.ts +16 -0
- package/node/cloud-storage/operations/download-file/index.js +14 -0
- package/node/cloud-storage/operations/exists-file/index.d.ts +13 -0
- package/node/cloud-storage/operations/exists-file/index.js +14 -0
- package/node/cloud-storage/operations/index.d.ts +12 -3
- package/node/cloud-storage/operations/index.js +91 -19
- package/node/cloud-storage/operations/list-dir/index.d.ts +13 -0
- package/node/cloud-storage/operations/list-dir/index.js +14 -0
- package/node/cloud-storage/operations/move-dir/index.d.ts +15 -0
- package/node/cloud-storage/operations/move-dir/index.js +14 -0
- package/node/cloud-storage/operations/move-file/index.d.ts +15 -0
- package/node/cloud-storage/operations/move-file/index.js +14 -0
- package/node/cloud-storage/operations/remove-dir/index.d.ts +15 -0
- package/node/cloud-storage/operations/remove-dir/index.js +14 -0
- package/node/cloud-storage/operations/remove-file/index.d.ts +15 -0
- package/node/cloud-storage/operations/remove-file/index.js +14 -0
- package/node/cloud-storage/operations/stat-file/index.d.ts +15 -0
- package/node/cloud-storage/operations/stat-file/index.js +14 -0
- package/node/cloud-storage/operations/upload-file/index.d.ts +16 -0
- package/node/cloud-storage/operations/upload-file/index.js +14 -0
- package/node/encryption/@aes-256-gcm/buffer/index.js +3 -3
- package/node/encryption/@aes-256-gcm/index.js +4 -4
- package/node/encryption/@aes-256-gcm/uint8-array/index.js +2 -2
- package/node/encryption/index.js +7 -7
- package/node/encryption/key/index.js +2 -2
- package/node/files/index.js +4 -4
- package/node/files/is-in-directory/index.js +1 -1
- package/node/files/read-write/index.js +1 -1
- package/node/files/subpaths/index.js +1 -1
- package/node/ftps/directory/copy-dir/index.d.ts +28 -0
- package/node/ftps/directory/copy-dir/index.js +9 -0
- package/node/ftps/directory/index.d.ts +5 -0
- package/node/ftps/directory/index.js +22 -0
- package/node/ftps/directory/list/index.d.ts +12 -0
- package/node/ftps/directory/list/index.js +9 -0
- package/node/ftps/directory/move-dir/index.d.ts +26 -0
- package/node/ftps/directory/move-dir/index.js +9 -0
- package/node/ftps/directory/remove-dir/index.d.ts +25 -0
- package/node/ftps/directory/remove-dir/index.js +9 -0
- package/node/ftps/file/copy/index.d.ts +28 -0
- package/node/ftps/file/copy/index.js +9 -0
- package/node/ftps/file/download/index.d.ts +2 -2
- package/node/ftps/file/download/index.js +2 -2
- package/node/ftps/file/exists/index.d.ts +21 -0
- package/node/ftps/file/exists/index.js +9 -0
- package/node/ftps/file/index.d.ts +6 -1
- package/node/ftps/file/index.js +25 -5
- package/node/ftps/file/move/index.d.ts +38 -0
- package/node/ftps/file/move/index.js +9 -0
- package/node/ftps/file/remove/index.d.ts +20 -0
- package/node/ftps/file/remove/index.js +9 -0
- package/node/ftps/file/stat/index.d.ts +17 -0
- package/node/ftps/file/stat/index.js +9 -0
- package/node/ftps/file/upload/index.d.ts +3 -3
- package/node/ftps/file/upload/index.js +2 -2
- package/node/ftps/index.d.ts +2 -1
- package/node/ftps/index.js +17 -4
- package/node/images/format/index.js +3 -3
- package/node/images/index.js +38 -38
- package/node/images/prepare/index.js +38 -38
- package/node/images/transform/_utils/color-schema/index.js +3 -3
- package/node/images/transform/_utils/operation-names/index.js +1 -1
- package/node/images/transform/_utils/positions/index.js +3 -3
- package/node/images/transform/blur/index.js +3 -3
- package/node/images/transform/brighten/index.js +3 -3
- package/node/images/transform/compose/index.js +5 -5
- package/node/images/transform/extend/index.js +4 -4
- package/node/images/transform/extract/index.js +3 -3
- package/node/images/transform/flatten/index.js +4 -4
- package/node/images/transform/flip/index.js +3 -3
- package/node/images/transform/flop/index.js +3 -3
- package/node/images/transform/frame/backgrounds/create-line-background/index.d.ts +2 -2
- package/node/images/transform/frame/backgrounds/create-line-background/index.js +3 -3
- package/node/images/transform/frame/backgrounds/create-tile-background/index.d.ts +2 -2
- package/node/images/transform/frame/backgrounds/create-tile-background/index.js +3 -3
- package/node/images/transform/frame/index.js +7 -7
- package/node/images/transform/hue-rotate/index.js +3 -3
- package/node/images/transform/index.js +36 -36
- package/node/images/transform/lighten/index.js +3 -3
- package/node/images/transform/lineate-levels/index.js +3 -3
- package/node/images/transform/modulate/index.js +3 -3
- package/node/images/transform/normalize/index.js +3 -3
- package/node/images/transform/operations/_utils/compose/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/backgrounds/create-line-background/index.js +5 -5
- package/node/images/transform/operations/_utils/frame/backgrounds/create-tile-background/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/create-color-palette/index.js +6 -6
- package/node/images/transform/operations/_utils/frame/extract-colors-from-image/index.js +1 -1
- package/node/images/transform/operations/_utils/frame/index.js +10 -10
- package/node/images/transform/operations/_utils/positions/index.js +1 -1
- package/node/images/transform/operations/_utils/scale/index.js +1 -1
- package/node/images/transform/resize/index.js +4 -4
- package/node/images/transform/rotate/index.js +3 -3
- package/node/images/transform/saturate/index.js +3 -3
- package/node/images/transform/scale/index.js +4 -4
- package/node/process/index.js +1 -1
- package/node/process/on-exit/index.js +1 -1
- package/node/sftp/directory/copy-dir/index.d.ts +28 -0
- package/node/sftp/directory/copy-dir/index.js +9 -0
- package/node/sftp/directory/index.d.ts +5 -0
- package/node/sftp/directory/index.js +22 -0
- package/node/sftp/directory/list/index.d.ts +12 -0
- package/node/sftp/directory/list/index.js +9 -0
- package/node/sftp/directory/move-dir/index.d.ts +26 -0
- package/node/sftp/directory/move-dir/index.js +9 -0
- package/node/sftp/directory/remove-dir/index.d.ts +25 -0
- package/node/sftp/directory/remove-dir/index.js +9 -0
- package/node/sftp/file/copy/index.d.ts +28 -0
- package/node/sftp/file/copy/index.js +9 -0
- package/node/sftp/file/download/index.d.ts +2 -2
- package/node/sftp/file/download/index.js +2 -2
- package/node/sftp/file/exists/index.d.ts +21 -0
- package/node/sftp/file/exists/index.js +9 -0
- package/node/sftp/file/index.d.ts +6 -1
- package/node/sftp/file/index.js +25 -5
- package/node/sftp/file/move/index.d.ts +38 -0
- package/node/sftp/file/move/index.js +9 -0
- package/node/sftp/file/remove/index.d.ts +20 -0
- package/node/sftp/file/remove/index.js +9 -0
- package/node/sftp/file/stat/index.d.ts +18 -0
- package/node/sftp/file/stat/index.js +9 -0
- package/node/sftp/file/upload/index.d.ts +3 -3
- package/node/sftp/file/upload/index.js +2 -2
- package/node/sftp/index.d.ts +2 -1
- package/node/sftp/index.js +17 -4
- package/package.json +3 -2
@@ -0,0 +1,47 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-JMU5PDBD.js";
|
4
|
+
import {
|
5
|
+
unknownToString
|
6
|
+
} from "./chunk-FENXVJYO.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-WSFCRVEQ.js";
|
10
|
+
|
11
|
+
// src/node/ftps/file/upload/index.ts
|
12
|
+
var upload_exports = {};
|
13
|
+
__export(upload_exports, {
|
14
|
+
upload: () => upload
|
15
|
+
});
|
16
|
+
async function upload(ftpClient, targetPath, fileStream, options) {
|
17
|
+
const {
|
18
|
+
ensureDir = true,
|
19
|
+
overwrite = false
|
20
|
+
} = options ?? {};
|
21
|
+
try {
|
22
|
+
if (ensureDir) {
|
23
|
+
const dirPath = targetPath.substring(0, targetPath.lastIndexOf("/"));
|
24
|
+
await ftpClient.ensureDir(dirPath);
|
25
|
+
}
|
26
|
+
let fileExists = false;
|
27
|
+
try {
|
28
|
+
await ftpClient.size(targetPath);
|
29
|
+
fileExists = true;
|
30
|
+
} catch {
|
31
|
+
fileExists = false;
|
32
|
+
}
|
33
|
+
if (fileExists && !overwrite) {
|
34
|
+
return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
35
|
+
}
|
36
|
+
await ftpClient.uploadFrom(fileStream, targetPath, options);
|
37
|
+
return Outcome.makeSuccess(true);
|
38
|
+
} catch (err) {
|
39
|
+
const errStr = unknownToString(err);
|
40
|
+
return Outcome.makeFailure(errStr);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
export {
|
45
|
+
upload,
|
46
|
+
upload_exports
|
47
|
+
};
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-JMU5PDBD.js";
|
4
|
+
import {
|
5
|
+
unknownToString
|
6
|
+
} from "./chunk-FENXVJYO.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-WSFCRVEQ.js";
|
10
|
+
|
11
|
+
// src/node/@google-cloud/storage/file/copy/index.ts
|
12
|
+
var copy_exports = {};
|
13
|
+
__export(copy_exports, {
|
14
|
+
copy: () => copy
|
15
|
+
});
|
16
|
+
async function copy(bucket, sourcePath, targetPath, options) {
|
17
|
+
const {
|
18
|
+
fileOptions,
|
19
|
+
copyOptions,
|
20
|
+
overwrite = false
|
21
|
+
} = options ?? {};
|
22
|
+
try {
|
23
|
+
const srcFile = bucket.file(sourcePath, fileOptions);
|
24
|
+
const destFile = bucket.file(targetPath, fileOptions);
|
25
|
+
if (!overwrite) {
|
26
|
+
const [destExists] = await destFile.exists();
|
27
|
+
if (destExists) {
|
28
|
+
return Outcome.makeFailure(`Object already exists at ${targetPath}.`);
|
29
|
+
}
|
30
|
+
}
|
31
|
+
await srcFile.copy(destFile, copyOptions);
|
32
|
+
return Outcome.makeSuccess(true);
|
33
|
+
} catch (err) {
|
34
|
+
return Outcome.makeFailure(unknownToString(err));
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
export {
|
39
|
+
copy,
|
40
|
+
copy_exports
|
41
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import {
|
2
|
+
bucket_exports
|
3
|
+
} from "./chunk-BD56ZAYF.js";
|
4
|
+
import {
|
5
|
+
directory_exports
|
6
|
+
} from "./chunk-WJ3XV35I.js";
|
7
|
+
import {
|
8
|
+
file_exports
|
9
|
+
} from "./chunk-3G7KHSKB.js";
|
10
|
+
import {
|
11
|
+
__export
|
12
|
+
} from "./chunk-WSFCRVEQ.js";
|
13
|
+
|
14
|
+
// src/node/@google-cloud/storage/index.ts
|
15
|
+
var storage_exports = {};
|
16
|
+
__export(storage_exports, {
|
17
|
+
Bucket: () => bucket_exports,
|
18
|
+
Directory: () => directory_exports,
|
19
|
+
File: () => file_exports
|
20
|
+
});
|
21
|
+
|
22
|
+
export {
|
23
|
+
storage_exports
|
24
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import {
|
2
|
+
OperationNames
|
3
|
+
} from "./chunk-MOVLLUDL.js";
|
4
|
+
import {
|
5
|
+
esm_default
|
6
|
+
} from "./chunk-QPHK5QI7.js";
|
7
|
+
|
8
|
+
// src/node/images/transform/flop/index.ts
|
9
|
+
var flopSchema = esm_default.object({
|
10
|
+
name: esm_default.literal(OperationNames.Flop),
|
11
|
+
params: esm_default.object({
|
12
|
+
flop: esm_default.boolean().optional()
|
13
|
+
})
|
14
|
+
});
|
15
|
+
|
16
|
+
export {
|
17
|
+
flopSchema
|
18
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import {
|
2
|
+
OperationNames
|
3
|
+
} from "./chunk-MOVLLUDL.js";
|
4
|
+
import {
|
5
|
+
esm_default
|
6
|
+
} from "./chunk-QPHK5QI7.js";
|
7
|
+
|
8
|
+
// src/node/images/transform/normalize/index.ts
|
9
|
+
var normalizeSchema = esm_default.object({
|
10
|
+
name: esm_default.literal(OperationNames.Normalize),
|
11
|
+
params: esm_default.object({
|
12
|
+
lower: esm_default.number(),
|
13
|
+
upper: esm_default.number()
|
14
|
+
})
|
15
|
+
});
|
16
|
+
|
17
|
+
export {
|
18
|
+
normalizeSchema
|
19
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import {
|
2
|
+
list as list4
|
3
|
+
} from "./chunk-37TRFYZT.js";
|
4
|
+
import {
|
5
|
+
list as list3
|
6
|
+
} from "./chunk-ZSUG52DO.js";
|
7
|
+
import {
|
8
|
+
list as list2
|
9
|
+
} from "./chunk-UK2F7CWI.js";
|
10
|
+
import {
|
11
|
+
list
|
12
|
+
} from "./chunk-3CLGBOHN.js";
|
13
|
+
import {
|
14
|
+
isFtpClient,
|
15
|
+
isGcsBucket,
|
16
|
+
isS3ClientWithBucket,
|
17
|
+
isSftpClient
|
18
|
+
} from "./chunk-V3GX7SIJ.js";
|
19
|
+
import {
|
20
|
+
Outcome
|
21
|
+
} from "./chunk-JMU5PDBD.js";
|
22
|
+
import {
|
23
|
+
__export
|
24
|
+
} from "./chunk-WSFCRVEQ.js";
|
25
|
+
|
26
|
+
// src/node/cloud-storage/operations/list-dir/index.ts
|
27
|
+
var list_dir_exports = {};
|
28
|
+
__export(list_dir_exports, {
|
29
|
+
listDir: () => listDir
|
30
|
+
});
|
31
|
+
async function listDir(client, path, options) {
|
32
|
+
if (isGcsBucket(client)) return list4(client, path, options);
|
33
|
+
if (isS3ClientWithBucket(client)) return list3(client.client, client.bucketName, path, options);
|
34
|
+
if (isFtpClient(client)) return list(client, path);
|
35
|
+
if (isSftpClient(client)) return list2(client, path);
|
36
|
+
return Outcome.makeFailure("Invalid client type");
|
37
|
+
}
|
38
|
+
|
39
|
+
export {
|
40
|
+
listDir,
|
41
|
+
list_dir_exports
|
42
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import {
|
2
|
+
esm_default
|
3
|
+
} from "./chunk-QPHK5QI7.js";
|
4
|
+
|
5
|
+
// src/node/images/transform/_utils/color-schema/index.ts
|
6
|
+
var colorSchema = esm_default.object({
|
7
|
+
r: esm_default.number().min(0).max(255),
|
8
|
+
g: esm_default.number().min(0).max(255),
|
9
|
+
b: esm_default.number().min(0).max(255),
|
10
|
+
alpha: esm_default.number().min(0).max(1)
|
11
|
+
}).or(esm_default.string().length(7));
|
12
|
+
|
13
|
+
export {
|
14
|
+
colorSchema
|
15
|
+
};
|
@@ -0,0 +1,141 @@
|
|
1
|
+
import {
|
2
|
+
esm_default
|
3
|
+
} from "./chunk-QPHK5QI7.js";
|
4
|
+
import {
|
5
|
+
Outcome
|
6
|
+
} from "./chunk-JMU5PDBD.js";
|
7
|
+
import {
|
8
|
+
clamp
|
9
|
+
} from "./chunk-OSAXBA7G.js";
|
10
|
+
import {
|
11
|
+
__export
|
12
|
+
} from "./chunk-WSFCRVEQ.js";
|
13
|
+
|
14
|
+
// src/node/images/format/index.ts
|
15
|
+
var format_exports = {};
|
16
|
+
__export(format_exports, {
|
17
|
+
format: () => format,
|
18
|
+
formatImage: () => formatImage,
|
19
|
+
isFormatAvifOptions: () => isFormatAvifOptions,
|
20
|
+
isFormatCommonOptions: () => isFormatCommonOptions,
|
21
|
+
isFormatHeifOptions: () => isFormatHeifOptions,
|
22
|
+
isFormatJpgOptions: () => isFormatJpgOptions,
|
23
|
+
isFormatKeepOptions: () => isFormatKeepOptions,
|
24
|
+
isFormatOptions: () => isFormatOptions,
|
25
|
+
isFormatPngOptions: () => isFormatPngOptions,
|
26
|
+
isFormatTiffOptions: () => isFormatTiffOptions,
|
27
|
+
isFormatWebpOptions: () => isFormatWebpOptions,
|
28
|
+
toAvif: () => toAvif,
|
29
|
+
toHeif: () => toHeif,
|
30
|
+
toHeight: () => toHeight,
|
31
|
+
toJpg: () => toJpg,
|
32
|
+
toPng: () => toPng,
|
33
|
+
toTiff: () => toTiff,
|
34
|
+
toWebp: () => toWebp,
|
35
|
+
toWidth: () => toWidth
|
36
|
+
});
|
37
|
+
import sharp from "sharp";
|
38
|
+
async function formatImage(imageBuffer, outputOptions) {
|
39
|
+
const { width, height, quality, format: format2 } = outputOptions;
|
40
|
+
const sharpInstance = sharp(imageBuffer).resize({
|
41
|
+
width,
|
42
|
+
height,
|
43
|
+
fit: sharp.fit.cover
|
44
|
+
});
|
45
|
+
let withQuality = sharpInstance;
|
46
|
+
if (format2 === "png") {
|
47
|
+
withQuality = withQuality.png({ quality });
|
48
|
+
} else if (format2 === "jpeg") {
|
49
|
+
withQuality = withQuality.jpeg({ quality });
|
50
|
+
} else if (format2 === "webp") {
|
51
|
+
withQuality = withQuality.webp({ quality });
|
52
|
+
} else if (format2 === "avif") {
|
53
|
+
withQuality = withQuality.avif({ quality });
|
54
|
+
}
|
55
|
+
let buffer = Buffer.from([]);
|
56
|
+
try {
|
57
|
+
buffer = await withQuality.toBuffer();
|
58
|
+
} catch (e) {
|
59
|
+
console.log("Images:Exports:Error", { e });
|
60
|
+
}
|
61
|
+
return buffer;
|
62
|
+
}
|
63
|
+
var formatCommonOptionsSchema = esm_default.object({
|
64
|
+
width: esm_default.number().optional(),
|
65
|
+
height: esm_default.number().optional(),
|
66
|
+
fit: esm_default.enum(["contain", "cover", "fill", "inside", "outside"]).optional()
|
67
|
+
});
|
68
|
+
var formatJpgOptionsSchema = formatCommonOptionsSchema.extend({ quality: esm_default.number().optional() });
|
69
|
+
var formatPngOptionsSchema = formatCommonOptionsSchema.extend({
|
70
|
+
quality: esm_default.number().optional(),
|
71
|
+
compressionLevel: esm_default.number().optional()
|
72
|
+
});
|
73
|
+
var formatWebpOptionsSchema = formatCommonOptionsSchema.extend({ quality: esm_default.number().optional() });
|
74
|
+
var formatAvifOptionsSchema = formatCommonOptionsSchema.extend({ quality: esm_default.number().optional() });
|
75
|
+
var formatTiffOptionsSchema = formatCommonOptionsSchema.extend({
|
76
|
+
quality: esm_default.number().optional(),
|
77
|
+
compression: esm_default.enum(["none", "jpeg", "deflate", "packbits", "ccittfax4", "lzw", "webp", "zstd", "jp2k"]).optional()
|
78
|
+
});
|
79
|
+
var formatHeifOptionsSchema = formatCommonOptionsSchema.extend({ quality: esm_default.number().optional() });
|
80
|
+
var formatKeepOptionsSchema = formatCommonOptionsSchema;
|
81
|
+
var formatOptionsSchema = esm_default.union([
|
82
|
+
formatJpgOptionsSchema,
|
83
|
+
formatPngOptionsSchema,
|
84
|
+
formatWebpOptionsSchema,
|
85
|
+
formatAvifOptionsSchema,
|
86
|
+
formatTiffOptionsSchema,
|
87
|
+
formatHeifOptionsSchema,
|
88
|
+
formatKeepOptionsSchema
|
89
|
+
]);
|
90
|
+
var isFormatCommonOptions = (options) => formatCommonOptionsSchema.safeParse(options).success;
|
91
|
+
var isFormatJpgOptions = (options) => formatJpgOptionsSchema.safeParse(options).success;
|
92
|
+
var isFormatPngOptions = (options) => formatPngOptionsSchema.safeParse(options).success;
|
93
|
+
var isFormatWebpOptions = (options) => formatWebpOptionsSchema.safeParse(options).success;
|
94
|
+
var isFormatAvifOptions = (options) => formatAvifOptionsSchema.safeParse(options).success;
|
95
|
+
var isFormatTiffOptions = (options) => formatTiffOptionsSchema.safeParse(options).success;
|
96
|
+
var isFormatHeifOptions = (options) => formatHeifOptionsSchema.safeParse(options).success;
|
97
|
+
var isFormatKeepOptions = (options) => formatKeepOptionsSchema.safeParse(options).success;
|
98
|
+
var isFormatOptions = (options) => formatOptionsSchema.safeParse(options).success;
|
99
|
+
async function format(input, typeOrOptions, options) {
|
100
|
+
const sharpInstance = sharp(input);
|
101
|
+
if (typeof typeOrOptions !== "string") return Outcome.makeSuccess(await sharpInstance.resize(typeOrOptions).toBuffer());
|
102
|
+
const type = typeOrOptions;
|
103
|
+
if (type === "jpg" || type === "jpeg") return Outcome.makeSuccess(await sharpInstance.jpeg(options).toBuffer());
|
104
|
+
if (type === "png") return Outcome.makeSuccess(await sharpInstance.png(options).toBuffer());
|
105
|
+
if (type === "webp") return Outcome.makeSuccess(await sharpInstance.webp(options).toBuffer());
|
106
|
+
if (type === "avif") return Outcome.makeSuccess(await sharpInstance.avif(options).toBuffer());
|
107
|
+
if (type === "tiff") return Outcome.makeSuccess(await sharpInstance.tiff(options).toBuffer());
|
108
|
+
if (type === "heif") return Outcome.makeSuccess(await sharpInstance.heif(options).toBuffer());
|
109
|
+
return Outcome.makeFailure(`Invalid image format: ${type}`);
|
110
|
+
}
|
111
|
+
var toWidth = async (input, width) => sharp(input).resize({ width }).toBuffer();
|
112
|
+
var toHeight = async (input, height) => sharp(input).resize({ height }).toBuffer();
|
113
|
+
var toJpg = async (input, quality) => sharp(input).jpeg({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
|
114
|
+
var toPng = async (input, quality, compressionLevel) => sharp(input).png({ quality: clamp(quality ?? 100, 1, 100), compressionLevel }).toBuffer();
|
115
|
+
var toWebp = async (input, quality) => sharp(input).webp({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
|
116
|
+
var toAvif = async (input, quality) => sharp(input).avif({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
|
117
|
+
var toTiff = async (input, quality, compression) => sharp(input).tiff({ quality: clamp(quality ?? 100, 1, 100), compression }).toBuffer();
|
118
|
+
var toHeif = async (input, quality) => sharp(input).heif({ quality: clamp(quality ?? 100, 1, 100) }).toBuffer();
|
119
|
+
|
120
|
+
export {
|
121
|
+
formatImage,
|
122
|
+
isFormatCommonOptions,
|
123
|
+
isFormatJpgOptions,
|
124
|
+
isFormatPngOptions,
|
125
|
+
isFormatWebpOptions,
|
126
|
+
isFormatAvifOptions,
|
127
|
+
isFormatTiffOptions,
|
128
|
+
isFormatHeifOptions,
|
129
|
+
isFormatKeepOptions,
|
130
|
+
isFormatOptions,
|
131
|
+
format,
|
132
|
+
toWidth,
|
133
|
+
toHeight,
|
134
|
+
toJpg,
|
135
|
+
toPng,
|
136
|
+
toWebp,
|
137
|
+
toAvif,
|
138
|
+
toTiff,
|
139
|
+
toHeif,
|
140
|
+
format_exports
|
141
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import {
|
2
|
+
download as download4
|
3
|
+
} from "./chunk-2JH4TCT2.js";
|
4
|
+
import {
|
5
|
+
download as download3
|
6
|
+
} from "./chunk-IV75M3KE.js";
|
7
|
+
import {
|
8
|
+
download as download2
|
9
|
+
} from "./chunk-HWEGQVBQ.js";
|
10
|
+
import {
|
11
|
+
download
|
12
|
+
} from "./chunk-FF5NURFO.js";
|
13
|
+
import {
|
14
|
+
isFtpClient,
|
15
|
+
isGcsBucket,
|
16
|
+
isS3ClientWithBucket,
|
17
|
+
isSftpClient
|
18
|
+
} from "./chunk-V3GX7SIJ.js";
|
19
|
+
import {
|
20
|
+
Outcome
|
21
|
+
} from "./chunk-JMU5PDBD.js";
|
22
|
+
import {
|
23
|
+
__export
|
24
|
+
} from "./chunk-WSFCRVEQ.js";
|
25
|
+
|
26
|
+
// src/node/cloud-storage/operations/download-file/index.ts
|
27
|
+
var download_file_exports = {};
|
28
|
+
__export(download_file_exports, {
|
29
|
+
downloadFile: () => downloadFile
|
30
|
+
});
|
31
|
+
async function downloadFile(client, path, options) {
|
32
|
+
if (isGcsBucket(client)) return download4(client, path, options);
|
33
|
+
if (isS3ClientWithBucket(client)) return download3(client.client, client.bucketName, path, options);
|
34
|
+
if (isFtpClient(client)) return download(client, path, options);
|
35
|
+
if (isSftpClient(client)) return download2(client, path, options);
|
36
|
+
return Outcome.makeFailure("Invalid client type");
|
37
|
+
}
|
38
|
+
|
39
|
+
export {
|
40
|
+
downloadFile,
|
41
|
+
download_file_exports
|
42
|
+
};
|
@@ -0,0 +1,151 @@
|
|
1
|
+
import {
|
2
|
+
formatImage
|
3
|
+
} from "./chunk-E3F7QTXR.js";
|
4
|
+
import {
|
5
|
+
transform
|
6
|
+
} from "./chunk-6SXCNPJ2.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-WSFCRVEQ.js";
|
10
|
+
|
11
|
+
// src/node/images/prepare/index.ts
|
12
|
+
var prepare_exports = {};
|
13
|
+
__export(prepare_exports, {
|
14
|
+
MAX_NB_OUTPUTS: () => MAX_NB_OUTPUTS,
|
15
|
+
OUTPUT_ZIP_FOLDER: () => OUTPUT_ZIP_FOLDER,
|
16
|
+
exportZipBuffer: () => exportZipBuffer,
|
17
|
+
prepareImage: () => prepareImage
|
18
|
+
});
|
19
|
+
import sharp from "sharp";
|
20
|
+
import { Writable } from "node:stream";
|
21
|
+
import archiver from "archiver";
|
22
|
+
var MAX_NB_OUTPUTS = 50;
|
23
|
+
var OUTPUT_ZIP_FOLDER = "./output-zips";
|
24
|
+
async function prepareImage(imageBuffer, customOptions) {
|
25
|
+
const sharpImage = sharp(imageBuffer);
|
26
|
+
const sharpImageMetadata = await sharpImage.metadata();
|
27
|
+
const imageBufferMetadata = {
|
28
|
+
width: sharpImageMetadata.width ?? 0,
|
29
|
+
height: sharpImageMetadata.height ?? 0,
|
30
|
+
format: sharpImageMetadata.format || "png"
|
31
|
+
};
|
32
|
+
const options = getOptions(imageBufferMetadata, customOptions);
|
33
|
+
const nbOutputs = options.qualities.length * (options.ratios.length + 1) * (options.widths.length + 1) * (options.heights.length + 1);
|
34
|
+
if (nbOutputs > MAX_NB_OUTPUTS) throw Error("Nb output exceeds supported max nb output");
|
35
|
+
let transformedBuffer = imageBuffer;
|
36
|
+
try {
|
37
|
+
transformedBuffer = await transform(imageBuffer, options.inputOperations, options.checkValidOperations);
|
38
|
+
} catch (e) {
|
39
|
+
console.log("Images:Prepare:Transform:Buffer:Error", { e });
|
40
|
+
}
|
41
|
+
const transformedBufferMetadata = await sharp(transformedBuffer).metadata();
|
42
|
+
const exportsBuffers = [
|
43
|
+
{
|
44
|
+
buffer: imageBuffer,
|
45
|
+
name: generateFileName({
|
46
|
+
...imageBufferMetadata,
|
47
|
+
quality: 100,
|
48
|
+
suffix: "original",
|
49
|
+
prefix: options.name
|
50
|
+
})
|
51
|
+
},
|
52
|
+
{
|
53
|
+
buffer: transformedBuffer,
|
54
|
+
name: generateFileName({
|
55
|
+
width: transformedBufferMetadata.width || 0,
|
56
|
+
height: transformedBufferMetadata.height || 0,
|
57
|
+
format: transformedBufferMetadata.format || "png",
|
58
|
+
quality: 100,
|
59
|
+
suffix: "transformed-unresized",
|
60
|
+
prefix: options.name
|
61
|
+
})
|
62
|
+
}
|
63
|
+
];
|
64
|
+
for (const width of options.widths) {
|
65
|
+
for (const height of options.heights) {
|
66
|
+
for (const quality of options.qualities) {
|
67
|
+
for (const format of options.formats) {
|
68
|
+
const exportBuffer = await formatImage(transformedBuffer, {
|
69
|
+
format,
|
70
|
+
quality,
|
71
|
+
width,
|
72
|
+
height
|
73
|
+
});
|
74
|
+
exportsBuffers.push({
|
75
|
+
buffer: exportBuffer,
|
76
|
+
name: generateFileName({
|
77
|
+
width,
|
78
|
+
height,
|
79
|
+
quality,
|
80
|
+
format,
|
81
|
+
prefix: options.name
|
82
|
+
})
|
83
|
+
});
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
console.log("Images:Transform:Export:ZIP", generateZipName(options.name));
|
89
|
+
const zipBuffer = exportZipBuffer(exportsBuffers, generateZipName(options.name));
|
90
|
+
return zipBuffer;
|
91
|
+
}
|
92
|
+
function exportZipBuffer(zipSources, zipDirectoryName) {
|
93
|
+
return new Promise(async (resolve) => {
|
94
|
+
const archive = archiver("zip", { zlib: { level: 9 } });
|
95
|
+
if (zipDirectoryName) {
|
96
|
+
archive.directory(zipDirectoryName + "/", false);
|
97
|
+
}
|
98
|
+
zipSources.forEach((zipSource) => {
|
99
|
+
const fileName = zipDirectoryName ? `${zipDirectoryName}/${zipSource.name}` : zipSource.name;
|
100
|
+
archive.append(zipSource.buffer, { name: fileName });
|
101
|
+
});
|
102
|
+
const chunks = [];
|
103
|
+
const writable = new Writable();
|
104
|
+
writable._write = (chunk, _enc, callback) => {
|
105
|
+
chunks.push(chunk);
|
106
|
+
callback();
|
107
|
+
};
|
108
|
+
archive.pipe(writable);
|
109
|
+
await archive.finalize();
|
110
|
+
const bufferZip = Buffer.concat(chunks);
|
111
|
+
resolve(bufferZip);
|
112
|
+
});
|
113
|
+
}
|
114
|
+
function getOptions(imageBufferMetadata, options) {
|
115
|
+
return {
|
116
|
+
center: [0.5, 0.5],
|
117
|
+
qualities: [100],
|
118
|
+
inputOperations: [],
|
119
|
+
...options,
|
120
|
+
checkValidOperations: options?.checkValidOperations ?? false,
|
121
|
+
name: options?.name ?? "",
|
122
|
+
formats: [imageBufferMetadata.format, ...options?.formats ? options.formats : []],
|
123
|
+
ratios: [...options?.ratios ? options.ratios : []],
|
124
|
+
widths: [imageBufferMetadata.width, ...options?.widths ? options.widths : []],
|
125
|
+
heights: [imageBufferMetadata.height, ...options?.heights ? options.heights : []]
|
126
|
+
};
|
127
|
+
}
|
128
|
+
function generateZipName(name = "") {
|
129
|
+
const date = /* @__PURE__ */ new Date();
|
130
|
+
return `${name}_image-exports_${date.toLocaleDateString()}_${date.toLocaleTimeString()}_${date.getTime()}`.replace(/\/|:/g, "-").replace(/ /g, "").trim();
|
131
|
+
}
|
132
|
+
function generateFileName({
|
133
|
+
width,
|
134
|
+
height,
|
135
|
+
quality,
|
136
|
+
format,
|
137
|
+
suffix,
|
138
|
+
prefix
|
139
|
+
}) {
|
140
|
+
prefix = prefix ? `${prefix}_` : "image-formats_";
|
141
|
+
suffix = `${suffix ? `_${suffix}` : ""}.${format}`;
|
142
|
+
return `${prefix}${width}x${height}_Q${quality}${suffix}`;
|
143
|
+
}
|
144
|
+
|
145
|
+
export {
|
146
|
+
MAX_NB_OUTPUTS,
|
147
|
+
OUTPUT_ZIP_FOLDER,
|
148
|
+
prepareImage,
|
149
|
+
exportZipBuffer,
|
150
|
+
prepare_exports
|
151
|
+
};
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-JMU5PDBD.js";
|
4
|
+
import {
|
5
|
+
unknownToString
|
6
|
+
} from "./chunk-FENXVJYO.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-WSFCRVEQ.js";
|
10
|
+
|
11
|
+
// src/node/@google-cloud/storage/file/upload/index.ts
|
12
|
+
var upload_exports = {};
|
13
|
+
__export(upload_exports, {
|
14
|
+
upload: () => upload
|
15
|
+
});
|
16
|
+
async function upload(bucket, targetPath, fileStream, options) {
|
17
|
+
const { fileOptions, saveOptions, overwrite = false } = options ?? {};
|
18
|
+
const file = bucket.file(targetPath, fileOptions);
|
19
|
+
if (!overwrite) {
|
20
|
+
try {
|
21
|
+
const [exists] = await file.exists();
|
22
|
+
if (exists) {
|
23
|
+
return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
24
|
+
}
|
25
|
+
} catch (err) {
|
26
|
+
const errStr = unknownToString(err);
|
27
|
+
return Outcome.makeFailure(errStr);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
try {
|
31
|
+
await new Promise((resolve, reject) => {
|
32
|
+
const writeStream = file.createWriteStream(saveOptions);
|
33
|
+
fileStream.pipe(writeStream);
|
34
|
+
fileStream.on("error", reject);
|
35
|
+
writeStream.on("finish", resolve);
|
36
|
+
writeStream.on("error", reject);
|
37
|
+
});
|
38
|
+
return Outcome.makeSuccess(true);
|
39
|
+
} catch (err) {
|
40
|
+
const errStr = unknownToString(err);
|
41
|
+
return Outcome.makeFailure(errStr);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
export {
|
46
|
+
upload,
|
47
|
+
upload_exports
|
48
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-JMU5PDBD.js";
|
4
|
+
import {
|
5
|
+
unknownToString
|
6
|
+
} from "./chunk-FENXVJYO.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-WSFCRVEQ.js";
|
10
|
+
|
11
|
+
// src/node/@aws-s3/storage/file/upload/index.ts
|
12
|
+
var upload_exports = {};
|
13
|
+
__export(upload_exports, {
|
14
|
+
upload: () => upload
|
15
|
+
});
|
16
|
+
import {
|
17
|
+
HeadObjectCommand
|
18
|
+
} from "@aws-sdk/client-s3";
|
19
|
+
import { Upload } from "@aws-sdk/lib-storage";
|
20
|
+
async function upload(s3, bucketName, targetPath, fileStream, options) {
|
21
|
+
const {
|
22
|
+
uploadSettings,
|
23
|
+
fileMetadata,
|
24
|
+
overwrite = false
|
25
|
+
} = options ?? {};
|
26
|
+
if (!overwrite) {
|
27
|
+
try {
|
28
|
+
const headCommand = new HeadObjectCommand({
|
29
|
+
Bucket: bucketName,
|
30
|
+
Key: targetPath
|
31
|
+
});
|
32
|
+
await s3.send(headCommand);
|
33
|
+
return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
34
|
+
} catch (err) {
|
35
|
+
const code = err?.name ?? err?.$metadata?.httpStatusCode;
|
36
|
+
if (code !== "NotFound" && code !== 404) {
|
37
|
+
return Outcome.makeFailure(unknownToString(err));
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
const params = {
|
42
|
+
...fileMetadata,
|
43
|
+
Bucket: bucketName,
|
44
|
+
Key: targetPath,
|
45
|
+
Body: fileStream
|
46
|
+
};
|
47
|
+
try {
|
48
|
+
const upload2 = new Upload({
|
49
|
+
client: s3,
|
50
|
+
params,
|
51
|
+
...uploadSettings
|
52
|
+
});
|
53
|
+
await upload2.done();
|
54
|
+
return Outcome.makeSuccess(true);
|
55
|
+
} catch (err) {
|
56
|
+
return Outcome.makeFailure(unknownToString(err));
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
export {
|
61
|
+
upload,
|
62
|
+
upload_exports
|
63
|
+
};
|