@seayoo-web/gamer-api 2.12.1 → 2.12.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.
package/dist/index.js
CHANGED
|
@@ -875,7 +875,7 @@ const v = {
|
|
|
875
875
|
Huya: "huya",
|
|
876
876
|
/** 斗鱼 */
|
|
877
877
|
Douyu: "douyu"
|
|
878
|
-
}, ne = e.string().enum(yt).
|
|
878
|
+
}, ne = e.string().enum(yt).lock(), ht = {
|
|
879
879
|
/** 已提交 */
|
|
880
880
|
Submitted: "submitted",
|
|
881
881
|
/** 已接收 */
|
|
@@ -1227,7 +1227,7 @@ const v = {
|
|
|
1227
1227
|
title: e.string(),
|
|
1228
1228
|
content: e.string().optional(),
|
|
1229
1229
|
image_urls: e.array(e.string()).optional(),
|
|
1230
|
-
social_media: ne,
|
|
1230
|
+
social_media: ne.clone().optional(),
|
|
1231
1231
|
social_media_url: e.string().optional()
|
|
1232
1232
|
}), Dn = e.object({
|
|
1233
1233
|
ugcs: e.array(
|
|
@@ -1237,7 +1237,7 @@ const v = {
|
|
|
1237
1237
|
title: e.string(),
|
|
1238
1238
|
content: e.string().optional(),
|
|
1239
1239
|
image_urls: e.array(e.string()).optional(),
|
|
1240
|
-
social_media: ne,
|
|
1240
|
+
social_media: ne.clone().optional(),
|
|
1241
1241
|
social_media_url: e.string().optional(),
|
|
1242
1242
|
server_id: e.number().optional(),
|
|
1243
1243
|
server_name: e.string().optional(),
|
|
@@ -1245,7 +1245,7 @@ const v = {
|
|
|
1245
1245
|
role_name: e.string().optional(),
|
|
1246
1246
|
total_likes: e.number().optional()
|
|
1247
1247
|
})
|
|
1248
|
-
),
|
|
1248
|
+
).optional(),
|
|
1249
1249
|
next_token: e.string().optional()
|
|
1250
1250
|
}), In = e.object({
|
|
1251
1251
|
existed: e.bool(),
|
|
@@ -1804,6 +1804,7 @@ class ua {
|
|
|
1804
1804
|
const { data: r, code: a, message: o } = await this.req.get("event/ugc/my", hr, {
|
|
1805
1805
|
...n,
|
|
1806
1806
|
params: {
|
|
1807
|
+
max_results: 20,
|
|
1807
1808
|
...t,
|
|
1808
1809
|
event_id: this.event
|
|
1809
1810
|
/** 查询返回最大参与记录数 */
|
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.12.
|
|
4
|
+
"version": "2.12.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.13.1",
|
|
33
33
|
"@seayoo-web/combo-webview": "2.8.0",
|
|
34
|
-
"@seayoo-web/request": "3.4.0",
|
|
35
|
-
"@seayoo-web/scripts": "3.1.5",
|
|
36
34
|
"@seayoo-web/tsconfig": "1.0.5",
|
|
35
|
+
"@seayoo-web/scripts": "3.1.5",
|
|
37
36
|
"@seayoo-web/utils": "4.1.3",
|
|
37
|
+
"@seayoo-web/request": "3.4.0",
|
|
38
38
|
"@seayoo-web/validator": "1.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@seayoo-web/utils": "^4.1.3",
|
|
42
41
|
"@seayoo-web/combo-webview": "^2.8.0",
|
|
43
|
-
"@seayoo-web/validator": "^1.1.1"
|
|
42
|
+
"@seayoo-web/validator": "^1.1.1",
|
|
43
|
+
"@seayoo-web/utils": "^4.1.3"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prebuild": "pnpm -F validator build && pnpm -F request build && pnpm -F combo-webview build",
|
package/types/src/event.d.ts
CHANGED
|
@@ -345,8 +345,8 @@ export declare class EventApi {
|
|
|
345
345
|
*/
|
|
346
346
|
getUgcRecord(option: {
|
|
347
347
|
feature_id: number;
|
|
348
|
-
/** 查询返回最大参与记录数 */
|
|
349
|
-
max_results
|
|
348
|
+
/** 查询返回最大参与记录数 默认20*/
|
|
349
|
+
max_results?: number;
|
|
350
350
|
/** 分页标识,不传默认首页查询 */
|
|
351
351
|
next_token?: string;
|
|
352
352
|
}, requestOptions?: IRequestOptions): Promise<import("./event.engage").UgcRecordResponse | {
|
|
@@ -454,7 +454,16 @@ export declare const UgcSocialMedia: {
|
|
|
454
454
|
readonly Douyu: "douyu";
|
|
455
455
|
};
|
|
456
456
|
export type UgcSocialMedia = ValueOf<typeof UgcSocialMedia>;
|
|
457
|
-
export declare const UgcSocialMediaValidator: import("@seayoo-web/validator").StringValidator<
|
|
457
|
+
export declare const UgcSocialMediaValidator: import("@seayoo-web/validator").StringValidator<UgcSocialMedia, false, false> & {
|
|
458
|
+
pattern: never;
|
|
459
|
+
url: never;
|
|
460
|
+
dataUri: never;
|
|
461
|
+
enum: never;
|
|
462
|
+
disallow: never;
|
|
463
|
+
optional: never;
|
|
464
|
+
maybeNull: never;
|
|
465
|
+
lock: never;
|
|
466
|
+
};
|
|
458
467
|
/** 投稿活动的稿件的审核状态 */
|
|
459
468
|
export declare const UgcReviewStatus: {
|
|
460
469
|
/** 已提交 */
|
|
@@ -1,228 +0,0 @@
|
|
|
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
|
-
}
|