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 {
|
export interface UserBaseInfo {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
/**
|
||||||
|
* Username cannot modify
|
||||||
|
*
|
||||||
|
* There must be one with email
|
||||||
|
*/
|
||||||
|
username?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* E-mail cannot be modified
|
||||||
|
* required
|
||||||
|
*/
|
||||||
email: string;
|
email: string;
|
||||||
|
/**
|
||||||
|
* display name that can be modified
|
||||||
|
*/
|
||||||
nickname: string;
|
nickname: string;
|
||||||
|
/**
|
||||||
|
* Identifier, together with username constitutes a globally unique username
|
||||||
|
* use for search
|
||||||
|
* <username>#<discriminator>
|
||||||
|
*/
|
||||||
discriminator: string;
|
discriminator: string;
|
||||||
avatar: string | null;
|
avatar: string | null;
|
||||||
|
/**
|
||||||
|
* Is it a temporary user
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
temporary: boolean;
|
temporary: boolean;
|
||||||
|
type: UserType;
|
||||||
emailVerified: boolean;
|
emailVerified: boolean;
|
||||||
extra?: Record<string, unknown>;
|
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;
|
import type { UserBaseInfo, UserInfoWithToken, UserType } from 'tailchat-types';
|
||||||
export type UserType = (typeof userType)[number];
|
import { userType } from 'tailchat-types';
|
||||||
|
|
||||||
export interface UserStruct {
|
export {
|
||||||
_id: string;
|
userType,
|
||||||
|
UserType,
|
||||||
/**
|
UserBaseInfo as UserStruct,
|
||||||
* 用户名 不可被修改
|
UserInfoWithToken as UserStructWithToken,
|
||||||
* 与email必有一个
|
};
|
||||||
*/
|
|
||||||
username?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮箱 不可被修改
|
|
||||||
* 必填
|
|
||||||
*/
|
|
||||||
email: string;
|
|
||||||
|
|
||||||
password: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 可以被修改的显示名
|
|
||||||
*/
|
|
||||||
nickname: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 识别器, 跟username构成全局唯一的用户名
|
|
||||||
* 用于搜索
|
|
||||||
* <username>#<discriminator>
|
|
||||||
*/
|
|
||||||
discriminator: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否为临时用户
|
|
||||||
* @default false
|
|
||||||
*/
|
|
||||||
temporary: boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 头像
|
|
||||||
*/
|
|
||||||
avatar?: string;
|
|
||||||
|
|
||||||
type: UserType;
|
|
||||||
|
|
||||||
emailVerified: boolean;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue