import { Schema } from "mongoose"; import { EnumMap,IJson,IDocument,IObject,IInstance,IModel,IAction,IActionTypes,ISettings,MiscInfo } from "@onebro/oba-common"; export enum SwiftMsgrUserProfileStatuses { N = "New", S = "Saved", Y = "Sent", Z = "Seen/Read", A = "Accepted", D = "Declined", R = "Revised", E = "Expired", C = "Cancelled",} export type SwiftMsgrUserProfileStatus = keyof typeof SwiftMsgrUserProfileStatuses; export enum SwiftMsgrRoles { G = "GUEST", U = "USER", A = "ADMIN", S = "SUPER", SA = "SYSADMIN"} export type SwiftMsgrRole = keyof typeof SwiftMsgrRoles; export type SwiftMsgrExperienceLevel = "novice"|"beginner"|"intermediate"|"advanced"|"expert"; export type SwiftMsgrUserProfileConfig = { username:string; role:SwiftMsgrRole; settings:ISettings<"location"|"cookies">; img?:string;}; export type SwiftMsgrUserProfileType = IObject & SwiftMsgrUserProfileConfig & { bio:string; motto:string; socials?:MiscInfo; stats?:MiscInfo; expYrs?:number; expLvl?:SwiftMsgrExperienceLevel; rating?:number; followers?:SwiftMsgrUserProfile[]; following?:SwiftMsgrUserProfile[];}; export interface SwiftMsgrUserProfileDocument extends IDocument,SwiftMsgrUserProfileType {lang:string;} export interface SwiftMsgrUserProfile extends IInstance,SwiftMsgrUserProfileDocument { following:SwiftMsgrUserProfile[]; followers:SwiftMsgrUserProfile[]; preview():SwiftMsgrUserProfilePreview; follow(o:any):Promise; unfollow(o:any):Promise; rate(o:any):Promise; invite(o:any):Promise; respond(o:any):Promise;} export interface SwiftMsgrUserProfileModel extends IModel {} export type SwiftMsgrUSerProfilePublicKeys = "username"|"bio"|"motto"|"expYrs"|"expLvl"|"rating"|"settings"|"img"|"socials"|"lang"; export type SwiftMsgrUSerProfilePublicData = Pick; export type SwiftMsgrUserProfilePreview = Pick & {role:SwiftMsgrRoles;}; export type SwiftMsgrUserProfileJson = IJson & SwiftMsgrUSerProfilePublicData & { role:SwiftMsgrRoles; memberSince:Date; followers:SwiftMsgrUserProfilePreview[]; following:SwiftMsgrUserProfilePreview[];}; export type SwiftMsgrUserProfileModelMap = {SwiftMsgrUserProfile:SwiftMsgrUserProfileModel;}; export type SwiftMsgrUserProfileInstanceMap = {profile:SwiftMsgrUserProfile;}; export type SwiftMsgrUserProfileSchemaMap = {profile:Schema;}; export type SwiftMsgrUserProfileActionTypes = IActionTypes|"fetchByUsername$"; export type SwiftMsgrUserProfileActions = EnumMap; export type SwiftMsgrUserProfileUpdateFollowersOrFollowing = Partial<{ addFollowers?:string[]; removeFollowers?:string[]; addFollowing?:string[]; removeFollowing?:string[];}>;