shellphone.app/types.ts
2021-08-06 01:14:19 +08:00

22 lines
497 B
TypeScript

import { DefaultCtx, SessionContext, SimpleRolesIsAuthorized } from "blitz";
import { Organization, User, GlobalRole, MembershipRole } from "./db";
type Role = GlobalRole | MembershipRole;
declare module "blitz" {
export interface Ctx extends DefaultCtx {
session: SessionContext;
}
export interface Session {
isAuthorized: SimpleRolesIsAuthorized<Role>;
PublicData: {
userId: User["id"];
roles: Role[];
orgId: Organization["id"];
hasCompletedOnboarding?: true;
};
}
}