@intlsdk/account-api
Advanced tools
Comparing version 1.17.3 to 1.18.0
@@ -36,11 +36,5 @@ import { ClientOptions } from '../type'; | ||
} | ||
/** | ||
* 账号的初始化配置 | ||
*/ | ||
declare const defaultConfig: Config; | ||
export default defaultConfig; | ||
export type SDKConfig = Config & ClientOptions; | ||
/** | ||
* 根据 scene 获取默认的 sigkey | ||
*/ | ||
export declare function getDefaultSigkey(scene: string): string; |
@@ -5,2 +5,6 @@ import Aegis from 'aegis-web-mini-sdk'; | ||
import InternalApi from './model/internal-api'; | ||
import AccountApi from './model/api-lipass'; | ||
import ThirdChannelApi from './model/api-third-channel'; | ||
import BindApi from './model/api-bind'; | ||
import MapApi from './model/api-map'; | ||
import { getUbid } from './model/intl-account'; | ||
@@ -27,4 +31,5 @@ import { ClientOptions } from './type/client'; | ||
readonly kakaov3: 35; | ||
readonly xbox: 20; | ||
readonly wechat: 1; | ||
readonly xbox: 20; | ||
readonly qq: 2; | ||
}; | ||
@@ -36,24 +41,24 @@ }; | ||
options: ClientOptions; | ||
signIn: ApiModel['signIn']; | ||
verifyCodeSignIn: ApiModel['verifyCodeSignIn']; | ||
requestVerifyCode: ApiModel['requestVerifyCode']; | ||
queryCodeStatus: ApiModel['getCodeStatus']; | ||
logout: ApiModel['logout']; | ||
register: ApiModel['register']; | ||
verifyCodeRegister: ApiModel['verifyCodeRegister']; | ||
queryRegisterStatus: ApiModel['queryRegisterStatus']; | ||
queryUserNameStatus: ApiModel['queryUserNameStatus']; | ||
signIn: AccountApi['signIn']; | ||
verifyCodeSignIn: AccountApi['verifyCodeSignIn']; | ||
requestVerifyCode: AccountApi['requestVerifyCode']; | ||
queryCodeStatus: AccountApi['getCodeStatus']; | ||
logout: AccountApi['logout']; | ||
register: AccountApi['register']; | ||
verifyCodeRegister: AccountApi['verifyCodeRegister']; | ||
queryRegisterStatus: AccountApi['queryRegisterStatus']; | ||
queryUserNameStatus: AccountApi['queryUserNameStatus']; | ||
intlSignIn: ApiModel['intlSignIn']; | ||
refreshCAccTokenByOpenID: ApiModel['refreshCAccTokenByOpenID']; | ||
queryUidByOpenID: ApiModel['queryUidByOpenID']; | ||
queryUserInfo: ApiModel['queryUserInfo']; | ||
modifyProfile: ApiModel['modifyProfile']; | ||
modifyAccountInfo: ApiModel['modifyAccountInfo']; | ||
resetPassword: ApiModel['resetPassword']; | ||
queryUserInfo: AccountApi['queryUserInfo']; | ||
modifyProfile: AccountApi['modifyProfile']; | ||
modifyAccountInfo: AccountApi['modifyAccountInfo']; | ||
resetPassword: AccountApi['resetPassword']; | ||
requestVerifyImage: ApiModel['requestVerifyImage']; | ||
queryAccountConfig: ApiModel['queryAccountConfig']; | ||
unlink: ApiModel['unlink']; | ||
setReceiveVideo: ApiModel['setReceiveVideo']; | ||
getProtocol: ApiModel['getProtocol']; | ||
setProtocol: ApiModel['setProtocol']; | ||
setReceiveVideo: AccountApi['setReceiveVideo']; | ||
getProtocol: AccountApi['getProtocol']; | ||
setProtocol: AccountApi['setProtocol']; | ||
queryBindListBySacc: InternalApi['queryBindListBySacc']; | ||
@@ -66,18 +71,19 @@ queryGameInfo: InternalApi['queryGameInfo']; | ||
decryptAES: ApiModel['decryptAES']; | ||
modifyUserAgreement: ApiModel['modifyUserAgreement']; | ||
thirdAuthorize: ApiModel['getThirdLoginInfo']; | ||
intlAuthorize: ApiModel['thirdChannelLogin']; | ||
msdkAuthorize: ApiModel['thirdChannelLoginToMsdk']; | ||
getThirdAccessToken: ApiModel['getThirdAccessToken']; | ||
login: ApiModel['login']; | ||
getRedirectResult: ApiModel['getRedirectResult']; | ||
share: ApiModel['openShareBox']; | ||
queryMapByCAccInfo: ApiModel['queryThirdMap']; | ||
queryMapByThirdInfo: ApiModel['queryAccountMap']; | ||
unmap: ApiModel['unmap']; | ||
map: ApiModel['map']; | ||
bind: ApiModel['bind']; | ||
unbind: ApiModel['unbind']; | ||
getBindChannelsByUid: ApiModel['getBindChannelsByUid']; | ||
getBindChannelsByOpenID: ApiModel['getBindChannelsByOpenID']; | ||
modifyUserAgreement: AccountApi['modifyUserAgreement']; | ||
thirdAuthorize: ThirdChannelApi['getThirdLoginInfo']; | ||
intlAuthorize: ThirdChannelApi['thirdChannelLogin']; | ||
msdkAuthorize: ThirdChannelApi['thirdChannelLoginToMsdk']; | ||
getThirdAccessToken: ThirdChannelApi['getThirdAccessToken']; | ||
login: ThirdChannelApi['login']; | ||
credentialFromRedirect: ThirdChannelApi['credentialFromRedirect']; | ||
signInWithRedirect: ThirdChannelApi['signInWithRedirect']; | ||
share: ThirdChannelApi['openShareBox']; | ||
queryMapByCAccInfo: MapApi['queryThirdMap']; | ||
queryMapByThirdInfo: MapApi['queryAccountMap']; | ||
unmap: MapApi['unmap']; | ||
map: MapApi['map']; | ||
bind: BindApi['bind']; | ||
unbind: BindApi['unbind']; | ||
getBindChannelsByUid: BindApi['getBindChannelsByUid']; | ||
getBindChannelsByOpenID: BindApi['getBindChannelsByOpenID']; | ||
subscribeEmail: ApiModel['subscribeEmail']; | ||
@@ -84,0 +90,0 @@ queryMyCountry: CommonApi['queryMyCountry']; |
import { RespMeta, IntlSignInResp, IntlRequestParams } from '../type/common.type'; | ||
import { ThirdChannelInfo } from '../type/third-common.type'; | ||
import { SignInParams, CACCSignInResp, VerifyCodeSignInParams, IntlSignInParams, QueryUserInfoParams, QueryUserInfoResp, ModifyProfileParams, ModifyProfileResp, QueryUserNameStatusParams, QueryUserNameStatusResp, ModifyUserAgreementParams, ModifyUserAgreementResp, QueryRegisterStatusResp, RegisterParams, RegisterResp, VerifyCodeRegisterParams, VerifyCodeRegisterResp, RequestVerifyCodeParams, RequestVerifyCodeResp, RequestVerifyImageResp, ResetPasswordParams, LogoutParams, ThirdAuthorizeParams, ThirdAuthorizeResp, IntlAuthorizeParams, QueryRegisterStatusParams, QueryCodeStatusParams, QueryCodeStatusResp, ModifyAccountInfoParams, ModifyAccountInfoResp, GetThirdAccessTokenParams, GetThirdAccessTokenResp, LoginParams, SubscribeEmailParams, LoginResp, intlLogoutParams, VerifyLoginParams, getRedirectResultParams, DecryptAESParams } from '../type'; | ||
import { GetProtocolParam, GetProtocolResp, SetProtocolParam, SetProtocolResp } from '../type/account'; | ||
import { IntlSignInParams, RequestVerifyImageResp, SubscribeEmailParams, intlLogoutParams, VerifyLoginParams, DecryptAESParams } from '../type'; | ||
import { SDKConfig } from '../config'; | ||
@@ -11,109 +9,6 @@ export declare const VERIFY_TYPE: { | ||
}; | ||
/** | ||
* 对外api类,和业务完全解耦。 | ||
*/ | ||
export default class { | ||
private config; | ||
private intl; | ||
private thirdPartyWinowCloseInterval; | ||
private thirdPartyUUID; | ||
constructor(config: SDKConfig); | ||
/** | ||
* 密码登录接口(密码校验) | ||
* @param {*} params | ||
* account string 【必填】登录的帐号 | ||
* account_type int 【必填】1email,2phone | ||
* phone_area_code string 【选填 】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* password string 【必填】 登录密码 ,格式(09a-zA-z_![]-+()) 3264个字节 MD5加密 | ||
* machine_check_type【选填:是否必填受管理端自建账号配置控制】 人机识别方式,1 为图片验证,2 为 google reCAPTCHA 方式 ,3 为腾讯人机识别。未传时默认走图片验证码 | ||
* png_verify_code【选填:machine_check_type=1必填】 图片验证码,通过获取图片验证接口进行获取 ,60s 有效,只能校验一次 | ||
* session_id 图形验证码session_id | ||
* google_response【选填:machine_check_type=2必填】 google reCAPTCHA 方式,response 入参,2 分钟有效,只能校验一次 | ||
* tencent_response【选填:machine_check_type=3必填】 tencent 人机识别返回 | ||
*/ | ||
signIn: (params: SignInParams) => Promise<CACCSignInResp>; | ||
/** | ||
* 验证码登录接口 | ||
* @param {*} params | ||
* account string 【必填】注册的帐号 | ||
* account_type int 【必填】1email,2phone | ||
* verify_code string 【必填】验证码,老协议适配可为int型 | ||
* phone_area_code string 【选填 】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* machine_check_type【选填:是否必填受管理端自建账号配置控制】 人机识别方式,1 为图片验证,2 为 google reCAPTCHA 方式 ,3 为腾讯人机识别。未传时默认走图片验证码 | ||
* png_verify_code【选填:machine_check_type=1必填】 图片验证码,通过获取图片验证接口进行获取 ,60s 有效,只能校验一次 | ||
* google_response【选填:machine_check_type=2必填】 google reCAPTCHA 方式,response 入参,2 分钟有效,只能校验一次 | ||
* tencent_response【选填:machine_check_type=3必填】 tencent 人机识别返回 | ||
*/ | ||
verifyCodeSignIn: (params: VerifyCodeSignInParams) => Promise<CACCSignInResp>; | ||
/** | ||
* 登出 | ||
* token string 【必填】自建帐号登录态信息 | ||
* uid string 【必填】用户id | ||
*/ | ||
logout: (params: LogoutParams) => Promise<RespMeta>; | ||
/** | ||
* 修改密码 | ||
* @param {*} params | ||
* verify_type int 【必填】验证方式,1:使用验证码,2:使用旧密码 | ||
* verify_code string 【当verify_type=1时必填】验证码 ,可为int型老协议适配 | ||
* account string 【必填】注册的帐号 | ||
* phone_area_code string 【选填 】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* account_type int 【必填】1email,2phone | ||
* password string 【必填】 新密码,格式8-20位A-Za-z0-9!@#$%^&*()+=\\-_/?<>,.:;| | ||
* old_password string 【当verify_type=2时必填】 旧密码格式(09a-zA-z_![]-+()) 32/64个字节-客户端MD5传输 | ||
*/ | ||
resetPassword: (params: ResetPasswordParams) => Promise<RespMeta>; | ||
/** | ||
* 修改个人信息 | ||
* @param {*参数对象} params | ||
* token string 【必填】自建帐号登录态信息 | ||
* uid string 【必填】用户id | ||
* user_name string 【选填】 用户名由小写字母开头、小写字母下划线及数字组成(a-z_09)616bytes,在后台开关关闭时, 可以不必填;(注册时非必填,故此设置非必填);不能重复 | ||
* nick_name string 【选填】 昵称,允许重复 | ||
* birthday string 【选填】 YYYY-MM-DD,不填为设置默认值"1970-01-01" | ||
* region string 【选填】 取值参考ISO_3166-1标准,3字节的数字字符 | ||
* user_lang_type string 【选填】 用户语言信息 | ||
* is_receive_email int 【选填】用户同意接收线下邮件选项,1为同意,其他为不同意 | ||
*/ | ||
modifyProfile: (params: ModifyProfileParams) => Promise<ModifyProfileResp>; | ||
/** | ||
* 修改账号信息:参考接口 修改账号信息接口 | ||
* @param {*} params | ||
* verify_type int 【必填】验证方式,1:使用验证码,2:使用旧密码 3: 使用当前自建账号登录态!! | ||
* verify_code string / int 【当verify_type=1时必填】验证码, 可为int型老协议适配 | ||
* password string 【当verify_type=2时必填】 密码,格式(09a-zA-z_![]-+()) 32 - 64个字节-客户端MD5传输 | ||
* account string 【当verify_type!=3时必填】当前存在的账号 | ||
* phone_area_code string 【account_type = 2必填】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* account_type int 【当verify_type!=3时必填】1 email, 2 phone | ||
* token string 【当verify_type=3时必填】自建帐号登录态信息 | ||
* uid string 【当verify_type=3时必填】用户id | ||
* | ||
* verify_code_modify string 【必填】被修改账号的验证码,修改账号验证码(code_type=3) | ||
* account_modify string 【必填】要修改的帐号 | ||
* account_type_modify int 【必填】要修改的账号,类似1email,2phone | ||
* phone_area_code_modify string 【ccount_type_modify = 2必填】 要修改的账号是手机时为必填参数, 这里填写的是手机区号字段 | ||
*/ | ||
modifyAccountInfo: (params: ModifyAccountInfoParams) => Promise<ModifyAccountInfoResp>; | ||
/** | ||
* 获取用户信息(和queryUserInfoBy返回的结果相同,只不过是多了terms_of_service/privacy_policy信息) | ||
* @param {*参数对象} params | ||
* uid string 【必填】用户id | ||
* token string 【必填】自建帐号登录态信息 | ||
*/ | ||
queryUserInfo: (params: QueryUserInfoParams) => Promise<QueryUserInfoResp>; | ||
/** | ||
* LonelyFish新增需求,官网渠道账号新增字段,存储玩家不接收Idomoo videos的选项 | ||
* @param {*参数对象} params | ||
* uid string 【必填】用户id | ||
* token string 【必填】自建帐号登录态信息 | ||
* is_receive_video int 【必填】存储玩家不接收Idomoo videos的选项: -1 未设置, 0表示不接收, 1表示接收 | ||
* @returns { | ||
* ret: Response status, 0 stands for success, others stands for failure | ||
* msg: string Response message | ||
* } | ||
*/ | ||
setReceiveVideo: (params: any) => Promise<any>; | ||
/** | ||
* 获取验证图片的内容 | ||
*/ | ||
getVerifyPngImageData: () => Promise<{ | ||
@@ -123,344 +18,13 @@ sessionid: any; | ||
}>; | ||
/** | ||
* 生成图片验证码图片url | ||
*/ | ||
requestVerifyImage: () => Promise<RequestVerifyImageResp>; | ||
/** | ||
* 发送邮件校验码 | ||
* @param {*参数对象} params | ||
* account string 【必填】注册的帐号 | ||
* account_type int 【必填】1email(5到50个字节),2phone | ||
* code_type int 【必填】生成的验证码类型,0注册,1修改密码,2登录并注册,3修改主体注册账号 | ||
* machine_check_type int 【os=3时必填】人机识别方式,1为图片验证,2为google reCAPTCHA方式,未传时默认走图片验证码 3.腾讯防水墙 | ||
* google_response string 【os=3且人机识别方式为2时必填】google reCAPTCHA方式,response入参,2分钟有效,只能校验一次 | ||
* tencent_response string 【os=3且人机识别方式为3时必填】tencent防水墙方式 | ||
* phone_area_code string 【选填】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* png_verify_code string 【os=3且人机识别方式为1时必填】图片验证码,通过获取图片验证接口进行获取 ,60s有效,只能校验一次 | ||
* session_id string 【os=3且人机识别方式为1时必填】图片验证码的sessionid,在获取图片验证码的头里面会返回 | ||
*/ | ||
requestVerifyCode: (params: RequestVerifyCodeParams) => Promise<RequestVerifyCodeResp>; | ||
/** | ||
* 修改用户协议版本 | ||
* @param {*} params | ||
* uid 用户uid | ||
* token 自建账号token | ||
* privacy_policy 隐私政策版本号 | ||
* terms_of_service 服务期限版本号 | ||
* @returns | ||
*/ | ||
modifyUserAgreement: (params: ModifyUserAgreementParams) => Promise<ModifyUserAgreementResp>; | ||
/** | ||
* 用户账号是否注册查询接口 | ||
* @param {*参数对象} params | ||
* account string 【必填】注册的帐号 | ||
* account_type int 【必填】1email,2phone | ||
* phone_area_code string 【选填 】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
*/ | ||
queryRegisterStatus: (params: QueryRegisterStatusParams) => Promise<QueryRegisterStatusResp>; | ||
/** | ||
* 用户名username已被注册(重复)查询接口 | ||
* @param {*参数对象} params | ||
* username string 【必填】用户id | ||
*/ | ||
queryUserNameStatus: (params: QueryUserNameStatusParams) => Promise<QueryUserNameStatusResp>; | ||
/** | ||
* 账号密码注册 | ||
* @param {*} params 参数 | ||
* account_type int 【必填】1email,2sms | ||
* is_receive_email int 【选填】用户同意接收线下邮件选项,1为同意,其他为不同意 | ||
* verify_code string 【必填】验证码,老协议适配可为int型 | ||
* account string 【必填】注册的帐号 | ||
* phone_area_code string 【选填 】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* password string 【必填】 登录密码,格式(09a-zA-z_![]-+()) 3264个字节-客户端MD5传输 | ||
* user_name string 【选填】 不可重复,用户名由小写字母开头、小写字母下划线及数字组成(a-z_09)616bytes,在后台开关关闭时, 可以不必填 | ||
* nick_name string 【选填】昵称,可重复 | ||
* birthday string 【选填】 YYYY-MM-DD,不填为设置默认值"1970-01-01" | ||
* region string 【选填】 取值参考ISO_3166-1标准,3字节的数字字符 | ||
* machine_check_type【选填:是否必填受管理端自建账号配置控制】 人机识别方式,1 为图片验证,2 为 google reCAPTCHA 方式 ,3 为腾讯人机识别。未传时默认走图片验证码 | ||
* png_verify_code【选填:machine_check_type=1必填】 图片验证码,通过获取图片验证接口进行获取 ,60s 有效,只能校验一次 | ||
* google_response【选填:machine_check_type=2必填】 google reCAPTCHA 方式,response 入参,2 分钟有效,只能校验一次 | ||
* tencent_response【选填:machine_check_type=3必填】 tencent 人机识别返回 | ||
*/ | ||
register: (params: RegisterParams) => Promise<RegisterResp>; | ||
/** | ||
* 验证码注册接口 | ||
* @param {*} params 参数 | ||
* account_type int 【必填】1email,2sms | ||
* is_receive_email int 【选填】用户同意接收线下邮件选项,1为同意,其他为不同意 | ||
* verify_code string 【必填】验证码,老协议适配可为int型 (必须是code_type=2收到的验证码,否则注册不成功) | ||
* account string 【必填】注册的帐号 | ||
* phone_area_code string 【选填】 手机登录时为必填参数, 这里填写的是手机区号字段 | ||
* password string 【选填】 登录密码,格式(09a-zA-z_![]-+()) 3264个字节-客户端MD5传输 | ||
* user_name string 【选填】 不可重复,用户名由小写字母开头、小写字母下划线及数字组成(a-z_09)616bytes,在后台开关关闭时, 可以不必填 | ||
* nick_name string 【选填】昵称,可重复 | ||
* birthday string 【选填】 YYYY-MM-DD,不填为设置默认值"1970-01-01" | ||
* region string 【选填】 取值参考ISO_3166-1标准,3字节的数字字符 | ||
* machine_check_type【选填:是否必填受管理端自建账号配置控制】 人机识别方式,1 为图片验证,2 为 google reCAPTCHA 方式 ,3 为腾讯人机识别。未传时默认走图片验证码 | ||
* png_verify_code【选填:machine_check_type=1必填】 图片验证码,通过获取图片验证接口进行获取 ,60s 有效,只能校验一次 | ||
* google_response【选填:machine_check_type=2必填】 google reCAPTCHA 方式,response 入参,2 分钟有效,只能校验一次 | ||
* tencent_response【选填:machine_check_type=3必填】 tencent 人机识别返回 | ||
*/ | ||
verifyCodeRegister: (params: VerifyCodeRegisterParams) => Promise<VerifyCodeRegisterResp>; | ||
/** | ||
* 查询此openid上的map列表 | ||
* @param {* Object} params | ||
* token:自建账号token 【必填】 | ||
* openid:自建账号uid 【必填】 | ||
*/ | ||
queryThirdMap: (params?: any) => Promise<any>; | ||
/** | ||
* 查询映射到渠道的自建账号 | ||
* @param {* Object} params | ||
* third_type //steam ,facebook ,twitter ... | ||
* channel_info 渠道信息 | ||
* @returns | ||
*/ | ||
queryAccountMap: (params?: any) => Promise<any>; | ||
/** | ||
* 解除映射 | ||
* @param { Object} params | ||
* token:string 自建账号token 【必填】 | ||
* openid:string 自建账号openid 【必填】 | ||
* unmap_channelid:int 解除三方渠道id | ||
*/ | ||
unmap: (params?: any) => Promise<any>; | ||
/** | ||
* 建立自建账号和三方平台的映射关系 | ||
* @param {*} params | ||
* params: | ||
* ({ | ||
* third_type:'',//三方平台类型 | ||
* channel_info:{ | ||
* openid.ns:'', | ||
* openid.mode:'', | ||
* openid.op_endpoint:'', | ||
* openid.claimed_id:'', | ||
* openid.identity:'', | ||
* openid.return_to:'', | ||
* openid.response_nonce:'', | ||
* openid.assoc_handle:'', | ||
* openid.signed:'', | ||
* openid.sig:'' | ||
* }, | ||
* sacc_channel_info:{ | ||
* token:''//自建账号token, | ||
* openid:''//uid | ||
* } | ||
* })//目前仅支持steam,steam的channel_info暂时如此 | ||
*/ | ||
map: (params?: any) => Promise<any>; | ||
getThirdInfo(name: string): any; | ||
/** | ||
*三方渠道登录intl | ||
* @param param0 | ||
* @returns | ||
*/ | ||
thirdChannelLogin: <T extends keyof ThirdChannelInfo>({ third_type, channel_info, }: IntlAuthorizeParams<T>) => Promise<IntlSignInResp<T>>; | ||
/** | ||
* 三方渠道快速登录 intl | ||
* | ||
* 只支持 popup 模式,不支持 redirect 模式 | ||
* @param param0 | ||
* @returns | ||
*/ | ||
login: <T extends keyof ThirdChannelInfo>({ third_type, extra, }: LoginParams<T>) => Promise<LoginResp>; | ||
/** | ||
*三方渠道登录MSDK | ||
*目前兼容 'facebook', 'google', 'apple' 渠道 | ||
* @param param0 | ||
* @returns | ||
*/ | ||
thirdChannelLoginToMsdk: ({ third_type, channel_info }: { | ||
third_type: string; | ||
channel_info: any; | ||
}) => Promise<any>; | ||
/** | ||
* 自建账号uid换取INTL账号openid | ||
* @param params | ||
* @returns | ||
*/ | ||
intlSignIn: (params: IntlSignInParams) => Promise<IntlSignInResp<'customAccount'>>; | ||
/** | ||
* 获取三方登录信息 | ||
* | ||
* @returns url | ||
*/ | ||
getThirdLoginInfo: (params: ThirdAuthorizeParams) => Promise<ThirdAuthorizeResp | unknown>; | ||
/** | ||
* kakao version 3 ,login | ||
* @param params | ||
* appId | ||
* jsKey | ||
* @returns | ||
*/ | ||
kakaoV3Login: (params: any) => Promise<unknown>; | ||
getThirdAccessToken: (reqParams: GetThirdAccessTokenParams) => Promise<GetThirdAccessTokenResp>; | ||
/** | ||
* 分享:公共方法(新版) | ||
* @param {*} params | ||
*/ | ||
openShareBox: (params?: any) => Promise<unknown>; | ||
/** | ||
* kakao story share | ||
* @param params | ||
* url | ||
* text | ||
* jsKey kakao appkey for jssdk | ||
* @returns | ||
*/ | ||
kakaoStoryShare: (params?: any) => Promise<unknown>; | ||
/** | ||
* 根据uid获取绑定列表 | ||
* @param {*} params | ||
* channel_info 用户渠道信息 | ||
* channel_id 用户渠道id | ||
* @returns | ||
*/ | ||
getBindChannelsByUid: (params?: any) => Promise<any>; | ||
/** | ||
* 根据INTL账号token/openid获取绑定列表 | ||
* @param {*} params | ||
* openid 用户渠道信息 | ||
* token 用户渠道id | ||
* channelid 渠道id | ||
* @returns | ||
*/ | ||
getBindChannelsByOpenID: (params?: any) => Promise<any>; | ||
/** | ||
* 绑定 | ||
* @param {*} params | ||
* openid INTL openid | ||
* token INTL token | ||
* oauth_channelid 登录INTL账号的渠道id | ||
* bind_channelid 需要绑定的账号的渠道id | ||
* bind_channel_info 需要绑定渠道的channelinfo信息(acctoken等信息) | ||
* @returns | ||
*/ | ||
bind: (params?: any) => Promise<any>; | ||
/** | ||
* 解除绑定 | ||
* @param {*} params | ||
* openid INTL openid | ||
* token INTL token | ||
* unbind_channelid 解除绑定的渠道id | ||
* uid 用户uid | ||
* oauth_channelid 渠道id | ||
* @returns | ||
*/ | ||
unbind: (params?: any) => Promise<any>; | ||
/** | ||
* 邮件订阅 | ||
*/ | ||
subscribeEmail: (params: SubscribeEmailParams) => Promise<any>; | ||
/** | ||
* 校验自建账号token有效性 | ||
* @param {*参数对象} params | ||
* uid string 【必填】用户id | ||
* token string 【必填】自建帐号登录态信息 | ||
*/ | ||
checkAccountLogined: (params?: any) => Promise<any>; | ||
/** | ||
* 查询当前账号是否允许邮件推送 | ||
* @returns | ||
*/ | ||
getReceiveEmail: (params?: any) => Promise<any>; | ||
/** | ||
* 设置当前账号是否允许邮件推送 | ||
* @returns | ||
*/ | ||
setReceiveEmail: (params?: any) => Promise<any>; | ||
/** | ||
* 获取验证码有效状态 | ||
* @returns | ||
*/ | ||
getCodeStatus: (params: QueryCodeStatusParams) => Promise<QueryCodeStatusResp>; | ||
/** | ||
* 获取账号配置 | ||
* @returns | ||
*/ | ||
queryAccountConfig: (params?: any) => Promise<any>; | ||
/** | ||
* Query uid through INTL openid | ||
* @returns | ||
*/ | ||
queryUidByOpenID: (params?: any) => Promise<any>; | ||
/** | ||
* refresh cacc token by openid | ||
* openid string [required] third channel oepnid | ||
* token string [required] third channel token | ||
* channel_id number [required] CAcc account_plat_type | ||
* oauth_channelid [required] third channel id | ||
* @returns | ||
*/ | ||
refreshCAccTokenByOpenID: (params?: any) => Promise<any>; | ||
/** | ||
* verify_code string [required] Verify Code | ||
* account string [required] Email or Phone | ||
* phone_area_code string [optional] Country Calling Code | ||
* account_type int [required] Account Type: 1 email, 2 phone | ||
* machine_check_type int [optional] Machine Check Type: 2 Google, 3 Tencent | ||
* google_response string [optional] Gooogle machine check response | ||
* tencent_response string [optional] Tencent machine check response | ||
*/ | ||
unlink: (params: any) => Promise<any>; | ||
/** | ||
* 查询 LI uid 是否同意了协议,是否需要升级 | ||
* @param params | ||
* @returns | ||
*/ | ||
getProtocol: (params: GetProtocolParam) => Promise<GetProtocolResp>; | ||
/** | ||
* 设置 LI uid 同意协议 | ||
* @param params | ||
* @returns | ||
*/ | ||
setProtocol: (params: SetProtocolParam) => Promise<SetProtocolResp>; | ||
/** | ||
* Intl退出登录 | ||
* @param params | ||
* @returns | ||
*/ | ||
intlLogout: (params: intlLogoutParams) => Promise<RespMeta>; | ||
/** | ||
* Intl 鉴权 | ||
* @param params | ||
* @returns | ||
*/ | ||
verifyLogin: (params: VerifyLoginParams) => Promise<RespMeta>; | ||
/** | ||
* | ||
* @param params | ||
* @returns | ||
*/ | ||
getRedirectResult: (params: getRedirectResultParams) => Promise<RespMeta>; | ||
intlRequest: (params: IntlRequestParams) => Promise<RespMeta>; | ||
/** | ||
* intl descryptAES for openid/token/uid | ||
* @returns | ||
*/ | ||
decryptAES: (params: DecryptAESParams) => Promise<any>; | ||
/** | ||
* | ||
* 处理三方渠道返回的授权信息 | ||
* 1. 取消授权 | ||
* 2. 授权失败 | ||
* 3. 授权成功,用 code 换 token 等授权信息 | ||
* 4. 授权成功,直接返回授权信息 | ||
* | ||
* TODO: 梳理内部解析逻辑 | ||
* @param options | ||
* @returns | ||
*/ | ||
private handleThirdInfo; | ||
/** | ||
* 获取三方 authlink 链接 | ||
* | ||
* 1. 访问三方渠道 authlink 接口 | ||
* 2. 对链接进行处理 | ||
* | ||
* @param options | ||
* @returns | ||
*/ | ||
private getAuthLink; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { QueryGameNameParams, QueryGameNameResp } from '../../src/type/common.type'; | ||
import { QueryGameNameParams, QueryGameNameResp } from '../type/common.type'; | ||
import { SDKConfig } from '../config'; | ||
@@ -8,9 +8,3 @@ export default class { | ||
queryMyRegion: () => Promise<any>; | ||
/** | ||
* | ||
* https://iwiki.woa.com/pages/viewpage.action?pageId=520665832 | ||
* @param params region、lang_type、gameid | ||
* @returns | ||
*/ | ||
queryGameName: (params: QueryGameNameParams) => Promise<QueryGameNameResp>; | ||
} |
@@ -10,5 +10,2 @@ export declare const MACHINE_CHECK_TYPE: { | ||
}; | ||
/** | ||
* 渠道(channel)常量类 | ||
*/ | ||
export declare const THIRD_CHANNEL_IDS: { | ||
@@ -31,4 +28,5 @@ readonly guest: 3; | ||
readonly kakaov3: 35; | ||
readonly xbox: 20; | ||
readonly wechat: 1; | ||
readonly xbox: 20; | ||
readonly qq: 2; | ||
}; | ||
@@ -51,12 +49,8 @@ export declare const THIRD_CHANNEL_NAME: { | ||
kakao: string; | ||
wechat: string; | ||
xbox: string; | ||
garena: string; | ||
wechat: string; | ||
qq: string; | ||
}; | ||
export declare const SPECLIAL_CUSTOM_MAP_TO_INTL_CHANNELID: any; | ||
export declare const THIRD_LOGIN_PARAMS: any; | ||
/** | ||
* popup 模式下 渠道登陆窗口尺寸 | ||
* width、height、 | ||
*/ | ||
export declare const THIRD_LOGIN_POPUP_LAYOUT: { | ||
@@ -63,0 +57,0 @@ readonly [x: string]: { |
@@ -5,5 +5,2 @@ import { SDKConfig } from '../config'; | ||
constructor(config: SDKConfig); | ||
/** | ||
* 查询 | ||
*/ | ||
queryGameInfo(params: QueryGameInfoParam): Promise<QueryGameInfoResp>; | ||
@@ -10,0 +7,0 @@ queryBindListBySacc(params: QueryBindListBySaccParam): Promise<any>; |
import '../utils/polyfill'; | ||
import { IntlRequestParams, RespMeta } from '../../src/type/common.type'; | ||
import { SubscribeEmailParams, UnbindParams, VerifyLoginParams, intlLogoutParams } from '../../src/type/cacc.type'; | ||
import { IntlRequestParams, RespMeta } from '../type/common.type'; | ||
import { SubscribeEmailParams, UnbindParams, VerifyLoginParams, intlLogoutParams } from '../type/cacc.type'; | ||
import { SDKConfig } from '../config'; | ||
@@ -23,15 +23,6 @@ import { DecryptAESParams } from '../type'; | ||
export declare const CHANNEL_DIS = "00000000"; | ||
/** | ||
* intl 账号api | ||
*/ | ||
export default class { | ||
private config; | ||
constructor(config: SDKConfig); | ||
/** | ||
* 登录 | ||
*/ | ||
uidToOpenID: (params?: {}, extraConfig?: {}) => Promise<any>; | ||
/** | ||
* 查询绑定关系 | ||
*/ | ||
getBindChannelsByOpenID({ openid, token }: { | ||
@@ -41,60 +32,17 @@ openid: string; | ||
}, extraConfig?: {}): Promise<any>; | ||
/** | ||
* 查询绑定关系,通过uid | ||
*/ | ||
getBindChannelsByUid({ channel_info }: { | ||
channel_info: any; | ||
}, extraConfig?: {}): Promise<any>; | ||
/** | ||
* 查询映射 | ||
*/ | ||
queryChannelMap(params: {} | undefined, extraConfig: any): Promise<any>; | ||
/** | ||
* 建立映射 | ||
*/ | ||
map(params: {} | undefined, extraConfig: any): Promise<any>; | ||
/** | ||
* 解除映射 | ||
*/ | ||
unmap(params: {} | undefined, extraConfig: any): Promise<any>; | ||
/** | ||
* 账号绑定 | ||
*/ | ||
bind(params: {} | undefined, extraConfig: any): Promise<RespMeta>; | ||
/** | ||
* 解除绑定 | ||
*/ | ||
unbind(params: UnbindParams, extraConfig: any): Promise<RespMeta>; | ||
/** | ||
* 邮件订阅 | ||
*/ | ||
subscribeEmail(params: SubscribeEmailParams, extraConfig: any): Promise<RespMeta>; | ||
/** | ||
* 登录鉴权 | ||
*/ | ||
verifyLogin: ({ openid, token, channel_id }: VerifyLoginParams) => Promise<any>; | ||
/** | ||
* intl解密 | ||
*/ | ||
decryptAES(params: DecryptAESParams): Promise<import("axios").AxiosResponse<any>>; | ||
/** | ||
* Query uid through INTL openid | ||
*/ | ||
getChannelInfo(params: {} | undefined, extraConfig: any): Promise<any>; | ||
/** | ||
* 获取账号配置 | ||
* @returns | ||
*/ | ||
queryAccountConfig(params: {} | undefined, extraConfig: any): Promise<any>; | ||
/** | ||
* Intl 退出登录 | ||
* | ||
* channel_id 需要和 intl 授权时的 channel id 相一致 | ||
*/ | ||
intlLogout(params: intlLogoutParams): Promise<RespMeta>; | ||
/** | ||
* 自定义调用 intl 接口,适用于不对外统一开放的、应用范围较窄、非通用的后台请求 | ||
* @param params | ||
*/ | ||
intlRequest(params: IntlRequestParams): Promise<RespMeta>; | ||
} |
@@ -1,46 +0,5 @@ | ||
/** | ||
* 自建账号get请求 | ||
* @param url | ||
* @param data | ||
* @param config | ||
* @param headers | ||
* @param options | ||
* @returns | ||
*/ | ||
export declare function get(url: string, data?: {}, config?: {}, headers?: {}, options?: {}): Promise<any>; | ||
/** | ||
* 自建账号get请求(返回结果包含header信息) | ||
* @param url | ||
* @param data | ||
* @param config | ||
* @param headers | ||
* @param options | ||
* @returns | ||
*/ | ||
export declare function getWithHeader(url: string, data?: {}, config?: {}, headers?: {}, options?: {}): Promise<import("axios").AxiosResponse<any>>; | ||
/** | ||
* 自建账号post请求 | ||
* @param url | ||
* @param data | ||
* @param config | ||
* @param headers | ||
* @param options | ||
* @returns | ||
*/ | ||
export declare function post(url: string, data?: {}, config?: {}, headers?: {}, options?: {}): Promise<any>; | ||
/** | ||
* 通用post请求 | ||
* @param url | ||
* @param data | ||
* @param headers | ||
* @returns | ||
*/ | ||
export declare function singlePost(url: string, data: any, headers?: Record<string, unknown>): Promise<any>; | ||
/** | ||
* 通用get请求 | ||
* @param url | ||
* @param data | ||
* @param headers | ||
* @returns | ||
*/ | ||
export declare function singleGet(url: string, data: any, headers?: Record<string, unknown>): Promise<any>; |
@@ -28,2 +28,3 @@ export declare const Succ = 0; | ||
export declare const ErrLoginWechat = 808098015; | ||
export declare const ErrLoginQQ = 808098021; | ||
export declare const CancelLoginDiscord = 808098016; | ||
@@ -30,0 +31,0 @@ export declare const CancelLoginFacebook = 808098017; |
@@ -7,11 +7,2 @@ export declare const STEAM_PARAM_KEYS: readonly ["openid.ns", "openid.mode", "openid.op_endpoint", "openid.claimed_id", "openid.identity", "openid.return_to", "openid.response_nonce", "openid.assoc_handle", "openid.signed", "openid.sig"]; | ||
} | ||
/** | ||
* | ||
* 后台 auth/login 授权、绑定等需要的 steam channelInfo 是 steamid 和 query_str | ||
* 而 steam 返回的是 Record<TSteamParamKeys, string> | ||
* 所以如果有 query_str, steamid 了,就无需重新构造出来 | ||
* 没有的话,根据 steam 返回的 Record<TSteamParamKeys, string> 构造出后台需要的 channelInfo | ||
* @param params | ||
* @returns | ||
*/ | ||
export declare function generateSteamChannelInfo(params: GenerateSteamChannelInfoParams): { | ||
@@ -18,0 +9,0 @@ steamid: string; |
@@ -1,11 +0,1 @@ | ||
/** | ||
* 校验参数合法性 | ||
* @param params 参数对象 | ||
* @param keys 必要参数key值数组 | ||
* @param validates 自定义校验规则对象数组 | ||
* @param validates[].key 参数key | ||
* @param validates[].valid 校验规则,目前只支持正则 | ||
* @param validates[].msg 描述 | ||
* @returns 合法性 | ||
*/ | ||
export declare function assertNecessaryParams(params?: any, keys?: any, validates?: any): true | { | ||
@@ -15,37 +5,9 @@ msg: any; | ||
}; | ||
/** | ||
* 校验地区合法性 | ||
* @returns | ||
*/ | ||
export declare function validRegion(value: string): boolean; | ||
/** | ||
* 校验语言合法性 | ||
* @returns | ||
*/ | ||
export declare function validLang(value: string): boolean; | ||
/** | ||
* 校验生日合法性;允许yy-mm格式 | ||
* @returns | ||
*/ | ||
export declare function validBirthday(value: string): boolean; | ||
/** | ||
* 格式化后台接口response为标准对外api结构体 | ||
* @param rtn | ||
* @returns | ||
*/ | ||
export declare function formatBackend(rtn: Record<string, any>): any; | ||
/** | ||
* 格式化数据为标准对外api结构体 | ||
* @param rtn | ||
* @returns | ||
*/ | ||
export declare function formatData(rtn?: Record<string, any>): any; | ||
/** | ||
* 校验请求是否失败 | ||
*/ | ||
export declare function getCurrentUrl(): string; | ||
/** | ||
* Dynamically load script tag resources | ||
*/ | ||
export declare function dynaLoadScript(params: any, callbackFunc: any): void; | ||
export declare function osType(): number; |
import { MachineCheckMeta, UidMeta } from './common.type'; | ||
/** | ||
* 自建账号:账号参数 | ||
*/ | ||
export interface AccountMeta { | ||
@@ -10,21 +7,4 @@ account: string; | ||
} | ||
/** | ||
* 自建账号:账号类型 | ||
* 1: email | ||
* 2: phone | ||
*/ | ||
export type AccountType = 1 | 2; | ||
/** | ||
* 自建账号:账号删除状态 | ||
* -1: 查询失败 | ||
* 0: 未撤回任何删除账户记录或删除号码 | ||
* 1:账号删除前的等待期 | ||
* 2:已经成功删除账号 | ||
* 3:正在删除账号 | ||
* 4:删除账号失败 | ||
*/ | ||
export type DelAccountStatusType = -1 | 0 | 1 | 2 | 3 | 4; | ||
/** | ||
* 自建账号:通用个人基础信息 | ||
*/ | ||
export interface PersonalInfoMeta { | ||
@@ -37,20 +17,5 @@ user_name?: string; | ||
} | ||
/** | ||
* 自建账号:是否接收邮件推送 | ||
* 1:允许推送 其他:不允许 | ||
*/ | ||
export type ReceiveEmailType = 0 | 1; | ||
/** | ||
* 自建账号:用户名是否可用 | ||
* 0:不可用, 1:可用 | ||
*/ | ||
export type UsernameAvailableType = 0 | 1; | ||
/** | ||
* 自建账号:账号是否存在 | ||
* 0:不存在, 1:存在 | ||
*/ | ||
export type RegisterType = 0 | 1; | ||
/** | ||
* 自建账号:用户协议 | ||
*/ | ||
export interface UserAgreementMeta { | ||
@@ -60,5 +25,2 @@ privacy_policy: string; | ||
} | ||
/** | ||
* 自建账号:用户协议及更新时间 | ||
*/ | ||
export interface UpdateUserAgreementMeta extends UserAgreementMeta { | ||
@@ -68,16 +30,6 @@ privacy_update_time: number; | ||
} | ||
/** | ||
* 自建账号:验证方式 | ||
* 1:使用验证码 2:使用旧密码 3:使⽤当前⾃建账号的登录态 | ||
*/ | ||
export type VerifyType = 1 | 2 | 3; | ||
/** | ||
* 自建账号:Uid和expire参数 | ||
*/ | ||
export interface UidExpireRespMeta extends UidMeta { | ||
expire: number; | ||
} | ||
/** | ||
* 自建账号:手机号参数 | ||
*/ | ||
export interface PhoneMeta { | ||
@@ -87,5 +39,2 @@ phone: string; | ||
} | ||
/** | ||
* 自建账号:密码验证码参数 | ||
*/ | ||
export interface PasswordMeta { | ||
@@ -95,15 +44,6 @@ password: string; | ||
} | ||
/** | ||
* 自建账号:人机校验参数 | ||
*/ | ||
export interface MachineCheckParams extends AccountMeta, MachineCheckMeta { | ||
} | ||
/** | ||
* 自建账号:密码、人机校验参数 | ||
*/ | ||
export interface PasswordParams extends PasswordMeta, MachineCheckParams { | ||
} | ||
/** | ||
* 自建账号:渠道参数信息 | ||
*/ | ||
export interface CustomAccountMeta { | ||
@@ -114,7 +54,4 @@ token: string; | ||
} | ||
/** | ||
* 自建账号:渠道信息 | ||
*/ | ||
export interface CustomAccountChannelInfo { | ||
customAccount: CustomAccountMeta; | ||
} |
import { PersonalInfoMeta, UsernameAvailableType, UserAgreementMeta, RegisterType, VerifyType, UidExpireRespMeta, PhoneMeta, UpdateUserAgreementMeta, MachineCheckParams, PasswordParams, AccountMeta, AccountType } from './cacc-common.type'; | ||
import { RespMeta, CodeType, BasicRespMeta, UidMeta, OpenIdMeta, ExtraMeta } from './common.type'; | ||
/** | ||
* 【API 参数】自建账号密码登录 | ||
*/ | ||
export interface SignInParams extends MachineCheckParams { | ||
@@ -10,11 +7,5 @@ password: string; | ||
} | ||
/** | ||
* 【API 回包】自建账号密码 / 验证码登录 | ||
*/ | ||
export interface CACCSignInResp extends RespMeta, UidExpireRespMeta { | ||
register_time: number; | ||
} | ||
/** | ||
* 【API 参数】自建账号验证码登录 | ||
*/ | ||
export interface VerifyCodeSignInParams extends MachineCheckParams { | ||
@@ -25,5 +16,2 @@ verify_code: string; | ||
} | ||
/** | ||
* 【API 参数】INTL 账号登录(使用自建账号) | ||
*/ | ||
export interface IntlSignInParams extends OpenIdMeta { | ||
@@ -39,10 +27,4 @@ account_plat_type: number; | ||
} | ||
/** | ||
* 【API 参数】获取自建账号个人信息 | ||
*/ | ||
export interface QueryUserInfoParams extends UidMeta { | ||
} | ||
/** | ||
* 【API 回包】获取自建账号个人信息 | ||
*/ | ||
export interface QueryUserInfoResp extends ModifyProfileResp, UpdateUserAgreementMeta, PhoneMeta { | ||
@@ -53,11 +35,5 @@ account_type: AccountType; | ||
} | ||
/** | ||
* 【API 参数】修改自建账号个人信息 | ||
*/ | ||
export interface ModifyProfileParams extends PersonalInfoMeta, OpenIdMeta { | ||
user_lang_type?: string; | ||
} | ||
/** | ||
* 【API 回包】修改自建账号个人信息 | ||
*/ | ||
export interface ModifyProfileResp extends RespMeta, PersonalInfoMeta, PhoneMeta { | ||
@@ -67,22 +43,10 @@ email: string; | ||
} | ||
/** | ||
* 【API 参数】检查用户名是否被注册(自建账号) | ||
*/ | ||
export interface QueryUserNameStatusParams { | ||
user_name: string; | ||
} | ||
/** | ||
* 【API 回包】检查用户名是否被注册(自建账号) | ||
*/ | ||
export interface QueryUserNameStatusResp extends RespMeta { | ||
username_available: UsernameAvailableType; | ||
} | ||
/** | ||
* 【API 参数】修改用户信息隐私政策、服务条款版本号(自建账号) | ||
*/ | ||
export interface ModifyUserAgreementParams extends UserAgreementMeta, OpenIdMeta { | ||
} | ||
/** | ||
* 【API 回包】修改用户信息隐私政策、服务条款版本号(自建账号) | ||
*/ | ||
export interface ModifyUserAgreementResp extends RespMeta, UserAgreementMeta { | ||
@@ -92,44 +56,20 @@ } | ||
} | ||
/** | ||
* 【API 回包】查询账号是否被注册(自建账号) | ||
*/ | ||
export interface QueryRegisterStatusResp extends RespMeta { | ||
is_register: RegisterType; | ||
} | ||
/** | ||
* 【API 参数】自建账号密码注册 | ||
*/ | ||
export interface RegisterParams extends VerifyCodeRegisterParams { | ||
user_lang_type?: string; | ||
} | ||
/** | ||
* 【API 回包】自建账号密码注册 | ||
*/ | ||
export interface RegisterResp extends RespMeta, UidExpireRespMeta { | ||
} | ||
/** | ||
* 【API 参数】自建账号验证码注册 | ||
*/ | ||
export interface VerifyCodeRegisterParams extends PersonalInfoMeta, PasswordParams { | ||
} | ||
/** | ||
* 【API 回包】自建账号验证码注册 | ||
*/ | ||
export interface VerifyCodeRegisterResp extends RespMeta, UidExpireRespMeta { | ||
} | ||
/** | ||
* 【API 参数】发送邮箱/手机验证码 | ||
*/ | ||
export interface RequestVerifyCodeParams extends MachineCheckParams { | ||
code_type: CodeType; | ||
} | ||
/** | ||
* 【API 回包】发送邮箱/手机验证码 | ||
*/ | ||
export interface RequestVerifyCodeResp extends RespMeta { | ||
expire_time: number; | ||
} | ||
/** | ||
* 【API 参数】检查验证码是否正确 | ||
*/ | ||
export interface QueryCodeStatusParams extends AccountMeta { | ||
@@ -139,10 +79,4 @@ code_type: CodeType; | ||
} | ||
/** | ||
* 【API 回包】检查验证码是否正确 | ||
*/ | ||
export interface QueryCodeStatusResp extends RespMeta { | ||
} | ||
/** | ||
* 【API 回包】获取图形验证码 | ||
*/ | ||
export interface RequestVerifyImageResp extends BasicRespMeta { | ||
@@ -152,5 +86,2 @@ sessionid: string; | ||
} | ||
/** | ||
* 【API 参数】修改密码 | ||
*/ | ||
export interface ResetPasswordParams extends PasswordParams { | ||
@@ -160,10 +91,4 @@ verify_type: VerifyType; | ||
} | ||
/** | ||
* 【API 参数】登出 | ||
*/ | ||
export interface LogoutParams extends UidMeta { | ||
} | ||
/** | ||
* 【API 参数】修改自建账号信息 | ||
*/ | ||
export interface ModifyAccountInfoParams extends MachineCheckParams { | ||
@@ -180,14 +105,4 @@ verify_type: VerifyType; | ||
} | ||
/** | ||
* 【API 回包】修改自建账号信息 | ||
*/ | ||
export interface ModifyAccountInfoResp extends RespMeta { | ||
} | ||
/** | ||
* 【API 参数】绑定 | ||
* For Garena binding,there are two situations for binding. One is for Binding Channel and Guest. Another is binding channel and channel. | ||
* For binding Guest and channel, please input channel token into bind_channel_info, so that we can bind guest and this channel. | ||
* For binding channel and channel, please into the secondary channel access token intobind_channel_info, so that we can bind this chanel to the original one | ||
* Moreover, for the binding between channels, please set it as true, however, when binding guest and channel, you can set it as false or just ignore it. | ||
*/ | ||
export interface BindParams { | ||
@@ -203,5 +118,2 @@ openid?: string; | ||
} | ||
/** | ||
* 【API 参数】解绑 | ||
*/ | ||
export interface UnbindParams { | ||
@@ -214,5 +126,2 @@ openid: string; | ||
} | ||
/** | ||
* 【API 参数】邮件订阅 | ||
*/ | ||
export interface SubscribeEmailParams { | ||
@@ -228,5 +137,2 @@ email: string; | ||
} | ||
/** | ||
* 【API 参数】Intl退出登录 | ||
*/ | ||
export interface intlLogoutParams { | ||
@@ -233,0 +139,0 @@ openid: string; |
import { CustomAccountChannelInfo, DelAccountStatusType } from './cacc-common.type'; | ||
import { ThirdChannelInfo } from './third-common.type'; | ||
/** | ||
* 性别 | ||
* 0:未定义 1:男 2:女 | ||
*/ | ||
export type GenderType = 0 | 1 | 2; | ||
/** | ||
* 是否首次登录 | ||
* -1:未知 0:否 1:是 | ||
*/ | ||
export type FirstLoginStatusType = -1 | 0 | 1; | ||
/** | ||
* Uid参数 | ||
*/ | ||
export interface UidMeta { | ||
@@ -20,5 +9,2 @@ uid: string; | ||
} | ||
/** | ||
* OpenId参数 | ||
*/ | ||
export interface OpenIdMeta { | ||
@@ -28,5 +14,2 @@ token: string; | ||
} | ||
/** | ||
* 后台返回通用数据 | ||
*/ | ||
export interface BasicRespMeta { | ||
@@ -36,11 +19,5 @@ ret: number; | ||
} | ||
/** | ||
* 后台返回数据 | ||
*/ | ||
export interface RespMeta extends BasicRespMeta { | ||
seq?: string; | ||
} | ||
/** | ||
* 验证码类型 | ||
*/ | ||
export declare enum CodeType { | ||
@@ -52,5 +29,2 @@ register = 0, | ||
} | ||
/** | ||
* 是否支持人机验证 | ||
*/ | ||
export declare enum SUPPORT_CAPTCHA_TYPE { | ||
@@ -60,5 +34,2 @@ YES = 1, | ||
} | ||
/** | ||
* 人机验证参数 | ||
*/ | ||
export interface MachineCheckMeta { | ||
@@ -72,10 +43,4 @@ machine_check_type?: 1 | 2 | 3; | ||
} | ||
/** | ||
* Intl渠道信息 合并自建账号、第三方渠道 | ||
*/ | ||
export interface IntlChannelInfo extends ThirdChannelInfo, CustomAccountChannelInfo { | ||
} | ||
/** | ||
* INTL授权返回的信息 | ||
*/ | ||
export interface IntlSignInResp<T extends keyof IntlChannelInfo = any> extends RespMeta { | ||
@@ -125,5 +90,2 @@ email: string; | ||
} | ||
/** | ||
* 【API 参数】获取Game Name | ||
*/ | ||
export interface QueryGameNameParams { | ||
@@ -134,11 +96,5 @@ region?: string; | ||
} | ||
/** | ||
* 【API 回包】获取Game Name | ||
*/ | ||
export interface QueryGameNameResp extends RespMeta { | ||
game_name: string; | ||
} | ||
/** | ||
* 邮件订阅 自定义参数 | ||
*/ | ||
export interface ExtraMeta { | ||
@@ -145,0 +101,0 @@ field_name: string; |
@@ -1,9 +0,1 @@ | ||
/** | ||
* 三方渠道 channel ID enum | ||
* | ||
* FIXME: 因为 account-api 只有一个 default 导出,所以不能导出 enum 类型 | ||
*/ | ||
/** | ||
* 三方渠道: 渠道名称 enum | ||
*/ | ||
declare enum ThirdChannelNameEnum { | ||
@@ -24,13 +16,7 @@ facebook = "facebook", | ||
xbox = "xbox", | ||
garena = "garena" | ||
garena = "garena", | ||
wechat = "wechat", | ||
qq = "qq" | ||
} | ||
/** | ||
* 三方渠道: 渠道名称 | ||
*/ | ||
export type ThirdChannelName = keyof typeof ThirdChannelNameEnum; | ||
/** | ||
* 三方渠道: 渠道参数 | ||
* 渠道的登录信息,不同渠道内容不同, 详见渠道信息说明 | ||
* https://developers.intlgame.com/docs/intlsdk/zh/JS/Info/DataTypeDefinition#ChannelInfo | ||
*/ | ||
export interface ThirdChannelInfo { | ||
@@ -52,2 +38,4 @@ facebook: FacebookChannelInfo; | ||
garena: GarenaChannelInfo; | ||
wechat: WechatCHannelInfo; | ||
qq: QQChannelInfo; | ||
} | ||
@@ -57,24 +45,11 @@ type ShapeOf<T> = Record<keyof T, any>; | ||
export type Assertion = AssertKeysEqual<ShapeOf<typeof ThirdChannelNameEnum>, ThirdChannelInfo>; | ||
/** | ||
* 三方渠道: issuerId | ||
* 用于识别要调用的sony环境;QA:8, PROD:256, DEV:1 | ||
*/ | ||
export interface IssuerIdMeta { | ||
issuerId?: number; | ||
} | ||
/** | ||
* 三方渠道: Facebook channelInfo | ||
*/ | ||
export interface FacebookChannelInfo { | ||
access_token: string; | ||
} | ||
/** | ||
* 三方渠道: Google channelInfo | ||
*/ | ||
export interface GoogleChannelInfo { | ||
code: string; | ||
} | ||
/** | ||
* 三方渠道: Xbox channelInfo | ||
*/ | ||
export interface XboxChannelInfo { | ||
@@ -84,11 +59,5 @@ auth_token: string; | ||
} | ||
/** | ||
* 三方渠道: Garena channelInfo | ||
*/ | ||
export interface GarenaChannelInfo { | ||
access_token: string; | ||
} | ||
/** | ||
* 三方渠道: Twitter channelInfo | ||
*/ | ||
export interface TwitterChannelInfo { | ||
@@ -98,5 +67,2 @@ oauth_token: string; | ||
} | ||
/** | ||
* 三方渠道: Line channelInfo | ||
*/ | ||
export interface LineChannelInfo { | ||
@@ -106,5 +72,2 @@ access_token: string; | ||
} | ||
/** | ||
* 三方渠道: Apple channelInfo | ||
*/ | ||
export interface AppleChannelInfo { | ||
@@ -114,11 +77,5 @@ code: string; | ||
} | ||
/** | ||
* 三方渠道: VK channelInfo | ||
*/ | ||
export interface VKChannelInfo { | ||
token: string; | ||
} | ||
/** | ||
* 三方渠道: Steam channelInfo | ||
*/ | ||
export interface SteamChannelInfo { | ||
@@ -136,5 +93,2 @@ 'openid.ns': string; | ||
} | ||
/** | ||
* 三方渠道: Epic channelInfo | ||
*/ | ||
export interface EpicChannelInfo { | ||
@@ -148,5 +102,2 @@ openid: string; | ||
} | ||
/** | ||
* 三方渠道: Discord channelInfo | ||
*/ | ||
export interface DiscordChannelInfo { | ||
@@ -158,5 +109,2 @@ access_token: string; | ||
} | ||
/** | ||
* 三方渠道: PlayStation 5 channelInfo | ||
*/ | ||
export interface PlayStation5ChannelInfo extends IssuerIdMeta { | ||
@@ -166,5 +114,2 @@ code: string; | ||
} | ||
/** | ||
* 三方渠道: Twitch channelInfo | ||
*/ | ||
export interface TwitchChannelInfo { | ||
@@ -176,11 +121,5 @@ access_token: string; | ||
} | ||
/** | ||
* 三方渠道: Facebook Instant Game channelInfo | ||
*/ | ||
export interface FacebookInstantGameChannelInfo { | ||
signature: string; | ||
} | ||
/** | ||
* 三方渠道: Kakao v3 channelInfo | ||
*/ | ||
export interface KakaoV3ChannelInfo { | ||
@@ -192,4 +131,13 @@ zat: string; | ||
} | ||
export interface WechatCHannelInfo { | ||
access_token: string; | ||
expires_in: number; | ||
} | ||
export interface QQChannelInfo { | ||
access_token: string; | ||
expires_in: number; | ||
refresh_token: number; | ||
} | ||
export type WindowOpenType = '_self'; | ||
export type UxMode = 'popup' | 'fullScreen'; | ||
export {}; |
@@ -1,7 +0,3 @@ | ||
/** 三方渠道 API 类型 */ | ||
import { ThirdChannelName, ThirdChannelInfo, WindowOpenType, UxMode } from './third-common.type'; | ||
import { BasicRespMeta, IntlSignInResp } from './common.type'; | ||
/** | ||
* 【API 参数】第三方渠道授权 | ||
*/ | ||
export interface ThirdAuthorizeParams { | ||
@@ -22,11 +18,16 @@ third_type: ThirdChannelName; | ||
} | ||
/** | ||
* 【API 回包】第三方渠道授权 | ||
*/ | ||
export interface SignInWithRedirectParams { | ||
third_type: ThirdChannelName; | ||
signInSuccessUrl?: string; | ||
extra?: { | ||
appleAppId?: string; | ||
kakaov3AppId?: number; | ||
kakaov3JsKey?: string; | ||
platform?: string; | ||
all_platforms?: string; | ||
}; | ||
} | ||
export interface ThirdAuthorizeResp extends BasicRespMeta { | ||
access_token: string; | ||
} | ||
/** | ||
* 【API 参数】INTL 账号授权 | ||
*/ | ||
export interface IntlAuthorizeParams<T extends keyof ThirdChannelInfo> { | ||
@@ -36,5 +37,2 @@ third_type: T; | ||
} | ||
/** | ||
* 【API 参数】获取access_token | ||
*/ | ||
export interface GetThirdAccessTokenParams { | ||
@@ -48,5 +46,2 @@ gameid: string; | ||
} | ||
/** | ||
* 【API 回包】获取access_token | ||
*/ | ||
export interface GetThirdAccessTokenResp extends BasicRespMeta { | ||
@@ -58,5 +53,2 @@ access_token: string; | ||
} | ||
/** | ||
* 【API 参数】第三方渠道登录 | ||
*/ | ||
export interface LoginParams<T extends keyof ThirdChannelInfo> { | ||
@@ -66,5 +58,2 @@ third_type: T; | ||
} | ||
/** | ||
* 【API 回包】第三方渠道登录 | ||
*/ | ||
export interface LoginResp extends ThirdAuthorizeResp, IntlSignInResp { | ||
@@ -71,0 +60,0 @@ } |
export declare const IFRAME_LOGINCALL_TRANS_PATH = "jssdk/logincallback_transmitter.html"; | ||
export declare const IFRAME_AUTH_HELPER = "jssdk/iframe_authHelper.html"; | ||
interface OpenIframeOptions { | ||
@@ -3,0 +4,0 @@ where: HTMLElement; |
export declare function getUrlParams(search?: string): any; | ||
/** | ||
* | ||
* TODO: 使用开源方案替换 | ||
* @param url | ||
* @returns | ||
*/ | ||
export declare function urlParse(url: string): any; |
import Aegis from 'aegis-web-mini-sdk'; | ||
import { ClientOptions, ThirdChannelName } from '../type'; | ||
/** | ||
* uin: openid (优先级高)或 uin | ||
* | ||
* ext1: 一般是参数 | ||
* ext2: gameID | ||
* ext3: scene | ||
*/ | ||
/** | ||
* 初始化 aegis 上报 SDK | ||
* | ||
*/ | ||
export declare function initReport(options: ClientOptions): Aegis; | ||
/** | ||
* 上报初始化事件 | ||
*/ | ||
export declare function reportJSSDKInit({ options }: { | ||
options: ClientOptions; | ||
}): void; | ||
/** | ||
* 上报跳转到三方渠道页面 | ||
* @param param0 | ||
*/ | ||
export declare function reportRedirectToThirdChannel({ thirdType, authlink, state, }: { | ||
@@ -30,5 +12,2 @@ thirdType: ThirdChannelName; | ||
}): void; | ||
/** | ||
* 上报请求接口获取三方渠道的 token | ||
*/ | ||
export declare function reportGetChannelToken({ thirdType, params, state, }: { | ||
@@ -39,7 +18,2 @@ thirdType: ThirdChannelName; | ||
}): void; | ||
/** | ||
* | ||
* 上报请求接口获取三方渠道的 token 时, 入参异常情况 | ||
* @param reqParams | ||
*/ | ||
export declare function reportGetChannelTokenParamsError({ thirdType, params, state, }: { | ||
@@ -50,5 +24,2 @@ thirdType: ThirdChannelName; | ||
}): void; | ||
/** | ||
* 上报请求接口获取三方渠道的 token 时接口返回异常 | ||
*/ | ||
export declare function reportGetChannelTokenError({ thirdType, params, resp, }: { | ||
@@ -59,6 +30,2 @@ thirdType: ThirdChannelName; | ||
}): void; | ||
/** | ||
* 一般传递 openid, 如果没有 openid 则传递 uid | ||
* @param openid | ||
*/ | ||
export declare function setReportUin(openid: string): void; |
@@ -13,11 +13,2 @@ import { ThirdChannelInfo, ThirdChannelName, UxMode } from '../type'; | ||
} | ||
/** | ||
* | ||
* 引导用户跳转到渠道的页面进行授权,一般只能通过 state 参数传递信息,渠道授权成功后会返回 state | ||
* 1. popup 模式,没有 callbackurl | ||
* 2. self 模式(重定向模式),需要把 state 参数的值设置成 callbackurl 这样通用的三方渠道回调页才知道要重定向回哪里。 | ||
* | ||
* 如果有 callbackrul, 则替换 authlink 中的 state | ||
* @param options | ||
*/ | ||
export declare function transformStateInAuthlink(options: TransformStateInAuthlinkOptions): string; | ||
@@ -29,55 +20,8 @@ interface TansformDisPlayModeInAuthlinkOptions { | ||
} | ||
/** | ||
* | ||
* 修改 authlink, 如果是弹窗模式,根据渠道修改 authlink 链接参数,让渠道方展示弹窗样式 | ||
* @param options | ||
* @returns | ||
*/ | ||
export declare function transformDisPlayModeInAuthlink(options: TansformDisPlayModeInAuthlinkOptions): string; | ||
/** | ||
* ps5 渠道需要传 issuer_id,用于识别要调用的 sony 环境;QA:8, PROD:256, DEV:1 | ||
* @param channelInfo | ||
* @param hostThird | ||
* @returns | ||
*/ | ||
export declare function addPS5IssuerIdToChannelInfo(channelInfo: ThirdChannelInfo['ps5'], hostThird: string): import("../type").PlayStation5ChannelInfo; | ||
/** | ||
* 生成 twiiter 的回调地址 | ||
* | ||
* 1. 根据环境生成回调地址 | ||
* 2. 如果有业务回调地址,那么放在 state 里 | ||
* 3. 如果没有业务回调地址,那么 state 就是随机数 | ||
* | ||
* @param env | ||
* @param callbackurl | ||
* @returns | ||
*/ | ||
export declare function getTwitterLoginCallbackUrl(env: string, callbackurl: string): string; | ||
/** | ||
* 从后台返回的 authlink 中获取 state | ||
* steam 和 twitter 没有 state. 需要前端自己生成 | ||
* @param authlink | ||
* @returns | ||
*/ | ||
export declare function getStateFromAuthlink(authlink: string): string; | ||
/** | ||
* 检查是否使用新窗口打开 三方渠道授权页 | ||
* | ||
* 如果不是明确说明 _self 模式,那么默认使用新窗口打开 | ||
* @param windowOpenType | ||
* @returns | ||
*/ | ||
export declare function checkIfUseNewWindow(windowOpenType: string | undefined): boolean; | ||
/** | ||
* | ||
* 检查是否使用 popup 模式(最小弹出窗口)打开 三方渠道授权页 | ||
* | ||
* 如果不是明确说明用 fullScreen 模式,那么默认使用最小弹出窗口 (popup 模式) | ||
* @param uxMode | ||
* @returns | ||
*/ | ||
export declare function checkIsPopupMode(uxMode: UxMode | undefined): boolean; | ||
/** | ||
* 设置新窗口打开的 target | ||
*/ | ||
export declare function setNewWindowTarget({ ifUseNewWindow }: { | ||
@@ -84,0 +28,0 @@ ifUseNewWindow: boolean; |
export declare function arrayBufferToBase64(buffer?: never[]): string; | ||
/** | ||
* 删除对象的空白属性,如 null, undefined, '', 0, [], {} | ||
* @param obj | ||
* @returns | ||
*/ | ||
export declare function compacted(obj: Record<string, any>): {}; |
{ | ||
"name": "@intlsdk/account-api", | ||
"version": "1.17.3", | ||
"version": "1.18.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "dist/src/index.d.ts", |
Sorry, the diff of this file is too big to display
40
553157
3996