Twenty standard backfill non searchable object search field metadata (#22063)
# Introduction This PR https://github.com/twentyhq/twenty/pull/21964 introduces a search field metadata workspace command backfill that will recompute all the standard search field metadata but only for the searchable object Whereas the non searchable object still have a search vector as they can still be searched but internally Preserving their search vector by computing their search field metadata <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22063?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
+1
-8
@@ -1,9 +1,8 @@
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { type FileOutput } from 'src/engine/api/common/common-args-processors/data-arg-processor/types/file-item.type';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type CustomWorkspaceEntity } from 'src/engine/twenty-orm/custom.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { type DashboardWorkspaceEntity } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
@@ -14,12 +13,6 @@ import { type TaskWorkspaceEntity } from 'src/modules/task/standard-objects/task
|
||||
import { type WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_ATTACHMENT: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class AttachmentWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
/** @deprecated Use `file[0].label` field instead */
|
||||
name: string | null;
|
||||
|
||||
-9
@@ -1,16 +1,7 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_BLOCKLIST: FieldTypeAndNameMetadata[] = [
|
||||
{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class BlocklistWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
handle: string | null;
|
||||
workspaceMember: EntityRelation<WorkspaceMemberWorkspaceEntity>;
|
||||
|
||||
-8
@@ -1,15 +1,7 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarEventWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event.workspace-entity';
|
||||
|
||||
const EVENT_EXTERNAL_ID_FIELD_NAME = 'eventExternalId';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_CHANNEL_EVENT_ASSOCIATION: FieldTypeAndNameMetadata[] =
|
||||
[{ name: EVENT_EXTERNAL_ID_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export class CalendarChannelEventAssociationWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
eventExternalId: string | null;
|
||||
recurringEventExternalId: string | null;
|
||||
|
||||
-8
@@ -5,11 +5,9 @@ import {
|
||||
CalendarChannelSyncStage,
|
||||
CalendarChannelSyncStatus,
|
||||
CalendarChannelVisibility,
|
||||
FieldMetadataType,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarChannelEventAssociationWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-channel-event-association.workspace-entity';
|
||||
|
||||
@@ -36,12 +34,6 @@ registerEnumType(CalendarChannelContactAutoCreationPolicy, {
|
||||
name: 'CalendarChannelContactAutoCreationPolicy',
|
||||
});
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_CHANNEL: FieldTypeAndNameMetadata[] = [
|
||||
{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class CalendarChannelWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
handle: string | null;
|
||||
syncStatus: CalendarChannelSyncStatus | null;
|
||||
|
||||
-8
@@ -1,17 +1,9 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarEventWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_EVENT_PARTICIPANT: FieldTypeAndNameMetadata[] =
|
||||
[{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export enum CalendarEventParticipantResponseStatus {
|
||||
NEEDS_ACTION = 'NEEDS_ACTION',
|
||||
DECLINED = 'DECLINED',
|
||||
|
||||
+1
-8
@@ -1,17 +1,10 @@
|
||||
import { FieldMetadataType, type LinksMetadata } from 'twenty-shared/types';
|
||||
import { type LinksMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CalendarChannelEventAssociationWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-channel-event-association.workspace-entity';
|
||||
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_CALENDAR_EVENT: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
title: string | null;
|
||||
isCanceled: boolean;
|
||||
|
||||
-10
@@ -1,12 +1,10 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
type ActorMetadata,
|
||||
type AddressMetadata,
|
||||
type CurrencyMetadata,
|
||||
type LinksMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
@@ -16,14 +14,6 @@ import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-object
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
const DOMAIN_NAME_FIELD_NAME = 'domainName';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_COMPANY: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
{ name: DOMAIN_NAME_FIELD_NAME, type: FieldMetadataType.LINKS },
|
||||
];
|
||||
|
||||
export class CompanyWorkspaceEntity {
|
||||
// Base fields
|
||||
id: string;
|
||||
|
||||
+1
-8
@@ -1,17 +1,10 @@
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_DASHBOARD: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class DashboardWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
title: string | null;
|
||||
pageLayoutId: string | null;
|
||||
|
||||
+1
-8
@@ -1,18 +1,11 @@
|
||||
import { type EmailsMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type EmailsMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageListWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
|
||||
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
|
||||
const SUBJECT_FIELD_NAME = 'subject';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN: FieldTypeAndNameMetadata[] = [
|
||||
{ name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageCampaignWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
subject: string | null;
|
||||
bodyTemplate: string | null;
|
||||
|
||||
-9
@@ -1,17 +1,8 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { type MessageListMemberWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_LIST: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageListWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
members: EntityRelation<MessageListMemberWorkspaceEntity[]>;
|
||||
|
||||
-4
@@ -1,12 +1,8 @@
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { type MessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-folder.workspace-entity';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER: FieldTypeAndNameMetadata[] =
|
||||
[];
|
||||
|
||||
export class MessageChannelMessageAssociationMessageFolderWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
messageChannelMessageAssociation: EntityRelation<MessageChannelMessageAssociationWorkspaceEntity>;
|
||||
messageChannelMessageAssociationId: string;
|
||||
|
||||
-8
@@ -1,17 +1,9 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum';
|
||||
import { type MessageChannelMessageAssociationMessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association-message-folder.workspace-entity';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
|
||||
const MESSAGE_EXTERNAL_ID_FIELD_NAME = 'messageExternalId';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION: FieldTypeAndNameMetadata[] =
|
||||
[{ name: MESSAGE_EXTERNAL_ID_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export class MessageChannelMessageAssociationWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
messageExternalId: string | null;
|
||||
messageThreadExternalId: string | null;
|
||||
|
||||
-8
@@ -1,7 +1,6 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
FieldMetadataType,
|
||||
MessageChannelContactAutoCreationPolicy,
|
||||
MessageChannelPendingGroupEmailsAction,
|
||||
MessageChannelSyncStage,
|
||||
@@ -12,7 +11,6 @@ import {
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { type MessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-folder.workspace-entity';
|
||||
@@ -55,12 +53,6 @@ registerEnumType(MessageChannelPendingGroupEmailsAction, {
|
||||
name: 'MessageChannelPendingGroupEmailsAction',
|
||||
});
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_CHANNEL: FieldTypeAndNameMetadata[] = [
|
||||
{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageChannelWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
visibility: string;
|
||||
handle: string | null;
|
||||
|
||||
+1
-11
@@ -1,12 +1,8 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import {
|
||||
FieldMetadataType,
|
||||
MessageFolderPendingSyncAction,
|
||||
} from 'twenty-shared/types';
|
||||
import { MessageFolderPendingSyncAction } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageChannelMessageAssociationMessageFolderWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association-message-folder.workspace-entity';
|
||||
|
||||
@@ -16,12 +12,6 @@ registerEnumType(MessageFolderPendingSyncAction, {
|
||||
name: 'MessageFolderPendingSyncAction',
|
||||
});
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_FOLDER: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageFolderWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
syncCursor: string | null;
|
||||
|
||||
+1
-10
@@ -1,21 +1,12 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
type MessageParticipantRole,
|
||||
} from 'twenty-shared/types';
|
||||
import { type MessageParticipantRole } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const HANDLE_FIELD_NAME = 'handle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_PARTICIPANT: FieldTypeAndNameMetadata[] =
|
||||
[{ name: HANDLE_FIELD_NAME, type: FieldMetadataType.TEXT }];
|
||||
|
||||
export class MessageParticipantWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
role: MessageParticipantRole;
|
||||
handle: string | null;
|
||||
|
||||
-9
@@ -1,16 +1,7 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
|
||||
|
||||
const SUBJECT_FIELD_NAME = 'subject';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE_THREAD: FieldTypeAndNameMetadata[] = [
|
||||
{ name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageThreadWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
subject: string | null;
|
||||
messages: EntityRelation<MessageWorkspaceEntity[]>;
|
||||
|
||||
-9
@@ -1,19 +1,10 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
|
||||
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
|
||||
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
|
||||
import { type MessageThreadWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
|
||||
|
||||
const SUBJECT_FIELD_NAME = 'subject';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_MESSAGE: FieldTypeAndNameMetadata[] = [
|
||||
{ name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class MessageWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
headerMessageId: string | null;
|
||||
subject: string | null;
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
FieldMetadataType,
|
||||
type RichTextMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
import { type ActorMetadata, type RichTextMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
const BODY_V2_FIELD_NAME = 'bodyV2';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_NOTES: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
{ name: BODY_V2_FIELD_NAME, type: FieldMetadataType.RICH_TEXT },
|
||||
];
|
||||
|
||||
export class NoteWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
title: string;
|
||||
|
||||
+1
-12
@@ -1,11 +1,6 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
type CurrencyMetadata,
|
||||
FieldMetadataType,
|
||||
} from 'twenty-shared/types';
|
||||
import { type ActorMetadata, type CurrencyMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
@@ -15,12 +10,6 @@ import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-object
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_OPPORTUNITY: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class OpportunityWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string;
|
||||
amount: CurrencyMetadata | null;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
type EmailsMetadata,
|
||||
FieldMetadataType,
|
||||
type FullNameMetadata,
|
||||
type LinksMetadata,
|
||||
type PhonesMetadata,
|
||||
@@ -9,7 +8,6 @@ import {
|
||||
|
||||
import { type FileOutput } from 'src/engine/api/common/common-args-processors/data-arg-processor/types/file-item.type';
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
@@ -21,18 +19,6 @@ import { type OpportunityWorkspaceEntity } from 'src/modules/opportunity/standar
|
||||
import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
const EMAILS_FIELD_NAME = 'emails';
|
||||
const PHONES_FIELD_NAME = 'phones';
|
||||
const JOB_TITLE_FIELD_NAME = 'jobTitle';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_PERSON: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.FULL_NAME },
|
||||
{ name: EMAILS_FIELD_NAME, type: FieldMetadataType.EMAILS },
|
||||
{ name: PHONES_FIELD_NAME, type: FieldMetadataType.PHONES },
|
||||
{ name: JOB_TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: FullNameMetadata | null;
|
||||
emails: EmailsMetadata;
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
import {
|
||||
type ActorMetadata,
|
||||
FieldMetadataType,
|
||||
type RichTextMetadata,
|
||||
} from 'twenty-shared/types';
|
||||
import { type ActorMetadata, type RichTextMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
const BODY_V2_FIELD_NAME = 'bodyV2';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_TASKS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: TITLE_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
{ name: BODY_V2_FIELD_NAME, type: FieldMetadataType.RICH_TEXT },
|
||||
];
|
||||
|
||||
export class TaskWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
title: string | null;
|
||||
|
||||
-9
@@ -1,8 +1,5 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type CustomWorkspaceEntity } from 'src/engine/twenty-orm/custom.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { type DashboardWorkspaceEntity } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
@@ -17,12 +14,6 @@ import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common
|
||||
import { type WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_TIMELINE_ACTIVITY: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class TimelineActivityWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
happensAt: Date;
|
||||
name: string | null;
|
||||
|
||||
+1
-8
@@ -1,13 +1,12 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
import {
|
||||
type WorkflowRunStepInfos,
|
||||
type WorkflowRunStepLogs,
|
||||
} from 'twenty-shared/workflow';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
|
||||
@@ -54,12 +53,6 @@ export type WorkflowRunState = {
|
||||
workflowRunError?: string;
|
||||
};
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKFLOW_RUNS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkflowRunWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
enqueuedAt: Date | null;
|
||||
|
||||
-9
@@ -1,7 +1,4 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
import { type WorkflowRunWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-run.workspace-entity';
|
||||
@@ -16,12 +13,6 @@ export enum WorkflowVersionStatus {
|
||||
ARCHIVED = 'ARCHIVED',
|
||||
}
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKFLOW_VERSIONS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkflowVersionWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
trigger: WorkflowTrigger | null;
|
||||
|
||||
+1
-8
@@ -1,7 +1,6 @@
|
||||
import { type ActorMetadata, FieldMetadataType } from 'twenty-shared/types';
|
||||
import { type ActorMetadata } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
@@ -15,12 +14,6 @@ export enum WorkflowStatus {
|
||||
DEACTIVATED = 'DEACTIVATED',
|
||||
}
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKFLOWS: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkflowWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
name: string | null;
|
||||
lastPublishedVersionId: string | null;
|
||||
|
||||
+1
-10
@@ -1,11 +1,10 @@
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { type APP_LOCALES } from 'twenty-shared/translations';
|
||||
import { FieldMetadataType, type FullNameMetadata } from 'twenty-shared/types';
|
||||
import { type FullNameMetadata } from 'twenty-shared/types';
|
||||
import { type Relation } from 'typeorm';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type BlocklistWorkspaceEntity } from 'src/modules/blocklist/standard-objects/blocklist.workspace-entity';
|
||||
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
|
||||
@@ -52,14 +51,6 @@ registerEnumType(WorkspaceMemberDateFormatEnum, {
|
||||
'Date format as Month first, Day first, Year first or system as default',
|
||||
});
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
const USER_EMAIL_FIELD_NAME = 'userEmail';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_WORKSPACE_MEMBER: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.FULL_NAME },
|
||||
{ name: USER_EMAIL_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class WorkspaceMemberWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
name: FullNameMetadata;
|
||||
|
||||
Reference in New Issue
Block a user