import type { ClubAddress, ClubUserProfile, RedeemParams } from "./club.define"; import type { ClubCreditChangeType, ClubItemType } from "./club.enums"; import type { UgcSocialMedia } from "./event.enums"; import type { AuthToken } from "./token"; import type { RequestInternalError, RequestOptions } from "@seayoo-web/request"; import type { SomePartial } from "@seayoo-web/utils"; export declare class ClubApi { private token; private req; constructor(authToken: AuthToken); /** * 获取俱乐部配置 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=tuhsPt3ihp */ getConfig(requestOptions?: RequestOptions): Promise; /** * 用于游戏内嵌 Web 页面和微信小程序获取当前登录的游戏账号在俱乐部中的信息。 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=hIDfaMlT7m */ getCurrentPlayer(requestOptions?: RequestOptions): Promise; /** * 俱乐部用户关联游戏账号 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Dpb9JAKqzG */ linkPlayer(requestOptions?: RequestOptions): Promise; /** * 关联游戏账号 * * https://www.kdocs.cn/l/cpaabaxfsvaj?linkname=awQyxBMqkM */ linkPlayerV2(option: { /** * 授权类型 * * - `session_seayoo` 通过 gamer 登录后的 session 授权,将 seayoo identity 对应的 combo_id 关联至俱乐部账号(游戏内 | 游戏外) * - `session_combo` 通过 gamer 登录后的 session 授权,将 combo identity 对应的 combo_id 关联至俱乐部账号(游戏内,暂不实现) */ grant_type: "session_seayoo" | "session_combo"; } | { /** 授权类型,`ticket` 表示服务端将 ticket 背后缓存的 combo_id 关联至俱乐部账号 */ grant_type: "ticket"; /** verify-role-otp 返回的 ticket */ ticket: string; }, requestOptions?: RequestOptions): Promise; /** * 解除游戏账号关联 * * https://www.kdocs.cn/l/cpaabaxfsvaj?linkname=qCCNWpxpHq */ unlinkPlayer(requestOptions?: RequestOptions): Promise; /** * 发送角色验证码 * * https://www.kdocs.cn/l/cpaabaxfsvaj?linkname=m4AMDTqmZs */ sendRoleOtp(option: { /** 发送角色邮件验证码的动作,`link-player` 为关联游戏账号 */ action: "link-player"; /** 角色 ID */ role_id: string; /** 服务器 ID,混服游戏不需要传该参数 */ server_id?: string; }, requestOptions?: RequestOptions): Promise; /** * 验证角色验证码,返回一次性授权凭证 ticket,用于 link-player(grant_type=ticket) * * https://www.kdocs.cn/l/cpaabaxfsvaj?linkname=HbCOOTrEbS */ verifyRoleOtp(option: { /** 发送角色邮件验证码的动作,`link-player` 为关联游戏账号 */ action: "link-player"; /** 验证码 */ otp: string; /** 角色 ID */ role_id: string; /** 服务器 ID,混服游戏不需要传该参数 */ server_id?: string; }, requestOptions?: RequestOptions): Promise; /** * 获取俱乐部关联的游戏账号下的角色列表 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=nwu4FiGM9V */ getRoles(playerId?: string, forceReload?: boolean, requestOptions?: RequestOptions): Promise; /** * 获取俱乐部会员的角色卡片数据 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=A1Wr7kUXnS */ getRoleCard(memberId: string, requestOptions?: RequestOptions): Promise; /** * 设置自己的角色卡片 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XgMf6OFE5i */ setRoleCard(option: { player_id: string; server_id: string; role_id: string; }, requestOptions?: RequestOptions): Promise; /** * 强制刷新自己的角色卡片,从游戏内获取最新数据 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=RPdJquwmgv */ refreshRoleCard(requestOptions?: RequestOptions): Promise; /** * 创建俱乐部账号,重复创建会返回成功 * * 注册成功以后会在当前用户的 session 中记录 seayoo_user_id,供后续使用 club 相关功能(游戏内) * * https://www.kdocs.cn/l/cpaabaxfsvaj?linkname=SKL4MxaCdK */ registerMember(requestOptions?: RequestOptions): Promise; /** * 查询俱乐部账号信息 * * https://www.kdocs.cn/l/cpaabaxfsvaj?linkname=H5t6bq6r2h */ getMember(requestOptions?: RequestOptions): Promise; /** * 获取俱乐部用户的信息 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TMWBCFcOr2 */ getUserProfile(memberId: string, requestOptions?: RequestOptions): Promise; /** * 修改自己的俱乐部用户信息 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Qt822A57jd */ updateUserProfile(option: Partial, requestOptions?: RequestOptions): Promise; /** * 获取自己的俱乐部收货地址列表 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=NowUIynMVn */ getAddresses(requestOptions?: RequestOptions): Promise; /** * 增加俱乐部收货地址 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TaGIIYDRYA */ addAddress(option: Omit, "address_id">, requestOptions?: RequestOptions): Promise; /** * 修改自己的俱乐部收货地址 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=p9FlJhHnWN */ updateAddress(option: SomePartial, requestOptions?: RequestOptions): Promise; /** * 删除自己的俱乐部收货地址 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=MEEOBdf8rm */ deleteAddress(addressId: number, requestOptions?: RequestOptions): Promise; /** * 获取俱乐部积分统计信息 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=x4uxtGstRL */ getUserCredit(option: { /** 开始时间的秒时间戳 */ start_time: number; /** 结束时间的秒时间戳 */ end_time: number; /** 游戏账号 ID,游戏外必传 */ player_id?: string; }, requestOptions?: RequestOptions): Promise; /** * 获取自己的俱乐部积分变动记录 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=lQFgF689P8 */ getCreditLogs(option: { /** 单次获取数量 */ max_results?: number; /** 分页游标;首次请求为空 */ next_token?: string; /** 积分变动类型 */ change_type?: ClubCreditChangeType; /** 开始时间的秒时间戳 */ start_time: number; /** 结束时间的秒时间戳 */ end_time: number; /** 游戏账号 ID,游戏外必传 */ player_id?: string; }, requestOptions?: RequestOptions): Promise<{ credit_logs: import("./club.define").ClubCreditLog[]; next_token: string | undefined; }>; /** * 获取自己的俱乐部权益列表 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=UFSDGvqkdV */ getBenefits(requestOptions?: RequestOptions): Promise; /** * 获取某个权益详细信息 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XKto0MeaHF */ getBenefit(benefitId: number, requestOptions?: RequestOptions): Promise; /** * 获取商城商品列表 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=r3vC3PzfMQ */ getProducts(option?: { /** 游戏账号 ID,游戏外必传 */ player_id?: string; /** 商品分类 ID */ catalog_id?: number; }, requestOptions?: RequestOptions): Promise; /** * 兑换商城商品 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=LWcMVwX3OY */ redeemProduct(option: { /** 商品 ID */ product_id: number; /** 商品数量 */ quantity: number; /** 兑换参数,由 product_id 对应的 item_type 决定 */ params?: RedeemParams; /** 游戏账号 ID,游戏外必传 */ player_id?: string; }, requestOptions?: RequestOptions): Promise; /** * 获取兑换记录 * * https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Ml6mLgT4cM */ getRedemptions(option: { /** 单次获取数量 */ max_results?: number; /** 分页游标;首次请求为空 */ next_token?: string; /** 物品类型 */ item_type?: ClubItemType; /** 游戏账号 ID,游戏外必传 */ player_id?: string; }, requestOptions?: RequestOptions): Promise<{ redemptions: import("./club.define").Redemption[]; next_token: string | undefined; }>; /** * 图片预上传地址获取,为 club 服务提供预签名上传 URL,供用户客户端上传图片资源 * * https://www.kdocs.cn/l/cgp4gSBMbOf1?linkname=d4IHcCQu34 */ clubUploadImage(option: { /** 业务上传范围 */ scope: "avatar" | "social_homepage"; /** 当 scope 为 social_homepage 时,此参数为必填项 */ social_media?: UgcSocialMedia; /** 待上传文件的 MIME Type,仅支持上传标准图片格式 image/jpeg 和 image/png */ content_type: "image/jpeg" | "image/png"; /** 待上传文件的字节大小,用于限制 S3 上传 */ content_length: number; /** 待上传文件的 SHA-256 哈希值 用于校验上传对象的完整性 */ content_sha256: string; }, requestOptions?: RequestOptions): Promise<{ existed: boolean; image_upload_url: string | undefined; image_id: string; } | { message: string; error: RequestInternalError | "address_not_found"; }>; }