mirror of https://codeberg.org/pzp/pzp-promise.git
update secret-stack to 8.1
This commit is contained in:
parent
000dd016f4
commit
fe3487c5ba
22
lib/index.js
22
lib/index.js
|
@ -22,22 +22,6 @@ const b4a = require('b4a')
|
||||||
* @typedef {(...args: [NodeJS.ErrnoException] | [null, T]) => void} CB<T>
|
* @typedef {(...args: [NodeJS.ErrnoException] | [null, T]) => void} CB<T>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {{ db: PPPPPDB | null }} peer
|
|
||||||
* @returns {asserts peer is { db: PPPPPDB }}
|
|
||||||
*/
|
|
||||||
function assertDBPlugin(peer) {
|
|
||||||
if (!peer.db) throw new Error('"promise" plugin requires "db" plugin')
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {{ set: PPPPPSet | null }} peer
|
|
||||||
* @returns {asserts peer is { set: PPPPPSet }}
|
|
||||||
*/
|
|
||||||
function assertSetPlugin(peer) {
|
|
||||||
if (!peer.set) throw new Error('"promise" plugin requires "set" plugin')
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Config} config
|
* @param {Config} config
|
||||||
* @returns {asserts config is ExpectedConfig}
|
* @returns {asserts config is ExpectedConfig}
|
||||||
|
@ -49,11 +33,10 @@ function assertValidConfig(config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {{ db: PPPPPDB | null; set: PPPPPSet | null }} peer
|
* @param {{ db: PPPPPDB; set: PPPPPSet }} peer
|
||||||
* @param {Config} config
|
* @param {Config} config
|
||||||
*/
|
*/
|
||||||
function initPromise(peer, config) {
|
function initPromise(peer, config) {
|
||||||
assertDBPlugin(peer)
|
|
||||||
assertValidConfig(config)
|
assertValidConfig(config)
|
||||||
const devicePromisesFile = Path.join(config.global.path, 'promises.json')
|
const devicePromisesFile = Path.join(config.global.path, 'promises.json')
|
||||||
|
|
||||||
|
@ -147,7 +130,6 @@ function initPromise(peer, config) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
assertSetPlugin(peer)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
cb(/**@type {Error}*/ (err))
|
cb(/**@type {Error}*/ (err))
|
||||||
return
|
return
|
||||||
|
@ -198,7 +180,6 @@ function initPromise(peer, config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
assertDBPlugin(peer)
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
cb(/**@type {Error}*/ (err))
|
cb(/**@type {Error}*/ (err))
|
||||||
return
|
return
|
||||||
|
@ -296,6 +277,7 @@ function initPromise(peer, config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.name = 'promise'
|
exports.name = 'promise'
|
||||||
|
exports.needs = ['db', 'set']
|
||||||
exports.manifest = {
|
exports.manifest = {
|
||||||
// management
|
// management
|
||||||
create: 'async',
|
create: 'async',
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
"pretty-quick": "^3.1.3",
|
"pretty-quick": "^3.1.3",
|
||||||
"rimraf": "^5.0.1",
|
"rimraf": "^5.0.1",
|
||||||
"secret-handshake-ext": "0.0.11",
|
"secret-handshake-ext": "0.0.11",
|
||||||
"secret-stack": "~8.0.0",
|
"secret-stack": "~8.1.0",
|
||||||
"typescript": "^5.1.3"
|
"typescript": "^5.1.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in New Issue