1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00
budibase/packages/types/src/sdk/context.ts

22 lines
479 B
TypeScript
Raw Normal View History

import { User, Account } from "../documents"
import { IdentityType } from "./events/identification"
export interface BaseContext {
_id: string
type: IdentityType
2022-07-14 00:22:21 +12:00
tenantId?: string
}
export interface AccountUserContext extends BaseContext {
tenantId: string
account: Account
}
export interface UserContext extends BaseContext, User {
_id: string
2022-07-14 00:22:21 +12:00
tenantId: string
account?: Account
}
export type IdentityContext = BaseContext | AccountUserContext | UserContext