mirror of https://github.com/msgbyte/tailchat
feat: add fim record provider create / search and sign token
parent
b64d037b60
commit
ed1d7cc1d6
@ -1,10 +1,45 @@
|
||||
export const userType = ['normalUser', 'pluginBot', 'openapiBot'] as const;
|
||||
export type UserType = (typeof userType)[number];
|
||||
|
||||
export interface UserBaseInfo {
|
||||
_id: string;
|
||||
/**
|
||||
* Username cannot modify
|
||||
*
|
||||
* There must be one with email
|
||||
*/
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* E-mail cannot be modified
|
||||
* required
|
||||
*/
|
||||
email: string;
|
||||
/**
|
||||
* display name that can be modified
|
||||
*/
|
||||
nickname: string;
|
||||
/**
|
||||
* Identifier, together with username constitutes a globally unique username
|
||||
* use for search
|
||||
* <username>#<discriminator>
|
||||
*/
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
/**
|
||||
* Is it a temporary user
|
||||
* @default false
|
||||
*/
|
||||
temporary: boolean;
|
||||
type: UserType;
|
||||
emailVerified: boolean;
|
||||
extra?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface UserInfoWithPassword extends UserBaseInfo {
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface UserInfoWithToken extends UserBaseInfo {
|
||||
token: string;
|
||||
}
|
||||
|
@ -1,47 +1,9 @@
|
||||
export const userType = ['normalUser', 'pluginBot', 'openapiBot'] as const;
|
||||
export type UserType = (typeof userType)[number];
|
||||
|
||||
export interface UserStruct {
|
||||
_id: string;
|
||||
|
||||
/**
|
||||
* 用户名 不可被修改
|
||||
* 与email必有一个
|
||||
*/
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* 邮箱 不可被修改
|
||||
* 必填
|
||||
*/
|
||||
email: string;
|
||||
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* 可以被修改的显示名
|
||||
*/
|
||||
nickname: string;
|
||||
|
||||
/**
|
||||
* 识别器, 跟username构成全局唯一的用户名
|
||||
* 用于搜索
|
||||
* <username>#<discriminator>
|
||||
*/
|
||||
discriminator: string;
|
||||
|
||||
/**
|
||||
* 是否为临时用户
|
||||
* @default false
|
||||
*/
|
||||
temporary: boolean;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
avatar?: string;
|
||||
|
||||
type: UserType;
|
||||
|
||||
emailVerified: boolean;
|
||||
}
|
||||
import type { UserBaseInfo, UserInfoWithToken, UserType } from 'tailchat-types';
|
||||
import { userType } from 'tailchat-types';
|
||||
|
||||
export {
|
||||
userType,
|
||||
UserType,
|
||||
UserBaseInfo as UserStruct,
|
||||
UserInfoWithToken as UserStructWithToken,
|
||||
};
|
||||
|
Loading…
Reference in New Issue