@seayoo-web/gamer-api 4.5.5 → 4.6.0
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 +203 -119
- package/package.json +6 -6
- package/types/src/event.methods.d.ts +5 -1
- package/types/src/ggd.d.ts +81 -2
- package/types/src/ggd.enum.d.ts +22 -0
- package/types/src/ggd.enums.d.ts +49 -0
package/dist/index.js
CHANGED
|
@@ -143,30 +143,30 @@ var p = "gamer_token", se = class {
|
|
|
143
143
|
let { data: t } = await this.req.post("auth-real-name", a(e), ie);
|
|
144
144
|
return t;
|
|
145
145
|
}
|
|
146
|
-
},
|
|
146
|
+
}, m = {
|
|
147
147
|
Unknown: "unknown",
|
|
148
148
|
Male: "male",
|
|
149
149
|
Female: "female"
|
|
150
|
-
},
|
|
150
|
+
}, ce = f.string().enum(m).lock(), le = {
|
|
151
151
|
Increase: "increase",
|
|
152
152
|
Decrease: "decrease",
|
|
153
153
|
Expired: "expired"
|
|
154
|
-
},
|
|
154
|
+
}, ue = f.string().enum(le).lock(), de = {
|
|
155
155
|
Order: "order",
|
|
156
156
|
Consumption: "consumption",
|
|
157
157
|
Redeem: "redeem",
|
|
158
158
|
Expire: "expire",
|
|
159
159
|
Admin: "admin",
|
|
160
160
|
Event: "event"
|
|
161
|
-
},
|
|
161
|
+
}, fe = f.string().enum(de).lock(), pe = {
|
|
162
162
|
GameReward: "game_reward",
|
|
163
163
|
Physical: "physical",
|
|
164
164
|
Virtual: "virtual"
|
|
165
|
-
},
|
|
165
|
+
}, h = f.string().enum(pe).lock(), me = {
|
|
166
166
|
Pending: "pending",
|
|
167
167
|
Issued: "issued",
|
|
168
168
|
Failed: "failed"
|
|
169
|
-
},
|
|
169
|
+
}, he = f.string().enum(me).lock(), ge = f.object({
|
|
170
170
|
default_avatar_url: f.string(),
|
|
171
171
|
official_avatar_urls: f.array(f.string()),
|
|
172
172
|
default_nickname: f.string(),
|
|
@@ -182,7 +182,7 @@ var p = "gamer_token", se = class {
|
|
|
182
182
|
exp_description: f.string(),
|
|
183
183
|
credit_description: f.string(),
|
|
184
184
|
send_role_mail_rate_limit: f.number()
|
|
185
|
-
}).lock(),
|
|
185
|
+
}).lock(), _e = f.object({
|
|
186
186
|
member_id: f.string(),
|
|
187
187
|
player_id: f.string(),
|
|
188
188
|
exp: f.number(),
|
|
@@ -191,28 +191,28 @@ var p = "gamer_token", se = class {
|
|
|
191
191
|
credit_expiring: f.number(),
|
|
192
192
|
level_change_time: f.number(),
|
|
193
193
|
level_expire_time: f.number()
|
|
194
|
-
}).lock(),
|
|
194
|
+
}).lock(), ve = f.object({
|
|
195
195
|
server_id: f.string(),
|
|
196
196
|
server_name: f.string()
|
|
197
|
-
}).lock(),
|
|
197
|
+
}).lock(), ye = f.object({
|
|
198
198
|
role_id: f.string(),
|
|
199
199
|
role_name: f.string()
|
|
200
|
-
}).lock(),
|
|
201
|
-
...be.shape,
|
|
200
|
+
}).lock(), g = f.object({
|
|
202
201
|
...ye.shape,
|
|
202
|
+
...ve.shape,
|
|
203
203
|
role_level: f.number(),
|
|
204
204
|
last_login_time: f.number()
|
|
205
|
-
}).lock(),
|
|
206
|
-
...
|
|
205
|
+
}).lock(), be = f.object({
|
|
206
|
+
...g.shape,
|
|
207
207
|
role_fighting: f.number(),
|
|
208
208
|
kin_id: f.string().optional(),
|
|
209
209
|
kin_name: f.string().optional(),
|
|
210
210
|
kin_position: f.string().optional()
|
|
211
|
-
}).lock(),
|
|
211
|
+
}).lock(), xe = f.object({
|
|
212
212
|
name: f.string(),
|
|
213
213
|
avatar_url: f.string(),
|
|
214
214
|
bio: f.string(),
|
|
215
|
-
gender:
|
|
215
|
+
gender: ce,
|
|
216
216
|
birthday: f.object({
|
|
217
217
|
year: f.number(),
|
|
218
218
|
month: f.number(),
|
|
@@ -222,7 +222,7 @@ var p = "gamer_token", se = class {
|
|
|
222
222
|
homepage_url: f.string(),
|
|
223
223
|
homepage_image_url: f.string()
|
|
224
224
|
}).optional()).optional()
|
|
225
|
-
}).lock(),
|
|
225
|
+
}).lock(), _ = f.object({
|
|
226
226
|
address_id: f.number(),
|
|
227
227
|
recipient: f.string(),
|
|
228
228
|
mobile: f.string(),
|
|
@@ -231,20 +231,20 @@ var p = "gamer_token", se = class {
|
|
|
231
231
|
district: f.string(),
|
|
232
232
|
address: f.string(),
|
|
233
233
|
is_default: f.bool()
|
|
234
|
-
}).lock(),
|
|
234
|
+
}).lock(), Se = f.object({
|
|
235
235
|
increased_credit: f.number(),
|
|
236
236
|
decreased_credit: f.number(),
|
|
237
237
|
expired_credit: f.number(),
|
|
238
238
|
balance_credit: f.number()
|
|
239
|
-
}).lock(),
|
|
239
|
+
}).lock(), Ce = f.object({
|
|
240
240
|
id: f.number(),
|
|
241
|
-
change_type:
|
|
242
|
-
change_scene:
|
|
241
|
+
change_type: ue,
|
|
242
|
+
change_scene: fe,
|
|
243
243
|
change_credit: f.number(),
|
|
244
244
|
balance: f.number(),
|
|
245
245
|
change_time: f.number(),
|
|
246
246
|
metadata: f.record(f.unknown()).optional()
|
|
247
|
-
}).lock(),
|
|
247
|
+
}).lock(), v = f.object({
|
|
248
248
|
benefit_id: f.number(),
|
|
249
249
|
name: f.string(),
|
|
250
250
|
img_url: f.string(),
|
|
@@ -253,11 +253,11 @@ var p = "gamer_token", se = class {
|
|
|
253
253
|
max_level: f.number(),
|
|
254
254
|
product_id: f.number(),
|
|
255
255
|
tag: f.string()
|
|
256
|
-
}).lock(),
|
|
256
|
+
}).lock(), y = f.object({
|
|
257
257
|
product_id: f.number(),
|
|
258
258
|
catalog_id: f.number(),
|
|
259
259
|
catalog_name: f.string(),
|
|
260
|
-
item_type:
|
|
260
|
+
item_type: h,
|
|
261
261
|
name: f.string(),
|
|
262
262
|
img_url: f.string(),
|
|
263
263
|
description: f.string(),
|
|
@@ -279,13 +279,13 @@ var p = "gamer_token", se = class {
|
|
|
279
279
|
created_at: f.number(),
|
|
280
280
|
updated_at: f.number(),
|
|
281
281
|
redeemable_quantity: f.number().optional()
|
|
282
|
-
}).lock(),
|
|
283
|
-
...r(
|
|
284
|
-
product:
|
|
285
|
-
}).lock(),
|
|
282
|
+
}).lock(), we = f.object({
|
|
283
|
+
...r(v.shape, "tag"),
|
|
284
|
+
product: y.clone().optional()
|
|
285
|
+
}).lock(), Te = f.union(f.object({
|
|
286
286
|
server_id: f.string(),
|
|
287
287
|
role_id: f.string()
|
|
288
|
-
}), f.object({ address_id: f.number() })).satisfies().lock(),
|
|
288
|
+
}), f.object({ address_id: f.number() })).satisfies().lock(), Ee = f.object({
|
|
289
289
|
recipient: f.string(),
|
|
290
290
|
mobile: f.string(),
|
|
291
291
|
province: f.string(),
|
|
@@ -294,29 +294,29 @@ var p = "gamer_token", se = class {
|
|
|
294
294
|
address: f.string(),
|
|
295
295
|
express_company: f.string(),
|
|
296
296
|
express_number: f.string()
|
|
297
|
-
}).lock(),
|
|
297
|
+
}).lock(), De = f.object({
|
|
298
298
|
server_id: f.string(),
|
|
299
299
|
role_id: f.string(),
|
|
300
300
|
role_name: f.string()
|
|
301
|
-
}).lock(),
|
|
301
|
+
}).lock(), Oe = f.object({
|
|
302
302
|
redemption_id: f.number(),
|
|
303
303
|
player_id: f.string(),
|
|
304
304
|
product_id: f.number(),
|
|
305
305
|
name: f.string(),
|
|
306
306
|
img_url: f.string(),
|
|
307
|
-
item_type:
|
|
307
|
+
item_type: h,
|
|
308
308
|
catalog_id: f.number(),
|
|
309
309
|
catalog_name: f.string(),
|
|
310
310
|
quantity: f.number(),
|
|
311
311
|
amount: f.number(),
|
|
312
|
-
status:
|
|
312
|
+
status: he,
|
|
313
313
|
created_at: f.number(),
|
|
314
|
-
extra_data: f.union(
|
|
315
|
-
}),
|
|
316
|
-
credit_logs: f.array(
|
|
314
|
+
extra_data: f.union(Ee.clone(), De.clone()).satisfies().optional()
|
|
315
|
+
}), ke = f.guard(ge), Ae = d({ player: _e }), je = d({ roles: f.array(g) }), b = d({ role_card: be }), Me = f.guard(xe), x = f.guard(_), Ne = d({ addresses: f.array(_) }), Pe = f.guard(Se), Fe = d({
|
|
316
|
+
credit_logs: f.array(Ce),
|
|
317
317
|
next_token: f.string().optional()
|
|
318
|
-
}), Ie = d({ products: f.array(
|
|
319
|
-
redemptions: f.array(
|
|
318
|
+
}), Ie = d({ products: f.array(y) }), Le = d({ benefits: f.array(v) }), Re = d({ benefit: we }), ze = d({
|
|
319
|
+
redemptions: f.array(Oe),
|
|
320
320
|
next_token: f.string().optional()
|
|
321
321
|
}), Be = d({
|
|
322
322
|
existed: f.bool(),
|
|
@@ -330,12 +330,12 @@ var p = "gamer_token", se = class {
|
|
|
330
330
|
}
|
|
331
331
|
async getConfig(e) {
|
|
332
332
|
await this.token.autoLogin();
|
|
333
|
-
let { data: t } = await this.req.get("club/config", null,
|
|
333
|
+
let { data: t } = await this.req.get("club/config", null, ke, e);
|
|
334
334
|
return t;
|
|
335
335
|
}
|
|
336
336
|
async getCurrentPlayer(e) {
|
|
337
337
|
await this.token.autoLogin();
|
|
338
|
-
let { data: t, code: n, message: r } = await this.req.get("club/current-player", null,
|
|
338
|
+
let { data: t, code: n, message: r } = await this.req.get("club/current-player", null, Ae, e);
|
|
339
339
|
return t?.player ?? {
|
|
340
340
|
message: r,
|
|
341
341
|
error: n
|
|
@@ -343,7 +343,7 @@ var p = "gamer_token", se = class {
|
|
|
343
343
|
}
|
|
344
344
|
async linkPlayer(e) {
|
|
345
345
|
await this.token.autoLogin();
|
|
346
|
-
let { data: t, code: n, message: r } = await this.req.post("club/link-player", { id_token: this.token.idToken },
|
|
346
|
+
let { data: t, code: n, message: r } = await this.req.post("club/link-player", { id_token: this.token.idToken }, Ae, e);
|
|
347
347
|
return t?.player ?? {
|
|
348
348
|
message: r,
|
|
349
349
|
error: n
|
|
@@ -354,27 +354,27 @@ var p = "gamer_token", se = class {
|
|
|
354
354
|
let { data: r } = await this.req.get("club/roles", {
|
|
355
355
|
player_id: e,
|
|
356
356
|
refresh: t
|
|
357
|
-
},
|
|
357
|
+
}, je, n);
|
|
358
358
|
return r?.roles || [];
|
|
359
359
|
}
|
|
360
360
|
async getRoleCard(e, t) {
|
|
361
361
|
await this.token.autoLogin();
|
|
362
|
-
let { data: n } = await this.req.get("club/role-card", { member_id: e },
|
|
362
|
+
let { data: n } = await this.req.get("club/role-card", { member_id: e }, b, t);
|
|
363
363
|
return n?.role_card ?? null;
|
|
364
364
|
}
|
|
365
365
|
async setRoleCard(e, t) {
|
|
366
366
|
if (!await this.token.autoLogin()) return null;
|
|
367
|
-
let { data: n } = await this.req.post("club/role-card", e,
|
|
367
|
+
let { data: n } = await this.req.post("club/role-card", e, b, t);
|
|
368
368
|
return n?.role_card ?? null;
|
|
369
369
|
}
|
|
370
370
|
async refreshRoleCard(e) {
|
|
371
371
|
if (!await this.token.autoLogin()) return null;
|
|
372
|
-
let { data: t } = await this.req.post("club/refresh-role-card", {},
|
|
372
|
+
let { data: t } = await this.req.post("club/refresh-role-card", {}, b, e);
|
|
373
373
|
return t?.role_card ?? null;
|
|
374
374
|
}
|
|
375
375
|
async getUserProfile(e, t) {
|
|
376
376
|
await this.token.autoLogin();
|
|
377
|
-
let { data: n } = await this.req.get("club/user-profile", { member_id: e },
|
|
377
|
+
let { data: n } = await this.req.get("club/user-profile", { member_id: e }, Me, t);
|
|
378
378
|
return n;
|
|
379
379
|
}
|
|
380
380
|
async updateUserProfile(e, t) {
|
|
@@ -383,7 +383,7 @@ var p = "gamer_token", se = class {
|
|
|
383
383
|
message: "请提供需要修改的信息"
|
|
384
384
|
};
|
|
385
385
|
await this.token.autoLogin();
|
|
386
|
-
let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e,
|
|
386
|
+
let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e, Me, t);
|
|
387
387
|
return n ?? {
|
|
388
388
|
message: i,
|
|
389
389
|
error: r
|
|
@@ -1235,15 +1235,18 @@ async function ei(e, t) {
|
|
|
1235
1235
|
let { data: n } = await this.req.post("event/unlimit-qrcode", a(e), Or, t);
|
|
1236
1236
|
return n?.img ?? null;
|
|
1237
1237
|
}
|
|
1238
|
-
async function ti(e, t) {
|
|
1238
|
+
async function ti(e, t, n) {
|
|
1239
1239
|
if (!await this.token.autoLogin()) return null;
|
|
1240
|
-
let { data:
|
|
1241
|
-
|
|
1240
|
+
let { data: r, code: i, message: a } = await this.req.get(`event/${this.event}/quest-progress`, {
|
|
1241
|
+
feature_id: e,
|
|
1242
1242
|
...t
|
|
1243
|
+
}, kr, {
|
|
1244
|
+
message: !1,
|
|
1245
|
+
...n
|
|
1243
1246
|
});
|
|
1244
|
-
return
|
|
1245
|
-
message:
|
|
1246
|
-
error:
|
|
1247
|
+
return r || {
|
|
1248
|
+
message: a,
|
|
1249
|
+
error: i
|
|
1247
1250
|
};
|
|
1248
1251
|
}
|
|
1249
1252
|
async function ni(e, t) {
|
|
@@ -1423,25 +1426,46 @@ async function vi(e, t, n) {
|
|
|
1423
1426
|
var yi = {
|
|
1424
1427
|
Waiting: 1,
|
|
1425
1428
|
Playing: 2
|
|
1426
|
-
}, bi = f.number().enum(yi).lock(), xi =
|
|
1427
|
-
|
|
1429
|
+
}, bi = f.number().enum(yi).lock(), xi = {
|
|
1430
|
+
Unknown: 0,
|
|
1431
|
+
Goose: 1,
|
|
1432
|
+
Duck: 2,
|
|
1433
|
+
Bird: 3
|
|
1434
|
+
}, Si = f.number().enum(xi).lock(), Ci = {
|
|
1435
|
+
Unknown: 0,
|
|
1436
|
+
Win: 1,
|
|
1437
|
+
Lose: 2,
|
|
1438
|
+
Mvp: 3,
|
|
1439
|
+
Flee: 4,
|
|
1440
|
+
KickOut: 5
|
|
1441
|
+
}, wi = f.number().enum(Ci).lock(), Ti = class {
|
|
1442
|
+
req = null;
|
|
1428
1443
|
constructor(e, t) {
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
resolve: "
|
|
1438
|
-
|
|
1439
|
-
|
|
1444
|
+
if (typeof e == "string" && t) {
|
|
1445
|
+
let n = ae(e) ? e : `https://${o(e)}`;
|
|
1446
|
+
this.req = t({
|
|
1447
|
+
baseURL: `${n}/v1/ggd`,
|
|
1448
|
+
timeout: 1e4,
|
|
1449
|
+
maxRetry: 2,
|
|
1450
|
+
retryInterval: "2EB",
|
|
1451
|
+
responseRule: {
|
|
1452
|
+
ok: { resolve: "body" },
|
|
1453
|
+
failed: {
|
|
1454
|
+
resolve: "json",
|
|
1455
|
+
statusField: "error",
|
|
1456
|
+
messageField: ["user_message", "message"]
|
|
1457
|
+
}
|
|
1440
1458
|
}
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1459
|
+
});
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1462
|
+
if (typeof e == "object" && "req" in e) {
|
|
1463
|
+
this.req = e.req;
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1443
1466
|
}
|
|
1444
1467
|
async describeRoomByCode(e, t, n) {
|
|
1468
|
+
if (!this.req) throw Error("初始化错误,没有找到请求工具");
|
|
1445
1469
|
let r = String(n || s("expires_at")), i = e || s("invitation_code"), a = t || s("server_id");
|
|
1446
1470
|
if (!i && !a || !/^\d+$/.test(r)) return {
|
|
1447
1471
|
error: "invitation_code_invalid",
|
|
@@ -1472,19 +1496,79 @@ var yi = {
|
|
|
1472
1496
|
message: u
|
|
1473
1497
|
};
|
|
1474
1498
|
}
|
|
1475
|
-
|
|
1499
|
+
async describeRole() {
|
|
1500
|
+
if (!this.req) throw Error("初始化错误,没有找到请求工具");
|
|
1501
|
+
let { data: e, code: t, message: n } = await this.req.get("describe-role", null, d({
|
|
1502
|
+
combo_id: f.string(),
|
|
1503
|
+
showid: f.number(),
|
|
1504
|
+
role_id: f.number(),
|
|
1505
|
+
role_name: f.string(),
|
|
1506
|
+
role_level: f.number(),
|
|
1507
|
+
avatar_url: f.string().optional(),
|
|
1508
|
+
behavior_score: f.number(),
|
|
1509
|
+
lead_goose_level: f.number(),
|
|
1510
|
+
create_time: f.number()
|
|
1511
|
+
}));
|
|
1512
|
+
return e || {
|
|
1513
|
+
error: t,
|
|
1514
|
+
message: n
|
|
1515
|
+
};
|
|
1516
|
+
}
|
|
1517
|
+
async describeRoleMatchStats(e) {
|
|
1518
|
+
if (!this.req) throw Error("初始化错误,没有找到请求工具");
|
|
1519
|
+
let { data: t, code: n, message: r } = await this.req.post("describe-role-match-stats", { role_id: e }, d({
|
|
1520
|
+
inference_level: f.string().optional(),
|
|
1521
|
+
recent_classic_survival_round: f.number().optional(),
|
|
1522
|
+
recent_goose_vote_correct_rate: f.string().optional(),
|
|
1523
|
+
recent_duck_vote_correct_rate: f.string().optional(),
|
|
1524
|
+
recent_total_killed_count: f.number().optional(),
|
|
1525
|
+
season_top_count: f.number().optional(),
|
|
1526
|
+
goose_win_rate: f.string().optional(),
|
|
1527
|
+
duck_win_rate: f.string().optional(),
|
|
1528
|
+
neutral_win_rate: f.string().optional(),
|
|
1529
|
+
goose_win_count: f.number().optional(),
|
|
1530
|
+
duck_win_count: f.number().optional(),
|
|
1531
|
+
neutral_win_count: f.number().optional(),
|
|
1532
|
+
total_win_rate: f.string().optional(),
|
|
1533
|
+
total_count: f.number().optional(),
|
|
1534
|
+
goose_vote_correct_rate: f.string().optional(),
|
|
1535
|
+
duck_vote_correct_rate: f.string().optional(),
|
|
1536
|
+
total_killed_count: f.number().optional()
|
|
1537
|
+
}));
|
|
1538
|
+
return t || {
|
|
1539
|
+
error: n,
|
|
1540
|
+
message: r
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
async listRoleMatches(e) {
|
|
1544
|
+
if (!this.req) throw Error("初始化错误,没有找到请求工具");
|
|
1545
|
+
let { data: t, code: n, message: r } = await this.req.post("list-role-matches", { role_id: e }, d({ matches: f.array(f.object({
|
|
1546
|
+
players_num: f.number(),
|
|
1547
|
+
end_time: f.number(),
|
|
1548
|
+
map_name: f.string(),
|
|
1549
|
+
career_camp: Si,
|
|
1550
|
+
player_status: wi,
|
|
1551
|
+
career_name: f.string(),
|
|
1552
|
+
mode_name: f.string()
|
|
1553
|
+
})) }));
|
|
1554
|
+
return t ? t.matches : {
|
|
1555
|
+
error: n,
|
|
1556
|
+
message: r
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
}, Ei = {
|
|
1476
1560
|
All: "all",
|
|
1477
1561
|
Limit: "limit"
|
|
1478
|
-
},
|
|
1562
|
+
}, Di = f.string().enum(Ei).lock(), Oi = {
|
|
1479
1563
|
Pending: "pending",
|
|
1480
1564
|
Approved: "approved",
|
|
1481
1565
|
Failed: "failed",
|
|
1482
1566
|
Suspect: "suspect"
|
|
1483
|
-
}, V = f.string().enum(
|
|
1567
|
+
}, V = f.string().enum(Oi).lock(), ki = {
|
|
1484
1568
|
System: "system",
|
|
1485
1569
|
Comment: "comment",
|
|
1486
1570
|
Like: "like"
|
|
1487
|
-
},
|
|
1571
|
+
}, Ai = f.string().enum(ki).lock(), H = {
|
|
1488
1572
|
System: "system",
|
|
1489
1573
|
PostPinned: "post_pinned",
|
|
1490
1574
|
PostHighlighted: "post_highlighted",
|
|
@@ -1497,13 +1581,13 @@ var yi = {
|
|
|
1497
1581
|
ReplyReplied: "reply_replied",
|
|
1498
1582
|
ReplyLiked: "reply_liked",
|
|
1499
1583
|
ReplyDeleted: "reply_deleted"
|
|
1500
|
-
},
|
|
1584
|
+
}, ji = f.string().enum(H).lock(), U = f.object({
|
|
1501
1585
|
forum_id: f.number(),
|
|
1502
1586
|
icon_url: f.string(),
|
|
1503
1587
|
name: f.string(),
|
|
1504
1588
|
tags: f.array(f.string()),
|
|
1505
1589
|
sort: f.number(),
|
|
1506
|
-
mode:
|
|
1590
|
+
mode: Di,
|
|
1507
1591
|
member_ids: f.array(f.number())
|
|
1508
1592
|
}).lock(), W = f.object({
|
|
1509
1593
|
topic_id: f.number(),
|
|
@@ -1532,7 +1616,7 @@ var yi = {
|
|
|
1532
1616
|
is_highlighted: f.bool(),
|
|
1533
1617
|
status: V,
|
|
1534
1618
|
create_time: f.number()
|
|
1535
|
-
}).lock(), K = f.object({ err_msg: f.string().optional() }).optional().lock(),
|
|
1619
|
+
}).lock(), K = f.object({ err_msg: f.string().optional() }).optional().lock(), Mi = f.object({
|
|
1536
1620
|
reply_id: f.number(),
|
|
1537
1621
|
reply_content: f.string().optional(),
|
|
1538
1622
|
replied_by: f.string(),
|
|
@@ -1551,7 +1635,7 @@ var yi = {
|
|
|
1551
1635
|
content: f.string(),
|
|
1552
1636
|
like_num: f.number(),
|
|
1553
1637
|
liked: f.bool(),
|
|
1554
|
-
reply_to:
|
|
1638
|
+
reply_to: Mi,
|
|
1555
1639
|
create_time: f.number()
|
|
1556
1640
|
}).lock(), J = f.object({
|
|
1557
1641
|
comment_id: f.number(),
|
|
@@ -1573,19 +1657,19 @@ var yi = {
|
|
|
1573
1657
|
create_time: f.number(),
|
|
1574
1658
|
status: V,
|
|
1575
1659
|
replies: f.array(q).optional()
|
|
1576
|
-
}).lock(),
|
|
1660
|
+
}).lock(), Ni = f.object({
|
|
1577
1661
|
image_url: f.string(),
|
|
1578
1662
|
upload_url: f.string(),
|
|
1579
1663
|
existed: f.bool()
|
|
1580
1664
|
}).lock(), Y = f.object({
|
|
1581
1665
|
notification_id: f.string(),
|
|
1582
|
-
notification_type:
|
|
1666
|
+
notification_type: ji,
|
|
1583
1667
|
is_read: f.bool(),
|
|
1584
1668
|
create_time: f.number(),
|
|
1585
1669
|
origin_user_id: f.string(),
|
|
1586
1670
|
origin_user_name: f.string(),
|
|
1587
1671
|
origin_user_avatar_url: f.string()
|
|
1588
|
-
}).lock(),
|
|
1672
|
+
}).lock(), Pi = f.object({
|
|
1589
1673
|
system_message_subject: f.string(),
|
|
1590
1674
|
system_message_content: f.string()
|
|
1591
1675
|
}).lock(), X = f.object({
|
|
@@ -1599,86 +1683,86 @@ var yi = {
|
|
|
1599
1683
|
}).lock(), Q = f.object({
|
|
1600
1684
|
reply_id: f.number(),
|
|
1601
1685
|
reply_content: f.string()
|
|
1602
|
-
}).lock(),
|
|
1686
|
+
}).lock(), Fi = f.object({
|
|
1603
1687
|
...Y.shape,
|
|
1604
|
-
...
|
|
1688
|
+
...Pi.shape,
|
|
1605
1689
|
notification_type: f.string().enum(H.System)
|
|
1606
|
-
}),
|
|
1690
|
+
}), Ii = f.object({
|
|
1607
1691
|
...Y.shape,
|
|
1608
1692
|
...X.shape,
|
|
1609
1693
|
notification_type: f.string().enum(H.PostPinned, H.PostHighlighted, H.PostDeleted, H.PostLiked)
|
|
1610
|
-
}),
|
|
1694
|
+
}), Li = f.object({
|
|
1611
1695
|
...Y.shape,
|
|
1612
1696
|
...X.shape,
|
|
1613
1697
|
...Z.shape,
|
|
1614
1698
|
notification_type: f.string().enum(H.PostCommented)
|
|
1615
|
-
}),
|
|
1699
|
+
}), Ri = f.object({
|
|
1616
1700
|
...Y.shape,
|
|
1617
1701
|
...Z.shape,
|
|
1618
1702
|
...Q.shape,
|
|
1619
1703
|
notification_type: f.string().enum(H.CommentReplied)
|
|
1620
|
-
}),
|
|
1704
|
+
}), zi = f.object({
|
|
1621
1705
|
...Y.shape,
|
|
1622
1706
|
...Z.shape,
|
|
1623
1707
|
...X.shape,
|
|
1624
1708
|
notification_type: f.string().enum(H.CommentLiked, H.CommentDeleted)
|
|
1625
|
-
}),
|
|
1709
|
+
}), Bi = f.object({
|
|
1626
1710
|
...Y.shape,
|
|
1627
1711
|
...Q.shape,
|
|
1628
1712
|
notification_type: f.string().enum(H.ReplyReplied),
|
|
1629
1713
|
comment_id: f.number(),
|
|
1630
1714
|
reply_to_reply_id: f.number(),
|
|
1631
1715
|
reply_to_reply_content: f.string()
|
|
1632
|
-
}),
|
|
1716
|
+
}), Vi = f.object({
|
|
1633
1717
|
...Y.shape,
|
|
1634
1718
|
...Q.shape,
|
|
1635
1719
|
...Z.shape,
|
|
1636
1720
|
notification_type: f.string().enum(H.ReplyLiked, H.ReplyDeleted)
|
|
1637
|
-
}),
|
|
1721
|
+
}), Hi = f.union(Fi, Ii, Li, Ri, zi, Bi, Vi).satisfies().lock(), Ui = d({ forums: f.array(U) }), Wi = d({ topics: f.array(W) }), Gi = d({ topic: W }), Ki = d({ post: G }), qi = d({
|
|
1638
1722
|
posts: f.array(G),
|
|
1639
1723
|
next_token: f.string().optional()
|
|
1640
|
-
}),
|
|
1724
|
+
}), Ji = d({
|
|
1641
1725
|
post: G.clone().optional(),
|
|
1642
1726
|
antispam: K.clone().optional()
|
|
1643
|
-
}),
|
|
1727
|
+
}), Yi = d({
|
|
1644
1728
|
replies: f.array(q),
|
|
1645
1729
|
next_token: f.string().optional()
|
|
1646
|
-
}),
|
|
1730
|
+
}), Xi = d({ reply: q }), Zi = d({
|
|
1647
1731
|
reply: q.clone().optional(),
|
|
1648
1732
|
antispam: K.clone().optional()
|
|
1649
|
-
}),
|
|
1733
|
+
}), Qi = d({ comment: J }), $i = d({
|
|
1650
1734
|
comments: f.array(J),
|
|
1651
1735
|
next_token: f.string().optional()
|
|
1652
|
-
}),
|
|
1736
|
+
}), ea = d({
|
|
1653
1737
|
comment: J.clone().optional(),
|
|
1654
1738
|
antispam: J.clone().optional()
|
|
1655
|
-
}),
|
|
1656
|
-
notifications: f.array(
|
|
1739
|
+
}), ta = f.guard(Ni), na = d({
|
|
1740
|
+
notifications: f.array(Hi),
|
|
1657
1741
|
next_token: f.string().optional()
|
|
1658
|
-
}),
|
|
1742
|
+
}), ra = d({
|
|
1659
1743
|
system: f.number(),
|
|
1660
1744
|
comment: f.number(),
|
|
1661
1745
|
like: f.number()
|
|
1662
|
-
}),
|
|
1746
|
+
}), ia = class {
|
|
1663
1747
|
token;
|
|
1664
1748
|
req;
|
|
1665
1749
|
constructor(e) {
|
|
1666
1750
|
this.token = e, this.req = e.req;
|
|
1667
1751
|
}
|
|
1668
1752
|
async getForums(e) {
|
|
1669
|
-
let { data: t } = await this.req.get("community/forums", null,
|
|
1753
|
+
let { data: t } = await this.req.get("community/forums", null, Ui, e);
|
|
1670
1754
|
return t?.forums || [];
|
|
1671
1755
|
}
|
|
1672
1756
|
async getTopics(e) {
|
|
1673
|
-
let { data: t } = await this.req.get("community/topics", null,
|
|
1757
|
+
let { data: t } = await this.req.get("community/topics", null, Wi, e);
|
|
1674
1758
|
return t?.topics || [];
|
|
1675
1759
|
}
|
|
1676
1760
|
async getTopic(e, t) {
|
|
1677
|
-
let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e },
|
|
1761
|
+
let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e }, Gi, t);
|
|
1678
1762
|
return n?.topic ?? { error: r };
|
|
1679
1763
|
}
|
|
1680
1764
|
async getPosts(e, t) {
|
|
1681
|
-
let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null,
|
|
1765
|
+
let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null, qi, t);
|
|
1682
1766
|
return n ?? {
|
|
1683
1767
|
message: i,
|
|
1684
1768
|
error: r
|
|
@@ -1689,35 +1773,35 @@ var yi = {
|
|
|
1689
1773
|
forum_id: e,
|
|
1690
1774
|
max_results: t,
|
|
1691
1775
|
next_token: n
|
|
1692
|
-
},
|
|
1776
|
+
}, qi, r);
|
|
1693
1777
|
return i ?? {
|
|
1694
1778
|
message: o,
|
|
1695
1779
|
error: a
|
|
1696
1780
|
};
|
|
1697
1781
|
}
|
|
1698
1782
|
async getPost(e, t) {
|
|
1699
|
-
let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e },
|
|
1783
|
+
let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e }, Ki, t);
|
|
1700
1784
|
return n?.post ?? {
|
|
1701
1785
|
message: i,
|
|
1702
1786
|
error: r
|
|
1703
1787
|
};
|
|
1704
1788
|
}
|
|
1705
1789
|
async post(e, t) {
|
|
1706
|
-
let { data: n, code: r, message: i } = await this.req.post("community/post", a(e),
|
|
1790
|
+
let { data: n, code: r, message: i } = await this.req.post("community/post", a(e), Ji, t);
|
|
1707
1791
|
return n ?? {
|
|
1708
1792
|
message: i,
|
|
1709
1793
|
error: r
|
|
1710
1794
|
};
|
|
1711
1795
|
}
|
|
1712
1796
|
async getComments(e, t) {
|
|
1713
|
-
let { data: n, code: r, message: i } = await this.req.get("community/comments", e,
|
|
1797
|
+
let { data: n, code: r, message: i } = await this.req.get("community/comments", e, $i, t);
|
|
1714
1798
|
return n ?? {
|
|
1715
1799
|
message: i,
|
|
1716
1800
|
error: r
|
|
1717
1801
|
};
|
|
1718
1802
|
}
|
|
1719
1803
|
async getComment(e, t) {
|
|
1720
|
-
let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e },
|
|
1804
|
+
let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e }, Qi, t);
|
|
1721
1805
|
return n?.comment ?? {
|
|
1722
1806
|
message: i,
|
|
1723
1807
|
error: r
|
|
@@ -1725,7 +1809,7 @@ var yi = {
|
|
|
1725
1809
|
}
|
|
1726
1810
|
async comment(e, t) {
|
|
1727
1811
|
await this.token.autoLogin();
|
|
1728
|
-
let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e),
|
|
1812
|
+
let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e), ea, t);
|
|
1729
1813
|
return n ?? {
|
|
1730
1814
|
message: i,
|
|
1731
1815
|
error: r
|
|
@@ -1735,14 +1819,14 @@ var yi = {
|
|
|
1735
1819
|
let { data: n } = await this.req.get("community/replies", {
|
|
1736
1820
|
max_results: 20,
|
|
1737
1821
|
...e
|
|
1738
|
-
},
|
|
1822
|
+
}, Yi, t);
|
|
1739
1823
|
return {
|
|
1740
1824
|
replies: n?.replies || [],
|
|
1741
1825
|
next_token: n?.next_token || ""
|
|
1742
1826
|
};
|
|
1743
1827
|
}
|
|
1744
1828
|
async getReply(e, t) {
|
|
1745
|
-
let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e },
|
|
1829
|
+
let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e }, Xi, t);
|
|
1746
1830
|
return n?.reply ?? {
|
|
1747
1831
|
message: i,
|
|
1748
1832
|
error: r
|
|
@@ -1750,7 +1834,7 @@ var yi = {
|
|
|
1750
1834
|
}
|
|
1751
1835
|
async reply(e, t) {
|
|
1752
1836
|
await this.token.autoLogin();
|
|
1753
|
-
let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e),
|
|
1837
|
+
let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e), Zi, t);
|
|
1754
1838
|
return n ?? {
|
|
1755
1839
|
message: i,
|
|
1756
1840
|
error: r
|
|
@@ -1780,7 +1864,7 @@ var yi = {
|
|
|
1780
1864
|
}
|
|
1781
1865
|
async getMediaPresignedUrl(e, t) {
|
|
1782
1866
|
await this.token.autoLogin();
|
|
1783
|
-
let { data: n } = await this.req.get("community/media-presign-url", e,
|
|
1867
|
+
let { data: n } = await this.req.get("community/media-presign-url", e, ta, t);
|
|
1784
1868
|
return n;
|
|
1785
1869
|
}
|
|
1786
1870
|
async getNotifications(e, t) {
|
|
@@ -1788,7 +1872,7 @@ var yi = {
|
|
|
1788
1872
|
let { data: n } = await this.req.get("community/notifications", {
|
|
1789
1873
|
max_results: 20,
|
|
1790
1874
|
...e
|
|
1791
|
-
},
|
|
1875
|
+
}, na, t);
|
|
1792
1876
|
return {
|
|
1793
1877
|
notifications: n?.notifications || [],
|
|
1794
1878
|
next_token: n?.next_token || ""
|
|
@@ -1796,7 +1880,7 @@ var yi = {
|
|
|
1796
1880
|
}
|
|
1797
1881
|
async getUnreadNotificationsCount(e) {
|
|
1798
1882
|
if (!await this.token.autoLogin()) return null;
|
|
1799
|
-
let { data: t } = await this.req.get("community/unread-notifications-count", null,
|
|
1883
|
+
let { data: t } = await this.req.get("community/unread-notifications-count", null, ra, e);
|
|
1800
1884
|
return t;
|
|
1801
1885
|
}
|
|
1802
1886
|
async clearUnreadNotifications(e, t) {
|
|
@@ -1804,11 +1888,11 @@ var yi = {
|
|
|
1804
1888
|
let { ok: n } = await this.req.post("community/clear-unread-notifications", { category: e }, null, t);
|
|
1805
1889
|
return n;
|
|
1806
1890
|
}
|
|
1807
|
-
},
|
|
1891
|
+
}, aa = d({
|
|
1808
1892
|
nonce_str: f.string(),
|
|
1809
1893
|
timestamp: f.number(),
|
|
1810
1894
|
signature: f.string()
|
|
1811
|
-
}),
|
|
1895
|
+
}), oa = /* @__PURE__ */ function(e) {
|
|
1812
1896
|
return e.RedirectUriDisMatch = "10003", e.AppidError = "10016", e.AuthorizationError = "10015", e.NoRightForScope = "10005", e.Frequently = "10009", e.AppBanded = "10004", e.ShouldFollow = "10006", e.ScopeNull = "10010", e.RedirectUriNull = "10011", e.AppidNull = "10012", e.StateNull = "10013", e;
|
|
1813
1897
|
}({});
|
|
1814
1898
|
//#endregion
|
|
@@ -1818,7 +1902,7 @@ function $(e) {
|
|
|
1818
1902
|
}
|
|
1819
1903
|
//#endregion
|
|
1820
1904
|
//#region src/weixin.ts
|
|
1821
|
-
var
|
|
1905
|
+
var sa = "wx_login_cache", ca = class {
|
|
1822
1906
|
token;
|
|
1823
1907
|
_appid;
|
|
1824
1908
|
req;
|
|
@@ -1829,7 +1913,7 @@ var ra = "wx_login_cache", ia = class {
|
|
|
1829
1913
|
return this._appid;
|
|
1830
1914
|
}
|
|
1831
1915
|
async getLoginCache() {
|
|
1832
|
-
let e = this.token.storage.get(
|
|
1916
|
+
let e = this.token.storage.get(sa);
|
|
1833
1917
|
if (!e) return null;
|
|
1834
1918
|
let t = i(e);
|
|
1835
1919
|
return $(t) ? (this.token.weixinToken = t.weixin_token, await this.token.autoLogin(), t) : null;
|
|
@@ -1845,7 +1929,7 @@ var ra = "wx_login_cache", ia = class {
|
|
|
1845
1929
|
...e,
|
|
1846
1930
|
message: !1
|
|
1847
1931
|
});
|
|
1848
|
-
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(
|
|
1932
|
+
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(sa, JSON.stringify(r))), r ?? {
|
|
1849
1933
|
message: a,
|
|
1850
1934
|
error: i
|
|
1851
1935
|
};
|
|
@@ -1887,7 +1971,7 @@ var ra = "wx_login_cache", ia = class {
|
|
|
1887
1971
|
let { data: t } = await this.req.get("weixin/offiaccount/jssdk-sign", {
|
|
1888
1972
|
appid: this.appid,
|
|
1889
1973
|
url: location.href.split("#")[0]
|
|
1890
|
-
},
|
|
1974
|
+
}, aa, e);
|
|
1891
1975
|
return t ? {
|
|
1892
1976
|
appid: this.appid,
|
|
1893
1977
|
nonceStr: t.nonce_str,
|
|
@@ -1897,4 +1981,4 @@ var ra = "wx_login_cache", ia = class {
|
|
|
1897
1981
|
}
|
|
1898
1982
|
};
|
|
1899
1983
|
//#endregion
|
|
1900
|
-
export { K as AntispamValidator, se as AuthToken, Yn as CandidateVoteValidator, I as CashbackEngagementDataValidator, vn as ClaimActivationKeyEngagementDataValidator, Qe as ClaimRewardStatus, k as ClaimRewardStatusValidator, ar as ClaimedItemValidator,
|
|
1984
|
+
export { K as AntispamValidator, se as AuthToken, Yn as CandidateVoteValidator, I as CashbackEngagementDataValidator, vn as ClaimActivationKeyEngagementDataValidator, Qe as ClaimRewardStatus, k as ClaimRewardStatusValidator, ar as ClaimedItemValidator, _ as ClubAddressValidator, Ve as ClubApi, v as ClubBenefitSummaryValidator, we as ClubBenefitValidator, de as ClubCreditChangeScene, fe as ClubCreditChangeSceneValidator, le as ClubCreditChangeType, ue as ClubCreditChangeTypeValidator, Ce as ClubCreditLogValidator, ge as ClubGlobalConfigValidator, pe as ClubItemType, h as ClubItemTypeValidator, _e as ClubPlayerValidator, y as ClubProductValidator, me as ClubRedemptionStatus, he as ClubRedemptionStatusValidator, Se as ClubUserCreditValidator, xe as ClubUserProfileValidator, Qn as CommentEngagementValidator, J as CommentValidator, ia as CommunityApi, Xn as ConversationValidator, We as EngageAccountType, Ge as EngageAccountTypeValidator, ir as EngageResponseValidator, er as EngageRewardValidator, He as EventApi, fr as EventConfigValidator, bt as EventFeatureConfigOfCashbackValidator, St as EventFeatureConfigOfCheckInValidator, wt as EventFeatureConfigOfClaimActivationKeyValidator, Et as EventFeatureConfigOfClaimRewardsValidator, Ot as EventFeatureConfigOfCommentValidator, At as EventFeatureConfigOfFollowValidator, Nt as EventFeatureConfigOfGiftCodeValidator, Ft as EventFeatureConfigOfInviteValidator, Lt as EventFeatureConfigOfInvitedRegisterValidator, Ut as EventFeatureConfigOfLotteryDrawValidator, Vt as EventFeatureConfigOfLotteryValidator, Gt as EventFeatureConfigOfPreregisterValidator, qt as EventFeatureConfigOfQuestValidator, Xt as EventFeatureConfigOfRedeemValidator, $t as EventFeatureConfigOfReferralValidator, tn as EventFeatureConfigOfRegisterValidator, rn as EventFeatureConfigOfShareValidator, on as EventFeatureConfigOfSubscribeValidator, cn as EventFeatureConfigOfSurveyValidator, un as EventFeatureConfigOfTeamValidator, mn as EventFeatureConfigOfUgcLikeValidator, fn as EventFeatureConfigOfUgcValidator, cr as EventFeatureConfigOfVote2Validator, _n as EventFeatureConfigOfVoteValidator, dr as EventFeatureConfigValidator, Ke as EventPeriodType, qe as EventPeriodTypeValidator, N as EventRewardItemConfigValidator, De as ExtraGameRewardValidator, Ee as ExtraPhysicalShipmentValidator, Yt as FeatureRedeemItemConfigValidator, Qt as FeatureReferralTierItemValidator, vt as FeatureRewardValidator, T as FeatureType, Je as FeatureTypeValidator, Ei as ForumMode, Di as ForumModeValidator, U as ForumValidator, xi as GGDCareerCampType, Si as GGDCareerCampTypeValidator, Ci as GGDPlayerStatus, wi as GGDPlayerStatusValidator, Ti as GGDPublicApi, yi as GGDRoomStatus, bi as GGDRoomStatusValidator, S as GamerItemType, C as GamerItemTypeValidator, m as Gender, ce as GenderValidator, Nn as GenerateReferralRewardsResponseValidator, yn as GiftCodeEngagementDataValidator, L as InviteEngagementDataValidator, st as LotteryDrawAction, ct as LotteryDrawActionValidator, Cn as LotteryDrawEngagementDataValidator, bn as LotteryEngagementDataValidator, j as LotteryTicketStatus, nt as LotteryTicketStatusValidator, Y as NotificationBaseValidator, ki as NotificationCategory, Ai as NotificationCategoryValidator, Ri as NotificationCommentReplyValidator, zi as NotificationCommentValidator, Z as NotificationPayloadCommentValidator, X as NotificationPayloadPostValidator, Q as NotificationPayloadReplyValidator, Pi as NotificationPayloadSystemValidator, Li as NotificationPostCommentValidator, Ii as NotificationPostValidator, Bi as NotificationReplyRepliedValidator, Vi as NotificationReplyValidator, Fi as NotificationSystemValidator, H as NotificationType, ji as NotificationTypeValidator, Hi as NotificationValidator, be as PlayerRoleCardValidator, g as PlayerRoleValidator, Oi as PostStatus, V as PostStatusValidator, G as PostValidator, wn as PreregisterEngagementDataValidator, Ni as PresignedUrlResponseValidator, En as QuestEngagementDataValidator, Ye as QuestObjective, E as QuestObjectiveValidator, lt as QuestProgressAlgorithm, ut as QuestProgressAlgorithmValidator, Dn as QuestProgressValidator, On as RedeemEngagementDataValidator, Te as RedeemParamsValidator, kn as RedeemStocksResponseValidator, Oe as RedemptionValidator, at as ReferralAction, ot as ReferralActionValidator, jn as ReferralEngagementDataValidator, An as ReferralInviteValidator, _t as RegularRewardValidator, Mi as ReplyToValidator, q as ReplyValidator, Ue as RewardItemType, w as RewardItemTypeValidator, $e as RewardSource, A as RewardSourceValidator, D as RewardStatus, O as RewardStatusValidator, $n as RewardValidator, ye as RoleBaseInfoValidator, ve as ServerBaseInfoValidator, Pn as ShareEngagementDataValidator, In as SurveyEngagementDataValidator, rt as TeamAction, it as TeamActionValidator, zn as TeamEngagementDataValidator, Ln as TeamEngagementValidator, Rn as TeamMemberValidator, et as TeamVisibility, tt as TeamVisibilityValidator, Mn as TierStatusValidator, W as TopicValidator, Un as UgcCountResponseValidator, Bn as UgcEngagementDataValidator, Gn as UgcLeaderboardResponseValidator, Vn as UgcRecordBaseResponseValidator, Hn as UgcRecordResponseValidator, mt as UgcReviewStatus, ht as UgcReviewStatusValidator, pt as UgcSocialMedia, M as UgcSocialMediaValidator, Wn as UgcUploadImageValidator, z as UserEngagementDataValidator, tr as UserEngagementValidator, rr as UserFeatureStatusValidator, R as UserRewardValidator, nr as VerifyMobileResultValidator, Jn as Vote2ClaimRewardsResponseValidator, qn as Vote2EngagementDataValidator, dt as Vote2RewardType, ft as Vote2RewardTypeValidator, Kn as VoteEngagementDataValidator, Xe as VoteOptionSource, Ze as VoteOptionSourceValidator, ca as WeixinApi, Fn as WeixinSubscribeEngagementDataValidator, oa as WeixinWebLoginErrorCode, Zn as ZeroChatGPTDataValidator, Xr as claimRewards, si as claimRewardsV2, ci as claimWeixinHongbao, Yr as engage, vi as generateReferralRewards, ei as generateUnlimitQrcode, ii as getCashbackQuery, Vr as getConfig, Wr as getEngagements, Ur as getEngagementsCount, Hr as getEngagementsUserCount, $r as getParamsByQrcodeScene, ti as getQuestProgress, _i as getRedeemItemStocks, gi as getUgcLeaderboard, oi as getUgcMyCount, mi as getUgcRecommendation, ai as getUgcRecord, hi as getUgcs, Qr as getUnlimitQrcodeScene, qr as getUserEngagementCount, Jr as getUserEngagements, Kr as getUserFeatureStatus, fi as getUserItemCount, ui as getUserRewards, di as getUserRewardsCount, ri as getVote2Leaderboard, aa as isWeixinSignResponse, Zr as submitUserRewardAddress, pi as ugcUploadImage, li as verifyActivationKey, Br as verifyMobileAllowed, Gr as visit, ni as vote2Rewards };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/gamer-api",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "agent for gamer api",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "web@seayoo.com",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"@vitest/coverage-istanbul": "^4.1.4",
|
|
31
31
|
"happy-dom": "^13.10.1",
|
|
32
32
|
"vitest": "^4.1.4",
|
|
33
|
-
"@seayoo-web/combo-webview": "2.9.8",
|
|
34
|
-
"@seayoo-web/scripts": "4.3.10",
|
|
35
|
-
"@seayoo-web/tsconfig": "1.0.6",
|
|
36
|
-
"@seayoo-web/utils": "4.5.5",
|
|
37
33
|
"@seayoo-web/request": "4.1.3",
|
|
38
|
-
"@seayoo-web/
|
|
34
|
+
"@seayoo-web/scripts": "4.3.11",
|
|
35
|
+
"@seayoo-web/tsconfig": "1.0.7",
|
|
36
|
+
"@seayoo-web/validator": "2.3.1",
|
|
37
|
+
"@seayoo-web/utils": "4.5.5",
|
|
38
|
+
"@seayoo-web/combo-webview": "2.9.8"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@seayoo-web/combo-webview": "^2.9.8",
|
|
@@ -238,7 +238,11 @@ export declare function generateUnlimitQrcode(this: ApiInstance, option: {
|
|
|
238
238
|
*
|
|
239
239
|
* https://www.kdocs.cn/l/ckWFDcOsYEUA?linkname=ZAnm12d3f0
|
|
240
240
|
*/
|
|
241
|
-
export declare function getQuestProgress(this: ApiInstance, featureId: number,
|
|
241
|
+
export declare function getQuestProgress(this: ApiInstance, featureId: number, option?: {
|
|
242
|
+
/** 游戏服务器 ID,quest 玩法的 game_task_gm objective 必传。 */
|
|
243
|
+
server_id?: string;
|
|
244
|
+
role_id?: string;
|
|
245
|
+
}, requestOptions?: RequestOptions): Promise<import("./event.engage").QuestProgress | {
|
|
242
246
|
message: string;
|
|
243
247
|
error: RequestInternalError | "invalid_token" | "feature_not_found";
|
|
244
248
|
} | null>;
|
package/types/src/ggd.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import type { AuthToken } from "./token";
|
|
1
2
|
import type { NetRequestFactory, RequestInternalError } from "@seayoo-web/request";
|
|
2
3
|
/**
|
|
3
|
-
* 鹅鸭杀(ggd)定制化 public
|
|
4
|
+
* 鹅鸭杀(ggd)定制化 public 接口,如果需要调用需要登录态的接口,初始化需要传入 AuthToken
|
|
4
5
|
*/
|
|
5
6
|
export declare class GGDPublicApi {
|
|
6
|
-
req: ReturnType<NetRequestFactory
|
|
7
|
+
req: ReturnType<NetRequestFactory> | null;
|
|
8
|
+
constructor(authToken: AuthToken);
|
|
7
9
|
constructor(endpoint: string, NetRequest: NetRequestFactory);
|
|
8
10
|
/**
|
|
9
11
|
* 获取鹅鸭杀房间内详情
|
|
10
12
|
*
|
|
13
|
+
* 💡不需要登录
|
|
14
|
+
*
|
|
11
15
|
* - 参数 `invitationCode` 默认从 url query 的 `invitation_code` 参数读取
|
|
12
16
|
* - 参数 `serverId` 默认从 url query 的 `server_id` 参数读取
|
|
13
17
|
* - 参数 `expiresAt` 默认从 url query 的 `expires_at` 参数读取
|
|
@@ -32,4 +36,79 @@ export declare class GGDPublicApi {
|
|
|
32
36
|
error: RequestInternalError | "room_not_found" | "invitation_code_invalid" | "invitation_code_expired";
|
|
33
37
|
message: string;
|
|
34
38
|
}>;
|
|
39
|
+
/**
|
|
40
|
+
* 查询当前登录用户的游戏角色信息,包括角色编号、昵称、等级、行为分、领头鹅等级、头像、创角时间等
|
|
41
|
+
*
|
|
42
|
+
* 💡需要登录
|
|
43
|
+
*
|
|
44
|
+
* https://www.kdocs.cn/l/ccZPz3rWSl4o?linkname=NtItEHncF8
|
|
45
|
+
*/
|
|
46
|
+
describeRole(): Promise<{
|
|
47
|
+
combo_id: string;
|
|
48
|
+
showid: number;
|
|
49
|
+
role_id: number;
|
|
50
|
+
role_name: string;
|
|
51
|
+
role_level: number;
|
|
52
|
+
avatar_url: string | undefined;
|
|
53
|
+
behavior_score: number;
|
|
54
|
+
lead_goose_level: number;
|
|
55
|
+
create_time: number;
|
|
56
|
+
} | {
|
|
57
|
+
error: "role_not_found" | RequestInternalError;
|
|
58
|
+
message: string;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* 查询当前登录用户的对局统计数据,包括推理等级、巅峰数、各阵营胜率/胜场、击杀、票准率等
|
|
62
|
+
*
|
|
63
|
+
* 💡需要登录
|
|
64
|
+
*
|
|
65
|
+
* https://www.kdocs.cn/l/ccZPz3rWSl4o?linkname=CntoE573fE
|
|
66
|
+
*
|
|
67
|
+
* [GM 命令 DescribeRoleMatchStats](https://www.kdocs.cn/l/cnZbBuB5x12C?linkname=mhjVTRxSVD)
|
|
68
|
+
*/
|
|
69
|
+
describeRoleMatchStats(roleId: number): Promise<{
|
|
70
|
+
inference_level: string | undefined;
|
|
71
|
+
recent_classic_survival_round: number | undefined;
|
|
72
|
+
recent_goose_vote_correct_rate: string | undefined;
|
|
73
|
+
recent_duck_vote_correct_rate: string | undefined;
|
|
74
|
+
recent_total_killed_count: number | undefined;
|
|
75
|
+
season_top_count: number | undefined;
|
|
76
|
+
goose_win_rate: string | undefined;
|
|
77
|
+
duck_win_rate: string | undefined;
|
|
78
|
+
neutral_win_rate: string | undefined;
|
|
79
|
+
goose_win_count: number | undefined;
|
|
80
|
+
duck_win_count: number | undefined;
|
|
81
|
+
neutral_win_count: number | undefined;
|
|
82
|
+
total_win_rate: string | undefined;
|
|
83
|
+
total_count: number | undefined;
|
|
84
|
+
goose_vote_correct_rate: string | undefined;
|
|
85
|
+
duck_vote_correct_rate: string | undefined;
|
|
86
|
+
total_killed_count: number | undefined;
|
|
87
|
+
} | {
|
|
88
|
+
error: "role_not_found" | RequestInternalError;
|
|
89
|
+
message: string;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* 查询当前登录用户的对局记录,返回近 30 天的对局记录,最多 50 场。
|
|
93
|
+
*
|
|
94
|
+
* 除展示对局列表外,本接口返回条数同时作为「近 30 天总场次」的数据来源,修改返回上限或时间窗口时需同步评估影响
|
|
95
|
+
*
|
|
96
|
+
* 💡需要登录
|
|
97
|
+
*
|
|
98
|
+
* https://www.kdocs.cn/l/ccZPz3rWSl4o?linkname=NSvUAib1FA
|
|
99
|
+
*
|
|
100
|
+
* [GM 命令 ListRoleMatches](https://www.kdocs.cn/l/cnZbBuB5x12C?linkname=ftJhlIPOX2)
|
|
101
|
+
*/
|
|
102
|
+
listRoleMatches(roleId: number): Promise<{
|
|
103
|
+
players_num: number;
|
|
104
|
+
end_time: number;
|
|
105
|
+
map_name: string;
|
|
106
|
+
career_camp: import("./ggd.enums").GGDCareerCampType;
|
|
107
|
+
player_status: import("./ggd.enums").GGDPlayerStatus;
|
|
108
|
+
career_name: string;
|
|
109
|
+
mode_name: string;
|
|
110
|
+
}[] | {
|
|
111
|
+
error: "role_not_found" | RequestInternalError;
|
|
112
|
+
message: string;
|
|
113
|
+
}>;
|
|
35
114
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ValueOf } from "@seayoo-web/utils";
|
|
2
|
+
/** 房间状态 */
|
|
3
|
+
export declare const GGDRoomStatus: {
|
|
4
|
+
/** 等待中 */
|
|
5
|
+
readonly Waiting: 1;
|
|
6
|
+
/** 游戏中 */
|
|
7
|
+
readonly Playing: 2;
|
|
8
|
+
};
|
|
9
|
+
export type GGDRoomStatus = ValueOf<typeof GGDRoomStatus>;
|
|
10
|
+
export declare const GGDRoomStatusValidator: import("@seayoo-web/validator").NumberValidator<GGDRoomStatus, false, false> & {
|
|
11
|
+
int: never;
|
|
12
|
+
min: never;
|
|
13
|
+
max: never;
|
|
14
|
+
allowNaN: never;
|
|
15
|
+
allowInfinity: never;
|
|
16
|
+
unsafe: never;
|
|
17
|
+
enum: never;
|
|
18
|
+
disallow: never;
|
|
19
|
+
optional: never;
|
|
20
|
+
maybeNull: never;
|
|
21
|
+
lock: never;
|
|
22
|
+
};
|
package/types/src/ggd.enums.d.ts
CHANGED
|
@@ -20,3 +20,52 @@ export declare const GGDRoomStatusValidator: import("@seayoo-web/validator").Num
|
|
|
20
20
|
maybeNull: never;
|
|
21
21
|
lock: never;
|
|
22
22
|
};
|
|
23
|
+
/** 对局所在阵营 */
|
|
24
|
+
export declare const GGDCareerCampType: {
|
|
25
|
+
readonly Unknown: 0;
|
|
26
|
+
readonly Goose: 1;
|
|
27
|
+
readonly Duck: 2;
|
|
28
|
+
readonly Bird: 3;
|
|
29
|
+
};
|
|
30
|
+
export type GGDCareerCampType = ValueOf<typeof GGDCareerCampType>;
|
|
31
|
+
export declare const GGDCareerCampTypeValidator: import("@seayoo-web/validator").NumberValidator<GGDCareerCampType, false, false> & {
|
|
32
|
+
int: never;
|
|
33
|
+
min: never;
|
|
34
|
+
max: never;
|
|
35
|
+
allowNaN: never;
|
|
36
|
+
allowInfinity: never;
|
|
37
|
+
unsafe: never;
|
|
38
|
+
enum: never;
|
|
39
|
+
disallow: never;
|
|
40
|
+
optional: never;
|
|
41
|
+
maybeNull: never;
|
|
42
|
+
lock: never;
|
|
43
|
+
};
|
|
44
|
+
/** 对局结果 */
|
|
45
|
+
export declare const GGDPlayerStatus: {
|
|
46
|
+
readonly Unknown: 0;
|
|
47
|
+
/** 胜利 */
|
|
48
|
+
readonly Win: 1;
|
|
49
|
+
/** 失败 */
|
|
50
|
+
readonly Lose: 2;
|
|
51
|
+
/** MVP */
|
|
52
|
+
readonly Mvp: 3;
|
|
53
|
+
/** 逃跑 */
|
|
54
|
+
readonly Flee: 4;
|
|
55
|
+
/** 踢下线,行为违规 */
|
|
56
|
+
readonly KickOut: 5;
|
|
57
|
+
};
|
|
58
|
+
export type GGDPlayerStatus = ValueOf<typeof GGDPlayerStatus>;
|
|
59
|
+
export declare const GGDPlayerStatusValidator: import("@seayoo-web/validator").NumberValidator<GGDPlayerStatus, false, false> & {
|
|
60
|
+
int: never;
|
|
61
|
+
min: never;
|
|
62
|
+
max: never;
|
|
63
|
+
allowNaN: never;
|
|
64
|
+
allowInfinity: never;
|
|
65
|
+
unsafe: never;
|
|
66
|
+
enum: never;
|
|
67
|
+
disallow: never;
|
|
68
|
+
optional: never;
|
|
69
|
+
maybeNull: never;
|
|
70
|
+
lock: never;
|
|
71
|
+
};
|