-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add fim record provider create / search and sign token
- Loading branch information
1 parent
b64d037
commit ed1d7cc
Showing
9 changed files
with
229 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.