feat(pockethost): extend models

This commit is contained in:
Ben Allfree 2024-07-31 06:09:32 -04:00
parent aa228303cb
commit aa1e2bee6e
2 changed files with 14 additions and 7 deletions

View File

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

View File

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