Skip to content

Commit

Permalink
refactor: apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Vasco Santos <santos.vasco10@gmail.com>
  • Loading branch information
Alan Shaw and vasco-santos authored May 15, 2024
1 parent e272d97 commit 7f8ec15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/upload-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function uploadDirectory(

Uploads a directory of files to the service and returns the root data CID for the generated DAG. All files are added to a container directory, with paths in file names preserved.

Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`
Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`, `filecoin/offer`

More information: [`InvocationConfig`](#invocationconfig), [`ShardStoredCallback`](#shardstoredcallback)

Expand All @@ -227,7 +227,7 @@ function uploadFile(

Uploads a file to the service and returns the root data CID for the generated DAG.

Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`
Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`, `filecoin/offer`

More information: [`InvocationConfig`](#invocationconfig)

Expand All @@ -250,7 +250,7 @@ function uploadCAR(

Uploads a CAR file to the service. The difference between this function and [Blob.add](#blobadd) is that the CAR file is automatically sharded, an index is generated, uploaded and registered (see [`Index.add`](#indexadd)) and finally an "upload" is registered (see [`Upload.add`](#uploadadd)), linking the individual shards. Use the `onShardStored` callback to obtain the CIDs of the CAR file shards.

Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`
Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`, `filecoin/offer`

More information: [`InvocationConfig`](#invocationconfig), [`ShardStoredCallback`](#shardstoredcallback)

Expand Down
4 changes: 2 additions & 2 deletions packages/upload-client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function uploadDirectory(conf, files, options = {}) {
*
* Use the `onShardStored` callback to obtain the CIDs of the CAR file shards.
*
* Required delegated capability proofs: `blob/add`, `index/add`, `upload/add`
* Required delegated capability proofs: `blob/add`, `index/add`, `filecoin/offer`, `upload/add`
*
* @param {import('./types.js').InvocationConfig} conf Configuration
* for the UCAN invocation. An object with `issuer`, `with` and `proofs`.
Expand All @@ -103,7 +103,7 @@ export async function uploadDirectory(conf, files, options = {}) {
* The `proofs` are a set of capability delegations that prove the issuer
* has the capability to perform the action.
*
* The issuer needs the `blob/add`, `index/add` and `upload/add` delegated capability.
* The issuer needs the `blob/add`, `index/add`, `filecoin/offer` and `upload/add` delegated capability.
* @param {import('./types.js').BlobLike} car CAR file.
* @param {import('./types.js').UploadOptions} [options]
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/w3up-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async function main () {
// from "bring your own Agent" example in `Creating a client object" section`
// used command line to generate KEY and PROOF (stored in env variables)
// KEY: `npx ucan-key ed --json` in command line, which returns private key and DID for Agent (the private key is stored in KEY)
// PROOF: w3cli used to run `w3 delegation create <did_from_ucan-key_command_above> --can 'blob/add' --can 'index/add' --can 'upload/add' | base64`, which returns the delegation from Space to the Agent we're using (stored in PROOF)
// PROOF: w3cli used to run `w3 delegation create <did_from_ucan-key_command_above> --can 'blob/add' --can 'index/add' --can 'filecoin/offer' --can 'upload/add' | base64`, which returns the delegation from Space to the Agent we're using (stored in PROOF)
const principal = Signer.parse(process.env.KEY)
const store = new StoreMemory()
const client = await Client.create({ principal, store })
Expand Down

0 comments on commit 7f8ec15

Please # to comment.