Skip to content

Commit

Permalink
feat: add static uploads API (#148)
Browse files Browse the repository at this point in the history
This PR adds static methods allowing streaming uploads to the service.
It is integrated with ucanto 0.9.

Essentially the client is "bring your own agent" - it requires an
`issuer` (a `Signer`) and `proofs` (delegated capabilities) to be passed
to each method.

The API is oriented around 3 use cases:

1. Simple and easy to use `uploadFile`/`uploadDirectory` methods that
return CIDs.
2. More advanced APIs that split out DAG creation, CAR creation, storing
and registering uploads.
3. Streaming APIs that have the same split, but cater for uploads of
arbitrary size using streams.

Every method has tests and the [README has extensive examples and API
reference
documentation](https://github.com/web3-storage/w3protocol/blob/777327609cd2c96b2be4e5e8d48e9a45f17b9a7b/packages/upload-client/README.md).

closes #150

Co-authored-by: Oli Evans <oli.evans@gmail.com>
  • Loading branch information
Alan Shaw and olizilla authored Nov 16, 2022
1 parent 37f37cf commit d85d051
Show file tree
Hide file tree
Showing 27 changed files with 3,301 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Client
name: Upload Client
env:
CI: true
FORCE_COLOR: 1
Expand Down Expand Up @@ -28,5 +28,6 @@ jobs:
node-version: 18
cache: 'pnpm'
- run: pnpm install
- run: pnpm -r --filter @web3-storage/upload-client run build
- run: pnpm -r --filter @web3-storage/upload-client run lint
- run: pnpm -r --filter @web3-storage/upload-client run test
Loading

0 comments on commit d85d051

Please sign in to comment.