2022-10-25 00:06:50 +13:00
|
|
|
import { Context, Request } from "koa"
|
2022-11-11 06:38:26 +13:00
|
|
|
import { User, Role, UserRoles } from "../documents"
|
2022-09-07 03:24:36 +12:00
|
|
|
import { License } from "../sdk"
|
2022-07-19 08:11:52 +12:00
|
|
|
|
2022-11-11 06:38:26 +13:00
|
|
|
export interface ContextUser extends Omit<User, "roles"> {
|
2022-07-19 08:11:52 +12:00
|
|
|
globalId?: string
|
2022-09-07 03:24:36 +12:00
|
|
|
license: License
|
2022-11-11 06:38:26 +13:00
|
|
|
userId?: string
|
2022-11-16 06:35:17 +13:00
|
|
|
roleId?: string | null
|
2022-11-11 06:38:26 +13:00
|
|
|
role?: Role
|
|
|
|
roles?: UserRoles
|
2022-11-16 07:33:24 +13:00
|
|
|
csrfToken?: string
|
2022-07-19 08:11:52 +12:00
|
|
|
}
|
|
|
|
|
2022-10-25 00:06:50 +13:00
|
|
|
export interface BBRequest extends Request {
|
|
|
|
body: any
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BBContext extends Context {
|
|
|
|
request: BBRequest
|
2022-07-19 08:11:52 +12:00
|
|
|
user?: ContextUser
|
|
|
|
}
|