From fe3487c5ba6c27c97a465d568cb046197d393c9b Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Mon, 8 Jan 2024 11:49:39 +0200 Subject: [PATCH] update secret-stack to 8.1 --- lib/index.js | 22 ++-------------------- package.json | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/lib/index.js b/lib/index.js index a0c703d..ab755b8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -22,22 +22,6 @@ const b4a = require('b4a') * @typedef {(...args: [NodeJS.ErrnoException] | [null, T]) => void} CB */ -/** - * @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', diff --git a/package.json b/package.json index 6d557fb..7e6c814 100644 --- a/package.json +++ b/package.json @@ -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": {