Remove sync-metadata and IS_WORKSPACE_CREATION_V2_ENABLED feature flag (#16997)
# Introduction Followup of https://github.com/twentyhq/twenty/pull/17001#pullrequestreview-3638508738 close https://github.com/twentyhq/core-team-issues/issues/1910 We've completely decom the `sync-metadata` in production. We're now then removing its implementation in favor of the v2. ## TODO: - [x] Remove sync-metadata implem and commands - [x] Remove workspace decorators - [x] Type each deprecated field to deprecated on their workspaceEntity - [x] Remove the `workspace-sync-metadata` folder entirely - [x] remove workspace migration - [x] workspace migration removal migration - [x] remove the `v2` references from workspace manager file names - [x] remove the `v2` references from workspace manager modules - [ ] Double check impact on translation file path updates ## Note - Removed the gate logic - Remains some service v2 naming, serverless needs to be migrated on v2 fully - Removed workspaceMigration service app health consumption, making it always returning up ( no more down ) cc @FelixMalfait ( quite obsolete health check now, will require complete refactor once we introduce inter app dependency etc )
This commit is contained in:
-35
@@ -1,35 +0,0 @@
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { type AgentEntity } from 'src/engine/metadata-modules/ai/ai-agent/entities/agent.entity';
|
||||
import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
|
||||
import { type StandardAgentDefinition } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-agents/types/standard-agent-definition.interface';
|
||||
|
||||
export const transformStandardAgentDefinitionToFlatAgent = ({
|
||||
standardAgentDefinition,
|
||||
workspaceId,
|
||||
existingAgentEntity,
|
||||
}: {
|
||||
standardAgentDefinition: StandardAgentDefinition;
|
||||
workspaceId: string;
|
||||
existingAgentEntity?: Pick<
|
||||
AgentEntity,
|
||||
'createdAt' | 'deletedAt' | 'updatedAt' | 'id'
|
||||
>;
|
||||
}): FlatAgent => {
|
||||
const {
|
||||
standardRoleId: _standardRoleId,
|
||||
outputStrategy: _outputStrategy,
|
||||
...agentData
|
||||
} = standardAgentDefinition;
|
||||
const createdAt = new Date().toISOString();
|
||||
|
||||
return {
|
||||
id: existingAgentEntity?.id ?? v4(),
|
||||
createdAt: existingAgentEntity?.createdAt?.toISOString() ?? createdAt,
|
||||
updatedAt: existingAgentEntity?.updatedAt?.toISOString() ?? createdAt,
|
||||
deletedAt: existingAgentEntity?.deletedAt?.toISOString() ?? null,
|
||||
...agentData,
|
||||
workspaceId,
|
||||
universalIdentifier: standardAgentDefinition.standardId,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user