本文整理匯總了TypeScript中@poetapp/frost-client.Frost類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Frost類的具體用法?TypeScript Frost怎麽用?TypeScript Frost使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Frost類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: GetProfileFrost
async function GetProfileFrost(
token: string,
password: string
): Promise<{ readonly createdAt: number; readonly verified: boolean }> {
const frost = new Frost({ host: '/api' })
return await frost.getProfile(token)
}
示例2: signInFrost
async function signInFrost(data: {
readonly email: string
readonly password: string
}): Promise<{ readonly token: string }> {
const { email, password } = data
const frost = new Frost({ host: '/api' })
return await frost.login(email, password)
}
示例3: CreateApiTokenFrost
async function CreateApiTokenFrost(apiToken: string): Promise<{ readonly apiToken: string }> {
const frost = new Frost({ host: '/api' })
return await frost.createApiToken(apiToken)
}
示例4: GetApiTokensFrost
async function GetApiTokensFrost(email: string): Promise<string> {
const frost = new Frost({ host: '/api' })
return await frost.sendEmailForgotPassword(email)
}
示例5: ChangePasswordTokenFrost
async function ChangePasswordTokenFrost(token: string, password: string): Promise<{ readonly token: string }> {
const frost = new Frost({ host: '/api' })
return await frost.changePasswordWithToken(token, password)
}
示例6: DeleteApiTokenFrost
async function DeleteApiTokenFrost(token: string, tokenId: string): Promise<string> {
const frost = new Frost({ host: '/api' })
return await frost.removeApiToken(token, tokenId)
}
示例7: SendEmailVerifiedAccountFrost
async function SendEmailVerifiedAccountFrost(data: { readonly token: string }): Promise<string> {
const { token } = data
const frost = new Frost({ host: '/api' })
return await frost.sendEmailVerifyAccount(token)
}
示例8: GetApiTokensFrost
async function GetApiTokensFrost(token: string, password: string): Promise<{ readonly token: string }> {
const frost = new Frost({ host: '/api' })
return await frost.verifyAccount(token)
}
示例9: GetApiTokensFrost
async function GetApiTokensFrost(apiToken: string): Promise<{ readonly apiTokens: ReadonlyArray<string> }> {
const frost = new Frost({ host: '/api' })
return await frost.getApiTokens(apiToken)
}