import { IRepoOptions } from "@codiac.io/codiac-common";
import { UpdatePartialWhereRequest, ListResult, BatchResult, SingleResult, PatchSpecForOne, PatchSpecForMany, IdSpecFor } from "@codiac.io/codiac-common/contracts";
import * as Contracts from '../codiac-api/contracts';
export interface IAuthClient {
    apiRootUrl?: string;
    setUserToken(token: string): void;
    authToken?: string;
    isExpired(token: string, throwOnError?: boolean): boolean;
    extractTokenExpiration(token: string): Date | undefined;
    extractRoles(token: string): string[] | undefined;
    Auth: IAuthOperations;
}
export interface IAuthOperations {
    RoleCreate(request: Contracts.AuthRole, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthRole>>;
    RoleCreateMany(request: Array<Contracts.AuthRole>, options?: IRepoOptions): Promise<BatchResult<Contracts.AuthRole>>;
    RoleDelete(request: IdSpecFor<Contracts.AuthRole>, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthRole>>;
    RoleDeleteWhere(request: Contracts.AuthRoleCriteria, options?: IRepoOptions): Promise<BatchResult<Contracts.AuthRole>>;
    RoleGet(request: IdSpecFor<Contracts.AuthRole>, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthRole>>;
    RoleList(request: Contracts.AuthRoleCriteria, options?: IRepoOptions): Promise<ListResult<Contracts.AuthRole>>;
    RolePatch(request: PatchSpecForOne<Contracts.AuthRole>, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthRole>>;
    RolePatchWhere(request: PatchSpecForMany<Contracts.AuthRole, Contracts.AuthRoleCriteria>, options?: IRepoOptions): Promise<BatchResult<Contracts.AuthRole>>;
    RoleUpdate(request: Contracts.AuthRole, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthRole>>;
    RoleUpdateMany(request: Array<Contracts.AuthRole>, options?: IRepoOptions): Promise<BatchResult<Contracts.AuthRole>>;
    RoleUpdatePartial(request: Partial<Contracts.AuthRole>, options?: IRepoOptions): Promise<SingleResult<Partial<Contracts.AuthRole>>>;
    RoleUpdatePartialMany(request: Array<Contracts.AuthRole>, options?: IRepoOptions): Promise<BatchResult<Partial<Contracts.AuthRole>>>;
    RoleUpdatePartialWhere(request: UpdatePartialWhereRequest<Contracts.AuthRole, Contracts.AuthRoleCriteria>, options?: IRepoOptions): Promise<BatchResult<Contracts.AuthRole>>;
    RoleUpsert(request: Contracts.AuthRole, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthRole>>;
    RoleUpsertMany(request: Array<Contracts.AuthRole>, options?: IRepoOptions): Promise<BatchResult<Contracts.AuthRole>>;
    CodiacUserGet(request: IdSpecFor<Contracts.CodiacUser>, options?: IRepoOptions): Promise<SingleResult<Contracts.CodiacUser>>;
    CodiacUserList(request: Contracts.CodiacUserCriteria, options?: IRepoOptions): Promise<ListResult<Contracts.CodiacUser>>;
    DefaultChildAclCreate(request: Contracts.DefaultChildAcl, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclCreateMany(request: Array<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<BatchResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclDelete(request: IdSpecFor<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclDeleteWhere(request: Contracts.DefaultChildAclCriteria, options?: IRepoOptions): Promise<BatchResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclGet(request: IdSpecFor<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclList(request: Contracts.DefaultChildAclCriteria, options?: IRepoOptions): Promise<ListResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclPatch(request: PatchSpecForOne<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclPatchWhere(request: PatchSpecForMany<Contracts.DefaultChildAcl, Contracts.DefaultChildAclCriteria>, options?: IRepoOptions): Promise<BatchResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclUpdate(request: Contracts.DefaultChildAcl, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclUpdateMany(request: Array<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<BatchResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclUpdatePartial(request: Partial<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<SingleResult<Partial<Contracts.DefaultChildAcl>>>;
    DefaultChildAclUpdatePartialMany(request: Array<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<BatchResult<Partial<Contracts.DefaultChildAcl>>>;
    DefaultChildAclUpdatePartialWhere(request: UpdatePartialWhereRequest<Contracts.DefaultChildAcl, Contracts.DefaultChildAclCriteria>, options?: IRepoOptions): Promise<BatchResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclUpsert(request: Contracts.DefaultChildAcl, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    DefaultChildAclUpsertMany(request: Array<Contracts.DefaultChildAcl>, options?: IRepoOptions): Promise<BatchResult<Contracts.DefaultChildAcl>>;
    EntityAclCreate(request: Contracts.EntityAcl, options?: IRepoOptions): Promise<SingleResult<Contracts.EntityAcl>>;
    EntityAclCreateMany(request: Array<Contracts.EntityAcl>, options?: IRepoOptions): Promise<BatchResult<Contracts.EntityAcl>>;
    EntityAclDelete(request: IdSpecFor<Contracts.EntityAcl>, options?: IRepoOptions): Promise<SingleResult<Contracts.EntityAcl>>;
    EntityAclDeleteWhere(request: Contracts.EntityAclCriteria, options?: IRepoOptions): Promise<BatchResult<Contracts.EntityAcl>>;
    EntityAclGet(request: IdSpecFor<Contracts.EntityAcl>, options?: IRepoOptions): Promise<SingleResult<Contracts.EntityAcl>>;
    EntityAclList(request: Contracts.EntityAclCriteria, options?: IRepoOptions): Promise<ListResult<Contracts.EntityAcl>>;
    EntityAclPatch(request: PatchSpecForOne<Contracts.EntityAcl>, options?: IRepoOptions): Promise<SingleResult<Contracts.EntityAcl>>;
    EntityAclPatchWhere(request: PatchSpecForMany<Contracts.EntityAcl, Contracts.EntityAclCriteria>, options?: IRepoOptions): Promise<BatchResult<Contracts.EntityAcl>>;
    EntityAclUpdate(request: Contracts.EntityAcl, options?: IRepoOptions): Promise<SingleResult<Contracts.EntityAcl>>;
    EntityAclUpdateMany(request: Array<Contracts.EntityAcl>, options?: IRepoOptions): Promise<BatchResult<Contracts.EntityAcl>>;
    EntityAclUpdatePartial(request: Partial<Contracts.EntityAcl>, options?: IRepoOptions): Promise<SingleResult<Partial<Contracts.EntityAcl>>>;
    EntityAclUpdatePartialMany(request: Array<Contracts.EntityAcl>, options?: IRepoOptions): Promise<BatchResult<Partial<Contracts.EntityAcl>>>;
    EntityAclUpdatePartialWhere(request: UpdatePartialWhereRequest<Contracts.EntityAcl, Contracts.EntityAclCriteria>, options?: IRepoOptions): Promise<BatchResult<Contracts.EntityAcl>>;
    EntityAclUpsert(request: Contracts.EntityAcl, options?: IRepoOptions): Promise<SingleResult<Contracts.EntityAcl>>;
    EntityAclUpsertMany(request: Array<Contracts.EntityAcl>, options?: IRepoOptions): Promise<BatchResult<Contracts.EntityAcl>>;
    AddTenantUser(request: Contracts.AddTenantUserRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    ChangePassword(request: Contracts.ChangePasswordRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    ExpelUser(request: IdSpecFor<Contracts.TenantUser>, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    Login(request: Contracts.AuthenticationRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    MyTenant(request: Contracts.MyTenantRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthTenant>>;
    PatchUser(request: Contracts.CodiacUserPatch, options?: IRepoOptions): Promise<SingleResult<Contracts.CodiacUser>>;
    ResetPassword(request: Contracts.ResetPasswordRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    RoleAssignment(request: Contracts.RoleAssignmentRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    SetDefaultChildPermission(request: Contracts.DefaultChildPermissionRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.DefaultChildAcl>>;
    SetEntityPermission(request: Contracts.EntityPermissionRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.SecurableEntity>>;
    SetTenantStatus(request: Contracts.TenantStatusChange, options?: IRepoOptions): Promise<SingleResult<Contracts.SubscriptionStatus>>;
    SubscriptionCancel(request: Contracts.TenantSubscriptionCancel, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthTenant>>;
    SubscriptionUpdate(request: Contracts.TenantSubscriptionUpdate, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthTenant>>;
    SwitchTenant(request: Contracts.SwitchTenantRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    TenantRegistration(request: Contracts.TenantRegistrationRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.AuthTenant>>;
    TokenRefresh(request: Contracts.RefreshTokenRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    WhoAmI(request: Contracts.WhoAmIRequest, options?: IRepoOptions): Promise<SingleResult<Contracts.TenantUser>>;
    /** Determines whether the given token is expired.
     * @param throwOnError throws any encountered errors, including token parsing errors.
     */
    isExpired(token: string, throwOnError: boolean): boolean;
    extractTokenExpiration(token: string): Date | undefined;
}
