[BREAKING_CHANGE] Deprecate remaining entities standardId (#17639)
# Introduction Following https://github.com/twentyhq/twenty/pull/17632 and https://github.com/twentyhq/twenty/pull/17572 This PR deprecates the agent, skill, field metadata and role `standardId` in favor of the `universalIdentifier` usage ## Note - Removed previous standard ids declaration modules - Twenty-sdk now re-exports the `STANDARD_OBJECTS` universalIdentifier hashmap constant - deleted some sync-metadata deadcode too ( mainly types )
This commit is contained in:
@@ -20,9 +20,6 @@ export class AgentDTO {
|
||||
@Field(() => UUIDScalarType)
|
||||
id: string;
|
||||
|
||||
@Field(() => UUIDScalarType, { nullable: true })
|
||||
standardId?: string | null;
|
||||
|
||||
@IsString()
|
||||
@Field()
|
||||
name: string;
|
||||
|
||||
+1
-4
@@ -15,9 +15,9 @@ import GraphQLJSON from 'graphql-type-json';
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AgentResponseFormat } from 'src/engine/metadata-modules/ai/ai-agent/types/agent-response-format.type';
|
||||
import { ModelConfiguration } from 'src/engine/metadata-modules/ai/ai-agent/types/modelConfiguration';
|
||||
import { ModelId } from 'src/engine/metadata-modules/ai/ai-models/constants/ai-models.const';
|
||||
import { AgentResponseFormatJson } from 'src/engine/metadata-modules/ai/ai-agent/validators/agent-response-format-json.validator';
|
||||
import { AgentResponseFormatText } from 'src/engine/metadata-modules/ai/ai-agent/validators/agent-response-format-text.validator';
|
||||
import { ModelId } from 'src/engine/metadata-modules/ai/ai-models/constants/ai-models.const';
|
||||
|
||||
@InputType()
|
||||
export class CreateAgentInput {
|
||||
@@ -82,9 +82,6 @@ export class CreateAgentInput {
|
||||
@Field(() => [String], { nullable: true })
|
||||
evaluationInputs?: string[];
|
||||
|
||||
@HideField()
|
||||
standardId?: string;
|
||||
|
||||
@HideField()
|
||||
applicationId?: string;
|
||||
}
|
||||
|
||||
-3
@@ -30,9 +30,6 @@ export class AgentEntity
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({ nullable: true, type: 'uuid' })
|
||||
standardId: string | null;
|
||||
|
||||
@Column({ nullable: false })
|
||||
name: string;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
|
||||
|
||||
import { isWorkflowRelatedObject } from 'src/engine/metadata-modules/ai/ai-agent/utils/is-workflow-related-object.util';
|
||||
import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant';
|
||||
|
||||
describe('isWorkflowRelatedObject', () => {
|
||||
it('should return true for workflow-related objects', () => {
|
||||
|
||||
+1
-5
@@ -32,7 +32,6 @@ export const fromCreateAgentInputToFlatAgent = ({
|
||||
'description',
|
||||
'prompt',
|
||||
'modelId',
|
||||
'standardId',
|
||||
'applicationId',
|
||||
'roleId',
|
||||
],
|
||||
@@ -40,12 +39,9 @@ export const fromCreateAgentInputToFlatAgent = ({
|
||||
|
||||
const createdAt = new Date().toISOString();
|
||||
const agentId = v4();
|
||||
const standardId = createAgentInput.standardId ?? null;
|
||||
const universalIdentifier = standardId ?? agentId;
|
||||
|
||||
const flatAgentToCreate: FlatAgent = {
|
||||
id: agentId,
|
||||
standardId,
|
||||
name: isNonEmptyString(createAgentInput.name)
|
||||
? createAgentInput.name
|
||||
: computeMetadataNameFromLabel({ label: createAgentInput.label }),
|
||||
@@ -57,7 +53,7 @@ export const fromCreateAgentInputToFlatAgent = ({
|
||||
responseFormat: createAgentInput.responseFormat ?? { type: 'text' },
|
||||
workspaceId,
|
||||
isCustom: true,
|
||||
universalIdentifier,
|
||||
universalIdentifier: v4(),
|
||||
applicationId: createAgentInput.applicationId,
|
||||
modelConfiguration: createAgentInput.modelConfiguration ?? null,
|
||||
evaluationInputs: createAgentInput.evaluationInputs ?? [],
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant';
|
||||
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
|
||||
|
||||
// All workflow-related standard object IDs that should be filtered out from agent access
|
||||
const WORKFLOW_STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS = [
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
|
||||
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { STANDARD_OBJECTS } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-object.constant';
|
||||
|
||||
// All workflow-related standard object IDs that should be filtered out from agent access
|
||||
const WORKFLOW_STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS = [
|
||||
|
||||
Reference in New Issue
Block a user