diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js b/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js index 7bc77af..aea156b 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/transport-admin.js @@ -279,6 +279,27 @@ extendTransport(class { return msg; } + // Stop / restart indexing one root (MNP 6.2). Already-indexed files stay + // listed while it is paused. + async pauseRoot(groupId, rootName, signFn) { + return this._rootIndexOp('root_pause', groupId, rootName, signFn); + } + + async resumeRoot(groupId, rootName, signFn) { + return this._rootIndexOp('root_resume', groupId, rootName, signFn); + } + + async _rootIndexOp(type, groupId, rootName, signFn) { + const msg = await this._sendAndWait({ + type, v: '6.2', group_id: groupId, root_name: rootName, + }); + if (msg.type === 'error') throw new Error(msg.detail); + if (msg.type === 'admin_challenge') { + return this._authorizeAdminOp(msg, type, rootName, signFn); + } + return msg; + } + /** * Ask the node for a one-time pairing code admitting `userId` to this group. * |