[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:
-11
@@ -1,11 +0,0 @@
|
||||
import { type FactoryProvider, type ModuleMetadata } from '@nestjs/common';
|
||||
|
||||
export interface TwentyORMOptions {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export type TwentyORMModuleAsyncOptions = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
useFactory: (...args: any[]) => TwentyORMOptions | Promise<TwentyORMOptions>;
|
||||
} & Pick<ModuleMetadata, 'imports'> &
|
||||
Pick<FactoryProvider, 'inject'>;
|
||||
-94
@@ -1,94 +0,0 @@
|
||||
import { type ObjectType } from 'typeorm';
|
||||
import { type RelationOnDeleteAction } from 'twenty-shared/types';
|
||||
|
||||
import { type RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
export type WorkspaceDynamicRelationMetadataArgsFactory = (
|
||||
oppositeObjectMetadata: ObjectMetadataEntity,
|
||||
) => {
|
||||
/**
|
||||
* Standard id.
|
||||
*/
|
||||
readonly standardId: string;
|
||||
|
||||
/**
|
||||
* Relation name.
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Relation label.
|
||||
*/
|
||||
readonly label: string;
|
||||
|
||||
/**
|
||||
* Relation description.
|
||||
*/
|
||||
readonly description?: string;
|
||||
|
||||
/**
|
||||
* Relation icon.
|
||||
*/
|
||||
readonly icon?: string;
|
||||
|
||||
/**
|
||||
* Relation join column.
|
||||
*/
|
||||
readonly joinColumn?: string;
|
||||
};
|
||||
|
||||
export interface WorkspaceDynamicRelationMetadataArgs {
|
||||
/**
|
||||
* Class to which relation is applied.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/**
|
||||
* Factory function
|
||||
*/
|
||||
readonly argsFactory: WorkspaceDynamicRelationMetadataArgsFactory;
|
||||
|
||||
/**
|
||||
* Relation type.
|
||||
*/
|
||||
readonly type: RelationType;
|
||||
|
||||
/**
|
||||
* Relation inverse side target.
|
||||
*/
|
||||
readonly inverseSideTarget: () => ObjectType<object>;
|
||||
|
||||
/**
|
||||
* Relation inverse side field key.
|
||||
*/
|
||||
readonly inverseSideFieldKey?: string;
|
||||
|
||||
/**
|
||||
* Relation on delete action.
|
||||
*/
|
||||
readonly onDelete?: RelationOnDeleteAction;
|
||||
|
||||
/**
|
||||
* Is primary field.
|
||||
*/
|
||||
readonly isPrimary: boolean;
|
||||
|
||||
/**
|
||||
* Is system field.
|
||||
*/
|
||||
readonly isSystem: boolean;
|
||||
|
||||
/**
|
||||
* Is nullable field.
|
||||
*/
|
||||
readonly isNullable: boolean;
|
||||
|
||||
/**
|
||||
* Field gate.
|
||||
*/
|
||||
readonly gate?: Gate;
|
||||
}
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { type WorkspaceEntityDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-builder/types/workspace-entity-duplicate-criteria.type';
|
||||
|
||||
export interface WorkspaceEntityMetadataArgs {
|
||||
/**
|
||||
* Standard id.
|
||||
*/
|
||||
readonly standardId: string;
|
||||
|
||||
/**
|
||||
* Class to which table is applied.
|
||||
* Function target is a table defined in the class.
|
||||
* String target is a table defined in a json schema.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/**
|
||||
* Entity name.
|
||||
*/
|
||||
readonly nameSingular: string;
|
||||
readonly namePlural: string;
|
||||
|
||||
/**
|
||||
* Entity label.
|
||||
*/
|
||||
readonly labelSingular: string;
|
||||
readonly labelPlural: string;
|
||||
|
||||
/**
|
||||
* Entity description.
|
||||
*/
|
||||
readonly description?: string;
|
||||
|
||||
/**
|
||||
* Entity icon.
|
||||
*/
|
||||
readonly icon?: string;
|
||||
|
||||
/**
|
||||
* Entity shortcut.
|
||||
*/
|
||||
readonly shortcut?: string;
|
||||
|
||||
/**
|
||||
* Is audit logged.
|
||||
*/
|
||||
readonly isAuditLogged: boolean;
|
||||
|
||||
/**
|
||||
* Is system object.
|
||||
*/
|
||||
readonly isSystem: boolean;
|
||||
|
||||
/**
|
||||
* Is UI read-only object.
|
||||
*/
|
||||
readonly isUIReadOnly: boolean;
|
||||
|
||||
/**
|
||||
* Entity gate.
|
||||
*/
|
||||
readonly gate?: Gate;
|
||||
|
||||
/**
|
||||
* Label identifier.
|
||||
*/
|
||||
readonly labelIdentifierStandardId: string | null;
|
||||
|
||||
/**
|
||||
* Image identifier.
|
||||
*/
|
||||
readonly imageIdentifierStandardId: string | null;
|
||||
|
||||
/**
|
||||
* Duplicate criteria.
|
||||
*/
|
||||
readonly duplicateCriteria?: WorkspaceEntityDuplicateCriteria[];
|
||||
|
||||
/**
|
||||
* Is searchable object.
|
||||
*/
|
||||
readonly isSearchable: boolean;
|
||||
}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
export interface WorkspaceExtendedEntityMetadataArgs {
|
||||
/**
|
||||
* Class to which table is applied.
|
||||
* Function target is a table defined in the class.
|
||||
* String target is a table defined in a json schema.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/**
|
||||
* Entity gate.
|
||||
*/
|
||||
readonly gate?: Gate;
|
||||
}
|
||||
-117
@@ -1,117 +0,0 @@
|
||||
import {
|
||||
type FieldMetadataOptions,
|
||||
type FieldMetadataSettings,
|
||||
type FieldMetadataType,
|
||||
type FieldMetadataDefaultValue,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
export interface WorkspaceFieldMetadataArgs {
|
||||
/**
|
||||
* Standard id.
|
||||
*/
|
||||
readonly standardId: string;
|
||||
|
||||
/**
|
||||
* Class to which field is applied.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/**
|
||||
* Field name.
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Field label.
|
||||
*/
|
||||
readonly label: string | ((objectMetadata: ObjectMetadataEntity) => string);
|
||||
|
||||
/**
|
||||
* Field type.
|
||||
*/
|
||||
readonly type: FieldMetadataType;
|
||||
|
||||
/**
|
||||
* Field description.
|
||||
*/
|
||||
readonly description?:
|
||||
| string
|
||||
| ((objectMetadata: ObjectMetadataEntity) => string);
|
||||
|
||||
/**
|
||||
* Field icon.
|
||||
*/
|
||||
readonly icon?: string;
|
||||
|
||||
/**
|
||||
* Field default value.
|
||||
*/
|
||||
readonly defaultValue?: FieldMetadataDefaultValue;
|
||||
|
||||
/**
|
||||
* Field options.
|
||||
*/
|
||||
readonly options?: FieldMetadataOptions;
|
||||
|
||||
/**
|
||||
* Field settings.
|
||||
*/
|
||||
readonly settings?: FieldMetadataSettings;
|
||||
|
||||
/**
|
||||
* Is primary field.
|
||||
*/
|
||||
readonly isPrimary: boolean;
|
||||
|
||||
/**
|
||||
* Is system field.
|
||||
*/
|
||||
readonly isSystem: boolean;
|
||||
|
||||
/**
|
||||
* Is UI read-only field.
|
||||
*/
|
||||
readonly isUIReadOnly: boolean;
|
||||
|
||||
/**
|
||||
* Is nullable field.
|
||||
*/
|
||||
readonly isNullable: boolean;
|
||||
|
||||
/**
|
||||
* Is unique field.
|
||||
*/
|
||||
readonly isUnique: boolean;
|
||||
|
||||
/**
|
||||
* Field gate.
|
||||
*/
|
||||
readonly gate?: Gate;
|
||||
|
||||
/**
|
||||
* Is deprecated field.
|
||||
*/
|
||||
readonly isDeprecated?: boolean;
|
||||
|
||||
/**
|
||||
* Is active field.
|
||||
*/
|
||||
readonly isActive?: boolean;
|
||||
|
||||
/**
|
||||
* Is active field.
|
||||
*/
|
||||
readonly generatedType?: 'STORED' | 'VIRTUAL';
|
||||
|
||||
/**
|
||||
* Is active field.
|
||||
*/
|
||||
readonly asExpression?: string;
|
||||
|
||||
readonly isLabelSyncedWithName: boolean;
|
||||
}
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { type IndexType } from 'src/engine/metadata-modules/index-metadata/types/indexType.types';
|
||||
|
||||
export interface WorkspaceIndexMetadataArgs {
|
||||
/**
|
||||
* Class to which index is applied.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/*
|
||||
* Index name.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/*
|
||||
* Index columns.
|
||||
*/
|
||||
columns: string[];
|
||||
|
||||
/**
|
||||
* Is index unique.
|
||||
*/
|
||||
isUnique: boolean;
|
||||
|
||||
/*
|
||||
* Index type. Defaults to Btree.
|
||||
*/
|
||||
type?: IndexType;
|
||||
|
||||
/**
|
||||
* Index where clause.
|
||||
*/
|
||||
whereClause: string | null;
|
||||
|
||||
/**
|
||||
* Field gate.
|
||||
*/
|
||||
readonly gate?: Gate;
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
export interface WorkspaceJoinColumnsMetadataArgs {
|
||||
/**
|
||||
* Class to which relation is applied.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/**
|
||||
* Relation name.
|
||||
*/
|
||||
readonly relationName: string;
|
||||
|
||||
/**
|
||||
* Relation label.
|
||||
*/
|
||||
readonly joinColumn: string;
|
||||
}
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
import { type ObjectType } from 'typeorm';
|
||||
import { type RelationOnDeleteAction } from 'twenty-shared/types';
|
||||
|
||||
import { type RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
import { type Gate } from 'src/engine/twenty-orm/interfaces/gate.interface';
|
||||
|
||||
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
|
||||
export interface WorkspaceRelationMetadataArgs {
|
||||
/**
|
||||
* Standard id.
|
||||
*/
|
||||
readonly standardId: string;
|
||||
|
||||
/**
|
||||
* Class to which relation is applied.
|
||||
*/
|
||||
|
||||
readonly target: Function;
|
||||
|
||||
/**
|
||||
* Relation name.
|
||||
*/
|
||||
readonly name: string;
|
||||
|
||||
/**
|
||||
* Relation label.
|
||||
*/
|
||||
readonly label: string | ((objectMetadata: ObjectMetadataEntity) => string);
|
||||
|
||||
/**
|
||||
* Relation type.
|
||||
*/
|
||||
readonly type: RelationType;
|
||||
|
||||
/**
|
||||
* Relation description.
|
||||
*/
|
||||
readonly description?:
|
||||
| string
|
||||
| ((objectMetadata: ObjectMetadataEntity) => string);
|
||||
|
||||
/**
|
||||
* Relation icon.
|
||||
*/
|
||||
readonly icon?: string;
|
||||
|
||||
/**
|
||||
* Relation inverse side target.
|
||||
*/
|
||||
readonly inverseSideTarget: () => ObjectType<object>;
|
||||
|
||||
/**
|
||||
* Relation inverse side field key.
|
||||
*/
|
||||
readonly inverseSideFieldKey?: string;
|
||||
|
||||
/**
|
||||
* Relation on delete action.
|
||||
*/
|
||||
readonly onDelete?: RelationOnDeleteAction;
|
||||
|
||||
/**
|
||||
* Is primary field.
|
||||
*/
|
||||
readonly isPrimary: boolean;
|
||||
|
||||
/**
|
||||
* Is system field.
|
||||
*/
|
||||
readonly isSystem: boolean;
|
||||
|
||||
/**
|
||||
* Is UI read-only field.
|
||||
*/
|
||||
readonly isUIReadOnly: boolean;
|
||||
|
||||
/**
|
||||
* Is nullable field.
|
||||
*/
|
||||
readonly isNullable: boolean;
|
||||
|
||||
/**
|
||||
* Field gate.
|
||||
*/
|
||||
readonly gate?: Gate;
|
||||
|
||||
/**
|
||||
* Is active field.
|
||||
*/
|
||||
readonly isActive?: boolean;
|
||||
|
||||
readonly isLabelSyncedWithName: boolean;
|
||||
|
||||
/**
|
||||
* Is morph relation.
|
||||
*/
|
||||
readonly isMorphRelation: boolean;
|
||||
|
||||
/**
|
||||
* Morph id.
|
||||
*/
|
||||
readonly morphId?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user