@seayoo-web/gamer-api 2.0.12 → 2.0.14
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
|
@@ -640,6 +640,8 @@ const V = {
|
|
|
640
640
|
LotteryTicket: "lottery_ticket",
|
|
641
641
|
/** 积分 */
|
|
642
642
|
Credit: "credit",
|
|
643
|
+
/** 外部兑换码 */
|
|
644
|
+
ExternalCode: "external_gift_code",
|
|
643
645
|
/** 空奖励 */
|
|
644
646
|
VoidItem: "void_item"
|
|
645
647
|
}, Z = e.string().enum(V).lock(), Cr = V, W = Z, Ze = {
|
|
@@ -1019,6 +1021,8 @@ const V = {
|
|
|
1019
1021
|
engagement_id: e.number(),
|
|
1020
1022
|
feature_type: nt,
|
|
1021
1023
|
receive_time: e.number(),
|
|
1024
|
+
// https://kdocs.cn/l/ckWFDcOsYEUA?linkname=merUzJsVYH
|
|
1025
|
+
// 后续会格式化为具体的类型,此处的校验需要对应增加
|
|
1022
1026
|
extra_data: e.record(e.unknown()).optional()
|
|
1023
1027
|
}), sn = e.string().enum(h.Unknown, h.Pending), cn = e.union(
|
|
1024
1028
|
e.object({
|
|
@@ -1184,7 +1188,7 @@ class xr {
|
|
|
1184
1188
|
l(this, "token");
|
|
1185
1189
|
l(this, "event", 0);
|
|
1186
1190
|
l(this, "req");
|
|
1187
|
-
this.token = t, this.event = n, this.req = t.req;
|
|
1191
|
+
this.token = t, this.event = +n, this.req = t.req;
|
|
1188
1192
|
}
|
|
1189
1193
|
/**
|
|
1190
1194
|
* 根据手机号白名单,检查手机号是否允许登录某个游戏
|
|
@@ -1354,7 +1358,7 @@ class xr {
|
|
|
1354
1358
|
* https://kdocs.cn/l/ckWFDcOsYEUA?linkname=qj12eIgYQG
|
|
1355
1359
|
*/
|
|
1356
1360
|
async getUserRewards(t) {
|
|
1357
|
-
if (!await this.token.autoLogin()) return [];
|
|
1361
|
+
if (!await this.token.autoLogin()) return { user_rewards: [], next_token: "" };
|
|
1358
1362
|
const { data: n } = await this.req.post(
|
|
1359
1363
|
"event/user-rewards",
|
|
1360
1364
|
a({ max_results: 20, ...t, event_id: this.event }),
|
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.0.
|
|
4
|
+
"version": "2.0.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"author": "web@seayoo.com",
|
|
22
22
|
"license": "MIT",
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
"vitest": "^3.0.5",
|
|
26
26
|
"@seayoo-web/combo-webview": "^2.5.3",
|
|
27
27
|
"@seayoo-web/request": "^3.0.3",
|
|
28
|
-
"@seayoo-web/
|
|
29
|
-
"@seayoo-web/scripts": "^2.0.
|
|
30
|
-
"@seayoo-web/
|
|
28
|
+
"@seayoo-web/utils": "^3.4.4",
|
|
29
|
+
"@seayoo-web/scripts": "^2.0.3",
|
|
30
|
+
"@seayoo-web/tsconfig": "^1.0.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@seayoo-web/combo-webview": "^2.5.3",
|
|
34
|
-
"@seayoo-web/utils": "^3.4.4"
|
|
34
|
+
"@seayoo-web/utils": "^3.4.4",
|
|
35
|
+
"@seayoo-web/request": "^3.0.3"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"prebuild": "pnpm -F request build && pnpm -F combo-webview build",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InferType } from "@seayoo-web/utils";
|
|
2
2
|
import { type EventFeatureBaseConfig } from "./feature.base";
|
|
3
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"
|
|
3
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "credit" | "external_gift_code" | "void_item", false, false>;
|
|
4
4
|
declare const featureType: "lottery";
|
|
5
5
|
export interface FeatureLotteryItemConfig {
|
|
6
6
|
/** 抽奖奖励道具 id */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InferType } from "@seayoo-web/utils";
|
|
2
|
-
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"
|
|
2
|
+
declare const rewardItemTypeValidator: import("@seayoo-web/utils").StringValidator<"event_item" | "game_item" | "physical_item" | "weixin_hongbao" | "credit" | "external_gift_code" | "void_item", false, false>;
|
|
3
3
|
export interface EventRewardItemConfig {
|
|
4
4
|
/** 玩法奖励道具 id */
|
|
5
5
|
reward_item_id: number;
|
package/types/src/event.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class EventApi {
|
|
|
9
9
|
private token;
|
|
10
10
|
private event;
|
|
11
11
|
private req;
|
|
12
|
-
constructor(authToken: AuthToken, eventId: number);
|
|
12
|
+
constructor(authToken: AuthToken, eventId: number | string);
|
|
13
13
|
/**
|
|
14
14
|
* 根据手机号白名单,检查手机号是否允许登录某个游戏
|
|
15
15
|
*
|
|
@@ -164,7 +164,7 @@ export declare class EventApi {
|
|
|
164
164
|
/** 单次查询的数量,默认 20 */
|
|
165
165
|
max_results?: number;
|
|
166
166
|
next_token?: string;
|
|
167
|
-
}): Promise<
|
|
167
|
+
}): Promise<{
|
|
168
168
|
user_rewards: import("./event.engage").UserReward[];
|
|
169
169
|
next_token: string;
|
|
170
170
|
}>;
|
|
@@ -15,6 +15,8 @@ export declare const GamerItemType: {
|
|
|
15
15
|
readonly LotteryTicket: "lottery_ticket";
|
|
16
16
|
/** 积分 */
|
|
17
17
|
readonly Credit: "credit";
|
|
18
|
+
/** 外部兑换码 */
|
|
19
|
+
readonly ExternalCode: "external_gift_code";
|
|
18
20
|
/** 空奖励 */
|
|
19
21
|
readonly VoidItem: "void_item";
|
|
20
22
|
};
|
|
@@ -44,6 +46,8 @@ export declare const RewardItemType: {
|
|
|
44
46
|
readonly LotteryTicket: "lottery_ticket";
|
|
45
47
|
/** 积分 */
|
|
46
48
|
readonly Credit: "credit";
|
|
49
|
+
/** 外部兑换码 */
|
|
50
|
+
readonly ExternalCode: "external_gift_code";
|
|
47
51
|
/** 空奖励 */
|
|
48
52
|
readonly VoidItem: "void_item";
|
|
49
53
|
};
|