@visulima/storage 1.0.10 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/LICENSE.md +33 -22
- package/dist/adapter/nuxt/module.d.ts +5 -4
- package/dist/ai/ai-sdk/index.d.ts +4 -3
- package/dist/ai/claude/index.d.ts +3 -2
- package/dist/ai/openai/index.d.ts +4 -3
- package/dist/ai/tanstack/index.d.ts +3 -2
- package/dist/handler/http/fetch/index.d.ts +8 -7
- package/dist/handler/http/fetch/index.js +1 -1
- package/dist/handler/http/hono/index.d.ts +5 -4
- package/dist/handler/http/hono/index.js +1 -1
- package/dist/handler/http/nextjs/index.d.ts +5 -4
- package/dist/handler/http/nextjs/index.js +1 -1
- package/dist/handler/http/node/index.d.ts +8 -7
- package/dist/handler/http/node/index.js +1 -1
- package/dist/handler/http/solid-start/index.d.ts +5 -4
- package/dist/handler/http/solid-start/index.js +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1 -1
- package/dist/packem_shared/{AbstractBaseStorage-CiPEMcuo.js → AbstractBaseStorage-CLsYmMZg.js} +1 -1
- package/dist/packem_shared/AwsLightStorage-DGSPFUqr.js +1 -0
- package/dist/packem_shared/AzureStorage-DvKk_hhz.js +1 -0
- package/dist/packem_shared/BoxMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{BoxStorage-B8_oCz27.js → BoxStorage-CmM95wi2.js} +1 -1
- package/dist/packem_shared/BunS3MetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{BunS3Storage-_PVXu_na.js → BunS3Storage-B_roVJ29.js} +1 -1
- package/dist/packem_shared/BunnyMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{BunnyStorage-BsoWjScH.js → BunnyStorage-eZ1QDVaY.js} +1 -1
- package/dist/packem_shared/CloudinaryMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/{CloudinaryStorage-BNwiLF9V.js → CloudinaryStorage-CpH2f0Fv.js} +1 -1
- package/dist/packem_shared/DiskStorage-DzjjqCzo.js +1 -0
- package/dist/packem_shared/{DiskStorageWithChecksum-UnCtyEvs.js → DiskStorageWithChecksum-MZkDEyts.js} +1 -1
- package/dist/packem_shared/DropboxMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{DropboxStorage-BS9kj0nH.js → DropboxStorage-BB9NoWK2.js} +1 -1
- package/dist/packem_shared/{Files-CpIcMjP0.js → Files-DyMJ9FPN.js} +1 -1
- package/dist/packem_shared/FirebaseMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/{FirebaseStorage-DNquii2p.js → FirebaseStorage-BgbxzYNC.js} +1 -1
- package/dist/packem_shared/FtpMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{FtpStorage-Bd004--s.js → FtpStorage-CNqXDz7P.js} +1 -1
- package/dist/packem_shared/{GCSMetaStorage-Bf4qDFB1.js → GCSMetaStorage-Cm_XzR0C.js} +1 -1
- package/dist/packem_shared/GCStorage-DcvsI7eu.js +1 -0
- package/dist/packem_shared/GoogleDriveMetaStorage-B0gLF7Io.js +1 -0
- package/dist/packem_shared/{GoogleDriveStorage-v1glykjd.js → GoogleDriveStorage-Du7uBhSm.js} +1 -1
- package/dist/packem_shared/{LocalMetaStorage-YWPBYEe7.js → LocalMetaStorage-CcGfFG39.js} +1 -1
- package/dist/packem_shared/{MemoryStorage-9gbWd09l.js → MemoryStorage-ChKyI6OY.js} +1 -1
- package/dist/packem_shared/{Multipart-D0ok6BBy.js → Multipart-C35TR2qL.js} +1 -1
- package/dist/packem_shared/{Multipart-CQjYqU--.js → Multipart-V64Bg5dt.js} +1 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/NetlifyBlobStorage-CZsr_0DF.js +1 -0
- package/dist/packem_shared/OneDriveMetaStorage-B0gLF7Io.js +1 -0
- package/dist/packem_shared/{OneDriveStorage-BJ3Kzxc5.js → OneDriveStorage-B8qFgMq1.js} +1 -1
- package/dist/packem_shared/PocketBaseMetaStorage-Cm3v8g1-.js +1 -0
- package/dist/packem_shared/{PocketBaseStorage-DqKHbbvn.js → PocketBaseStorage-D2vMN-oY.js} +1 -1
- package/dist/packem_shared/{Rest-DvfN4-kf.js → Rest-BrEMYgxZ.js} +1 -1
- package/dist/packem_shared/{Rest-CI_BiZPv.js → Rest-aPVP2ww1.js} +1 -1
- package/dist/packem_shared/{S3Storage-BiI2k6d1.js → S3Storage-CTe_BMDl.js} +1 -1
- package/dist/packem_shared/SftpMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{SftpStorage-w8XdtZtw.js → SftpStorage-BKeAzuej.js} +1 -1
- package/dist/packem_shared/SharePointMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{SharePointStorage-DpDpI7Ln.js → SharePointStorage-Dtnt5-wk.js} +1 -1
- package/dist/packem_shared/SupabaseMetaStorage-B0gLF7Io.js +1 -0
- package/dist/packem_shared/{SupabaseStorage-B_ugUCs7.js → SupabaseStorage-CmGQjqXf.js} +1 -1
- package/dist/packem_shared/{Tus-BlBZykIL.js → Tus-CJBgnJrn.js} +1 -1
- package/dist/packem_shared/{Tus-BBVt2ky3.js → Tus-D9c7KDnl.js} +1 -1
- package/dist/packem_shared/UploadThingMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/{UploadThingStorage-_H45IVqX.js → UploadThingStorage-DZ4zNvDH.js} +1 -1
- package/dist/packem_shared/VercelBlobMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{VercelBlobStorage-U1YMKeHs.js → VercelBlobStorage-DDNEofR3.js} +1 -1
- package/dist/packem_shared/{base-handler-core-D-9Ku1h-.js → base-handler-core-BJP9jHCE.js} +1 -1
- package/dist/packem_shared/{base-handler-fetch-CfkNakv8.js → base-handler-fetch-yrYrukwL.js} +1 -1
- package/dist/packem_shared/base-handler-node-C8P9rkaH.js +1 -0
- package/dist/packem_shared/{createRetryWrapper-CxgiV_hH.js → createRetryWrapper-DgmeHPNF.js} +1 -1
- package/dist/packem_shared/disk-storage-DqnnFQAQ.js +1 -0
- package/dist/packem_shared/{disk-storage-with-checksum.d-CQucFacO.d.ts → disk-storage-with-checksum.d-Dgwyza8a.d.ts} +1 -1
- package/dist/packem_shared/{executors.d-DeDH3Ilt.d.ts → executors.d-B9dIy3NT.d.ts} +2 -1
- package/dist/packem_shared/{files.d-D8H_ge9Y.d.ts → files.d-CmSZi3M0.d.ts} +1 -1
- package/dist/packem_shared/gcs-meta-storage-Bu2upyHK.js +1 -0
- package/dist/packem_shared/local-meta-storage-BELb1YwO.js +11 -0
- package/dist/packem_shared/{local-meta-storage.d-DuTEzyii.d.ts → local-meta-storage.d-cRTXr1kb.d.ts} +1 -1
- package/dist/packem_shared/{media-transformer.d-CvMFjINm.d.ts → media-transformer.d-C8tn4J2Z.d.ts} +2 -2
- package/dist/packem_shared/{memory-storage.d-BRdTiY8y.d.ts → memory-storage.d-BNZvDG1b.d.ts} +1 -1
- package/dist/packem_shared/path-C-OWflAo-_mqb5p5d.js +1 -0
- package/dist/packem_shared/{rest-base-e0reNDE_.js → rest-base-BQ_dhWyV.js} +1 -1
- package/dist/packem_shared/s3-base-storage-CX94H-Za.js +1 -0
- package/dist/packem_shared/{s3-base-storage.d-Cg7m4FuH.d.ts → s3-base-storage.d-ks99NSs-.d.ts} +1 -1
- package/dist/packem_shared/storage-DR7qdwBN.js +1 -0
- package/dist/packem_shared/{storage.d-DIav_lF1.d.ts → storage.d-DwdJrArF.d.ts} +26 -3
- package/dist/packem_shared/{tus-base.d-BiEg5t4t.d.ts → tus-base.d-BKBoJVy0.d.ts} +4 -3
- package/dist/packem_shared/{types.d-DgHhkCAl.d.ts → types.d-B1_xZIhu.d.ts} +1 -1
- package/dist/packem_shared/{types.d-CAAzKiI6.d.ts → types.d-BEUv414z.d.ts} +1 -1
- package/dist/packem_shared/{types.d-jAs_Rp_v.d.ts → types.d-D7Zlz5RE.d.ts} +2 -2
- package/dist/storage/aws/index.d.ts +3 -2
- package/dist/storage/aws/index.js +1 -1
- package/dist/storage/aws-light/index.d.ts +3 -2
- package/dist/storage/aws-light/index.js +1 -1
- package/dist/storage/azure/index.d.ts +2 -1
- package/dist/storage/azure/index.js +1 -1
- package/dist/storage/box/index.d.ts +3 -2
- package/dist/storage/box/index.js +1 -1
- package/dist/storage/bun-s3/index.d.ts +3 -2
- package/dist/storage/bun-s3/index.js +1 -1
- package/dist/storage/bunny/index.d.ts +3 -2
- package/dist/storage/bunny/index.js +1 -1
- package/dist/storage/cloudinary/index.d.ts +3 -2
- package/dist/storage/cloudinary/index.js +1 -1
- package/dist/storage/dropbox/index.d.ts +3 -2
- package/dist/storage/dropbox/index.js +1 -1
- package/dist/storage/firebase/index.d.ts +3 -2
- package/dist/storage/firebase/index.js +1 -1
- package/dist/storage/ftp/index.d.ts +3 -2
- package/dist/storage/ftp/index.js +1 -1
- package/dist/storage/gcs/index.d.ts +2 -1
- package/dist/storage/gcs/index.js +1 -1
- package/dist/storage/google-drive/index.d.ts +3 -2
- package/dist/storage/google-drive/index.js +1 -1
- package/dist/storage/local/index.d.ts +4 -3
- package/dist/storage/local/index.js +1 -1
- package/dist/storage/memory/index.d.ts +3 -2
- package/dist/storage/memory/index.js +1 -1
- package/dist/storage/netlify-blob/index.d.ts +3 -2
- package/dist/storage/netlify-blob/index.js +1 -1
- package/dist/storage/onedrive/index.d.ts +5 -4
- package/dist/storage/onedrive/index.js +1 -1
- package/dist/storage/pocketbase/index.d.ts +3 -2
- package/dist/storage/pocketbase/index.js +1 -1
- package/dist/storage/sftp/index.d.ts +3 -2
- package/dist/storage/sftp/index.js +1 -1
- package/dist/storage/sharepoint/index.d.ts +4 -3
- package/dist/storage/sharepoint/index.js +1 -1
- package/dist/storage/supabase/index.d.ts +3 -2
- package/dist/storage/supabase/index.js +1 -1
- package/dist/storage/uploadthing/index.d.ts +3 -2
- package/dist/storage/uploadthing/index.js +1 -1
- package/dist/storage/vercel-blob/index.d.ts +3 -2
- package/dist/storage/vercel-blob/index.js +1 -1
- package/dist/transformer/audio-transformer.d.ts +3 -2
- package/dist/transformer/image-transformer.d.ts +3 -2
- package/dist/transformer/index.d.ts +4 -3
- package/dist/transformer/video-transformer.d.ts +3 -2
- package/package.json +2 -2
- package/dist/packem_shared/AwsLightStorage-EsqkAtU5.js +0 -1
- package/dist/packem_shared/AzureStorage-DL-U7qFG.js +0 -1
- package/dist/packem_shared/BoxMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/BunS3MetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/BunnyMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/CloudinaryMetaStorage-BI9YXcwU.js +0 -1
- package/dist/packem_shared/DiskStorage-D-NtQDms.js +0 -1
- package/dist/packem_shared/DropboxMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/FirebaseMetaStorage-BI9YXcwU.js +0 -1
- package/dist/packem_shared/FtpMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/GCStorage-ChqEpgqR.js +0 -1
- package/dist/packem_shared/GoogleDriveMetaStorage-xlHfKwmR.js +0 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-BI9YXcwU.js +0 -1
- package/dist/packem_shared/NetlifyBlobStorage-BPyEWSnx.js +0 -1
- package/dist/packem_shared/OneDriveMetaStorage-xlHfKwmR.js +0 -1
- package/dist/packem_shared/PocketBaseMetaStorage-DnrxOQhO.js +0 -1
- package/dist/packem_shared/SftpMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/SharePointMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/SupabaseMetaStorage-xlHfKwmR.js +0 -1
- package/dist/packem_shared/UploadThingMetaStorage-BI9YXcwU.js +0 -1
- package/dist/packem_shared/VercelBlobMetaStorage-CHWrhgg2.js +0 -1
- package/dist/packem_shared/base-handler-node-BF1v1qDa.js +0 -1
- package/dist/packem_shared/disk-storage-BwPk2IRa.js +0 -1
- package/dist/packem_shared/gcs-meta-storage-DQGu_cHq.js +0 -1
- package/dist/packem_shared/local-meta-storage-DJDcuxf1.js +0 -11
- package/dist/packem_shared/path-0oTTdkvl-DvWvbDbh.js +0 -1
- package/dist/packem_shared/s3-base-storage-CMUui93V.js +0 -1
- package/dist/packem_shared/storage-0j5nCAUp.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{utimes as Yt}from"node:fs/promises";import{tmpdir as Zt}from"node:os";import{createRequire as k}from"node:module";import{b as Jt,J as he,P as ht,w as Dt,W as et,K as Pt}from"./path-C-OWflAo-_mqb5p5d.js";import{throwErrorCode as ot,ERRORS as st}from"./ERRORS-BIBxE2oR.js";import er from"./MetaStorage-DPEUyWgN.js";import{stringifyMetadata as tr,parseMetadata as rr}from"./Metadata-B7CcBueg.js";const Ft=0;let or;const sr=e=>(or??=k(import.meta.url))(e),be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nr=e=>{if(typeof be<"u"&&be.versions&&be.versions.node){const[t,r]=be.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return be.getBuiltinModule(e)}return sr(e)},{fileURLToPath:ir}=nr("node:url");function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vt,Et;function ar(){return Et||(Et=1,vt=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),vt}var lr=ar();const pr=ur(lr);new Set(pr);const ye=e=>Jt(e instanceof URL?ir(e):e);let cr=class extends Error{constructor(t){super(`EEXIST: ${t}`)}get code(){return"EEXIST"}set code(t){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(t){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const ge=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")};let fr;const dr=e=>(fr??=k(import.meta.url))(e),$e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hr=e=>{if(typeof $e<"u"&&$e.versions&&$e.versions.node){const[t,r]=$e.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return $e.getBuiltinModule(e)}return dr(e)};hr("node:fs/promises");let gr;const mr=e=>(gr??=k(import.meta.url))(e),ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yr=e=>{if(typeof ve<"u"&&ve.versions&&ve.versions.node){const[t,r]=ve.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ve.getBuiltinModule(e)}return mr(e)};yr("node:fs");const gt=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let br;const $r=e=>(br??=k(import.meta.url))(e),Ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vr=e=>{if(typeof Ee<"u"&&Ee.versions&&Ee.versions.node){const[t,r]=Ee.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ee.getBuiltinModule(e)}return $r(e)},{lstat:At,mkdir:Er}=vr("node:fs/promises"),Gt=async e=>{ge(e);try{const t=await At(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(gt(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{await Er(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=await At(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(gt(r))}'`,{cause:t})}};let Ar;const wr=e=>(Ar??=k(import.meta.url))(e),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rr=e=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[t,r]=Ae.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ae.getBuiltinModule(e)}return wr(e)};Rr("node:fs");let xr;const _r=e=>(xr??=k(import.meta.url))(e),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tr=e=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[t,r]=we.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return we.getBuiltinModule(e)}return _r(e)},{lstat:Sr,writeFile:Cr}=Tr("node:fs/promises"),on=async e=>{ge(e);try{const t=await Sr(e);if(!t.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(gt(t))}'`)}catch(t){if(t.code==="ENOENT"){await Gt(he(ye(e))),await Cr(e,new Uint8Array);return}throw t}};let Or;const kr=e=>(Or??=k(import.meta.url))(e),Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nr=e=>{if(typeof Re<"u"&&Re.versions&&Re.versions.node){const[t,r]=Re.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Re.getBuiltinModule(e)}return kr(e)};Nr("node:fs");let Lr;const Hr=e=>(Lr??=k(import.meta.url))(e),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mr=e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,r]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return xe.getBuiltinModule(e)}return Hr(e)};Mr("node:fs/promises");let Br;const Ir=e=>(Br??=k(import.meta.url))(e),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Dr=e=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[t,r]=_e.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return _e.getBuiltinModule(e)}return Ir(e)};Dr("node:fs");let Pr;const Fr=e=>(Pr??=k(import.meta.url))(e),Te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gr=e=>{if(typeof Te<"u"&&Te.versions&&Te.versions.node){const[t,r]=Te.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Te.getBuiltinModule(e)}return Fr(e)};Gr("node:fs/promises");let Ur;const Xr=e=>(Ur??=k(import.meta.url))(e),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zr=e=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[t,r]=Se.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Se.getBuiltinModule(e)}return Xr(e)};zr("node:fs");let wt=class extends Error{root;constructor(t,r){super(`${t instanceof Error?t.message:String(t)} for path "${r}"`),this.cause=t,this.root=r}get name(){return"WalkError"}set name(t){throw new Error("Cannot overwrite name of WalkError")}};const Kr=e=>{const t=[],r=new Set;let m=0;for(const p of e){if(p==="{")t.push(m);else if(p==="}"){const l=t.pop();l!==void 0&&(r.add(l),r.add(m))}m+=1}let c=0,o=0,a="";for(const p of e)p==="{"?r.has(o)?(a+="(",c+=1):a+=String.raw`\{`:p==="}"?r.has(o)?(a+=")",c-=1):a+=String.raw`\}`:p===","&&c>0?a+="|":a+=p,o+=1;return a},Rt=e=>{const t=e.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`),r=Kr(t).replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${r}$`)}catch(m){throw new Error(`Invalid glob pattern: ${e}`,{cause:m})}};let jr=class{name;path;#e;constructor(t,r,m){this.#e=t,this.name=r,this.path=m}isDirectory(){return this.#e.isDirectory()}isFile(){return this.#e.isFile()}isSymbolicLink(){return this.#e.isSymbolicLink()}};const mt=(e,t,r)=>new jr(e,t,r),Je=(e,t,r,m)=>{if(Array.isArray(t)&&t.length>0&&!t.some(o=>e.endsWith(o)))return!1;const c=e.includes("\\")?e.replaceAll("\\","/"):e;return r&&!r.some(o=>o.test(c))?!1:!m?.some(o=>o.test(c))};let Wr;const Qr=e=>(Wr??=k(import.meta.url))(e),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qr=e=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[t,r]=Ce.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ce.getBuiltinModule(e)}return Qr(e)},{readdir:Vr,realpath:Yr,stat:Ut}=qr("node:fs/promises"),Zr=async e=>{const t=et(e),r=Pt(t),m=await Ut(t);return mt(m,r,t)};async function*Jr(e,t={}){const{extensions:r,followSymlinks:m=!1,includeDirs:c=!0,includeFiles:o=!0,includeSymlinks:a=!0,match:p,maxDepth:l=Number.POSITIVE_INFINITY,skip:E}=t;if(ge(e),l<0)return;const h=t.visited??new Set,R=p?p.map(b=>typeof b=="string"?Rt(b):b):void 0,_=E?E.map(b=>typeof b=="string"?Rt(b):b):void 0;if(e=ht(ye(e)),c&&Je(e,r,R,_)&&(yield await Zr(e)),!(l<1||!Je(e,void 0,void 0,_)))try{const b=await Vr(e,{withFileTypes:!0});for(const C of b){let X=Dt(e,C.name),K=C,{name:j}=C,H=C.isDirectory(),g=C.isFile();if(C.isSymbolicLink())if(m){const y=et(await Yr(X));if(h.has(y))continue;X=y;const s=await Ut(y);H=s.isDirectory(),g=s.isFile(),K=s,j=Pt(y)}else if(a&&Je(X,r,R,_)){yield mt(C,C.name,X);continue}else continue;H?(m&&h.add(X),yield*Jr(X,{extensions:r,followSymlinks:m,includeDirs:c,includeFiles:o,includeSymlinks:a,match:R,maxDepth:l-1,skip:_,visited:h})):g&&o&&Je(X,r,R,_)&&(yield mt(K,j,X))}}catch(b){throw b instanceof wt?b:new wt(b,e)}}let eo;const to=e=>(eo??=k(import.meta.url))(e),Oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=e=>{if(typeof Oe<"u"&&Oe.versions&&Oe.versions.node){const[t,r]=Oe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Oe.getBuiltinModule(e)}return to(e)};ro("node:fs");let oo;const so=e=>(oo??=k(import.meta.url))(e),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,no=e=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[t,r]=ke.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ke.getBuiltinModule(e)}return so(e)};no("node:fs/promises");let io;const uo=e=>(io??=k(import.meta.url))(e),Ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ao=e=>{if(typeof Ne<"u"&&Ne.versions&&Ne.versions.node){const[t,r]=Ne.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ne.getBuiltinModule(e)}return uo(e)};ao("node:fs");function bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xt={},nt,_t;function tt(){if(_t)return nt;_t=1;const e="[^\\\\/]",t=Symbol("unignore"),r="\\.",m="\\+",c="\\?",o="\\/",a="(?=.)",p="[^/]",l=`(?:${o}|$)`,E=`(?:^|${o})`,h=`${r}{1,2}${l}`,R=`(?!${r})`,_=`(?!${E}${h})`,b=`(?!${r}{0,1}${l})`,C=`(?!${h})`,X=`[^.${o}]`,K=`${p}*?`,j="/",H={DOT_LITERAL:r,PLUS_LITERAL:m,QMARK_LITERAL:c,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:p,END_ANCHOR:l,DOTS_SLASH:h,NO_DOT:R,NO_DOTS:_,NO_DOT_SLASH:b,NO_DOTS_SLASH:C,QMARK_NO_DOT:X,STAR:K,START_ANCHOR:E,SEP:j},g={...H,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},y={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return nt={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:y,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?g:H}},nt}var Tt;function rt(){return Tt||(Tt=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:m,REGEX_SPECIAL_CHARS_GLOBAL:c}=tt();e.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),e.hasRegexChars=o=>m.test(o),e.isRegexChar=o=>o.length===1&&e.hasRegexChars(o),e.escapeRegex=o=>o.replace(c,"\\$1"),e.toPosixSlashes=o=>o.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const o=navigator.platform.toLowerCase();return o==="win32"||o==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=o=>o.replace(r,a=>a==="\\"?"":a),e.escapeLast=(o,a,p)=>{const l=o.lastIndexOf(a,p);return l===-1?o:o[l-1]==="\\"?e.escapeLast(o,a,l-1):`${o.slice(0,l)}\\${o.slice(l)}`},e.removePrefix=(o,a={})=>{let p=o;return p.startsWith("./")&&(p=p.slice(2),a.prefix="./"),p},e.wrapOutput=(o,a={},p={})=>{const l=p.contains?"":"^",E=p.contains?"":"$";let h=`${l}(?:${o})${E}`;return a.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},e.basename=(o,{windows:a}={})=>{const p=o.split(a?/[\\/]/:"/"),l=p[p.length-1];return l===""?p[p.length-2]:l}})(xt)),xt}var it,St;function lo(){if(St)return it;St=1;const e=rt(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:m,CHAR_COMMA:c,CHAR_DOT:o,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:l,CHAR_LEFT_PARENTHESES:E,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:R,CHAR_QUESTION_MARK:_,CHAR_RIGHT_CURLY_BRACE:b,CHAR_RIGHT_PARENTHESES:C,CHAR_RIGHT_SQUARE_BRACKET:X}=tt(),K=H=>H===p||H===m,j=H=>{H.isPrefix!==!0&&(H.depth=H.isGlobstar?1/0:1)};return it=(H,g)=>{const y=g||{},s=H.length-1,w=y.parts===!0||y.scanToEnd===!0,O=[],$=[],x=[];let v=H,W=-1,G=0,J=0,le=!1,ee=!1,U=!1,te=!1,pe=!1,se=!1,re=!1,P=!1,ne=!1,q=!1,ce=0,V,A,L={value:"",depth:0,isGlob:!1};const Q=()=>W>=s,u=()=>v.charCodeAt(W+1),I=()=>(V=A,v.charCodeAt(++W));for(;W<s;){A=I();let Y;if(A===m){re=L.backslashes=!0,A=I(),A===l&&(se=!0);continue}if(se===!0||A===l){for(ce++;Q()!==!0&&(A=I());){if(A===m){re=L.backslashes=!0,I();continue}if(A===l){ce++;continue}if(se!==!0&&A===o&&(A=I())===o){if(le=L.isBrace=!0,U=L.isGlob=!0,q=!0,w===!0)continue;break}if(se!==!0&&A===c){if(le=L.isBrace=!0,U=L.isGlob=!0,q=!0,w===!0)continue;break}if(A===b&&(ce--,ce===0)){se=!1,le=L.isBrace=!0,q=!0;break}}if(w===!0)continue;break}if(A===p){if(O.push(W),$.push(L),L={value:"",depth:0,isGlob:!1},q===!0)continue;if(V===o&&W===G+1){G+=2;continue}J=W+1;continue}if(y.noext!==!0&&(A===R||A===r||A===t||A===_||A===a)&&u()===E){if(U=L.isGlob=!0,te=L.isExtglob=!0,q=!0,A===a&&W===G&&(ne=!0),w===!0){for(;Q()!==!0&&(A=I());){if(A===m){re=L.backslashes=!0,A=I();continue}if(A===C){U=L.isGlob=!0,q=!0;break}}continue}break}if(A===t){if(V===t&&(pe=L.isGlobstar=!0),U=L.isGlob=!0,q=!0,w===!0)continue;break}if(A===_){if(U=L.isGlob=!0,q=!0,w===!0)continue;break}if(A===h){for(;Q()!==!0&&(Y=I());){if(Y===m){re=L.backslashes=!0,I();continue}if(Y===X){ee=L.isBracket=!0,U=L.isGlob=!0,q=!0;break}}if(w===!0)continue;break}if(y.nonegate!==!0&&A===a&&W===G){P=L.negated=!0,G++;continue}if(y.noparen!==!0&&A===E){if(U=L.isGlob=!0,w===!0){for(;Q()!==!0&&(A=I());){if(A===E){re=L.backslashes=!0,A=I();continue}if(A===C){q=!0;break}}continue}break}if(U===!0){if(q=!0,w===!0)continue;break}}y.noext===!0&&(te=!1,U=!1);let B=v,fe="",n="";G>0&&(fe=v.slice(0,G),v=v.slice(G),J-=G),B&&U===!0&&J>0?(B=v.slice(0,J),n=v.slice(J)):U===!0?(B="",n=v):B=v,B&&B!==""&&B!=="/"&&B!==v&&K(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),y.unescape===!0&&(n&&(n=e.removeBackslashes(n)),B&&re===!0&&(B=e.removeBackslashes(B)));const i={prefix:fe,input:H,start:G,base:B,glob:n,isBrace:le,isBracket:ee,isGlob:U,isExtglob:te,isGlobstar:pe,negated:P,negatedExtglob:ne};if(y.tokens===!0&&(i.maxDepth=0,K(A)||$.push(L),i.tokens=$),y.parts===!0||y.tokens===!0){let Y;for(let N=0;N<O.length;N++){const oe=Y?Y+1:G,ie=O[N],Z=H.slice(oe,ie);y.tokens&&(N===0&&G!==0?($[N].isPrefix=!0,$[N].value=fe):$[N].value=Z,j($[N]),i.maxDepth+=$[N].depth),(N!==0||Z!=="")&&x.push(Z),Y=ie}if(Y&&Y+1<H.length){const N=H.slice(Y+1);x.push(N),y.tokens&&($[$.length-1].value=N,j($[$.length-1]),i.maxDepth+=$[$.length-1].depth)}i.slashes=O,i.parts=x}return i},it}var ut,Ct;function po(){if(Ct)return ut;Ct=1;const e=tt(),t=rt(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:m,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:o,REPLACEMENTS:a}=e,p=(g,y)=>typeof y.expandRange=="function"?y.expandRange(...g,y):(g.sort(),`[${g.join("-")}]`),l=(g,y)=>`Missing ${g}: "${y}" - use "\\\\${y}" to match literal characters`,E=g=>{const y=[];let s=0,w=0,O=0,$="",x=!1;for(const v of g){if(x===!0){$+=v,x=!1;continue}if(v==="\\"){$+=v,x=!0;continue}if(v==='"'){O=O===1?0:1,$+=v;continue}if(O===0){if(v==="[")s++;else if(v==="]"&&s>0)s--;else if(s===0){if(v==="(")w++;else if(v===")"&&w>0)w--;else if(v==="|"&&w===0){y.push($),$="";continue}}}$+=v}return y.push($),y},h=g=>{let y=!1;for(const s of g){if(y===!0){y=!1;continue}if(s==="\\"){y=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},R=g=>{let y=g.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(y)&&(y=y.slice(2,-1),s=!0);if(h(y))return y.replace(/\\(.)/g,"$1")},_=g=>{const y=g.map(R).filter(Boolean);for(let s=0;s<y.length;s++)for(let w=s+1;w<y.length;w++){const O=y[s],$=y[w],x=O[0];if(!(!x||O!==x.repeat(O.length)||$!==x.repeat($.length))&&(O===$||O.startsWith($)||$.startsWith(O)))return!0}return!1},b=(g,y=!0)=>{if(g[0]!=="+"&&g[0]!=="*"||g[1]!=="(")return;let s=0,w=0,O=0,$=!1;for(let x=1;x<g.length;x++){const v=g[x];if($===!0){$=!1;continue}if(v==="\\"){$=!0;continue}if(v==='"'){O=O===1?0:1;continue}if(O!==1){if(v==="["){s++;continue}if(v==="]"&&s>0){s--;continue}if(!(s>0)){if(v==="("){w++;continue}if(v===")"&&(w--,w===0))return y===!0&&x!==g.length-1?void 0:{type:g[0],body:g.slice(2,x),end:x}}}}},C=g=>`${g.length===1?t.escapeRegex(g[0]):`[${g.map(y=>t.escapeRegex(y)).join("")}]`}*`,X=g=>{let y=0;const s=[];for(;y<g.length;){const w=b(g.slice(y),!1);if(!w||w.type!=="*")return;const O=E(w.body).map(x=>x.trim());if(O.length!==1)return;const $=R(O[0]);if(!$||$.length!==1)return;s.push($),y+=w.end+1}if(!(s.length<1))return s},K=g=>{let y=0,s=g.trim(),w=b(s);for(;w;)y++,s=w.body.trim(),w=b(s);return y},j=(g,y)=>{if(y.maxExtglobRecursion===!1)return{risky:!1};const s=typeof y.maxExtglobRecursion=="number"?y.maxExtglobRecursion:e.DEFAULT_MAX_EXTGLOB_RECURSION,w=E(g).map(v=>v.trim());if(w.length>1&&(w.some(v=>v==="")||w.some(v=>/^[*?]+$/.test(v))||_(w)))return{risky:!0};const O=[];let $=!1,x=!0;for(const v of w){const W=X(v);if(W){$=!0,O.push(...W);continue}const G=R(v);if(G&&G.length===1){O.push(G);continue}if(x=!1,K(v)>s)return{risky:!0}}return $?x?{risky:!0,safeOutput:C([...new Set(O)])}:{risky:!0}:{risky:!1}},H=(g,y)=>{if(typeof g!="string")throw new TypeError("Expected a string");g=a[g]||g;const s={...y},w=typeof s.maxLength=="number"?Math.min(r,s.maxLength):r;let O=g.length;if(O>w)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${w}`);const $={type:"bos",value:"",output:s.prepend||""},x=[$],v=s.capture?"":"?:",W=e.globChars(s.windows),G=e.extglobChars(W),{DOT_LITERAL:J,PLUS_LITERAL:le,SLASH_LITERAL:ee,ONE_CHAR:U,DOTS_SLASH:te,NO_DOT:pe,NO_DOT_SLASH:se,NO_DOTS_SLASH:re,QMARK:P,QMARK_NO_DOT:ne,STAR:q,START_ANCHOR:ce}=W,V=d=>`(${v}(?:(?!${ce}${d.dot?te:J}).)*?)`,A=s.dot?"":pe,L=s.dot?P:ne;let Q=s.bash===!0?V(s):q;s.capture&&(Q=`(${Q})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const u={input:g,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:x};g=t.removePrefix(g,u),O=g.length;const I=[],B=[],fe=[];let n=$,i;const Y=()=>u.index===O-1,N=u.peek=(d=1)=>g[u.index+d],oe=u.advance=()=>g[++u.index]||"",ie=()=>g.slice(u.index+1),Z=(d="",D=0)=>{u.consumed+=d,u.index+=D},Ve=d=>{u.output+=d.output!=null?d.output:d.value,Z(d.value)},qt=()=>{let d=1;for(;N()==="!"&&(N(2)!=="("||N(3)==="?");)oe(),u.start++,d++;return d%2===0?!1:(u.negated=!0,u.start++,!0)},Ye=d=>{u[d]++,fe.push(d)},de=d=>{u[d]--,fe.pop()},T=d=>{if(n.type==="globstar"){const D=u.braces>0&&(d.type==="comma"||d.type==="brace"),f=d.extglob===!0||I.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!D&&!f&&(u.output=u.output.slice(0,-n.output.length),n.type="star",n.value="*",n.output=Q,u.output+=n.output)}if(I.length&&d.type!=="paren"&&(I[I.length-1].inner+=d.value),(d.value||d.output)&&Ve(d),n&&n.type==="text"&&d.type==="text"){n.output=(n.output||n.value)+d.value,n.value+=d.value;return}d.prev=n,x.push(d),n=d},Ze=(d,D)=>{const f={...G[D],conditions:1,inner:""};f.prev=n,f.parens=u.parens,f.output=u.output,f.startIndex=u.index,f.tokensIndex=x.length;const S=(s.capture?"(":"")+f.open;Ye("parens"),T({type:d,value:D,output:u.output?"":U}),T({type:"paren",extglob:!0,value:oe(),output:S}),I.push(f)},Vt=d=>{const D=g.slice(d.startIndex,u.index+1),f=g.slice(d.startIndex+2,u.index),S=j(f,s);if((d.type==="plus"||d.type==="star")&&S.risky){const M=S.safeOutput?(d.output?"":U)+(s.capture?`(${S.safeOutput})`:S.safeOutput):void 0,ue=x[d.tokensIndex];ue.type="text",ue.value=D,ue.output=M||t.escapeRegex(D);for(let ae=d.tokensIndex+1;ae<x.length;ae++)x[ae].value="",x[ae].output="",delete x[ae].suffix;u.output=d.output+ue.output,u.backtrack=!0,T({type:"paren",extglob:!0,value:i,output:""}),de("parens");return}let F=d.close+(s.capture?")":""),z;if(d.type==="negate"){let M=Q;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(M=V(s)),(M!==Q||Y()||/^\)+$/.test(ie()))&&(F=d.close=`)$))${M}`),d.inner.includes("*")&&(z=ie())&&/^\.[^\\/.]+$/.test(z)){const ue=H(z,{...y,fastpaths:!1}).output;F=d.close=`)${ue})${M})`}d.prev.type==="bos"&&(u.negatedExtglob=!0)}T({type:"paren",extglob:!0,value:i,output:F}),de("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(g)){let d=!1,D=g.replace(o,(f,S,F,z,M,ue)=>z==="\\"?(d=!0,f):z==="?"?S?S+z+(M?P.repeat(M.length):""):ue===0?L+(M?P.repeat(M.length):""):P.repeat(F.length):z==="."?J.repeat(F.length):z==="*"?S?S+z+(M?Q:""):Q:S?f:`\\${f}`);return d===!0&&(s.unescape===!0?D=D.replace(/\\/g,""):D=D.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),D===g&&s.contains===!0?(u.output=g,u):(u.output=t.wrapOutput(D,u,y),u)}for(;!Y();){if(i=oe(),i==="\0")continue;if(i==="\\"){const f=N();if(f==="/"&&s.bash!==!0||f==="."||f===";")continue;if(!f){i+="\\",T({type:"text",value:i});continue}const S=/^\\+/.exec(ie());let F=0;if(S&&S[0].length>2&&(F=S[0].length,u.index+=F,F%2!==0&&(i+="\\")),s.unescape===!0?i=oe():i+=oe(),u.brackets===0){T({type:"text",value:i});continue}}if(u.brackets>0&&(i!=="]"||n.value==="["||n.value==="[^")){if(s.posix!==!1&&i===":"){const f=n.value.slice(1);if(f.includes("[")&&(n.posix=!0,f.includes(":"))){const S=n.value.lastIndexOf("["),F=n.value.slice(0,S),z=n.value.slice(S+2),M=m[z];if(M){n.value=F+M,u.backtrack=!0,oe(),!$.output&&x.indexOf(n)===1&&($.output=U);continue}}}(i==="["&&N()!==":"||i==="-"&&N()==="]")&&(i=`\\${i}`),i==="]"&&(n.value==="["||n.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&n.value==="["&&(i="^"),n.value+=i,Ve({value:i});continue}if(u.quotes===1&&i!=='"'){i=t.escapeRegex(i),n.value+=i,Ve({value:i});continue}if(i==='"'){u.quotes=u.quotes===1?0:1,s.keepQuotes===!0&&T({type:"text",value:i});continue}if(i==="("){Ye("parens"),T({type:"paren",value:i});continue}if(i===")"){if(u.parens===0&&s.strictBrackets===!0)throw new SyntaxError(l("opening","("));const f=I[I.length-1];if(f&&u.parens===f.parens+1){Vt(I.pop());continue}T({type:"paren",value:i,output:u.parens?")":"\\)"}),de("parens");continue}if(i==="["){if(s.nobracket===!0||!ie().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(l("closing","]"));i=`\\${i}`}else Ye("brackets");T({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||n&&n.type==="bracket"&&n.value.length===1){T({type:"text",value:i,output:`\\${i}`});continue}if(u.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(l("opening","["));T({type:"text",value:i,output:`\\${i}`});continue}de("brackets");const f=n.value.slice(1);if(n.posix!==!0&&f[0]==="^"&&!f.includes("/")&&(i=`/${i}`),n.value+=i,Ve({value:i}),s.literalBrackets===!1||t.hasRegexChars(f))continue;const S=t.escapeRegex(n.value);if(u.output=u.output.slice(0,-n.value.length),s.literalBrackets===!0){u.output+=S,n.value=S;continue}n.value=`(${v}${S}|${n.value})`,u.output+=n.value;continue}if(i==="{"&&s.nobrace!==!0){Ye("braces");const f={type:"brace",value:i,output:"(",outputIndex:u.output.length,tokensIndex:u.tokens.length};B.push(f),T(f);continue}if(i==="}"){const f=B[B.length-1];if(s.nobrace===!0||!f){T({type:"text",value:i,output:i});continue}let S=")";if(f.dots===!0){const F=x.slice(),z=[];for(let M=F.length-1;M>=0&&(x.pop(),F[M].type!=="brace");M--)F[M].type!=="dots"&&z.unshift(F[M].value);S=p(z,s),u.backtrack=!0}if(f.comma!==!0&&f.dots!==!0){const F=u.output.slice(0,f.outputIndex),z=u.tokens.slice(f.tokensIndex);f.value=f.output="\\{",i=S="\\}",u.output=F;for(const M of z)u.output+=M.output||M.value}T({type:"brace",value:i,output:S}),de("braces"),B.pop();continue}if(i==="|"){I.length>0&&I[I.length-1].conditions++,T({type:"text",value:i});continue}if(i===","){let f=i;const S=B[B.length-1];S&&fe[fe.length-1]==="braces"&&(S.comma=!0,f="|"),T({type:"comma",value:i,output:f});continue}if(i==="/"){if(n.type==="dot"&&u.index===u.start+1){u.start=u.index+1,u.consumed="",u.output="",x.pop(),n=$;continue}T({type:"slash",value:i,output:ee});continue}if(i==="."){if(u.braces>0&&n.type==="dot"){n.value==="."&&(n.output=J);const f=B[B.length-1];n.type="dots",n.output+=i,n.value+=i,f.dots=!0;continue}if(u.braces+u.parens===0&&n.type!=="bos"&&n.type!=="slash"){T({type:"text",value:i,output:J});continue}T({type:"dot",value:i,output:J});continue}if(i==="?"){if(!(n&&n.value==="(")&&s.noextglob!==!0&&N()==="("&&N(2)!=="?"){Ze("qmark",i);continue}if(n&&n.type==="paren"){const f=N();let S=i;(n.value==="("&&!/[!=<:]/.test(f)||f==="<"&&!/<([!=]|\w+>)/.test(ie()))&&(S=`\\${i}`),T({type:"text",value:i,output:S});continue}if(s.dot!==!0&&(n.type==="slash"||n.type==="bos")){T({type:"qmark",value:i,output:ne});continue}T({type:"qmark",value:i,output:P});continue}if(i==="!"){if(s.noextglob!==!0&&N()==="("&&(N(2)!=="?"||!/[!=<:]/.test(N(3)))){Ze("negate",i);continue}if(s.nonegate!==!0&&u.index===0){qt();continue}}if(i==="+"){if(s.noextglob!==!0&&N()==="("&&N(2)!=="?"){Ze("plus",i);continue}if(n&&n.value==="("||s.regex===!1){T({type:"plus",value:i,output:le});continue}if(n&&(n.type==="bracket"||n.type==="paren"||n.type==="brace")||u.parens>0){T({type:"plus",value:i});continue}T({type:"plus",value:le});continue}if(i==="@"){if(s.noextglob!==!0&&N()==="("&&N(2)!=="?"){T({type:"at",extglob:!0,value:i,output:""});continue}T({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const f=c.exec(ie());f&&(i+=f[0],u.index+=f[0].length),T({type:"text",value:i});continue}if(n&&(n.type==="globstar"||n.star===!0)){n.type="star",n.star=!0,n.value+=i,n.output=Q,u.backtrack=!0,u.globstar=!0,Z(i);continue}let d=ie();if(s.noextglob!==!0&&/^\([^?]/.test(d)){Ze("star",i);continue}if(n.type==="star"){if(s.noglobstar===!0){Z(i);continue}const f=n.prev,S=f.prev,F=f.type==="slash"||f.type==="bos",z=S&&(S.type==="star"||S.type==="globstar");if(s.bash===!0&&(!F||d[0]&&d[0]!=="/")){T({type:"star",value:i,output:""});continue}const M=u.braces>0&&(f.type==="comma"||f.type==="brace"),ue=I.length&&(f.type==="pipe"||f.type==="paren");if(!F&&f.type!=="paren"&&!M&&!ue){T({type:"star",value:i,output:""});continue}for(;d.slice(0,3)==="/**";){const ae=g[u.index+4];if(ae&&ae!=="/")break;d=d.slice(3),Z("/**",3)}if(f.type==="bos"&&Y()){n.type="globstar",n.value+=i,n.output=V(s),u.output=n.output,u.globstar=!0,Z(i);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!z&&Y()){u.output=u.output.slice(0,-(f.output+n.output).length),f.output=`(?:${f.output}`,n.type="globstar",n.output=V(s)+(s.strictSlashes?")":"|$)"),n.value+=i,u.globstar=!0,u.output+=f.output+n.output,Z(i);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&d[0]==="/"){const ae=d[1]!==void 0?"|$":"";u.output=u.output.slice(0,-(f.output+n.output).length),f.output=`(?:${f.output}`,n.type="globstar",n.output=`${V(s)}${ee}|${ee}${ae})`,n.value+=i,u.output+=f.output+n.output,u.globstar=!0,Z(i+oe()),T({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&d[0]==="/"){n.type="globstar",n.value+=i,n.output=`(?:^|${ee}|${V(s)}${ee})`,u.output=n.output,u.globstar=!0,Z(i+oe()),T({type:"slash",value:"/",output:""});continue}if(M&&d[0]==="/"){n.type="globstar",n.value+=i,n.output=`(?:^|${ee}|${V(s)}${ee})`,u.output+=n.output,u.globstar=!0,Z(i+oe()),T({type:"slash",value:"/",output:""});continue}u.output=u.output.slice(0,-n.output.length),n.type="globstar",n.output=V(s),n.value+=i,u.output+=n.output,u.globstar=!0,Z(i);continue}const D={type:"star",value:i,output:Q};if(s.bash===!0){D.output=".*?",(n.type==="bos"||n.type==="slash")&&(D.output=A+D.output),T(D);continue}if(n&&(n.type==="bracket"||n.type==="paren")&&s.regex===!0){D.output=i,T(D);continue}(u.index===u.start||n.type==="slash"||n.type==="dot")&&(n.type==="dot"?(u.output+=se,n.output+=se):s.dot===!0?(u.output+=re,n.output+=re):(u.output+=A,n.output+=A),N()!=="*"&&(u.output+=U,n.output+=U)),T(D)}for(;u.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(l("closing","]"));u.output=t.escapeLast(u.output,"["),de("brackets")}for(;u.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(l("closing",")"));u.output=t.escapeLast(u.output,"("),de("parens")}for(;u.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(l("closing","}"));u.output=t.escapeLast(u.output,"{"),de("braces")}if(s.strictSlashes!==!0&&(n.type==="star"||n.type==="bracket")&&T({type:"maybe_slash",value:"",output:`${ee}?`}),u.backtrack===!0){u.output="";for(const d of u.tokens)u.output+=d.output!=null?d.output:d.value,d.suffix&&(u.output+=d.suffix)}return u};return H.fastpaths=(g,y)=>{const s={...y},w=typeof s.maxLength=="number"?Math.min(r,s.maxLength):r,O=g.length;if(O>w)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${w}`);g=a[g]||g;const{DOT_LITERAL:$,SLASH_LITERAL:x,ONE_CHAR:v,DOTS_SLASH:W,NO_DOT:G,NO_DOTS:J,NO_DOTS_SLASH:le,STAR:ee,START_ANCHOR:U}=e.globChars(s.windows),te=s.dot?J:G,pe=s.dot?le:G,se=s.capture?"":"?:",re={negated:!1,prefix:""};let P=s.bash===!0?".*?":ee;s.capture&&(P=`(${P})`);const ne=A=>A.noglobstar===!0?P:`(${se}(?:(?!${U}${A.dot?W:$}).)*?)`,q=A=>{switch(A){case"*":return`${te}${v}${P}`;case".*":return`${$}${v}${P}`;case"*.*":return`${te}${P}${$}${v}${P}`;case"*/*":return`${te}${P}${x}${v}${pe}${P}`;case"**":return te+ne(s);case"**/*":return`(?:${te}${ne(s)}${x})?${pe}${v}${P}`;case"**/*.*":return`(?:${te}${ne(s)}${x})?${pe}${P}${$}${v}${P}`;case"**/.*":return`(?:${te}${ne(s)}${x})?${$}${v}${P}`;default:{const L=/^(.*?)\.(\w+)$/.exec(A);if(!L)return;const Q=q(L[1]);return Q?Q+$+L[2]:void 0}}},ce=t.removePrefix(g,re);let V=q(ce);return V&&s.strictSlashes!==!0&&(V+=`${x}?`),V},ut=H,ut}var at,Ot;function co(){if(Ot)return at;Ot=1;const e=lo(),t=po(),r=rt(),m=tt(),c=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,p,l=!1)=>{if(Array.isArray(a)){const K=a.map(j=>o(j,p,l));return j=>{for(const H of K){const g=H(j);if(g)return g}return!1}}const E=c(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!E)throw new TypeError("Expected pattern to be a non-empty string");const h=p||{},R=h.windows,_=E?o.compileRe(a,p):o.makeRe(a,p,!1,!0),b=_.state;delete _.state;let C=()=>!1;if(h.ignore){const K={...p,ignore:null,onMatch:null,onResult:null};C=o(h.ignore,K,l)}const X=(K,j=!1)=>{const{isMatch:H,match:g,output:y}=o.test(K,_,p,{glob:a,posix:R}),s={glob:a,state:b,regex:_,posix:R,input:K,output:y,match:g,isMatch:H};if(typeof h.onResult=="function"&&h.onResult(s),H===!1)return s.isMatch=!1,j?s:!1;e:if(C(K)){if(typeof h.onIgnore=="function"&&h.onIgnore(s)===m.UNIGNORE){s.isMatch=!0;break e}return s.isMatch=!1,j?s:!1}return typeof h.onMatch=="function"&&h.onMatch(s),j?s:!0};return l&&(X.state=b),X};return o.test=(a,p,l,{glob:E,posix:h}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const R=l||{},_=R.format||(h?r.toPosixSlashes:null);let b=a===E,C=b&&_?_(a):a;return b===!1&&(C=_?_(a):a,b=C===E),(b===!1||R.capture===!0)&&(R.matchBase===!0||R.basename===!0?b=o.matchBase(a,p,l,h):b=p.exec(C)),{isMatch:!!b,match:b,output:C}},o.matchBase=(a,p,l,E=l&&l.windows)=>(p instanceof RegExp?p:o.makeRe(p,l)).test(r.basename(a,{windows:E})),o.isMatch=(a,p,l)=>o(p,l)(a),o.parse=(a,p)=>Array.isArray(a)?a.map(l=>o.parse(l,p)):t(a,{...p,fastpaths:!1}),o.scan=(a,p)=>e(a,p),o.compileRe=(a,p,l=!1,E=!1)=>{if(l===!0)return a.output;const h=p||{},R=h.contains?"":"^",_=h.contains?"":"$";let b=`${R}(?:${a.output})${_}`;a&&a.negated===!0&&(b=`^(?!${b}).*$`);const C=o.toRegex(b,p);return E===!0&&(C.state=a),C},o.makeRe=(a,p={},l=!1,E=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(h.output=t.fastpaths(a,p)),h.output||(h=t(a,p)),o.compileRe(h,p,l,E)},o.toRegex=(a,p)=>{try{const l=p||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(p&&p.debug===!0)throw l;return/$^/}},o.constants=m,at=o,at}var lt,kt;function fo(){if(kt)return lt;kt=1;const e=co(),t=rt();function r(m,c,o=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:t.isWindows()}),e(m,c,o)}return Object.assign(r,e),lt=r,lt}var ho=fo();bt(ho);let go;const mo=e=>(go??=k(import.meta.url))(e),Le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qe=e=>{if(typeof Le<"u"&&Le.versions&&Le.versions.node){const[t,r]=Le.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Le.getBuiltinModule(e)}return mo(e)};qe("fs");qe("fs");qe("path");qe("url");const{createRequire:yo}=qe("module");var Nt=yo(import.meta.url);try{Nt.resolve("picomatch"),Nt("picomatch")}catch{}var pt,Lt;function bo(){if(Lt)return pt;Lt=1;/*!
|
|
2
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/return pt=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},pt}var ct,Ht;function Xt(){if(Ht)return ct;Ht=1;/*!
|
|
7
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
*/var e=bo(),t={"{":"}","(":")","[":"]"},r=function(c){if(c[0]==="!")return!0;for(var o=0,a=-2,p=-2,l=-2,E=-2,h=-2;o<c.length;){if(c[o]==="*"||c[o+1]==="?"&&/[\].+)]/.test(c[o])||p!==-1&&c[o]==="["&&c[o+1]!=="]"&&(p<o&&(p=c.indexOf("]",o)),p>o&&(h===-1||h>p||(h=c.indexOf("\\",o),h===-1||h>p)))||l!==-1&&c[o]==="{"&&c[o+1]!=="}"&&(l=c.indexOf("}",o),l>o&&(h=c.indexOf("\\",o),h===-1||h>l))||E!==-1&&c[o]==="("&&c[o+1]==="?"&&/[:!=]/.test(c[o+2])&&c[o+3]!==")"&&(E=c.indexOf(")",o),E>o&&(h=c.indexOf("\\",o),h===-1||h>E))||a!==-1&&c[o]==="("&&c[o+1]!=="|"&&(a<o&&(a=c.indexOf("|",o)),a!==-1&&c[a+1]!==")"&&(E=c.indexOf(")",a),E>a&&(h=c.indexOf("\\",a),h===-1||h>E))))return!0;if(c[o]==="\\"){var R=c[o+1];o+=2;var _=t[R];if(_){var b=c.indexOf(_,o);b!==-1&&(o=b+1)}if(c[o]==="!")return!0}else o++}return!1},m=function(c){if(c[0]==="!")return!0;for(var o=0;o<c.length;){if(/[*?{}()[\]]/.test(c[o]))return!0;if(c[o]==="\\"){var a=c[o+1];o+=2;var p=t[a];if(p){var l=c.indexOf(p,o);l!==-1&&(o=l+1)}if(c[o]==="!")return!0}else o++}return!1};return ct=function(c,o){if(typeof c!="string"||c==="")return!1;if(e(c))return!0;var a=r;return o&&o.strict===!1&&(a=m),a(c)},ct}let $o;const vo=e=>($o??=k(import.meta.url))(e),He=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zt=e=>{if(typeof He<"u"&&He.versions&&He.versions.node){const[t,r]=He.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return He.getBuiltinModule(e)}return vo(e)},Eo=zt("path"),Ao=zt("os");var ft,Mt;function wo(){if(Mt)return ft;Mt=1;var e=Xt(),t=Eo.posix.dirname,r=Ao.platform()==="win32",m="/",c=/\\/g,o=/\\([!*?|[\](){}])/g;ft=function(l,E){var h=Object.assign({flipBackslashes:!0},E);h.flipBackslashes&&r&&l.indexOf(m)<0&&(l=l.replace(c,m)),a(l)&&(l+=m),l+="a";do l=t(l);while(p(l));return l.replace(o,"$1")};function a(l){var E=l.slice(-1),h;switch(E){case"}":h="{";break;case"]":h="[";break;default:return!1}var R=l.indexOf(h);return R<0?!1:l.slice(R+1,-1).includes(m)}function p(l){return/\([^()]+$/.test(l)||l[0]==="{"||l[0]==="["||/[^\\][{[]/.test(l)?!0:e(l)}return ft}var Ro=wo();bt(Ro);let xo;const _o=e=>(xo??=k(import.meta.url))(e),Me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,To=e=>{if(typeof Me<"u"&&Me.versions&&Me.versions.node){const[t,r]=Me.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Me.getBuiltinModule(e)}return _o(e)},{access:So}=To("node:fs/promises");async function yt(e,t=Ft){ge(e),e=ye(e);try{return await So(e,t),!0}catch{return!1}}let Co;const Oo=e=>(Co??=k(import.meta.url))(e),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ko=e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,r]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Be.getBuiltinModule(e)}return Oo(e)};ko("node:fs");var No=Xt();bt(No);let Lo;const Ho=e=>(Lo??=k(import.meta.url))(e),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Kt=e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,r]=me.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return me.getBuiltinModule(e)}return Ho(e)},{cwd:Mo}=me,{mkdir:Bo,rename:Io,copyFile:Do,unlink:Po}=Kt("node:fs/promises");Kt("node:fs");class Fo extends Error{constructor(t,r){super(`Source directory "${he(t)}" does not match destination directory "${he(r)}"`),this.name="SameDirectoryError"}}const Go=(e,t)=>{if(!e||!t)throw new Error("Source and destination paths must not be empty");if(he(e)!==he(t))throw new Fo(e,t)},Uo=async(e,t,{cwd:r,directoryMode:m,overwrite:c,validateDirectory:o})=>{if(r&&(e=ht(r,e),t=ht(r,t)),o&&Go(e,t),!c&&await yt(t))throw new Error(`The destination file exists: ${t}`);await Bo(he(t),{mode:m,recursive:!0});try{await Io(e,t)}catch(a){if(a.code==="EXDEV")await Do(e,t),await Po(e);else throw a}},un=async(e,t,r={})=>{const m={overwrite:!0,validateDirectory:!1,...r,cwd:r.cwd?ye(r.cwd):Mo()};await Uo(e,t,m)};let Xo=class extends Error{constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}},zo=class extends Error{constructor(t){super(`EPERM: Operation not permitted, ${t}`)}get code(){return"EPERM"}set code(t){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(t){throw new Error("Cannot overwrite name of PermissionError")}};const Ko=(e,t)=>{const r=e?.code;return r==="ENOENT"?new Xo(`no such file or directory, open '${t}'`):r==="EACCES"||r==="EPERM"?new zo(`unable to read the non-readable file: ${t}`):e};let jo;const Wo=e=>(jo??=k(import.meta.url))(e),Ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jt=e=>{if(typeof Ie<"u"&&Ie.versions&&Ie.versions.node){const[t,r]=Ie.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ie.getBuiltinModule(e)}return Wo(e)},{readFile:Qo}=jt("node:fs/promises"),{unzip:qo,brotliDecompress:Vo}=jt("node:zlib"),Yo={brotli:Vo,gzip:qo,none:(e,t)=>{t(null,e)}},Zo=async(e,t)=>{ge(e),e=ye(e);const{buffer:r,compression:m,encoding:c,flag:o}=t??{};let a;try{a=await Qo(e,o?{flag:o}:{})}catch(p){throw Ko(p,e)}return await new Promise((p,l)=>{Yo[m??"none"](a,(E,h)=>{E?l(E):p(r?h:h.toString(c??"utf8"))})})};let Jo;const es=e=>(Jo??=k(import.meta.url))(e),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wt=e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,r]=De.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return De.getBuiltinModule(e)}return es(e)};Wt("node:fs");Wt("node:zlib");const ts=e=>{const t={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(t.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(t.retryDelay=e.retryDelay),t};let rs;const os=e=>(rs??=k(import.meta.url))(e),Pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qt=e=>{if(typeof Pe<"u"&&Pe.versions&&Pe.versions.node){const[t,r]=Pe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Pe.getBuiltinModule(e)}return os(e)};Qt("node:fs");Qt("node:fs/promises");let ss;const ns=e=>(ss??=k(import.meta.url))(e),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,is=e=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[t,r]=Fe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Fe.getBuiltinModule(e)}return ns(e)};is("node:fs");let us;const as=e=>(us??=k(import.meta.url))(e),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ls=e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,r]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ge.getBuiltinModule(e)}return as(e)},{rm:ps}=ls("node:fs/promises"),cs=async(e,t={})=>{ge(e),await ps(e,ts(t))};let fs;const ds=e=>(fs??=k(import.meta.url))(e),Ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hs=e=>{if(typeof Ue<"u"&&Ue.versions&&Ue.versions.node){const[t,r]=Ue.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ue.getBuiltinModule(e)}return ds(e)};hs("node:fs");const gs=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let ms;const ys=e=>(ms??=k(import.meta.url))(e),Xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bs=e=>{if(typeof Xe<"u"&&Xe.versions&&Xe.versions.node){const[t,r]=Xe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Xe.getBuiltinModule(e)}return ys(e)},{randomBytes:$s}=bs("node:crypto"),vs=e=>`${e}.${process.pid.toString(36)}.${$s(6).toString("hex")}.tmp`,Es=new TextEncoder,As=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return Es.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let ws;const Rs=e=>(ws??=k(import.meta.url))(e),ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xs=e=>{if(typeof ze<"u"&&ze.versions&&ze.versions.node){const[t,r]=ze.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ze.getBuiltinModule(e)}return Rs(e)},{mkdir:_s,readFile:Ts,writeFile:Ss,stat:Cs,rename:Bt,chown:Os,chmod:ks,unlink:Ns}=xs("node:fs/promises"),Ls=async(e,t,r)=>{r={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},ge(e),gs(t),e=ye(e);const m=await yt(e,Ft),c=r.flag??"w",o=c.includes("a"),a=c.includes("x");if(m&&(!r.overwrite||a))throw new cr(`file already exists, open '${e}'`);const p=vs(e);try{!m&&r.recursive&&await _s(he(e),{recursive:!0});let l,E=typeof t=="string"?Buffer.from(t,r.encoding??"utf8"):As(t);if(o&&m&&(E=Buffer.concat([await Ts(e),E])),await Ss(p,E,{flag:"wx"}),m&&r.backup&&(l=await Cs(e),r.chown??={gid:l.gid,uid:l.uid},await Bt(e,`${e}.bak`)),r.chown)try{await Os(p,r.chown.uid,r.chown.gid)}catch{}const h=l&&r.mode===void 0?l.mode:r.mode;h!==void 0&&await ks(p,h),await Bt(p,e)}catch(l){throw new Error(`Failed to write file at: ${e} - ${l.message}`,{cause:l})}finally{await yt(p)&&await Ns(p)}};let Hs;const Ms=e=>(Hs??=k(import.meta.url))(e),Ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bs=e=>{if(typeof Ke<"u"&&Ke.versions&&Ke.versions.node){const[t,r]=Ke.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ke.getBuiltinModule(e)}return Ms(e)};Bs("node:fs");let Is;const Ds=e=>(Is??=k(import.meta.url))(e),je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ps=e=>{if(typeof je<"u"&&je.versions&&je.versions.node){const[t,r]=je.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return je.getBuiltinModule(e)}return Ds(e)};Ps("node:fs/promises");let Fs;const Gs=e=>(Fs??=k(import.meta.url))(e),We=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Us=e=>{if(typeof We<"u"&&We.versions&&We.versions.node){const[t,r]=We.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return We.getBuiltinModule(e)}return Gs(e)};Us("node:fs");let Xs;const zs=e=>(Xs??=k(import.meta.url))(e),Qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$t=e=>{if(typeof Qe<"u"&&Qe.versions&&Qe.versions.node){const[t,r]=Qe.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Qe.getBuiltinModule(e)}return zs(e)},Ks=$t("fs"),js=$t("os"),Ws=$t("path");var dt={},It;function Qs(){if(It)return dt;It=1;var e=Object.defineProperty,t=(h,R)=>e(h,"name",{value:R,configurable:!0}),r=Ks,m=js,c=Ws;const o=t(h=>{let R="";for(let _=0;_<h.length;_+=1){const b=h[_],C=b.toUpperCase();R+=b===C?b.toLowerCase():C}return R},"invertCase"),a=new Map,p=t((h,R)=>{const _=c.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return R.writeFileSync(_,""),!R.existsSync(o(_))}finally{try{R.unlinkSync(_)}catch{}}},"checkDirectoryCaseWithWrite"),l=t((h,R,_)=>{try{return p(h,_)}catch(b){if(R===void 0)return p(m.tmpdir(),_);throw b}},"checkDirectoryCaseWithFallback"),E=t((h,R=r,_=!0)=>{const b=h??process.cwd();if(_&&a.has(b))return a.get(b);let C;const X=o(b);return X!==b&&R.existsSync(b)?C=!R.existsSync(X):C=l(b,h,R),_&&a.set(b,C),C},"isFsCaseSensitive");return dt.isFsCaseSensitive=E,dt}Qs();class pn extends er{directory;constructor(t){super(t),this.directory=et(t?.directory||Dt(Zt(),"Upload_meta")),this.accessCheck().catch(r=>{this.logger?.error("Metadata storage access check failed: %O",r)})}getMetaPath=t=>{const r=et(`${this.directory}/${this.prefix}${t}${this.suffix}`),m=this.directory.endsWith("/")?this.directory:`${this.directory}/`;return r.startsWith(m)?r:ot(st.INVALID_FILE_NAME,`Invalid id: "${t}" resolves outside the meta directory`)};getIdFromPath=t=>t.slice(`${this.directory}/${this.prefix}`.length,-this.suffix.length);async save(t,r){await this.accessCheck();const m={...r};return m.metadata&&(m.metadata=tr(r.metadata)),await Ls(this.getMetaPath(t),JSON.stringify(m),{recursive:!0}),r}async touch(t,r){const m=new Date;return await Yt(this.getMetaPath(t),m,m),r}async get(t){try{const r=await Zo(this.getMetaPath(t));if(r===void 0)throw ot(st.FILE_NOT_FOUND);const m=JSON.parse(r);return m.metadata&&typeof m.metadata=="string"&&(m.metadata=rr(m.metadata)),m}catch(r){const m=r,c=r instanceof SyntaxError;throw m.code==="ENOENT"||c?ot(st.FILE_NOT_FOUND):r}}async delete(t){await cs(this.getMetaPath(t))}async accessCheck(){await Gt(this.directory)}}export{un as X,Gt as d,on as h,Jr as j,Zo as q,cs as u,pn as y};
|
package/dist/packem_shared/{local-meta-storage.d-DuTEzyii.d.ts → local-meta-storage.d-cRTXr1kb.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, M as MetaStorage } from "./storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, M as MetaStorage } from "./storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
3
|
/**
|
|
4
4
|
* Stores upload metafiles on local disk
|
package/dist/packem_shared/{media-transformer.d-CvMFjINm.d.ts → media-transformer.d-C8tn4J2Z.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as File, g as FileReturn, B as BaseStorage } from "./storage.d-
|
|
2
|
-
import { M as MediaTransformerConfig, a as MediaTransformResult } from "./types.d-
|
|
1
|
+
import { F as File, g as FileReturn, B as BaseStorage } from "./storage.d-DwdJrArF.js";
|
|
2
|
+
import { M as MediaTransformerConfig, a as MediaTransformResult } from "./types.d-BEUv414z.js";
|
|
3
3
|
/**
|
|
4
4
|
* Unified media transformer that automatically detects media type and routes to appropriate transformer.
|
|
5
5
|
* @template TFile The file type used by this transformer.
|
package/dist/packem_shared/{memory-storage.d-BRdTiY8y.d.ts → memory-storage.d-BNZvDG1b.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import { F as File, k as MetaStorageOptions, M as MetaStorage, l as BaseStorageOptions, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "./storage.d-
|
|
2
|
+
import { F as File, k as MetaStorageOptions, M as MetaStorage, l as BaseStorageOptions, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "./storage.d-DwdJrArF.js";
|
|
3
3
|
/**
|
|
4
4
|
* Map-backed metadata storage used by {@link MemoryStorage}. Holds a deep-copied
|
|
5
5
|
* snapshot of each `File` so callers can mutate the returned object without leaking
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const $=/^[A-Z]:\//i,h=(e="")=>e&&e.replaceAll("\\","/").replace($,n=>n.toUpperCase()),p=/^[/\\]{2}/,i=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,u=/^[A-Z]:$/i,d=/\/$/,x=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return h(e)}catch{}return"/"},a=(e,n)=>{let t="",l=0,s=-1,r=0,o;for(let f=0;f<=e.length;++f){if(f<e.length)o=e[f];else{if(o==="/")break;o="/"}if(o==="/"){if(!(s===f-1||r===1))if(r===2){if(t.length<2||l!==2||!t.endsWith(".")||t.at(-2)!=="."){if(t.length>2){const g=t.lastIndexOf("/");g===-1?(t="",l=0):(t=t.slice(0,g),l=t.length-1-t.lastIndexOf("/")),s=f,r=0;continue}else if(t.length>0){t="",l=0,s=f,r=0;continue}}n&&(t+=t.length>0?"/..":"..",l=2)}else t.length>0?t+=`/${e.slice(s+1,f)}`:t=e.slice(s+1,f),l=f-s-1;s=f,r=0}else o==="."&&r!==-1?++r:r=-1}return t},c=e=>i.test(e),I=function(e){if(e.length===0)return".";e=h(e);const n=p.exec(e),t=c(e),l=e.at(-1)==="/";return e=a(e,!t),e.length===0?t?"/":l?"./":".":(l&&(e+="/"),u.test(e)&&(e+="/"),n?t?`//${e}`:`//./${e}`:t&&!c(e)?`/${e}`:e)},w=(...e)=>{let n="";for(const t of e)if(t)if(n.length>0){const l=n.at(-1)==="/",s=t[0]==="/";l&&s?n+=t.slice(1):n+=l||s?t:`/${t}`}else n+=t;return I(n)},y=function(...e){e=e.map(l=>h(l));let n="",t=!1;for(let l=e.length-1;l>=-1&&!t;l--){const s=l>=0?e[l]:x();!s||s.length===0||(n=`${s}/${n}`,t=c(s))}return n=a(n,!t),u.test(n)?`${n}/`:t&&!c(n)?`/${n}`:n.length>0?n:"."},A=e=>{const n=h(e).replace(d,""),t=n.lastIndexOf("/");if(t===-1)return c(e)?"/":".";const l=n.slice(0,t);return u.test(l)?`${l}/`:l||(c(e)?"/":".")},O=(e,n)=>{const t=h(e),l=t.slice(t.lastIndexOf("/")+1);if(n&&l.endsWith(n)){if(n===t)return"";const s=l.slice(0,-n.length);if(s.length>0)return s}return l};export{A as J,O as K,y as P,I as W,h as b,c as v,w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as d}from"./headers-BAiAKekR.js";import{hasBody as _}from"type-is";import{b as h}from"./base-handler-core-
|
|
1
|
+
import{n as d}from"./headers-BAiAKekR.js";import{hasBody as _}from"type-is";import{b as h}from"./base-handler-core-BJP9jHCE.js";import{ERRORS as E}from"./ERRORS-BIBxE2oR.js";import{b as g,a as C,c as S,d as X}from"./response-builder-CbSA8qPa.js";const M=(a,t={})=>{const e=h(a,"x-file-metadata",!0);if(!e)return t;try{return{...t,...JSON.parse(e)}}catch{return t}},v=a=>{if(!a)return;const t=2e3,e=a.length>t?a.slice(0,Math.max(0,t)):a,r=e.toLowerCase().indexOf("filename");if(r===-1)return;let s=r+8;for(;s<e.length&&(e[s]==="*"||e[s]===" "||e[s]===" ");)s++;if(s>=e.length||e[s]!=="=")return;for(s++;s<e.length&&(e[s]===" "||e[s]===" ");)s++;if(s>=e.length)return;let n=s,i;const o=e[s];return o==='"'||o==="'"?(n=s+1,i=e.indexOf(o,n),i===-1&&(i=e.indexOf(";",n),i===-1&&(i=e.length))):(i=e.indexOf(";",n),i===-1&&(i=e.length)),n>=i?void 0:e.substring(n,i).trim()||void 0},A=a=>{const t=h(a,"content-disposition",!0);return v(t)},L=a=>{const t=h(a,"x-chunked-upload",!0)==="true",e=h(a,"x-chunk-offset",!0),r=h(a,"x-total-size",!0),s={isChunkedUpload:t};if(e){const n=Number.parseInt(e,10);!Number.isNaN(n)&&n>=0&&(s.chunkOffset=n)}if(r){const n=Number.parseInt(r,10);!Number.isNaN(n)&&n>0&&(s.totalSize=n)}return s},P=(a,t=!1)=>{const e=h(a,"x-chunked-upload",!0)==="true";if(!(t&&e)){if(!_(a))throw d(400,"Request body is required");if(Number.parseInt(h(a,"content-length")||"0",10)===0&&!e)throw d(400,"Content-Length is required and must be greater than 0")}},B=(a,t=!1,e)=>{const r=h(a,"x-chunked-upload",!0)==="true",s=Number.parseInt(h(a,"content-length")||"0",10);if(!t&&!r&&s===0)throw d(400,"Content-Length is required and must be greater than 0");if(e!==void 0&&s>e)throw d(413,`File size exceeds maximum allowed size of ${e} bytes`);return s},W=(a,t,e="application/octet-stream")=>{const r=A(a),s=M(a),{isChunkedUpload:n,totalSize:i}=L(a),o=n&&i?i:t;return n&&i&&(s._chunkedUpload=!0,s._chunks=[],s._totalSize=i),{contentType:e,metadata:s,originalName:r,size:o}},x=(a,t)=>{if(a.length===0)return!1;const e=[...a].toSorted((n,i)=>n.offset-i.offset),r=e[0];if(r?.offset!==0)return!1;let s=r.length;for(let n=1;n<e.length;n+=1){const i=e[n];if(i){if(i.offset>s)return!1;s=Math.max(s,i.offset+i.length)}}return s>=t},T=(a,t,e,r)=>{if(Number.isNaN(a)||a<0)throw new Error("Chunk offset must be a valid non-negative number");if(t<=0)throw new Error("Chunk length must be greater than 0");if(t>r)throw new Error(`Chunk size exceeds maximum allowed size of ${r} bytes`);if(a+t>e)throw new Error(`Chunk exceeds file size. Offset: ${a}, Size: ${t}, Total: ${e}`)},D=(a,t)=>{const e=a.find(r=>r.offset===t.offset&&r.length===t.length);return e?t.checksum&&e.checksum!==t.checksum?a.map(r=>r.offset===t.offset?{...r,checksum:t.checksum}:r):a:[...a,t]},U=a=>(a.metadata||{})._chunkedUpload===!0,y=a=>{const t=a.metadata||{};if(t._chunkedUpload===!0&&typeof t._totalSize=="number")return t._totalSize};class j{async deleteSingle(t){const e=await this.storage.delete({id:t});if(e.status===void 0)throw d(404,"File not found");return{...e,headers:{},statusCode:204}}async handlePost(t,e,r,s,n){if(e&&t.size!==void 0){const l=typeof t.size=="number"?t.size:Number.parseInt(String(t.size),10);if(l>0&&l>this.storage.maxUploadSize)throw d(413,`File size exceeds maximum allowed size of ${this.storage.maxUploadSize} bytes`)}const i=await this.storage.create(t);if(e){const l=this.buildFileUrl(r,i);return g(i,{...C(i,l),"X-Chunked-Upload":"true","X-Upload-ID":i.id},201)}const o=await this.storage.write({body:s,contentLength:n,id:i.id,start:0}),c=this.buildFileUrl(r,o);return g(o,C(o,c),201)}async handlePut(t,e,r,s,n,i){let o,c=!1;try{await this.storage.getMeta(t),c=!0,i&&await this.storage.update({id:t},{metadata:i}),o=await this.storage.write({body:s,contentLength:n,id:t,start:0})}catch(f){const k=f;if(k.UploadErrorCode===E.FILE_NOT_FOUND||k.code==="ENOENT")try{const p=await this.storage.create(e);o=await this.storage.write({body:s,contentLength:n,id:p.id,start:0})}catch(p){throw p}else throw f}const l=this.buildFileUrl(r,o);return g(o,C(o,l),c?200:201)}async handlePatch(t,e,r,s,n,i){let o=await this.storage.getMeta(t);const c=o.metadata||{},l=U(o);if(l){const u=y(o);u&&o.size!==u&&(o={...o,size:u})}const f=typeof c._totalSize=="number"?c._totalSize:o.size||0;if(!l)throw d(400,"File is not a chunked upload. Use POST or PUT for full file uploads.");const k=100*1024*1024;try{T(e,r,f,k)}catch(u){throw u instanceof Error&&u.message.includes("exceeds maximum")?d(413,u.message):d(400,u instanceof Error?u.message:String(u))}if(o.status==="completed"){const u=this.buildFileUrl(n,o);return g(o,{...C(o,u),"X-Upload-Complete":"true"},200)}const p=await this.storage.withLock(`chunks:${t}`,async()=>{const u=(await this.storage.getMeta(t)).metadata??{},O=Array.isArray(u._chunks)?u._chunks:[],z=D(O,{checksum:s,length:r,offset:e});return await this.storage.update({id:t},{metadata:{...u,_chunks:z}}),z});let m=await this.storage.write({body:i,contentLength:r,id:t,start:e}),w=m.bytesWritten>=f;l&&(w=x(p,f),m.status==="completed"&&!w&&(await this.storage.update({id:t},{status:"part"}),m={...m,status:"part"}));const b=w&&m.bytesWritten!==f?{...m,bytesWritten:f}:m,N=this.buildFileUrl(n,b),F={...C(b,N),...S(b,w),"x-upload-offset":String(b.bytesWritten||0)};return g(b,F,w?200:202)}async handleHead(t){let e=await this.storage.getMeta(t);const r=U(e);if(r){const n=y(e);n&&e.size!==n&&(e={...e,size:n})}const s={...X(e)};if(r){const n=e.metadata||{},i=y(e)||e.size||0,o=Array.isArray(n._chunks)?n._chunks:[],c=x(o,i);Object.assign(s,S(e,c))}return g(e,s,200)}handleOptions(t,e){return{headers:{"Access-Control-Allow-Headers":"Authorization, Content-Type, Content-Length, Content-Disposition, X-File-Metadata, X-Chunked-Upload, X-Total-Size, X-Chunk-Offset, X-Chunk-Checksum","Access-Control-Allow-Methods":t.map(r=>r.toUpperCase()).join(", "),"Access-Control-Max-Age":86400,"X-Max-Upload-Size":String(e)},statusCode:204}}async deleteBatch(t){const e=await this.storage.deleteBatch(t);if(e.successfulCount===0&&e.failedCount>0){const r=e.failed.map(s=>s.id).join(", ");throw d(404,`Failed to delete files: ${r}`)}return{data:e.successful,headers:e.failedCount>0?{"X-Delete-Errors":JSON.stringify(e.failed),"X-Delete-Failed":String(e.failedCount),"X-Delete-Successful":String(e.successfulCount)}:{"X-Delete-Successful":String(e.successfulCount)},statusCode:e.successfulCount===t.length?204:207}}get storage(){throw new Error("storage must be implemented")}buildFileUrl(t,e){throw new Error("buildFileUrl must be implemented")}}export{j as X,B as a,A as b,L as c,W as e,v as p,P as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Readable as w}from"node:stream";import{J as M,B as U,O as C,c as O}from"./storage-DR7qdwBN.js";import{d as T}from"./detect-file-type-BA7UBLKA.js";import{throwErrorCode as m,ERRORS as y}from"./ERRORS-BIBxE2oR.js";import{createRetryWrapper as A}from"./createRetryWrapper-DgmeHPNF.js";import{y as k}from"./local-meta-storage-BELb1YwO.js";import{t as x}from"./update-size-DuNuLyxj.js";import{i as I}from"./part-match-D-9dGX42.js";import{e as R}from"./has-content-50BsqrWw.js";import{t as S}from"./get-file-status-y3wTtDQs.js";const z=(u,t)=>{const i={};return Object.keys(u).forEach(e=>{i[e]=t(u[e])}),i},v=u=>u===Number(u)?u:(M(u)??0)/1e3,B=5*1024*1024,L=16*1024*1024,N=u=>{if(u)return`bytes=${Math.max(0,u.start)}-${u.end===void 0?"":u.end}`};class b extends U{checksumTypes=["md5","crc32","crc32c","sha1","sha256"];supportsRange=!0;supportsDelimiter=!0;bucket;meta;MAX_PARTS=1e4;partSize;retry;resolvedRetryConfig;constructor(t){if(super(t),this.bucket=t.bucket,this.partSize=typeof t.partSize=="string"?C(t.partSize):t.partSize||L,this.partSize<B)throw new Error("Minimum allowed partSize value is 5MB");const i={backoffMultiplier:2,initialDelay:1e3,maxDelay:3e4,maxRetries:3,retryableStatusCodes:[408,429,500,502,503,504],shouldRetry:a=>{const s=a;return s.statusCode&&[408,429,500,502,503,504].includes(s.statusCode)||s.retryable===!0?!0:void 0},...t.retryConfig};this.retry=A(i),this.resolvedRetryConfig=i;const{metaStorage:e,metaStorageConfig:r}=t;if(e)this.meta=e;else{const a={...t,...r,logger:this.logger};"directory"in a?(this.logger?.debug("Using local meta storage"),this.meta=new k(a)):this.meta=new k(a)}this.isReady=!1,this.accessCheck().then(()=>{this.isReady=!0}).catch(a=>{this.logger?.error("Storage access check failed: %O",a)})}getRetryConfig(){return this.resolvedRetryConfig}async create(t,i){return this.instrumentOperation("create",async()=>{const e={...t};if(t.ttl){const n=typeof t.ttl=="string"?O(t.ttl):t.ttl;n!==void 0&&(e.expiredAt=Date.now()+n)}const r=new(this.getFileClass())(e);r.name=this.namingFunction(r),await this.validate(r);try{const n=await this.getMeta(r.id);if(n.bytesWritten>=0)return n}catch{}const a=this.getS3Api();let s;try{s=await this.runOperation(i,n=>a.createMultipartUpload({ACL:this.getAcl(),Bucket:this.bucket,ContentType:r.contentType,Key:r.name,Metadata:z({originalName:r.originalName,...r.metadata},o=>encodeURI(String(o)))},{signal:n}))}catch{return m(y.FILE_ERROR,"s3 create upload error")}const{UploadId:c}=s||{};return c?(r.UploadId=c,r.bytesWritten=0,this.config.clientDirectUpload&&(r.partSize??=this.partSize),await this.saveMeta(r),r.status="created",await this.onCreate(r),this.config.clientDirectUpload?this.buildPresigned(r):r):m(y.FILE_ERROR,"s3 create upload error")})}async write(t,i){return this.instrumentOperation("write",async()=>{let e;if("contentType"in t&&"metadata"in t&&!("body"in t)&&!("start"in t)?e=t:(e=await this.getMeta(t.id),await this.checkIfExpired(e)),e.status==="completed")return e;if(typeof t.size=="number"&&t.size>0&&x(e,t.size),!I(t,e))return m(y.FILE_CONFLICT);if(this.config.clientDirectUpload)return this.buildPresigned(e);e.Parts??=await this.getParts(e),e.bytesWritten=e.Parts.map(a=>a.Size||0).reduce((a,s)=>a+s,0);const r=await this.lock(t.id);try{if(R(t)){if(this.isUnsupportedChecksum(t.checksumAlgorithm))return m(y.UNSUPPORTED_CHECKSUM_ALGORITHM);if(e.Parts.length===0&&(!e.contentType||e.contentType==="application/octet-stream"))try{const d=t.body instanceof w?t.body:w.fromWeb(t.body),{fileType:g,stream:f}=await T(d);g?.mime&&(e.contentType=g.mime),t.body=f}catch{}if(e.Parts.length>this.MAX_PARTS)throw new Error(`Exceeded ${this.MAX_PARTS} as part of the upload to ${this.bucket}.`);const a=e.Parts.length+1,s=this.getS3Api(),c=e.UploadId;if(!c)throw new Error("UploadId is required");const n=t.body,o=n instanceof Uint8Array,{ETag:l}=await this.runOperation(i,d=>s.uploadPart({Body:n,Bucket:this.bucket,ContentLength:t.contentLength||0,Key:e.name,PartNumber:a,UploadId:c,...t.checksumAlgorithm==="md5"?{ContentMD5:t.checksum}:{}},{signal:d}),{replayable:o}),p={ETag:l,PartNumber:a,Size:t.contentLength};e.Parts=[...e.Parts,p],e.bytesWritten+=t.contentLength||0}if(this.cache.set(e.id,e),e.status=S(e),e.status==="completed"){const[a]=await this.internalOnComplete(e);delete e.Parts,e.uri=a.Location,e.ETag=a.ETag}}finally{await this.unlock(t.id,r)}return e})}async delete({id:t},i){return this.instrumentOperation("delete",async()=>{const e=await this.getMeta(t);e.status="deleted",await this.abortMultipartUpload(e,i),await this.deleteMeta(e.id);const r={...e};return await this.onDelete(r),r})}async copy(t,i,e){return this.instrumentOperation("copy",async()=>{b.assertSafeId(t),b.assertSafeId(i);const r=await this.getMeta(t),a=`${this.bucket}/${t}`,s=this.bucket,c=i,n=this.getS3Api();return await this.runOperation(e,o=>n.copyObject({Bucket:s,CopySource:a,Key:c,...e?.storageClass&&{StorageClass:e.storageClass}},{signal:o})),{...r,id:c,name:c}})}async move(t,i,e){return this.instrumentOperation("move",async()=>{await this.copy(t,i,e);const r=this.getS3Api();return await this.runOperation(e,a=>r.deleteObject({Bucket:this.bucket,Key:t},{signal:a})),await this.getMeta(i)})}async list(t=1e3,i){return this.instrumentOperation("list",async()=>{const e=this.getS3Api(),r=Math.min(t,1e3);let a={Bucket:this.bucket,MaxKeys:r};const s=[];let c=!0;for(;c&&s.length<t;)try{const n=await this.runOperation(i,o=>e.listObjectsV2(a,{signal:o}));for(const{Key:o,LastModified:l}of n?.Contents||[]){if(s.length>=t)break;o!==void 0&&s.push({id:o,...l&&{createdAt:l}})}c=n.IsTruncated||!1,c&&n.NextContinuationToken&&s.length<t&&(a={...a,ContinuationToken:n.NextContinuationToken,MaxKeys:Math.min(r,t-s.length)})}catch(n){const o=this.normalizeError(n instanceof Error?n:new Error(String(n)));throw await this.onError(o),n}return s},{limit:t})}async listDirectory(t){return this.instrumentOperation("listDirectory",async()=>{const i=this.getS3Api(),e=t?.limit??1e3,r=Math.min(e,1e3);let a={Bucket:this.bucket,Delimiter:t?.delimiter,MaxKeys:r,...t?.prefix!==void 0&&{Prefix:t.prefix}};const s=[],c=new Set;let n=!0;for(;n&&s.length<e;)try{const o=await this.runOperation(t,l=>i.listObjectsV2(a,{signal:l}));for(const{Prefix:l}of o?.CommonPrefixes||[])l!==void 0&&c.add(l);for(const{Key:l,LastModified:p}of o?.Contents||[]){if(s.length>=e)break;l!==void 0&&s.push({id:l,...p&&{createdAt:p}})}n=o.IsTruncated||!1,n&&o.NextContinuationToken&&s.length<e&&(a={...a,ContinuationToken:o.NextContinuationToken,MaxKeys:Math.min(r,e-s.length)})}catch(o){const l=this.normalizeError(o instanceof Error?o:new Error(String(o)));throw await this.onError(l),o}return{files:s,prefixes:[...c]}},{limit:t?.limit??1e3})}async exists({id:t},i){return this.instrumentOperation("exists",async()=>{try{await this.getMeta(t);const e=this.getS3Api();return await this.runOperation(i,r=>e.headObject({Bucket:this.bucket,Key:t},{signal:r})),!0}catch{return!1}})}async get({id:t},i){return this.instrumentOperation("get",async()=>{const e=this.getS3Api(),r=N(i?.range),{Body:a,ContentLength:s,ContentType:c,ETag:n,Expires:o,LastModified:l,Metadata:p}=await this.runOperation(i,h=>e.getObject({Bucket:this.bucket,Key:t,...r!==void 0&&{Range:r}},{signal:h}));await this.checkIfExpired({expiredAt:o});const d=[];if(a)if(a instanceof w)for await(const h of a)d.push(h instanceof Uint8Array?h:new Uint8Array(h));else{const h=a.getReader();try{for(;;){const{done:P,value:E}=await h.read();if(P)break;d.push(E)}}finally{h.releaseLock()}}const{originalName:g,...f}=p||{};return{content:Buffer.concat(d),contentType:c,ETag:n,expiredAt:o,id:t,metadata:f,modifiedAt:l,name:t,originalName:g||t,size:Number(s)}})}async buildPresigned(t){const i=t;if(i.Parts?.length||(i.Parts=await this.getParts(t)),i.bytesWritten=i.Parts.map(e=>e.Size||0).reduce((e,r)=>e+r,0),t.status=S(i),i.partsUrls?.length||(i.partsUrls=await this.getPartsPresignedUrls(t)),t.status==="completed"){const[e]=await this.internalOnComplete(t);return delete i.Parts,i.uri=e.Location,t}return t}async getPartsPresignedUrls(t){t.partSize??=this.partSize;const i=t.UploadId;if(!i)throw new Error("UploadId is required for getting presigned URLs");const e=Math.trunc(t.size/this.partSize)+1,r=[],a=Math.trunc(v(this.config.expiration?.maxAge||"6hrs")),s=this.getS3Api();for(let c=0;c<e;c++)r.push(s.getPresignedUrl({Bucket:this.bucket,expiresIn:a,Key:t.name,PartNumber:c+1,UploadId:i}));return Promise.all(r)}async getParts(t){const i=this.getS3Api(),e=t.UploadId;if(!e)throw new Error("UploadId is required");const{Parts:r=[]}=await this.runOperation(void 0,a=>i.listParts({Bucket:this.bucket,Key:t.name,UploadId:e},{signal:a}));return r}completeMultipartUpload(t){const i=this.getS3Api(),e=t.UploadId;if(!e)throw new Error("UploadId is required");const r=t.Parts?.map(({ETag:a,PartNumber:s})=>{if(!a||!s)throw new Error("ETag and PartNumber are required");return{ETag:a,PartNumber:s}})||[];return this.runOperation(void 0,a=>i.completeMultipartUpload({Bucket:this.bucket,Key:t.name,Parts:r,UploadId:e},{signal:a}))}async abortMultipartUpload(t,i){if(t.status!=="completed")try{const e=this.getS3Api(),r=t.UploadId;if(!r)return;await this.runOperation(i,a=>e.abortMultipartUpload({Bucket:this.bucket,Key:t.name,UploadId:r},{signal:a}))}catch(e){this.logger?.error("abortMultipartUploadError: ",e);const r=this.normalizeError(e instanceof Error?e:new Error(String(e)));await this.onError(r)}}internalOnComplete=async t=>{const[i]=await Promise.all([this.completeMultipartUpload(t),this.deleteMeta(t.id)]);return[i,t]}}export{b as S,N as b};
|
package/dist/packem_shared/{s3-base-storage.d-Cg7m4FuH.d.ts → s3-base-storage.d-ks99NSs-.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import { F as File, M as MetaStorage, c as createRetryWrapper, R as RetryConfig, d as FileInit, B as BaseStorage, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn } from "./storage.d-
|
|
2
|
+
import { F as File, M as MetaStorage, c as createRetryWrapper, R as RetryConfig, d as FileInit, B as BaseStorage, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn } from "./storage.d-DwdJrArF.js";
|
|
3
3
|
/**
|
|
4
4
|
* Part interface for multipart uploads.
|
|
5
5
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Readable as Y}from"node:stream";import{setInterval as G}from"node:timers";import{inspect as K}from"node:util";import{W as H,v as O}from"./path-C-OWflAo-_mqb5p5d.js";import q from"type-is";import J from"./NoOpMetrics-BLo6u4NY.js";import{N as Q}from"./cache-Cw3QjoVN.js";import{ErrorMap as $,throwErrorCode as b,ERRORS as v}from"./ERRORS-BIBxE2oR.js";import{randomUUID as X}from"node:crypto";import{LRUCache as ee}from"lru-cache";import{retry as te}from"./createRetryWrapper-DgmeHPNF.js";import{t as re}from"./is-expired-CBEk6XBi.js";const se=new RegExp("^(?<value>-?\\d+(?:[\\p{Zs}'’.,]\\d+)*)\\p{Zs}*(?<type>[a-z]+)?$","iu"),oe={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},ie=["metric","iec","metric_octet","iec_octet"],ne=1024,ae=t=>t==="iec"||t==="iec_octet",R=new Map,ce=t=>{let e=R.get(t);if(e===void 0){const r=new Intl.NumberFormat(t);e={decimalSeparator:r.format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),""),thousandSeparator:r.format(11111).replaceAll(new RegExp("\\p{Number}","gu"),"")},R.set(t,e)}return e},le=(t,e)=>{const{decimalSeparator:r,thousandSeparator:s}=ce(e),o=t.replaceAll(/[\p{Zs}'’]/gu,"");return Number.parseFloat(o.replaceAll(new RegExp(`\\${s}`,"g"),"").replace(new RegExp(`\\${r}`),"."))},ue=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},ge=(t,e)=>{for(const r of[e,...ie.filter(s=>s!==e)]){const s=oe[r].findIndex(o=>o.short.toUpperCase()===t||o.long.toUpperCase()===t);if(s!==-1)return{level:s,system:r}}},U=(t,e)=>{const r={base:2,locale:"en-US",units:"metric",...e};if(typeof t!="string"||t.length===0)throw new TypeError("Value is not a string or is empty.");if(t.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const s=se.exec(t)?.groups;if(!s)return Number.NaN;const o=le(s.value,r.locale),i=ge((s.type??"Bytes").toUpperCase(),r.units);if(i===void 0)return Number.NaN;const n=ue(r.base),c=ae(i.system)?ne:n;return o*c**i.level},me=(t,e,r,s,o,i,n,c,l,a,u,m,g,p)=>{const d={d:s,h:o,m:i,mo:e,ms:c,s:n,w:r,y:t};return d.future=l,d.past=a,d.decimal=u,m!==void 0&&(d.unitMap=m),d.groupSeparator=g,d.placeholderSeparator=p,d},I={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},de=me(t=>`year${t===1?"":"s"}`,t=>`month${t===1?"":"s"}`,t=>`week${t===1?"":"s"}`,t=>`day${t===1?"":"s"}`,t=>`hour${t===1?"":"s"}`,t=>`minute${t===1?"":"s"}`,t=>`second${t===1?"":"s"}`,t=>`millisecond${t===1?"":"s"}`,"in %s","%s ago",".",I,",","_"),z=new WeakSet,he=t=>{if(z.has(t))return;const e=["y","mo","w","d","h","m","s","ms"];for(const s of e)if(!Object.hasOwn(t,s))throw new TypeError(`Missing required property: ${s}`);if(t.future!==void 0&&typeof t.future!="string")throw new TypeError("Properties future and past must be of type string");if(t.past!==void 0&&typeof t.past!="string")throw new TypeError("Properties future and past must be of type string");const r=["y","mo","w","d","h","m","s","ms"];for(const s of r)if(typeof t[s]!="string"&&typeof t[s]!="function")throw new TypeError(`Property ${s} must be of type string or function`);if(t.decimal&&typeof t.decimal!="string")throw new TypeError("Property decimal must be of type string");if(t.delimiter&&typeof t.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(t._digitReplacements&&!Array.isArray(t._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(t._numberFirst&&typeof t._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(t.unitMap&&typeof t.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(t.unitMap&&Object.values(t.unitMap).some(s=>typeof s!="string"))throw new TypeError("All values in unitMap must be of type string");z.add(t)},w={d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},S=/[-/\\^$*+?.()|[\]{}]/g,P=new WeakMap,B=new WeakMap,pe=t=>{let e=B.get(t);if(e===void 0){const r=t.decimal??".",s=t.groupSeparator??",",o=t.placeholderSeparator??"_",i=r.replaceAll(S,String.raw`\$&`),n=s.replaceAll(S,String.raw`\$&`),c=o.replaceAll(S,String.raw`\$&`);e={decimalRewrite:r==="."?void 0:new RegExp(String.raw`(\d)${i}(\d)`,"g"),groupStrip:new RegExp(String.raw`(\d)[${c}${n}](\d)`,"g")},B.set(t,e)}return e},E=t=>String.raw`(?:(\d+(?:[.,]\d+)?)${t})?`,fe=new RegExp(`^P${E("Y")}${E("M")}${E("W")}${E("D")}(?:T${E("H")}${E("M")}${E("S")})?$`,"i"),ye=/^(?:\s*,)?\s*$/,A=new Map,we=64,be=t=>{const e=t===void 0?"":t.trim();if(e.length===0)return ye;let r=A.get(e);if(r===void 0){A.size>=we&&A.clear();const s=e.replaceAll(S,String.raw`\$&`);r=new RegExp(String.raw`^(?:\s*,)?\s*(?:${s}\s*)?$`,"i"),A.set(e,r)}return r},ve=/^(?:(\d+):)?(?:(\d+):)?(\d+)$/,Ee=/^[+-]?\d+(?:\.\d+)?$/,$e=/^[-+]/,xe=(t,e)=>{if(typeof t!="string"||t.length===0)return;const{conjunction:r,defaultUnit:s="ms",language:o=de}={};he(o);const{decimalRewrite:i,groupStrip:n}=pe(o),c=o.unitMap??I;let l=t.replaceAll(n,"$1$2");if(i!==void 0&&(l=l.replaceAll(i,"$1.$2")),Ee.test(l.trim())){const f=Number.parseFloat(l.trim());if(!Number.isNaN(f)){const h=c[s];if(h!==void 0)return f*w[h]}return}const a=fe.exec(t);if(a){const f=[[1,w.y],[2,w.mo],[3,w.w],[4,w.d],[5,w.h],[6,w.m],[7,w.s]];let h=0,y=!1;for(const[N,D]of f){const x=a[N];x!==void 0&&(y=!0,h+=Number.parseFloat(x.replace(",","."))*D)}if(y)return h}const u=ve.exec(t);if(u){let f=0,h=0;u[2]!==void 0?(f=Number.parseInt(u[1]??"0",10),h=Number.parseInt(u[2],10)):u[1]!==void 0&&(h=Number.parseInt(u[1],10));const y=Number.parseInt(u[3]??"0",10);return f*36e5+h*6e4+y*1e3}let m=P.get(c);if(m===void 0){const f=Object.keys(c).toSorted((h,y)=>y.length-h.length).map(h=>h.replaceAll(S,String.raw`\$&`)).join("|");m=new RegExp(String.raw`(-?\d*\.?\d+)\s*(${f})`,"gi"),P.set(c,m)}const g=be(r);let p=0,d,T=!1,_=-1,M=0;for(m.lastIndex=0;(d=m.exec(l))!==null;){const f=d[1],h=d[2];if(!f||!h)continue;const y=f.trim(),N=y.startsWith("-")?-1:1,D=y.replace($e,""),x=Number.parseFloat(D),k=c[h.toLowerCase()];if(k===void 0)continue;if(!T)_=d.index;else if(!g.test(l.slice(M,d.index)))return;T=!0,M=m.lastIndex;const Z=w[k];if(Number.isNaN(x))return;p+=N*x*Z}const j=l.slice(0,_).trim(),W=l.slice(M).trim();if(!(T&&(j.length>0||W.length>0))&&T)return p};class Se extends ee{constructor(e){super({ttl:3e4,ttlAutopurge:!0,...e})}lock(e){if(this.get(e)!==void 0)throw new Error(`${e} is locked`);const r=X();return this.set(e,r),r}unlock(e,r){return this.get(e)!==r?!1:this.delete(e)}}const C=t=>{if(t===Number(t))return t;if(!t)return;const e=xe(t);if(e!==void 0)return e};class Te extends Error{code;statusCode;body;headers;name="ValidationError";constructor(e,r,s,o){const i=typeof s=="string"?s:s?.message||"Validation error";super(i),this.code=e,this.statusCode=r,this.body=s,this.headers=o}}const Ae=t=>t&&t[0].toUpperCase()+t.slice(1),Ce=t=>{if(!Array.isArray(t))return t;const[e,r,s]=t;return{body:r,headers:s,statusCode:e}};class Me{constructor(e="ValidationError"){this.prefix=e}prefix;validators={};add(e){Object.entries(e).forEach(([r,s])=>{const o=`${this.prefix}${Ae(r)}`;if(this.validators[o]={...this.validators[o],...s},typeof this.validators[o].isValid!="function")throw new TypeError('Validation config "isValid" is missing, or it is not a function!')})}async verify(e){for(const[r,s]of Object.entries(this.validators))if(!await s.isValid(e)){const o=s.response||(r in $?$[r]:$.UnknownError),i=Ce(o),{body:n,headers:c,message:l,statusCode:a}=i;throw new Te(r,a,n||l,c)}}}const Ye=t=>t.name==="ValidationError",Ne=t=>{if(typeof t.name=="string")return t.name;if(typeof t.title=="string")return t.title;if(typeof t.originalName=="string")return t.originalName;if(typeof t.filename=="string")return t.filename},F=(t,e)=>{const r={...t};return Object.keys(e).forEach(s=>{const o=e[s];if(o!==null&&typeof o=="object"&&!Array.isArray(o)){const i=r[s],n=i&&typeof i=="object"&&!Array.isArray(i)?i:{};r[s]=F(n,o)}else r[s]=o}),r},De=(t,e)=>{const r=F(t,e);Object.assign(t,r),t.originalName=Ne(t.metadata)||t.originalName},Oe=/(secret|password|passwd|pwd|token|api[_-]?key|credential|authorization|sas|signature|sessiontoken|connectionstring)/i,L=t=>{const e={};for(const[r,s]of Object.entries(t))typeof s=="string"&&Oe.test(r)?e[r]="[REDACTED]":s&&typeof s=="object"&&!Array.isArray(s)&&s.constructor===Object?e[r]=L(s):e[r]=s;return e},_e={allowMIME:["*/*"],filename:({id:t})=>t,maxMetadataSize:"8MB",maxUploadSize:"5TB",onComplete:()=>{},onCreate:()=>{},onDelete:()=>{},onError:()=>{},onUpdate:()=>{},useRelativeLocation:!1,validation:{}},ke=t=>!t||t.length<3||t.length>255||O(t)?!1:!(t.toUpperCase().includes("../")||t.includes("\0")),Ge=t=>{if(!t||t.length<3||t.length>255||O(t))return!1;const e=t.toUpperCase();return!['"',"*",":","<",">","?","\\","|","../","\0"].some(r=>e.includes(r))};class V{onCreate;onUpdate;onComplete;onDelete;onError;isReady=!0;errorResponses={};cache;logger;metrics;genericConfig;maxMetadataSize;checksumTypes=[];supportsRange=!1;supportsMetadata=!0;supportsCacheControl=!1;supportsDelimiter=!1;reportsUploadProgress=!1;maxUploadSize;expiration;locker;namingFunction;validation=new Me;assetFolder=void 0;concurrency;autoPurgeTimer;constructor(e){const r={..._e,...e};this.onCreate=r.onCreate,this.onUpdate=r.onUpdate,this.onComplete=r.onComplete,this.onDelete=r.onDelete,this.onError=r.onError,this.namingFunction=r.filename,this.maxUploadSize=typeof r.maxUploadSize=="string"?U(r.maxUploadSize):r.maxUploadSize,this.maxMetadataSize=typeof r.maxMetadataSize=="string"?U(r.maxMetadataSize):r.maxMetadataSize,this.expiration=r.expiration,this.genericConfig=r,r.assetFolder!==void 0&&(this.assetFolder=H(r.assetFolder)),this.locker=new Se({max:1e3,ttl:3e4,ttlAutopurge:!0}),this.cache=r.cache??new Q,this.logger=r.logger,this.metrics=r.metrics??new J,this.logger?.debug(`${this.constructor.name} config: ${K(L({...e,logger:this.logger.constructor}))}`);const s=C(r.expiration?.purgeInterval);s&&this.startAutoPurge(s);const o={isValid(l){if(l.size===void 0)return!0;const a=l.size;if(a==null)return!1;const u=typeof a=="number"?a:Number(a);if(Number.isNaN(u)||u<0)return!1;const m=typeof this.value=="number"?this.value:Number(this.value);return!Number.isNaN(m)&&u<=m},response:$.RequestEntityTooLarge,value:this.maxUploadSize},i={isValid(l){return!!q.is(l.contentType,this.value)},response:$.UnsupportedMediaType,value:r.allowMIME},n=r.fileNameValidation??ke,c={isValid(l){return n(l.name)},response:$.InvalidFileName};this.validation.add({filename:c,mime:i,size:o}),this.validation.add({...r.validation})}get raw(){}async getReadUrl(e,r){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement getReadUrl()`)}async getUploadUrl(e,r){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement getUploadUrl()`)}get tusExtension(){const e=["creation","creation-with-upload","termination","checksum","creation-defer-length","concatenation"];return this.expiration&&e.push("expiration"),e}async validate(e){await this.validation.verify(e)}async exists(e,r){return this.instrumentOperation("exists",async()=>{try{return await this.getMeta(e.id,r),!0}catch{return!1}})}normalizeError(e){const r={code:e.name,message:e.message,name:e.name,statusCode:500};return{...r,message:`[${this.constructor.name}] ${r.message}`}}get config(){return this.genericConfig}async saveMeta(e){return V.assertSafeId(e.id),this.updateTimestamps(e),this.cache.set(e.id,e),this.meta.save(e.id,e)}static assertSafeId(e){(!e||typeof e!="string"||e.includes("\0")||e.includes("../")||e.includes("..\\")||e===".."||e.startsWith("../")||e.startsWith("..\\")||O(e)||/^[A-Z]:[/\\]/i.test(e))&&b(v.INVALID_FILE_NAME,`Invalid file id: "${e}"`)}async deleteMeta(e){return this.cache.delete(e),this.meta.delete(e)}async getMeta(e,r){try{const s=await this.meta.get(e);return this.cache.set(s.id,s),{...s}}catch(s){const o=this.normalizeError(s instanceof Error?s:new Error(String(s)));return await this.onError(o),b(v.FILE_NOT_FOUND)}}async checkIfExpired(e){return re(e)?(this.delete(e).catch(()=>{}),this.deleteMeta(e.id).catch(()=>{}),b(v.GONE)):e}async purge(e){return this.instrumentOperation("purge",async()=>{const r=C(e||this.expiration?.maxAge),s={items:[],maxAgeMs:r};if(r){const o=Date.now()-r,i=(await this.list()).filter(n=>Number(new Date(this.expiration?.rolling&&n.modifiedAt||n.createdAt))<o);for await(const{id:n,...c}of i)try{const l=await this.delete({id:n});s.items.push({...l,...c})}catch(l){this.logger?.warn(`Failed to delete file ${n} during purge: ${l instanceof Error?l.message:String(l)}`)}s.items.length>0&&(this.logger?.info(`Purge: removed ${s.items.length} uploads`),this.metrics.gauge("storage.operations.purge.items_count",s.items.length,{storage:this.constructor.name.toLowerCase().replace("storage","")}))}return s})}async getStream({id:e},r){return this.instrumentOperation("getStream",async()=>{const s=await this.get({id:e},r),o=Y.from(s.content);return{headers:{"Content-Length":String(s.size),"Content-Type":s.contentType,...s.ETag&&{ETag:s.ETag},...s.modifiedAt&&{"Last-Modified":s.modifiedAt.toString()}},size:typeof s.size=="number"?s.size:void 0,stream:o}})}async list(e=1e3,r){return this.instrumentOperation("list",async()=>{throw new Error("Not implemented")})}async listDirectory(e){return b(v.METHOD_NOT_ALLOWED,`${this.constructor.name} does not implement listDirectory()`)}async update({id:e},r){return this.instrumentOperation("update",async()=>{const s=await this.getMeta(e),o={...r};if("ttl"in o&&o.ttl!==void 0){const n=o.ttl,c=typeof n=="string"?C(n):n;c!==void 0&&(o.expiredAt=Date.now()+c),delete o.ttl}De(s,o),await this.saveMeta(s);const i={...s,status:"updated"};return await this.onUpdate(i),i})}async deleteBatch(e,r){const s=Date.now(),o=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.delete.count",1,{batch_size:e.length,storage:o});const i=[],n=[],c=e.map(async u=>{try{return{file:await this.delete({id:u},r),id:u,success:!0}}catch(m){const g=m instanceof Error?m.message:"Delete failed";return this.metrics.increment("storage.operations.delete.error.count",1,{error:g,storage:o}),{error:g,id:u,success:!1}}}),l=await Promise.allSettled(c);for(const u of l)u.status==="fulfilled"?u.value.success?i.push(u.value.file):n.push({error:u.value.error,id:u.value.id}):n.push({error:u.reason?.message||"Delete failed",id:""});const a=Date.now()-s;return this.metrics.timing("storage.operations.batch.delete.duration",a,{batch_size:e.length,storage:o}),this.metrics.gauge("storage.operations.batch.delete.success_count",i.length,{storage:o}),this.metrics.gauge("storage.operations.batch.delete.failed_count",n.length,{storage:o}),{failed:n,failedCount:n.length,successful:i,successfulCount:i.length}}async copyBatch(e){const r=Date.now(),s=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.copy.count",1,{batch_size:e.length,storage:s});const o=[],i=[],n=e.map(async({destination:a,options:u,source:m})=>{try{return{file:await this.copy(m,a,u),id:a,success:!0}}catch(g){const p=g instanceof Error?g.message:"Copy failed";return this.metrics.increment("storage.operations.copy.error.count",1,{error:p,storage:s}),{error:p,id:a,success:!1}}}),c=await Promise.allSettled(n);for(const a of c)a.status==="fulfilled"?a.value.success&&a.value.file?o.push(a.value.file):i.push({error:a.value.error||"Copy failed",id:a.value.id}):i.push({error:a.reason?.message||"Copy failed",id:""});const l=Date.now()-r;return this.metrics.timing("storage.operations.batch.copy.duration",l,{batch_size:e.length,storage:s}),this.metrics.gauge("storage.operations.batch.copy.success_count",o.length,{storage:s}),this.metrics.gauge("storage.operations.batch.copy.failed_count",i.length,{storage:s}),{failed:i,failedCount:i.length,successful:o,successfulCount:o.length}}async moveBatch(e){const r=Date.now(),s=this.constructor.name.toLowerCase().replace("storage","");this.metrics.increment("storage.operations.batch.move.count",1,{batch_size:e.length,storage:s});const o=[],i=[],n=e.map(async({destination:a,source:u})=>{try{return{file:await this.move(u,a),id:a,success:!0}}catch(m){const g=m instanceof Error?m.message:"Move failed";return this.metrics.increment("storage.operations.move.error.count",1,{error:g,storage:s}),{error:g,id:a,success:!1}}}),c=await Promise.allSettled(n);for(const a of c)a.status==="fulfilled"?a.value.success&&a.value.file?o.push(a.value.file):i.push({error:a.value.error||"Move failed",id:a.value.id}):i.push({error:a.reason?.message||"Move failed",id:a.reason?.id||""});const l=Date.now()-r;return this.metrics.timing("storage.operations.batch.move.duration",l,{batch_size:e.length,storage:s}),this.metrics.gauge("storage.operations.batch.move.success_count",o.length,{storage:s}),this.metrics.gauge("storage.operations.batch.move.failed_count",i.length,{storage:s}),{failed:i,failedCount:i.length,successful:o,successfulCount:o.length}}async lock(e){return this.locker.has(e)?b(v.FILE_LOCKED):this.config.concurrency&&typeof this.config.concurrency=="number"&&this.config.concurrency<=this.locker.size?b(v.STORAGE_BUSY):this.locker.lock(e)}async unlock(e,r){if(r===void 0){this.locker.delete(e);return}this.locker.unlock(e,r)}async withLock(e,r){const s=await this.lock(e);try{return await r()}finally{await this.unlock(e,s)}}isUnsupportedChecksum(e=""){return!!e&&!this.checksumTypes.includes(e)}startAutoPurge(e){if(e>=2147483647)throw new Error("“purgeInterval” must be less than 2147483647 ms");this.autoPurgeTimer=G(()=>{this.purge().catch(r=>this.logger?.error(r))},e),this.autoPurgeTimer.unref?.()}stopAutoPurge(){this.autoPurgeTimer&&(clearInterval(this.autoPurgeTimer),this.autoPurgeTimer=void 0)}async close(){this.stopAutoPurge()}updateTimestamps(e){e.createdAt??=new Date().toISOString();const r=C(this.expiration?.maxAge);return r&&!e.expiredAt&&(e.expiredAt=this.expiration?.rolling?Date.now()+r:+new Date(e.createdAt)+r),e}getRetryConfig(){}runOperation(e,r,s){let o;typeof e?.retries=="number"?o={maxRetries:e.retries}:e?.retries&&(o=e.retries);const i={...this.getRetryConfig(),...o};s?.replayable===!1&&(i.maxRetries=0);const n=[];this.genericConfig.defaultSignal&&n.push(this.genericConfig.defaultSignal),e?.signal&&n.push(e.signal);let c;n.length===1?[c]=n:n.length>1&&(c=AbortSignal.any(n));const l=typeof e?.timeout=="number"?e.timeout:this.genericConfig.defaultTimeout,a=typeof l=="number"&&l>0?l:void 0,u=i.shouldRetry;i.shouldRetry=g=>c?.aborted||g instanceof Error&&g.name==="AbortError"?!1:u?u(g):void 0;const m=g=>{if(g instanceof Error&&g.name==="AbortError")return g;const p=g instanceof Error&&g.message?g.message:"The operation was aborted",d=new Error(p,{cause:g});return d.name="AbortError",d};return te(async()=>{if(c?.aborted)throw m(c.reason);let g,p;if(a===void 0)p=c;else{const d=new AbortController;g=setTimeout(()=>{d.abort(new DOMException(`The operation timed out after ${a}ms`,"TimeoutError"))},a),p=c?AbortSignal.any([c,d.signal]):d.signal}try{return await r(p)}catch(d){throw p?.aborted?m(d):d}finally{g&&clearTimeout(g)}},i)}async instrumentOperation(e,r,s){const o=Date.now(),i={storage:this.constructor.name.toLowerCase().replace("storage",""),...s};try{this.metrics.increment(`storage.operations.${e}.count`,1,i);const n=await r(),c=Date.now()-o;return this.metrics.timing(`storage.operations.${e}.duration`,c,i),n&&typeof n=="object"&&"size"in n&&typeof n.size=="number"&&this.metrics.gauge("storage.files.size",n.size,{...i,operation:e}),n}catch(n){const c=Date.now()-o,l=n instanceof Error?n.message:"Unknown error";throw this.metrics.timing(`storage.operations.${e}.duration`,c,{...i,error:"true"}),this.metrics.increment(`storage.operations.${e}.error.count`,1,{...i,error:l}),n}}}export{V as B,xe as J,U as O,Ge as a,Te as b,C as c,ke as d,De as e,Ye as i};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Transform, Readable } from 'node:stream';
|
|
2
|
+
import { setInterval } from 'node:timers';
|
|
2
3
|
import { BinaryToTextEncoding, Hash } from 'node:crypto';
|
|
3
4
|
import { IncomingMessage } from 'node:http';
|
|
4
5
|
import { LRUCache } from 'lru-cache';
|
|
@@ -317,11 +318,15 @@ interface RetryConfig {
|
|
|
317
318
|
*/
|
|
318
319
|
retryableStatusCodes?: number[];
|
|
319
320
|
/**
|
|
320
|
-
* Custom function to determine if an error should be retried
|
|
321
|
+
* Custom function to determine if an error should be retried.
|
|
322
|
+
*
|
|
323
|
+
* Tri-state: return `true` to force a retry, `false` to authoritatively
|
|
324
|
+
* suppress it (the built-in {@link isRetryableError} heuristics are *not*
|
|
325
|
+
* consulted), or `undefined` to defer the decision to those heuristics.
|
|
321
326
|
* @param error The error that occurred
|
|
322
|
-
* @returns true
|
|
327
|
+
* @returns `true`/`false` to decide, or `undefined` to defer to the built-in heuristics
|
|
323
328
|
*/
|
|
324
|
-
shouldRetry?: (error: unknown) => boolean;
|
|
329
|
+
shouldRetry?: (error: unknown) => boolean | undefined;
|
|
325
330
|
}
|
|
326
331
|
/**
|
|
327
332
|
* Determines if an error is retryable based on common patterns
|
|
@@ -835,6 +840,11 @@ declare abstract class BaseStorage<TFile extends File = File, TFileReturn extend
|
|
|
835
840
|
* Limits the number of concurrent upload requests
|
|
836
841
|
*/
|
|
837
842
|
protected concurrency?: number;
|
|
843
|
+
/**
|
|
844
|
+
* Handle for the {@link startAutoPurge} interval, retained so it can be
|
|
845
|
+
* cleared via {@link stopAutoPurge}/{@link close}.
|
|
846
|
+
*/
|
|
847
|
+
protected autoPurgeTimer?: ReturnType<typeof setInterval>;
|
|
838
848
|
protected constructor(config: BaseStorageOptions<TFile>);
|
|
839
849
|
/**
|
|
840
850
|
* Escape hatch returning the underlying native client (S3Client, BlobServiceClient, etc.)
|
|
@@ -1117,6 +1127,19 @@ declare abstract class BaseStorage<TFile extends File = File, TFileReturn extend
|
|
|
1117
1127
|
withLock<R>(key: string, function_: () => Promise<R>): Promise<R>;
|
|
1118
1128
|
protected isUnsupportedChecksum(algorithm?: string): boolean;
|
|
1119
1129
|
protected startAutoPurge(purgeInterval: number): void;
|
|
1130
|
+
/**
|
|
1131
|
+
* Stops the auto-purge interval started by {@link startAutoPurge}, if any.
|
|
1132
|
+
* Safe to call multiple times. Call this to release a storage instance that
|
|
1133
|
+
* was constructed with `expiration.purgeInterval` so it can be garbage
|
|
1134
|
+
* collected and the event loop can drain.
|
|
1135
|
+
*/
|
|
1136
|
+
stopAutoPurge(): void;
|
|
1137
|
+
/**
|
|
1138
|
+
* Releases resources held by this storage instance (currently the auto-purge
|
|
1139
|
+
* timer). Provided so callers and the `Files` facade can tear a storage down
|
|
1140
|
+
* deterministically.
|
|
1141
|
+
*/
|
|
1142
|
+
close(): Promise<void>;
|
|
1120
1143
|
protected updateTimestamps(file: TFile): TFile;
|
|
1121
1144
|
/**
|
|
1122
1145
|
* Backend-resolved retry configuration that {@link runOperation} layers
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { IncomingMessage } from 'node:http';
|
|
3
|
-
import { U as UploadFile, h as ResponseBodyType, B as BaseStorage, E as ErrorResponses } from "./storage.d-
|
|
3
|
+
import { U as UploadFile, h as ResponseBodyType, B as BaseStorage, E as ErrorResponses } from "./storage.d-DwdJrArF.js";
|
|
4
4
|
import 'node:stream';
|
|
5
|
-
import { M as MediaTransformer } from "./media-transformer.d-
|
|
6
|
-
import { U as UploadOptions } from "./types.d-
|
|
5
|
+
import { M as MediaTransformer } from "./media-transformer.d-C8tn4J2Z.js";
|
|
6
|
+
import { U as UploadOptions } from "./types.d-D7Zlz5RE.js";
|
|
7
7
|
import 'node:crypto';
|
|
8
8
|
import 'lru-cache';
|
|
9
9
|
import '@visulima/pagination';
|
|
10
|
+
import 'node:timers';
|
|
10
11
|
/**
|
|
11
12
|
* Core base class containing shared business logic for all handlers.
|
|
12
13
|
* This class is platform-agnostic and contains no Node.js or Web API specific code.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions } from "./storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions } from "./storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
3
|
import { Client } from '@microsoft/microsoft-graph-client';
|
|
4
4
|
declare class OneDriveFile extends File {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Cache, F as File, g as FileReturn, B as BaseStorage } from "./storage.d-
|
|
1
|
+
import { C as Cache, F as File, g as FileReturn, B as BaseStorage } from "./storage.d-DwdJrArF.js";
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
3
|
/**
|
|
4
4
|
* Base transformer configuration with common properties
|
|
@@ -2,8 +2,8 @@ import { EventEmitter } from 'node:events';
|
|
|
2
2
|
import { IncomingMessage } from 'node:http';
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
import { PaginationResult } from '@visulima/pagination';
|
|
5
|
-
import { U as UploadFile, B as BaseStorage, a as UploadError, b as UploadEventType } from "./storage.d-
|
|
6
|
-
import { M as MediaTransformer } from "./media-transformer.d-
|
|
5
|
+
import { U as UploadFile, B as BaseStorage, a as UploadError, b as UploadEventType } from "./storage.d-DwdJrArF.js";
|
|
6
|
+
import { M as MediaTransformer } from "./media-transformer.d-C8tn4J2Z.js";
|
|
7
7
|
type WebRequest = globalThis.Request;
|
|
8
8
|
type WebResponse = globalThis.Response;
|
|
9
9
|
interface BaseResponse {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, L as LocalMetaStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, L as LocalMetaStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
|
-
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-
|
|
3
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-ks99NSs-.js";
|
|
4
4
|
import { S3ClientConfig, ObjectCannedACL, S3Client } from '@aws-sdk/client-s3';
|
|
5
5
|
import { ResponseMetadata } from '@aws-sdk/types';
|
|
6
|
+
import 'node:timers';
|
|
6
7
|
import 'node:crypto';
|
|
7
8
|
import 'node:http';
|
|
8
9
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/S3File-CpZrubaV.js";import{default as r}from"../../packem_shared/S3MetaStorage-CMonflzp.js";import{default as S}from"../../packem_shared/S3Storage-
|
|
1
|
+
import{default as t}from"../../packem_shared/S3File-CpZrubaV.js";import{default as r}from"../../packem_shared/S3MetaStorage-CMonflzp.js";import{default as S}from"../../packem_shared/S3Storage-CTe_BMDl.js";export{t as S3File,r as S3MetaStorage,S as S3Storage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-
|
|
2
|
-
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-
|
|
1
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-ks99NSs-.js";
|
|
2
|
+
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
import { AwsClient } from 'aws4fetch';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/AwsLightFile-CpZrubaV.js";import{p as r}from"../../packem_shared/aws-light-meta-storage-DGrn72VJ.js";import{default as f}from"../../packem_shared/AwsLightStorage-
|
|
1
|
+
import{default as a}from"../../packem_shared/AwsLightFile-CpZrubaV.js";import{p as r}from"../../packem_shared/aws-light-meta-storage-DGrn72VJ.js";import{default as f}from"../../packem_shared/AwsLightStorage-DGSPFUqr.js";export{a as AwsLightFile,r as AwsLightMetaStorage,f as AwsLightStorage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as File, k as MetaStorageOptions, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, R as RetryConfig, d as FileInit, O as OperationOptions, f as FileQuery, o as BatchOperationResponse, e as FilePart, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, k as MetaStorageOptions, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, R as RetryConfig, d as FileInit, O as OperationOptions, f as FileQuery, o as BatchOperationResponse, e as FilePart, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
3
|
import { TokenCredential } from '@azure/core-auth';
|
|
4
4
|
import { BlobServiceClient } from '@azure/storage-blob';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/AzureFile-DFSaVe25.js";import{c as t}from"../../packem_shared/azure-meta-storage-ClbEsfI4.js";import{default as u}from"../../packem_shared/AzureStorage-
|
|
1
|
+
import{default as a}from"../../packem_shared/AzureFile-DFSaVe25.js";import{c as t}from"../../packem_shared/azure-meta-storage-ClbEsfI4.js";import{default as u}from"../../packem_shared/AzureStorage-DvKk_hhz.js";export{a as AzureFile,t as AzureSMetaStorage,u as AzureStorage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
4
|
import { BoxClient } from 'box-typescript-sdk-gen';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/BoxFile-CseIoPW1.js";import{default as r}from"../../packem_shared/BoxMetaStorage-
|
|
1
|
+
import{default as a}from"../../packem_shared/BoxFile-CseIoPW1.js";import{default as r}from"../../packem_shared/BoxMetaStorage-CJsyeQ63.js";import{default as x}from"../../packem_shared/BoxStorage-CmM95wi2.js";export{a as BoxFile,r as BoxMetaStorage,x as BoxStorage};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
|
+
import 'node:timers';
|
|
4
5
|
import 'node:crypto';
|
|
5
6
|
import 'node:http';
|
|
6
7
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/BunS3File-BcYmsz1n.js";import{default as r}from"../../packem_shared/BunS3MetaStorage-
|
|
1
|
+
import{default as t}from"../../packem_shared/BunS3File-BcYmsz1n.js";import{default as r}from"../../packem_shared/BunS3MetaStorage-CJsyeQ63.js";import{default as u}from"../../packem_shared/BunS3Storage-B_roVJ29.js";export{t as BunS3File,r as BunS3MetaStorage,u as BunS3Storage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
4
|
import * as BunnyStorageSDK from '@bunny.net/storage-sdk';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/BunnyFile-BgEOlcYI.js";import{default as r}from"../../packem_shared/BunnyMetaStorage-
|
|
1
|
+
import{default as t}from"../../packem_shared/BunnyFile-BgEOlcYI.js";import{default as r}from"../../packem_shared/BunnyMetaStorage-CJsyeQ63.js";import{default as n}from"../../packem_shared/BunnyStorage-eZ1QDVaY.js";export{t as BunnyFile,r as BunnyMetaStorage,n as BunnyStorage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
4
|
import { v2 } from 'cloudinary';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/CloudinaryFile-Bo5B-vM1.js";import{default as t}from"../../packem_shared/CloudinaryMetaStorage-
|
|
1
|
+
import{default as r}from"../../packem_shared/CloudinaryFile-Bo5B-vM1.js";import{default as t}from"../../packem_shared/CloudinaryMetaStorage-Bv_YCZ0Q.js";import{default as d}from"../../packem_shared/CloudinaryStorage-CpH2f0Fv.js";export{r as CloudinaryFile,t as CloudinaryMetaStorage,d as CloudinaryStorage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
4
|
import { Dropbox } from 'dropbox';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"../../packem_shared/DropboxFile-BFb7eOzy.js";import{default as t}from"../../packem_shared/DropboxMetaStorage-
|
|
1
|
+
import{default as e}from"../../packem_shared/DropboxFile-BFb7eOzy.js";import{default as t}from"../../packem_shared/DropboxMetaStorage-CJsyeQ63.js";import{default as p}from"../../packem_shared/DropboxStorage-BB9NoWK2.js";export{e as DropboxFile,t as DropboxMetaStorage,p as DropboxStorage};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
|
+
import 'node:timers';
|
|
4
5
|
import 'node:crypto';
|
|
5
6
|
import 'node:http';
|
|
6
7
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/FirebaseFile-BLaBxa2A.js";import{default as o}from"../../packem_shared/FirebaseMetaStorage-
|
|
1
|
+
import{default as r}from"../../packem_shared/FirebaseFile-BLaBxa2A.js";import{default as o}from"../../packem_shared/FirebaseMetaStorage-Bv_YCZ0Q.js";import{default as s}from"../../packem_shared/FirebaseStorage-BgbxzYNC.js";export{r as FirebaseFile,o as FirebaseMetaStorage,s as FirebaseStorage};
|