diff --git a/README.md b/README.md
index 230444e..9552ad5 100644
--- a/README.md
+++ b/README.md
@@ -56,10 +56,10 @@ w3 up recipies.txt
* [`w3 can space info`](#w3-can-space-info-did) coming soon!
* [`w3 can space recover`](#w3-can-space-recover-email) coming soon!
* [`w3 can store add`](#w3-can-store-add-car-path)
- * [`w3 can store ls`](#w3-can-store-ls) coming soon!
+ * [`w3 can store ls`](#w3-can-store-ls)
* [`w3 can store rm`](#w3-can-store-rm-car-cid) coming soon!
* [`w3 can upload add`](#w3-can-upload-add-root-cid-shard-cid-shard-cid)
- * [`w3 can upload ls`](#w3-can-upload-ls) coming soon!
+ * [`w3 can upload ls`](#w3-can-upload-ls)
* [`w3 can upload rm`](#w3-can-upload-rm-root-cid) coming soon!
---
@@ -68,24 +68,24 @@ w3 up recipies.txt
Upload file(s) to web3.storage. The IPFS Content ID (CID) for your files is calculated on your machine, and sent up along with your files. web3.storage makes your content available on the IPFS network
-- `--no-wrap` Don't wrap input files with a directory.
-- `-H, --hidden` Include paths that start with ".".
-- `-c, --car` File is a CAR file.
-- `--shard-size` Shard uploads into CAR files of approximately this size in bytes.
-- `--concurrent-requests` Send up to this many CAR shards concurrently.
+* `--no-wrap` Don't wrap input files with a directory.
+* `-H, --hidden` Include paths that start with ".".
+* `-c, --car` File is a CAR file.
+* `--shard-size` Shard uploads into CAR files of approximately this size in bytes.
+* `--concurrent-requests` Send up to this many CAR shards concurrently.
### `w3 ls`
List all the uploads registered in the current space.
-- `--json` Format as newline delimted JSON
-- `--shards` Pretty print with shards in output
+* `--json` Format as newline delimited JSON
+* `--shards` Pretty print with shards in output
### `w3 rm `
Remove an upload from the uploads listing. Note that this command does not remove the data from the IPFS network, nor does it remove it from space storage (by default).
-- `--shards` Also remove all shards referenced by the upload from the store. Use with caution and ensure other uploads do not reference the same shards.
+* `--shards` Also remove all shards referenced by the upload from the store. Use with caution and ensure other uploads do not reference the same shards.
### `w3 open `
@@ -136,7 +136,7 @@ Create a delegation to the passed audience for the given abilities with the _cur
List delegations created by this agent for others.
-- `--json` Format as newline delimted JSON
+* `--json` Format as newline delimited JSON
### `w3 proof add `
@@ -146,7 +146,7 @@ Add a proof delegated to this agent. The proof is a CAR encoded delegation to _t
List proofs of delegated capabilities. Proofs are delegations with an audience matching the agent DID.
-- `--json` Format as newline delimted JSON
+* `--json` Format as newline delimited JSON
### `w3 can space info `
@@ -158,6 +158,13 @@ Store a [CAR](https://ipld.io/specs/transport/car/carv1/) file to web3.storage.
### `w3 can store ls`
+List CARs in the current space.
+
+* `--json` Format as newline delimited JSON
+* `--size` The desired number of results to return
+* `--cursor` An opaque string included in a prior upload/list response that allows the service to provide the next "page" of results
+* `--pre` If true, return the page of results preceding the cursor
+
### `w3 can store rm `
### `w3 can upload add [shard-cid...]`
@@ -166,6 +173,14 @@ Register an upload - a DAG with the given root data CID that is stored in the gi
### `w3 can upload ls`
+List uploads in the current space.
+
+* `--json` Format as newline delimited JSON
+* `--shards` Pretty print with shards in output
+* `--size` The desired number of results to return
+* `--cursor` An opaque string included in a prior upload/list response that allows the service to provide the next "page" of results
+* `--pre` If true, return the page of results preceding the cursor
+
### `w3 can upload rm `
## Contributing
diff --git a/bin.js b/bin.js
index d86998e..a42fe14 100755
--- a/bin.js
+++ b/bin.js
@@ -20,7 +20,9 @@ import {
} from './index.js'
import {
storeAdd,
- uploadAdd
+ storeList,
+ uploadAdd,
+ uploadList
} from './can.js'
const cli = sade('w3')
@@ -46,7 +48,7 @@ cli.command('open ')
cli.command('ls')
.alias('list')
.describe('List uploads in the current space')
- .option('--json', 'Format as newline delimted JSON')
+ .option('--json', 'Format as newline delimited JSON')
.option('--shards', 'Pretty print with shards in output')
.action(list)
@@ -94,26 +96,43 @@ cli.command('delegation create ')
cli.command('delegation ls')
.describe('List delegations created by this agent for others.')
- .option('--json', 'Format as newline delimted JSON')
+ .option('--json', 'Format as newline delimited JSON')
.action(listDelegations)
cli.command('proof add ')
.describe('Add a proof delegated to this agent.')
- .option('--json', 'Format as newline delimted JSON')
+ .option('--json', 'Format as newline delimited JSON')
.option('--dry-run', 'Decode and view the proof but do not add it')
.action(addProof)
cli.command('proof ls')
.describe('List proofs of capabilities delegated to this agent.')
- .option('--json', 'Format as newline delimted JSON')
+ .option('--json', 'Format as newline delimited JSON')
.action(listProofs)
cli.command('can store add ')
.describe('Store a CAR file with the service.')
.action(storeAdd)
+cli.command('can store ls')
+ .describe('List CAR files in the current space.')
+ .option('--json', 'Format as newline delimited JSON')
+ .option('--size', 'The desired number of results to return')
+ .option('--cursor', 'An opaque string included in a prior store/list response that allows the service to provide the next "page" of results')
+ .option('--pre', 'If true, return the page of results preceding the cursor')
+ .action(storeList)
+
cli.command('can upload add ')
.describe('Register an upload - a DAG with the given root data CID that is stored in the given CAR shard(s), identified by CAR CIDs.')
.action(uploadAdd)
+cli.command('can upload ls')
+ .describe('List uploads in the current space.')
+ .option('--json', 'Format as newline delimited JSON')
+ .option('--shards', 'Pretty print with shards in output')
+ .option('--size', 'The desired number of results to return')
+ .option('--cursor', 'An opaque string included in a prior upload/list response that allows the service to provide the next "page" of results')
+ .option('--pre', 'If true, return the page of results preceding the cursor')
+ .action(uploadList)
+
cli.parse(process.argv)
diff --git a/can.js b/can.js
index 658d2e5..930d906 100644
--- a/can.js
+++ b/can.js
@@ -2,7 +2,7 @@
import fs from 'fs'
import { CID } from 'multiformats'
import ora from 'ora'
-import { getClient } from './lib.js'
+import { getClient, uploadListResponseToString, storeListResponseToString } from './lib.js'
/**
* @param {string} carPath
@@ -27,6 +27,33 @@ export async function storeAdd (carPath) {
spinner.stopAndPersist({ symbol: '⁂', text: `Stored ${cid}` })
}
+/**
+ * Print out all the CARs in the current space.
+ * @param {object} opts
+ * @param {boolean} [opts.json]
+ * @param {string} [opts.cursor]
+ * @param {number} [opts.size]
+ * @param {boolean} [opts.pre]
+ */
+export async function storeList (opts = {}) {
+ const client = await getClient()
+ const listOptions = {}
+ if (opts.size) {
+ listOptions.size = parseInt(opts.size)
+ }
+ if (opts.cursor) {
+ listOptions.cursor = opts.cursor
+ }
+ if (opts.pre) {
+ listOptions.pre = opts.pre
+ }
+
+ const spinner = ora('Listing CARs').start()
+ const res = await client.capability.store.list(listOptions)
+ spinner.stop()
+ console.log(storeListResponseToString(res, opts))
+}
+
/**
* @param {string} root
* @param {string} shard
@@ -60,3 +87,31 @@ export async function uploadAdd (root, shard, opts) {
await client.capability.upload.add(rootCID, shards)
spinner.stopAndPersist({ symbol: '⁂', text: `Upload added ${rootCID}` })
}
+
+/**
+ * Print out all the uploads in the current space.
+ * @param {object} opts
+ * @param {boolean} [opts.json]
+ * @param {boolean} [opts.shards]
+ * @param {string} [opts.cursor]
+ * @param {number} [opts.size]
+ * @param {boolean} [opts.pre]
+ */
+export async function uploadList (opts = {}) {
+ const client = await getClient()
+ const listOptions = {}
+ if (opts.size) {
+ listOptions.size = parseInt(opts.size)
+ }
+ if (opts.cursor) {
+ listOptions.cursor = opts.cursor
+ }
+ if (opts.pre) {
+ listOptions.pre = opts.pre
+ }
+
+ const spinner = ora('Listing uploads').start()
+ const res = await client.capability.upload.list(listOptions)
+ spinner.stop()
+ console.log(uploadListResponseToString(res, opts))
+}
diff --git a/index.js b/index.js
index 7efc598..f8f28c9 100644
--- a/index.js
+++ b/index.js
@@ -1,11 +1,10 @@
import fs from 'fs'
import ora, { oraPromise } from 'ora'
-import tree from 'pretty-tree'
import { Readable } from 'stream'
import { CID } from 'multiformats/cid'
import * as DID from '@ipld/dag-ucan/did'
import { CarWriter } from '@ipld/car'
-import { getClient, checkPathsExist, filesize, readProof, filesFromPaths } from './lib.js'
+import { getClient, checkPathsExist, filesize, readProof, filesFromPaths, uploadListResponseToString } from './lib.js'
/**
* @param {string} firstPath
@@ -55,7 +54,7 @@ export async function upload (firstPath, opts) {
* @param {boolean} [opts.json]
* @param {boolean} [opts.shards]
*/
-export async function list (opts) {
+export async function list (opts = {}) {
const client = await getClient()
let count = 0
let res
@@ -63,22 +62,7 @@ export async function list (opts) {
res = await client.capability.upload.list()
count += res.results.length
if (res.results.length) {
- if (opts.json) {
- console.log(res.results.map(({ root, shards }) => JSON.stringify({
- root: root.toString(),
- shards: shards?.map(s => s.toString())
- })).join('\n'))
- } else if (opts.shards) {
- console.log(res.results.map(({ root, shards }) => tree({
- label: root.toString(),
- nodes: [{
- label: 'shards',
- leaf: shards?.map(s => s.toString())
- }]
- })).join('\n'))
- } else {
- console.log(res.results.map(({ root }) => root.toString()).join('\n'))
- }
+ console.log(uploadListResponseToString(res, opts))
}
} while (res.cursor && res.results.length)
diff --git a/lib.js b/lib.js
index a82271e..df77202 100644
--- a/lib.js
+++ b/lib.js
@@ -1,5 +1,6 @@
import fs from 'fs'
import path from 'path'
+import tree from 'pretty-tree'
import { Readable } from 'stream'
import { importDAG } from '@ucanto/core/delegation'
import { connect } from '@ucanto/client'
@@ -13,6 +14,9 @@ import { CarReader } from '@ipld/car'
/**
* @typedef {import('@web3-storage/w3up-client/types').FileLike & { size: number }} FileLike
+ * @typedef {import('@web3-storage/w3up-client/types').ListResponse} ListResponse
+ * @typedef {import('@web3-storage/w3up-client/types').StoreListResult} StoreListResult
+ * @typedef {import('@web3-storage/w3up-client/types').UploadListResult} UploadListResult
*/
export function getPkg () {
@@ -193,3 +197,47 @@ async function * filesFromDir (dir, filter) {
}
}
}
+
+/**
+ * @param {ListResponse} res
+ * @param {boolean} [opts.raw]
+ * @param {boolean} [opts.json]
+ * @param {boolean} [opts.shards]
+ * @returns {string}
+ */
+export function uploadListResponseToString (res, opts = {}) {
+ if (opts.json) {
+ return res.results.map(({ root, shards }) => JSON.stringify({
+ root: root.toString(),
+ shards: shards?.map(s => s.toString())
+ })).join('\n')
+ } else if (opts.shards) {
+ return res.results.map(({ root, shards }) => tree({
+ label: root.toString(),
+ nodes: [{
+ label: 'shards',
+ leaf: shards?.map(s => s.toString())
+ }]
+ })).join('\n')
+ } else {
+ return res.results.map(({ root }) => root.toString()).join('\n')
+ }
+}
+
+/**
+ * @param {ListResponse} res
+ * @param {boolean} [opts.raw]
+ * @param {boolean} [opts.json]
+ * @returns {string}
+ */
+export function storeListResponseToString (res, opts = {}) {
+ if (opts.json) {
+ return res.results.map(({ link, size, insertedAt }) => JSON.stringify({
+ link: link.toString(),
+ size,
+ insertedAt
+ })).join('\n')
+ } else {
+ return res.results.map(({ link }) => link.toString()).join('\n')
+ }
+}
diff --git a/package-lock.json b/package-lock.json
index 45258a8..7f18782 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,7 +15,7 @@
"@ucanto/core": "^4.0.3",
"@ucanto/transport": "^4.0.3",
"@web3-storage/access": "^9.1.1",
- "@web3-storage/w3up-client": "^4.1.0",
+ "@web3-storage/w3up-client": "^4.2.0",
"open": "^8.4.0",
"ora": "^6.1.2",
"pretty-tree": "^1.0.0",
@@ -31,7 +31,7 @@
"@web3-storage/capabilities": "^2.1.0",
"ava": "^5.1.0",
"execa": "^6.1.0",
- "multiformats": "^10.0.2",
+ "multiformats": "^11.0.0",
"npm-run-all": "^4.1.5",
"standard": "^17.0.0"
}
@@ -129,15 +129,6 @@
"npm": ">=7.0.0"
}
},
- "node_modules/@ipld/car/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ipld/dag-cbor": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-9.0.0.tgz",
@@ -151,15 +142,6 @@
"npm": ">=7.0.0"
}
},
- "node_modules/@ipld/dag-cbor/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ipld/dag-json": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@ipld/dag-json/-/dag-json-10.0.0.tgz",
@@ -173,19 +155,10 @@
"npm": ">=7.0.0"
}
},
- "node_modules/@ipld/dag-json/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ipld/dag-pb": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.0.0.tgz",
- "integrity": "sha512-8FB/qTlNowCiszL9Sek8xH6xIQxIioXuzZ5B1jVPknQMVkd08nZUHzDjrn1Y6MqJ5PrXWLrBwNghGMWPPpvNVw==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.0.2.tgz",
+ "integrity": "sha512-me9oEPb7UNPWSplUFCXyxnQE3/WlsjOljqO2RZN44XOmGkBY0/WVklbXorVE1eiv0Rt3p6dBS2x36Rq8A0Am8A==",
"dependencies": {
"multiformats": "^11.0.0"
},
@@ -194,15 +167,6 @@
"npm": ">=7.0.0"
}
},
- "node_modules/@ipld/dag-pb/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ipld/dag-ucan": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/@ipld/dag-ucan/-/dag-ucan-3.2.0.tgz",
@@ -213,15 +177,6 @@
"multiformats": "^11.0.0"
}
},
- "node_modules/@ipld/dag-ucan/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ipld/unixfs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@ipld/unixfs/-/unixfs-2.0.1.tgz",
@@ -235,15 +190,6 @@
"rabin-rs": "^2.1.0"
}
},
- "node_modules/@ipld/unixfs/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@noble/ed25519": {
"version": "1.7.1",
"resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.1.tgz",
@@ -351,9 +297,9 @@
"dev": true
},
"node_modules/@types/node": {
- "version": "18.11.18",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz",
- "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA=="
+ "version": "18.13.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
+ "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
},
"node_modules/@types/retry": {
"version": "0.12.1",
@@ -361,79 +307,39 @@
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g=="
},
"node_modules/@ucanto/client": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/client/-/client-4.1.0.tgz",
- "integrity": "sha512-Sn24Z5+g+MbuopGEXaBXqrrite8TwSUVHvuXHPfnSco7PtZ0Zu7siTXKrHp15dTbVN2tkvdZTSxB0UZsMmOGPA==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/client/-/client-4.2.3.tgz",
+ "integrity": "sha512-vIa0drEAeolQpSePpHtsW1bx8lzDdxtXi2fEdQ4f34xbI2VSOQuAgUURJTtRVmRXa5MweQoEGI9CHPKL4CMyFQ==",
"dependencies": {
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0"
}
},
- "node_modules/@ucanto/client/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ucanto/core": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-4.1.0.tgz",
- "integrity": "sha512-uH3ViPWB1/K2eeQyTS7nOpupcQ0VC0qzPMYpMD1e0WSTrwVYGwMs0ttG4J77fqXExul46rLCPTY/2R7Tstn7xQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-4.2.3.tgz",
+ "integrity": "sha512-udvp7IMRCE3XFhPYiKISt52r8QjbrqG7d1papdtWwF6RAzTbIWhgXSwAjEbroYCr/gQst7U8aYsgr4xvG2miUQ==",
"dependencies": {
- "@ipld/car": "^5.0.0",
- "@ipld/dag-cbor": "^8.0.0",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-cbor": "^9.0.0",
"@ipld/dag-ucan": "^3.2.0",
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0"
}
},
- "node_modules/@ucanto/core/node_modules/@ipld/dag-cbor": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-8.0.1.tgz",
- "integrity": "sha512-mHRuzgGXNk0Y5W7nNQdN37qJiig1Kdgf92icBVFRUNtBc9Ezl5DIdWfiGWBucHBrhqPBncxoH3As9cHPIRozxA==",
- "dependencies": {
- "cborg": "^1.6.0",
- "multiformats": "^11.0.0"
- },
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/@ucanto/core/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ucanto/interface": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-4.1.0.tgz",
- "integrity": "sha512-vqHUcMPk1tPIJbCT2X5dBRrUUSz5CUKiMJv6GOP24JournjqcwHTr4GqhXZEYgA2yAv/H+CcfVR5mWfnmLd+MQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-4.2.3.tgz",
+ "integrity": "sha512-IoccqMc2/vqaPT6U061ylC138mQ3pLp6coqjXTDmlL9OHmskLcEeQh5Mxe0AYHWMhO1ZuB0LRIysBXk7xoK25Q==",
"dependencies": {
"@ipld/dag-ucan": "^3.2.0",
"multiformats": "^11.0.0"
}
},
- "node_modules/@ucanto/interface/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ucanto/principal": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/principal/-/principal-4.1.0.tgz",
- "integrity": "sha512-R4YdxXkBr4cbmUj7bZKDtdxkfqlT60jYSS2JCtzzxYsSmxRKIjKR/a4Nmo7pqX40vSfqrvp4WlZAzl9Lczuw2A==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/principal/-/principal-4.2.3.tgz",
+ "integrity": "sha512-S02cKaMcIQhxk9uJfUCUb+f98zEEFsC+5BZC6aBoYVCEpXwVZD6+hc9xI0yIQl8zJyQVA3nnUUpLfLynsSox2A==",
"dependencies": {
"@ipld/dag-ucan": "^3.2.0",
"@noble/ed25519": "^1.7.1",
@@ -442,19 +348,10 @@
"one-webcrypto": "^1.0.3"
}
},
- "node_modules/@ucanto/principal/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ucanto/server": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-4.1.0.tgz",
- "integrity": "sha512-JljZI9rbM82ho3E2AGyPZ7O8EZlrMgBkSmTM4lUYWostAxJdPz8EQvBqK7mBZcPRWE/CmjMRPS7Tu/L9Yw7eQw==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-4.2.3.tgz",
+ "integrity": "sha512-lmDC0d9mVGYfiqwzpiTG6CFZpGVw1GnFx9EOtozKPa+v2nzwqDAkwYAQwNrJ2nbJWQQeFi7/Jiaec9EmdPEpsg==",
"dev": true,
"dependencies": {
"@ucanto/core": "^4.1.0",
@@ -463,45 +360,23 @@
}
},
"node_modules/@ucanto/transport": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/transport/-/transport-4.1.0.tgz",
- "integrity": "sha512-Bd/Ma5K0rv+OOBjnisOxfhq1iFWvCn1VtFwtuzqjZGUNt7HdefJazBfpA1wILd+lLw8Krx2gr+7RHbLfQmLXtQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/transport/-/transport-4.2.3.tgz",
+ "integrity": "sha512-ZtHB5ybSB/1dBLhzJqjxGDEE+TTTNzc9HMrVA1AP5KHvaHPu2UtAmS2IMr+HrhSjcwWwdavK0qMQbXSfLWM+kg==",
"dependencies": {
- "@ipld/car": "^5.0.0",
- "@ipld/dag-cbor": "^8.0.0",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-cbor": "^9.0.0",
"@ucanto/core": "^4.1.0",
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0"
}
},
- "node_modules/@ucanto/transport/node_modules/@ipld/dag-cbor": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-8.0.1.tgz",
- "integrity": "sha512-mHRuzgGXNk0Y5W7nNQdN37qJiig1Kdgf92icBVFRUNtBc9Ezl5DIdWfiGWBucHBrhqPBncxoH3As9cHPIRozxA==",
- "dependencies": {
- "cborg": "^1.6.0",
- "multiformats": "^11.0.0"
- },
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/@ucanto/transport/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@ucanto/validator": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/validator/-/validator-4.1.0.tgz",
- "integrity": "sha512-YARh2hR4YafJpeKp1UmLzQUjjdpYE5cO9aVfmJVRbQMqyYz50VvkICm1dhp/7VyO4/H8oJM8WVhxiuo5eJv+ZA==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/validator/-/validator-4.2.3.tgz",
+ "integrity": "sha512-7lA9PK+c0Hu857eHuZIVX3ZBooqvOT25/CXUxGjqs5YFCY7dUhrNCxJYnWsPZnEdriq6x6VSj8pZPwN8I7CyQw==",
"dependencies": {
- "@ipld/car": "^5.0.0",
+ "@ipld/car": "^5.0.3",
"@ipld/dag-cbor": "^8.0.0",
"@ucanto/core": "^4.1.0",
"@ucanto/interface": "^4.1.0",
@@ -521,15 +396,6 @@
"npm": ">=7.0.0"
}
},
- "node_modules/@ucanto/validator/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@web-std/stream": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@web-std/stream/-/stream-1.0.1.tgz",
@@ -539,95 +405,73 @@
}
},
"node_modules/@web3-storage/access": {
- "version": "9.2.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/access/-/access-9.2.0.tgz",
- "integrity": "sha512-6H/MtlTcEsDB7Ek+mTPg3tA5AhvzeMJt68gbcYzl71IooMrTKK46ZCMa//wxt0+fgOFGo0YX0jyE7fcRj4Vmnw==",
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/access/-/access-9.3.0.tgz",
+ "integrity": "sha512-j1HUqREA6etXP0/Rcg2+e3Ug6Vi9zgJBxenFSC4U+AyulGtfkKgJrZG8Qabj6L4+UjNxjrEjSmxUn8V8lq/ULw==",
"dependencies": {
- "@ipld/car": "^5.0.1",
- "@ipld/dag-cbor": "^8.0.0",
- "@ipld/dag-ucan": "^3.0.1",
- "@ucanto/client": "^4.0.3",
- "@ucanto/core": "^4.0.3",
- "@ucanto/interface": "^4.0.3",
- "@ucanto/principal": "^4.0.3",
- "@ucanto/transport": "^4.0.3",
- "@ucanto/validator": "^4.0.3",
- "@web3-storage/capabilities": "^2.1.0",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-cbor": "^9.0.0",
+ "@ipld/dag-ucan": "^3.2.0",
+ "@ucanto/client": "^4.2.3",
+ "@ucanto/core": "^4.2.3",
+ "@ucanto/interface": "^4.2.3",
+ "@ucanto/principal": "^4.2.3",
+ "@ucanto/transport": "^4.2.3",
+ "@ucanto/validator": "^4.2.3",
+ "@web3-storage/capabilities": "^2.2.0",
"bigint-mod-arith": "^3.1.2",
- "conf": "^10.2.0",
+ "conf": "10.2.0",
"inquirer": "^9.1.4",
"isomorphic-ws": "^5.0.0",
- "kysely": "^0.22.0",
- "multiformats": "^10.0.2",
+ "kysely": "^0.23.4",
+ "multiformats": "^11.0.1",
"one-webcrypto": "^1.0.3",
"ora": "^6.1.2",
"p-defer": "^4.0.0",
"p-wait-for": "^5.0.0",
"type-fest": "^3.3.0",
- "uint8arrays": "^4.0.2",
+ "uint8arrays": "^4.0.3",
"varint": "^6.0.0",
- "ws": "^8.11.0",
+ "ws": "^8.12.0",
"zod": "^3.20.2"
},
"bin": {
"w3access": "src/cli/index.js"
}
},
- "node_modules/@web3-storage/access/node_modules/@ipld/dag-cbor": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-8.0.1.tgz",
- "integrity": "sha512-mHRuzgGXNk0Y5W7nNQdN37qJiig1Kdgf92icBVFRUNtBc9Ezl5DIdWfiGWBucHBrhqPBncxoH3As9cHPIRozxA==",
- "dependencies": {
- "cborg": "^1.6.0",
- "multiformats": "^11.0.0"
- },
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
- "node_modules/@web3-storage/access/node_modules/@ipld/dag-cbor/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/@web3-storage/capabilities": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-2.1.0.tgz",
- "integrity": "sha512-6rbcushGhbaeHC38iTEW8t6QapJutfDxLoKPEVMHTJYUGfKE/bL7M7VYXws6Vdp1XCFaLbLv88OSIR/nq9M9lg==",
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-2.3.0.tgz",
+ "integrity": "sha512-+vg61eqK1eqQ+QD1hvChDDx6CXLGFnUsEA+W+g9yagCpq+H9yAqROncEEt+oluIGvAqNbFMrUb+bWRWxk0Tmuw==",
"dependencies": {
- "@ucanto/core": "^4.0.2",
- "@ucanto/interface": "^4.0.2",
- "@ucanto/principal": "^4.0.2",
- "@ucanto/transport": "^4.0.2",
- "@ucanto/validator": "^4.0.2"
+ "@ucanto/core": "^4.2.3",
+ "@ucanto/interface": "^4.2.3",
+ "@ucanto/principal": "^4.2.3",
+ "@ucanto/transport": "^4.2.3",
+ "@ucanto/validator": "^4.2.3"
}
},
"node_modules/@web3-storage/upload-client": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/upload-client/-/upload-client-5.3.0.tgz",
- "integrity": "sha512-3vLErJTiigQ/cSlg8mCrOz3ZV1AZeGgeKDvmDhOBSaIY5rBvKzW2Bjcu4Vqv1cLdWOz2qkg6Tp6X+0qRV0cfPA==",
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/upload-client/-/upload-client-5.5.0.tgz",
+ "integrity": "sha512-mx3L3jpSlKdosNwsswdhGqMI6lektFCONWogw5GP1FAzrUTRLtzCJDMjLDk3umNRy/bIwHZ7PcOmtn8oVlHrzw==",
"dependencies": {
- "@ipld/car": "^5.0.0",
- "@ipld/dag-ucan": "^3.0.1",
- "@ipld/unixfs": "^2.0.0",
- "@ucanto/client": "^4.0.3",
- "@ucanto/interface": "^4.0.3",
- "@ucanto/transport": "^4.0.3",
- "@web3-storage/capabilities": "^2.1.0",
- "multiformats": "^10.0.2",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-ucan": "^3.2.0",
+ "@ipld/unixfs": "^2.0.1",
+ "@ucanto/client": "^4.2.3",
+ "@ucanto/interface": "^4.2.3",
+ "@ucanto/transport": "^4.2.3",
+ "@web3-storage/capabilities": "^2.3.0",
+ "multiformats": "^11.0.1",
"p-queue": "^7.3.0",
"p-retry": "^5.1.2"
}
},
"node_modules/@web3-storage/w3up-client": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/w3up-client/-/w3up-client-4.1.0.tgz",
- "integrity": "sha512-ekLo576uFJHYpWG3QXJETydV/Xq+GniouVDN1S6ND5QSBmb/TBRbEnzplohqwLztvlPSrkd1/VL+t+IDuosubQ==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/w3up-client/-/w3up-client-4.2.0.tgz",
+ "integrity": "sha512-6kMCR/jSi2p1NcrxyVRHJNXdZPGvECIrFlzjmijRSTpsjuXexrvDjc7puJPRLTlS7bXQbIv58HefV0BjQEFZVw==",
"dependencies": {
"@ipld/dag-ucan": "^3.0.1",
"@ucanto/client": "^4.0.2",
@@ -3665,9 +3509,9 @@
}
},
"node_modules/kysely": {
- "version": "0.22.0",
- "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.22.0.tgz",
- "integrity": "sha512-ZE3qWtnqLOalodzfK5QUEcm7AEulhxsPNuKaGFsC3XiqO92vMLm+mAHk/NnbSIOtC4RmGm0nsv700i8KDp1gfQ==",
+ "version": "0.23.4",
+ "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.23.4.tgz",
+ "integrity": "sha512-3icLnj1fahUtZsP9zzOvF4DcdhekGsLX4ZaoBaIz0ZeHegyRDdbwpJD7zezAJ+KwQZNDeKchel6MikFNLsSZIA==",
"engines": {
"node": ">=14.0.0"
}
@@ -3923,9 +3767,9 @@
"dev": true
},
"node_modules/multiformats": {
- "version": "10.0.3",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.3.tgz",
- "integrity": "sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw==",
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
+ "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
@@ -4454,9 +4298,9 @@
}
},
"node_modules/p-queue": {
- "version": "7.3.0",
- "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.0.tgz",
- "integrity": "sha512-5fP+yVQ0qp0rEfZoDTlP2c3RYBgxvRsw30qO+VtPPc95lyvSG+x6USSh1TuLB4n96IO6I8/oXQGsTgtna4q2nQ==",
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.4.tgz",
+ "integrity": "sha512-esox8CWt0j9EZECFvkFl2WNPat8LN4t7WWeXq73D9ha0V96qPRufApZi4ZhPwXAln1uVVal429HVVKPa2X0yQg==",
"dependencies": {
"eventemitter3": "^4.0.7",
"p-timeout": "^5.0.2"
@@ -4855,9 +4699,9 @@
}
},
"node_modules/protobufjs": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.0.tgz",
- "integrity": "sha512-hYCqTDuII4iJ4stZqiuGCSU8xxWl5JeXYpwARGtn/tWcKCAro6h3WQz+xpsNbXW0UYqpmTQFEyFWO0G0Kjt64g==",
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.2.tgz",
+ "integrity": "sha512-++PrQIjrom+bFDPpfmqXfAGSQs40116JRrqqyf53dymUMvvb5d/LMRyicRoF1AUKoXVS1/IgJXlEgcpr4gTF3Q==",
"hasInstallScript": true,
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
@@ -5863,15 +5707,6 @@
"npm": ">=7.0.0"
}
},
- "node_modules/uint8arrays/node_modules/multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA==",
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
- }
- },
"node_modules/unbox-primitive": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
@@ -6246,13 +6081,6 @@
"cborg": "^1.9.0",
"multiformats": "^11.0.0",
"varint": "^6.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ipld/dag-cbor": {
@@ -6262,13 +6090,6 @@
"requires": {
"cborg": "^1.10.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ipld/dag-json": {
@@ -6278,28 +6099,14 @@
"requires": {
"cborg": "^1.10.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ipld/dag-pb": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.0.0.tgz",
- "integrity": "sha512-8FB/qTlNowCiszL9Sek8xH6xIQxIioXuzZ5B1jVPknQMVkd08nZUHzDjrn1Y6MqJ5PrXWLrBwNghGMWPPpvNVw==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.0.2.tgz",
+ "integrity": "sha512-me9oEPb7UNPWSplUFCXyxnQE3/WlsjOljqO2RZN44XOmGkBY0/WVklbXorVE1eiv0Rt3p6dBS2x36Rq8A0Am8A==",
"requires": {
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ipld/dag-ucan": {
@@ -6310,13 +6117,6 @@
"@ipld/dag-cbor": "^9.0.0",
"@ipld/dag-json": "^10.0.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ipld/unixfs": {
@@ -6330,13 +6130,6 @@
"multiformats": "^11.0.1",
"protobufjs": "^7.1.2",
"rabin-rs": "^2.1.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@noble/ed25519": {
@@ -6431,9 +6224,9 @@
"dev": true
},
"@types/node": {
- "version": "18.11.18",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz",
- "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA=="
+ "version": "18.13.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
+ "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg=="
},
"@types/retry": {
"version": "0.12.1",
@@ -6441,88 +6234,51 @@
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g=="
},
"@ucanto/client": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/client/-/client-4.1.0.tgz",
- "integrity": "sha512-Sn24Z5+g+MbuopGEXaBXqrrite8TwSUVHvuXHPfnSco7PtZ0Zu7siTXKrHp15dTbVN2tkvdZTSxB0UZsMmOGPA==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/client/-/client-4.2.3.tgz",
+ "integrity": "sha512-vIa0drEAeolQpSePpHtsW1bx8lzDdxtXi2fEdQ4f34xbI2VSOQuAgUURJTtRVmRXa5MweQoEGI9CHPKL4CMyFQ==",
"requires": {
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ucanto/core": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-4.1.0.tgz",
- "integrity": "sha512-uH3ViPWB1/K2eeQyTS7nOpupcQ0VC0qzPMYpMD1e0WSTrwVYGwMs0ttG4J77fqXExul46rLCPTY/2R7Tstn7xQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-4.2.3.tgz",
+ "integrity": "sha512-udvp7IMRCE3XFhPYiKISt52r8QjbrqG7d1papdtWwF6RAzTbIWhgXSwAjEbroYCr/gQst7U8aYsgr4xvG2miUQ==",
"requires": {
- "@ipld/car": "^5.0.0",
- "@ipld/dag-cbor": "^8.0.0",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-cbor": "^9.0.0",
"@ipld/dag-ucan": "^3.2.0",
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "@ipld/dag-cbor": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-8.0.1.tgz",
- "integrity": "sha512-mHRuzgGXNk0Y5W7nNQdN37qJiig1Kdgf92icBVFRUNtBc9Ezl5DIdWfiGWBucHBrhqPBncxoH3As9cHPIRozxA==",
- "requires": {
- "cborg": "^1.6.0",
- "multiformats": "^11.0.0"
- }
- },
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ucanto/interface": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-4.1.0.tgz",
- "integrity": "sha512-vqHUcMPk1tPIJbCT2X5dBRrUUSz5CUKiMJv6GOP24JournjqcwHTr4GqhXZEYgA2yAv/H+CcfVR5mWfnmLd+MQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-4.2.3.tgz",
+ "integrity": "sha512-IoccqMc2/vqaPT6U061ylC138mQ3pLp6coqjXTDmlL9OHmskLcEeQh5Mxe0AYHWMhO1ZuB0LRIysBXk7xoK25Q==",
"requires": {
"@ipld/dag-ucan": "^3.2.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ucanto/principal": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/principal/-/principal-4.1.0.tgz",
- "integrity": "sha512-R4YdxXkBr4cbmUj7bZKDtdxkfqlT60jYSS2JCtzzxYsSmxRKIjKR/a4Nmo7pqX40vSfqrvp4WlZAzl9Lczuw2A==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/principal/-/principal-4.2.3.tgz",
+ "integrity": "sha512-S02cKaMcIQhxk9uJfUCUb+f98zEEFsC+5BZC6aBoYVCEpXwVZD6+hc9xI0yIQl8zJyQVA3nnUUpLfLynsSox2A==",
"requires": {
"@ipld/dag-ucan": "^3.2.0",
"@noble/ed25519": "^1.7.1",
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0",
"one-webcrypto": "^1.0.3"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ucanto/server": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-4.1.0.tgz",
- "integrity": "sha512-JljZI9rbM82ho3E2AGyPZ7O8EZlrMgBkSmTM4lUYWostAxJdPz8EQvBqK7mBZcPRWE/CmjMRPS7Tu/L9Yw7eQw==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-4.2.3.tgz",
+ "integrity": "sha512-lmDC0d9mVGYfiqwzpiTG6CFZpGVw1GnFx9EOtozKPa+v2nzwqDAkwYAQwNrJ2nbJWQQeFi7/Jiaec9EmdPEpsg==",
"dev": true,
"requires": {
"@ucanto/core": "^4.1.0",
@@ -6531,39 +6287,23 @@
}
},
"@ucanto/transport": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/transport/-/transport-4.1.0.tgz",
- "integrity": "sha512-Bd/Ma5K0rv+OOBjnisOxfhq1iFWvCn1VtFwtuzqjZGUNt7HdefJazBfpA1wILd+lLw8Krx2gr+7RHbLfQmLXtQ==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/transport/-/transport-4.2.3.tgz",
+ "integrity": "sha512-ZtHB5ybSB/1dBLhzJqjxGDEE+TTTNzc9HMrVA1AP5KHvaHPu2UtAmS2IMr+HrhSjcwWwdavK0qMQbXSfLWM+kg==",
"requires": {
- "@ipld/car": "^5.0.0",
- "@ipld/dag-cbor": "^8.0.0",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-cbor": "^9.0.0",
"@ucanto/core": "^4.1.0",
"@ucanto/interface": "^4.1.0",
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "@ipld/dag-cbor": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-8.0.1.tgz",
- "integrity": "sha512-mHRuzgGXNk0Y5W7nNQdN37qJiig1Kdgf92icBVFRUNtBc9Ezl5DIdWfiGWBucHBrhqPBncxoH3As9cHPIRozxA==",
- "requires": {
- "cborg": "^1.6.0",
- "multiformats": "^11.0.0"
- }
- },
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"@ucanto/validator": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@ucanto/validator/-/validator-4.1.0.tgz",
- "integrity": "sha512-YARh2hR4YafJpeKp1UmLzQUjjdpYE5cO9aVfmJVRbQMqyYz50VvkICm1dhp/7VyO4/H8oJM8WVhxiuo5eJv+ZA==",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/@ucanto/validator/-/validator-4.2.3.tgz",
+ "integrity": "sha512-7lA9PK+c0Hu857eHuZIVX3ZBooqvOT25/CXUxGjqs5YFCY7dUhrNCxJYnWsPZnEdriq6x6VSj8pZPwN8I7CyQw==",
"requires": {
- "@ipld/car": "^5.0.0",
+ "@ipld/car": "^5.0.3",
"@ipld/dag-cbor": "^8.0.0",
"@ucanto/core": "^4.1.0",
"@ucanto/interface": "^4.1.0",
@@ -6578,11 +6318,6 @@
"cborg": "^1.6.0",
"multiformats": "^11.0.0"
}
- },
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
}
}
},
@@ -6595,88 +6330,70 @@
}
},
"@web3-storage/access": {
- "version": "9.2.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/access/-/access-9.2.0.tgz",
- "integrity": "sha512-6H/MtlTcEsDB7Ek+mTPg3tA5AhvzeMJt68gbcYzl71IooMrTKK46ZCMa//wxt0+fgOFGo0YX0jyE7fcRj4Vmnw==",
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/access/-/access-9.3.0.tgz",
+ "integrity": "sha512-j1HUqREA6etXP0/Rcg2+e3Ug6Vi9zgJBxenFSC4U+AyulGtfkKgJrZG8Qabj6L4+UjNxjrEjSmxUn8V8lq/ULw==",
"requires": {
- "@ipld/car": "^5.0.1",
- "@ipld/dag-cbor": "^8.0.0",
- "@ipld/dag-ucan": "^3.0.1",
- "@ucanto/client": "^4.0.3",
- "@ucanto/core": "^4.0.3",
- "@ucanto/interface": "^4.0.3",
- "@ucanto/principal": "^4.0.3",
- "@ucanto/transport": "^4.0.3",
- "@ucanto/validator": "^4.0.3",
- "@web3-storage/capabilities": "^2.1.0",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-cbor": "^9.0.0",
+ "@ipld/dag-ucan": "^3.2.0",
+ "@ucanto/client": "^4.2.3",
+ "@ucanto/core": "^4.2.3",
+ "@ucanto/interface": "^4.2.3",
+ "@ucanto/principal": "^4.2.3",
+ "@ucanto/transport": "^4.2.3",
+ "@ucanto/validator": "^4.2.3",
+ "@web3-storage/capabilities": "^2.2.0",
"bigint-mod-arith": "^3.1.2",
- "conf": "^10.2.0",
+ "conf": "10.2.0",
"inquirer": "^9.1.4",
"isomorphic-ws": "^5.0.0",
- "kysely": "^0.22.0",
- "multiformats": "^10.0.2",
+ "kysely": "^0.23.4",
+ "multiformats": "^11.0.1",
"one-webcrypto": "^1.0.3",
"ora": "^6.1.2",
"p-defer": "^4.0.0",
"p-wait-for": "^5.0.0",
"type-fest": "^3.3.0",
- "uint8arrays": "^4.0.2",
+ "uint8arrays": "^4.0.3",
"varint": "^6.0.0",
- "ws": "^8.11.0",
+ "ws": "^8.12.0",
"zod": "^3.20.2"
- },
- "dependencies": {
- "@ipld/dag-cbor": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-8.0.1.tgz",
- "integrity": "sha512-mHRuzgGXNk0Y5W7nNQdN37qJiig1Kdgf92icBVFRUNtBc9Ezl5DIdWfiGWBucHBrhqPBncxoH3As9cHPIRozxA==",
- "requires": {
- "cborg": "^1.6.0",
- "multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
- }
- }
}
},
"@web3-storage/capabilities": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-2.1.0.tgz",
- "integrity": "sha512-6rbcushGhbaeHC38iTEW8t6QapJutfDxLoKPEVMHTJYUGfKE/bL7M7VYXws6Vdp1XCFaLbLv88OSIR/nq9M9lg==",
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-2.3.0.tgz",
+ "integrity": "sha512-+vg61eqK1eqQ+QD1hvChDDx6CXLGFnUsEA+W+g9yagCpq+H9yAqROncEEt+oluIGvAqNbFMrUb+bWRWxk0Tmuw==",
"requires": {
- "@ucanto/core": "^4.0.2",
- "@ucanto/interface": "^4.0.2",
- "@ucanto/principal": "^4.0.2",
- "@ucanto/transport": "^4.0.2",
- "@ucanto/validator": "^4.0.2"
+ "@ucanto/core": "^4.2.3",
+ "@ucanto/interface": "^4.2.3",
+ "@ucanto/principal": "^4.2.3",
+ "@ucanto/transport": "^4.2.3",
+ "@ucanto/validator": "^4.2.3"
}
},
"@web3-storage/upload-client": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/upload-client/-/upload-client-5.3.0.tgz",
- "integrity": "sha512-3vLErJTiigQ/cSlg8mCrOz3ZV1AZeGgeKDvmDhOBSaIY5rBvKzW2Bjcu4Vqv1cLdWOz2qkg6Tp6X+0qRV0cfPA==",
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/upload-client/-/upload-client-5.5.0.tgz",
+ "integrity": "sha512-mx3L3jpSlKdosNwsswdhGqMI6lektFCONWogw5GP1FAzrUTRLtzCJDMjLDk3umNRy/bIwHZ7PcOmtn8oVlHrzw==",
"requires": {
- "@ipld/car": "^5.0.0",
- "@ipld/dag-ucan": "^3.0.1",
- "@ipld/unixfs": "^2.0.0",
- "@ucanto/client": "^4.0.3",
- "@ucanto/interface": "^4.0.3",
- "@ucanto/transport": "^4.0.3",
- "@web3-storage/capabilities": "^2.1.0",
- "multiformats": "^10.0.2",
+ "@ipld/car": "^5.0.3",
+ "@ipld/dag-ucan": "^3.2.0",
+ "@ipld/unixfs": "^2.0.1",
+ "@ucanto/client": "^4.2.3",
+ "@ucanto/interface": "^4.2.3",
+ "@ucanto/transport": "^4.2.3",
+ "@web3-storage/capabilities": "^2.3.0",
+ "multiformats": "^11.0.1",
"p-queue": "^7.3.0",
"p-retry": "^5.1.2"
}
},
"@web3-storage/w3up-client": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/@web3-storage/w3up-client/-/w3up-client-4.1.0.tgz",
- "integrity": "sha512-ekLo576uFJHYpWG3QXJETydV/Xq+GniouVDN1S6ND5QSBmb/TBRbEnzplohqwLztvlPSrkd1/VL+t+IDuosubQ==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/@web3-storage/w3up-client/-/w3up-client-4.2.0.tgz",
+ "integrity": "sha512-6kMCR/jSi2p1NcrxyVRHJNXdZPGvECIrFlzjmijRSTpsjuXexrvDjc7puJPRLTlS7bXQbIv58HefV0BjQEFZVw==",
"requires": {
"@ipld/dag-ucan": "^3.0.1",
"@ucanto/client": "^4.0.2",
@@ -8790,9 +8507,9 @@
}
},
"kysely": {
- "version": "0.22.0",
- "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.22.0.tgz",
- "integrity": "sha512-ZE3qWtnqLOalodzfK5QUEcm7AEulhxsPNuKaGFsC3XiqO92vMLm+mAHk/NnbSIOtC4RmGm0nsv700i8KDp1gfQ=="
+ "version": "0.23.4",
+ "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.23.4.tgz",
+ "integrity": "sha512-3icLnj1fahUtZsP9zzOvF4DcdhekGsLX4ZaoBaIz0ZeHegyRDdbwpJD7zezAJ+KwQZNDeKchel6MikFNLsSZIA=="
},
"levn": {
"version": "0.4.1",
@@ -8974,9 +8691,9 @@
"dev": true
},
"multiformats": {
- "version": "10.0.3",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.3.tgz",
- "integrity": "sha512-K2yGSmstS/oEmYiEIieHb53jJCaqp4ERPDQAYrm5sV3UUrVDZeshJQCK6GHAKyIGufU1vAcbS0PdAAZmC7Tzcw=="
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
+ "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
},
"mute-stream": {
"version": "0.0.8",
@@ -9357,9 +9074,9 @@
}
},
"p-queue": {
- "version": "7.3.0",
- "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.0.tgz",
- "integrity": "sha512-5fP+yVQ0qp0rEfZoDTlP2c3RYBgxvRsw30qO+VtPPc95lyvSG+x6USSh1TuLB4n96IO6I8/oXQGsTgtna4q2nQ==",
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.4.tgz",
+ "integrity": "sha512-esox8CWt0j9EZECFvkFl2WNPat8LN4t7WWeXq73D9ha0V96qPRufApZi4ZhPwXAln1uVVal429HVVKPa2X0yQg==",
"requires": {
"eventemitter3": "^4.0.7",
"p-timeout": "^5.0.2"
@@ -9625,9 +9342,9 @@
}
},
"protobufjs": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.0.tgz",
- "integrity": "sha512-hYCqTDuII4iJ4stZqiuGCSU8xxWl5JeXYpwARGtn/tWcKCAro6h3WQz+xpsNbXW0UYqpmTQFEyFWO0G0Kjt64g==",
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.2.tgz",
+ "integrity": "sha512-++PrQIjrom+bFDPpfmqXfAGSQs40116JRrqqyf53dymUMvvb5d/LMRyicRoF1AUKoXVS1/IgJXlEgcpr4gTF3Q==",
"requires": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
@@ -10322,13 +10039,6 @@
"integrity": "sha512-b+aKlI2oTnxnfeSQWV1sMacqSNxqhtXySaH6bflvONGxF8V/fT3ZlYH7z2qgGfydsvpVo4JUgM/Ylyfl2YouCg==",
"requires": {
"multiformats": "^11.0.0"
- },
- "dependencies": {
- "multiformats": {
- "version": "11.0.1",
- "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.1.tgz",
- "integrity": "sha512-atWruyH34YiknSdL5yeIir00EDlJRpHzELYQxG7Iy29eCyL+VrZHpPrX5yqlik3jnuqpLpRKVZ0SGVb9UzKaSA=="
- }
}
},
"unbox-primitive": {
diff --git a/package.json b/package.json
index aaf7653..3121932 100644
--- a/package.json
+++ b/package.json
@@ -10,8 +10,10 @@
},
"scripts": {
"lint": "standard",
+ "lint:fix": "standard --fix",
"test": "npm-run-all -p -r mock test:ava",
"test:ava": "ava --verbose",
+ "test:watch": "ava --watch",
"mock": "run-p mock:*",
"mock:bucket-200": "PORT=9200 STATUS=200 node test/helpers/bucket-server.js"
},
@@ -36,7 +38,7 @@
"@web3-storage/capabilities": "^2.1.0",
"ava": "^5.1.0",
"execa": "^6.1.0",
- "multiformats": "^10.0.2",
+ "multiformats": "^11.0.0",
"npm-run-all": "^4.1.5",
"standard": "^17.0.0"
},
@@ -47,7 +49,7 @@
"@ucanto/core": "^4.0.3",
"@ucanto/transport": "^4.0.3",
"@web3-storage/access": "^9.1.1",
- "@web3-storage/w3up-client": "^4.1.0",
+ "@web3-storage/w3up-client": "^4.2.0",
"open": "^8.4.0",
"ora": "^6.1.2",
"pretty-tree": "^1.0.0",
diff --git a/test/bin.spec.js b/test/bin.spec.js
index a11d1dd..9d6a658 100644
--- a/test/bin.spec.js
+++ b/test/bin.spec.js
@@ -592,3 +592,77 @@ test('w3 can upload add', async (t) => {
t.regex(out1.stderr, /Upload added/)
})
+
+test('w3 can upload ls', async (t) => {
+ const env = t.context.env.alice
+
+ await execa('./bin.js', ['space', 'create'], { env })
+
+ const uploads = []
+
+ const service = mockService({
+ store: {
+ add: provide(StoreCapabilities.add, () => ({
+ status: 'upload',
+ headers: { 'x-test': 'true' },
+ url: 'http://localhost:9200'
+ }))
+ },
+ upload: {
+ add: provide(UploadCapabilities.add, ({ invocation }) => {
+ const { nb } = invocation.capabilities[0]
+ if (!nb) throw new Error('missing nb')
+ uploads.push(nb)
+ return nb
+ }),
+ list: provide(UploadCapabilities.list, () => {
+ return { results: uploads, size: uploads.length }
+ })
+ }
+ })
+
+ t.context.setService(service)
+
+ await execa('./bin.js', ['up', 'test/fixtures/pinpie.jpg'], { env })
+
+ const list1 = await execa('./bin.js', ['can', 'upload', 'ls', '--json'], { env })
+ t.notThrows(() => CID.parse(JSON.parse(list1.stdout).root))
+})
+
+test('w3 can store ls', async (t) => {
+ const env = t.context.env.alice
+
+ await execa('./bin.js', ['space', 'create'], { env })
+
+ const cars = []
+
+ const service = mockService({
+ store: {
+ add: provide(StoreCapabilities.add, ({ invocation }) => {
+ cars.push({ link: invocation.root.cid })
+ return ({
+ status: 'upload',
+ headers: { 'x-test': 'true' },
+ url: 'http://localhost:9200'
+ })
+ }),
+ list: provide(StoreCapabilities.list, () => {
+ return { results: cars, size: cars.length }
+ })
+ },
+ upload: {
+ add: provide(UploadCapabilities.add, ({ invocation }) => {
+ const { nb } = invocation.capabilities[0]
+ if (!nb) throw new Error('missing nb')
+ return nb
+ })
+ }
+ })
+
+ t.context.setService(service)
+
+ await execa('./bin.js', ['up', 'test/fixtures/pinpie.jpg'], { env })
+
+ const list1 = await execa('./bin.js', ['can', 'store', 'ls', '--json'], { env })
+ t.notThrows(() => CID.parse(JSON.parse(list1.stdout).link))
+})
diff --git a/test/lib.spec.js b/test/lib.spec.js
index 85766bf..412d304 100644
--- a/test/lib.spec.js
+++ b/test/lib.spec.js
@@ -1,5 +1,11 @@
import test from 'ava'
-import { filesFromPaths, filesize } from '../lib.js'
+import * as CID from 'multiformats/cid'
+import {
+ filesFromPaths,
+ filesize,
+ uploadListResponseToString,
+ storeListResponseToString
+} from '../lib.js'
test('filesFromPaths', async (t) => {
const files = await filesFromPaths(['node_modules'])
@@ -41,3 +47,81 @@ test('filesize', t => {
[5_000_000_000, '5.0GB']
].forEach(([size, str]) => t.is(filesize(size), str))
})
+
+const uploadListResponse = {
+ size: 2,
+ cursor: 'bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje',
+ results: [
+ {
+ root: CID.fromJSON({ '/': 'bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm' }),
+ shards: [CID.fromJSON({ '/': 'bagbaierantza4rfjnhqksp2stcnd2tdjrn3f2kgi2wrvaxmayeuolryi66fq' })],
+ updatedAt: '2023-02-13T16:29:48.520Z',
+ insertedAt: '2023-02-13T16:27:36.451Z'
+ },
+ {
+ root: CID.fromJSON({ '/': 'bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje' }),
+ shards: [CID.fromJSON({ '/': 'bagbaieraxqbkzwvx5on6an4br5hagfgesdfc6adchy3hf5qt34pupfjd3rbq' })],
+ updatedAt: '2023-02-13T16:30:22.086Z',
+ insertedAt: '2023-02-13T16:30:22.086Z'
+ }
+ ],
+ after: 'bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje',
+ before: 'bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm'
+}
+
+test('uploadListResponseToString can return the upload roots CIDs as strings', (t) => {
+ t.is(
+ uploadListResponseToString(uploadListResponse, {}),
+ `bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm
+bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje`
+ )
+})
+
+test('uploadListResponseToString can return the upload roots as newline delimited JSON', (t) => {
+ t.is(
+ uploadListResponseToString(uploadListResponse, { shards: true }),
+ `bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm
+└─┬ shards
+ └── bagbaierantza4rfjnhqksp2stcnd2tdjrn3f2kgi2wrvaxmayeuolryi66fq
+
+bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje
+└─┬ shards
+ └── bagbaieraxqbkzwvx5on6an4br5hagfgesdfc6adchy3hf5qt34pupfjd3rbq
+`
+ )
+})
+
+test('uploadListResponseToString can return the upload roots and shards as a tree', (t) => {
+ t.is(
+ uploadListResponseToString(uploadListResponse, { json: true }),
+ `{"root":"bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm","shards":["bagbaierantza4rfjnhqksp2stcnd2tdjrn3f2kgi2wrvaxmayeuolryi66fq"]}
+{"root":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje","shards":["bagbaieraxqbkzwvx5on6an4br5hagfgesdfc6adchy3hf5qt34pupfjd3rbq"]}`
+ )
+})
+
+const storeListResponse = {
+ size: 2,
+ cursor: 'bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq',
+ results: [
+ { link: CID.fromJSON({ '/': 'bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma' }), size: 5336, insertedAt: '2023-02-13T10:57:23.274Z' },
+ { link: CID.fromJSON({ '/': 'bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq' }), size: 3297, insertedAt: '2023-02-13T16:30:02.077Z' }
+ ],
+ after: 'bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq',
+ before: 'bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma'
+}
+
+test('storeListResponseToString can return the CAR CIDs as strings', (t) => {
+ t.is(
+ storeListResponseToString(storeListResponse, {}),
+ `bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma
+bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq`
+ )
+})
+
+test('storeListResponseToString can return the CAR CIDs as newline delimited JSON', (t) => {
+ t.is(
+ storeListResponseToString(storeListResponse, { json: true }),
+ `{"link":"bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma","size":5336,"insertedAt":"2023-02-13T10:57:23.274Z"}
+{"link":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq","size":3297,"insertedAt":"2023-02-13T16:30:02.077Z"}`
+ )
+})
diff --git a/tmp.txt b/tmp.txt
new file mode 100644
index 0000000..e69de29