diff --git a/pkg/admin/src/db.ts b/pkg/admin/src/db.ts index 78f55c4c7..3ded1877e 100644 --- a/pkg/admin/src/db.ts +++ b/pkg/admin/src/db.ts @@ -500,3 +500,33 @@ export class Rule extends BaseEntity { @Column({ type: 'timestamp', name: 'failed_at' }) failedAt?: Date } + +@Entity({ name: 'export' }) +export class Export extends BaseEntity { + @PrimaryGeneratedColumn('uuid') + id!: string + + @Column('uuid') + userId!: string + + @Column('text', { nullable: true }) + taskId?: string + + @Column('text') + state!: string + + @Column('int', { default: 0 }) + totalItems!: number + + @Column('int', { default: 0 }) + processedItems!: number + + @Column('text', { nullable: true }) + signedUrl?: string + + @Column({ type: 'timestamp', name: 'created_at' }) + createdAt!: Date + + @Column({ type: 'timestamp', name: 'updated_at' }) + updatedAt!: Date +} diff --git a/pkg/admin/src/index.ts b/pkg/admin/src/index.ts index 662cb8180..97dd08877 100644 --- a/pkg/admin/src/index.ts +++ b/pkg/admin/src/index.ts @@ -17,6 +17,7 @@ import { Features, EmailAddress, Rule, + Export, } from './db' import { compare, hashSync } from 'bcryptjs' const readYamlFile = require('read-yaml-file') @@ -54,6 +55,7 @@ const ADMIN_USER_EMAIL = { resource: Features, options: { parent: { name: 'Users' } } }, { resource: EmailAddress, options: { parent: { name: 'Users' } } }, { resource: Rule, options: { parent: { name: 'Users' } } }, + { resource: Export, options: { parent: { name: 'Users' } } }, ], })