import { NgZone } from "@angular/core"; import { Subject } from "rxjs"; import { Router } from "@angular/router"; import { Location } from "@angular/common"; import { TranslateService } from "@ngx-translate/core"; import { LevelStatus, Mission, Organisation, Profile, ProfileEntity, RoleStatus, SpModule } from "../types.service"; import { ProfileService } from "./models/profile.service"; import { MissionService } from "./models/mission.service"; import { PropertyService } from "./models/property.service"; import * as i0 from "@angular/core"; interface CreateUser { email: string; phone?: string; lastName: string; firstName: string; password?: string; } /** * UserService handles user's lifecycle, from creation to deletion */ export declare class BaseUserService { private profileService; private missionService; private propertyService; private router; private location; private ngZone; private translate; isChanged: Subject; updating: boolean; managers: RoleStatus[]; currentMissions: Mission[]; lastExpiredMission: Mission; nextMissionToStart: Mission; cu: ProfileEntity; spModule: SpModule; constructor(profileService: ProfileService, missionService: MissionService, propertyService: PropertyService, router: Router, location: Location, ngZone: NgZone, translate: TranslateService, spModuleInjected: SpModule); /** * Checks if AWS user is connected and assigng it to current user (this.cu) **/ checkConnectedAWSUser(): Promise; /** * createUser spawns a new User, along with: * - a proper AWSCognito signup * - a Profile entry holding the AWSCognito ID * - a Mission entry holding the Organisation ID * * @see 174 * @see https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js#sign-up * @todo wonder if we can mash together Profile, Mission and User entries * @param u User to be created */ createUserAWSandProfile(u: { email: string; phone: string; lastName: string; firstName: string; password?: string; }, prevalidated?: boolean): Promise; /** * - Creates AWS user in Cognito for Hotel User Pool Schema (only email is required) * - Creates Profile in DynamoDB * * @param u User to be created */ createHotelUserAWSandProfile(user: { email: string; lastName: string; firstName: string; }): Promise; createProfile(awsUserID: string, u: CreateUser): Promise; currentOrganisation(spaceID?: string): Organisation; current(user: any, fastConnect?: boolean): Promise; userFromAWSID(userId: string): Promise; userFromUserID(userID: string): Promise; currentMission(spaceID: string): Mission; isManager(spaceID: string): boolean; isService(spaceID: string): boolean; isAdmin(spaceID: string): boolean; isSmarterPlan(): boolean; isSPAdmin(): boolean; getMissionForSpace(spaceID: string): Mission; hasManagerRoleInAnyMission(): boolean; hasServiceRoleInAnyMission(): boolean; hasAdminRoleInAnyMission(): boolean; createOrUpdateMissionForOrgWithProperty(missionInput: Mission, orgID: string, create?: boolean): Promise; softDeleteUser(userID: string): Promise; /** * Checks if the Profile (by id) can be removed completely from the DB (no missions in the DB) * @param profileID * @returns boolean */ canHardDeleteUser(profileID: string): Promise; hardDeleteUser(userID: string): Promise; getManagerMissions(): Mission[]; getAvalableLevelsForCurrentUser(): LevelStatus[]; getAvailableRolesForCurrentUser(): RoleStatus[]; /** Test if the user have the role given in parameter : "roleStatus" */ isRole(roleStatus: RoleStatus): boolean; isGuide(spaceID?: string): boolean; isMuseumVisitor(spaceID?: string): boolean; isOccupant(): boolean; isVisitor(spaceID?: string): boolean; isMuseumUser(spaceID?: string): boolean; hasOnlyMuseumRole(): boolean; profileForMail(mail: string): Promise; currentOrderedOrgList(): Organisation[]; userHasAccessToAllZonesInSpace(spaceID: string): boolean; logoutCurrentAndSignOutAuth(): Promise; logoutCurrentWihtoutAuth(): Promise; checkAccessToken(jwtToken: string): Promise; clearUserToken(id: any): Promise; updateCurrentUser(profile: Profile): void; getSpModule(): SpModule; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export {};