update secret-stack to 8.1

This commit is contained in:
Andre Staltz 2024-01-08 11:49:39 +02:00
parent 000dd016f4
commit fe3487c5ba
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
2 changed files with 3 additions and 21 deletions

View File

@ -22,22 +22,6 @@ const b4a = require('b4a')
* @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
* @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
*/
function initPromise(peer, config) {
assertDBPlugin(peer)
assertValidConfig(config)
const devicePromisesFile = Path.join(config.global.path, 'promises.json')
@ -147,7 +130,6 @@ function initPromise(peer, config) {
return
}
try {
assertSetPlugin(peer)
} catch (err) {
cb(/**@type {Error}*/ (err))
return
@ -198,7 +180,6 @@ function initPromise(peer, config) {
}
try {
assertDBPlugin(peer)
} catch (err) {
cb(/**@type {Error}*/ (err))
return
@ -296,6 +277,7 @@ function initPromise(peer, config) {
}
exports.name = 'promise'
exports.needs = ['db', 'set']
exports.manifest = {
// management
create: 'async',

View File

@ -40,7 +40,7 @@
"pretty-quick": "^3.1.3",
"rimraf": "^5.0.1",
"secret-handshake-ext": "0.0.11",
"secret-stack": "~8.0.0",
"secret-stack": "~8.1.0",
"typescript": "^5.1.3"
},
"scripts": {