@smart-consulting/lattice-services
Version:
Collection of common types and functions for connecting to Lattice services
37 lines (36 loc) • 1.24 kB
TypeScript
import * as t from 'io-ts';
declare const corgisAuth0Namespace = "https://wsp-lattice.io/";
declare const corgisAuth0PermissionsNamespace = "https://wsp-lattice.io/user_authorization";
declare const userPermissionsType: t.PartialC<{
corgis: t.ArrayC<t.StringC>;
adminservice: t.ArrayC<t.StringC>;
}>;
declare const userProfileFromServer: t.TypeC<{
aud: t.StringC;
exp: t.NumberC;
"https://wsp-lattice.io/": t.TypeC<{
team: t.StringC;
}>;
"https://wsp-lattice.io/user_authorization": t.TypeC<{
permissions: t.PartialC<{
corgis: t.ArrayC<t.StringC>;
adminservice: t.ArrayC<t.StringC>;
}>;
}>;
iat: t.NumberC;
iss: t.StringC;
name: t.StringC;
nickname: t.StringC;
nonce: t.StringC;
picture: t.StringC;
sub: t.StringC;
updated_at: t.StringC;
}>;
declare type userPermissions = t.TypeOf<typeof userPermissionsType>;
export declare type UserProfile = Pick<t.TypeOf<typeof userProfileFromServer>, 'name' | 'nickname' | 'picture' | 'sub'> & {
team: string;
permissions: userPermissions;
};
export declare const AUTH_USER_PROFILE_ROUTE = "/user-profile";
export declare function getProfile(): Promise<UserProfile>;
export {};