Skip to content

Commit

Permalink
feat: add fields to User interface (#69)
Browse files Browse the repository at this point in the history
* feat: add passwordType to User interface

* feat: add fields to User interface

* fix error
  • Loading branch information
tx2002 authored Oct 18, 2024
1 parent 9160772 commit 4445c7a
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface Permission {
description: string

users?: string[]
groups?: string[]
roles?: string[]
domains?: string[]

Expand Down
115 changes: 104 additions & 11 deletions src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,32 @@ import { Config } from './config'
import Request from './request'
import { CasdoorMfaProps } from './mfa'
import { Role } from './role'
import { Permission } from './permission'

export interface User {
owner: string
name: string
createdTime: string
updatedTime?: string
deletedTime?: string

id?: string
externalId?: string
type?: string
password?: string
passwordSalt?: string
passwordType?: string
displayName?: string
firstName?: string
lastName?: string
avatar?: string
avatarType?: string
permanentAvatar?: string
email?: string
emailVerified?: boolean
phone?: string
countryCode?: string
region?: string
location?: string
address?: string[]
affiliation?: string
Expand All @@ -47,24 +54,26 @@ export interface User {
homepage?: string
bio?: string
tag?: string
region?: string
language?: string
gender?: string
birthday?: string
education?: string
score?: number
karma?: number
ranking?: number
balance?: number
currency?: string
isDefaultAvatar?: boolean
isOnline?: boolean
isAdmin?: boolean
isGlobalAdmin?: boolean
isForbidden?: boolean
isDeleted?: boolean
signupApplication?: string
hash?: string
preHash?: string
roles?: Role[]
accessKey?: string
accessSecret?: string
accessToken?: string

createdIp?: string
lastSigninTime?: string
Expand All @@ -73,12 +82,12 @@ export interface User {
github?: string
google?: string
qq?: string
wechat?: string
weChat?: string
facebook?: string
dingtalk?: string
dingTalk?: string
weibo?: string
gitee?: string
linkedin?: string
linkedIn?: string
wecom?: string
lark?: string
gitlab?: string
Expand All @@ -88,24 +97,108 @@ export interface User {
casdoor?: string
infoflow?: string
apple?: string
azuread?: string
azureAD?: string
azureADB2c?: string
slack?: string
steam?: string
bilibili?: string
okta?: string
douyin?: string
line?: string
amazon?: string
auth0?: string
battleNet?: string
bitbucket?: string
box?: string
cloudFoundry?: string
dailymotion?: string
deezer?: string
digitalOcean?: string
discord?: string
dropbox?: string
eveOnline?: string
fitbit?: string
gitea?: string
heroku?: string
influxCloud?: string
instagram?: string
intercom?: string
kakao?: string
lastfm?: string
mailru?: string
meetup?: string
microsoftOnline?: string
naver?: string
nextcloud?: string
oneDrive?: string
oura?: string
patreon?: string
paypal?: string
salesForce?: string
shopify?: string
soundcloud?: string
spotify?: string
strava?: string
stripe?: string
tiktok?: string
tumblr?: string
twitch?: string
twitter?: string
typetalk?: string
uber?: string
vk?: string
wepay?: string
xero?: string
yahoo?: string
yammer?: string
yandex?: string
zoom?: string
metaMask?: string
web3Onboard?: string
custom?: string

ldap?: string
properties?: Record<string, string>

//mfa
preferredMfaType?: string
recoveryCodes?: string[]
totpSecret?: string
mfaPhoneEnabled?: boolean
mfaEmailEnabled?: boolean
multiFactorAuths?: CasdoorMfaProps[]
invitation?: string
invitationCode?: string
faceIds?: FaceId[]

ldap?: string
properties?: Record<string, string>

roles?: Role[]
permissions?: Permission[]
groups?: string[]

lastSigninWrongTime?: string
signinWrongTimes?: number

managedAccounts?: ManagedAccount[]
mfaAccounts?: MfaAccount[]
needUpdatePassword?: boolean
ipWhitelist?: string
}

export interface ManagedAccount {
application?: string
username?: string
password?: string
signinUrl?: string
}

export interface MfaAccount {
accountName: string
issuer: string
secretKey: string
}

export interface FaceId {
name: string
faceIdData: number[]
}

export interface SetPassword {
Expand Down

0 comments on commit 4445c7a

Please sign in to comment.