mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 01:25:00 +02:00
Accounts listWorkspaces (#483)
Signed-off-by: Ilya Sumbatyants <ilya.sumb@gmail.com>
This commit is contained in:
+11
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
import { program } from 'commander'
|
||||
import { MongoClient, Db } from 'mongodb'
|
||||
import { getAccount, createAccount, assignWorkspace, createWorkspace, ACCOUNT_DB, dropWorkspace, dropAccount } from '@anticrm/account'
|
||||
import { getAccount, createAccount, assignWorkspace, createWorkspace, ACCOUNT_DB, dropWorkspace, dropAccount, listWorkspaces } from '@anticrm/account'
|
||||
import { createContributingClient } from '@anticrm/contrib'
|
||||
import core, { TxOperations } from '@anticrm/core'
|
||||
import { encode } from 'jwt-simple'
|
||||
@@ -164,6 +164,16 @@ program
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('list-workspaces')
|
||||
.description('List workspaces')
|
||||
.action(async () => {
|
||||
return await withDatabase(mongodbUri, async (db) => {
|
||||
const workspacesJSON = JSON.stringify(await listWorkspaces(db), null, 2)
|
||||
console.info(workspacesJSON)
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
.command('drop-account <name>')
|
||||
.description('drop account')
|
||||
|
||||
Reference in New Issue
Block a user