@design-edito/tools 0.1.63 → 0.1.65
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 +6 -6
- 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 +1 -1
- 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.d.ts +1 -0
- package/agnostic/colors/complement-color/index.js +7 -0
- package/agnostic/colors/hex-to-rgb/index.d.ts +1 -0
- package/agnostic/colors/hex-to-rgb/index.js +7 -0
- package/agnostic/colors/hsl-to-rgb/index.d.ts +1 -0
- package/agnostic/colors/hsl-to-rgb/index.js +7 -0
- package/agnostic/colors/index.d.ts +16 -0
- package/agnostic/colors/index.js +37 -0
- package/agnostic/colors/lighten-color/index.d.ts +2 -0
- package/agnostic/colors/lighten-color/index.js +11 -0
- package/agnostic/colors/rgb-to-hex/index.d.ts +1 -0
- package/agnostic/colors/rgb-to-hex/index.js +7 -0
- package/agnostic/colors/rgb-to-hsl/index.d.ts +1 -0
- package/agnostic/colors/rgb-to-hsl/index.js +7 -0
- package/agnostic/colors/saturate-color/index.d.ts +2 -0
- package/agnostic/colors/saturate-color/index.js +11 -0
- package/agnostic/css/bem/index.js +1 -1
- package/agnostic/css/generate-nice-color/index.js +1 -1
- package/agnostic/css/index.js +9 -9
- package/agnostic/css/is-valid-css-class-name/index.js +1 -1
- package/agnostic/css/styles-set/index.js +1 -1
- 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.d.ts +1 -1
- package/agnostic/html/hyper-json/cast/index.js +4 -4
- package/agnostic/html/hyper-json/index.js +5 -5
- 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 +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.d.ts +3 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.d.ts +3 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.d.ts +2 -2
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.d.ts +3 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.d.ts +3 -1
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +4 -4
- 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 +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +4 -4
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +4 -4
- package/agnostic/html/hyper-json/transformer/index.js +1 -1
- package/agnostic/html/hyper-json/tree/index.js +4 -4
- package/agnostic/html/hyper-json/types/index.js +1 -1
- package/agnostic/html/hyper-json/utils/index.d.ts +5 -0
- package/agnostic/html/hyper-json/utils/index.js +4 -4
- package/agnostic/html/index.js +10 -10
- 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 +1 -1
- package/agnostic/html/selector-to-element/index.js +1 -1
- package/agnostic/html/string-to-nodes/index.js +1 -1
- package/agnostic/index.d.ts +2 -0
- 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 +1 -1
- 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 +26 -26
- 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 +3 -3
- 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/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 +4 -4
- 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 +12 -12
- 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.d.ts +3 -0
- package/agnostic/sanitization/index.js +1311 -0
- package/agnostic/strings/char-codes/index.js +1 -1
- package/agnostic/strings/index.js +11 -11
- 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 +4 -4
- 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-26QQ56SS.js +36 -0
- package/chunks/chunk-2H5RIOJO.js +16 -0
- package/chunks/chunk-2POD3TAX.js +11 -0
- package/chunks/chunk-2TJCB6IM.js +12 -0
- package/chunks/chunk-334MFRHI.js +56 -0
- package/chunks/chunk-33YK4WOA.js +18 -0
- package/chunks/chunk-3KN4IIQU.js +23 -0
- package/chunks/chunk-3LAWRHHB.js +23 -0
- package/chunks/chunk-3XNFVOJF.js +20 -0
- package/chunks/chunk-45WKBXSF.js +39 -0
- package/chunks/chunk-46HTGOCE.js +56 -0
- package/chunks/chunk-4TGRV2AB.js +18 -0
- package/chunks/chunk-4WZEYD3R.js +56 -0
- package/chunks/chunk-55MT7BMY.js +16 -0
- package/chunks/chunk-5GBYBDYQ.js +36 -0
- package/chunks/chunk-5J7H5WYC.js +82 -0
- package/chunks/chunk-5JAITHS2.js +48 -0
- package/chunks/chunk-5JNJVGDX.js +20 -0
- package/chunks/chunk-5SWBMXLR.js +98 -0
- package/chunks/chunk-5TRAENM3.js +31 -0
- package/chunks/chunk-6HPXM6ED.js +20 -0
- package/chunks/chunk-76QORXDC.js +19 -0
- package/chunks/chunk-7BCQCDGQ.js +31 -0
- package/chunks/chunk-7FJKDVBE.js +49 -0
- package/chunks/chunk-7KCMLH6B.js +22 -0
- package/chunks/chunk-7SS2R4B6.js +82 -0
- package/chunks/chunk-ADTQQNIQ.js +47 -0
- package/chunks/chunk-AMXIZUFB.js +16 -0
- package/chunks/chunk-AWVQJNGX.js +101 -0
- package/chunks/chunk-AZOSX3LU.js +191 -0
- package/chunks/chunk-BANYGSW4.js +20 -0
- package/chunks/chunk-BWXVJB4I.js +20 -0
- package/chunks/chunk-CP454IJD.js +231 -0
- package/chunks/chunk-CSZFW4R5.js +69 -0
- package/chunks/chunk-CYIUZX2T.js +31 -0
- package/chunks/chunk-D5E2CIDK.js +20 -0
- package/chunks/chunk-DEQ5N53D.js +21 -0
- package/chunks/chunk-E7J4E6OB.js +65 -0
- package/chunks/chunk-EA4L7AGZ.js +48 -0
- package/chunks/chunk-ECWDSMDZ.js +20 -0
- package/chunks/chunk-FAXNZG5C.js +10 -0
- package/chunks/chunk-FMRPJBUC.js +20 -0
- package/chunks/chunk-FTT6ZCCS.js +29 -0
- package/chunks/chunk-GCHQD7MH.js +63 -0
- package/chunks/chunk-GXICX4F6.js +31 -0
- package/chunks/chunk-H73SGDQI.js +20 -0
- package/chunks/chunk-H7LDIXVY.js +48 -0
- package/chunks/chunk-HDK7W7GS.js +20 -0
- package/chunks/chunk-HUC2IRGW.js +205 -0
- package/chunks/chunk-IARWH6LC.js +34 -0
- package/chunks/chunk-IJAFLBHD.js +16 -0
- package/chunks/chunk-JBSS64SA.js +6 -0
- package/chunks/chunk-JBZR6R5B.js +15 -0
- package/chunks/chunk-JLXITDAV.js +48 -0
- package/chunks/chunk-JRYI4VBX.js +22 -0
- package/chunks/chunk-JYYW4KOZ.js +72 -0
- package/chunks/chunk-KFMYB672.js +31 -0
- package/chunks/chunk-LOAOXFA2.js +2369 -0
- package/chunks/chunk-LOY7C5BP.js +151 -0
- package/chunks/chunk-LVBXPZUO.js +104 -0
- package/chunks/chunk-MAE5XZGF.js +37 -0
- package/chunks/chunk-MB7HWF22.js +23 -0
- package/chunks/chunk-MFWKY3DT.js +32 -0
- package/chunks/chunk-MOBGB2PH.js +54 -0
- package/chunks/chunk-MOVLLUDL.js +25 -0
- package/chunks/chunk-MTGZYBK2.js +129 -0
- package/chunks/chunk-MV2LDBDF.js +164 -0
- package/chunks/chunk-MVNQWIVH.js +151 -0
- package/chunks/chunk-MZZOFFFT.js +21 -0
- package/chunks/chunk-NA3M6VUU.js +20 -0
- package/chunks/chunk-NOBTN4IW.js +4471 -0
- package/chunks/chunk-NZLE2WMY.js +35 -0
- package/chunks/chunk-O7UEQQ6H.js +49 -0
- package/chunks/chunk-OCM3RLO6.js +73 -0
- package/chunks/chunk-OPU4CANL.js +35 -0
- package/chunks/chunk-OSCBZIZF.js +28 -0
- package/chunks/chunk-OSZ4BWDE.js +32 -0
- package/chunks/chunk-OUJTDMHK.js +16 -0
- package/chunks/chunk-OWCPJD6O.js +16 -0
- package/chunks/chunk-OXV3LVNK.js +191 -0
- package/chunks/chunk-PEUWFUEZ.js +98 -0
- package/chunks/chunk-PXRLKO5Y.js +23 -0
- package/chunks/chunk-QAE3OWOI.js +79 -0
- package/chunks/chunk-QLC3A6PC.js +17 -0
- package/chunks/chunk-QUDIXNB2.js +18 -0
- package/chunks/chunk-R6F2MFZZ.js +173 -0
- package/chunks/chunk-RGGOIE34.js +20 -0
- package/chunks/chunk-RLTBF5FT.js +23 -0
- package/chunks/chunk-RPWYARS3.js +18 -0
- package/chunks/chunk-RVZ32GPI.js +55 -0
- package/chunks/chunk-S2PB2PLY.js +191 -0
- package/chunks/chunk-SC54OKBX.js +43 -0
- package/chunks/chunk-SJFY537W.js +84 -0
- package/chunks/chunk-SNRRHDIZ.js +31 -0
- package/chunks/chunk-SZQHLC4K.js +31 -0
- package/chunks/chunk-T55QIYYV.js +32 -0
- package/chunks/chunk-TC7A4P5S.js +34 -0
- package/chunks/chunk-TXGV4KJD.js +31 -0
- package/chunks/chunk-U57Q62IN.js +23 -0
- package/chunks/chunk-U7CF7IDN.js +35 -0
- package/chunks/chunk-UUSZJMJB.js +37 -0
- package/chunks/chunk-V4S34MIM.js +32 -0
- package/chunks/chunk-VHAGPTVR.js +37 -0
- package/chunks/chunk-VLHSIIPO.js +20 -0
- package/chunks/chunk-WLGIDY6A.js +2456 -0
- package/chunks/chunk-WMSE5GRO.js +63 -0
- package/chunks/chunk-WO2R3QFK.js +20 -0
- package/chunks/chunk-WU3JQC7W.js +164 -0
- package/chunks/chunk-X4XXZ44B.js +37 -0
- package/chunks/chunk-XEAHMN2T.js +4063 -0
- package/chunks/chunk-XF5QBETN.js +48 -0
- package/chunks/chunk-XN44EWRS.js +21 -0
- package/chunks/chunk-XSVBWVVC.js +20 -0
- package/chunks/chunk-XZ7II65Z.js +31 -0
- package/chunks/chunk-YLKBLE6G.js +30 -0
- package/chunks/chunk-YRQ7LODK.js +177 -0
- package/chunks/chunk-YSDPTGYO.js +31 -0
- package/chunks/chunk-YUJJEKYY.js +144 -0
- package/chunks/chunk-YVLJKJV2.js +17 -0
- package/chunks/chunk-YW5ASSIQ.js +31 -0
- package/chunks/chunk-YXJXNTCV.js +65 -0
- package/chunks/chunk-YYA5VRE4.js +177 -0
- package/chunks/chunk-YZYA7LFK.js +20 -0
- package/chunks/chunk-ZRWVPWQC.js +36 -0
- package/chunks/chunk-ZZH6RUS3.js +48 -0
- package/components/Comp/index.js +1 -1
- package/node/@aws-s3/index.js +5 -5
- package/node/@aws-s3/storage/file/download/index.js +2 -2
- package/node/@aws-s3/storage/file/index.js +4 -4
- package/node/@aws-s3/storage/file/upload/index.js +2 -2
- package/node/@aws-s3/storage/index.js +5 -5
- package/node/@design-edito/index.js +2 -7
- package/node/@design-edito/thumbnails/colors/index.d.ts +7 -4
- package/node/@design-edito/thumbnails/colors/index.js +7 -3
- package/node/@design-edito/thumbnails/index.d.ts +1 -5
- package/node/@design-edito/thumbnails/index.js +1 -20
- package/node/@express/@multer/index.js +2 -2
- package/node/@express/index.js +2 -2
- package/node/@google-cloud/index.js +17 -17
- package/node/@google-cloud/storage/bucket/get-metadata/index.js +2 -2
- package/node/@google-cloud/storage/bucket/index.js +6 -6
- package/node/@google-cloud/storage/bucket/list/index.js +2 -2
- package/node/@google-cloud/storage/file/copy/index.js +2 -2
- package/node/@google-cloud/storage/file/download/index.js +2 -2
- package/node/@google-cloud/storage/file/erase/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.js +2 -2
- package/node/@google-cloud/storage/file/get-metadata/index.js +2 -2
- package/node/@google-cloud/storage/file/get-permissions/index.js +2 -2
- package/node/@google-cloud/storage/file/index.js +17 -17
- package/node/@google-cloud/storage/file/move/index.js +2 -2
- package/node/@google-cloud/storage/file/revoke-signed-urls/index.js +5 -5
- package/node/@google-cloud/storage/file/update-metadata/index.js +2 -2
- package/node/@google-cloud/storage/file/upload/index.js +2 -2
- package/node/@google-cloud/storage/index.js +17 -17
- package/node/cloud-storage/client/index.js +3 -3
- package/node/cloud-storage/credentials/index.js +2 -2
- package/node/cloud-storage/endpoint/index.js +2 -2
- package/node/cloud-storage/index.js +18 -18
- package/node/cloud-storage/operations/download/index.js +7 -7
- package/node/cloud-storage/operations/index.js +13 -13
- package/node/cloud-storage/operations/upload/index.js +7 -7
- 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/file/download/index.js +2 -2
- package/node/ftps/file/index.js +4 -4
- package/node/ftps/file/upload/index.js +2 -2
- package/node/ftps/index.js +4 -4
- package/node/images/format/index.d.ts +52 -0
- package/node/images/format/index.js +27 -0
- package/node/images/index.d.ts +1 -1
- package/node/images/index.js +50 -13
- package/node/images/prepare/index.d.ts +11 -4
- package/node/images/prepare/index.js +50 -11
- package/node/images/transform/_utils/color-schema/index.d.ts +3 -0
- package/node/images/transform/_utils/color-schema/index.js +8 -0
- package/node/images/transform/_utils/operation-names/index.d.ts +20 -0
- package/node/images/transform/_utils/operation-names/index.js +7 -0
- package/node/images/transform/_utils/positions/index.d.ts +33 -0
- package/node/images/transform/_utils/positions/index.js +10 -0
- package/node/images/transform/blur/index.d.ts +10 -0
- package/node/images/transform/blur/index.js +9 -0
- package/node/images/transform/brighten/index.d.ts +8 -0
- package/node/images/transform/brighten/index.js +9 -0
- package/node/images/transform/compose/index.d.ts +38 -0
- package/node/images/transform/compose/index.js +11 -0
- package/node/images/transform/extend/index.d.ts +16 -0
- package/node/images/transform/extend/index.js +10 -0
- package/node/images/transform/extract/index.d.ts +13 -0
- package/node/images/transform/extract/index.js +9 -0
- package/node/images/transform/flatten/index.d.ts +11 -0
- package/node/images/transform/flatten/index.js +10 -0
- package/node/images/transform/flip/index.d.ts +10 -0
- package/node/images/transform/flip/index.js +9 -0
- package/node/images/transform/flop/index.d.ts +10 -0
- package/node/images/transform/flop/index.js +9 -0
- package/node/images/transform/frame/backgrounds/create-line-background/index.d.ts +155 -0
- package/node/images/transform/frame/backgrounds/create-line-background/index.js +10 -0
- package/node/images/transform/frame/backgrounds/create-tile-background/index.d.ts +106 -0
- package/node/images/transform/frame/backgrounds/create-tile-background/index.js +10 -0
- package/node/images/transform/frame/index.d.ts +44 -0
- package/node/images/transform/frame/index.js +13 -0
- package/node/images/transform/hue-rotate/index.d.ts +8 -0
- package/node/images/transform/hue-rotate/index.js +9 -0
- package/node/images/transform/index.d.ts +24 -207
- package/node/images/transform/index.js +50 -11
- package/node/images/transform/lighten/index.d.ts +8 -0
- package/node/images/transform/lighten/index.js +9 -0
- package/node/images/transform/lineate-levels/index.d.ts +11 -0
- package/node/images/transform/lineate-levels/index.js +9 -0
- package/node/images/transform/modulate/index.d.ts +13 -0
- package/node/images/transform/modulate/index.js +9 -0
- package/node/images/transform/normalize/index.d.ts +11 -0
- package/node/images/transform/normalize/index.js +9 -0
- package/node/images/transform/operations/_utils/compose/index.d.ts +3 -0
- package/node/images/transform/operations/_utils/compose/index.js +8 -0
- package/node/images/transform/operations/_utils/frame/backgrounds/create-line-background/index.d.ts +6 -0
- package/node/images/transform/operations/_utils/frame/backgrounds/create-line-background/index.js +12 -0
- package/node/images/transform/operations/_utils/frame/backgrounds/create-tile-background/index.d.ts +14 -0
- package/node/images/transform/operations/_utils/frame/backgrounds/create-tile-background/index.js +14 -0
- package/node/images/transform/operations/_utils/frame/create-color-palette/index.d.ts +11 -0
- package/node/images/transform/operations/_utils/frame/create-color-palette/index.js +17 -0
- package/node/images/transform/operations/_utils/frame/extract-colors-from-image/index.d.ts +10 -0
- package/node/images/transform/operations/_utils/frame/extract-colors-from-image/index.js +11 -0
- package/node/images/transform/operations/_utils/frame/index.d.ts +7 -0
- package/node/images/transform/operations/_utils/frame/index.js +24 -0
- package/node/images/transform/operations/_utils/positions/index.d.ts +16 -0
- package/node/images/transform/operations/_utils/positions/index.js +11 -0
- package/node/images/transform/operations/_utils/scale/index.d.ts +3 -0
- package/node/images/transform/operations/_utils/scale/index.js +7 -0
- package/node/images/transform/operations/area-composition/area-line-composition/index.d.ts +19 -0
- package/node/images/transform/operations/area-composition/area-line-composition/index.js +14 -0
- package/node/images/transform/operations/area-composition/area-tile-composition/index.d.ts +30 -0
- package/node/images/transform/operations/area-composition/area-tile-composition/index.js +15 -0
- package/node/images/transform/operations/area-composition/index.d.ts +31 -0
- package/node/images/transform/operations/area-composition/index.js +15 -0
- package/node/images/transform/operations/index.d.ts +0 -0
- package/node/images/transform/operations/index.js +0 -0
- package/node/images/transform/operations/inner-resize/index.d.ts +25 -0
- package/node/images/transform/operations/inner-resize/index.js +13 -0
- package/node/images/transform/resize/index.d.ts +16 -0
- package/node/images/transform/resize/index.js +10 -0
- package/node/images/transform/rotate/index.d.ts +9 -0
- package/node/images/transform/rotate/index.js +9 -0
- package/node/images/transform/saturate/index.d.ts +8 -0
- package/node/images/transform/saturate/index.js +9 -0
- package/node/images/transform/scale/index.d.ts +13 -0
- package/node/images/transform/scale/index.js +10 -0
- package/node/process/index.js +1 -1
- package/node/process/on-exit/index.js +1 -1
- package/node/sftp/file/download/index.js +2 -2
- package/node/sftp/file/index.js +4 -4
- package/node/sftp/file/upload/index.js +2 -2
- package/node/sftp/index.js +4 -4
- package/package.json +3 -2
@@ -0,0 +1,151 @@
|
|
1
|
+
import {
|
2
|
+
formatImage
|
3
|
+
} from "./chunk-SJFY537W.js";
|
4
|
+
import {
|
5
|
+
transform
|
6
|
+
} from "./chunk-YRQ7LODK.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-NZLE2WMY.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,104 @@
|
|
1
|
+
import {
|
2
|
+
exportZipBuffer,
|
3
|
+
prepareExport
|
4
|
+
} from "./chunk-5RGHYFQH.js";
|
5
|
+
import {
|
6
|
+
transformImage
|
7
|
+
} from "./chunk-TC7A4P5S.js";
|
8
|
+
import {
|
9
|
+
thumbnails_exports
|
10
|
+
} from "./chunk-OSCBZIZF.js";
|
11
|
+
import {
|
12
|
+
__export
|
13
|
+
} from "./chunk-WSFCRVEQ.js";
|
14
|
+
|
15
|
+
// src/node/images/prepare/index.ts
|
16
|
+
var prepare_exports = {};
|
17
|
+
__export(prepare_exports, {
|
18
|
+
MAX_NB_OUTPUTS: () => MAX_NB_OUTPUTS,
|
19
|
+
OUTPUT_ZIP_FOLDER: () => OUTPUT_ZIP_FOLDER,
|
20
|
+
prepareImage: () => prepareImage
|
21
|
+
});
|
22
|
+
import sharp from "sharp";
|
23
|
+
var MAX_NB_OUTPUTS = 50;
|
24
|
+
var OUTPUT_ZIP_FOLDER = "./output-zips";
|
25
|
+
async function prepareImage(imageBuffer, customOptions) {
|
26
|
+
const sharpImage = sharp(imageBuffer);
|
27
|
+
const sharpImageMetadata = await sharpImage.metadata();
|
28
|
+
const imageBufferMetadata = {
|
29
|
+
width: sharpImageMetadata.width || 0,
|
30
|
+
height: sharpImageMetadata.height || 0,
|
31
|
+
format: sharpImageMetadata.format || "png"
|
32
|
+
};
|
33
|
+
const outputDimensions = {
|
34
|
+
widths: customOptions?.widths && customOptions?.widths.length ? customOptions?.widths : [imageBufferMetadata.width],
|
35
|
+
heights: customOptions?.heights && customOptions?.heights.length ? customOptions?.heights : [imageBufferMetadata.height]
|
36
|
+
};
|
37
|
+
const options = getOptions(imageBufferMetadata, customOptions);
|
38
|
+
const nbOutputs = options.qualities.length * (options.ratios.length + 1) * (options.widths.length + 1) * (options.heights.length + 1);
|
39
|
+
if (nbOutputs > MAX_NB_OUTPUTS) {
|
40
|
+
throw Error("Nb output exceeds supported max nb output");
|
41
|
+
}
|
42
|
+
const transformedBuffer = await transformImage(imageBuffer, options.inputOperations, {
|
43
|
+
width: thumbnails_exports.Common.getArrayMax(outputDimensions.widths) || 0,
|
44
|
+
height: thumbnails_exports.Common.getArrayMax(outputDimensions.heights) || 0
|
45
|
+
});
|
46
|
+
const exportsBuffers = [{
|
47
|
+
buffer: imageBuffer,
|
48
|
+
name: generateFileName({
|
49
|
+
...imageBufferMetadata,
|
50
|
+
quality: 100,
|
51
|
+
suffix: "original",
|
52
|
+
preffix: options.name
|
53
|
+
})
|
54
|
+
}];
|
55
|
+
for await (const width of options.widths) {
|
56
|
+
for await (const height of options.heights) {
|
57
|
+
for await (const quality of options.qualities) {
|
58
|
+
for await (const format of options.formats) {
|
59
|
+
const exportBuffer = await prepareExport(transformedBuffer, {
|
60
|
+
format,
|
61
|
+
quality,
|
62
|
+
width,
|
63
|
+
height
|
64
|
+
});
|
65
|
+
exportsBuffers.push({
|
66
|
+
buffer: exportBuffer,
|
67
|
+
name: generateFileName({ width, height, quality, format, preffix: options.name })
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
const zipBuffer = exportZipBuffer(exportsBuffers, generateZipName(options.name));
|
74
|
+
return zipBuffer;
|
75
|
+
}
|
76
|
+
function getOptions(imageBufferMetadata, options) {
|
77
|
+
return {
|
78
|
+
center: [0.5, 0.5],
|
79
|
+
qualities: [100],
|
80
|
+
inputOperations: [],
|
81
|
+
...options,
|
82
|
+
name: options?.name || "",
|
83
|
+
formats: [imageBufferMetadata.format, ...options?.formats ? options.formats : []],
|
84
|
+
ratios: [...options?.ratios ? options.ratios : []],
|
85
|
+
widths: [imageBufferMetadata.width, ...options?.widths ? options.widths : []],
|
86
|
+
heights: [imageBufferMetadata.height, ...options?.heights ? options.heights : []]
|
87
|
+
};
|
88
|
+
}
|
89
|
+
function generateZipName(name) {
|
90
|
+
const date = /* @__PURE__ */ new Date();
|
91
|
+
return `${name || ""}_image-exports_${date.toLocaleDateString()}_${date.toLocaleTimeString()}_${date.getTime()}`.replace(/\/|:/g, "-").replace(/ /g, "").trim();
|
92
|
+
}
|
93
|
+
function generateFileName({ width, height, quality, format, suffix, preffix }) {
|
94
|
+
const _preffix = preffix ? `${preffix}_` : "image-formats_";
|
95
|
+
const _suffix = `${suffix ? `_${suffix}` : ""}.${format}`;
|
96
|
+
return `${_preffix}${width}x${height}_Q${quality}${_suffix}`;
|
97
|
+
}
|
98
|
+
|
99
|
+
export {
|
100
|
+
MAX_NB_OUTPUTS,
|
101
|
+
OUTPUT_ZIP_FOLDER,
|
102
|
+
prepareImage,
|
103
|
+
prepare_exports
|
104
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {
|
2
|
+
Cast,
|
3
|
+
Tree,
|
4
|
+
Utils
|
5
|
+
} from "./chunk-LOAOXFA2.js";
|
6
|
+
import {
|
7
|
+
Types
|
8
|
+
} from "./chunk-XEQ2PBT2.js";
|
9
|
+
import {
|
10
|
+
SmartTags
|
11
|
+
} from "./chunk-UT2J62LH.js";
|
12
|
+
import {
|
13
|
+
Serialize
|
14
|
+
} from "./chunk-SXRWMH3U.js";
|
15
|
+
import {
|
16
|
+
Transformer
|
17
|
+
} from "./chunk-BKO7GLC2.js";
|
18
|
+
import {
|
19
|
+
Method
|
20
|
+
} from "./chunk-RW7VAKJW.js";
|
21
|
+
|
22
|
+
// src/agnostic/html/hyper-json/index.ts
|
23
|
+
var HyperJson;
|
24
|
+
((HyperJson2) => {
|
25
|
+
HyperJson2.Cast = Cast;
|
26
|
+
HyperJson2.Method = Method;
|
27
|
+
HyperJson2.Serialize = Serialize;
|
28
|
+
HyperJson2.SmartTags = SmartTags;
|
29
|
+
HyperJson2.Transformer = Transformer;
|
30
|
+
HyperJson2.Tree = Tree;
|
31
|
+
HyperJson2.Types = Types;
|
32
|
+
HyperJson2.Utils = Utils;
|
33
|
+
})(HyperJson || (HyperJson = {}));
|
34
|
+
|
35
|
+
export {
|
36
|
+
HyperJson
|
37
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import {
|
2
|
+
HSLToRGB
|
3
|
+
} from "./chunk-QLC3A6PC.js";
|
4
|
+
import {
|
5
|
+
RGBToHSL
|
6
|
+
} from "./chunk-YVLJKJV2.js";
|
7
|
+
|
8
|
+
// src/agnostic/colors/saturate-color/index.ts
|
9
|
+
function saturateColor(color, intensity = 20) {
|
10
|
+
const [h, s, l] = RGBToHSL(color);
|
11
|
+
const rgb = HSLToRGB([h, Math.min(100, s + intensity), l]);
|
12
|
+
return rgb;
|
13
|
+
}
|
14
|
+
function setColorSaturation(color, intensity = 20) {
|
15
|
+
const [h, s, l] = RGBToHSL(color);
|
16
|
+
const rgb = HSLToRGB([h, Math.min(100, intensity), l]);
|
17
|
+
return rgb;
|
18
|
+
}
|
19
|
+
|
20
|
+
export {
|
21
|
+
saturateColor,
|
22
|
+
setColorSaturation
|
23
|
+
};
|
@@ -0,0 +1,32 @@
|
|
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-NZLE2WMY.js";
|
10
|
+
|
11
|
+
// src/node/ftps/file/download/index.ts
|
12
|
+
var download_exports = {};
|
13
|
+
__export(download_exports, {
|
14
|
+
download: () => download
|
15
|
+
});
|
16
|
+
import { PassThrough } from "node:stream";
|
17
|
+
async function download(sourcePath, ftpClient, options) {
|
18
|
+
const { startAt } = options ?? {};
|
19
|
+
const stream = new PassThrough();
|
20
|
+
try {
|
21
|
+
await ftpClient.downloadTo(stream, sourcePath, startAt);
|
22
|
+
return Outcome.makeSuccess(stream);
|
23
|
+
} catch (err) {
|
24
|
+
const errStr = unknownToString(err);
|
25
|
+
return Outcome.makeFailure(errStr);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
export {
|
30
|
+
download,
|
31
|
+
download_exports
|
32
|
+
};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import {
|
2
|
+
__export
|
3
|
+
} from "./chunk-NZLE2WMY.js";
|
4
|
+
|
5
|
+
// src/node/cloud-storage/endpoint/index.ts
|
6
|
+
var endpoint_exports = {};
|
7
|
+
__export(endpoint_exports, {
|
8
|
+
Type: () => Type,
|
9
|
+
ftpIdentifierData: () => ftpIdentifierData,
|
10
|
+
gcsIdentifierData: () => gcsIdentifierData,
|
11
|
+
s3IdentifierData: () => s3IdentifierData
|
12
|
+
});
|
13
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
14
|
+
Type2["GCS"] = "gcs-bucket";
|
15
|
+
Type2["S3"] = "s3-bucket";
|
16
|
+
Type2["FTP"] = "ftp";
|
17
|
+
Type2["FTPS"] = "ftps";
|
18
|
+
Type2["SFTP"] = "sftp";
|
19
|
+
return Type2;
|
20
|
+
})(Type || {});
|
21
|
+
function gcsIdentifierData(identifier) {
|
22
|
+
identifier = identifier.trim().replace(/^\//, "");
|
23
|
+
const [bucketName, ...pathChunks] = identifier.split("/");
|
24
|
+
return {
|
25
|
+
bucketName: bucketName ?? null,
|
26
|
+
path: `/${pathChunks.join("/")}`
|
27
|
+
};
|
28
|
+
}
|
29
|
+
function s3IdentifierData(identifier) {
|
30
|
+
identifier = identifier.trim().replace(/^\//, "");
|
31
|
+
const [bucketName, ...pathChunks] = identifier.split("/");
|
32
|
+
return {
|
33
|
+
bucketName: bucketName ?? null,
|
34
|
+
path: `/${pathChunks.join("/")}`
|
35
|
+
};
|
36
|
+
}
|
37
|
+
function ftpIdentifierData(identifier) {
|
38
|
+
identifier = identifier.trim().replace(/^\//, "");
|
39
|
+
const [hostAndPort, ...pathChunks] = identifier.split("/");
|
40
|
+
const [host, port] = hostAndPort?.split(":") ?? [];
|
41
|
+
return {
|
42
|
+
host: host ?? null,
|
43
|
+
port: port ?? null,
|
44
|
+
path: `/${pathChunks.join("/")}`
|
45
|
+
};
|
46
|
+
}
|
47
|
+
|
48
|
+
export {
|
49
|
+
Type,
|
50
|
+
gcsIdentifierData,
|
51
|
+
s3IdentifierData,
|
52
|
+
ftpIdentifierData,
|
53
|
+
endpoint_exports
|
54
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
// src/node/images/transform/_utils/operation-names/index.ts
|
2
|
+
var OperationNames = {
|
3
|
+
Blur: "blur",
|
4
|
+
Brighten: "brighten",
|
5
|
+
Compose: "compose",
|
6
|
+
Extract: "extract",
|
7
|
+
Extend: "extend",
|
8
|
+
Flatten: "flatten",
|
9
|
+
Flip: "flip",
|
10
|
+
Flop: "flop",
|
11
|
+
Frame: "frame",
|
12
|
+
HueRotate: "hue-rotate",
|
13
|
+
Lighten: "lighten",
|
14
|
+
LineateLevels: "lineate-levels",
|
15
|
+
Modulate: "modulate",
|
16
|
+
Normalize: "normalize",
|
17
|
+
Resize: "resize",
|
18
|
+
Rotate: "rotate",
|
19
|
+
Saturate: "saturate",
|
20
|
+
Scale: "scale"
|
21
|
+
};
|
22
|
+
|
23
|
+
export {
|
24
|
+
OperationNames
|
25
|
+
};
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import {
|
2
|
+
ftpIdentifierData,
|
3
|
+
gcsIdentifierData
|
4
|
+
} from "./chunk-MOBGB2PH.js";
|
5
|
+
import {
|
6
|
+
Outcome
|
7
|
+
} from "./chunk-JMU5PDBD.js";
|
8
|
+
import {
|
9
|
+
unknownToString
|
10
|
+
} from "./chunk-FENXVJYO.js";
|
11
|
+
import {
|
12
|
+
__export
|
13
|
+
} from "./chunk-NZLE2WMY.js";
|
14
|
+
|
15
|
+
// src/node/cloud-storage/client/index.ts
|
16
|
+
var client_exports = {};
|
17
|
+
__export(client_exports, {
|
18
|
+
makeClient: () => makeClient,
|
19
|
+
makeFtpClient: () => makeFtpClient,
|
20
|
+
makeFtpsClient: () => makeFtpsClient,
|
21
|
+
makeGcsClient: () => makeGcsClient,
|
22
|
+
makeS3Client: () => makeS3Client,
|
23
|
+
makeSftpClient: () => makeSftpClient
|
24
|
+
});
|
25
|
+
import { Storage } from "@google-cloud/storage";
|
26
|
+
import { S3 } from "aws-sdk";
|
27
|
+
import { Client as FtpClient } from "basic-ftp";
|
28
|
+
import SftpClient from "ssh2-sftp-client";
|
29
|
+
async function makeClient(endpointType, endpointIdentifier, credentials) {
|
30
|
+
if (endpointType === "gcs-bucket" /* GCS */) {
|
31
|
+
return makeGcsClient({ type: endpointType, identifier: endpointIdentifier }, credentials);
|
32
|
+
} else if (endpointType === "s3-bucket" /* S3 */) {
|
33
|
+
return makeS3Client(credentials);
|
34
|
+
} else if (endpointType === "ftp" /* FTP */) {
|
35
|
+
return await makeFtpClient({ type: endpointType, identifier: endpointIdentifier }, credentials);
|
36
|
+
} else if (endpointType === "ftps" /* FTPS */) {
|
37
|
+
return await makeFtpsClient({ type: endpointType, identifier: endpointIdentifier }, credentials);
|
38
|
+
} else if (endpointType === "sftp" /* SFTP */) {
|
39
|
+
return await makeSftpClient({ type: endpointType, identifier: endpointIdentifier }, credentials);
|
40
|
+
} else {
|
41
|
+
return Outcome.makeFailure(`Invalid endpoint type: ${endpointType}`);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
function makeGcsClient(endpoint, credentials) {
|
45
|
+
const storage = new Storage({ credentials });
|
46
|
+
const { bucketName } = gcsIdentifierData(endpoint.identifier);
|
47
|
+
if (bucketName === null) return Outcome.makeFailure("Invalid GCS bucket name");
|
48
|
+
const bucket = storage.bucket(bucketName);
|
49
|
+
return Outcome.makeSuccess(bucket);
|
50
|
+
}
|
51
|
+
function makeS3Client(credentials) {
|
52
|
+
const s3 = new S3({ credentials });
|
53
|
+
return Outcome.makeSuccess(s3);
|
54
|
+
}
|
55
|
+
async function makeFtpClient(endpoint, credentials) {
|
56
|
+
const { host, port, path } = ftpIdentifierData(endpoint.identifier);
|
57
|
+
if (host === null) return Outcome.makeFailure("Invalid host information");
|
58
|
+
if (port === null) return Outcome.makeFailure("Invalid port information");
|
59
|
+
const client = new FtpClient();
|
60
|
+
try {
|
61
|
+
await client.access({
|
62
|
+
host,
|
63
|
+
port: parseInt(port),
|
64
|
+
user: credentials.username,
|
65
|
+
password: credentials.password
|
66
|
+
});
|
67
|
+
await client.cd(path);
|
68
|
+
return Outcome.makeSuccess(client);
|
69
|
+
} catch (err) {
|
70
|
+
unknownToString(err);
|
71
|
+
return Outcome.makeFailure(unknownToString(err));
|
72
|
+
}
|
73
|
+
}
|
74
|
+
async function makeFtpsClient(endpoint, credentials) {
|
75
|
+
const { host, port, path } = ftpIdentifierData(endpoint.identifier);
|
76
|
+
if (host === null) return Outcome.makeFailure("Invalid host information");
|
77
|
+
if (port === null) return Outcome.makeFailure("Invalid port information");
|
78
|
+
const client = new FtpClient();
|
79
|
+
try {
|
80
|
+
await client.access({
|
81
|
+
host,
|
82
|
+
port: parseInt(port),
|
83
|
+
user: credentials.username,
|
84
|
+
password: credentials.password,
|
85
|
+
secure: true,
|
86
|
+
secureOptions: credentials.implicit ? { rejectUnauthorized: false } : void 0
|
87
|
+
// Explicit mode uses STARTTLS
|
88
|
+
});
|
89
|
+
await client.cd(path);
|
90
|
+
return Outcome.makeSuccess(client);
|
91
|
+
} catch (err) {
|
92
|
+
return Outcome.makeFailure(unknownToString(err));
|
93
|
+
}
|
94
|
+
}
|
95
|
+
async function makeSftpClient(endpoint, credentials) {
|
96
|
+
const { host, port, path } = ftpIdentifierData(endpoint.identifier);
|
97
|
+
if (host === null) return Outcome.makeFailure("Invalid host information");
|
98
|
+
if (port === null) return Outcome.makeFailure("Invalid port information");
|
99
|
+
const sftp = new SftpClient();
|
100
|
+
try {
|
101
|
+
await sftp.connect({
|
102
|
+
host,
|
103
|
+
port: parseInt(port),
|
104
|
+
username: credentials.username,
|
105
|
+
password: credentials.password,
|
106
|
+
privateKey: credentials.privateKey,
|
107
|
+
passphrase: credentials.passphrase
|
108
|
+
});
|
109
|
+
try {
|
110
|
+
const stats = await sftp.stat(path);
|
111
|
+
if (!stats.isDirectory) return Outcome.makeFailure(`Target path exists but is not a directory: ${path}`);
|
112
|
+
} catch (err) {
|
113
|
+
return Outcome.makeFailure(`Target directory does not exist: ${path}`);
|
114
|
+
}
|
115
|
+
return Outcome.makeSuccess(sftp);
|
116
|
+
} catch (err) {
|
117
|
+
return Outcome.makeFailure(unknownToString(err));
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
export {
|
122
|
+
makeClient,
|
123
|
+
makeGcsClient,
|
124
|
+
makeS3Client,
|
125
|
+
makeFtpClient,
|
126
|
+
makeFtpsClient,
|
127
|
+
makeSftpClient,
|
128
|
+
client_exports
|
129
|
+
};
|