Merge pull request #4469 from omnivore-app/jacksonh/export-admin

Add exports to admin
This commit is contained in:
Jackson Harper
2024-10-31 14:03:41 +08:00
committed by GitHub
2 changed files with 32 additions and 0 deletions

View File

@ -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
}

View File

@ -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' } } },
],
})