UNPKG

1.87 kBTypeScriptView Raw
1import * as t from 'io-ts';
2import { Context } from '..';
3import { DatastoreProvider } from '../datastore/datastore.provider';
4import { Repository } from '../datastore/repository';
5import { OneOrMany } from '../util/types';
6declare const passwordReset: t.TypeC<{
7 id: t.StringC;
8 accountId: t.StringC;
9 createdAt: t.Type<Date, Date, unknown>;
10}>;
11export declare type PasswordReset = t.TypeOf<typeof passwordReset>;
12export declare class PasswordResetRepository extends Repository<PasswordReset> {
13 constructor(datastoreProvider: DatastoreProvider);
14}
15declare const userInvite: t.TypeC<{
16 id: t.StringC;
17 email: t.StringC;
18 createdAt: t.Type<Date, Date, unknown>;
19 userId: t.StringC;
20 roles: t.ArrayC<t.StringC>;
21}>;
22export declare type UserInvite = t.TypeOf<typeof userInvite>;
23export declare class UserInviteRepository extends Repository<UserInvite> {
24 constructor(datastoreProvider: DatastoreProvider);
25}
26declare const externalAuthTypeEnum: t.UnionC<[t.LiteralC<"google">, t.LiteralC<"saml">, t.LiteralC<"auth0">, t.LiteralC<"oidc">]>;
27declare const loginCredentials: t.Type<{
28 id: string;
29 userId: string;
30 password: string;
31 type: "password";
32} | {
33 id: string;
34 userId: string;
35 type: "google" | "saml" | "auth0" | "oidc";
36}, {
37 id: string;
38 userId: string;
39 password: string;
40 type: "password";
41} | {
42 id: string;
43 userId: string;
44 type: "google" | "saml" | "auth0" | "oidc";
45}, unknown>;
46export declare type LoginCredentials = t.TypeOf<typeof loginCredentials>;
47export declare type ExternalAuthType = t.TypeOf<typeof externalAuthTypeEnum>;
48export declare class CredentialRepository extends Repository<LoginCredentials> {
49 constructor(datastore: DatastoreProvider);
50 protected beforePersist(context: Context, entities: OneOrMany<LoginCredentials>): OneOrMany<LoginCredentials>;
51}
52export {};