0b93a6785b
* wip * wip * move blocklist to connectedAccount * wip * format date * fix styling * renaming * fix imports * fix imports * Rename BlockListItem.ts to BlocklistItem.ts * Add IS_BLOCKLIST_ENABLED feature flag and remove IS_MESSAGING_ENABLED gate at model creation * hide blocklist if feature flag is disabled
83 lines
2.8 KiB
TypeScript
83 lines
2.8 KiB
TypeScript
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
|
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
|
import { FieldMetadata } from 'src/workspace/workspace-sync-metadata/decorators/field-metadata.decorator';
|
|
import { IsNullable } from 'src/workspace/workspace-sync-metadata/decorators/is-nullable.decorator';
|
|
import { IsSystem } from 'src/workspace/workspace-sync-metadata/decorators/is-system.decorator';
|
|
import { ObjectMetadata } from 'src/workspace/workspace-sync-metadata/decorators/object-metadata.decorator';
|
|
import { RelationMetadata } from 'src/workspace/workspace-sync-metadata/decorators/relation-metadata.decorator';
|
|
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
|
import { MessageChannelObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/message-channel.object-metadata';
|
|
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
|
|
|
@ObjectMetadata({
|
|
namePlural: 'connectedAccounts',
|
|
labelSingular: 'Connected Account',
|
|
labelPlural: 'Connected Accounts',
|
|
description: 'A connected account',
|
|
icon: 'IconAt',
|
|
})
|
|
@IsSystem()
|
|
export class ConnectedAccountObjectMetadata extends BaseObjectMetadata {
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'handle',
|
|
description: 'The account handle (email, username, phone number, etc.)',
|
|
icon: 'IconMail',
|
|
})
|
|
handle: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'provider',
|
|
description: 'The account provider',
|
|
icon: 'IconSettings',
|
|
})
|
|
provider: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'Access Token',
|
|
description: 'Messaging provider access token',
|
|
icon: 'IconKey',
|
|
})
|
|
accessToken: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'Refresh Token',
|
|
description: 'Messaging provider refresh token',
|
|
icon: 'IconKey',
|
|
})
|
|
refreshToken: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.RELATION,
|
|
label: 'Account Owner',
|
|
description: 'Account Owner',
|
|
icon: 'IconUserCircle',
|
|
joinColumn: 'accountOwnerId',
|
|
})
|
|
accountOwner: WorkspaceMemberObjectMetadata;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.TEXT,
|
|
label: 'Last sync history ID',
|
|
description: 'Last sync history ID',
|
|
icon: 'IconHistory',
|
|
})
|
|
lastSyncHistoryId: string;
|
|
|
|
@FieldMetadata({
|
|
type: FieldMetadataType.RELATION,
|
|
label: 'Message Channel',
|
|
description: 'Message Channel',
|
|
icon: 'IconMessage',
|
|
})
|
|
@RelationMetadata({
|
|
type: RelationMetadataType.ONE_TO_MANY,
|
|
objectName: 'messageChannel',
|
|
})
|
|
@IsNullable()
|
|
messageChannels: MessageChannelObjectMetadata[];
|
|
}
|