gip-remote 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const ReadyResource = require('ready-resource')
|
|
2
2
|
const HyperDB = require('hyperdb')
|
|
3
3
|
const Hyperbee = require('hyperbee2')
|
|
4
|
+
const z32 = require('z32')
|
|
4
5
|
const def = require('./schema/hyperdb/index')
|
|
5
6
|
const RemoteDrive = require('./lib/drive')
|
|
6
7
|
const GitPearLink = require('./lib/link')
|
|
@@ -38,19 +39,27 @@ class Remote extends ReadyResource {
|
|
|
38
39
|
get name() {
|
|
39
40
|
return this._name
|
|
40
41
|
}
|
|
42
|
+
|
|
41
43
|
get core() {
|
|
42
44
|
return this._db.core
|
|
43
45
|
}
|
|
46
|
+
|
|
44
47
|
get key() {
|
|
45
48
|
return this._db.core.key
|
|
46
49
|
}
|
|
50
|
+
|
|
47
51
|
get discoveryKey() {
|
|
48
52
|
return this._db.core.discoveryKey
|
|
49
53
|
}
|
|
54
|
+
|
|
50
55
|
get availablePeers() {
|
|
51
56
|
return this._db.core.peers.length
|
|
52
57
|
}
|
|
53
58
|
|
|
59
|
+
get url() {
|
|
60
|
+
return `git+pear://${z32.encode(this.key)}/${this.name}`
|
|
61
|
+
}
|
|
62
|
+
|
|
54
63
|
// --- Objects ---
|
|
55
64
|
|
|
56
65
|
async getObject(oid) {
|