@seayoo-web/gamer-api 2.11.1 → 2.12.1
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.
- package/dist/index.js +560 -444
- package/package.json +6 -6
- package/types/src/event.config/feature.d.ts +4 -2
- package/types/src/event.config/feature.lottery.d.ts +1 -1
- package/types/src/event.config/feature.ugc.d.ts +15 -0
- package/types/src/event.config/reward.d.ts +1 -1
- package/types/src/event.config.d.ts +228 -0
- package/types/src/event.d.ts +43 -2
- package/types/src/event.engage/engage.d.ts +5 -2
- package/types/src/event.engage/engage.ugc.d.ts +75 -0
- package/types/src/event.engage/index.d.ts +3 -3
- package/types/src/event.enums.d.ts +41 -0
- package/types/src/event.guards.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/gamer-api",
|
|
3
3
|
"description": "agent for gamer api",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.12.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.13.1",
|
|
33
|
-
"@seayoo-web/
|
|
33
|
+
"@seayoo-web/combo-webview": "2.8.0",
|
|
34
34
|
"@seayoo-web/request": "3.4.0",
|
|
35
|
-
"@seayoo-web/
|
|
35
|
+
"@seayoo-web/scripts": "3.1.5",
|
|
36
36
|
"@seayoo-web/tsconfig": "1.0.5",
|
|
37
37
|
"@seayoo-web/utils": "4.1.3",
|
|
38
38
|
"@seayoo-web/validator": "1.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@seayoo-web/
|
|
42
|
-
"@seayoo-web/combo-webview": "^2.
|
|
43
|
-
"@seayoo-web/
|
|
41
|
+
"@seayoo-web/utils": "^4.1.3",
|
|
42
|
+
"@seayoo-web/combo-webview": "^2.8.0",
|
|
43
|
+
"@seayoo-web/validator": "^1.1.1"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prebuild": "pnpm -F validator build && pnpm -F request build && pnpm -F combo-webview build",
|
|
@@ -16,6 +16,7 @@ import type { EventFeatureConfigOfShare } from "./feature.share";
|
|
|
16
16
|
import type { EventFeatureConfigOfSubscribe } from "./feature.subscribe";
|
|
17
17
|
import type { EventFeatureConfigOfSurvey } from "./feature.survey";
|
|
18
18
|
import type { EventFeatureConfigOfTeam } from "./feature.team";
|
|
19
|
+
import type { EventFeatureConfigOfUgc } from "./feature.ugc";
|
|
19
20
|
import type { EventFeatureConfigOfVote } from "./feature.vote";
|
|
20
21
|
import type { EventFeatureConfigOfVote2 } from "./feature.vote2";
|
|
21
22
|
import type { EventFeatureConfigOfZeroChatgpt } from "./feature.zeroChatgpt";
|
|
@@ -39,5 +40,6 @@ export * from "./feature.team";
|
|
|
39
40
|
export * from "./feature.vote";
|
|
40
41
|
export * from "./feature.vote2";
|
|
41
42
|
export * from "./feature.claimActivationKey";
|
|
42
|
-
export
|
|
43
|
-
export
|
|
43
|
+
export * from "./feature.ugc";
|
|
44
|
+
export type EventFeatureConfig = EventFeatureConfigOfCashback | EventFeatureConfigOfCheckIn | EventFeatureConfigOfClaimRewards | EventFeatureConfigOfComment | EventFeatureConfigOfFollow | EventFeatureConfigOfGiftCode | EventFeatureConfigOfInvite | EventFeatureConfigOfInvitedRegister | EventFeatureConfigOfLottery | EventFeatureConfigOfLotteryDraw | EventFeatureConfigOfPreregister | EventFeatureConfigOfQuest | EventFeatureConfigOfRegister | EventFeatureConfigOfShare | EventFeatureConfigOfSubscribe | EventFeatureConfigOfSurvey | EventFeatureConfigOfTeam | EventFeatureConfigOfVote | EventFeatureConfigOfVote2 | EventFeatureConfigOfClaimActivationKey | EventFeatureConfigOfZeroChatgpt | EventFeatureConfigOfUgc;
|
|
45
|
+
export declare const EventFeatureConfigValidator: import("@seayoo-web/validator").UnionValidator<[import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfCashback, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfCheckIn, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfClaimRewards, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfComment, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfFollow, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfGiftCode, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfInvite, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfInvitedRegister, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfLottery, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfLotteryDraw, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfPreregister, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfQuest, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfRegister, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfShare, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfSubscribe, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfSurvey, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfTeam, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfVote, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfVote2, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfClaimActivationKey, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfZeroChatgpt, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfUgc, false, false>], false, false>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EventFeatureBaseConfig } from "./feature.base";
|
|
2
2
|
import type { InferType } from "@seayoo-web/validator";
|
|
3
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"
|
|
3
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "activation_key" | "credit" | "external_gift_code" | "void_item", false, false>;
|
|
4
4
|
declare const featureType: "lottery";
|
|
5
5
|
export interface FeatureLotteryItemConfig {
|
|
6
6
|
/** 抽奖奖励道具 id */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EventFeatureBaseConfig } from "./feature.base";
|
|
2
|
+
import type { EventRewardItemConfig } from "./reward";
|
|
3
|
+
declare const featureType: "ugc";
|
|
4
|
+
export interface FeatureUgcConfig {
|
|
5
|
+
/** 允许的社交媒体,未配置时表示不限制 */
|
|
6
|
+
allowed_social_medias?: string[];
|
|
7
|
+
/** 审核通过后发放的投稿通过奖励内容 */
|
|
8
|
+
acceptance_rewards?: EventRewardItemConfig[];
|
|
9
|
+
}
|
|
10
|
+
export type EventFeatureConfigOfUgc = EventFeatureBaseConfig & {
|
|
11
|
+
feature_type: typeof featureType;
|
|
12
|
+
config: FeatureUgcConfig;
|
|
13
|
+
};
|
|
14
|
+
export declare const EventFeatureConfigOfUgcValidator: import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfUgc, false, false>;
|
|
15
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InferType } from "@seayoo-web/validator";
|
|
2
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"
|
|
2
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/validator").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "gift_code" | "activation_key" | "lottery_ticket" | "credit" | "external_gift_code" | "void_item", false, false>;
|
|
3
3
|
export interface EventRewardItemConfig {
|
|
4
4
|
/** 玩法奖励道具 id */
|
|
5
5
|
reward_item_id: number;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { type GamerItemType, EngageAccountType, EventPeriodType, FeatureType, QuestObjective, VoteOptionSource } from "./event.enums";
|
|
2
|
+
export interface EventConfig {
|
|
3
|
+
/** 活动名称 */
|
|
4
|
+
event_name: string;
|
|
5
|
+
/** 面向玩家的富文本活动规则 */
|
|
6
|
+
rules: string;
|
|
7
|
+
/** 活动开始时间 */
|
|
8
|
+
since: number;
|
|
9
|
+
/** 活动结束时间 */
|
|
10
|
+
until: number;
|
|
11
|
+
/** 活动访问人数 */
|
|
12
|
+
visit_count?: number;
|
|
13
|
+
/** 活动下玩法列表 */
|
|
14
|
+
features: EventFeatureConfig[];
|
|
15
|
+
}
|
|
16
|
+
export declare function isEventConfig(data: unknown): data is EventConfig;
|
|
17
|
+
export type EventFeatureConfig = EventFeatureBaseConfig<FeatureType.Preregister, NoopFeatureConfig> | EventFeatureBaseConfig<FeatureType.Lottery, FeatureLotteryConfig> | EventFeatureBaseConfig<FeatureType.Survey, FeatureSurveyConfig> | EventFeatureBaseConfig<FeatureType.Invite, FeatureInviteConfig> | EventFeatureBaseConfig<FeatureType.Share, FeatureShareConfig> | EventFeatureBaseConfig<FeatureType.Follow, FeatureFollowConfig> | EventFeatureBaseConfig<FeatureType.Subscribe, FeatureSubscribeConfig> | EventFeatureBaseConfig<FeatureType.Comment, FeatureCommentConfig> | EventFeatureBaseConfig<FeatureType.Vote, FeatureVoteConfig> | EventFeatureBaseConfig<FeatureType.Cashback, FeatureCashbackConfig> | EventFeatureBaseConfig<FeatureType.GiftCode, FeatureGiftCodeConfig> | EventFeatureBaseConfig<FeatureType.Register, NoopFeatureConfig> | EventFeatureBaseConfig<FeatureType.InvitedRegister, NoopFeatureConfig> | EventFeatureBaseConfig<FeatureType.ClaimRewards, NoopFeatureConfig> | EventFeatureBaseConfig<FeatureType.Quest, FeatureQuestConfig> | EventFeatureBaseConfig<FeatureType.Team, FeatureTeamConfig> | EventFeatureBaseConfig<FeatureType.LotteryDraw, FeatureLotteryDrawConfig> | EventFeatureBaseConfig<FeatureType.CheckIn, NoopFeatureConfig>;
|
|
18
|
+
export interface EventRewardItemConfig {
|
|
19
|
+
/** 玩法奖励道具 id */
|
|
20
|
+
reward_item_id: number;
|
|
21
|
+
/** 玩法奖励道具数量 */
|
|
22
|
+
reward_amount: number;
|
|
23
|
+
/** 玩法奖励道具名称 */
|
|
24
|
+
reward_item_name: string;
|
|
25
|
+
/** 玩法奖励道具图片地址 */
|
|
26
|
+
reward_item_icon_url: string;
|
|
27
|
+
/** 玩法奖励道具描述 */
|
|
28
|
+
reward_item_desc?: string;
|
|
29
|
+
/** 玩法奖励道具类型 */
|
|
30
|
+
reward_item_type: Exclude<GamerItemType, GamerItemType.GiftCode | GamerItemType.LotteryTicket>;
|
|
31
|
+
/** 奖励道具评级,用于前端展示 */
|
|
32
|
+
reward_item_rating: number;
|
|
33
|
+
}
|
|
34
|
+
export interface RegularReward {
|
|
35
|
+
engage_count: number;
|
|
36
|
+
rewards: EventRewardItemConfig[];
|
|
37
|
+
}
|
|
38
|
+
export type FeatureReward = {
|
|
39
|
+
feature_reward_type: "every";
|
|
40
|
+
reward_details: EventRewardItemConfig[];
|
|
41
|
+
} | {
|
|
42
|
+
feature_reward_type: "regular";
|
|
43
|
+
reward_details: RegularReward[];
|
|
44
|
+
};
|
|
45
|
+
export type NoopFeatureConfig = {} | null;
|
|
46
|
+
export interface EventFeatureBaseConfig<T extends FeatureType = FeatureType, C extends object | null = object> {
|
|
47
|
+
/** 玩法名称 */
|
|
48
|
+
feature_name: string;
|
|
49
|
+
/** 玩法 Id */
|
|
50
|
+
feature_id: number;
|
|
51
|
+
/** 玩法描述 */
|
|
52
|
+
description: string;
|
|
53
|
+
/** 玩法类型 */
|
|
54
|
+
feature_type: T;
|
|
55
|
+
/** 玩法配置 */
|
|
56
|
+
config?: C;
|
|
57
|
+
/** 玩法周期,即每多长时间可参与一次 */
|
|
58
|
+
cycle: EventPeriodType;
|
|
59
|
+
/** 允许的最大参与次数 */
|
|
60
|
+
limit: number;
|
|
61
|
+
/** 玩法开始时间 */
|
|
62
|
+
since: number;
|
|
63
|
+
/** 玩法结束时间 */
|
|
64
|
+
until: number;
|
|
65
|
+
/** 参与玩法维度账号类型 */
|
|
66
|
+
engage_account: EngageAccountType;
|
|
67
|
+
/** 玩法参与奖励 */
|
|
68
|
+
feature_rewards?: FeatureReward;
|
|
69
|
+
}
|
|
70
|
+
export interface FeatureLotteryItemConfig {
|
|
71
|
+
/** 抽奖奖励道具 id */
|
|
72
|
+
reward_item_id: number;
|
|
73
|
+
/** 抽奖奖励道具名称 */
|
|
74
|
+
reward_item_name: string;
|
|
75
|
+
/** 抽奖奖励道具类型 */
|
|
76
|
+
reward_item_type: Exclude<GamerItemType, GamerItemType.GiftCode | GamerItemType.LotteryTicket>;
|
|
77
|
+
/** 抽奖奖励道具图片地址 */
|
|
78
|
+
reward_item_icon_url: string;
|
|
79
|
+
/** 抽奖奖励道具描述 */
|
|
80
|
+
reward_item_desc?: string;
|
|
81
|
+
/** 抽奖奖励道具数量 */
|
|
82
|
+
reward_amount: number;
|
|
83
|
+
/** 抽奖奖励道具库存 */
|
|
84
|
+
reward_remaining_stock: number;
|
|
85
|
+
}
|
|
86
|
+
export interface FeatureLotteryConfig {
|
|
87
|
+
/** 抽奖消耗道具 id */
|
|
88
|
+
consume_item_id: number;
|
|
89
|
+
/** 抽奖消耗道具名称 */
|
|
90
|
+
consume_item_name: number;
|
|
91
|
+
/** 抽奖消耗道具图片地址 */
|
|
92
|
+
consume_item_icon_url: string;
|
|
93
|
+
/** 抽奖消耗道具数量配置 */
|
|
94
|
+
consume_item_count: number;
|
|
95
|
+
/** 抽奖消耗道具描述 */
|
|
96
|
+
consume_item_desc?: string;
|
|
97
|
+
/** 抽奖配置奖励列表 */
|
|
98
|
+
rewards: FeatureLotteryItemConfig[];
|
|
99
|
+
}
|
|
100
|
+
export interface FeatureSurveyConfig {
|
|
101
|
+
/** 问卷 ID */
|
|
102
|
+
survey_id: string;
|
|
103
|
+
/** 问卷 url 地址 */
|
|
104
|
+
survey_url: string;
|
|
105
|
+
}
|
|
106
|
+
export interface FeatureInviteConfig {
|
|
107
|
+
/** 邀请玩法配置分享链接 */
|
|
108
|
+
share_url: string;
|
|
109
|
+
}
|
|
110
|
+
export interface FeatureShareConfig {
|
|
111
|
+
/** 分享玩法配置分享平台 */
|
|
112
|
+
share_platform: string;
|
|
113
|
+
/** 分享玩法配置跳转地址 */
|
|
114
|
+
jump_url?: string;
|
|
115
|
+
/** 分享玩法分享平台图标 */
|
|
116
|
+
icon_url?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface FeatureFollowConfig {
|
|
119
|
+
/**
|
|
120
|
+
* 社交媒体平台的标识
|
|
121
|
+
*
|
|
122
|
+
* 比如 "bilibili", "douyin", "xiaohongshu", "weibo", "weixin_official_account", "qq"
|
|
123
|
+
*/
|
|
124
|
+
platform: string;
|
|
125
|
+
/** 社交媒体平台 icon */
|
|
126
|
+
platform_icon?: string;
|
|
127
|
+
/** 跳转链接 */
|
|
128
|
+
link?: string;
|
|
129
|
+
/** 二维码链接地址 */
|
|
130
|
+
qr_code_url?: string;
|
|
131
|
+
/** 社交媒体平台描述 */
|
|
132
|
+
platform_desc?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface FeatureSubscribeConfig {
|
|
135
|
+
/** 一组微信订阅消息模版 ID */
|
|
136
|
+
weixin_template_ids: string[];
|
|
137
|
+
}
|
|
138
|
+
export interface FeatureCommentConfig {
|
|
139
|
+
/** 活动配置的弹幕信息,用于快捷选择 */
|
|
140
|
+
comments: string[];
|
|
141
|
+
/** 发送频率限制,单位:秒 */
|
|
142
|
+
send_rate: number;
|
|
143
|
+
}
|
|
144
|
+
export interface FeatureVoteConfig {
|
|
145
|
+
/** 关联一个或多个投票玩法 ID */
|
|
146
|
+
vote_feature_ids: number[];
|
|
147
|
+
/** 关联一个或多个投稿玩法 ID */
|
|
148
|
+
submission_feature_ids: number[];
|
|
149
|
+
/** 入围数量 */
|
|
150
|
+
finalists_amount: number;
|
|
151
|
+
/** 选项来源 */
|
|
152
|
+
source: VoteOptionSource;
|
|
153
|
+
/** 投票选项配置 */
|
|
154
|
+
options: FeatureVoteOption[];
|
|
155
|
+
/** 投票入围后用户可获得的奖励 */
|
|
156
|
+
rewards: EventRewardItemConfig[];
|
|
157
|
+
}
|
|
158
|
+
export interface FeatureVoteOption {
|
|
159
|
+
/** 选项标识 */
|
|
160
|
+
sn: string;
|
|
161
|
+
/** 选项名称 */
|
|
162
|
+
name: string;
|
|
163
|
+
/** 选项图片地址 */
|
|
164
|
+
img_urls?: string[];
|
|
165
|
+
/** 选项视频地址 */
|
|
166
|
+
video_urls?: string[];
|
|
167
|
+
/** 选项描述文本 */
|
|
168
|
+
descriptions?: string[];
|
|
169
|
+
/** 跳转地址 */
|
|
170
|
+
jump_url: string;
|
|
171
|
+
/** 选项投票数量 */
|
|
172
|
+
amount: number;
|
|
173
|
+
/** 选项是否入围 */
|
|
174
|
+
finalists: boolean;
|
|
175
|
+
/** 最后投票时间秒级时间戳 */
|
|
176
|
+
last_vote_time: number;
|
|
177
|
+
}
|
|
178
|
+
export interface FeatureCashbackConfig {
|
|
179
|
+
/** 计算充值总额的开始时间 */
|
|
180
|
+
order_start_time: number;
|
|
181
|
+
/** 计算充值总额的结束时间 */
|
|
182
|
+
order_end_time: number;
|
|
183
|
+
/** 可领取充值返还奖励的开始时间 */
|
|
184
|
+
claim_rewards_start_time: number;
|
|
185
|
+
/** 可领取充值返还奖励的结束时间 */
|
|
186
|
+
claim_rewards_end_time: number;
|
|
187
|
+
}
|
|
188
|
+
export interface FeatureGiftCodeConfig {
|
|
189
|
+
/** 用于前端显示礼包码兑换后会获得的奖励内容 */
|
|
190
|
+
gift_items: EventGiftItemConfig[];
|
|
191
|
+
/** 社媒平台链接 */
|
|
192
|
+
mp_url?: string;
|
|
193
|
+
/** 社媒平台二维码 */
|
|
194
|
+
mp_qrcode_url?: string;
|
|
195
|
+
}
|
|
196
|
+
export interface EventGiftItemConfig {
|
|
197
|
+
/** 用于前端展示的游戏道具名称 */
|
|
198
|
+
name: string;
|
|
199
|
+
/** 用于前端展示的游戏道具图片地址 */
|
|
200
|
+
icon_url: string;
|
|
201
|
+
/** 用于前端展示的游戏道具数量 */
|
|
202
|
+
count: number;
|
|
203
|
+
}
|
|
204
|
+
export interface FeatureQuestConfig {
|
|
205
|
+
/** 任务目标 */
|
|
206
|
+
objective: QuestObjective;
|
|
207
|
+
/** 目标值 */
|
|
208
|
+
completion_value: number;
|
|
209
|
+
/** 团队任务配置 */
|
|
210
|
+
team?: {
|
|
211
|
+
/** 组队任务 ID */
|
|
212
|
+
feature_id?: number;
|
|
213
|
+
/** 目标值 */
|
|
214
|
+
completion_value: number;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export interface FeatureTeamConfig {
|
|
218
|
+
/** 队伍最大成员数 */
|
|
219
|
+
max_members: number;
|
|
220
|
+
/** 队伍最小成员数 */
|
|
221
|
+
min_members: number;
|
|
222
|
+
}
|
|
223
|
+
export interface FeatureLotteryDrawConfig {
|
|
224
|
+
/** 可开奖起始时间 */
|
|
225
|
+
draw_not_before: number;
|
|
226
|
+
/** 可开奖结束时间 */
|
|
227
|
+
draw_not_after: number;
|
|
228
|
+
}
|
package/types/src/event.d.ts
CHANGED
|
@@ -313,11 +313,13 @@ export declare class EventApi {
|
|
|
313
313
|
error: RequestInternalError | "invalid_token" | "feature_not_found";
|
|
314
314
|
} | null>;
|
|
315
315
|
/**
|
|
316
|
-
*
|
|
316
|
+
* 产生投票(vote2)玩法获得的奖励,并非发放给用户;领取需要调用 claimRewardsV2
|
|
317
|
+
*
|
|
318
|
+
* path: event/vote2/rewards
|
|
317
319
|
*
|
|
318
320
|
* https://www.kdocs.cn/l/chlVWKom7DzU?linkname=fabGKteIEK
|
|
319
321
|
*/
|
|
320
|
-
|
|
322
|
+
vote2Rewards(featureId: number, requestOptions?: IRequestOptions): Promise<import("./event.engage").Vote2ClaimRewardsResponse | {
|
|
321
323
|
message: string;
|
|
322
324
|
code: RequestInternalError | "vote_rewards_not_started" | "vote_rewards_already_ended" | "engagement_not_found";
|
|
323
325
|
} | null>;
|
|
@@ -336,4 +338,43 @@ export declare class EventApi {
|
|
|
336
338
|
message: string;
|
|
337
339
|
error: RequestInternalError | "event_not_found" | "feature_not_found";
|
|
338
340
|
} | null>;
|
|
341
|
+
/**
|
|
342
|
+
* 获取当前登录用户的投稿记录
|
|
343
|
+
*
|
|
344
|
+
* https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=biEwrNKhAF
|
|
345
|
+
*/
|
|
346
|
+
getUgcRecord(option: {
|
|
347
|
+
feature_id: number;
|
|
348
|
+
/** 查询返回最大参与记录数 */
|
|
349
|
+
max_results: number;
|
|
350
|
+
/** 分页标识,不传默认首页查询 */
|
|
351
|
+
next_token?: string;
|
|
352
|
+
}, requestOptions?: IRequestOptions): Promise<import("./event.engage").UgcRecordResponse | {
|
|
353
|
+
message: string;
|
|
354
|
+
error: RequestInternalError | "event_not_found" | "feature_not_found";
|
|
355
|
+
} | null>;
|
|
356
|
+
/**
|
|
357
|
+
* 媒体资源预上传地址获取,为投稿玩法(UGC)提供 S3 预签名上传 URL,供用户客户端上传图片资源
|
|
358
|
+
*
|
|
359
|
+
* 仅允许上传 image/jpeg 和 image/png 格式的图片。
|
|
360
|
+
* 图片会按照 event_id / feature_id 维度分目录存储在S3 对象存储中。
|
|
361
|
+
* 投稿玩法不调用任何第三方(网易易盾等)进行内容安全检测。
|
|
362
|
+
*
|
|
363
|
+
* https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=xhGGpJEbol
|
|
364
|
+
*/
|
|
365
|
+
ugcUploadImage(option: {
|
|
366
|
+
feature_id: number;
|
|
367
|
+
image_type: "png" | "jpg" | "jpeg";
|
|
368
|
+
/** 媒体文件大小 */
|
|
369
|
+
size: number;
|
|
370
|
+
/** 媒体文件内容的 SHA-256 哈希值 用于校验上传对象的完整性 */
|
|
371
|
+
sha256: string;
|
|
372
|
+
}, requestOptions?: IRequestOptions): Promise<{
|
|
373
|
+
existed: boolean;
|
|
374
|
+
upload_url: string | undefined;
|
|
375
|
+
image_url: string;
|
|
376
|
+
} | {
|
|
377
|
+
message: string;
|
|
378
|
+
code: RequestInternalError | "event_not_found" | "feature_not_found";
|
|
379
|
+
} | null>;
|
|
339
380
|
}
|
|
@@ -10,6 +10,7 @@ import type { ShareEngagementData } from "./engage.share";
|
|
|
10
10
|
import type { WeixinSubscribeEngagementData } from "./engage.subscribe";
|
|
11
11
|
import type { SurveyEngagementData } from "./engage.survey";
|
|
12
12
|
import type { TeamEngagementData } from "./engage.team";
|
|
13
|
+
import type { UgcEngagementData } from "./engage.ugc";
|
|
13
14
|
import type { VoteEngagementData } from "./engage.vote";
|
|
14
15
|
import type { Vote2EngagementData } from "./engage.vote2";
|
|
15
16
|
import type { ZeroChatGPTData } from "./engage.zeroChatGPT";
|
|
@@ -28,8 +29,10 @@ export * from "./engage.team";
|
|
|
28
29
|
export * from "./engage.vote";
|
|
29
30
|
export * from "./engage.vote2";
|
|
30
31
|
export * from "./engage.claimActivationKey";
|
|
32
|
+
export * from "./engage.zeroChatGPT";
|
|
33
|
+
export * from "./engage.ugc";
|
|
31
34
|
export type EmptyObject = Record<string | number | symbol, never>;
|
|
32
|
-
export type UserEngagementData = PreregisterEngagementData | LotteryEngagementData | SurveyEngagementData | InviteEngagementData | ShareEngagementData | VoteEngagementData | Vote2EngagementData | WeixinSubscribeEngagementData | CashbackEngagementData | GiftCodeEngagementData | TeamEngagementData | QuestEngagementData | LotteryDrawEngagementData | ClaimActivationKeyEngagementData | ZeroChatGPTData | EmptyObject;
|
|
35
|
+
export type UserEngagementData = PreregisterEngagementData | LotteryEngagementData | SurveyEngagementData | InviteEngagementData | ShareEngagementData | VoteEngagementData | Vote2EngagementData | WeixinSubscribeEngagementData | CashbackEngagementData | GiftCodeEngagementData | TeamEngagementData | QuestEngagementData | LotteryDrawEngagementData | ClaimActivationKeyEngagementData | ZeroChatGPTData | UgcEngagementData | EmptyObject;
|
|
33
36
|
export declare const UserEngagementDataValidator: import("@seayoo-web/validator").UnionValidator<[import("@seayoo-web/validator").ObjectValidator<{
|
|
34
37
|
platforms: string[];
|
|
35
38
|
}, false, false>, import("@seayoo-web/validator").ObjectValidator<LotteryEngagementData, false, false>, import("@seayoo-web/validator").ObjectValidator<{
|
|
@@ -48,7 +51,7 @@ export declare const UserEngagementDataValidator: import("@seayoo-web/validator"
|
|
|
48
51
|
role: /*elided*/ any;
|
|
49
52
|
content: /*elided*/ any;
|
|
50
53
|
}[];
|
|
51
|
-
}, false, false>, import("@seayoo-web/validator").CustomValidator<EmptyObject, false, false>], false, false> & {
|
|
54
|
+
}, false, false>, import("@seayoo-web/validator").ObjectValidator<UgcEngagementData, false, false>, import("@seayoo-web/validator").CustomValidator<EmptyObject, false, false>], false, false> & {
|
|
52
55
|
optional: never;
|
|
53
56
|
maybeNull: never;
|
|
54
57
|
key: never;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UgcReviewStatus } from "../event.enums";
|
|
2
|
+
import type { UgcSocialMedia } from "../event.enums";
|
|
3
|
+
export type UgcEngagementParam = {
|
|
4
|
+
/** 标题 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 正文 */
|
|
7
|
+
content?: string;
|
|
8
|
+
/** 图片 URL 列表 */
|
|
9
|
+
image_urls?: string[];
|
|
10
|
+
/** 媒体平台 */
|
|
11
|
+
social_media?: UgcSocialMedia;
|
|
12
|
+
/** 社交媒体上的链接地址 */
|
|
13
|
+
social_media_url?: string;
|
|
14
|
+
};
|
|
15
|
+
export interface UgcEngagementData {
|
|
16
|
+
/** 投稿记录 ID */
|
|
17
|
+
ugc_id: string;
|
|
18
|
+
/** 标题 */
|
|
19
|
+
title: string;
|
|
20
|
+
/** 描述 */
|
|
21
|
+
content?: string;
|
|
22
|
+
/** 图片 URL 列表 */
|
|
23
|
+
image_urls?: string[];
|
|
24
|
+
/** 媒体平台 */
|
|
25
|
+
social_media?: UgcSocialMedia;
|
|
26
|
+
/** 社交媒体上的链接地址 */
|
|
27
|
+
social_media_url?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const UgcEngagementDataValidator: import("@seayoo-web/validator").ObjectValidator<UgcEngagementData, false, false>;
|
|
30
|
+
export interface UgcRecord {
|
|
31
|
+
/** 投稿记录 ID */
|
|
32
|
+
ugc_id: number;
|
|
33
|
+
/** 状态 */
|
|
34
|
+
review_status: UgcReviewStatus;
|
|
35
|
+
/** 标题 */
|
|
36
|
+
title: string;
|
|
37
|
+
/** 描述 */
|
|
38
|
+
content?: string;
|
|
39
|
+
/** 图片 URL 列表 */
|
|
40
|
+
image_urls?: string[];
|
|
41
|
+
/** 媒体平台 */
|
|
42
|
+
social_media?: UgcSocialMedia;
|
|
43
|
+
/** 社交媒体上的链接地址 */
|
|
44
|
+
social_media_url?: string;
|
|
45
|
+
/** 服务器 ID */
|
|
46
|
+
server_id?: number;
|
|
47
|
+
/** 服务器名称 */
|
|
48
|
+
server_name?: string;
|
|
49
|
+
/** 角色 ID */
|
|
50
|
+
role_id?: string;
|
|
51
|
+
/** 角色名称 */
|
|
52
|
+
role_name?: string;
|
|
53
|
+
/** 投稿记录获得的总赞数 */
|
|
54
|
+
total_likes?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface UgcRecordResponse {
|
|
57
|
+
/** 稿件列表 */
|
|
58
|
+
ugcs: Array<UgcRecord>;
|
|
59
|
+
/** 分页标识,返回空表示后续没有数据了 */
|
|
60
|
+
next_token?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare const UgcRecordResponseValidator: import("@seayoo-web/validator").ObjectValidator<UgcRecordResponse, false, false>;
|
|
63
|
+
export interface UgcUploadImageResponse {
|
|
64
|
+
/** 图片是否已存在,已存在无需上传。 */
|
|
65
|
+
existed: boolean;
|
|
66
|
+
/** 图片的临时上传地址(有效期 5min)。 */
|
|
67
|
+
upload_url?: string;
|
|
68
|
+
/** 图片的访问地址。 */
|
|
69
|
+
image_url: string;
|
|
70
|
+
}
|
|
71
|
+
export declare const UgcUploadImageValidator: import("@seayoo-web/validator").ObjectValidator<{
|
|
72
|
+
existed: boolean;
|
|
73
|
+
upload_url: string | undefined;
|
|
74
|
+
image_url: string;
|
|
75
|
+
}, false, false>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UserEngagementData, CommentEngagementParam, PreregisterEngagementParam, LotteryEngagementParam, LotteryDrawEngagementParam, ShareEngagementParam, SubscribeEngagementParam, TeamEngagementParam, VoteEngagementParam, Vote2EngagementParam, Vote2EngagementError, LotteryEngagementError, ClaimActivationKeyEngagementError, LotteryDrawEngagementError, TeamEngagementError, GiftCodeEngagementError } from "./engage";
|
|
1
|
+
import type { UserEngagementData, CommentEngagementParam, PreregisterEngagementParam, LotteryEngagementParam, LotteryDrawEngagementParam, ShareEngagementParam, SubscribeEngagementParam, TeamEngagementParam, VoteEngagementParam, Vote2EngagementParam, UgcEngagementParam, Vote2EngagementError, LotteryEngagementError, ClaimActivationKeyEngagementError, LotteryDrawEngagementError, TeamEngagementError, GiftCodeEngagementError } from "./engage";
|
|
2
2
|
import type { Reward } from "./reward";
|
|
3
3
|
import type { FeatureType } from "../event.enums";
|
|
4
4
|
import type { ZeroChatGPTEngagementParam } from "./engage.zeroChatGPT";
|
|
@@ -32,12 +32,12 @@ export declare const UserEngagementValidator: import("@seayoo-web/validator").Ob
|
|
|
32
32
|
/**
|
|
33
33
|
* 部分玩法参与时需要提供的参数
|
|
34
34
|
*/
|
|
35
|
-
export type EngagementParam = null | PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | Vote2EngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam | ZeroChatGPTEngagementParam;
|
|
35
|
+
export type EngagementParam = null | PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | Vote2EngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam | ZeroChatGPTEngagementParam | UgcEngagementParam;
|
|
36
36
|
export type EngagementFeatureType = FeatureType | unknown;
|
|
37
37
|
/**
|
|
38
38
|
* 根据玩法类型推导需要提交的参数数据类型
|
|
39
39
|
*/
|
|
40
|
-
export type InferEngagementParam<T extends EngagementFeatureType> = [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam : [T] extends ["vote"] ? VoteEngagementParam : [T] extends ["vote2"] ? Vote2EngagementParam : [T] extends ["weixin_subscribe"] ? SubscribeEngagementParam : [T] extends ["team"] ? TeamEngagementParam : [T] extends ["lottery_draw"] ? LotteryDrawEngagementParam : [T] extends ["zero_chatgpt"] ? ZeroChatGPTEngagementParam : EngagementParam;
|
|
40
|
+
export type InferEngagementParam<T extends EngagementFeatureType> = [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam : [T] extends ["vote"] ? VoteEngagementParam : [T] extends ["vote2"] ? Vote2EngagementParam : [T] extends ["weixin_subscribe"] ? SubscribeEngagementParam : [T] extends ["team"] ? TeamEngagementParam : [T] extends ["lottery_draw"] ? LotteryDrawEngagementParam : [T] extends ["zero_chatgpt"] ? ZeroChatGPTEngagementParam : [T] extends ["ugc"] ? UgcEngagementParam : EngagementParam;
|
|
41
41
|
export type EngagementCommonError = "invalid_token" | "event_not_found" | "feature_not_found" | "visit_record_not_found" | "event_not_started" | "event_already_ended" | "engage_feature_reached_limit" | "invalid_merchant_parameter" | "budget_not_enough" | "combo_id_not_found";
|
|
42
42
|
export type EngagementError = EngagementCommonError | TeamEngagementError | Vote2EngagementError | ClaimActivationKeyEngagementError | LotteryDrawEngagementError | LotteryEngagementError | GiftCodeEngagementError;
|
|
43
43
|
/**
|
|
@@ -146,6 +146,8 @@ export declare const FeatureType: {
|
|
|
146
146
|
readonly ClaimActivationKey: "claim_activation_key";
|
|
147
147
|
/** 不朽箴言特有的 AI 聊天 */
|
|
148
148
|
readonly ZeroChatgpt: "zero_chatgpt";
|
|
149
|
+
/** 投稿 */
|
|
150
|
+
readonly Ugc: "ugc";
|
|
149
151
|
};
|
|
150
152
|
export type FeatureType = ValueOf<typeof FeatureType>;
|
|
151
153
|
export declare const FeatureTypeValidator: import("@seayoo-web/validator").StringValidator<FeatureType, false, false> & {
|
|
@@ -434,3 +436,42 @@ export declare const Vote2RewardTypeValidator: import("@seayoo-web/validator").S
|
|
|
434
436
|
maybeNull: never;
|
|
435
437
|
lock: never;
|
|
436
438
|
};
|
|
439
|
+
/** 投稿活动的社交媒体 */
|
|
440
|
+
export declare const UgcSocialMedia: {
|
|
441
|
+
/** 抖音 */
|
|
442
|
+
readonly Douyin: "douyin";
|
|
443
|
+
/** 小红书 */
|
|
444
|
+
readonly Xiaohongshu: "xiaohongshu";
|
|
445
|
+
/** Tap Tap */
|
|
446
|
+
readonly Taptap: "taptap";
|
|
447
|
+
/** B站 */
|
|
448
|
+
readonly Bilibili: "bilibili";
|
|
449
|
+
/** 微博 */
|
|
450
|
+
readonly Weibo: "weibo";
|
|
451
|
+
/** 虎牙 */
|
|
452
|
+
readonly Huya: "huya";
|
|
453
|
+
/** 斗鱼 */
|
|
454
|
+
readonly Douyu: "douyu";
|
|
455
|
+
};
|
|
456
|
+
export type UgcSocialMedia = ValueOf<typeof UgcSocialMedia>;
|
|
457
|
+
export declare const UgcSocialMediaValidator: import("@seayoo-web/validator").StringValidator<"douyin" | "xiaohongshu" | "taptap" | "bilibili" | "weibo" | "huya" | "douyu", true, false>;
|
|
458
|
+
/** 投稿活动的稿件的审核状态 */
|
|
459
|
+
export declare const UgcReviewStatus: {
|
|
460
|
+
/** 已提交 */
|
|
461
|
+
readonly Submitted: "submitted";
|
|
462
|
+
/** 已接收 */
|
|
463
|
+
readonly Accepted: "accepted";
|
|
464
|
+
/** 已拒绝 */
|
|
465
|
+
readonly Rejected: "rejected";
|
|
466
|
+
};
|
|
467
|
+
export type UgcReviewStatus = ValueOf<typeof UgcReviewStatus>;
|
|
468
|
+
export declare const UgcReviewStatusValidator: import("@seayoo-web/validator").StringValidator<UgcReviewStatus, false, false> & {
|
|
469
|
+
pattern: never;
|
|
470
|
+
url: never;
|
|
471
|
+
dataUri: never;
|
|
472
|
+
enum: never;
|
|
473
|
+
disallow: never;
|
|
474
|
+
optional: never;
|
|
475
|
+
maybeNull: never;
|
|
476
|
+
lock: never;
|
|
477
|
+
};
|
|
@@ -48,3 +48,9 @@ export declare const isVote2LeaderboardResponse: (data: unknown) => data is {
|
|
|
48
48
|
candidate_votes: import("./event.engage").CandidateVote[];
|
|
49
49
|
};
|
|
50
50
|
export declare const isCashbackQueryResponse: (data: unknown) => data is import("./event.engage").CashbackEngagementData;
|
|
51
|
+
export declare const isUgcResponse: (data: unknown) => data is import("./event.engage").UgcRecordResponse;
|
|
52
|
+
export declare const isUgcUploadImageResponse: (data: unknown) => data is {
|
|
53
|
+
existed: boolean;
|
|
54
|
+
upload_url: string | undefined;
|
|
55
|
+
image_url: string;
|
|
56
|
+
};
|