UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

24 lines (23 loc) 775 B
import type { SecretInfoType } from '../types'; /** * 获取凭据的通用代码 * @ignore * * @param {object} options 配置 * @param {string} options.apiKey apiKey * @param {string} options.loginName loginName * @param {Function} options.getPwdCode getPwdCode * @param {Function} options.encrypt encrypt * * @returns {Promise<{auth: string, apiToken: string, apiTime: string}>} 凭据信息 * @example * ```ts * const { auth, apiToken, apiTime } = await getCredential({ * apiKey: 'xxx', * loginName: 'novlan1', * getPwdCode: (apiKey, apiToken, apiTime) => '<sign>', * encrypt: (apiKey, loginName) => '<encrypted>', * }); * ``` */ export declare function getCredential({ apiKey, loginName, getPwdCode, encrypt, }: SecretInfoType): Promise<any>;