[Snyk] Upgrade ipld from 0.17.4 to 0.25.3 #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade ipld from 0.17.4 to 0.25.3.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.The recommended version fixes:
SNYK-JS-LODASH-73638
SNYK-JS-LODASH-450202
npm:lodash:20180130
SNYK-JS-LODASH-73639
SNYK-JS-ELLIPTIC-511941
Release notes
Package name: ipld
Bug Fixes
No content.
Bug Fixes
Code Refactoring
BREAKING CHANGES
ipfs-block-service, ipfs-repo and ipld-in-memory.
This commit uses the new async API of:
If your library has a dependency on any of those, you likely also need
to upgrade to at least those versions.
Bug Fixes
cidVersion
option (b1a3a2a)Chores
BREAKING CHANGES
Previous versions returned a base58 encoded string when
toString()
/toBaseEncodedString()
was called on a CIDv1. It now returns a base32encoded string.
Bug Fixes
BREAKING CHANGES
The most important change is that now all formats return links as CID instances
and no longer as the JSON representation (
{"/": "base-encoded-cid"}
.Bug Fixes
Code Refactoring
_getFormat()
async/await (996e9dc)Features
addFormat/removeFormat()
functions (12b436b)get()
function (743e679)put()
function (8b737b1)remove()
function (08c1e0e)resolve()
function (162473b)tree()
function (9801765)BREAKING CHANGES
This commit introduces single item functions which are called
put()
/get()
,remove()
.In order to put, get or remove multiple items you need to call
putMany()
,getMany()
/removeMany()
now.treeStream()
function.The API docs for it:
cid
(CID
, required): the CID to get the paths from.path
(IPLD Path
, default: ''): the path to start to retrieve the other paths from.options
:recursive
(bool
, default: false): whether to get the paths recursively or not.false
resolves only the paths of the given CID.Returns an async iterator of all the paths (as Strings) you could resolve into.
support.add()
andsupport.rm()
functions.The API docs for it:
.addFormat(ipldFormatImplementation)
:ipldFormatImplementation
(IPLD Format
, required): the implementation of an IPLD Format..removeFormat(codec)
:codec
(multicodec
, required): the codec of the IPLD Format to remove.remove()
has a new API.The API docs for it:
cids
(Iterable<CID>
): the CIDs of the IPLD Nodes that should beremoved.
Throws an error if any of the Blocks can’t be removed. This operation is
not atomic, some Blocks might have already been removed.
get()
is replacing thegetMany()
function.The API docs for it:
cids
(Iterable<CID>
): the CIDs of the IPLD Nodes that should be retrieved.Returns an async iterator with the IPLD Nodes that correspond to the given
cids
.Throws an error if a IPLD Node can’t be retrieved.
put()
changes.The API docs for it:
nodes
(Iterable<Object>
): deserialized IPLD nodes that should be inserted.format
(multicodec
, required): the multicodec of the format that IPLD Node should be encoded in.options
is applied to any of thenodes
and is an object with the following properties:hashAlg
(multicodec
, default: hash algorithm of the given multicodec): the hashing algorithm that is used to calculate the CID.cidVersion
(boolean
, default: 1): the CID version to use.onlyHash
(boolean
, default: false): if true the serialized form of the IPLD Node will not be passed to the underlying block store.Returns an async iterator with the CIDs of the serialized IPLD Nodes.
codec
parameter inoptions.loadFormat()
is a numberInstead of returnign the name of the codec as string, the codec code (a number)
is now returned.
So if you e.g. check within the function for a certain format, it changes from:
To:
to be an async now.
So the signature for
options.loadFormat
is no longer:function (codec, callback)
but
async functiont (codec)
resolve()
replaces parts ofget()
.The API docs for it:
cid
(CID
, required): the CID the resolving starts.path
(IPLD Path
, required): the path that should be resolved.Returns an async iterator of all the IPLD Nodes that were traversed during the path resolving. Every element is an object with these fields:
remainderPath
(string
): the part of the path that wasn’t resolved yet.value
(*
): the value where the resolved path points to. If further traversing is possible, then the value is a CID object linking to another IPLD Node. If it was possible to fully resolve the path,value
is the value thepath
points to. So if you need the CID of the IPLD Node you’re currently at, just take thevalue
of the previously returned IPLD Node.No content.
Code Refactoring
BREAKING CHANGES
inMemory
utility to create an IPLD instance that uses a block service that stores data in memory. Please use theipld-in-memory
module instead.License: MIT
Signed-off-by: Alan Shaw [email protected]
Commit messages
Package name: ipld
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs