files-sdk@2.4.0
Minor Changes
-
8d25273: minio: add the
client: "fetch"engine (#155).minio({ client: "fetch" })runs on the same SigV4-signedaws4fetchcore asr2({ client: "fetch" })ands3Fetch()— no@aws-sdk/*packages installed or bundled — while keeping MinIO’s defaults: path-style addressing, theus-east-1signing region, andMinIO errorlabels. Pointing the generics3Fetch()at MinIO dropped those, and the virtual-hosted default then surfaced as a misleadingNotFound: The specified bucket does not exist(MinIO has no per-bucket DNS, so it reads the key’s first folder as the bucket). Inside Cloudflare Workers the fetch engine is now the default, exactly as forr2(): the aws-sdk engine’s XML parsing needsDOMParser, which workerd lacks; an explicitclient: "aws-sdk"or aDOMParserpolyfill keeps the SDK engine. Afetchoption overrides the fetch implementation for tests and instrumented runtimes.The
"aws-sdk"engine behindminio()is now loaded lazily on first use, so a Worker bundle on the fetch engine never includes@aws-sdk/client-s3. One visible consequence:files.rawisundefineduntil any method has run — call one first if you read the underlyingS3Clientdirectly.s3-fetch: a
NoSuchBucketerror received under virtual-hosted addressing now appends a hint to passforcePathStyle: true, since on services without per-bucket DNS (MinIO, LocalStack, most self-hosted gateways) that error almost always means the bucket landed in the hostname rather than that it is missing.
Patch Changes
-
248443a: Type-evidence pass across the SDK (adopting the
anti-sloplint rules): every remaining type assertion now states the invariant that makes it hold,unknownno longer leaks through internal signatures, and runtimetypeofprobes go through named predicates. Along the way this surfaced and fixed a few real defects:box():lastModifiedwas silently dropped on real responses. The Box SDK deserializesmodified_atinto a date wrapper ({ value: Date }), and the adapter was reading it as an ISO string, sonew Date(...)produced an Invalid Date. Both the wrapper and the string form are now unwrapped correctly.getProvider()no longer resolvesObject.prototypenames:getProvider("constructor")returnedObject.prototype.constructorinstead ofundefined.- Provider error mappers (Vercel Blob, UploadThing, Bunny, PocketBase, Supabase, Cloudinary, Netlify) only adopt
message/status/code/namefrom a thrown value when they have the expected primitive type, instead of copying whatever was there into theFilesError. supabase()’s client detection no longer treats{ storage: null }as a Supabase client.- CLI:
--toand--config-jsonvalues that decode to a non-object JSON value (an array, a string, a number) are rejected up front with a clear message instead of failing later or being spread character-by-character into the adapter options.
No public type changes in meaning. Two parameter names in exported types changed from
reasontocause(UploadControl.abortand theabortreturned byuseFiles), which does not affect assignability. -
55a1b3b: Widen optional peer ranges to the current majors:
@google-cloud/storage8,@googleapis/drive21–22,@netlify/blobs11,@openai/agents0.12–0.17,ai7,astro7,disk1,google-auth-library11,node-appwrite29 andopenai7. Refresh all dev/runtime dependencies (picomatch4.0.7,p-map7.0.7).