·
2 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Major Changes
- 2b81046: Release files-sdk 2.0 — the full-stack release. Alongside the core
FilesAPI, the SDK now reaches the browser with framework client bindings (files-sdk/react,files-sdk/vue,files-sdk/svelte), a server gateway (files-sdk/api) with route handlers for Next.js, Hono, Express, Fastify, Koa, Elysia, Nitro, SvelteKit, Astro, Bun, and Deno, and a shadcn UI component registry wired to theuseFileshook. See the accompanying changesets for the full surface.
Minor Changes
- 58757d7: Add an Archil adapter (
files-sdk/archil) for Archil disks over their S3-compatible API. The disk id is the path-style bucket and the endpoint is derived from the Archil region; SigV4 enables byte ranges, multipart, and presigned URLs. Supports abranchoption (branch-scoped access) and an optionaldiskinstance exposed atadapter.diskfor Archil-native operations. - 31c9c3f: Add
files-sdk/api—createFilesRouter, a server gateway exposing the wholeFilesverb set (upload, download, head, exists, list, search, url, delete, copy, move, capabilities, signed upload URLs) over a single endpoint, with deny-by-default per-operationauthorize(throw to deny, return a key-prefix/expiry/read-only constraint), redirect-or-proxy streaming downloads (Range/206 + client-disconnect abort), keyless presign→complete uploads with a proxy fallback, HMAC round-trip tokens, and an origin allowlist. - 91d20ef: Add
files-sdk/astro—createRouteHandler(router)returns{ GET, POST, PUT }for an Astro endpoint (GETserves downloads,POSTthe JSON verbs,PUTthe upload byte path). The handlers are Web-native, so the route runs on Node and edge adapters alike. The endpoint must run per-request: setprerender = false(oroutput: "server") with an SSR adapter. - 31c9c3f: Add
files-sdk/client—createFilesClient, a framework-agnostic verb client for the gateway;downloadreturns the same lazyStoredFilethe server SDK returns. - 31c9c3f: Add
files-sdk/express—createRouteHandler(router)returns a Node(req, res)handler that bridgesIncomingMessage/ServerResponseto the WebRequest/Responsethe gateway speaks (also works with Connect and a rawhttp.createServer). A client disconnect aborts the upstream read on a proxied download. Mount it before any body parser so the gateway can read the raw upload/JSON body. - 91d20ef: Add
files-sdk/fastify—createRouteHandler(router)returns a Fastify(request, reply)handler thatreply.hijack()s and bridges the rawIncomingMessage/ServerResponseto the WebRequest/Responsethe gateway speaks (the same seam asfiles-sdk/express). A client disconnect aborts the upstream read on a proxied download. Drop Fastify's built-in body parsers (removeAllContentTypeParsers()+ a no-opaddContentTypeParser("*", …)) so the gateway can read the raw upload/JSON body. - 31c9c3f: Add
files-sdk/hono—createRouteHandler(router)returns a single Hono handler (app.all("/api/files", handler)). Web-native, so it runs on Workers, Bun, Deno, and Node. - 91d20ef: Add
files-sdk/koa—createRouteHandler(router)returns a Koa handler that setsctx.respond = falseand bridgesctx.req/ctx.resto the WebRequest/Responsethe gateway speaks (the same seam asfiles-sdk/express). A client disconnect aborts the upstream read on a proxied download. Mount it before any body parser so the gateway can read the raw upload/JSON body. - 31c9c3f: Add
files-sdk/next—createRouteHandlerto mount the gateway in the Next.js App Router. - 91d20ef: Add
files-sdk/nitro—createRouteHandler(router)returns an h3 event handler for Nitro (and Nuxt server) routes that marshalsevent.node.reqinto the WebRequestthe gateway speaks and returns the WebResponsefor Nitro to flush, hiding thetoWebRequest(event)step. A client disconnect aborts the upstream read on a proxied download. Targets Nitro v2 / h3 v1, whereevent.node.reqis present on every preset. - 9923947: Expose the
versioning()andsoftDelete()plugin verbs through the gateway, client anduseFileshook.createFilesRouternow dispatchesversions/restoreVersion/trashed/restoreTrashed/purge(each a new deny-by-defaultFilesOperation, answered only when the matching plugin wraps theFilesinstance — otherwise a 422), andcreateFilesClient/useFilesgain matching methods (files.versions(key),files.restoreVersion(key, versionId?),files.trashed(),files.restoreTrashed(key),files.purge(key?)). Trash listing and "empty trash" are key-prefix-scoped, so a multi-tenantauthorizekeyPrefix never leaks or purges another tenant's trash. - 31c9c3f: Add
files-sdk/react—useFiles({ endpoint })returning every verb (imperative, with ambient upload progress/error) plus optional reactiveuseList/useFile/useSearchhooks. Emitted as a"use client"module. - 31c9c3f: Add
files-sdk/svelte— the Svelte binding:useFilesreturning Svelte stores for the ambient state, plususeList/useFile/useSearchquery stores. Store-based (no Svelte runtime dependency). - 91d20ef: Add
files-sdk/sveltekit—createRouteHandler(router)returns{ GET, POST, PUT }for a SvelteKit+server.tsendpoint (GETserves downloads,POSTthe JSON verbs,PUTthe upload byte path). The handlers are Web-native, so the route runs on the Node and edge adapters alike. This is the server binding, distinct from thefiles-sdk/svelteclient store. - b20440c: Add a shadcn component registry of
useFiles-wired UI, installable withnpx shadcn add. Upload + display:dropzone,file-list,file-preview,upload-progress,multipart-uploader. Navigation + actions:file-browser(folder tree vialist({ delimiter })+ breadcrumbs),file-search(search()with glob/regex/substring/exact),share-dialog(url()/signedUploadUrl()with expiry + copy),file-actions(copy/move/rename/download/delete menu),capabilities-badges(capabilities()as feature badges). Plugin showcases:version-history(versioning()— list + restore snapshots) andtrash-bin(softDelete()— restore + purge soft-deleted files). The components ship in the docs site rather than the package, but they're a first-class part of the SDK surface. - 31c9c3f: Add
files-sdk/vue— the Vue 3 twin of the React hook: auseFilescomposable returning refs for the ambient state, plus reactiveuseList/useFile/useSearchcomposables over the same gateway.