2809 create connected account data model (#2856)
* create connectedAccount model * finished * fix comma
This commit is contained in:
@ -0,0 +1,47 @@
|
||||
import {
|
||||
WorkspaceMigrationColumnActionType,
|
||||
WorkspaceMigrationTableAction,
|
||||
} from 'src/metadata/workspace-migration/workspace-migration.entity';
|
||||
|
||||
export const addConnectedAccount: WorkspaceMigrationTableAction[] = [
|
||||
{
|
||||
name: 'connectedAccount',
|
||||
action: 'create',
|
||||
},
|
||||
{
|
||||
name: 'connectedAccount',
|
||||
action: 'alter',
|
||||
columns: [
|
||||
{
|
||||
columnName: 'type',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'accessToken',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'refreshToken',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'externalScopes',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'hasEmailScope',
|
||||
columnType: 'boolean',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: 'false',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@ -23,6 +23,7 @@ import { addViewTable } from './migrations/1697618011-addViewTable';
|
||||
import { addViewFieldTable } from './migrations/1697618012-addViewFieldTable';
|
||||
import { addViewFilterTable } from './migrations/1697618013-addViewFilterTable';
|
||||
import { addViewSortTable } from './migrations/1697618014-addViewSortTable';
|
||||
import { addConnectedAccount } from 'src/metadata/workspace-migration/migrations/1697618035-addConnectedAccount';
|
||||
|
||||
// TODO: read the folder and return all migrations
|
||||
export const standardMigrations = {
|
||||
@ -51,4 +52,5 @@ export const standardMigrations = {
|
||||
'1697618032-addActivityTargetRelations': addActivityTargetRelations,
|
||||
'1697618033-addActivityRelations': addActivityRelations,
|
||||
'1697618034-addCommentRelations': addCommentRelations,
|
||||
'1697618035-addConnectedAccount': addConnectedAccount,
|
||||
};
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
|
||||
const connectedAccountMetadata = {
|
||||
nameSingular: 'connectedAccount',
|
||||
namePlural: 'connectedAccounts',
|
||||
labelSingular: 'Connected Account',
|
||||
labelPlural: 'Connected Accounts',
|
||||
targetTableName: 'connectedAccount',
|
||||
description: 'A connected account',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
fields: [
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'type',
|
||||
label: 'type',
|
||||
targetColumnMap: {
|
||||
value: 'type',
|
||||
},
|
||||
description: 'The account type',
|
||||
icon: 'IconSettings',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'accessToken',
|
||||
label: 'accessToken',
|
||||
targetColumnMap: {
|
||||
value: 'accessToken',
|
||||
},
|
||||
description: 'Messaging provider access token',
|
||||
icon: 'IconKey',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'refreshToken',
|
||||
label: 'refreshToken',
|
||||
targetColumnMap: {
|
||||
value: 'refreshToken',
|
||||
},
|
||||
description: 'Messaging provider refresh token',
|
||||
icon: 'IconKey',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT, // Should be an array of strings
|
||||
name: 'externalScopes',
|
||||
label: 'externalScopes',
|
||||
targetColumnMap: {
|
||||
value: 'externalScopes',
|
||||
},
|
||||
description: 'External scopes',
|
||||
icon: 'IconCircle',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.BOOLEAN, // Should be an array of strings
|
||||
name: 'hasEmailScope',
|
||||
label: 'hasEmailScope',
|
||||
targetColumnMap: {
|
||||
value: 'hasEmailScope',
|
||||
},
|
||||
description: 'Has email scope',
|
||||
icon: 'IconMail',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default connectedAccountMetadata;
|
||||
@ -17,6 +17,7 @@ import viewFieldMetadata from 'src/workspace/workspace-manager/standard-objects/
|
||||
import viewFilterMetadata from 'src/workspace/workspace-manager/standard-objects/view-filter';
|
||||
import viewSortMetadata from 'src/workspace/workspace-manager/standard-objects/view-sort';
|
||||
import workspaceMemberMetadata from 'src/workspace/workspace-manager/standard-objects/workspace-member';
|
||||
import connectedAccountMetadata from 'src/workspace/workspace-manager/standard-objects/connected-account';
|
||||
|
||||
export const standardObjectsMetadata = {
|
||||
activityTarget: activityTargetMetadata,
|
||||
@ -25,6 +26,7 @@ export const standardObjectsMetadata = {
|
||||
attachment: attachmentMetadata,
|
||||
comment: commentMetadata,
|
||||
company: companyMetadata,
|
||||
connectedAccount: connectedAccountMetadata,
|
||||
favorite: favoriteMetadata,
|
||||
opportunity: opportunityMetadata,
|
||||
person: personMetadata,
|
||||
|
||||
Reference in New Issue
Block a user