mirror of
https://github.com/pockethost/pockethost.git
synced 2025-06-04 13:16:41 +00:00
feat(pockethost): extend models
This commit is contained in:
parent
aa228303cb
commit
aa1e2bee6e
@ -19,7 +19,7 @@ export type InstanceSecretCollection = {
|
||||
[name: InstanceSecretKey]: InstanceSecretValue
|
||||
}
|
||||
|
||||
export type InstanceFields = BaseFields & {
|
||||
export type InstanceFields<TExtra = {}> = BaseFields & {
|
||||
region: string
|
||||
subdomain: Subdomain
|
||||
uid: UserId
|
||||
@ -33,13 +33,13 @@ export type InstanceFields = BaseFields & {
|
||||
dev: boolean
|
||||
cname_active: boolean
|
||||
notifyMaintenanceMode: boolean
|
||||
} & TExtra
|
||||
|
||||
export type WithUser<TUser = UserFields> = {
|
||||
expand: { uid: TUser }
|
||||
}
|
||||
|
||||
export type WithUser = {
|
||||
expand: { uid: UserFields }
|
||||
}
|
||||
|
||||
export type InstanceFields_WithUser = InstanceFields & WithUser
|
||||
export type InstanceFields_WithUser = InstanceFields<WithUser>
|
||||
|
||||
export type InstanceFields_Create = Omit<InstanceFields, keyof BaseFields>
|
||||
|
||||
|
@ -14,11 +14,18 @@ export const PLAN_NAMES = {
|
||||
[SubscriptionType.Lifetime]: `Founder's Edition`,
|
||||
}
|
||||
|
||||
export type UserFields = BaseFields & {
|
||||
export type UserFields<TExtra = {}> = BaseFields & {
|
||||
email: string
|
||||
verified: boolean
|
||||
isLegacy: boolean
|
||||
isFounder: boolean
|
||||
subscription: SubscriptionType
|
||||
notifyMaintenanceMode: boolean
|
||||
} & TExtra
|
||||
|
||||
export type WithCredentials = {
|
||||
tokenKey: string
|
||||
passwordHash: string
|
||||
}
|
||||
|
||||
export type UserFields_WithCredentials = UserFields<WithCredentials>
|
||||
|
Loading…
x
Reference in New Issue
Block a user