Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame contribute delete
650 Bytes
import { BaseEntity } from './entity.ts'
import { GraphQL } from './graphql.ts'
import { randEmail, randPickOne, randString } from './rand.ts'
type UserRole = 'admin' | 'user'
export type UserParams = {
name: string
email: string
role: UserRole
username: string
password: string
}
export class User extends BaseEntity {
constructor(gql: GraphQL, id: string) {
super(gql, 'user', id)
}
static randParams(): UserParams {
return {
name: 'user-' + randString(20),
email: randEmail(),
role: randPickOne(['admin', 'user']),
username: 'test-' + randString(16),
password: randString(20),
}
}
}