@design-edito/tools 0.1.53 → 0.1.55
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 +9 -9
- 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/css/bem/index.js +3 -3
- package/agnostic/css/generate-nice-color/index.js +1 -1
- package/agnostic/css/index.js +14 -14
- 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 +3 -3
- 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 +3 -3
- package/agnostic/html/hyper-json/index.js +4 -4
- 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 +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/addclass/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/and/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/append/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/at/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/call/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/clone/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/deleteproperties/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/equals/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/getattribute/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperties/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/getproperty/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/if/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/initialize/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/join/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/length/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/map/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/negate/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/notrailing/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/or/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/pickrandom/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/populate/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/print/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/push/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/pusheach/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/recordtoarray/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeattribute/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/removeclass/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/renameproperty/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/replace/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/select/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/set/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/setattribute/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/setproperty/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/sorton/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/split/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/spread/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/toarray/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/toboolean/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/toelement/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/toggleclass/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonodelist/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonull/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/tonumber/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/torecord/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/toref/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/tostring/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/totext/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/transformselected/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/coalesced/trim/index.js +3 -3
- 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 +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/element/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/get/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/global/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/guess/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/nodelist/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/null/index.js +1 -1
- package/agnostic/html/hyper-json/smart-tags/isolated/number/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/record/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/ref/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/string/index.js +3 -3
- package/agnostic/html/hyper-json/smart-tags/isolated/text/index.js +3 -3
- package/agnostic/html/hyper-json/transformer/index.js +1 -1
- package/agnostic/html/hyper-json/tree/index.js +3 -3
- package/agnostic/html/hyper-json/types/index.js +1 -1
- package/agnostic/html/hyper-json/utils/index.js +3 -3
- package/agnostic/html/index.js +16 -16
- 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 +4 -4
- 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 +1 -1
- package/agnostic/misc/elo/index.js +1 -1
- package/agnostic/misc/get-current-downlink/index.js +1 -1
- package/agnostic/misc/index.js +28 -28
- 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 +12 -12
- 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 +13 -13
- 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 +1 -1
- 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/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 +7 -7
- 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-2PNFMIXN.js +20 -0
- package/chunks/chunk-35W7XRC3.js +173 -0
- package/chunks/chunk-3GTGE66Y.js +32 -0
- package/chunks/chunk-422KBDRV.js +203 -0
- package/chunks/chunk-454MZ5UE.js +239 -0
- package/chunks/chunk-4CAHGPFA.js +32 -0
- package/chunks/chunk-4OH2EX3D.js +191 -0
- package/chunks/chunk-4WOYAD35.js +31 -0
- package/chunks/chunk-55MT7BMY.js +16 -0
- package/chunks/chunk-5IPSIDXB.js +31 -0
- package/chunks/chunk-5JMTDJWX.js +37 -0
- package/chunks/chunk-5RGHYFQH.js +70 -0
- package/chunks/chunk-5VHFXWFM.js +31 -0
- package/chunks/chunk-6DA4S65P.js +37 -0
- package/chunks/chunk-6PNTQUTX.js +20 -0
- package/chunks/chunk-6WVNJVBE.js +34 -0
- package/chunks/chunk-7DDXALPH.js +49 -0
- package/chunks/chunk-7N7BJA6C.js +36 -0
- package/chunks/chunk-7YSTZ7GY.js +31 -0
- package/chunks/chunk-A4FSJC46.js +58 -0
- package/chunks/chunk-AE6L2HYA.js +56 -0
- package/chunks/chunk-AIESW26U.js +47 -0
- package/chunks/chunk-AM26FWT6.js +31 -0
- package/chunks/chunk-AZLVQV5A.js +39 -0
- package/chunks/chunk-BNNAZPI2.js +191 -0
- package/chunks/chunk-BONBND7I.js +239 -0
- package/chunks/chunk-CMWR77VW.js +54 -0
- package/chunks/chunk-D2NTUAFE.js +4284 -0
- package/chunks/chunk-D5E2CIDK.js +20 -0
- package/chunks/chunk-EHVYR4OU.js +56 -0
- package/chunks/chunk-EM37BFXO.js +35 -0
- package/chunks/chunk-ERAFJXWH.js +20 -0
- package/chunks/chunk-FEFY3V6P.js +31 -0
- package/chunks/chunk-FJTOFK3C.js +203 -0
- package/chunks/chunk-G66DWXF3.js +31 -0
- package/chunks/chunk-GKG3UQH3.js +191 -0
- package/chunks/chunk-GP44TBRI.js +39 -0
- package/chunks/chunk-HKTNK262.js +23 -0
- package/chunks/chunk-HQGZVWBB.js +56 -0
- package/chunks/chunk-HTNLTDQT.js +28 -0
- package/chunks/chunk-I66DPQN2.js +31 -0
- package/chunks/chunk-IJ7SOXLA.js +107 -0
- package/chunks/chunk-ISAIFQAY.js +100 -0
- package/chunks/chunk-JBDWHJ4Q.js +31 -0
- package/chunks/chunk-JJWKHBXD.js +68 -0
- package/chunks/chunk-JSYVAPV6.js +6 -0
- package/chunks/chunk-KH5JTC2N.js +49 -0
- package/chunks/chunk-KTB7NX4Q.js +56 -0
- package/chunks/chunk-KUIQRVIC.js +100 -0
- package/chunks/chunk-L2L27BLX.js +56 -0
- package/chunks/chunk-LXZULGNN.js +37 -0
- package/chunks/chunk-MC5RLVK5.js +4284 -0
- package/chunks/chunk-MOA6JFUQ.js +2369 -0
- package/chunks/chunk-MUYZV5F3.js +2369 -0
- package/chunks/chunk-MUZGZ3ZF.js +50 -0
- package/chunks/chunk-N4BZJOGW.js +56 -0
- package/chunks/chunk-N4LMP4UM.js +31 -0
- package/chunks/chunk-N5QAGJXV.js +49 -0
- package/chunks/chunk-OD33BN4K.js +32 -0
- package/chunks/chunk-OPO25SDO.js +28 -0
- package/chunks/chunk-P3QFJTAE.js +129 -0
- package/chunks/chunk-Q7HA7IAA.js +20 -0
- package/chunks/chunk-QTTNO4T6.js +37 -0
- package/chunks/chunk-QUWGF5WZ.js +191 -0
- package/chunks/chunk-QVIRBFMQ.js +31 -0
- package/chunks/chunk-QZPBUDX2.js +20 -0
- package/chunks/chunk-ROJZUEYL.js +37 -0
- package/chunks/chunk-RWWYR54P.js +31 -0
- package/chunks/chunk-SPMF4X5X.js +31 -0
- package/chunks/chunk-UHH75BZP.js +56 -0
- package/chunks/chunk-UJN2WZGO.js +32 -0
- package/chunks/chunk-UT75PSLP.js +20 -0
- package/chunks/chunk-UVSTFYSD.js +28 -0
- package/chunks/chunk-VHCD3Z4T.js +20 -0
- package/chunks/chunk-VLHSIIPO.js +20 -0
- package/chunks/chunk-VQEP2EQF.js +100 -0
- package/chunks/chunk-VV72XGJJ.js +58 -0
- package/chunks/chunk-VXSOUAUT.js +100 -0
- package/chunks/chunk-W5LE6YQ5.js +16 -0
- package/chunks/chunk-W6BFU7Y5.js +56 -0
- package/chunks/chunk-WDXNM5YB.js +20 -0
- package/chunks/chunk-WO2R3QFK.js +20 -0
- package/chunks/chunk-WOGRENMM.js +31 -0
- package/chunks/chunk-X4XXZ44B.js +37 -0
- package/chunks/chunk-X5FAZBWL.js +130 -0
- package/chunks/chunk-XC2YGMNJ.js +203 -0
- package/chunks/chunk-YMRAUWRW.js +20 -0
- package/chunks/chunk-ZNA7SWFK.js +29 -0
- package/components/Comp/index.js +1 -1
- package/node/@aws-s3/index.d.ts +2 -0
- package/node/@aws-s3/index.js +12 -0
- package/node/@aws-s3/storage/file/download/index.d.ts +22 -0
- package/node/@aws-s3/storage/file/download/index.js +9 -0
- package/node/@aws-s3/storage/file/index.d.ts +3 -0
- package/node/@aws-s3/storage/file/index.js +14 -0
- package/node/@aws-s3/storage/file/upload/index.d.ts +28 -0
- package/node/@aws-s3/storage/file/upload/index.js +9 -0
- package/node/@aws-s3/storage/index.d.ts +2 -0
- package/node/@aws-s3/storage/index.js +12 -0
- package/node/@design-edito/index.js +6 -6
- package/node/@design-edito/thumbnails/colors/index.js +2 -2
- package/node/@design-edito/thumbnails/common/index.js +2 -2
- package/node/@design-edito/thumbnails/easings/index.js +2 -2
- package/node/@design-edito/thumbnails/index.js +8 -8
- package/node/@design-edito/thumbnails/layout/index.js +4 -4
- package/node/@express/@multer/index.js +2 -3
- package/node/@express/index.js +2 -3
- 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.d.ts +3 -3
- package/node/@google-cloud/storage/file/copy/index.js +2 -2
- package/node/@google-cloud/storage/file/download/index.d.ts +5 -4
- 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 +22 -22
- package/node/@google-cloud/storage/file/move/index.d.ts +3 -3
- 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.d.ts +13 -9
- package/node/@google-cloud/storage/file/upload/index.js +2 -2
- package/node/@google-cloud/storage/index.js +19 -19
- package/node/cloud-storage/client/index.d.ts +14 -0
- package/node/cloud-storage/client/index.js +20 -0
- package/node/cloud-storage/credentials/index.d.ts +33 -0
- package/node/cloud-storage/credentials/index.js +1 -0
- package/node/cloud-storage/endpoint/index.d.ts +24 -0
- package/node/cloud-storage/endpoint/index.js +13 -0
- package/node/cloud-storage/index.d.ts +5 -0
- package/node/cloud-storage/index.js +31 -0
- package/node/cloud-storage/operations/download/index.d.ts +5 -0
- package/node/cloud-storage/operations/download/index.js +15 -0
- package/node/cloud-storage/operations/index.d.ts +3 -0
- package/node/cloud-storage/operations/index.js +24 -0
- package/node/cloud-storage/operations/upload/index.d.ts +6 -0
- package/node/cloud-storage/operations/upload/index.js +15 -0
- package/node/encryption/buffer/index.d.ts +5 -4
- package/node/encryption/buffer/index.js +11 -11
- package/node/encryption/generate-key/index.js +1 -1
- package/node/encryption/index.d.ts +4 -5
- package/node/encryption/index.js +10 -22
- package/node/encryption/key/index.d.ts +16 -0
- package/node/encryption/key/index.js +7 -0
- package/node/encryption/uint8-array/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.d.ts +22 -0
- package/node/ftps/file/download/index.js +9 -0
- package/node/ftps/file/index.d.ts +3 -0
- package/node/ftps/file/index.js +14 -0
- package/node/ftps/file/upload/index.d.ts +24 -0
- package/node/ftps/file/upload/index.js +9 -0
- package/node/ftps/index.d.ts +2 -0
- package/node/ftps/index.js +11 -0
- package/node/images/exports/index.js +2 -4
- package/node/images/index.js +11 -13
- package/node/images/prepare/index.js +10 -12
- package/node/images/transform/area-composition/index.js +7 -8
- package/node/images/transform/index.d.ts +182 -5
- package/node/images/transform/index.js +8 -9
- package/node/index.d.ts +5 -1
- package/node/process/index.js +1 -1
- package/node/process/on-exit/index.js +1 -1
- package/node/sftp/file/download/index.d.ts +20 -0
- package/node/sftp/file/download/index.js +9 -0
- package/node/sftp/file/index.d.ts +3 -0
- package/node/sftp/file/index.js +14 -0
- package/node/sftp/file/upload/index.d.ts +24 -0
- package/node/sftp/file/upload/index.js +9 -0
- package/node/sftp/index.d.ts +2 -0
- package/node/sftp/index.js +11 -0
- package/package.json +7 -5
@@ -0,0 +1,16 @@
|
|
1
|
+
import {
|
2
|
+
file_exports
|
3
|
+
} from "./chunk-D5E2CIDK.js";
|
4
|
+
import {
|
5
|
+
__export
|
6
|
+
} from "./chunk-WSFCRVEQ.js";
|
7
|
+
|
8
|
+
// src/node/@aws-s3/storage/index.ts
|
9
|
+
var storage_exports = {};
|
10
|
+
__export(storage_exports, {
|
11
|
+
File: () => file_exports
|
12
|
+
});
|
13
|
+
|
14
|
+
export {
|
15
|
+
storage_exports
|
16
|
+
};
|
@@ -0,0 +1,31 @@
|
|
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(sourcePath, targetPath, bucket, options) {
|
17
|
+
const { fileOptions, copyOptions } = options ?? {};
|
18
|
+
try {
|
19
|
+
const file = bucket.file(sourcePath, fileOptions);
|
20
|
+
await file.copy(targetPath, copyOptions);
|
21
|
+
return Outcome.makeSuccess(true);
|
22
|
+
} catch (err) {
|
23
|
+
const errStr = unknownToString(err);
|
24
|
+
return Outcome.makeFailure(errStr);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
export {
|
29
|
+
copy,
|
30
|
+
copy_exports
|
31
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {
|
2
|
+
Cast,
|
3
|
+
Tree,
|
4
|
+
Utils
|
5
|
+
} from "./chunk-MOA6JFUQ.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,70 @@
|
|
1
|
+
import {
|
2
|
+
__export
|
3
|
+
} from "./chunk-WSFCRVEQ.js";
|
4
|
+
|
5
|
+
// src/node/images/exports/index.ts
|
6
|
+
var exports_exports = {};
|
7
|
+
__export(exports_exports, {
|
8
|
+
exportZipBuffer: () => exportZipBuffer,
|
9
|
+
prepareExport: () => prepareExport
|
10
|
+
});
|
11
|
+
import archiver from "archiver";
|
12
|
+
import sharp from "sharp";
|
13
|
+
import { Writable } from "stream";
|
14
|
+
async function prepareExport(imageBuffer, outputOptions) {
|
15
|
+
const resizedSharp = sharp(imageBuffer).resize({
|
16
|
+
width: outputOptions.width,
|
17
|
+
height: outputOptions.height,
|
18
|
+
fit: sharp.fit.cover
|
19
|
+
});
|
20
|
+
const qualitiedSharp = setSharpQuality(resizedSharp, outputOptions.quality, outputOptions.format);
|
21
|
+
return await qualitiedSharp.toBuffer();
|
22
|
+
}
|
23
|
+
function exportZipBuffer(zipSources, zipDirectoryName) {
|
24
|
+
return new Promise(async (resolve, reject) => {
|
25
|
+
const archive = archiver("zip", {
|
26
|
+
zlib: { level: 9 }
|
27
|
+
// Sets the compression level.
|
28
|
+
});
|
29
|
+
if (zipDirectoryName) {
|
30
|
+
archive.directory(zipDirectoryName + "/", false);
|
31
|
+
}
|
32
|
+
zipSources.forEach((zipSource) => {
|
33
|
+
const fileName = zipDirectoryName ? `${zipDirectoryName}/${zipSource.name}` : zipSource.name;
|
34
|
+
archive.append(zipSource.buffer, { name: fileName });
|
35
|
+
});
|
36
|
+
const bufferZip = await toBuffer(archive);
|
37
|
+
resolve(bufferZip);
|
38
|
+
});
|
39
|
+
}
|
40
|
+
async function toBuffer(archive) {
|
41
|
+
const chunks = [];
|
42
|
+
const writable = new Writable();
|
43
|
+
writable._write = (chunk, encoding, callback) => {
|
44
|
+
chunks.push(chunk);
|
45
|
+
callback();
|
46
|
+
};
|
47
|
+
archive.pipe(writable);
|
48
|
+
await archive.finalize();
|
49
|
+
return Buffer.concat(chunks);
|
50
|
+
}
|
51
|
+
function setSharpQuality(sharp2, quality, format) {
|
52
|
+
switch (format) {
|
53
|
+
case "png":
|
54
|
+
return sharp2.png({ quality });
|
55
|
+
case "jpeg":
|
56
|
+
return sharp2.jpeg({ quality });
|
57
|
+
case "webp":
|
58
|
+
return sharp2.webp({ quality });
|
59
|
+
case "avif":
|
60
|
+
return sharp2.avif({ quality });
|
61
|
+
default:
|
62
|
+
return sharp2;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
export {
|
67
|
+
prepareExport,
|
68
|
+
exportZipBuffer,
|
69
|
+
exports_exports
|
70
|
+
};
|
@@ -0,0 +1,31 @@
|
|
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/exists/index.ts
|
12
|
+
var exists_exports = {};
|
13
|
+
__export(exists_exports, {
|
14
|
+
exists: () => exists
|
15
|
+
});
|
16
|
+
async function exists(bucket, sourcePath, options) {
|
17
|
+
const { fileOptions, existsOptions } = options ?? {};
|
18
|
+
try {
|
19
|
+
const file = bucket.file(sourcePath, fileOptions);
|
20
|
+
const [exists2] = await file.exists(existsOptions);
|
21
|
+
return Outcome.makeSuccess(exists2);
|
22
|
+
} catch (err) {
|
23
|
+
const errStr = unknownToString(err);
|
24
|
+
return Outcome.makeFailure(errStr);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
export {
|
29
|
+
exists,
|
30
|
+
exists_exports
|
31
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import {
|
2
|
+
Cast,
|
3
|
+
Tree,
|
4
|
+
Utils
|
5
|
+
} from "./chunk-MUYZV5F3.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,20 @@
|
|
1
|
+
import {
|
2
|
+
bucket_exports
|
3
|
+
} from "./chunk-YMRAUWRW.js";
|
4
|
+
import {
|
5
|
+
file_exports
|
6
|
+
} from "./chunk-UHH75BZP.js";
|
7
|
+
import {
|
8
|
+
__export
|
9
|
+
} from "./chunk-WSFCRVEQ.js";
|
10
|
+
|
11
|
+
// src/node/@google-cloud/storage/index.ts
|
12
|
+
var storage_exports = {};
|
13
|
+
__export(storage_exports, {
|
14
|
+
Bucket: () => bucket_exports,
|
15
|
+
File: () => file_exports
|
16
|
+
});
|
17
|
+
|
18
|
+
export {
|
19
|
+
storage_exports
|
20
|
+
};
|
@@ -0,0 +1,34 @@
|
|
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/download/index.ts
|
12
|
+
var download_exports = {};
|
13
|
+
__export(download_exports, {
|
14
|
+
download: () => download
|
15
|
+
});
|
16
|
+
async function download(sourcePath, bucket, options) {
|
17
|
+
const { fileOptions, downloadOptions } = options ?? {};
|
18
|
+
try {
|
19
|
+
const file = bucket.file(sourcePath, fileOptions);
|
20
|
+
const stream = file.createReadStream(downloadOptions);
|
21
|
+
stream.on("error", (err) => {
|
22
|
+
throw err;
|
23
|
+
});
|
24
|
+
return Outcome.makeSuccess(stream);
|
25
|
+
} catch (err) {
|
26
|
+
const errStr = unknownToString(err);
|
27
|
+
return Outcome.makeFailure(errStr);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
export {
|
32
|
+
download,
|
33
|
+
download_exports
|
34
|
+
};
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import {
|
2
|
+
__export
|
3
|
+
} from "./chunk-WSFCRVEQ.js";
|
4
|
+
|
5
|
+
// src/node/@design-edito/thumbnails/common/index.ts
|
6
|
+
var common_exports = {};
|
7
|
+
__export(common_exports, {
|
8
|
+
clampNumber: () => clampNumber,
|
9
|
+
getArrayMax: () => getArrayMax,
|
10
|
+
randomInt: () => randomInt,
|
11
|
+
randomIntRange: () => randomIntRange,
|
12
|
+
shuffleArray: () => shuffleArray
|
13
|
+
});
|
14
|
+
function randomInt(max) {
|
15
|
+
return Math.floor(Math.random() * max);
|
16
|
+
}
|
17
|
+
function randomIntRange(min, max) {
|
18
|
+
const minCeiled = Math.ceil(min);
|
19
|
+
const maxFloored = Math.floor(max);
|
20
|
+
return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled);
|
21
|
+
}
|
22
|
+
function shuffleArray(array) {
|
23
|
+
return [...array].sort((a, b) => 0.5 - Math.random());
|
24
|
+
}
|
25
|
+
function clampNumber(val, min, max) {
|
26
|
+
return Math.max(min, Math.min(val, max));
|
27
|
+
}
|
28
|
+
function getArrayMax(array) {
|
29
|
+
if (!array.length || !array[0]) {
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
let max = array[0];
|
33
|
+
for (let i = 0; i < array.length; i++) {
|
34
|
+
const current = array[i];
|
35
|
+
if (current !== void 0 && current > max) {
|
36
|
+
max = current;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return max;
|
40
|
+
}
|
41
|
+
|
42
|
+
export {
|
43
|
+
randomInt,
|
44
|
+
randomIntRange,
|
45
|
+
shuffleArray,
|
46
|
+
clampNumber,
|
47
|
+
getArrayMax,
|
48
|
+
common_exports
|
49
|
+
};
|
@@ -0,0 +1,36 @@
|
|
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/download/index.ts
|
12
|
+
var download_exports = {};
|
13
|
+
__export(download_exports, {
|
14
|
+
download: () => download
|
15
|
+
});
|
16
|
+
async function download(sourcePath, bucketName, s3, options) {
|
17
|
+
const { downloadSettings } = options ?? {};
|
18
|
+
const params = {
|
19
|
+
...downloadSettings,
|
20
|
+
Bucket: bucketName,
|
21
|
+
Key: sourcePath
|
22
|
+
};
|
23
|
+
try {
|
24
|
+
const data = await s3.getObject(params).promise();
|
25
|
+
const stream = data.Body;
|
26
|
+
return Outcome.makeSuccess(stream);
|
27
|
+
} catch (err) {
|
28
|
+
const errStr = unknownToString(err);
|
29
|
+
return Outcome.makeFailure(errStr);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
export {
|
34
|
+
download,
|
35
|
+
download_exports
|
36
|
+
};
|
@@ -0,0 +1,31 @@
|
|
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/bucket/list/index.ts
|
12
|
+
var list_exports = {};
|
13
|
+
__export(list_exports, {
|
14
|
+
list: () => list
|
15
|
+
});
|
16
|
+
async function list(bucket, options) {
|
17
|
+
const { getFileOptions } = options ?? {};
|
18
|
+
try {
|
19
|
+
const [files] = await bucket.getFiles(getFileOptions);
|
20
|
+
const fileNames = files.map((file) => file.name);
|
21
|
+
return Outcome.makeSuccess(fileNames);
|
22
|
+
} catch (err) {
|
23
|
+
const errStr = unknownToString(err);
|
24
|
+
return Outcome.makeFailure(errStr);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
export {
|
29
|
+
list,
|
30
|
+
list_exports
|
31
|
+
};
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import {
|
2
|
+
areaCompose
|
3
|
+
} from "./chunk-FJTOFK3C.js";
|
4
|
+
import {
|
5
|
+
__export
|
6
|
+
} from "./chunk-WSFCRVEQ.js";
|
7
|
+
|
8
|
+
// src/node/images/transform/index.ts
|
9
|
+
var transform_exports = {};
|
10
|
+
__export(transform_exports, {
|
11
|
+
isOperation: () => isOperation,
|
12
|
+
transformImage: () => transformImage
|
13
|
+
});
|
14
|
+
import sharp from "sharp";
|
15
|
+
async function transformImage(imageBuffer, operations, maxDimensions) {
|
16
|
+
const imageSharp = sharp(imageBuffer);
|
17
|
+
let imageSharped = imageSharp;
|
18
|
+
for await (const operation of operations) {
|
19
|
+
if (isOperation(operation)) {
|
20
|
+
imageSharped = await applyOperation(imageSharped, operation, maxDimensions);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return await imageSharped.toBuffer();
|
24
|
+
}
|
25
|
+
function isOperation(operation) {
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
async function applyOperation(imageSharp, operation, maxDimensions) {
|
29
|
+
switch (operation.name) {
|
30
|
+
case "rotate":
|
31
|
+
return imageSharp.rotate(operation.params.angle);
|
32
|
+
case "resize":
|
33
|
+
return imageSharp.resize({
|
34
|
+
width: operation.params.width,
|
35
|
+
height: operation.params.height,
|
36
|
+
fit: operation.params.fit || "cover",
|
37
|
+
background: { r: 255, g: 255, b: 255, alpha: 0 }
|
38
|
+
});
|
39
|
+
/* Adds a transparent background (necessary for png) */
|
40
|
+
case "area-composition":
|
41
|
+
const composedImage = await areaCompose(imageSharp, {
|
42
|
+
...operation.params,
|
43
|
+
dimensions: {
|
44
|
+
w: maxDimensions.width,
|
45
|
+
h: maxDimensions.height
|
46
|
+
}
|
47
|
+
});
|
48
|
+
return composedImage;
|
49
|
+
default:
|
50
|
+
return imageSharp;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
export {
|
55
|
+
transformImage,
|
56
|
+
isOperation,
|
57
|
+
transform_exports
|
58
|
+
};
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import {
|
2
|
+
upload as upload2
|
3
|
+
} from "./chunk-N5QAGJXV.js";
|
4
|
+
import {
|
5
|
+
upload
|
6
|
+
} from "./chunk-KH5JTC2N.js";
|
7
|
+
import {
|
8
|
+
upload as upload4
|
9
|
+
} from "./chunk-AZLVQV5A.js";
|
10
|
+
import {
|
11
|
+
upload as upload3
|
12
|
+
} from "./chunk-AIESW26U.js";
|
13
|
+
import {
|
14
|
+
makeClient
|
15
|
+
} from "./chunk-P3QFJTAE.js";
|
16
|
+
import {
|
17
|
+
s3IdentifierData
|
18
|
+
} from "./chunk-CMWR77VW.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/upload/index.ts
|
27
|
+
var upload_exports = {};
|
28
|
+
__export(upload_exports, {
|
29
|
+
upload: () => upload5
|
30
|
+
});
|
31
|
+
import { Bucket } from "@google-cloud/storage";
|
32
|
+
import { S3 } from "aws-sdk";
|
33
|
+
import { Client as FtpClient } from "basic-ftp";
|
34
|
+
import SftpClient from "ssh2-sftp-client";
|
35
|
+
async function upload5(fileReadable, targetPath, endpointType, endpointIdentifier, credentials, client) {
|
36
|
+
if (client === void 0) {
|
37
|
+
const clientCreationOutcome = await makeClient(endpointType, endpointIdentifier, credentials);
|
38
|
+
if (!clientCreationOutcome.success) return Outcome.makeFailure(clientCreationOutcome.error);
|
39
|
+
client = clientCreationOutcome.payload;
|
40
|
+
}
|
41
|
+
if (endpointType === "gcs-bucket" /* GCS */ && client instanceof Bucket) return await upload(fileReadable, targetPath, client);
|
42
|
+
if (endpointType === "s3-bucket" /* S3 */ && client instanceof S3) {
|
43
|
+
const { bucketName } = s3IdentifierData(endpointIdentifier);
|
44
|
+
if (bucketName === null) return Outcome.makeFailure("Invalid S3 bucket name");
|
45
|
+
return await upload2(fileReadable, targetPath, bucketName, client);
|
46
|
+
}
|
47
|
+
if (endpointType === "ftp" /* FTP */ && client instanceof FtpClient) return await upload3(fileReadable, targetPath, client);
|
48
|
+
if (endpointType === "ftps" /* FTPS */ && client instanceof FtpClient) return await upload3(fileReadable, targetPath, client);
|
49
|
+
if (endpointType === "sftp" /* SFTP */ && client instanceof SftpClient) return await upload4(fileReadable, targetPath, client);
|
50
|
+
return Outcome.makeFailure("Invalid endpoint or client type");
|
51
|
+
}
|
52
|
+
|
53
|
+
export {
|
54
|
+
upload5 as upload,
|
55
|
+
upload_exports
|
56
|
+
};
|
@@ -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(fileStream, targetPath, ftpClient, options) {
|
17
|
+
const {
|
18
|
+
ensureDir = false,
|
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,31 @@
|
|
1
|
+
import {
|
2
|
+
shuffle
|
3
|
+
} from "./chunk-VJJIYJMY.js";
|
4
|
+
import {
|
5
|
+
isArrayOf
|
6
|
+
} from "./chunk-6RGDWX4A.js";
|
7
|
+
import {
|
8
|
+
make
|
9
|
+
} from "./chunk-RLAZR3NL.js";
|
10
|
+
import {
|
11
|
+
randomPick,
|
12
|
+
randomPickMany
|
13
|
+
} from "./chunk-B446JIN3.js";
|
14
|
+
import {
|
15
|
+
findDuplicates
|
16
|
+
} from "./chunk-YS6WMSWC.js";
|
17
|
+
|
18
|
+
// src/agnostic/arrays/index.tsx
|
19
|
+
var Arrays;
|
20
|
+
((Arrays2) => {
|
21
|
+
Arrays2.findDuplicates = findDuplicates;
|
22
|
+
Arrays2.isArrayOf = isArrayOf;
|
23
|
+
Arrays2.make = make;
|
24
|
+
Arrays2.randomPick = randomPick;
|
25
|
+
Arrays2.randomPickMany = randomPickMany;
|
26
|
+
Arrays2.shuffle = shuffle;
|
27
|
+
})(Arrays || (Arrays = {}));
|
28
|
+
|
29
|
+
export {
|
30
|
+
Arrays
|
31
|
+
};
|
@@ -0,0 +1,39 @@
|
|
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/sftp/file/upload/index.ts
|
12
|
+
var upload_exports = {};
|
13
|
+
__export(upload_exports, {
|
14
|
+
upload: () => upload
|
15
|
+
});
|
16
|
+
async function upload(fileStream, targetPath, sftp, options) {
|
17
|
+
const {
|
18
|
+
ensureDir = false,
|
19
|
+
overwrite = false
|
20
|
+
} = options ?? {};
|
21
|
+
try {
|
22
|
+
const exists = await sftp.exists(targetPath);
|
23
|
+
if (exists && !overwrite) return Outcome.makeFailure(`File already exists at ${targetPath}.`);
|
24
|
+
if (ensureDir) {
|
25
|
+
const dirPath = targetPath.substring(0, targetPath.lastIndexOf("/"));
|
26
|
+
await sftp.mkdir(dirPath, true);
|
27
|
+
}
|
28
|
+
await sftp.put(fileStream, targetPath, options);
|
29
|
+
return Outcome.makeSuccess(true);
|
30
|
+
} catch (err) {
|
31
|
+
const errStr = unknownToString(err);
|
32
|
+
return Outcome.makeFailure(errStr);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
export {
|
37
|
+
upload,
|
38
|
+
upload_exports
|
39
|
+
};
|