1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00
budibase/packages/types/src/sdk/context.ts
2022-07-13 08:22:21 -04:00

22 lines
479 B
TypeScript

import { User, Account } from "../documents"
import { IdentityType } from "./events/identification"
export interface BaseContext {
_id: string
type: IdentityType
tenantId?: string
}
export interface AccountUserContext extends BaseContext {
tenantId: string
account: Account
}
export interface UserContext extends BaseContext, User {
_id: string
tenantId: string
account?: Account
}
export type IdentityContext = BaseContext | AccountUserContext | UserContext