Skip to content

Commit

Permalink
Merge pull request #4469 from omnivore-app/jacksonh/export-admin
Browse files Browse the repository at this point in the history
Add exports to admin
  • Loading branch information
jacksonh authored Oct 31, 2024
2 parents ccaccab + 41b9703 commit 421c429
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pkg/admin/src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 2 additions & 0 deletions pkg/admin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Features,
EmailAddress,
Rule,
Export,
} from './db'
import { compare, hashSync } from 'bcryptjs'
const readYamlFile = require('read-yaml-file')
Expand Down Expand Up @@ -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' } } },
],
})

Expand Down

0 comments on commit 421c429

Please sign in to comment.