UBER-810 Add mixin attribute tool script (#3648)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2023-08-31 16:42:00 +07:00
committed by GitHub
parent dd64fc6e17
commit e43e151bba
2 changed files with 269 additions and 0 deletions
+21
View File
@@ -54,6 +54,7 @@ import { openAIConfigDefaults } from '@hcengineering/openai'
import { benchmark } from './benchmark'
import { cleanArchivedSpaces, cleanRemovedTransactions, cleanWorkspace, fixCommentDoubleIdCreate } from './clean'
import { changeConfiguration } from './configuration'
import { fixMixinForeignAttributes, showMixinForeignAttributes } from './mixin'
import { openAIConfig } from './openai'
/**
@@ -467,6 +468,26 @@ export function devTool (
await fixCommentDoubleIdCreate(getWorkspaceId(workspace, productId), transactorUrl)
})
program
.command('mixin-show-foreign-attributes <workspace>')
.description('mixin-show-foreign-attributes')
.option('--mixin <mixin>', 'Mixin class', '')
.option('--property <property>', 'Property name', '')
.option('--detail <detail>', 'Show details', false)
.action(async (workspace: string, cmd: { detail: boolean, mixin: string, property: string }) => {
await showMixinForeignAttributes(getWorkspaceId(workspace, productId), transactorUrl, cmd)
})
program
.command('mixin-fix-foreign-attributes <workspace>')
.description('mixin-fix-foreign-attributes')
.option('--mixin <mixin>', 'Mixin class', '')
.option('--property <property>', 'Property name', '')
.action(async (workspace: string, cmd: { mixin: string, property: string }) => {
const { mongodbUri } = prepareTools()
await fixMixinForeignAttributes(mongodbUri, getWorkspaceId(workspace, productId), transactorUrl, cmd)
})
program
.command('configure <workspace>')
.description('clean archived spaces')