{"version":3,"file":"user.cjs","sources":["../../src/interfaces/user.ts"],"sourcesContent":["import type { IAttachment } from './attachment';\nimport type { Ref } from './common';\nimport type { HasObjectId } from './has-object-id';\nimport type { Lang } from './lang';\n\nexport type IUser = {\n  name: string;\n  username: string;\n  email: string;\n  password: string;\n  image?: string; // for backward conpatibility\n  imageAttachment?: Ref<IAttachment>;\n  imageUrlCached: string;\n  isGravatarEnabled: boolean;\n  admin: boolean;\n  readOnly: boolean;\n  apiToken?: string;\n  isEmailPublished: boolean;\n  isInvitationEmailSended: boolean;\n  lang: Lang;\n  slackMemberId?: string;\n  createdAt: Date;\n  lastLoginAt?: Date;\n  contributionsMigratedAt?: Date;\n  introduction: string;\n  status: IUserStatus;\n};\n\nexport type IUserGroupRelation = {\n  relatedGroup: Ref<IUserGroup>;\n  relatedUser: Ref<IUser>;\n  createdAt: Date;\n};\n\nexport type IUserGroup = {\n  name: string;\n  createdAt: Date;\n  description: string;\n  parent: Ref<IUserGroup> | null;\n};\n\nexport const USER_STATUS = {\n  REGISTERED: 1,\n  ACTIVE: 2,\n  SUSPENDED: 3,\n  DELETED: 4,\n  INVITED: 5,\n} as const;\nexport type IUserStatus = (typeof USER_STATUS)[keyof typeof USER_STATUS];\n\nexport type IUserHasId = IUser & HasObjectId;\nexport type IUserGroupHasId = IUserGroup & HasObjectId;\nexport type IUserGroupRelationHasId = IUserGroupRelation & HasObjectId;\n\nexport type IAdminExternalAccount<P> = {\n  _id: string;\n  providerType: P;\n  accountId: string;\n  user: IUser;\n  createdAt: Date;\n};\n"],"names":["USER_STATUS"],"mappings":"gFAyCO,MAAMA,EAAc,CACzB,WAAY,EACZ,OAAQ,EACR,UAAW,EACX,QAAS,EACT,QAAS,CACX"}