mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Account tools fix (#818)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
0557072f10
commit
9de79ba5bd
@ -14,7 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import {
|
||||
import accountPlugin, {
|
||||
ACCOUNT_DB,
|
||||
assignWorkspace,
|
||||
createAccount,
|
||||
@ -25,6 +25,7 @@ import {
|
||||
listWorkspaces,
|
||||
listAccounts
|
||||
} from '@anticrm/account'
|
||||
import { setMetadata } from '@anticrm/platform'
|
||||
import { program } from 'commander'
|
||||
import { Client } from 'minio'
|
||||
import { Db, MongoClient } from 'mongodb'
|
||||
@ -69,6 +70,9 @@ if (elasticUrl === undefined) {
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
setMetadata(accountPlugin.metadata.Endpoint, transactorUrl)
|
||||
setMetadata(accountPlugin.metadata.Transactor, transactorUrl)
|
||||
|
||||
const minio = new Client({
|
||||
endPoint: minioEndpoint,
|
||||
port: 9000,
|
||||
@ -93,7 +97,7 @@ program
|
||||
.description('create user and corresponding account in master database')
|
||||
.requiredOption('-p, --password <password>', 'user password')
|
||||
.requiredOption('-f, --first <first>', 'first name')
|
||||
.requiredOption('-l, --last <last>', 'first name')
|
||||
.requiredOption('-l, --last <last>', 'last name')
|
||||
.action(async (email: string, cmd) => {
|
||||
return await withDatabase(mongodbUri, async (db) => {
|
||||
console.log(`creating account ${cmd.first as string} ${cmd.last as string} (${email})...`)
|
||||
|
@ -76,6 +76,8 @@ export async function initWorkspace (transactorUrl: string, dbName: string): Pro
|
||||
const connection = await connect(transactorUrl, dbName)
|
||||
try {
|
||||
await createDeps(connection)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
} finally {
|
||||
await connection.close()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user