@seayoo-web/gamer-api 2.3.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/package.json +11 -4
  2. package/types/index.d.ts +5 -0
  3. package/types/src/club.define.d.ts +371 -0
  4. package/types/src/club.enums.d.ts +104 -0
  5. package/types/src/club.guards.d.ts +33 -0
  6. package/types/src/community.define.d.ts +331 -0
  7. package/types/src/community.enums.d.ts +99 -0
  8. package/types/src/community.guards.d.ts +52 -0
  9. package/types/src/event.config/feature.base.d.ts +23 -0
  10. package/types/src/event.config/feature.cashback.d.ts +18 -0
  11. package/types/src/event.config/feature.checkIn.d.ts +7 -0
  12. package/types/src/event.config/feature.claimActivationKey.d.ts +7 -0
  13. package/types/src/event.config/feature.claimRewards.d.ts +7 -0
  14. package/types/src/event.config/feature.comment.d.ts +14 -0
  15. package/types/src/event.config/feature.d.ts +40 -0
  16. package/types/src/event.config/feature.follow.d.ts +24 -0
  17. package/types/src/event.config/feature.giftcode.d.ts +24 -0
  18. package/types/src/event.config/feature.invite.d.ts +12 -0
  19. package/types/src/event.config/feature.invitedRegister.d.ts +7 -0
  20. package/types/src/event.config/feature.lotteryDraw.d.ts +14 -0
  21. package/types/src/event.config/feature.preregister.d.ts +7 -0
  22. package/types/src/event.config/feature.quest.d.ts +31 -0
  23. package/types/src/event.config/feature.register.d.ts +7 -0
  24. package/types/src/event.config/feature.share.d.ts +16 -0
  25. package/types/src/event.config/feature.subscribe.d.ts +12 -0
  26. package/types/src/event.config/feature.survey.d.ts +14 -0
  27. package/types/src/event.config/feature.team.d.ts +14 -0
  28. package/types/src/event.config/feature.vote.d.ts +44 -0
  29. package/types/src/event.config/index.d.ts +23 -0
  30. package/types/src/event.define.d.ts +48 -0
  31. package/types/src/event.engage/engage.cashback.d.ts +9 -0
  32. package/types/src/event.engage/engage.claimActivationKey.d.ts +5 -0
  33. package/types/src/event.engage/engage.comment.d.ts +22 -0
  34. package/types/src/event.engage/engage.d.ts +49 -0
  35. package/types/src/event.engage/engage.giftcode.d.ts +5 -0
  36. package/types/src/event.engage/engage.invite.d.ts +9 -0
  37. package/types/src/event.engage/engage.lottery.d.ts +9 -0
  38. package/types/src/event.engage/engage.lotteryDraw.d.ts +40 -0
  39. package/types/src/event.engage/engage.lotteryDraw.reward.d.ts +38 -0
  40. package/types/src/event.engage/engage.preregister.d.ts +11 -0
  41. package/types/src/event.engage/engage.quest.d.ts +28 -0
  42. package/types/src/event.engage/engage.share.d.ts +9 -0
  43. package/types/src/event.engage/engage.subscribe.d.ts +14 -0
  44. package/types/src/event.engage/engage.survey.d.ts +7 -0
  45. package/types/src/event.engage/engage.team.d.ts +53 -0
  46. package/types/src/event.engage/engage.vote.d.ts +9 -0
  47. package/types/src/event.engage/reward.d.ts +52 -0
  48. package/types/src/event.enums.d.ts +392 -0
  49. package/types/src/event.guards.d.ts +38 -0
  50. package/types/src/token.d.ts +93 -0
  51. package/types/src/token.define.d.ts +31 -0
  52. package/types/src/token.guards.d.ts +5 -0
  53. package/types/src/utils.d.ts +12 -0
  54. package/types/src/weixin.define.d.ts +46 -0
  55. package/types/src/weixin.guards.d.ts +2 -0
@@ -0,0 +1,7 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "invited_register";
3
+ export type EventFeatureConfigOfInvitedRegister = EventFeatureBaseConfig & {
4
+ feature_type: typeof featureType;
5
+ };
6
+ export declare const EventFeatureConfigOfInvitedRegisterValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfInvitedRegister, false, false>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "lottery_draw";
3
+ export interface FeatureLotteryDrawConfig {
4
+ /** 可开奖起始时间 */
5
+ draw_not_before: number;
6
+ /** 可开奖结束时间 */
7
+ draw_not_after: number;
8
+ }
9
+ export type EventFeatureConfigOfLotteryDraw = EventFeatureBaseConfig & {
10
+ feature_type: typeof featureType;
11
+ config: FeatureLotteryDrawConfig;
12
+ };
13
+ export declare const EventFeatureConfigOfLotteryDrawValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfLotteryDraw, false, false>;
14
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "preregister";
3
+ export type EventFeatureConfigOfPreregister = EventFeatureBaseConfig & {
4
+ feature_type: typeof featureType;
5
+ };
6
+ export declare const EventFeatureConfigOfPreregisterValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfPreregister, false, false>;
7
+ export {};
@@ -0,0 +1,31 @@
1
+ import { type QuestObjective } from "../event.enums";
2
+ import { type EventFeatureBaseConfig } from "./feature.base";
3
+ declare const featureType: "quest";
4
+ export interface FeatureQuestConfig {
5
+ /** 任务目标 */
6
+ objective: QuestObjective;
7
+ /** 目标值 */
8
+ completion_value: number;
9
+ /** 团队任务配置 */
10
+ team?: {
11
+ /** 组队任务 ID */
12
+ feature_id?: number;
13
+ /** 目标值 */
14
+ completion_value: number;
15
+ };
16
+ /** 任务专用配置,取决于任务目标类型 */
17
+ config?: {
18
+ /** 当任务目标为 community_posts 和 community_comments 有效,表示关联的社区话题,可能无值 */
19
+ topic_id?: number;
20
+ /** 参与对局的玩家数量,当任务目标为 player_match_counts 和 player_match_days 有效,不小于 1 */
21
+ required_players?: number;
22
+ /** 单日对局次数,当任务目标为 player_match_days 有效,不小于 1 */
23
+ required_matches?: number;
24
+ };
25
+ }
26
+ export type EventFeatureConfigOfQuest = EventFeatureBaseConfig & {
27
+ feature_type: typeof featureType;
28
+ config: FeatureQuestConfig;
29
+ };
30
+ export declare const EventFeatureConfigOfQuestValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfQuest, false, false>;
31
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "register";
3
+ export type EventFeatureConfigOfRegister = EventFeatureBaseConfig & {
4
+ feature_type: typeof featureType;
5
+ };
6
+ export declare const EventFeatureConfigOfRegisterValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfRegister, false, false>;
7
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "share";
3
+ export interface FeatureShareConfig {
4
+ /** 分享玩法配置分享平台 */
5
+ share_platform: string;
6
+ /** 分享玩法配置跳转地址 */
7
+ jump_url?: string;
8
+ /** 分享玩法分享平台图标 */
9
+ icon_url?: string;
10
+ }
11
+ export type EventFeatureConfigOfShare = EventFeatureBaseConfig & {
12
+ feature_type: typeof featureType;
13
+ config: FeatureShareConfig;
14
+ };
15
+ export declare const EventFeatureConfigOfShareValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfShare, false, false>;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "weixin_subscribe";
3
+ export interface FeatureSubscribeConfig {
4
+ /** 一组微信订阅消息模版 ID */
5
+ weixin_template_ids: string[];
6
+ }
7
+ export type EventFeatureConfigOfSubscribe = EventFeatureBaseConfig & {
8
+ feature_type: typeof featureType;
9
+ config: FeatureSubscribeConfig;
10
+ };
11
+ export declare const EventFeatureConfigOfSubscribeValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfSubscribe, false, false>;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "survey";
3
+ export interface FeatureSurveyConfig {
4
+ /** 问卷 ID */
5
+ survey_id: string;
6
+ /** 问卷 url 地址 */
7
+ survey_url: string;
8
+ }
9
+ export type EventFeatureConfigOfSurvey = EventFeatureBaseConfig & {
10
+ feature_type: typeof featureType;
11
+ config: FeatureSurveyConfig;
12
+ };
13
+ export declare const EventFeatureConfigOfSurveyValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfSurvey, false, false>;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type EventFeatureBaseConfig } from "./feature.base";
2
+ declare const featureType: "team";
3
+ export interface FeatureTeamConfig {
4
+ /** 队伍最大成员数 */
5
+ max_members: number;
6
+ /** 队伍最小成员数 */
7
+ min_members: number;
8
+ }
9
+ export type EventFeatureConfigOfTeam = EventFeatureBaseConfig & {
10
+ feature_type: typeof featureType;
11
+ config: FeatureTeamConfig;
12
+ };
13
+ export declare const EventFeatureConfigOfTeamValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfTeam, false, false>;
14
+ export {};
@@ -0,0 +1,44 @@
1
+ import { type VoteOptionSource } from "../event.enums";
2
+ import { type EventFeatureBaseConfig } from "./feature.base";
3
+ import { type EventRewardItemConfig } from "./reward";
4
+ declare const featureType: "vote";
5
+ export interface FeatureVoteOption {
6
+ /** 选项标识 */
7
+ sn: string;
8
+ /** 选项名称 */
9
+ name: string;
10
+ /** 选项图片地址 */
11
+ img_urls?: string[];
12
+ /** 选项视频地址 */
13
+ video_urls?: string[];
14
+ /** 选项描述文本 */
15
+ descriptions?: string[];
16
+ /** 跳转地址 */
17
+ jump_url: string;
18
+ /** 选项投票数量 */
19
+ amount: number;
20
+ /** 选项是否入围 */
21
+ finalists: boolean;
22
+ /** 最后投票时间秒级时间戳 */
23
+ last_vote_time: number;
24
+ }
25
+ export interface FeatureVoteConfig {
26
+ /** 关联一个或多个投票玩法 ID */
27
+ vote_feature_ids: number[];
28
+ /** 关联一个或多个投稿玩法 ID */
29
+ submission_feature_ids: number[];
30
+ /** 入围数量 */
31
+ finalists_amount: number;
32
+ /** 选项来源 */
33
+ source: VoteOptionSource;
34
+ /** 投票选项配置 */
35
+ options: FeatureVoteOption[];
36
+ /** 投票入围后用户可获得的奖励 */
37
+ rewards: EventRewardItemConfig[];
38
+ }
39
+ export type EventFeatureConfigOfVote = EventFeatureBaseConfig & {
40
+ feature_type: typeof featureType;
41
+ config: FeatureVoteConfig;
42
+ };
43
+ export declare const EventFeatureConfigOfVoteValidator: import("@seayoo-web/utils").ObjectValidator<EventFeatureConfigOfVote, false, false>;
44
+ export {};
@@ -0,0 +1,23 @@
1
+ import { type EventFeatureConfig } from "./feature";
2
+ export * from "./feature";
3
+ export * from "./reward";
4
+ export interface EventConfig {
5
+ /** 活动名称 */
6
+ event_name: string;
7
+ /** 面向玩家的富文本活动规则 */
8
+ rules: string;
9
+ /** 活动开始时间 */
10
+ since: number;
11
+ /** 活动结束时间 */
12
+ until: number;
13
+ /** 活动访问人数 */
14
+ visit_count?: number;
15
+ /** 活动下玩法列表 */
16
+ features: EventFeatureConfig[];
17
+ }
18
+ export declare const EventConfigValidator: import("@seayoo-web/utils").ObjectValidator<EventConfig, false, false> & {
19
+ plain: never;
20
+ optional: never;
21
+ maybeNull: never;
22
+ lock: never;
23
+ };
@@ -0,0 +1,48 @@
1
+ import { type UserEngagementData, type EngageReward } from "./event.engage";
2
+ import { type ClaimRewardStatus } from "./event.enums";
3
+ export * from "./event.config";
4
+ export * from "./event.engage";
5
+ export interface VerifyMobileResult {
6
+ /** 手机号是否允许登录此游戏(游戏 ID 由 Request Header 的 Origin 或 Referer 决定) */
7
+ allowed: boolean;
8
+ /** 手机号是否已注册世游通行证 */
9
+ registered: boolean;
10
+ }
11
+ export declare const VerifyMobileResultValidator: import("@seayoo-web/utils").ObjectValidator<VerifyMobileResult, false, false>;
12
+ export interface UserFeatureStatus {
13
+ /** 玩法 ID */
14
+ feature_id: number;
15
+ /**
16
+ * 是否可参与玩法。false 代表当前已不可再参与。
17
+ *
18
+ * 💡注意这里的语义是已经达到了参与次数的上限,不能再调用 engage,而不是没有资格参与。
19
+ */
20
+ can_engage: boolean;
21
+ /** 是否有已获得但尚未领取的玩法参与奖励 */
22
+ has_unclaimed_rewards: boolean;
23
+ }
24
+ export declare const UserFeatureStatusValidator: import("@seayoo-web/utils").ObjectValidator<UserFeatureStatus, false, false>;
25
+ export interface EngageResponse {
26
+ /** 当前参与记录 ID */
27
+ engagement_id: number;
28
+ /** 用户玩法参与记录 */
29
+ engagement?: {
30
+ engagement_id: number;
31
+ sequence: number;
32
+ feature_id: number;
33
+ /** 附带的数据,由 feature_id 的类型决定 */
34
+ data?: UserEngagementData;
35
+ };
36
+ /** 用户参与玩法得到的奖励 */
37
+ rewards?: EngageReward[];
38
+ /** 参与玩法后是否需要微信扫码 */
39
+ scan?: boolean;
40
+ }
41
+ export declare const EngageResponseValidator: import("@seayoo-web/utils").ObjectValidator<EngageResponse, false, false>;
42
+ export interface ClaimedItem {
43
+ /** 用户奖励记录 id */
44
+ reward_id: number;
45
+ /** 领取后的奖励状态 */
46
+ reward_status: ClaimRewardStatus;
47
+ }
48
+ export declare const ClaimedItemValidator: import("@seayoo-web/utils").ObjectValidator<ClaimedItem, false, false>;
@@ -0,0 +1,9 @@
1
+ export interface CashbackEngagementData {
2
+ /** 用户充值订单总金额(分) */
3
+ order_total_amount: `${number}` | number;
4
+ /** 充值返还的总金额(分) */
5
+ cashback_total_amount: `${number}` | number;
6
+ /** 充值返还的总金额所对应的游戏道具数量 */
7
+ game_item_count: `${number}` | number;
8
+ }
9
+ export declare const CashbackEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<CashbackEngagementData, false, false>;
@@ -0,0 +1,5 @@
1
+ export interface ClaimActivationKeyEngagementData {
2
+ /** 激活码 */
3
+ activation_key: string;
4
+ }
5
+ export declare const ClaimActivationKeyEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<ClaimActivationKeyEngagementData, false, false>;
@@ -0,0 +1,22 @@
1
+ /** 评论玩法的参与记录 */
2
+ export interface CommentEngagement {
3
+ /** 用户世游通行证 ID */
4
+ user_id: string;
5
+ /** 用户昵称 */
6
+ name: string;
7
+ /** 用户头像地址 */
8
+ avatar_url: string;
9
+ /** 评论信息 */
10
+ comment: string;
11
+ /** 用户发布弹幕的视频点 */
12
+ video_note: number;
13
+ /** 用户发布弹幕的时间 */
14
+ created_at: number;
15
+ }
16
+ export declare const CommentEngagementValidator: import("@seayoo-web/utils").ObjectValidator<CommentEngagement, false, false>;
17
+ export interface CommentEngagementParam {
18
+ /** 用户发送弹幕内容 */
19
+ comment: string;
20
+ /** 用户发布弹幕的视频点 */
21
+ video_note?: number;
22
+ }
@@ -0,0 +1,49 @@
1
+ import { type CashbackEngagementData } from "./engage.cashback";
2
+ import { type ClaimActivationKeyEngagementData } from "./engage.claimActivationKey";
3
+ import { type GiftCodeEngagementData } from "./engage.giftcode";
4
+ import { type InviteEngagementData } from "./engage.invite";
5
+ import { type LotteryEngagementData } from "./engage.lottery";
6
+ import { type LotteryDrawEngagementData } from "./engage.lotteryDraw";
7
+ import { type PreregisterEngagementData } from "./engage.preregister";
8
+ import { type QuestEngagementData } from "./engage.quest";
9
+ import { type ShareEngagementData } from "./engage.share";
10
+ import { type WeixinSubscribeEngagementData } from "./engage.subscribe";
11
+ import { type SurveyEngagementData } from "./engage.survey";
12
+ import { type TeamEngagementData } from "./engage.team";
13
+ import { type VoteEngagementData } from "./engage.vote";
14
+ export * from "./engage.cashback";
15
+ export * from "./engage.comment";
16
+ export * from "./engage.giftcode";
17
+ export * from "./engage.invite";
18
+ export * from "./engage.lottery";
19
+ export * from "./engage.lotteryDraw";
20
+ export * from "./engage.preregister";
21
+ export * from "./engage.quest";
22
+ export * from "./engage.share";
23
+ export * from "./engage.subscribe";
24
+ export * from "./engage.survey";
25
+ export * from "./engage.team";
26
+ export * from "./engage.vote";
27
+ export * from "./engage.claimActivationKey";
28
+ export type EmptyObject = Record<string | number | symbol, never>;
29
+ export type UserEngagementData = PreregisterEngagementData | LotteryEngagementData | SurveyEngagementData | InviteEngagementData | ShareEngagementData | VoteEngagementData | WeixinSubscribeEngagementData | CashbackEngagementData | GiftCodeEngagementData | TeamEngagementData | QuestEngagementData | LotteryDrawEngagementData | ClaimActivationKeyEngagementData | EmptyObject;
30
+ export declare const UserEngagementDataValidator: import("@seayoo-web/utils").UnionValidator<[import("@seayoo-web/utils").ObjectValidator<{
31
+ platforms: string[];
32
+ }, false, false>, import("@seayoo-web/utils").ObjectValidator<LotteryEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<{
33
+ serial_number: number;
34
+ }, false, false>, import("@seayoo-web/utils").ObjectValidator<InviteEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<ShareEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<VoteEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<WeixinSubscribeEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<CashbackEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<GiftCodeEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<TeamEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<QuestEngagementData, false, false>, import("@seayoo-web/utils").ObjectValidator<{
35
+ tickets: ({
36
+ ticket: /*elided*/ any;
37
+ status: /*elided*/ any;
38
+ } | {
39
+ ticket: /*elided*/ any;
40
+ status: /*elided*/ any;
41
+ reward: /*elided*/ any;
42
+ })[];
43
+ }, false, false>, import("@seayoo-web/utils").ObjectValidator<ClaimActivationKeyEngagementData, false, false>, import("@seayoo-web/utils").CustomValidator<EmptyObject, false, false>], false, false> & {
44
+ optional: never;
45
+ maybeNull: never;
46
+ key: never;
47
+ satisfies: never;
48
+ lock: never;
49
+ };
@@ -0,0 +1,5 @@
1
+ export interface GiftCodeEngagementData {
2
+ /** 礼包码 */
3
+ gift_code: string;
4
+ }
5
+ export declare const GiftCodeEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<GiftCodeEngagementData, false, false>;
@@ -0,0 +1,9 @@
1
+ export interface InviteEngagementData {
2
+ /** 被邀请人的世游通行证 ID */
3
+ user_id: string;
4
+ /** 被邀请人昵称 */
5
+ name?: string;
6
+ /** 被邀请人头像地址 */
7
+ avatar_url?: string;
8
+ }
9
+ export declare const InviteEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<InviteEngagementData, false, false>;
@@ -0,0 +1,9 @@
1
+ export interface LotteryEngagementData {
2
+ /** 用户抽奖次数 */
3
+ lottery_count: number;
4
+ }
5
+ export declare const LotteryEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<LotteryEngagementData, false, false>;
6
+ export interface LotteryEngagementParam {
7
+ /** 用户抽奖次数 */
8
+ lottery_count: number;
9
+ }
@@ -0,0 +1,40 @@
1
+ import { type InferType } from "@seayoo-web/utils";
2
+ import { LotteryTicketStatus, type LotteryDrawAction } from "../event.enums";
3
+ import { type UserReward } from "./engage.lotteryDraw.reward";
4
+ export * from "./engage.lotteryDraw.reward";
5
+ declare const noRewardStatus: import("@seayoo-web/utils").StringValidator<"unknown" | "pending", false, false>;
6
+ export type LotteryDrawTicket = {
7
+ /** 抽奖券 */
8
+ ticket: string;
9
+ /** 抽奖券状态 */
10
+ status: InferType<typeof noRewardStatus>;
11
+ } | {
12
+ /** 抽奖券 */
13
+ ticket: string;
14
+ /** 抽奖券状态 */
15
+ status: Exclude<LotteryTicketStatus, InferType<typeof noRewardStatus>>;
16
+ /** 抽奖券奖励物品,status = drawn 时 reward_id = 0 */
17
+ reward: UserReward;
18
+ };
19
+ export interface LotteryDrawEngagementData {
20
+ tickets: LotteryDrawTicket[];
21
+ }
22
+ export declare const LotteryDrawEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<{
23
+ tickets: ({
24
+ ticket: /*elided*/ any;
25
+ status: /*elided*/ any;
26
+ } | {
27
+ ticket: /*elided*/ any;
28
+ status: /*elided*/ any;
29
+ reward: /*elided*/ any;
30
+ })[];
31
+ }, false, false>;
32
+ export type LotteryDrawEngagementParam = {
33
+ /** 参与抽奖券的动作类型 */
34
+ action: Exclude<LotteryDrawAction, typeof LotteryDrawAction.Claim>;
35
+ } | {
36
+ /** 参与抽奖券的动作类型 */
37
+ action: typeof LotteryDrawAction.Claim;
38
+ /** 抽奖券 */
39
+ ticket: string;
40
+ };
@@ -0,0 +1,38 @@
1
+ import { type ClaimRewardStatus, type FeatureType, type GamerItemType, type RewardSource } from "../event.enums";
2
+ export interface UserReward {
3
+ /** 用户奖励记录 id */
4
+ reward_id: number;
5
+ /** 奖励道具 id */
6
+ reward_item_id: number;
7
+ /** 产生奖励的来源 */
8
+ reward_source: RewardSource;
9
+ /** 奖励道具名称 */
10
+ reward_item_name: string;
11
+ /** 奖励道具类型 */
12
+ reward_item_type: GamerItemType;
13
+ /** 奖励道具图片地址 */
14
+ reward_item_icon_url: string;
15
+ /** 奖励道具描述 */
16
+ reward_item_desc?: string;
17
+ /** 奖励道具评级,用于前端展示 */
18
+ reward_item_rating: number;
19
+ /** 奖励道具数量 */
20
+ reward_amount: number;
21
+ /** 奖励状态 */
22
+ reward_status: ClaimRewardStatus;
23
+ /** 活动 ID */
24
+ event_id: number;
25
+ /** 活动名称 */
26
+ event_name: string;
27
+ /** 活动玩法 ID */
28
+ feature_id: number;
29
+ /** 参与记录 ID */
30
+ engagement_id: number;
31
+ /** 玩法类型 */
32
+ feature_type: FeatureType;
33
+ /** 领奖时间 */
34
+ receive_time: number;
35
+ /** 提供额外扩展信息,比如收获地址等 */
36
+ extra_data?: Record<string, unknown>;
37
+ }
38
+ export declare const UserRewardValidator: import("@seayoo-web/utils").ObjectValidator<UserReward, false, false>;
@@ -0,0 +1,11 @@
1
+ export interface PreregisterEngagementData {
2
+ /** 用户预约平台 */
3
+ platforms: string[];
4
+ }
5
+ export declare const PreregisterEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<{
6
+ platforms: string[];
7
+ }, false, false>;
8
+ export interface PreregisterEngagementParam {
9
+ /** 用户预约平台 */
10
+ platforms: string[];
11
+ }
@@ -0,0 +1,28 @@
1
+ import { type QuestObjective } from "../event.enums";
2
+ export interface QuestEngagementData {
3
+ /** 任务目标 */
4
+ objective: QuestObjective;
5
+ /** 个人任务进度值 */
6
+ progress: number;
7
+ /** 个人任务目标值 */
8
+ completion_value?: number;
9
+ /** 组队任务进度信息 */
10
+ team?: {
11
+ /** 进度值 */
12
+ progress: number;
13
+ /** 目标值 */
14
+ completion_value?: number;
15
+ /** 队伍信息 */
16
+ players: {
17
+ /** 用户 id,含当前用户 */
18
+ user_id: number;
19
+ /** 角色名 */
20
+ role_name: string;
21
+ /** 是否为队长 */
22
+ is_leader: boolean;
23
+ /** 进度值 */
24
+ progress?: number;
25
+ }[];
26
+ };
27
+ }
28
+ export declare const QuestEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<QuestEngagementData, false, false>;
@@ -0,0 +1,9 @@
1
+ export interface ShareEngagementData {
2
+ /** 用户分享到对应的平台 */
3
+ platform: string;
4
+ }
5
+ export declare const ShareEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<ShareEngagementData, false, false>;
6
+ export interface ShareEngagementParam {
7
+ /** 用户分享到对应的平台 */
8
+ platform: string;
9
+ }
@@ -0,0 +1,14 @@
1
+ export interface WeixinSubscribeEngagementData {
2
+ weixin_openid: string;
3
+ }
4
+ export declare const WeixinSubscribeEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<WeixinSubscribeEngagementData, false, false>;
5
+ export interface SubscribeEngagementParam {
6
+ /**
7
+ * 小程序调用 wx.requestSubscribeMessage 并收到 success 回调后,得到的订阅结果。
8
+ *
9
+ * - key 为模版 ID
10
+ *
11
+ * - value 为订阅结果。示例 `accept` `reject` `ban` `filter`
12
+ */
13
+ subscribe_results: Record<string, string>;
14
+ }
@@ -0,0 +1,7 @@
1
+ export interface SurveyEngagementData {
2
+ /** 用户填写问卷流水号 */
3
+ serial_number: number;
4
+ }
5
+ export declare const SurveyEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<{
6
+ serial_number: number;
7
+ }, false, false>;
@@ -0,0 +1,53 @@
1
+ import { type TeamAction, type TeamVisibility } from "../event.enums";
2
+ /** 组队玩法的参与记录 */
3
+ export interface TeamEngagement {
4
+ /** 组队码 */
5
+ team_code: string;
6
+ /** 队长角色名称 */
7
+ leader_name: string;
8
+ /** 队员数量 */
9
+ total_members: number;
10
+ }
11
+ export declare const TeamEngagementValidator: import("@seayoo-web/utils").ObjectValidator<TeamEngagement, false, false>;
12
+ export interface TeamMember {
13
+ /** 是否为队长 */
14
+ is_leader: boolean;
15
+ /** 是否为当前登录用户 */
16
+ is_myself?: boolean;
17
+ /** 角色名 */
18
+ role_name: string;
19
+ /** 服务器名 */
20
+ server_name: string;
21
+ }
22
+ export declare const TeamMemberValidator: import("@seayoo-web/utils").ObjectValidator<TeamMember, false, false>;
23
+ export interface TeamEngagementData {
24
+ /** 组队码 */
25
+ team_code: string;
26
+ /** 队伍可见性 */
27
+ visibility: TeamVisibility;
28
+ /** 队员信息 */
29
+ members: TeamMember[];
30
+ }
31
+ export declare const TeamEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<TeamEngagementData, false, false>;
32
+ export type TeamEngagementParam = {
33
+ /** 操作类型 */
34
+ action: typeof TeamAction.ChangeVisibility;
35
+ /** 组队码 */
36
+ team_code: string;
37
+ /** 设置队伍的可见性 */
38
+ visibility: TeamVisibility;
39
+ } | {
40
+ /** 操作类型 */
41
+ action: typeof TeamAction.Assemble;
42
+ /** 设置队伍的可见性 */
43
+ visibility?: TeamVisibility;
44
+ } | {
45
+ action: typeof TeamAction.Join | typeof TeamAction.Disband;
46
+ /** 组队码 */
47
+ team_code: string;
48
+ } | {
49
+ /** 操作类型 */
50
+ action: typeof TeamAction.Query;
51
+ /** 组队码 */
52
+ team_code?: string;
53
+ };
@@ -0,0 +1,9 @@
1
+ export interface VoteEngagementData {
2
+ /** 用户投票选项 */
3
+ option_sn: string;
4
+ }
5
+ export declare const VoteEngagementDataValidator: import("@seayoo-web/utils").ObjectValidator<VoteEngagementData, false, false>;
6
+ export interface VoteEngagementParam {
7
+ /** 选项的 sn */
8
+ option_sn: string;
9
+ }
@@ -0,0 +1,52 @@
1
+ import { RewardItemType, type RewardSource, type RewardStatusSuffix } from "../event.enums";
2
+ import { type UserEngagementData } from "./engage";
3
+ export interface Reward {
4
+ /** 用户奖励记录 id */
5
+ reward_id: number;
6
+ /** 奖励道具 id */
7
+ reward_item_id: number;
8
+ /** 奖励道具类型 */
9
+ reward_item_type: RewardItemType;
10
+ /** 奖励道具数量 */
11
+ reward_count: number;
12
+ /** 奖励状态 */
13
+ reward_status: RewardStatusSuffix;
14
+ /** 奖励来源 */
15
+ reward_source: RewardSource;
16
+ /** 奖励道具名称 */
17
+ reward_item_name: string;
18
+ /** 奖励道具图片地址 */
19
+ reward_item_icon_url: string;
20
+ /** 奖励道具描述 */
21
+ reward_item_desc?: string;
22
+ /** 奖励道具评级,用于前端展示 */
23
+ reward_item_rating: number;
24
+ /** 领奖时间 */
25
+ receive_time: number;
26
+ /** 提供额外扩展信息 */
27
+ extra_data?: UserEngagementData | Record<string, unknown>;
28
+ }
29
+ export declare const RewardValidator: import("@seayoo-web/utils").ObjectValidator<Reward, false, false>;
30
+ export interface EngageReward {
31
+ /** 用户奖励记录 id(微信红包类型奖励需要前端请求一次领奖 api) */
32
+ reward_id: number;
33
+ /** 奖励道具 id */
34
+ reward_item_id: number;
35
+ /** 奖励道具名称 */
36
+ reward_item_name: string;
37
+ /** 奖励道具类型 */
38
+ reward_item_type: RewardItemType;
39
+ /** 奖励道具图片地址 */
40
+ reward_item_icon_url: string;
41
+ /** 奖励道具描述 */
42
+ reward_item_desc?: string;
43
+ /** 奖励道具数量 */
44
+ reward_amount: number;
45
+ /** 奖励状态 */
46
+ reward_status: RewardStatusSuffix;
47
+ /** 产生奖励的来源 */
48
+ reward_source: RewardSource;
49
+ /** 提供额外扩展信息,例如:礼包码的值等 */
50
+ extra_data?: Record<string, unknown>;
51
+ }
52
+ export declare const EngageRewardValidator: import("@seayoo-web/utils").ObjectValidator<EngageReward, false, false>;