Skip to content

Commit

Permalink
fix: update deps in api and client (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos authored Jan 11, 2022
1 parent b60fa1c commit 22155db
Show file tree
Hide file tree
Showing 10 changed files with 1,743 additions and 1,748 deletions.
3,360 changes: 1,695 additions & 1,665 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
"cluster:reset": "web3-storage-tools cluster --clean"
},
"devDependencies": {
"@sentry/webpack-plugin": "^1.16.0",
"@types/mocha": "^8.2.2",
"@web-std/form-data": "^2.1.0",
"@sentry/webpack-plugin": "^1.18.3",
"@types/mocha": "^9.0.0",
"@web-std/form-data": "^3.0.0",
"@web3-storage/tools": "^1.0.0",
"assert": "^2.0.0",
"buffer": "^6.0.3",
"dotenv": "^10.0.0",
"git-rev-sync": "^3.0.1",
"git-revision-webpack-plugin": "^5.0.0",
"ipfs-unixfs-importer": "^9.0.4",
"mocha": "^9.1.3",
"npm-run-all": "^4.1.5",
"playwright-test": "^7.0.1",
Expand All @@ -54,13 +53,13 @@
"@ipld/dag-pb": "^2.0.2",
"@magic-ext/oauth": "^0.8.0",
"@magic-sdk/admin": "^1.3.0",
"@nftstorage/ipfs-cluster": "^3.3.1",
"@nftstorage/ipfs-cluster": "^3.4.3",
"@web3-storage/db": "^4.0.0",
"@web3-storage/multipart-parser": "^1.0.0",
"cborg": "^1.5.3",
"ipfs-car": "^0.5.8",
"itty-router": "^2.3.10",
"multiformats": "^9.0.4",
"cborg": "^1.6.0",
"ipfs-car": "^0.6.1",
"itty-router": "^2.4.8",
"multiformats": "^9.5.8",
"p-retry": "^4.6.1",
"protobufjs": "^6.11.2",
"tweetnacl": "^1.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/car.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('POST /car', () => {
const { root, car: carBody } = await createCar('hello world!')

// expected CID for the above data
const expectedCid = 'bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354'
const expectedCid = 'bafkreidvbhs33ighmljlvr7zbv2ywwzcmp5adtf4kqvlly67cy56bdtmve'
assert.strictEqual(root.toString(), expectedCid, 'car file has correct root')

const res = await fetch(new URL('car', endpoint), {
Expand Down
26 changes: 0 additions & 26 deletions packages/api/test/mocks/cluster/post_add$format=car.js

This file was deleted.

37 changes: 14 additions & 23 deletions packages/api/test/mocks/cluster/post_add.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
const { importer } = require('ipfs-unixfs-importer')

const block = {
get: async cid => { throw new Error(`unexpected block API get for ${cid}`) },
put: async () => { throw new Error('unexpected block API put') }
}
const { CarReader } = require('@ipld/car')

/**
* https://github.com/sinedied/smoke#javascript-mocks
* @typedef {{ buffer: Buffer, originalname: string }} MultrFile
* @param {{ query: Record<string, string>, files: MultrFile[] }} request
*/
module.exports = async ({ files, query }) => {
const results = []

const options = {
onlyHash: true,
cidVersion: 1,
rawLeaves: true
}

const candidateImports = files.map((f) => ({ content: f.buffer }))
for await (const { cid } of importer(candidateImports, block, options)) {
results.push({
cid: {
'/': cid.toString()
}
})
module.exports = async ({ query, files }) => {
const car = await CarReader.fromBytes(files[0].buffer)
const roots = await car.getRoots()
// @ts-ignore
const { cid, bytes } = await car.get(roots[0])
const result = {
cid: {
'/': cid.toString()
},
name: files[0].originalname,
// car uploads may not be unixfs, so get a bytes property instead of `size` https://github.com/ipfs/ipfs-cluster/issues/1362
bytes: bytes.length
}
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: query['stream-channels'] === 'false' ? results : results[0]
body: query['stream-channels'] === 'false' ? [result] : result
}
}
3 changes: 2 additions & 1 deletion packages/api/test/scripts/car.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { packToBlob } from 'ipfs-car/pack/blob'
*/
export async function createCar (str) {
return await packToBlob({
input: new TextEncoder().encode(str)
input: [new TextEncoder().encode(str)],
wrapWithDirectory: false
})
}
38 changes: 19 additions & 19 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,43 @@
},
"dependencies": {
"@ipld/car": "^3.1.4",
"@web-std/blob": "^2.1.0",
"@web-std/fetch": "^2.0.2",
"@web-std/file": "^1.1.0",
"browser-readablestream-to-it": "^1.0.2",
"@web-std/blob": "^3.0.1",
"@web-std/fetch": "^3.0.0",
"@web-std/file": "^3.0.0",
"browser-readablestream-to-it": "^1.0.3",
"carbites": "^1.0.6",
"cborg": "^1.5.3",
"files-from-path": "^0.2.1",
"ipfs-car": "^0.5.8",
"ipns": "^0.15.0",
"libp2p-crypto": "^0.20.0",
"cborg": "^1.6.0",
"files-from-path": "^0.2.3",
"ipfs-car": "^0.6.1",
"ipns": "^0.16.0",
"libp2p-crypto": "^0.21.0",
"p-retry": "^4.5.0",
"parse-link-header": "^2.0.0",
"streaming-iterables": "^6.0.0",
"uint8arrays": "^3.0.0"
},
"devDependencies": {
"@ipld/dag-json": "^8.0.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@ipld/dag-json": "^8.0.7",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@types/mocha": "8.2.2",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/mocha": "9.0.0",
"@types/parse-link-header": "^1.0.1",
"bundlesize": "^0.18.1",
"cors": "^2.8.5",
"del-cli": "^4.0.0",
"hundreds": "0.0.9",
"mocha": "8.3.2",
"multiformats": "^9.1.2",
"mocha": "9.1.3",
"multiformats": "^9.5.8",
"npm-run-all": "^4.1.5",
"nyc": "15.1.0",
"playwright-test": "^7.0.1",
"rollup": "2.50.1",
"playwright-test": "^7.2.2",
"rollup": "2.63.0",
"rollup-plugin-multi-input": "1.3.1",
"rollup-plugin-terser": "^7.0.2",
"smoke": "^3.1.1",
"typedoc": "0.20.36",
"uvu": "0.5.1"
"typedoc": "0.22.10",
"uvu": "0.5.3"
},
"types": "./dist/src/lib.d.ts",
"module": "./src/lib.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/w3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"conf": "^10.0.1",
"enquirer": "^2.3.6",
"hard-rejection": "^2.1.0",
"ipfs-car": "^0.5.8",
"ipfs-car": "^0.6.1",
"ora": "^5.4.1",
"sade": "^1.7.4",
"web3.storage": "^3.0.0"
"web3.storage": "^3.5.2"
},
"devDependencies": {
"execa": "^5.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"react-query": "^3.13.9",
"react-syntax-highlighter": "^11.0.3",
"remark-slug": "^6.1.0",
"web3.storage": "^3.0.0"
"web3.storage": "^3.5.2"
},
"devDependencies": {
"@svgr/webpack": "^5.5.0",
Expand Down

0 comments on commit 22155db

Please sign in to comment.