diff --git a/docs/Entry.html b/docs/Entry.html new file mode 100644 index 00000000..be860286 --- /dev/null +++ b/docs/Entry.html @@ -0,0 +1,2118 @@ + + + + + JSDoc: Class: Entry + + + + + + + + + + +
+ +

Class: Entry

+ + + + + + +
+ +
+ +

Entry()

+ + +
+ +
+
+ + + + + + +

new Entry()

+ + + + + + +
+ An ipfs-log entry +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

(static) compare(a, b) → {number}

+ + + + + + +
+ Compares two entries. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +Entry + + + +
b + + +Entry + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ 1 if a is greater, -1 is b is greater +
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + + + + +

(async, static) create(ipfs, identity, logId, data, nextopt, clockopt) → {Promise.<Entry>}

+ + + + + + +
+ Create an Entry +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
ipfs + + +IPFS + + + + + + + + + + + + An IPFS instance
identity + + +Identity + + + + + + + + + + + + The identity instance
logId + + +string + + + + + + + + + + + + The unique identifier for this log
data + + +* + + + + + + + + + + + + Data of the entry to be added. Can be any JSON.stringifyable data
next + + +Array.<(string|Entry)> + + + + + + <optional>
+ + + + + +
+ + [] + + Parent hashes or entries
clock + + +LamportClock + + + + + + <optional>
+ + + + + +
+ + The lamport clock
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Entry> + + +
+
+ + + + + + +
Example
+ +
const entry = await Entry.create(ipfs, identity, 'hello')
+console.log(entry)
+// { hash: null, payload: "hello", next: [] }
+ + + + + + + + + +

(static) findChildren(entry, values) → {Array.<Entry>}

+ + + + + + +
+ Find entry's children from an Array of entries. +Returns entry's children as an Array up to the last know child. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entry + + +Entry + + + + Entry for which to find the parents
values + + +Array.<Entry> + + + + Entries to search parents from
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<Entry> + + +
+
+ + + + + + + + + + + + + +

(async, static) fromMultihash(ipfs, hash) → {Promise.<Entry>}

+ + + + + + +
+ Create an Entry from a hash. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ipfs + + +IPFS + + + + An IPFS instance
hash + + +string + + + + The hash to create an Entry from
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<Entry> + + +
+
+ + + + + + +
Example
+ +
const entry = await Entry.fromMultihash(ipfs, "zd...Foo")
+console.log(entry)
+// { hash: "Zd...Foo", payload: "hello", next: [] }
+ + + + + + + + + +

(static) isEntry(obj) → {boolean}

+ + + + + + +
+ Check if an object is an Entry. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
obj + + +Entry + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(static) isEqual(a, b) → {boolean}

+ + + + + + +
+ Check if an entry equals another entry. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +Entry + + + +
b + + +Entry + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(static) isParent(entry1, entry2) → {boolean}

+ + + + + + +
+ Check if an entry is a parent to another entry. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entry1 + + +Entry + + + + Entry to check
entry2 + + +Entry + + + + The parent Entry
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + + + + +

(static) toBuffer(entry) → {Buffer}

+ + + + + + +
+ Transforms an entry into a Buffer. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entry + + +Entry + + + + The entry
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ The buffer +
+ + + +
+
+ Type +
+
+ +Buffer + + +
+
+ + + + + + + + + + + + + +

(async, static) toMultihash(ipfs, entry) → {Promise.<string>}

+ + + + + + +
+ Get the multihash of an Entry. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ipfs + + +IPFS + + + + An IPFS instance
entry + + +Entry + + + + Entry to get a multihash for
+ + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • Yes
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<string> + + +
+
+ + + + + + +
Example
+ +
const multihash = await Entry.toMultihash(ipfs, entry)
+console.log(multihash)
+// "Qm...Foo"
+ + + + + + + + + +

(async, static) verify(identityProvider, entry) → {Promise}

+ + + + + + +
+ Verifies an entry signature. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
identityProvider + + +IdentityProvider + + + + The identity provider to use
entry + + +Entry + + + + The entry being verified
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+ A promise that resolves to a boolean value indicating if the signature is valid +
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/docs/GSet.html b/docs/GSet.html index 2ec57700..7ff4e86c 100644 --- a/docs/GSet.html +++ b/docs/GSet.html @@ -165,7 +165,7 @@

Home

Classes