mirror of https://codeberg.org/pzp/pzp-sync.git
better secret-stack plugin shape
This commit is contained in:
parent
0ae7704994
commit
782b435a98
|
@ -4,6 +4,7 @@ pnpm-lock.yaml
|
|||
package-lock.json
|
||||
coverage
|
||||
*~
|
||||
lib/*.d.ts
|
||||
|
||||
# For misc scripts and experiments:
|
||||
/gitignored
|
||||
|
|
27
lib/index.js
27
lib/index.js
|
@ -51,19 +51,7 @@ function assertSHSEExists(peer) {
|
|||
if (!peer.shse) throw new Error('sync requires secret-handshake-ext')
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
name: 'sync',
|
||||
manifest: {
|
||||
connect: 'duplex',
|
||||
initiate: 'sync',
|
||||
},
|
||||
permissions: {
|
||||
anonymous: {
|
||||
allow: ['connect'],
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param {Emitter & {
|
||||
* db: PPPPPDB | null,
|
||||
* dict: PPPPPDict | null,
|
||||
|
@ -73,7 +61,7 @@ module.exports = {
|
|||
* }} peer
|
||||
* @param {unknown} config
|
||||
*/
|
||||
init(peer, config) {
|
||||
function initSync(peer, config) {
|
||||
assertDBExists(peer)
|
||||
assertGoalsExists(peer)
|
||||
assertSHSEExists(peer)
|
||||
|
@ -140,5 +128,16 @@ module.exports = {
|
|||
connect,
|
||||
start,
|
||||
}
|
||||
}
|
||||
|
||||
exports.name = 'sync'
|
||||
exports.manifest = {
|
||||
connect: 'duplex',
|
||||
initiate: 'sync',
|
||||
}
|
||||
exports.init = initSync
|
||||
exports.permissions = {
|
||||
anonymous: {
|
||||
allow: ['connect'],
|
||||
},
|
||||
}
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
},
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"*.js",
|
||||
"lib/*.js"
|
||||
"lib/**"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
|
|
Loading…
Reference in New Issue