import type { EventApi } from "./event"; import type { EngagementFeatureType, InferEngagementError, InferEngagementParam } from "./event.define"; import type { GamerItemType, RewardSource, RewardStatus, UgcReviewStatus } from "./event.enums"; import type { RequestOptions, RequestInternalError } from "@seayoo-web/request"; type ApiInstance = InstanceType; /** 支持的 api 方法,用于 TS 类型输入提示 */ export type ApiMethodNames = "verifyMobileAllowed" | "getConfig" | "getEngagementsUserCount" | "getEngagementsCount" | "getEngagements" | "visit" | "getUserFeatureStatus" | "getUserEngagementCount" | "getUserEngagements" | "engage" | "claimRewards" | "submitUserRewardAddress" | "getUnlimitQrcodeScene" | "getParamsByQrcodeScene" | "generateUnlimitQrcode" | "getQuestProgress" | "vote2Rewards" | "getVote2Leaderboard" | "getCashbackQuery" | "getUgcRecord" | "getUgcMyCount" | "claimRewardsV2" | "claimWeixinHongbao" | "verifyActivationKey" | "getUserRewards" | "getUserRewardsCount" | "getUserItemCount" | "ugcUploadImage" | "getUgcRecommendation" | "getUgcs" | "getUgcLeaderboard" | "getUserVotes" | "getRedeemItemStocks" | "generateReferralRewards"; /** * 根据手机号白名单,检查手机号是否允许登录某个游戏 * * https://kdocs.cn/l/cf2mO2uRLqh9?linkname=OWGSPF3Ysl */ export declare function verifyMobileAllowed(this: ApiInstance, gameId: string, mobile: string, requestOptions?: RequestOptions): Promise; /** * 获取运营活动的基础配置信息 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=wFXxtdNKPm */ export declare function getConfig(this: ApiInstance, requestOptions?: RequestOptions): Promise; /** * 获取某个玩法参与用户数量 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1 */ export declare function getEngagementsUserCount(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 获取某个玩法参与次数 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=ejPOcWMvT1 */ export declare function getEngagementsCount(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 获取某个玩法的参与记录(和特定用户无关) * * 💡目前仅支持 Comment / Team 两个玩法的参与数据 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=THtZ4ewIQW */ export declare function getEngagements(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 用户访问某个活动或玩法 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=DWtJrnrBCn */ export declare function visit(this: ApiInstance, option?: { feature_id?: number; server_id?: string; role_id?: string; utm_source?: string; /** 邀请人的世游通行证 ID */ invited_by?: string; }, requestOptions?: RequestOptions): Promise<{ first_visit: boolean; } | { message: string; error: RequestInternalError | "event_not_found" | "feature_not_found" | "invalid_server_id" | "invalid_role_id"; }>; /** * 获取用户在目标活动下的所有玩法的参与状态,用于前端进一步确定如何执行交互逻辑 * * 💡活动下包含 engage_account_type 为 role_id 的玩法时,需要提供 server_id 和 role_id * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=WzX5BrMNpL */ export declare function getUserFeatureStatus(this: ApiInstance, option?: { server_id: string; role_id: string; }, requestOptions?: RequestOptions): Promise; /** * 获取用户在目标活动下的某个玩法的参与次数 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=uYCsjWyL36 */ export declare function getUserEngagementCount(this: ApiInstance, featureId: number, option?: { server_id: string; role_id: string; }): Promise>; /** * 获取当前登录用户参与某个玩法的记录 * * 💡当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=NFDdV1dwWb */ export declare function getUserEngagements(this: ApiInstance, featureId: number, option?: { /** 单页返回的最大数量,默认 20 */ max_results?: number; next_token?: string; /** * 是否返回参与奖记录,默认 false */ return_rewards?: boolean; /** * 当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录 */ server_id?: string; /** * 当玩法的 engage_account_type 为 role_id 时,可提供 server_id 和 role_id 获取具体角色的参与记录 */ role_id?: string; }, requestOptions?: RequestOptions): Promise<{ engagements: import("./event.engage").UserEngagement[]; next_token: string; }>; /** * 用户参与某个玩法 * * 💡可以设置泛型参数来快速确定 engagementParam 数据类型和返回值 * * 💡需要先调用 `visit` 接口提交访问信息 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=vuOyrcry3S */ export declare function engage(this: ApiInstance, featureId: number, engagementParam: InferEngagementParam, option?: { /** * 联的游戏账号 ID,如果传该参数后端需验证 player_id 是否从属于当前用户。 * * 参考 club 模块的 getPlayers 方法 */ player_id?: string; server_id?: string; server_name?: string; role_id?: string; role_name?: string; avatar_url?: string; }, requestOptions?: RequestOptions): Promise; }>; /** * 用户领取除红包和实物奖励以外的所有奖励 * * @deprecated 请优先使用 `claimRewardsV2` 接口 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=lCGuqgvUDP */ export declare function claimRewards(this: ApiInstance, params: { /** 用户参与记录 ID */ engagement_id: number; /** 产生奖励的来源 */ reward_source: RewardSource; /** 游戏服务器 ID,领取游戏道具时为必填 */ server_id?: string | number; /** 游戏角色 ID,领取游戏道具时为必填 */ role_id?: string; /** 游戏角色名 */ role_name?: string; }, requestOptions?: RequestOptions): Promise; /** * 填写实物奖励收货地址,返回 null 表示未登录 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=QIwGhnaexb */ export declare function submitUserRewardAddress(this: ApiInstance, option: { /** 用户奖励记录 id */ reward_id: number; /** @deprecated 即将废弃,请勿再使用 */ address_id?: number; /** 收件人称呼 */ recipient: string; /** 收件人手机号 */ mobile: string; /** 收件地址所在省 */ province: string; /** 收件地址所在市 */ city: string; /** 收件地址所在街道 */ district: string; /** 详细收货地址 */ address: string; }, requestOptions?: RequestOptions): Promise; /** * 小程序码携带参数最多 32 个可见字符,若前端携带参数过长,则将参数保存在 api 中,并返回符合小程序码要求的 scene * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=TbEeyUmZzN * * @param params - 前端扫描二维码打开小程序所需参数 */ export declare function getUnlimitQrcodeScene(this: ApiInstance, params: string, requestOptions?: RequestOptions): Promise; /** * 根据小程序码携带 scene 值,获取对应的前端所需参数 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=SzWPFZDQBV * * @param scene - 小程序码 scene 值 */ export declare function getParamsByQrcodeScene(this: ApiInstance, scene: string, requestOptions?: RequestOptions): Promise; /** * 生成不限制的带参数的小程序码(dataURI 格式的小程序码图片) * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=Rvmoq8iIy0 */ export declare function generateUnlimitQrcode(this: ApiInstance, option: { /** 小程序 appid */ app_id: string; /** * 小程序码所携带参数 * * https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/qr-code/getUnlimitedQRCode.html#%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0 */ scene: string; page?: string; /** * 检查 page 是否存在;检查时小程序必须已发布,且 page 存在。 * * 0 默认检查 1 检查 2 不检查 */ check_path?: 0 | 1 | 2; /** * 扫描小程序码打开的小程序版本,默认是正式版 * * - release 正式版小程序 * - trial 体验版小程序 * - develop 开发版小程序 */ env_version?: "release" | "trial" | "develop"; /** 小程序码的宽度,单位:px,最小 280,最大 1280,默认 430 */ width?: number; /** 小程序码自动配置线条颜色 */ auto_color?: boolean; /** 小程序码线条颜色,autoColor 为 false 时生效,使用 rgb 设置颜色 */ line_color?: { r?: string; g?: string; b?: string; }; /** 生成的小程序码是否需要透明底色 */ is_hyaline?: boolean; }, requestOptions?: RequestOptions): Promise; /** * 本接口用于获取任务玩法的实时进度数据,支持部分任务进度的查询:累计充值金额 / 累计游戏内活跃值 / 账号等级目标 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=ZAnm12d3f0 */ export declare function getQuestProgress(this: ApiInstance, featureId: number, option?: { /** 游戏服务器 ID,quest 玩法的 game_task_gm objective 必传。 */ server_id?: string; role_id?: string; }, requestOptions?: RequestOptions): Promise; /** * 产生投票(vote2)玩法获得的奖励,并非发放给用户;领取需要调用 claimRewardsV2 * * path: event/vote2/rewards * * https://www.kdocs.cn/l/chlVWKom7DzU?linkname=fabGKteIEK */ export declare function vote2Rewards(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 查询投票(vote2)玩法排行榜数据 * * https://www.kdocs.cn/l/chlVWKom7DzU?linkname=cYZMVXbP4u */ export declare function getVote2Leaderboard(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 批量查询用户在 vote2 玩法中的投票结果 * * https://www.kdocs.cn/l/chlVWKom7DzU?linkname=PGyDufvRjq */ export declare function getUserVotes(this: ApiInstance, featureId: number, userIds: string[], requestOptions?: RequestOptions): Promise<{ user_id: string; voted_candidates: import("./event.define").VoteCandidateSummary[]; }[]>; /** * 充值返还玩法的查询接口,查询返还数据 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=yNolN2sWp4 */ export declare function getCashbackQuery(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 获取当前登录用户的投稿记录 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF */ export declare function getUgcRecord(this: ApiInstance, option: { /** 按照多个活动 ID 批量查询投稿记录,以逗号分隔。若传入此参数,不再进行单活动/玩法的精确匹配*/ event_ids?: string; /** 单个活动 ID */ event_id?: number; /** 活动玩法 ID */ feature_id?: number; /** 审核状态 不传即查询所有状态的记录 */ review_status?: UgcReviewStatus; /** 查询返回最大参与记录数 默认20*/ max_results?: number; /** 分页标识,不传默认首页查询 */ next_token?: string; }, requestOptions?: RequestOptions): Promise; /** * 查询用户投稿数量 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=U0sYIGPzDk */ export declare function getUgcMyCount(this: ApiInstance, option: { /** 活动 ID 列表,多个用逗号分隔。若不传,则统计所有活动。*/ event_ids?: string; }, requestOptions?: RequestOptions): Promise<{ total_count: number; } | { message: string; error: RequestInternalError | "event_not_found"; } | null>; /** * 用户领取除红包和实物奖励以外的所有奖励 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=vdc4SrqXjF */ export declare function claimRewardsV2(this: ApiInstance, params: { /** 用户参与记录 ID */ engagement_id: number; /** 产生奖励的来源 */ reward_source: RewardSource; /** 游戏服务器 ID,领取游戏道具时为必填 */ server_id?: string | number; /** 游戏角色 ID,领取游戏道具时为必填 */ role_id?: string; /** 游戏角色名 */ role_name?: string; }, requestOptions?: RequestOptions): Promise; /** * 用户领取红包奖励 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=aQLhlOAB4Q */ export declare function claimWeixinHongbao(this: ApiInstance, rewardId: number, requestOptions?: RequestOptions): Promise<{ reward_status: import("./event.enums").ClaimRewardStatus; } | { message: string; error: RequestInternalError | "invalid_weixin_openid" | "event_not_started" | "event_already_ended" | "no_rewards_to_claim" | "reward_received" | "invalid_merchant_parameter" | "budget_not_enough"; }>; /** * 验证资格激活码有效性 * * https://kdocs.cn/l/cf2mO2uRLqh9?linkname=B4xwTbDzhn */ export declare function verifyActivationKey(this: ApiInstance, activationKey: string, requestOptions?: RequestOptions): Promise; /** * 查询用户活动奖励列表 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=qj12eIgYQG */ export declare function getUserRewards(this: ApiInstance, option: { /** 活动玩法 ID */ feature_id?: number; /** 奖励类型,不支持传递空奖励 `void_item` */ reward_types?: Exclude[]; /** 单次查询的数量,默认 20 */ max_results?: number; next_token?: string; reward_status?: RewardStatus; }, requestOptions?: RequestOptions): Promise<{ user_rewards: import("./event.engage").UserReward[]; next_token: string; }>; /** * 查询用户奖励数量,目前仅返回未领取的奖励数量 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=jrFbyZ3UWN */ export declare function getUserRewardsCount(this: ApiInstance, option: { /** 活动 ID 列表,多个用逗号分隔。若不传,则统计所有活动。*/ event_ids?: string; }, requestOptions?: RequestOptions): Promise<{ unclaimed: number; }>; /** * 查询用户活动道具数量。💡 注意,这里只能是活动道具 * * https://kdocs.cn/l/ckWFDcOsYEUA?linkname=mnGCTeTgMb */ export declare function getUserItemCount(this: ApiInstance, itemId: number, requestOptions?: RequestOptions): Promise; /** * 媒体资源预上传地址获取,为投稿玩法(UGC)提供 S3 预签名上传 URL,供用户客户端上传图片资源 * * 仅允许上传 image/jpeg 和 image/png 格式的图片。 * 图片会按照 event_id / feature_id 维度分目录存储在S3 对象存储中。 * 投稿玩法不调用任何第三方(网易易盾等)进行内容安全检测。 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=xhGGpJEbol */ export declare function ugcUploadImage(this: ApiInstance, featureId: number, option: { image_type: "png" | "jpg" | "jpeg"; /** 媒体文件大小 */ size: number; /** 媒体文件内容的 SHA-256 哈希值 用于校验上传对象的完整性 */ sha256: string; }, requestOptions?: RequestOptions): Promise<{ existed: boolean; upload_url: string | undefined; image_url: string; } | { message: string; error: RequestInternalError | "event_not_found" | "feature_not_found"; } | null>; /** * 获取推荐稿件列表,随机显示 N 条被接受的投稿记录 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=WzvcAPjHAh */ export declare function getUgcRecommendation(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 用于查询指定活动玩法下,所有已被接收 (review_status = accepted) 的用户投稿内容列表,默认按照投稿时间倒序。 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=VRYN6d3rbd */ export declare function getUgcs(this: ApiInstance, featureId: number, option?: { /** 单页返回的最大数量,默认 20 */ max_results?: number; next_token?: string; }, requestOptions?: RequestOptions): Promise; /** * 获取指定活动玩法的 UGC 投稿排行榜数据 * * 该接口仅在管理员在 Console 后台完成排行榜结算后才会返回有效数据。 * 结算前调用将返回空结果集。 * 排行榜结算通常在活动结束后由管理员在 Console 后台手动触发。 * 目前前端无法直接在投稿玩法中获得「是否已经结算」的状态。 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=KoB7S8omkC */ export declare function getUgcLeaderboard(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 查询兑换玩法的物品剩余库存(含用户可兑换数量) * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=gOqT9svLF7 */ export declare function getRedeemItemStocks(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; /** * 在裂变玩法中,生成阶梯奖励;奖励仍通过通用领奖接口领取 * * https://www.kdocs.cn/l/cdB3gn8J4a9S?linkname=JHR4LeqsmE */ export declare function generateReferralRewards(this: ApiInstance, featureId: number, params: { /** 游戏服务器 ID */ server_id?: string | number; /** 游戏角色 */ role_id?: string; }, requestOptions?: RequestOptions): Promise; /** * 查询受邀注册成功用户的 API。返回当前用户邀请且符合注册时间条件的用户列表,用于前端显示「谁受邀注册成功」。 * * https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=dye6j7ImUH */ export declare function getInvitedRegister(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise; export {};