@seayoo-web/gamer-api 4.0.3 → 4.0.5
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 +1755 -2787
- package/package.json +17 -17
- package/types/src/event.engage/index.d.ts +1 -1
- package/types/src/event.enums.d.ts +4 -0
- package/types/src/utils.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2826 +1,1794 @@
|
|
|
1
|
-
import { isComboWebView as
|
|
2
|
-
import { isPlainObject as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { isComboWebView as e } from "@seayoo-web/combo-webview";
|
|
2
|
+
import { isPlainObject as t, localStorageHelper as n, omitFields as r, parseJSON as i, pruneObject as a, pruneURL as o, queryString as s, removePara as ee, supportWindow as te, supportWx as c, useConsole as ne, usePromise as re, weixinStorageHelper as ie } from "@seayoo-web/utils";
|
|
3
|
+
import { objectGuard as l, v as u } from "@seayoo-web/validator";
|
|
4
|
+
//#region src/token.guards.ts
|
|
5
|
+
function ae(e) {
|
|
6
|
+
return t(e, "gamer_token") && typeof e.gamer_token == "string";
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
8
|
+
function oe(e) {
|
|
9
|
+
return t(e, "gamer_token", "game_id") && typeof e.gamer_token == "string" && typeof e.game_id == "string";
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
11
|
+
function se(e) {
|
|
12
|
+
return t(e);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
ne("GamerApiSDK");
|
|
15
|
+
function ce(e) {
|
|
16
|
+
return /^\/[a-z\d-]+$/.test(e);
|
|
16
17
|
}
|
|
17
|
-
async function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
async function le() {
|
|
19
|
+
let { promise: e, resolve: t } = re();
|
|
20
|
+
return wx.login({
|
|
21
|
+
success(e) {
|
|
22
|
+
t(e.code);
|
|
23
|
+
},
|
|
24
|
+
fail() {
|
|
25
|
+
t("");
|
|
26
|
+
}
|
|
27
|
+
}), await e;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/token.ts
|
|
31
|
+
var d = "gamer_token", ue = class {
|
|
32
|
+
_NetRequest;
|
|
33
|
+
_idToken = "";
|
|
34
|
+
_weixinToken = "";
|
|
35
|
+
_gamerToken = "";
|
|
36
|
+
req;
|
|
37
|
+
storage;
|
|
38
|
+
constructor(t, r) {
|
|
39
|
+
this.storage = c() ? ie : n;
|
|
40
|
+
let i = ce(t) ? t : `https://${o(t)}`;
|
|
41
|
+
if (this._NetRequest = r, this.req = r({
|
|
42
|
+
baseURL: `${i}/v1`,
|
|
43
|
+
timeout: 1e4,
|
|
44
|
+
maxRetry: 2,
|
|
45
|
+
retryInterval: "2EB",
|
|
46
|
+
responseRule: {
|
|
47
|
+
ok: { resolve: "body" },
|
|
48
|
+
failed: {
|
|
49
|
+
resolve: "json",
|
|
50
|
+
statusField: "error",
|
|
51
|
+
messageField: ["user_message", "message"]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
requestTransformer: (e) => {
|
|
55
|
+
this._gamerToken && (e.headers.Authorization = `Bearer ${this._gamerToken}`);
|
|
56
|
+
}
|
|
57
|
+
}), te()) {
|
|
58
|
+
let t = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), n = s("gamer_token");
|
|
59
|
+
(e() || t && n) && (this._gamerToken = n);
|
|
60
|
+
}
|
|
61
|
+
this._gamerToken || this.loadGamerTokenCache();
|
|
62
|
+
}
|
|
63
|
+
get NetRequest() {
|
|
64
|
+
return this._NetRequest;
|
|
65
|
+
}
|
|
66
|
+
loadGamerTokenCache() {
|
|
67
|
+
let e = this.storage.get(d).match(/^(\d{12,})#(.{8,})$/);
|
|
68
|
+
if (e) {
|
|
69
|
+
let t = parseInt(e[1]), n = e[2];
|
|
70
|
+
if (t > Date.now() - (24 * 3600 - 10) * 1e3) {
|
|
71
|
+
this._gamerToken = n;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
this.storage.remove(d);
|
|
76
|
+
}
|
|
77
|
+
get isLoggedIn() {
|
|
78
|
+
return this._gamerToken !== "";
|
|
79
|
+
}
|
|
80
|
+
get idToken() {
|
|
81
|
+
return this._idToken;
|
|
82
|
+
}
|
|
83
|
+
set idToken(e) {
|
|
84
|
+
this._idToken !== e && (this._idToken = e, this.gamerToken = "");
|
|
85
|
+
}
|
|
86
|
+
get weixinToken() {
|
|
87
|
+
return this._weixinToken;
|
|
88
|
+
}
|
|
89
|
+
set weixinToken(e) {
|
|
90
|
+
this._weixinToken !== e && (this._weixinToken = e, this.gamerToken = "");
|
|
91
|
+
}
|
|
92
|
+
get gamerToken() {
|
|
93
|
+
return this._gamerToken;
|
|
94
|
+
}
|
|
95
|
+
set gamerToken(e) {
|
|
96
|
+
this._gamerToken = e, e ? this.storage.set(d, `${Date.now()}#${e}`) : this.storage.remove(d);
|
|
97
|
+
}
|
|
98
|
+
logout() {
|
|
99
|
+
this._idToken = "", this._weixinToken = "", this.gamerToken = "";
|
|
100
|
+
}
|
|
101
|
+
async autoLogin() {
|
|
102
|
+
if (this.gamerToken) return !0;
|
|
103
|
+
let e = c();
|
|
104
|
+
if (!this.idToken || e && !this.weixinToken) return !1;
|
|
105
|
+
let { code: t, data: n } = await this.req.post("login-with-token", a({
|
|
106
|
+
id_token: this.idToken,
|
|
107
|
+
weixin_token: e ? this.weixinToken : null
|
|
108
|
+
}), ae, {
|
|
109
|
+
message: !1,
|
|
110
|
+
cacheTTL: 300,
|
|
111
|
+
cacheResolve: () => `${this.idToken}_${e ? this.weixinToken : "null"}`
|
|
112
|
+
});
|
|
113
|
+
switch (t) {
|
|
114
|
+
case "invalid_id_token":
|
|
115
|
+
this.idToken = "";
|
|
116
|
+
break;
|
|
117
|
+
case "invalid_weixin_token":
|
|
118
|
+
this.weixinToken = "";
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
return this.gamerToken = n?.gamer_token || "", !!this.gamerToken;
|
|
122
|
+
}
|
|
123
|
+
async switchGame(e) {
|
|
124
|
+
let t = c();
|
|
125
|
+
if (!this.idToken || t && !this.weixinToken) return !1;
|
|
126
|
+
let { code: n, data: r } = await this.req.post("session/switch-game", a({ game_id: e }), oe, {
|
|
127
|
+
message: !1,
|
|
128
|
+
maxRetry: 2
|
|
129
|
+
});
|
|
130
|
+
switch (n) {
|
|
131
|
+
case "game_not_allowed": return !1;
|
|
132
|
+
}
|
|
133
|
+
return this.gamerToken = r?.gamer_token || "", !!this.gamerToken;
|
|
134
|
+
}
|
|
135
|
+
async getSession() {
|
|
136
|
+
if (!await this.autoLogin()) return null;
|
|
137
|
+
let { data: e } = await this.req.get("session", null, se, { message: !1 });
|
|
138
|
+
return e;
|
|
139
|
+
}
|
|
140
|
+
async authRealName(e) {
|
|
141
|
+
if (!await this.autoLogin()) return null;
|
|
142
|
+
let { data: t } = await this.req.post("auth-real-name", a(e), se);
|
|
143
|
+
return t;
|
|
144
|
+
}
|
|
145
|
+
}, de = {
|
|
146
|
+
Unknown: "unknown",
|
|
147
|
+
Male: "male",
|
|
148
|
+
Female: "female"
|
|
149
|
+
}, fe = u.string().enum(de).lock(), pe = {
|
|
150
|
+
Increase: "increase",
|
|
151
|
+
Decrease: "decrease",
|
|
152
|
+
Expired: "expired"
|
|
153
|
+
}, me = u.string().enum(pe).lock(), he = {
|
|
154
|
+
Order: "order",
|
|
155
|
+
Consumption: "consumption",
|
|
156
|
+
Redeem: "redeem",
|
|
157
|
+
Expire: "expire",
|
|
158
|
+
Admin: "admin",
|
|
159
|
+
Event: "event"
|
|
160
|
+
}, ge = u.string().enum(he).lock(), _e = {
|
|
161
|
+
GameReward: "game_reward",
|
|
162
|
+
Physical: "physical",
|
|
163
|
+
Virtual: "virtual"
|
|
164
|
+
}, f = u.string().enum(_e).lock(), ve = {
|
|
165
|
+
Pending: "pending",
|
|
166
|
+
Issued: "issued",
|
|
167
|
+
Failed: "failed"
|
|
168
|
+
}, ye = u.string().enum(ve).lock(), be = u.object({
|
|
169
|
+
default_avatar_url: u.string(),
|
|
170
|
+
official_avatar_urls: u.array(u.string()),
|
|
171
|
+
default_nickname: u.string(),
|
|
172
|
+
default_bio: u.string(),
|
|
173
|
+
default_role_avatar_url: u.string(),
|
|
174
|
+
level_configs: u.array(u.object({
|
|
175
|
+
level: u.number(),
|
|
176
|
+
exp: u.number(),
|
|
177
|
+
title: u.string()
|
|
178
|
+
})),
|
|
179
|
+
level_valid_days: u.number(),
|
|
180
|
+
benefit_description: u.string(),
|
|
181
|
+
exp_description: u.string(),
|
|
182
|
+
credit_description: u.string(),
|
|
183
|
+
send_role_mail_rate_limit: u.number()
|
|
184
|
+
}).lock(), xe = u.object({
|
|
185
|
+
member_id: u.string(),
|
|
186
|
+
player_id: u.string(),
|
|
187
|
+
exp: u.number(),
|
|
188
|
+
level: u.number(),
|
|
189
|
+
credit: u.number(),
|
|
190
|
+
credit_expiring: u.number(),
|
|
191
|
+
level_change_time: u.number(),
|
|
192
|
+
level_expire_time: u.number()
|
|
193
|
+
}).lock(), Se = u.object({
|
|
194
|
+
server_id: u.string(),
|
|
195
|
+
server_name: u.string()
|
|
196
|
+
}).lock(), Ce = u.object({
|
|
197
|
+
role_id: u.string(),
|
|
198
|
+
role_name: u.string()
|
|
199
|
+
}).lock(), p = u.object({
|
|
200
|
+
...Ce.shape,
|
|
201
|
+
...Se.shape,
|
|
202
|
+
role_level: u.number(),
|
|
203
|
+
last_login_time: u.number()
|
|
204
|
+
}).lock(), we = u.object({
|
|
205
|
+
...p.shape,
|
|
206
|
+
role_fighting: u.number(),
|
|
207
|
+
kin_id: u.string().optional(),
|
|
208
|
+
kin_name: u.string().optional(),
|
|
209
|
+
kin_position: u.string().optional()
|
|
210
|
+
}).lock(), Te = u.object({
|
|
211
|
+
name: u.string(),
|
|
212
|
+
avatar_url: u.string(),
|
|
213
|
+
bio: u.string(),
|
|
214
|
+
gender: fe,
|
|
215
|
+
birthday: u.object({
|
|
216
|
+
year: u.number(),
|
|
217
|
+
month: u.number(),
|
|
218
|
+
day: u.number()
|
|
219
|
+
}),
|
|
220
|
+
social_medias: u.record(u.object({
|
|
221
|
+
homepage_url: u.string(),
|
|
222
|
+
homepage_image_url: u.string()
|
|
223
|
+
}).optional()).optional()
|
|
224
|
+
}).lock(), m = u.object({
|
|
225
|
+
address_id: u.number(),
|
|
226
|
+
recipient: u.string(),
|
|
227
|
+
mobile: u.string(),
|
|
228
|
+
province: u.string(),
|
|
229
|
+
city: u.string(),
|
|
230
|
+
district: u.string(),
|
|
231
|
+
address: u.string(),
|
|
232
|
+
is_default: u.bool()
|
|
233
|
+
}).lock(), Ee = u.object({
|
|
234
|
+
increased_credit: u.number(),
|
|
235
|
+
decreased_credit: u.number(),
|
|
236
|
+
expired_credit: u.number(),
|
|
237
|
+
balance_credit: u.number()
|
|
238
|
+
}).lock(), De = u.object({
|
|
239
|
+
id: u.number(),
|
|
240
|
+
change_type: me,
|
|
241
|
+
change_scene: ge,
|
|
242
|
+
change_credit: u.number(),
|
|
243
|
+
balance: u.number(),
|
|
244
|
+
change_time: u.number(),
|
|
245
|
+
metadata: u.record(u.unknown()).optional()
|
|
246
|
+
}).lock(), h = u.object({
|
|
247
|
+
benefit_id: u.number(),
|
|
248
|
+
name: u.string(),
|
|
249
|
+
img_url: u.string(),
|
|
250
|
+
description: u.string(),
|
|
251
|
+
min_level: u.number(),
|
|
252
|
+
max_level: u.number(),
|
|
253
|
+
product_id: u.number(),
|
|
254
|
+
tag: u.string()
|
|
255
|
+
}).lock(), g = u.object({
|
|
256
|
+
product_id: u.number(),
|
|
257
|
+
catalog_id: u.number(),
|
|
258
|
+
catalog_name: u.string(),
|
|
259
|
+
item_type: f,
|
|
260
|
+
name: u.string(),
|
|
261
|
+
img_url: u.string(),
|
|
262
|
+
description: u.string(),
|
|
263
|
+
tag: u.string(),
|
|
264
|
+
price: u.number(),
|
|
265
|
+
stock: u.number(),
|
|
266
|
+
redeem_quantity: u.number(),
|
|
267
|
+
not_visible_before: u.number(),
|
|
268
|
+
not_visible_after: u.number(),
|
|
269
|
+
not_before: u.number(),
|
|
270
|
+
not_after: u.number(),
|
|
271
|
+
min_level: u.number(),
|
|
272
|
+
max_level: u.number(),
|
|
273
|
+
limit_daily: u.number(),
|
|
274
|
+
limit_monthly: u.number(),
|
|
275
|
+
limit_yearly: u.number(),
|
|
276
|
+
limit_total: u.number(),
|
|
277
|
+
weight: u.number(),
|
|
278
|
+
created_at: u.number(),
|
|
279
|
+
updated_at: u.number(),
|
|
280
|
+
redeemable_quantity: u.number().optional()
|
|
281
|
+
}).lock(), Oe = u.object({
|
|
282
|
+
...r(h.shape, "tag"),
|
|
283
|
+
product: g.clone().optional()
|
|
284
|
+
}).lock(), ke = u.union(u.object({
|
|
285
|
+
server_id: u.string(),
|
|
286
|
+
role_id: u.string()
|
|
287
|
+
}), u.object({ address_id: u.number() })).satisfies().lock(), Ae = u.object({
|
|
288
|
+
recipient: u.string(),
|
|
289
|
+
mobile: u.string(),
|
|
290
|
+
province: u.string(),
|
|
291
|
+
city: u.string(),
|
|
292
|
+
district: u.string(),
|
|
293
|
+
address: u.string(),
|
|
294
|
+
express_company: u.string(),
|
|
295
|
+
express_number: u.string()
|
|
296
|
+
}).lock(), je = u.object({
|
|
297
|
+
server_id: u.string(),
|
|
298
|
+
role_id: u.string(),
|
|
299
|
+
role_name: u.string()
|
|
300
|
+
}).lock(), Me = u.object({
|
|
301
|
+
redemption_id: u.number(),
|
|
302
|
+
player_id: u.string(),
|
|
303
|
+
product_id: u.number(),
|
|
304
|
+
name: u.string(),
|
|
305
|
+
img_url: u.string(),
|
|
306
|
+
item_type: f,
|
|
307
|
+
catalog_id: u.number(),
|
|
308
|
+
catalog_name: u.string(),
|
|
309
|
+
quantity: u.number(),
|
|
310
|
+
amount: u.number(),
|
|
311
|
+
status: ye,
|
|
312
|
+
created_at: u.number(),
|
|
313
|
+
extra_data: u.union(Ae.clone(), je.clone()).satisfies().optional()
|
|
314
|
+
}), Ne = u.guard(be), _ = l({ player: xe }), Pe = l({ roles: u.array(p) }), v = l({ role_card: we }), y = u.guard(Te), b = u.guard(m), Fe = l({ addresses: u.array(m) }), Ie = u.guard(Ee), Le = l({
|
|
315
|
+
credit_logs: u.array(De),
|
|
316
|
+
next_token: u.string().optional()
|
|
317
|
+
}), Re = l({ products: u.array(g) }), ze = l({ benefits: u.array(h) }), Be = l({ benefit: Oe }), Ve = l({
|
|
318
|
+
redemptions: u.array(Me),
|
|
319
|
+
next_token: u.string().optional()
|
|
320
|
+
}), He = l({
|
|
321
|
+
existed: u.bool(),
|
|
322
|
+
image_upload_url: u.string().optional(),
|
|
323
|
+
image_id: u.string()
|
|
324
|
+
}), Ue = class {
|
|
325
|
+
token;
|
|
326
|
+
req;
|
|
327
|
+
constructor(e) {
|
|
328
|
+
this.token = e, this.req = e.req;
|
|
329
|
+
}
|
|
330
|
+
async getConfig(e) {
|
|
331
|
+
await this.token.autoLogin();
|
|
332
|
+
let { data: t } = await this.req.get("club/config", null, Ne, e);
|
|
333
|
+
return t;
|
|
334
|
+
}
|
|
335
|
+
async getCurrentPlayer(e) {
|
|
336
|
+
await this.token.autoLogin();
|
|
337
|
+
let { data: t, code: n, message: r } = await this.req.get("club/current-player", null, _, e);
|
|
338
|
+
return t?.player ?? {
|
|
339
|
+
message: r,
|
|
340
|
+
error: n
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
async linkPlayer(e) {
|
|
344
|
+
await this.token.autoLogin();
|
|
345
|
+
let { data: t, code: n, message: r } = await this.req.post("club/link-player", { id_token: this.token.idToken }, _, e);
|
|
346
|
+
return t?.player ?? {
|
|
347
|
+
message: r,
|
|
348
|
+
error: n
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
async getRoles(e, t, n) {
|
|
352
|
+
if (!await this.token.autoLogin()) return [];
|
|
353
|
+
let { data: r } = await this.req.get("club/roles", {
|
|
354
|
+
player_id: e,
|
|
355
|
+
refresh: t
|
|
356
|
+
}, Pe, n);
|
|
357
|
+
return r?.roles || [];
|
|
358
|
+
}
|
|
359
|
+
async getRoleCard(e, t) {
|
|
360
|
+
await this.token.autoLogin();
|
|
361
|
+
let { data: n } = await this.req.get("club/role-card", { member_id: e }, v, t);
|
|
362
|
+
return n?.role_card ?? null;
|
|
363
|
+
}
|
|
364
|
+
async setRoleCard(e, t) {
|
|
365
|
+
if (!await this.token.autoLogin()) return null;
|
|
366
|
+
let { data: n } = await this.req.post("club/role-card", e, v, t);
|
|
367
|
+
return n?.role_card ?? null;
|
|
368
|
+
}
|
|
369
|
+
async refreshRoleCard(e) {
|
|
370
|
+
if (!await this.token.autoLogin()) return null;
|
|
371
|
+
let { data: t } = await this.req.post("club/refresh-role-card", {}, v, e);
|
|
372
|
+
return t?.role_card ?? null;
|
|
373
|
+
}
|
|
374
|
+
async getUserProfile(e, t) {
|
|
375
|
+
await this.token.autoLogin();
|
|
376
|
+
let { data: n } = await this.req.get("club/user-profile", { member_id: e }, y, t);
|
|
377
|
+
return n;
|
|
378
|
+
}
|
|
379
|
+
async updateUserProfile(e, t) {
|
|
380
|
+
if (Object.keys(e).length === 0) return {
|
|
381
|
+
error: "OptionIsEmpty",
|
|
382
|
+
message: "请提供需要修改的信息"
|
|
383
|
+
};
|
|
384
|
+
await this.token.autoLogin();
|
|
385
|
+
let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e, y, t);
|
|
386
|
+
return n ?? {
|
|
387
|
+
message: i,
|
|
388
|
+
error: r
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
async getAddresses(e) {
|
|
392
|
+
if (!await this.token.autoLogin()) return [];
|
|
393
|
+
let { data: t } = await this.req.get("club/addresses", null, Fe, e);
|
|
394
|
+
return t?.addresses ?? [];
|
|
395
|
+
}
|
|
396
|
+
async addAddress(e, t) {
|
|
397
|
+
if (!await this.token.autoLogin()) return null;
|
|
398
|
+
let { data: n, code: r, message: i } = await this.req.post("/club/add-address", a(e), b, t);
|
|
399
|
+
return n ?? {
|
|
400
|
+
message: i,
|
|
401
|
+
error: r
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
async updateAddress(e, t) {
|
|
405
|
+
await this.token.autoLogin();
|
|
406
|
+
let { data: n, code: r, message: i } = await this.req.post("club/update-address", a(e), b, t);
|
|
407
|
+
return n ?? {
|
|
408
|
+
message: i,
|
|
409
|
+
error: r
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
async deleteAddress(e, t) {
|
|
413
|
+
if (!await this.token.autoLogin()) return null;
|
|
414
|
+
let { ok: n } = await this.req.post("club/delete-address", { address_id: e }, null, t);
|
|
415
|
+
return n;
|
|
416
|
+
}
|
|
417
|
+
async getUserCredit(e, t) {
|
|
418
|
+
await this.token.autoLogin();
|
|
419
|
+
let { data: n, code: r, message: i } = await this.req.get("club/user-credit", { ...e }, Ie, t);
|
|
420
|
+
return n ?? {
|
|
421
|
+
message: i,
|
|
422
|
+
error: r
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
async getCreditLogs(e, t) {
|
|
426
|
+
await this.token.autoLogin();
|
|
427
|
+
let { data: n } = await this.req.get("club/credit-logs", {
|
|
428
|
+
max_results: 20,
|
|
429
|
+
...e
|
|
430
|
+
}, Le, t);
|
|
431
|
+
return {
|
|
432
|
+
credit_logs: n?.credit_logs || [],
|
|
433
|
+
next_token: n?.next_token
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
async getBenefits(e) {
|
|
437
|
+
if (!await this.token.autoLogin()) return [];
|
|
438
|
+
let { data: t } = await this.req.get("club/benefits", null, ze, e);
|
|
439
|
+
return t?.benefits || [];
|
|
440
|
+
}
|
|
441
|
+
async getBenefit(e, t) {
|
|
442
|
+
if (!await this.token.autoLogin()) return null;
|
|
443
|
+
let { data: n } = await this.req.get("club/benefit", { benefit_id: e }, Be, t);
|
|
444
|
+
return n?.benefit || null;
|
|
445
|
+
}
|
|
446
|
+
async getProducts(e, t) {
|
|
447
|
+
await this.token.autoLogin();
|
|
448
|
+
let { data: n } = await this.req.get("club/products", e || null, Re, t);
|
|
449
|
+
return n?.products || [];
|
|
450
|
+
}
|
|
451
|
+
async redeemProduct(e, t) {
|
|
452
|
+
await this.token.autoLogin();
|
|
453
|
+
let { ok: n, code: r, message: i } = await this.req.post("club/redeem-product", a(e), null, t);
|
|
454
|
+
return n || {
|
|
455
|
+
message: i,
|
|
456
|
+
error: r
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
async getRedemptions(e, t) {
|
|
460
|
+
await this.token.autoLogin();
|
|
461
|
+
let { data: n } = await this.req.get("club/redemptions", {
|
|
462
|
+
max_results: 20,
|
|
463
|
+
...e
|
|
464
|
+
}, Ve, t);
|
|
465
|
+
return {
|
|
466
|
+
redemptions: n?.redemptions || [],
|
|
467
|
+
next_token: n?.next_token
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
async clubUploadImage(e, t) {
|
|
471
|
+
await this.token.autoLogin();
|
|
472
|
+
let { data: n, code: r, message: i } = await this.req.post("club/image-upload-url", a(e), He, t);
|
|
473
|
+
return n ?? {
|
|
474
|
+
message: i,
|
|
475
|
+
error: r
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
}, We = class {
|
|
479
|
+
token;
|
|
480
|
+
req;
|
|
481
|
+
_event = 0;
|
|
482
|
+
get event() {
|
|
483
|
+
return this._event;
|
|
484
|
+
}
|
|
485
|
+
constructor(e, t) {
|
|
486
|
+
this._event = +t, this.token = e, this.req = e.req;
|
|
487
|
+
}
|
|
488
|
+
bind(e) {
|
|
489
|
+
let t = this;
|
|
490
|
+
for (let [n, r] of Object.entries(e)) r && (t[n] = r.bind(this));
|
|
491
|
+
return t;
|
|
492
|
+
}
|
|
493
|
+
}, x = {
|
|
494
|
+
EventItem: "event_item",
|
|
495
|
+
GameItem: "game_item",
|
|
496
|
+
PhysicalItem: "physical_item",
|
|
497
|
+
WeixinHongbao: "weixin_hongbao",
|
|
498
|
+
GiftCode: "gift_code",
|
|
499
|
+
ActivationKey: "activation_key",
|
|
500
|
+
LotteryTicket: "lottery_ticket",
|
|
501
|
+
ClubCredit: "club_credit",
|
|
502
|
+
ClubExp: "club_exp",
|
|
503
|
+
ExternalCode: "external_gift_code",
|
|
504
|
+
VoidItem: "void_item"
|
|
505
|
+
}, S = u.string().enum(x).lock(), Ge = x, C = S, w = {
|
|
506
|
+
UserId: "user_id",
|
|
507
|
+
RoleId: "role_id"
|
|
508
|
+
}, Ke = u.string().enum(w).lock(), qe = {
|
|
509
|
+
None: "none",
|
|
510
|
+
Daily: "daily",
|
|
511
|
+
Weekly: "weekly",
|
|
512
|
+
Monthly: "monthly"
|
|
513
|
+
}, Je = u.string().enum(qe).lock(), T = {
|
|
514
|
+
Preregister: "preregister",
|
|
515
|
+
Lottery: "lottery",
|
|
516
|
+
Survey: "survey",
|
|
517
|
+
Invite: "invite",
|
|
518
|
+
Share: "share",
|
|
519
|
+
Follow: "follow",
|
|
520
|
+
Subscribe: "weixin_subscribe",
|
|
521
|
+
Comment: "comment",
|
|
522
|
+
Vote: "vote",
|
|
523
|
+
Vote2: "vote2",
|
|
524
|
+
GiftCode: "gift_code",
|
|
525
|
+
Register: "register",
|
|
526
|
+
InvitedRegister: "invited_register",
|
|
527
|
+
ClaimRewards: "claim_rewards",
|
|
528
|
+
Cashback: "cashback",
|
|
529
|
+
Quest: "quest",
|
|
530
|
+
Team: "team",
|
|
531
|
+
LotteryDraw: "lottery_draw",
|
|
532
|
+
CheckIn: "check_in",
|
|
533
|
+
ClaimActivationKey: "claim_activation_key",
|
|
534
|
+
ZeroChatgpt: "zero_chatgpt",
|
|
535
|
+
Ugc: "ugc",
|
|
536
|
+
UgcLike: "ugc_like",
|
|
537
|
+
Redeem: "redeem"
|
|
538
|
+
}, Ye = u.string().enum(T).lock(), Xe = {
|
|
539
|
+
Active: "player_active_points",
|
|
540
|
+
Login: "player_login_days",
|
|
541
|
+
OrderAmount: "order_total_amount",
|
|
542
|
+
OrderCount: "order_total_count",
|
|
543
|
+
Posts: "community_posts",
|
|
544
|
+
Comments: "community_comments",
|
|
545
|
+
MatchCounts: "player_match_counts",
|
|
546
|
+
MatchDays: "player_match_days",
|
|
547
|
+
PlayerLevel: "player_level",
|
|
548
|
+
EventItems: "event_items",
|
|
549
|
+
GameTask: "game_task",
|
|
550
|
+
OrderAmountInApp: "order_in_app_total_amount",
|
|
551
|
+
OrderAmountInPayCenter: "order_seayoo_web_total_amount",
|
|
552
|
+
TeamSize: "team_size",
|
|
553
|
+
UserGroup: "user_group"
|
|
554
|
+
}, E = u.string().enum(Xe).lock(), Ze = {
|
|
555
|
+
System: "system",
|
|
556
|
+
UserSubmission: "user_submission",
|
|
557
|
+
Shortlisted: "shortlisted"
|
|
558
|
+
}, Qe = u.string().enum(Ze).lock(), D = {
|
|
559
|
+
Ineligible: "ineligible",
|
|
560
|
+
Unclaimed: "unclaimed",
|
|
561
|
+
Received: "received",
|
|
562
|
+
Failed: "failed",
|
|
563
|
+
Delivered: "delivered"
|
|
564
|
+
}, O = u.string().enum(D).lock(), $e = {
|
|
565
|
+
Ineligible: D.Ineligible,
|
|
566
|
+
Unclaimed: D.Unclaimed,
|
|
567
|
+
Received: D.Received,
|
|
568
|
+
Failed: D.Failed,
|
|
569
|
+
Delivered: D.Delivered
|
|
570
|
+
}, k = u.string().enum($e).lock(), et = {
|
|
571
|
+
Output: "output",
|
|
572
|
+
Engage: "engage"
|
|
573
|
+
}, A = u.string().enum(et).lock(), tt = {
|
|
574
|
+
Private: "private",
|
|
575
|
+
Public: "public"
|
|
576
|
+
}, nt = u.string().enum(tt).lock(), j = {
|
|
577
|
+
Unknown: "unknown",
|
|
578
|
+
Pending: "pending",
|
|
579
|
+
Drawn: "drawn",
|
|
580
|
+
Claimed: "claimed",
|
|
581
|
+
Fail: "fail"
|
|
582
|
+
}, rt = u.string().enum(j).lock(), it = {
|
|
583
|
+
Assemble: "assemble",
|
|
584
|
+
Join: "join",
|
|
585
|
+
Disband: "disband",
|
|
586
|
+
ChangeVisibility: "change_visibility",
|
|
587
|
+
Query: "query"
|
|
588
|
+
}, at = u.string().enum(it).lock(), ot = {
|
|
589
|
+
Query: "query",
|
|
590
|
+
Draw: "draw",
|
|
591
|
+
Claim: "claim"
|
|
592
|
+
}, st = u.string().enum(ot).lock(), ct = {
|
|
593
|
+
Sum: "sum",
|
|
594
|
+
TopN: "top_n"
|
|
595
|
+
}, lt = u.string().enum(ct).lock(), ut = {
|
|
596
|
+
None: "none",
|
|
597
|
+
Winner: "winner",
|
|
598
|
+
Consolation: "consolation"
|
|
599
|
+
}, dt = u.string().enum(ut).lock(), ft = {
|
|
600
|
+
Douyin: "douyin",
|
|
601
|
+
Xiaohongshu: "xiaohongshu",
|
|
602
|
+
Taptap: "taptap",
|
|
603
|
+
Bilibili: "bilibili",
|
|
604
|
+
Weibo: "weibo",
|
|
605
|
+
Huya: "huya",
|
|
606
|
+
Douyu: "douyu",
|
|
607
|
+
Kuaishou: "kuaishou"
|
|
608
|
+
}, M = u.string().enum(ft).lock(), pt = {
|
|
609
|
+
Submitted: "submitted",
|
|
610
|
+
Accepted: "accepted",
|
|
611
|
+
Rejected: "rejected"
|
|
612
|
+
}, mt = u.string().enum(pt).lock(), ht = u.string().enum(x), N = u.object({
|
|
613
|
+
reward_item_id: u.number(),
|
|
614
|
+
reward_amount: u.number(),
|
|
615
|
+
reward_item_name: u.string(),
|
|
616
|
+
reward_item_icon_url: u.string(),
|
|
617
|
+
reward_item_desc: u.string().optional(),
|
|
618
|
+
reward_item_type: ht,
|
|
619
|
+
reward_item_rating: u.number()
|
|
620
|
+
}).lock(), gt = u.object({
|
|
621
|
+
engage_count: u.number(),
|
|
622
|
+
rewards: u.array(N)
|
|
623
|
+
}).lock(), _t = u.union(u.object({
|
|
624
|
+
feature_reward_type: u.string().enum("every"),
|
|
625
|
+
reward_details: u.array(N)
|
|
626
|
+
}), u.object({
|
|
627
|
+
feature_reward_type: u.string().enum("regular"),
|
|
628
|
+
reward_details: u.array(gt)
|
|
629
|
+
})).satisfies().lock(), P = u.object({
|
|
630
|
+
feature_name: u.string(),
|
|
631
|
+
feature_id: u.number(),
|
|
632
|
+
description: u.string(),
|
|
633
|
+
cycle: Je,
|
|
634
|
+
cycle_limit: u.number(),
|
|
635
|
+
limit: u.number(),
|
|
636
|
+
since: u.number(),
|
|
637
|
+
until: u.number(),
|
|
638
|
+
engage_account: Ke,
|
|
639
|
+
feature_rewards: _t.clone().optional(),
|
|
640
|
+
sort: u.number().optional()
|
|
641
|
+
}), vt = T.Cashback, yt = u.object({
|
|
642
|
+
...P.shape,
|
|
643
|
+
feature_type: u.string().enum(vt),
|
|
644
|
+
config: u.object({
|
|
645
|
+
order_start_time: u.number(),
|
|
646
|
+
order_end_time: u.number(),
|
|
647
|
+
claim_rewards_start_time: u.number(),
|
|
648
|
+
claim_rewards_end_time: u.number()
|
|
649
|
+
})
|
|
650
|
+
}), bt = T.CheckIn, xt = u.object({
|
|
651
|
+
...P.shape,
|
|
652
|
+
feature_type: u.string().enum(bt)
|
|
653
|
+
}), St = T.ClaimActivationKey, Ct = u.object({
|
|
654
|
+
...P.shape,
|
|
655
|
+
feature_type: u.string().enum(St)
|
|
656
|
+
}), wt = T.ClaimRewards, Tt = u.object({
|
|
657
|
+
...P.shape,
|
|
658
|
+
feature_type: u.string().enum(wt)
|
|
659
|
+
}), Et = T.Comment, Dt = u.object({
|
|
660
|
+
...P.shape,
|
|
661
|
+
feature_type: u.string().enum(Et),
|
|
662
|
+
config: u.object({
|
|
663
|
+
comments: u.array(u.string()),
|
|
664
|
+
send_rate: u.number()
|
|
665
|
+
})
|
|
666
|
+
}), Ot = T.Follow, kt = u.object({
|
|
667
|
+
...P.shape,
|
|
668
|
+
feature_type: u.string().enum(Ot),
|
|
669
|
+
config: u.object({
|
|
670
|
+
platform: u.string(),
|
|
671
|
+
platform_icon: u.string().optional(),
|
|
672
|
+
link: u.string().optional(),
|
|
673
|
+
qr_code_url: u.string().optional(),
|
|
674
|
+
platform_desc: u.string().optional()
|
|
675
|
+
})
|
|
676
|
+
}), At = T.GiftCode, jt = u.object({
|
|
677
|
+
name: u.string(),
|
|
678
|
+
icon_url: u.string(),
|
|
679
|
+
count: u.number()
|
|
680
|
+
}), Mt = u.object({
|
|
681
|
+
...P.shape,
|
|
682
|
+
feature_type: u.string().enum(At),
|
|
683
|
+
config: u.object({
|
|
684
|
+
gift_items: u.array(jt),
|
|
685
|
+
mp_url: u.string().optional(),
|
|
686
|
+
mp_qrcode_url: u.string().optional()
|
|
687
|
+
})
|
|
688
|
+
}), Nt = T.Invite, Pt = u.object({
|
|
689
|
+
...P.shape,
|
|
690
|
+
feature_type: u.string().enum(Nt),
|
|
691
|
+
config: u.object({ share_url: u.string() })
|
|
692
|
+
}), Ft = T.InvitedRegister, It = u.object({
|
|
693
|
+
...P.shape,
|
|
694
|
+
feature_type: u.string().enum(Ft)
|
|
695
|
+
}), Lt = u.string().enum(r(x, "GiftCode", "LotteryTicket")), Rt = T.Lottery, zt = u.object({
|
|
696
|
+
reward_item_id: u.number(),
|
|
697
|
+
reward_item_name: u.string(),
|
|
698
|
+
reward_item_type: Lt,
|
|
699
|
+
reward_item_icon_url: u.string(),
|
|
700
|
+
reward_item_desc: u.string().optional(),
|
|
701
|
+
reward_amount: u.number(),
|
|
702
|
+
reward_remaining_stock: u.number(),
|
|
703
|
+
reward_item_rating: u.number()
|
|
704
|
+
}), Bt = u.object({
|
|
705
|
+
...P.shape,
|
|
706
|
+
feature_type: u.string().enum(Rt),
|
|
707
|
+
config: u.object({
|
|
708
|
+
consume_item_id: u.number(),
|
|
709
|
+
consume_item_name: u.string(),
|
|
710
|
+
consume_item_icon_url: u.string(),
|
|
711
|
+
consume_item_count: u.array(u.number()),
|
|
712
|
+
consume_item_desc: u.string().optional(),
|
|
713
|
+
rewards: u.array(zt)
|
|
714
|
+
})
|
|
715
|
+
}), Vt = T.LotteryDraw, Ht = u.object({
|
|
716
|
+
...P.shape,
|
|
717
|
+
feature_type: u.string().enum(Vt),
|
|
718
|
+
config: u.object({
|
|
719
|
+
draw_not_before: u.number(),
|
|
720
|
+
draw_not_after: u.number()
|
|
721
|
+
})
|
|
722
|
+
}), Ut = T.Preregister, Wt = u.object({
|
|
723
|
+
...P.shape,
|
|
724
|
+
feature_type: u.string().enum(Ut)
|
|
725
|
+
}), Gt = T.Quest, Kt = u.object({
|
|
726
|
+
...P.shape,
|
|
727
|
+
feature_type: u.string().enum(Gt),
|
|
728
|
+
config: u.object({
|
|
729
|
+
objective: E,
|
|
730
|
+
completion_value: u.number(),
|
|
731
|
+
team: u.object({
|
|
732
|
+
feature_id: u.number().optional(),
|
|
733
|
+
completion_value: u.number(),
|
|
734
|
+
progress_algorithm: lt.clone().optional(),
|
|
735
|
+
top_n: u.number().optional()
|
|
736
|
+
}).optional(),
|
|
737
|
+
config: u.object({
|
|
738
|
+
topic_id: u.number().optional(),
|
|
739
|
+
required_players: u.number().min(1).optional(),
|
|
740
|
+
required_matches: u.number().min(1).optional(),
|
|
741
|
+
event_item_id: u.number().optional()
|
|
742
|
+
}).optional()
|
|
743
|
+
})
|
|
744
|
+
}), qt = T.Redeem, Jt = u.object({
|
|
745
|
+
price: u.number(),
|
|
746
|
+
per_user_limit: u.number(),
|
|
747
|
+
item: N
|
|
748
|
+
}), Yt = u.object({
|
|
749
|
+
...P.shape,
|
|
750
|
+
feature_type: u.string().enum(qt),
|
|
751
|
+
config: u.object({
|
|
752
|
+
event_item_id: u.number(),
|
|
753
|
+
redeem_catalog: u.array(Jt)
|
|
754
|
+
})
|
|
755
|
+
}), Xt = T.Register, Zt = u.object({
|
|
756
|
+
...P.shape,
|
|
757
|
+
feature_type: u.string().enum(Xt)
|
|
758
|
+
}), Qt = T.Share, $t = u.object({
|
|
759
|
+
...P.shape,
|
|
760
|
+
feature_type: u.string().enum(Qt),
|
|
761
|
+
config: u.object({
|
|
762
|
+
share_platform: u.string(),
|
|
763
|
+
jump_url: u.string().optional(),
|
|
764
|
+
icon_url: u.string().optional()
|
|
765
|
+
})
|
|
766
|
+
}), en = T.Subscribe, tn = u.object({
|
|
767
|
+
...P.shape,
|
|
768
|
+
feature_type: u.string().enum(en),
|
|
769
|
+
config: u.object({ weixin_template_ids: u.array(u.string()) })
|
|
770
|
+
}), nn = T.Survey, rn = u.object({
|
|
771
|
+
...P.shape,
|
|
772
|
+
feature_type: u.string().enum(nn),
|
|
773
|
+
config: u.object({
|
|
774
|
+
survey_id: u.string(),
|
|
775
|
+
survey_url: u.string()
|
|
776
|
+
})
|
|
777
|
+
}), an = T.Team, on = u.object({
|
|
778
|
+
...P.shape,
|
|
779
|
+
feature_type: u.string().enum(an),
|
|
780
|
+
config: u.object({
|
|
781
|
+
max_members: u.number().min(1),
|
|
782
|
+
min_members: u.number().min(1)
|
|
783
|
+
})
|
|
784
|
+
}), sn = T.Ugc, cn = u.object({
|
|
785
|
+
...P.shape,
|
|
786
|
+
feature_type: u.string().enum(sn),
|
|
787
|
+
config: u.object({
|
|
788
|
+
allowed_social_medias: u.array(u.string()).optional(),
|
|
789
|
+
acceptance_rewards: u.array(N).optional()
|
|
790
|
+
})
|
|
791
|
+
}), ln = T.UgcLike, un = u.object({
|
|
792
|
+
...P.shape,
|
|
793
|
+
feature_type: u.string().enum(ln),
|
|
794
|
+
config: u.object({ ugc_feature_id: u.number() })
|
|
795
|
+
}), dn = T.Vote, fn = u.object({
|
|
796
|
+
sn: u.string(),
|
|
797
|
+
name: u.string(),
|
|
798
|
+
img_urls: u.array(u.string()).optional(),
|
|
799
|
+
video_urls: u.array(u.string()).optional(),
|
|
800
|
+
descriptions: u.array(u.string()).optional(),
|
|
801
|
+
jump_url: u.string(),
|
|
802
|
+
amount: u.number(),
|
|
803
|
+
finalists: u.bool(),
|
|
804
|
+
last_vote_time: u.number()
|
|
805
|
+
}), pn = u.object({
|
|
806
|
+
...P.shape,
|
|
807
|
+
feature_type: u.string().enum(dn),
|
|
808
|
+
config: u.object({
|
|
809
|
+
vote_feature_ids: u.array(u.number()),
|
|
810
|
+
submission_feature_ids: u.array(u.number()),
|
|
811
|
+
finalists_amount: u.number(),
|
|
812
|
+
source: Qe,
|
|
813
|
+
options: u.array(fn),
|
|
814
|
+
rewards: u.array(N)
|
|
815
|
+
})
|
|
816
|
+
}), F = u.union(u.string().pattern("NumberString", /^\d+$/), u.number()), I = u.object({
|
|
817
|
+
order_total_amount: F,
|
|
818
|
+
cashback_total_amount: F,
|
|
819
|
+
game_item_count: F
|
|
820
|
+
}), mn = u.object({ activation_key: u.string().disallow("") }), hn = u.object({ gift_code: u.string() }), gn = u.object({
|
|
821
|
+
user_id: u.string(),
|
|
822
|
+
name: u.string().optional(),
|
|
823
|
+
avatar_url: u.string().optional()
|
|
824
|
+
}), _n = u.object({ lottery_count: u.number() }), L = u.object({
|
|
825
|
+
reward_id: u.number(),
|
|
826
|
+
reward_item_id: u.number(),
|
|
827
|
+
reward_source: A,
|
|
828
|
+
reward_item_name: u.string(),
|
|
829
|
+
reward_item_type: S,
|
|
830
|
+
reward_item_icon_url: u.string(),
|
|
831
|
+
reward_item_desc: u.string().optional(),
|
|
832
|
+
reward_item_rating: u.number(),
|
|
833
|
+
reward_amount: u.number(),
|
|
834
|
+
reward_status: k,
|
|
835
|
+
event_id: u.number(),
|
|
836
|
+
event_name: u.string(),
|
|
837
|
+
feature_id: u.number(),
|
|
838
|
+
engagement_id: u.number(),
|
|
839
|
+
feature_type: Ye,
|
|
840
|
+
receive_time: u.number(),
|
|
841
|
+
extra_data: u.record(u.unknown()).optional()
|
|
842
|
+
}), vn = u.string().enum(j.Unknown, j.Pending), yn = u.union(u.object({
|
|
843
|
+
ticket: u.string(),
|
|
844
|
+
status: vn,
|
|
845
|
+
created_at: u.number()
|
|
846
|
+
}), u.object({
|
|
847
|
+
ticket: u.string(),
|
|
848
|
+
status: u.string().enum(r(j, "Unknown", "Pending")),
|
|
849
|
+
created_at: u.number(),
|
|
850
|
+
reward: L
|
|
851
|
+
})).satisfies(), bn = u.object({ tickets: u.array(yn) }), xn = u.object({ platforms: u.array(u.string()) }), Sn = u.object({
|
|
852
|
+
role_name: u.string(),
|
|
853
|
+
is_leader: u.bool(),
|
|
854
|
+
is_myself: u.bool().optional(),
|
|
855
|
+
progress: u.number().optional(),
|
|
856
|
+
avatar_url: u.string().optional()
|
|
857
|
+
}).lock(), Cn = u.object({
|
|
858
|
+
objective: E,
|
|
859
|
+
progress: u.number(),
|
|
860
|
+
completion_value: u.number().optional(),
|
|
861
|
+
team: u.object({
|
|
862
|
+
progress: u.number(),
|
|
863
|
+
completion_value: u.number().optional(),
|
|
864
|
+
players: u.array(Sn)
|
|
865
|
+
}).optional()
|
|
866
|
+
}), wn = u.object({
|
|
867
|
+
progress: u.number(),
|
|
868
|
+
team: u.object({
|
|
869
|
+
progress: u.number(),
|
|
870
|
+
team_members: u.array(Sn).optional()
|
|
871
|
+
}).optional()
|
|
872
|
+
}), Tn = u.object({
|
|
873
|
+
item_id: u.number(),
|
|
874
|
+
item_count: u.number(),
|
|
875
|
+
redeem_count: u.number()
|
|
876
|
+
}), En = u.object({ item_stocks: u.array(u.object({
|
|
877
|
+
item_id: u.number(),
|
|
878
|
+
item_stock: u.number(),
|
|
879
|
+
user_limit: u.number()
|
|
880
|
+
})) }), Dn = u.object({ platform: u.string().optional() }), On = u.object({ weixin_openid: u.string() }), kn = u.object({ serial_number: u.number() }), An = u.object({
|
|
881
|
+
team_code: u.string(),
|
|
882
|
+
leader_name: u.string(),
|
|
883
|
+
total_members: u.number()
|
|
884
|
+
}), jn = u.object({
|
|
885
|
+
is_leader: u.bool(),
|
|
886
|
+
is_myself: u.bool().optional(),
|
|
887
|
+
role_name: u.string(),
|
|
888
|
+
server_name: u.string(),
|
|
889
|
+
avatar_url: u.string().optional()
|
|
890
|
+
}), Mn = u.object({
|
|
891
|
+
team_code: u.string(),
|
|
892
|
+
visibility: nt,
|
|
893
|
+
members: u.array(u.object({
|
|
894
|
+
is_leader: u.bool(),
|
|
895
|
+
role_name: u.string(),
|
|
896
|
+
server_name: u.string()
|
|
897
|
+
}))
|
|
898
|
+
}), Nn = u.object({
|
|
899
|
+
ugc_id: u.number(),
|
|
900
|
+
title: u.string(),
|
|
901
|
+
content: u.string().optional(),
|
|
902
|
+
image_urls: u.array(u.string()).optional(),
|
|
903
|
+
social_media: M.clone().optional(),
|
|
904
|
+
social_media_url: u.string().optional()
|
|
905
|
+
}), Pn = u.object({
|
|
906
|
+
ugcs: u.array(u.object({
|
|
907
|
+
ugc_id: u.number(),
|
|
908
|
+
event_id: u.number().optional(),
|
|
909
|
+
feature_id: u.number().optional(),
|
|
910
|
+
title: u.string(),
|
|
911
|
+
content: u.string().optional(),
|
|
912
|
+
image_urls: u.array(u.string()).optional(),
|
|
913
|
+
social_media: M.clone().optional(),
|
|
914
|
+
social_media_url: u.string().optional(),
|
|
915
|
+
server_id: u.number().optional(),
|
|
916
|
+
server_name: u.string().optional(),
|
|
917
|
+
role_id: u.string().optional(),
|
|
918
|
+
role_name: u.string().optional(),
|
|
919
|
+
total_likes: u.number().optional(),
|
|
920
|
+
created_at: u.number()
|
|
921
|
+
})).optional(),
|
|
922
|
+
next_token: u.string().optional()
|
|
923
|
+
}), Fn = u.object({
|
|
924
|
+
ugcs: u.array(u.object({
|
|
925
|
+
ugc_id: u.number(),
|
|
926
|
+
event_id: u.number().optional(),
|
|
927
|
+
feature_id: u.number().optional(),
|
|
928
|
+
feature_name: u.string().optional(),
|
|
929
|
+
review_status: mt,
|
|
930
|
+
reviewer_comment: u.string().optional(),
|
|
931
|
+
title: u.string(),
|
|
932
|
+
content: u.string().optional(),
|
|
933
|
+
image_urls: u.array(u.string()).optional(),
|
|
934
|
+
social_media: M.clone().optional(),
|
|
935
|
+
social_media_url: u.string().optional(),
|
|
936
|
+
server_id: u.number().optional(),
|
|
937
|
+
server_name: u.string().optional(),
|
|
938
|
+
role_id: u.string().optional(),
|
|
939
|
+
role_name: u.string().optional(),
|
|
940
|
+
total_likes: u.number().optional(),
|
|
941
|
+
created_at: u.number()
|
|
942
|
+
})).optional(),
|
|
943
|
+
next_token: u.string().optional()
|
|
944
|
+
}), In = u.object({ total_count: u.number() }), Ln = u.object({
|
|
945
|
+
existed: u.bool(),
|
|
946
|
+
upload_url: u.string().optional(),
|
|
947
|
+
image_url: u.string()
|
|
948
|
+
}), Rn = u.object({ ugcs: u.array(u.object({
|
|
949
|
+
ugc_id: u.number(),
|
|
950
|
+
rank: u.number(),
|
|
951
|
+
total_likes: u.number(),
|
|
952
|
+
image_urls: u.array(u.string()).optional(),
|
|
953
|
+
server_id: u.number().optional(),
|
|
954
|
+
server_name: u.string().optional(),
|
|
955
|
+
role_id: u.string().optional(),
|
|
956
|
+
role_name: u.string().optional()
|
|
957
|
+
})).optional() }), R = u.object({ option_sn: u.string() }), zn = u.object({
|
|
958
|
+
candidate_id: u.string(),
|
|
959
|
+
total_votes: u.number().optional(),
|
|
960
|
+
my_votes: u.number().optional(),
|
|
961
|
+
votes: u.number().optional()
|
|
962
|
+
}), Bn = u.object({
|
|
963
|
+
rewards_type: dt,
|
|
964
|
+
rewards: u.array(L).optional()
|
|
965
|
+
}), Vn = u.object({
|
|
966
|
+
candidate_id: u.string(),
|
|
967
|
+
is_winner: u.bool(),
|
|
968
|
+
total_votes: u.number(),
|
|
969
|
+
my_votes: u.number()
|
|
970
|
+
}), Hn = u.object({
|
|
971
|
+
role: u.string(),
|
|
972
|
+
content: u.string()
|
|
973
|
+
}), Un = u.object({ conversations: u.array(Hn) }), Wn = u.object({
|
|
974
|
+
user_id: u.string(),
|
|
975
|
+
name: u.string(),
|
|
976
|
+
avatar_url: u.string(),
|
|
977
|
+
comment: u.string(),
|
|
978
|
+
video_note: u.number(),
|
|
979
|
+
created_at: u.number()
|
|
980
|
+
}), z = u.union(xn, _n, kn, gn, Dn, R, zn, On, I, hn, Mn, Cn, bn, mn, Un, Nn, Tn, u.custom("EmptyObject", (e) => t(e) && Object.keys(e).length === 0)).satisfies().lock(), Gn = u.object({
|
|
981
|
+
reward_id: u.number(),
|
|
982
|
+
reward_item_id: u.number(),
|
|
983
|
+
reward_item_type: C,
|
|
984
|
+
reward_count: u.number(),
|
|
985
|
+
reward_status: O,
|
|
986
|
+
reward_source: A,
|
|
987
|
+
reward_item_name: u.string(),
|
|
988
|
+
reward_item_icon_url: u.string(),
|
|
989
|
+
reward_item_desc: u.string().optional(),
|
|
990
|
+
reward_item_rating: u.number(),
|
|
991
|
+
receive_time: u.number(),
|
|
992
|
+
extra_data: u.union(...z.validators, u.record(u.unknown())).satisfies().optional()
|
|
993
|
+
}), Kn = u.object({
|
|
994
|
+
reward_id: u.number(),
|
|
995
|
+
reward_item_id: u.number(),
|
|
996
|
+
reward_item_name: u.string(),
|
|
997
|
+
reward_item_type: C,
|
|
998
|
+
reward_item_icon_url: u.string(),
|
|
999
|
+
reward_item_desc: u.string().optional(),
|
|
1000
|
+
reward_item_rating: u.number(),
|
|
1001
|
+
reward_amount: u.number(),
|
|
1002
|
+
reward_status: O,
|
|
1003
|
+
reward_source: A,
|
|
1004
|
+
extra_data: u.record(u.unknown()).optional()
|
|
1005
|
+
}), qn = u.object({
|
|
1006
|
+
engagement_id: u.number(),
|
|
1007
|
+
user_id: u.string(),
|
|
1008
|
+
event_id: u.number(),
|
|
1009
|
+
feature_id: u.number(),
|
|
1010
|
+
sequence: u.number(),
|
|
1011
|
+
data: z.clone().optional(),
|
|
1012
|
+
server_id: u.string().optional(),
|
|
1013
|
+
role_id: u.string().optional(),
|
|
1014
|
+
created_at: u.number(),
|
|
1015
|
+
rewards: u.array(Gn).optional()
|
|
1016
|
+
}).lock(), Jn = u.object({
|
|
1017
|
+
allowed: u.bool(),
|
|
1018
|
+
registered: u.bool()
|
|
1019
|
+
}), Yn = u.object({
|
|
1020
|
+
feature_id: u.number(),
|
|
1021
|
+
can_engage: u.bool(),
|
|
1022
|
+
has_unclaimed_rewards: u.bool(),
|
|
1023
|
+
final_available_count: u.number(),
|
|
1024
|
+
total_remaining_engagements: u.number(),
|
|
1025
|
+
cycle_remaining_engagements: u.number()
|
|
1026
|
+
}), Xn = u.object({
|
|
1027
|
+
engagement_id: u.number(),
|
|
1028
|
+
engagement: u.object({
|
|
1029
|
+
engagement_id: u.number(),
|
|
1030
|
+
sequence: u.number(),
|
|
1031
|
+
feature_id: u.number(),
|
|
1032
|
+
data: z.clone().optional()
|
|
1033
|
+
}).optional(),
|
|
1034
|
+
rewards: u.array(Kn).optional(),
|
|
1035
|
+
scan: u.bool().optional()
|
|
1036
|
+
}), Zn = u.object({
|
|
1037
|
+
reward_id: u.number(),
|
|
1038
|
+
reward_status: k
|
|
1039
|
+
}), Qn = T.Vote2, $n = u.object({
|
|
1040
|
+
candidate_id: u.string(),
|
|
1041
|
+
display_name: u.string(),
|
|
1042
|
+
images: u.array(u.string()).optional(),
|
|
1043
|
+
videos: u.array(u.string()).optional(),
|
|
1044
|
+
description: u.string().optional(),
|
|
1045
|
+
jump_url: u.string()
|
|
1046
|
+
}), er = u.object({
|
|
1047
|
+
...P.shape,
|
|
1048
|
+
feature_type: u.string().enum(Qn),
|
|
1049
|
+
config: u.object({
|
|
1050
|
+
vote_item_id: u.number().optional(),
|
|
1051
|
+
candidates: u.array($n),
|
|
1052
|
+
vote_since: u.number(),
|
|
1053
|
+
vote_until: u.number(),
|
|
1054
|
+
rewards_since: u.number(),
|
|
1055
|
+
rewards_until: u.number(),
|
|
1056
|
+
winner_rewards: u.array(N).optional(),
|
|
1057
|
+
consolation_rewards: u.array(N).optional()
|
|
1058
|
+
})
|
|
1059
|
+
}), tr = T.ZeroChatgpt, nr = u.object({
|
|
1060
|
+
...P.shape,
|
|
1061
|
+
feature_type: u.string().enum(tr)
|
|
1062
|
+
}), rr = u.union(yt, xt, Tt, Dt, kt, Mt, Pt, It, Bt, Ht, Wt, Kt, Zt, $t, tn, rn, on, pn, er, Ct, nr, cn, un, Yt).key("feature_type").satisfies(), ir = u.object({
|
|
1063
|
+
event_name: u.string(),
|
|
1064
|
+
rules: u.string(),
|
|
1065
|
+
since: u.number(),
|
|
1066
|
+
until: u.number(),
|
|
1067
|
+
visit_count: u.number().optional(),
|
|
1068
|
+
features: u.array(rr)
|
|
1069
|
+
}).lock(), ar = u.guard(ir), or = u.guard(Jn), B = l({ count: u.number() }), sr = l({ first_visit: u.bool() }), cr = l({ engagements: u.union(u.array(Wn), u.array(An)) }), lr = l({ status: u.array(Yn) }), ur = l({ engagements_counts: u.record(u.number()) }), dr = l({
|
|
1070
|
+
engagements: u.array(qn),
|
|
1071
|
+
next_token: u.string().optional()
|
|
1072
|
+
}), fr = u.guard(Xn), pr = l({ claimed_items: u.array(Zn) }), mr = l({ rewards: u.array(L) }), hr = l({ reward_status: k }), gr = l({
|
|
1073
|
+
user_rewards: u.array(L),
|
|
1074
|
+
next_token: u.string().optional()
|
|
1075
|
+
}), _r = l({ unclaimed: u.number() }), vr = l({ scene: u.string() }), yr = l({ params: u.string() }), br = l({ img: u.string() }), xr = u.guard(wn), Sr = u.guard(Bn), Cr = u.guard(u.object({ candidate_votes: u.array(Vn) })), wr = u.guard(I), Tr = u.guard(Fn), Er = u.guard(Pn), Dr = u.guard(In), Or = u.guard(Ln), kr = u.guard(Rn), Ar = u.guard(En);
|
|
1076
|
+
//#endregion
|
|
1077
|
+
//#region src/event.methods.ts
|
|
1078
|
+
async function jr(e, t, n) {
|
|
1079
|
+
let { data: r } = await this.req.get("verify-mobile-allowed", {
|
|
1080
|
+
game_id: e,
|
|
1081
|
+
mobile: t
|
|
1082
|
+
}, or, n);
|
|
1083
|
+
return r;
|
|
202
1084
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
/** 男 */
|
|
207
|
-
Male: "male",
|
|
208
|
-
/** 女 */
|
|
209
|
-
Female: "female"
|
|
210
|
-
}, Ce = e.string().enum(Re).lock(), Ve = {
|
|
211
|
-
/** 积分增加 */
|
|
212
|
-
Increase: "increase",
|
|
213
|
-
/** 积分减少 */
|
|
214
|
-
Decrease: "decrease",
|
|
215
|
-
/** 积分过期 */
|
|
216
|
-
Expired: "expired"
|
|
217
|
-
}, je = e.string().enum(Ve).lock(), Te = {
|
|
218
|
-
/** 游戏内购买 */
|
|
219
|
-
Order: "order",
|
|
220
|
-
/** 游戏内消耗 */
|
|
221
|
-
Consumption: "consumption",
|
|
222
|
-
/** 商城兑换 */
|
|
223
|
-
Redeem: "redeem",
|
|
224
|
-
/** 积分过期 */
|
|
225
|
-
Expire: "expire",
|
|
226
|
-
/** 管理后台调整 */
|
|
227
|
-
Admin: "admin",
|
|
228
|
-
/** 运营活动 */
|
|
229
|
-
Event: "event"
|
|
230
|
-
}, qe = e.string().enum(Te).lock(), xe = {
|
|
231
|
-
/** 游戏内奖励 */
|
|
232
|
-
GameReward: "game_reward",
|
|
233
|
-
/** 实物商品 */
|
|
234
|
-
Physical: "physical",
|
|
235
|
-
/** 虚拟商品 */
|
|
236
|
-
Virtual: "virtual"
|
|
237
|
-
}, H = e.string().enum(xe).lock(), Le = {
|
|
238
|
-
/** 待发放 */
|
|
239
|
-
Pending: "pending",
|
|
240
|
-
/** 已发放 */
|
|
241
|
-
Issued: "issued",
|
|
242
|
-
/** 发放失败 */
|
|
243
|
-
Failed: "failed"
|
|
244
|
-
}, Ue = e.string().enum(Le).lock(), Se = e.object({
|
|
245
|
-
default_avatar_url: e.string(),
|
|
246
|
-
official_avatar_urls: e.array(e.string()),
|
|
247
|
-
default_nickname: e.string(),
|
|
248
|
-
default_bio: e.string(),
|
|
249
|
-
default_role_avatar_url: e.string(),
|
|
250
|
-
level_configs: e.array(
|
|
251
|
-
e.object({
|
|
252
|
-
level: e.number(),
|
|
253
|
-
exp: e.number(),
|
|
254
|
-
title: e.string()
|
|
255
|
-
})
|
|
256
|
-
),
|
|
257
|
-
level_valid_days: e.number(),
|
|
258
|
-
benefit_description: e.string(),
|
|
259
|
-
exp_description: e.string(),
|
|
260
|
-
credit_description: e.string(),
|
|
261
|
-
send_role_mail_rate_limit: e.number()
|
|
262
|
-
}).lock(), Pe = e.object({
|
|
263
|
-
member_id: e.string(),
|
|
264
|
-
player_id: e.string(),
|
|
265
|
-
exp: e.number(),
|
|
266
|
-
level: e.number(),
|
|
267
|
-
credit: e.number(),
|
|
268
|
-
credit_expiring: e.number(),
|
|
269
|
-
level_change_time: e.number(),
|
|
270
|
-
level_expire_time: e.number()
|
|
271
|
-
}).lock(), Ee = e.object({
|
|
272
|
-
server_id: e.string(),
|
|
273
|
-
server_name: e.string()
|
|
274
|
-
}).lock(), Fe = e.object({
|
|
275
|
-
role_id: e.string(),
|
|
276
|
-
role_name: e.string()
|
|
277
|
-
}).lock(), z = e.object({
|
|
278
|
-
...Fe.shape,
|
|
279
|
-
...Ee.shape,
|
|
280
|
-
role_level: e.number(),
|
|
281
|
-
last_login_time: e.number()
|
|
282
|
-
}).lock(), Ie = e.object({
|
|
283
|
-
...z.shape,
|
|
284
|
-
/** 角色战力 */
|
|
285
|
-
role_fighting: e.number(),
|
|
286
|
-
/** 宗门 ID */
|
|
287
|
-
kin_id: e.string().optional(),
|
|
288
|
-
/** 宗门名称 */
|
|
289
|
-
kin_name: e.string().optional(),
|
|
290
|
-
/** 宗门职位 */
|
|
291
|
-
kin_position: e.string().optional()
|
|
292
|
-
}).lock(), De = e.object({
|
|
293
|
-
name: e.string(),
|
|
294
|
-
avatar_url: e.string(),
|
|
295
|
-
bio: e.string(),
|
|
296
|
-
gender: Ce,
|
|
297
|
-
birthday: e.object({ year: e.number(), month: e.number(), day: e.number() }),
|
|
298
|
-
social_medias: e.record(
|
|
299
|
-
e.object({
|
|
300
|
-
homepage_url: e.string(),
|
|
301
|
-
homepage_image_url: e.string()
|
|
302
|
-
}).optional()
|
|
303
|
-
).optional()
|
|
304
|
-
}).lock(), J = e.object({
|
|
305
|
-
address_id: e.number(),
|
|
306
|
-
recipient: e.string(),
|
|
307
|
-
mobile: e.string(),
|
|
308
|
-
province: e.string(),
|
|
309
|
-
city: e.string(),
|
|
310
|
-
district: e.string(),
|
|
311
|
-
address: e.string(),
|
|
312
|
-
is_default: e.bool()
|
|
313
|
-
}).lock(), $e = e.object({
|
|
314
|
-
increased_credit: e.number(),
|
|
315
|
-
decreased_credit: e.number(),
|
|
316
|
-
expired_credit: e.number(),
|
|
317
|
-
balance_credit: e.number()
|
|
318
|
-
}).lock(), Ae = e.object({
|
|
319
|
-
id: e.number(),
|
|
320
|
-
change_type: je,
|
|
321
|
-
change_scene: qe,
|
|
322
|
-
change_credit: e.number(),
|
|
323
|
-
balance: e.number(),
|
|
324
|
-
change_time: e.number(),
|
|
325
|
-
metadata: e.record(e.unknown()).optional()
|
|
326
|
-
}).lock(), Z = e.object({
|
|
327
|
-
benefit_id: e.number(),
|
|
328
|
-
name: e.string(),
|
|
329
|
-
img_url: e.string(),
|
|
330
|
-
description: e.string(),
|
|
331
|
-
min_level: e.number(),
|
|
332
|
-
max_level: e.number(),
|
|
333
|
-
product_id: e.number(),
|
|
334
|
-
tag: e.string()
|
|
335
|
-
}).lock(), X = e.object({
|
|
336
|
-
product_id: e.number(),
|
|
337
|
-
catalog_id: e.number(),
|
|
338
|
-
catalog_name: e.string(),
|
|
339
|
-
item_type: H,
|
|
340
|
-
name: e.string(),
|
|
341
|
-
img_url: e.string(),
|
|
342
|
-
description: e.string(),
|
|
343
|
-
tag: e.string(),
|
|
344
|
-
price: e.number(),
|
|
345
|
-
stock: e.number(),
|
|
346
|
-
redeem_quantity: e.number(),
|
|
347
|
-
not_visible_before: e.number(),
|
|
348
|
-
not_visible_after: e.number(),
|
|
349
|
-
not_before: e.number(),
|
|
350
|
-
not_after: e.number(),
|
|
351
|
-
min_level: e.number(),
|
|
352
|
-
max_level: e.number(),
|
|
353
|
-
limit_daily: e.number(),
|
|
354
|
-
limit_monthly: e.number(),
|
|
355
|
-
limit_yearly: e.number(),
|
|
356
|
-
limit_total: e.number(),
|
|
357
|
-
weight: e.number(),
|
|
358
|
-
created_at: e.number(),
|
|
359
|
-
updated_at: e.number(),
|
|
360
|
-
redeemable_quantity: e.number().optional()
|
|
361
|
-
}).lock(), Oe = e.object({
|
|
362
|
-
...L(Z.shape, "tag"),
|
|
363
|
-
product: X.clone().optional()
|
|
364
|
-
}).lock(), fo = e.union(
|
|
365
|
-
e.object({
|
|
366
|
-
server_id: e.string(),
|
|
367
|
-
role_id: e.string()
|
|
368
|
-
}),
|
|
369
|
-
e.object({
|
|
370
|
-
address_id: e.number()
|
|
371
|
-
})
|
|
372
|
-
).satisfies().lock(), Ge = e.object({
|
|
373
|
-
recipient: e.string(),
|
|
374
|
-
mobile: e.string(),
|
|
375
|
-
province: e.string(),
|
|
376
|
-
city: e.string(),
|
|
377
|
-
district: e.string(),
|
|
378
|
-
address: e.string(),
|
|
379
|
-
express_company: e.string(),
|
|
380
|
-
express_number: e.string()
|
|
381
|
-
}).lock(), Ne = e.object({
|
|
382
|
-
server_id: e.string(),
|
|
383
|
-
role_id: e.string(),
|
|
384
|
-
role_name: e.string()
|
|
385
|
-
}).lock(), Qe = e.object({
|
|
386
|
-
redemption_id: e.number(),
|
|
387
|
-
player_id: e.string(),
|
|
388
|
-
product_id: e.number(),
|
|
389
|
-
name: e.string(),
|
|
390
|
-
img_url: e.string(),
|
|
391
|
-
item_type: H,
|
|
392
|
-
catalog_id: e.number(),
|
|
393
|
-
catalog_name: e.string(),
|
|
394
|
-
quantity: e.number(),
|
|
395
|
-
amount: e.number(),
|
|
396
|
-
status: Ue,
|
|
397
|
-
created_at: e.number(),
|
|
398
|
-
extra_data: e.union(Ge.clone(), Ne.clone()).satisfies().optional()
|
|
399
|
-
}), Be = e.guard(Se), N = s({ player: Pe }), Me = s({ roles: e.array(z) }), j = s({ role_card: Ie }), Q = e.guard(De), B = e.guard(J), Ke = s({ addresses: e.array(J) }), He = e.guard($e), ze = s({
|
|
400
|
-
credit_logs: e.array(Ae),
|
|
401
|
-
next_token: e.string().optional()
|
|
402
|
-
}), Je = s({ products: e.array(X) }), Ze = s({ benefits: e.array(Z) }), Xe = s({ benefit: Oe }), Ye = s({
|
|
403
|
-
redemptions: e.array(Qe),
|
|
404
|
-
next_token: e.string().optional()
|
|
405
|
-
}), We = s({
|
|
406
|
-
existed: e.bool(),
|
|
407
|
-
image_upload_url: e.string().optional(),
|
|
408
|
-
image_id: e.string()
|
|
409
|
-
});
|
|
410
|
-
class ho {
|
|
411
|
-
token;
|
|
412
|
-
req;
|
|
413
|
-
constructor(t) {
|
|
414
|
-
this.token = t, this.req = t.req;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* 获取俱乐部配置
|
|
418
|
-
*
|
|
419
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=tuhsPt3ihp
|
|
420
|
-
*/
|
|
421
|
-
async getConfig(t) {
|
|
422
|
-
await this.token.autoLogin();
|
|
423
|
-
const { data: n } = await this.req.get("club/config", null, Be, t);
|
|
424
|
-
return n;
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* 用于游戏内嵌 Web 页面和微信小程序获取当前登录的游戏账号在俱乐部中的信息。
|
|
428
|
-
*
|
|
429
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=hIDfaMlT7m
|
|
430
|
-
*/
|
|
431
|
-
async getCurrentPlayer(t) {
|
|
432
|
-
await this.token.autoLogin();
|
|
433
|
-
const { data: n, code: r, message: a } = await this.req.get(
|
|
434
|
-
"club/current-player",
|
|
435
|
-
null,
|
|
436
|
-
N,
|
|
437
|
-
t
|
|
438
|
-
);
|
|
439
|
-
return n?.player ?? {
|
|
440
|
-
message: a,
|
|
441
|
-
error: r
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* 俱乐部用户关联游戏账号
|
|
446
|
-
*
|
|
447
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Dpb9JAKqzG
|
|
448
|
-
*/
|
|
449
|
-
async linkPlayer(t) {
|
|
450
|
-
await this.token.autoLogin();
|
|
451
|
-
const { data: n, code: r, message: a } = await this.req.post(
|
|
452
|
-
"club/link-player",
|
|
453
|
-
{ id_token: this.token.idToken },
|
|
454
|
-
N,
|
|
455
|
-
t
|
|
456
|
-
);
|
|
457
|
-
return n?.player ?? {
|
|
458
|
-
message: a,
|
|
459
|
-
error: r
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* 获取俱乐部关联的游戏账号下的角色列表
|
|
464
|
-
*
|
|
465
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=nwu4FiGM9V
|
|
466
|
-
*/
|
|
467
|
-
async getRoles(t, n, r) {
|
|
468
|
-
if (!await this.token.autoLogin()) return [];
|
|
469
|
-
const { data: a } = await this.req.get(
|
|
470
|
-
"club/roles",
|
|
471
|
-
{ player_id: t, refresh: n },
|
|
472
|
-
Me,
|
|
473
|
-
r
|
|
474
|
-
);
|
|
475
|
-
return a?.roles || [];
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* 获取俱乐部会员的角色卡片数据
|
|
479
|
-
*
|
|
480
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=A1Wr7kUXnS
|
|
481
|
-
*/
|
|
482
|
-
async getRoleCard(t, n) {
|
|
483
|
-
await this.token.autoLogin();
|
|
484
|
-
const { data: r } = await this.req.get("club/role-card", { member_id: t }, j, n);
|
|
485
|
-
return r?.role_card ?? null;
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* 设置自己的角色卡片
|
|
489
|
-
*
|
|
490
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XgMf6OFE5i
|
|
491
|
-
*/
|
|
492
|
-
async setRoleCard(t, n) {
|
|
493
|
-
if (!await this.token.autoLogin()) return null;
|
|
494
|
-
const { data: r } = await this.req.post("club/role-card", t, j, n);
|
|
495
|
-
return r?.role_card ?? null;
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* 强制刷新自己的角色卡片,从游戏内获取最新数据
|
|
499
|
-
*
|
|
500
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=RPdJquwmgv
|
|
501
|
-
*/
|
|
502
|
-
async refreshRoleCard(t) {
|
|
503
|
-
if (!await this.token.autoLogin()) return null;
|
|
504
|
-
const { data: n } = await this.req.post("club/refresh-role-card", {}, j, t);
|
|
505
|
-
return n?.role_card ?? null;
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
* 获取俱乐部用户的信息
|
|
509
|
-
*
|
|
510
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TMWBCFcOr2
|
|
511
|
-
*/
|
|
512
|
-
async getUserProfile(t, n) {
|
|
513
|
-
await this.token.autoLogin();
|
|
514
|
-
const { data: r } = await this.req.get("club/user-profile", { member_id: t }, Q, n);
|
|
515
|
-
return r;
|
|
516
|
-
}
|
|
517
|
-
/**
|
|
518
|
-
* 修改自己的俱乐部用户信息
|
|
519
|
-
*
|
|
520
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Qt822A57jd
|
|
521
|
-
*/
|
|
522
|
-
async updateUserProfile(t, n) {
|
|
523
|
-
if (Object.keys(t).length === 0)
|
|
524
|
-
return { error: "OptionIsEmpty", message: "请提供需要修改的信息" };
|
|
525
|
-
await this.token.autoLogin();
|
|
526
|
-
const { data: r, code: a, message: i } = await this.req.post("club/user-profile", t, Q, n);
|
|
527
|
-
return r ?? {
|
|
528
|
-
message: i,
|
|
529
|
-
error: a
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
/**
|
|
533
|
-
* 获取自己的俱乐部收货地址列表
|
|
534
|
-
*
|
|
535
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=NowUIynMVn
|
|
536
|
-
*/
|
|
537
|
-
async getAddresses(t) {
|
|
538
|
-
if (!await this.token.autoLogin()) return [];
|
|
539
|
-
const { data: n } = await this.req.get("club/addresses", null, Ke, t);
|
|
540
|
-
return n?.addresses ?? [];
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* 增加俱乐部收货地址
|
|
544
|
-
*
|
|
545
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=TaGIIYDRYA
|
|
546
|
-
*/
|
|
547
|
-
async addAddress(t, n) {
|
|
548
|
-
if (!await this.token.autoLogin()) return null;
|
|
549
|
-
const { data: r, code: a, message: i } = await this.req.post(
|
|
550
|
-
"/club/add-address",
|
|
551
|
-
l(t),
|
|
552
|
-
B,
|
|
553
|
-
n
|
|
554
|
-
);
|
|
555
|
-
return r ?? {
|
|
556
|
-
message: i,
|
|
557
|
-
error: a
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
/**
|
|
561
|
-
* 修改自己的俱乐部收货地址
|
|
562
|
-
*
|
|
563
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=p9FlJhHnWN
|
|
564
|
-
*/
|
|
565
|
-
async updateAddress(t, n) {
|
|
566
|
-
await this.token.autoLogin();
|
|
567
|
-
const { data: r, code: a, message: i } = await this.req.post(
|
|
568
|
-
"club/update-address",
|
|
569
|
-
l(t),
|
|
570
|
-
B,
|
|
571
|
-
n
|
|
572
|
-
);
|
|
573
|
-
return r ?? {
|
|
574
|
-
message: i,
|
|
575
|
-
error: a
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* 删除自己的俱乐部收货地址
|
|
580
|
-
*
|
|
581
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=MEEOBdf8rm
|
|
582
|
-
*/
|
|
583
|
-
async deleteAddress(t, n) {
|
|
584
|
-
if (!await this.token.autoLogin()) return null;
|
|
585
|
-
const { ok: r } = await this.req.post("club/delete-address", { address_id: t }, null, n);
|
|
586
|
-
return r;
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* 获取俱乐部积分统计信息
|
|
590
|
-
*
|
|
591
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=x4uxtGstRL
|
|
592
|
-
*/
|
|
593
|
-
async getUserCredit(t, n) {
|
|
594
|
-
await this.token.autoLogin();
|
|
595
|
-
const { data: r, code: a, message: i } = await this.req.get("club/user-credit", { ...t }, He, n);
|
|
596
|
-
return r ?? {
|
|
597
|
-
message: i,
|
|
598
|
-
error: a
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
/**
|
|
602
|
-
* 获取自己的俱乐部积分变动记录
|
|
603
|
-
*
|
|
604
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=lQFgF689P8
|
|
605
|
-
*/
|
|
606
|
-
async getCreditLogs(t, n) {
|
|
607
|
-
await this.token.autoLogin();
|
|
608
|
-
const { data: r } = await this.req.get(
|
|
609
|
-
"club/credit-logs",
|
|
610
|
-
{ max_results: 20, ...t },
|
|
611
|
-
ze,
|
|
612
|
-
n
|
|
613
|
-
);
|
|
614
|
-
return {
|
|
615
|
-
credit_logs: r?.credit_logs || [],
|
|
616
|
-
next_token: r?.next_token
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
/**
|
|
620
|
-
* 获取自己的俱乐部权益列表
|
|
621
|
-
*
|
|
622
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=UFSDGvqkdV
|
|
623
|
-
*/
|
|
624
|
-
async getBenefits(t) {
|
|
625
|
-
if (!await this.token.autoLogin()) return [];
|
|
626
|
-
const { data: n } = await this.req.get("club/benefits", null, Ze, t);
|
|
627
|
-
return n?.benefits || [];
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* 获取某个权益详细信息
|
|
631
|
-
*
|
|
632
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=XKto0MeaHF
|
|
633
|
-
*/
|
|
634
|
-
async getBenefit(t, n) {
|
|
635
|
-
if (!await this.token.autoLogin()) return null;
|
|
636
|
-
const { data: r } = await this.req.get(
|
|
637
|
-
"club/benefit",
|
|
638
|
-
{ benefit_id: t },
|
|
639
|
-
Xe,
|
|
640
|
-
n
|
|
641
|
-
);
|
|
642
|
-
return r?.benefit || null;
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* 获取商城商品列表
|
|
646
|
-
*
|
|
647
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=r3vC3PzfMQ
|
|
648
|
-
*/
|
|
649
|
-
async getProducts(t, n) {
|
|
650
|
-
await this.token.autoLogin();
|
|
651
|
-
const { data: r } = await this.req.get("club/products", t || null, Je, n);
|
|
652
|
-
return r?.products || [];
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* 兑换商城商品
|
|
656
|
-
*
|
|
657
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=LWcMVwX3OY
|
|
658
|
-
*/
|
|
659
|
-
async redeemProduct(t, n) {
|
|
660
|
-
await this.token.autoLogin();
|
|
661
|
-
const { ok: r, code: a, message: i } = await this.req.post("club/redeem-product", l(t), null, n);
|
|
662
|
-
return r || {
|
|
663
|
-
message: i,
|
|
664
|
-
error: a
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* 获取兑换记录
|
|
669
|
-
*
|
|
670
|
-
* https://kdocs.cn/l/cgp4gSBMbOf1?linkname=Ml6mLgT4cM
|
|
671
|
-
*/
|
|
672
|
-
async getRedemptions(t, n) {
|
|
673
|
-
await this.token.autoLogin();
|
|
674
|
-
const { data: r } = await this.req.get(
|
|
675
|
-
"club/redemptions",
|
|
676
|
-
{ max_results: 20, ...t },
|
|
677
|
-
Ye,
|
|
678
|
-
n
|
|
679
|
-
);
|
|
680
|
-
return {
|
|
681
|
-
redemptions: r?.redemptions || [],
|
|
682
|
-
next_token: r?.next_token
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* 图片预上传地址获取,为 club 服务提供预签名上传 URL,供用户客户端上传图片资源
|
|
687
|
-
*
|
|
688
|
-
* https://www.kdocs.cn/l/cgp4gSBMbOf1?linkname=d4IHcCQu34
|
|
689
|
-
*/
|
|
690
|
-
async clubUploadImage(t, n) {
|
|
691
|
-
await this.token.autoLogin();
|
|
692
|
-
const { data: r, code: a, message: i } = await this.req.post(
|
|
693
|
-
"club/image-upload-url",
|
|
694
|
-
l(t),
|
|
695
|
-
We,
|
|
696
|
-
n
|
|
697
|
-
);
|
|
698
|
-
return r ?? {
|
|
699
|
-
message: i,
|
|
700
|
-
error: a
|
|
701
|
-
};
|
|
702
|
-
}
|
|
1085
|
+
async function Mr(e) {
|
|
1086
|
+
let { data: t } = await this.req.get(`event/${this.event}/event-config`, null, ar, e);
|
|
1087
|
+
return t;
|
|
703
1088
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}
|
|
711
|
-
constructor(t, n) {
|
|
712
|
-
this._event = +n, this.token = t, this.req = t.req;
|
|
713
|
-
}
|
|
714
|
-
/**
|
|
715
|
-
* 绑定指定的方法到当前实例上
|
|
716
|
-
*/
|
|
717
|
-
bind(t) {
|
|
718
|
-
const n = this;
|
|
719
|
-
for (const [r, a] of Object.entries(t))
|
|
720
|
-
a && (n[r] = a.bind(this));
|
|
721
|
-
return n;
|
|
722
|
-
}
|
|
1089
|
+
async function Nr(e, t) {
|
|
1090
|
+
let { data: n } = await this.req.get(`event/${this.event}/feature-engagement-count`, {
|
|
1091
|
+
feature_id: e,
|
|
1092
|
+
type: "user"
|
|
1093
|
+
}, B, t);
|
|
1094
|
+
return n?.count ?? null;
|
|
723
1095
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
PhysicalItem: "physical_item",
|
|
731
|
-
/** 微信红包 */
|
|
732
|
-
WeixinHongbao: "weixin_hongbao",
|
|
733
|
-
/** 礼包码 */
|
|
734
|
-
GiftCode: "gift_code",
|
|
735
|
-
/** 激活码 */
|
|
736
|
-
ActivationKey: "activation_key",
|
|
737
|
-
/** 抽奖券 */
|
|
738
|
-
LotteryTicket: "lottery_ticket",
|
|
739
|
-
/** 俱乐部积分 */
|
|
740
|
-
ClubCredit: "club_credit",
|
|
741
|
-
/** 俱乐部成长值 */
|
|
742
|
-
ClubExp: "club_exp",
|
|
743
|
-
/** 外部兑换码 */
|
|
744
|
-
ExternalCode: "external_gift_code",
|
|
745
|
-
/** 空奖励 */
|
|
746
|
-
VoidItem: "void_item"
|
|
747
|
-
}, Y = e.string().enum(v).lock(), ko = v, W = Y, et = {
|
|
748
|
-
/** 世游通行证 ID / Combo ID */
|
|
749
|
-
UserId: "user_id",
|
|
750
|
-
/** 游戏角色 ID */
|
|
751
|
-
RoleId: "role_id"
|
|
752
|
-
}, tt = e.string().enum(et).lock(), nt = {
|
|
753
|
-
None: "none",
|
|
754
|
-
Daily: "daily",
|
|
755
|
-
Weekly: "weekly",
|
|
756
|
-
Monthly: "monthly"
|
|
757
|
-
}, rt = e.string().enum(nt).lock(), c = {
|
|
758
|
-
/** 预约 */
|
|
759
|
-
Preregister: "preregister",
|
|
760
|
-
/** 抽奖 */
|
|
761
|
-
Lottery: "lottery",
|
|
762
|
-
/** 问卷 */
|
|
763
|
-
Survey: "survey",
|
|
764
|
-
/** 邀请 */
|
|
765
|
-
Invite: "invite",
|
|
766
|
-
/** 分享 */
|
|
767
|
-
Share: "share",
|
|
768
|
-
/** 关注社交媒体 */
|
|
769
|
-
Follow: "follow",
|
|
770
|
-
/** 微信小程序订阅消息 */
|
|
771
|
-
Subscribe: "weixin_subscribe",
|
|
772
|
-
/** 弹幕/评论 */
|
|
773
|
-
Comment: "comment",
|
|
774
|
-
/** 投票 */
|
|
775
|
-
Vote: "vote",
|
|
776
|
-
/** 投票 V2 */
|
|
777
|
-
Vote2: "vote2",
|
|
778
|
-
/** 礼包码 */
|
|
779
|
-
GiftCode: "gift_code",
|
|
780
|
-
/** 注册 */
|
|
781
|
-
Register: "register",
|
|
782
|
-
/** 受邀注册 */
|
|
783
|
-
InvitedRegister: "invited_register",
|
|
784
|
-
/** 领奖 */
|
|
785
|
-
ClaimRewards: "claim_rewards",
|
|
786
|
-
/** 充值返还 */
|
|
787
|
-
Cashback: "cashback",
|
|
788
|
-
/** 任务 */
|
|
789
|
-
Quest: "quest",
|
|
790
|
-
/** 组队 */
|
|
791
|
-
Team: "team",
|
|
792
|
-
/** 开奖 */
|
|
793
|
-
LotteryDraw: "lottery_draw",
|
|
794
|
-
/** 签到 */
|
|
795
|
-
CheckIn: "check_in",
|
|
796
|
-
/** 领取激活码 */
|
|
797
|
-
ClaimActivationKey: "claim_activation_key",
|
|
798
|
-
/** 不朽箴言特有的 AI 聊天 */
|
|
799
|
-
ZeroChatgpt: "zero_chatgpt",
|
|
800
|
-
/** 投稿 */
|
|
801
|
-
Ugc: "ugc",
|
|
802
|
-
/** 投稿点赞 */
|
|
803
|
-
UgcLike: "ugc_like",
|
|
804
|
-
/** 兑换 */
|
|
805
|
-
Redeem: "redeem"
|
|
806
|
-
}, ot = e.string().enum(c).lock(), at = {
|
|
807
|
-
/** 累计游戏内活跃值 */
|
|
808
|
-
Active: "player_active_points",
|
|
809
|
-
/** 累计登录,单位 人天 */
|
|
810
|
-
Login: "player_login_days",
|
|
811
|
-
/** 累计充值金额 */
|
|
812
|
-
OrderAmount: "order_total_amount",
|
|
813
|
-
/** 累计充值次数 */
|
|
814
|
-
OrderCount: "order_total_count",
|
|
815
|
-
/** 社区发帖数量 */
|
|
816
|
-
Posts: "community_posts",
|
|
817
|
-
/** 社区评论数量 */
|
|
818
|
-
Comments: "community_comments",
|
|
819
|
-
/** 游戏对局次数 */
|
|
820
|
-
MatchCounts: "player_match_counts",
|
|
821
|
-
/** 游戏对局天数 */
|
|
822
|
-
MatchDays: "player_match_days",
|
|
823
|
-
/** 账号等级目标 */
|
|
824
|
-
PlayerLevel: "player_level",
|
|
825
|
-
/** 活动道具累计获取 */
|
|
826
|
-
EventItems: "event_items",
|
|
827
|
-
/** 游戏内任务 */
|
|
828
|
-
GameTask: "game_task",
|
|
829
|
-
/** 游戏内充值金额 */
|
|
830
|
-
OrderAmountInApp: "order_in_app_total_amount",
|
|
831
|
-
/** 支付中心充值金额 */
|
|
832
|
-
OrderAmountInPayCenter: "order_seayoo_web_total_amount",
|
|
833
|
-
/** 组队进度 */
|
|
834
|
-
TeamSize: "team_size"
|
|
835
|
-
}, ee = e.string().enum(at).lock(), it = {
|
|
836
|
-
/** 官方上传 */
|
|
837
|
-
System: "system",
|
|
838
|
-
/** 用户投稿 */
|
|
839
|
-
UserSubmission: "user_submission",
|
|
840
|
-
/** 投票入围 */
|
|
841
|
-
Shortlisted: "shortlisted"
|
|
842
|
-
}, st = e.string().enum(it).lock(), p = {
|
|
843
|
-
/** 未获得奖励 */
|
|
844
|
-
Ineligible: "ineligible",
|
|
845
|
-
/** 奖励未领取 */
|
|
846
|
-
Unclaimed: "unclaimed",
|
|
847
|
-
/** 奖励已领取 */
|
|
848
|
-
Received: "received",
|
|
849
|
-
/** 奖励发放失败 */
|
|
850
|
-
Failed: "failed",
|
|
851
|
-
/** 奖励已发货 */
|
|
852
|
-
Delivered: "delivered"
|
|
853
|
-
}, te = e.string().enum(p).lock(), ct = {
|
|
854
|
-
/** 未获得奖励 */
|
|
855
|
-
Ineligible: p.Ineligible,
|
|
856
|
-
/** 奖励未领取 */
|
|
857
|
-
Unclaimed: p.Unclaimed,
|
|
858
|
-
/** 奖励已领取 */
|
|
859
|
-
Received: p.Received,
|
|
860
|
-
/** 奖励发放失败 */
|
|
861
|
-
Failed: p.Failed,
|
|
862
|
-
/** 奖励已发货 */
|
|
863
|
-
Delivered: p.Delivered
|
|
864
|
-
}, U = e.string().enum(ct).lock(), ut = {
|
|
865
|
-
/** 玩法产出奖励 */
|
|
866
|
-
Output: "output",
|
|
867
|
-
/** 玩法参与奖励 */
|
|
868
|
-
Engage: "engage"
|
|
869
|
-
}, S = e.string().enum(ut).lock(), lt = {
|
|
870
|
-
/** 私有队伍 */
|
|
871
|
-
Private: "private",
|
|
872
|
-
/** 公开队伍 */
|
|
873
|
-
Public: "public"
|
|
874
|
-
}, mt = e.string().enum(lt).lock(), w = {
|
|
875
|
-
/** 未知状态 */
|
|
876
|
-
Unknown: "unknown",
|
|
877
|
-
/** 等待开奖 */
|
|
878
|
-
Pending: "pending",
|
|
879
|
-
/** 已开奖,待领奖 */
|
|
880
|
-
Drawn: "drawn",
|
|
881
|
-
/** 已领奖 */
|
|
882
|
-
Claimed: "claimed",
|
|
883
|
-
/** 领奖失败 */
|
|
884
|
-
Fail: "fail"
|
|
885
|
-
}, vo = e.string().enum(w).lock(), dt = {
|
|
886
|
-
/** 发起组队 */
|
|
887
|
-
Assemble: "assemble",
|
|
888
|
-
/** 加入队伍 */
|
|
889
|
-
Join: "join",
|
|
890
|
-
/** 解散队伍 */
|
|
891
|
-
Disband: "disband",
|
|
892
|
-
/** 修改队伍可见性 */
|
|
893
|
-
ChangeVisibility: "change_visibility",
|
|
894
|
-
/** 查询组队信息 */
|
|
895
|
-
Query: "query"
|
|
896
|
-
}, Ro = e.string().enum(dt).lock(), gt = {
|
|
897
|
-
/** 查询抽奖券 */
|
|
898
|
-
Query: "query",
|
|
899
|
-
/** 开奖 */
|
|
900
|
-
Draw: "draw",
|
|
901
|
-
/** 领奖 */
|
|
902
|
-
Claim: "claim"
|
|
903
|
-
}, Co = e.string().enum(gt).lock(), _t = {
|
|
904
|
-
/** 将所有队员的进度值求和,作为队伍进度值 */
|
|
905
|
-
Sum: "sum",
|
|
906
|
-
/** 以进度值倒序排名第 N 的队员的进度值,作为队伍进度值。如果队伍人数不足 N,则队伍进度值为 0。N 的值来自于配置字段 top_n */
|
|
907
|
-
TopN: "top_n"
|
|
908
|
-
}, pt = e.string().enum(_t).lock(), bt = {
|
|
909
|
-
/** 尚未结算 */
|
|
910
|
-
None: "none",
|
|
911
|
-
/** 获胜奖励 */
|
|
912
|
-
Winner: "winner",
|
|
913
|
-
/** 安慰奖励 */
|
|
914
|
-
Consolation: "consolation"
|
|
915
|
-
}, yt = e.string().enum(bt).lock(), ft = {
|
|
916
|
-
/** 抖音 */
|
|
917
|
-
Douyin: "douyin",
|
|
918
|
-
/** 小红书 */
|
|
919
|
-
Xiaohongshu: "xiaohongshu",
|
|
920
|
-
/** Tap Tap */
|
|
921
|
-
Taptap: "taptap",
|
|
922
|
-
/** B站 */
|
|
923
|
-
Bilibili: "bilibili",
|
|
924
|
-
/** 微博 */
|
|
925
|
-
Weibo: "weibo",
|
|
926
|
-
/** 虎牙 */
|
|
927
|
-
Huya: "huya",
|
|
928
|
-
/** 斗鱼 */
|
|
929
|
-
Douyu: "douyu"
|
|
930
|
-
}, P = e.string().enum(ft).lock(), ht = {
|
|
931
|
-
/** 已提交 */
|
|
932
|
-
Submitted: "submitted",
|
|
933
|
-
/** 已接收 */
|
|
934
|
-
Accepted: "accepted",
|
|
935
|
-
/** 已拒绝 */
|
|
936
|
-
Rejected: "rejected"
|
|
937
|
-
}, wt = e.string().enum(ht).lock(), kt = e.string().enum(v), g = e.object({
|
|
938
|
-
reward_item_id: e.number(),
|
|
939
|
-
reward_amount: e.number(),
|
|
940
|
-
reward_item_name: e.string(),
|
|
941
|
-
reward_item_icon_url: e.string(),
|
|
942
|
-
reward_item_desc: e.string().optional(),
|
|
943
|
-
reward_item_type: kt,
|
|
944
|
-
reward_item_rating: e.number()
|
|
945
|
-
}).lock(), vt = e.object({
|
|
946
|
-
engage_count: e.number(),
|
|
947
|
-
rewards: e.array(g)
|
|
948
|
-
}).lock(), Rt = e.union(
|
|
949
|
-
e.object({
|
|
950
|
-
feature_reward_type: e.string().enum("every"),
|
|
951
|
-
reward_details: e.array(g)
|
|
952
|
-
}),
|
|
953
|
-
e.object({
|
|
954
|
-
feature_reward_type: e.string().enum("regular"),
|
|
955
|
-
reward_details: e.array(vt)
|
|
956
|
-
})
|
|
957
|
-
).satisfies().lock(), u = e.object({
|
|
958
|
-
feature_name: e.string(),
|
|
959
|
-
feature_id: e.number(),
|
|
960
|
-
description: e.string(),
|
|
961
|
-
cycle: rt,
|
|
962
|
-
cycle_limit: e.number(),
|
|
963
|
-
limit: e.number(),
|
|
964
|
-
since: e.number(),
|
|
965
|
-
until: e.number(),
|
|
966
|
-
engage_account: tt,
|
|
967
|
-
feature_rewards: Rt.clone().optional(),
|
|
968
|
-
sort: e.number().optional()
|
|
969
|
-
}), Ct = c.Cashback, Vt = e.object({
|
|
970
|
-
...u.shape,
|
|
971
|
-
feature_type: e.string().enum(Ct),
|
|
972
|
-
config: e.object({
|
|
973
|
-
order_start_time: e.number(),
|
|
974
|
-
order_end_time: e.number(),
|
|
975
|
-
claim_rewards_start_time: e.number(),
|
|
976
|
-
claim_rewards_end_time: e.number()
|
|
977
|
-
})
|
|
978
|
-
}), jt = c.CheckIn, Tt = e.object({
|
|
979
|
-
...u.shape,
|
|
980
|
-
feature_type: e.string().enum(jt)
|
|
981
|
-
}), qt = c.ClaimActivationKey, xt = e.object({
|
|
982
|
-
...u.shape,
|
|
983
|
-
feature_type: e.string().enum(qt)
|
|
984
|
-
}), Lt = c.ClaimRewards, Ut = e.object({
|
|
985
|
-
...u.shape,
|
|
986
|
-
feature_type: e.string().enum(Lt)
|
|
987
|
-
}), St = c.Comment, Pt = e.object({
|
|
988
|
-
...u.shape,
|
|
989
|
-
feature_type: e.string().enum(St),
|
|
990
|
-
config: e.object({
|
|
991
|
-
comments: e.array(e.string()),
|
|
992
|
-
send_rate: e.number()
|
|
993
|
-
})
|
|
994
|
-
}), Et = c.Follow, Ft = e.object({
|
|
995
|
-
...u.shape,
|
|
996
|
-
feature_type: e.string().enum(Et),
|
|
997
|
-
config: e.object({
|
|
998
|
-
platform: e.string(),
|
|
999
|
-
platform_icon: e.string().optional(),
|
|
1000
|
-
link: e.string().optional(),
|
|
1001
|
-
qr_code_url: e.string().optional(),
|
|
1002
|
-
platform_desc: e.string().optional()
|
|
1003
|
-
})
|
|
1004
|
-
}), It = c.GiftCode, Dt = e.object({
|
|
1005
|
-
name: e.string(),
|
|
1006
|
-
icon_url: e.string(),
|
|
1007
|
-
count: e.number()
|
|
1008
|
-
}), $t = e.object({
|
|
1009
|
-
...u.shape,
|
|
1010
|
-
feature_type: e.string().enum(It),
|
|
1011
|
-
config: e.object({
|
|
1012
|
-
gift_items: e.array(Dt),
|
|
1013
|
-
mp_url: e.string().optional(),
|
|
1014
|
-
mp_qrcode_url: e.string().optional()
|
|
1015
|
-
})
|
|
1016
|
-
}), At = c.Invite, Ot = e.object({
|
|
1017
|
-
...u.shape,
|
|
1018
|
-
feature_type: e.string().enum(At),
|
|
1019
|
-
config: e.object({
|
|
1020
|
-
share_url: e.string()
|
|
1021
|
-
})
|
|
1022
|
-
}), Gt = c.InvitedRegister, Nt = e.object({
|
|
1023
|
-
...u.shape,
|
|
1024
|
-
feature_type: e.string().enum(Gt)
|
|
1025
|
-
}), Qt = e.string().enum(L(v, "GiftCode", "LotteryTicket")), Bt = c.Lottery, Mt = e.object({
|
|
1026
|
-
reward_item_id: e.number(),
|
|
1027
|
-
reward_item_name: e.string(),
|
|
1028
|
-
reward_item_type: Qt,
|
|
1029
|
-
reward_item_icon_url: e.string(),
|
|
1030
|
-
reward_item_desc: e.string().optional(),
|
|
1031
|
-
reward_amount: e.number(),
|
|
1032
|
-
reward_remaining_stock: e.number(),
|
|
1033
|
-
reward_item_rating: e.number()
|
|
1034
|
-
}), Kt = e.object({
|
|
1035
|
-
...u.shape,
|
|
1036
|
-
feature_type: e.string().enum(Bt),
|
|
1037
|
-
config: e.object({
|
|
1038
|
-
consume_item_id: e.number(),
|
|
1039
|
-
consume_item_name: e.string(),
|
|
1040
|
-
consume_item_icon_url: e.string(),
|
|
1041
|
-
consume_item_count: e.array(e.number()),
|
|
1042
|
-
consume_item_desc: e.string().optional(),
|
|
1043
|
-
rewards: e.array(Mt)
|
|
1044
|
-
})
|
|
1045
|
-
}), Ht = c.LotteryDraw, zt = e.object({
|
|
1046
|
-
...u.shape,
|
|
1047
|
-
feature_type: e.string().enum(Ht),
|
|
1048
|
-
config: e.object({
|
|
1049
|
-
draw_not_before: e.number(),
|
|
1050
|
-
draw_not_after: e.number()
|
|
1051
|
-
})
|
|
1052
|
-
}), Jt = c.Preregister, Zt = e.object({
|
|
1053
|
-
...u.shape,
|
|
1054
|
-
feature_type: e.string().enum(Jt)
|
|
1055
|
-
}), Xt = c.Quest, Yt = e.object({
|
|
1056
|
-
...u.shape,
|
|
1057
|
-
feature_type: e.string().enum(Xt),
|
|
1058
|
-
config: e.object({
|
|
1059
|
-
objective: ee,
|
|
1060
|
-
completion_value: e.number(),
|
|
1061
|
-
team: e.object({
|
|
1062
|
-
feature_id: e.number().optional(),
|
|
1063
|
-
completion_value: e.number(),
|
|
1064
|
-
progress_algorithm: pt.clone().optional(),
|
|
1065
|
-
top_n: e.number().optional()
|
|
1066
|
-
}).optional(),
|
|
1067
|
-
config: e.object({
|
|
1068
|
-
topic_id: e.number().optional(),
|
|
1069
|
-
required_players: e.number().min(1).optional(),
|
|
1070
|
-
required_matches: e.number().min(1).optional(),
|
|
1071
|
-
event_item_id: e.number().optional()
|
|
1072
|
-
}).optional()
|
|
1073
|
-
})
|
|
1074
|
-
}), Wt = c.Redeem, en = e.object({
|
|
1075
|
-
price: e.number(),
|
|
1076
|
-
per_user_limit: e.number(),
|
|
1077
|
-
item: g
|
|
1078
|
-
}), tn = e.object({
|
|
1079
|
-
...u.shape,
|
|
1080
|
-
feature_type: e.string().enum(Wt),
|
|
1081
|
-
config: e.object({
|
|
1082
|
-
event_item_id: e.number(),
|
|
1083
|
-
redeem_catalog: e.array(en)
|
|
1084
|
-
})
|
|
1085
|
-
}), nn = c.Register, rn = e.object({
|
|
1086
|
-
...u.shape,
|
|
1087
|
-
feature_type: e.string().enum(nn)
|
|
1088
|
-
}), on = c.Share, an = e.object({
|
|
1089
|
-
...u.shape,
|
|
1090
|
-
feature_type: e.string().enum(on),
|
|
1091
|
-
config: e.object({
|
|
1092
|
-
share_platform: e.string(),
|
|
1093
|
-
jump_url: e.string().optional(),
|
|
1094
|
-
icon_url: e.string().optional()
|
|
1095
|
-
})
|
|
1096
|
-
}), sn = c.Subscribe, cn = e.object({
|
|
1097
|
-
...u.shape,
|
|
1098
|
-
feature_type: e.string().enum(sn),
|
|
1099
|
-
config: e.object({
|
|
1100
|
-
weixin_template_ids: e.array(e.string())
|
|
1101
|
-
})
|
|
1102
|
-
}), un = c.Survey, ln = e.object({
|
|
1103
|
-
...u.shape,
|
|
1104
|
-
feature_type: e.string().enum(un),
|
|
1105
|
-
config: e.object({
|
|
1106
|
-
survey_id: e.string(),
|
|
1107
|
-
survey_url: e.string()
|
|
1108
|
-
})
|
|
1109
|
-
}), mn = c.Team, dn = e.object({
|
|
1110
|
-
...u.shape,
|
|
1111
|
-
feature_type: e.string().enum(mn),
|
|
1112
|
-
config: e.object({
|
|
1113
|
-
max_members: e.number().min(1),
|
|
1114
|
-
min_members: e.number().min(1)
|
|
1115
|
-
})
|
|
1116
|
-
}), gn = c.Ugc, _n = e.object({
|
|
1117
|
-
...u.shape,
|
|
1118
|
-
feature_type: e.string().enum(gn),
|
|
1119
|
-
config: e.object({
|
|
1120
|
-
allowed_social_medias: e.array(e.string()).optional(),
|
|
1121
|
-
acceptance_rewards: e.array(g).optional()
|
|
1122
|
-
})
|
|
1123
|
-
}), pn = c.UgcLike, bn = e.object({
|
|
1124
|
-
...u.shape,
|
|
1125
|
-
feature_type: e.string().enum(pn),
|
|
1126
|
-
config: e.object({
|
|
1127
|
-
ugc_feature_id: e.number()
|
|
1128
|
-
})
|
|
1129
|
-
}), yn = c.Vote, fn = e.object({
|
|
1130
|
-
sn: e.string(),
|
|
1131
|
-
name: e.string(),
|
|
1132
|
-
img_urls: e.array(e.string()).optional(),
|
|
1133
|
-
video_urls: e.array(e.string()).optional(),
|
|
1134
|
-
descriptions: e.array(e.string()).optional(),
|
|
1135
|
-
jump_url: e.string(),
|
|
1136
|
-
amount: e.number(),
|
|
1137
|
-
finalists: e.bool(),
|
|
1138
|
-
last_vote_time: e.number()
|
|
1139
|
-
}), hn = e.object({
|
|
1140
|
-
...u.shape,
|
|
1141
|
-
feature_type: e.string().enum(yn),
|
|
1142
|
-
config: e.object({
|
|
1143
|
-
vote_feature_ids: e.array(e.number()),
|
|
1144
|
-
submission_feature_ids: e.array(e.number()),
|
|
1145
|
-
finalists_amount: e.number(),
|
|
1146
|
-
source: st,
|
|
1147
|
-
options: e.array(fn),
|
|
1148
|
-
rewards: e.array(g)
|
|
1149
|
-
})
|
|
1150
|
-
}), T = e.union(e.string().pattern("NumberString", /^\d+$/), e.number()), ne = e.object({
|
|
1151
|
-
order_total_amount: T,
|
|
1152
|
-
cashback_total_amount: T,
|
|
1153
|
-
game_item_count: T
|
|
1154
|
-
}), wn = e.object({
|
|
1155
|
-
activation_key: e.string().disallow("")
|
|
1156
|
-
}), kn = e.object({
|
|
1157
|
-
gift_code: e.string()
|
|
1158
|
-
}), vn = e.object({
|
|
1159
|
-
user_id: e.string(),
|
|
1160
|
-
name: e.string().optional(),
|
|
1161
|
-
avatar_url: e.string().optional()
|
|
1162
|
-
}), Rn = e.object({
|
|
1163
|
-
lottery_count: e.number()
|
|
1164
|
-
}), R = e.object({
|
|
1165
|
-
reward_id: e.number(),
|
|
1166
|
-
reward_item_id: e.number(),
|
|
1167
|
-
reward_source: S,
|
|
1168
|
-
reward_item_name: e.string(),
|
|
1169
|
-
reward_item_type: Y,
|
|
1170
|
-
reward_item_icon_url: e.string(),
|
|
1171
|
-
reward_item_desc: e.string().optional(),
|
|
1172
|
-
reward_item_rating: e.number(),
|
|
1173
|
-
reward_amount: e.number(),
|
|
1174
|
-
reward_status: U,
|
|
1175
|
-
event_id: e.number(),
|
|
1176
|
-
event_name: e.string(),
|
|
1177
|
-
feature_id: e.number(),
|
|
1178
|
-
engagement_id: e.number(),
|
|
1179
|
-
feature_type: ot,
|
|
1180
|
-
receive_time: e.number(),
|
|
1181
|
-
extra_data: e.record(e.unknown()).optional()
|
|
1182
|
-
}), Cn = e.string().enum(w.Unknown, w.Pending), Vn = e.union(
|
|
1183
|
-
e.object({
|
|
1184
|
-
ticket: e.string(),
|
|
1185
|
-
status: Cn,
|
|
1186
|
-
created_at: e.number()
|
|
1187
|
-
}),
|
|
1188
|
-
e.object({
|
|
1189
|
-
ticket: e.string(),
|
|
1190
|
-
status: e.string().enum(L(w, "Unknown", "Pending")),
|
|
1191
|
-
created_at: e.number(),
|
|
1192
|
-
reward: R
|
|
1193
|
-
})
|
|
1194
|
-
).satisfies(), jn = e.object({
|
|
1195
|
-
tickets: e.array(Vn)
|
|
1196
|
-
}), Tn = e.object({
|
|
1197
|
-
platforms: e.array(e.string())
|
|
1198
|
-
}), re = e.object({
|
|
1199
|
-
role_name: e.string(),
|
|
1200
|
-
is_leader: e.bool(),
|
|
1201
|
-
is_myself: e.bool().optional(),
|
|
1202
|
-
progress: e.number().optional(),
|
|
1203
|
-
avatar_url: e.string().optional()
|
|
1204
|
-
}).lock(), qn = e.object({
|
|
1205
|
-
objective: ee,
|
|
1206
|
-
progress: e.number(),
|
|
1207
|
-
completion_value: e.number().optional(),
|
|
1208
|
-
team: e.object({
|
|
1209
|
-
progress: e.number(),
|
|
1210
|
-
completion_value: e.number().optional(),
|
|
1211
|
-
players: e.array(re)
|
|
1212
|
-
}).optional()
|
|
1213
|
-
}), xn = e.object({
|
|
1214
|
-
progress: e.number(),
|
|
1215
|
-
team: e.object({
|
|
1216
|
-
progress: e.number(),
|
|
1217
|
-
team_members: e.array(re).optional()
|
|
1218
|
-
}).optional()
|
|
1219
|
-
}), Ln = e.object({
|
|
1220
|
-
item_id: e.number(),
|
|
1221
|
-
item_count: e.number(),
|
|
1222
|
-
redeem_count: e.number()
|
|
1223
|
-
}), Un = e.object({
|
|
1224
|
-
item_stocks: e.array(
|
|
1225
|
-
e.object({
|
|
1226
|
-
item_id: e.number(),
|
|
1227
|
-
item_stock: e.number(),
|
|
1228
|
-
user_limit: e.number()
|
|
1229
|
-
})
|
|
1230
|
-
)
|
|
1231
|
-
}), Sn = e.object({
|
|
1232
|
-
platform: e.string().optional()
|
|
1233
|
-
}), Pn = e.object({
|
|
1234
|
-
weixin_openid: e.string()
|
|
1235
|
-
}), En = e.object({
|
|
1236
|
-
serial_number: e.number()
|
|
1237
|
-
}), Fn = e.object({
|
|
1238
|
-
team_code: e.string(),
|
|
1239
|
-
leader_name: e.string(),
|
|
1240
|
-
total_members: e.number()
|
|
1241
|
-
}), Vo = e.object({
|
|
1242
|
-
is_leader: e.bool(),
|
|
1243
|
-
is_myself: e.bool().optional(),
|
|
1244
|
-
role_name: e.string(),
|
|
1245
|
-
server_name: e.string(),
|
|
1246
|
-
avatar_url: e.string().optional()
|
|
1247
|
-
}), In = e.object({
|
|
1248
|
-
team_code: e.string(),
|
|
1249
|
-
visibility: mt,
|
|
1250
|
-
members: e.array(
|
|
1251
|
-
e.object({
|
|
1252
|
-
is_leader: e.bool(),
|
|
1253
|
-
role_name: e.string(),
|
|
1254
|
-
server_name: e.string()
|
|
1255
|
-
})
|
|
1256
|
-
)
|
|
1257
|
-
}), Dn = e.object({
|
|
1258
|
-
ugc_id: e.number(),
|
|
1259
|
-
title: e.string(),
|
|
1260
|
-
content: e.string().optional(),
|
|
1261
|
-
image_urls: e.array(e.string()).optional(),
|
|
1262
|
-
social_media: P.clone().optional(),
|
|
1263
|
-
social_media_url: e.string().optional()
|
|
1264
|
-
}), $n = e.object({
|
|
1265
|
-
ugcs: e.array(
|
|
1266
|
-
e.object({
|
|
1267
|
-
ugc_id: e.number(),
|
|
1268
|
-
event_id: e.number().optional(),
|
|
1269
|
-
feature_id: e.number().optional(),
|
|
1270
|
-
title: e.string(),
|
|
1271
|
-
content: e.string().optional(),
|
|
1272
|
-
image_urls: e.array(e.string()).optional(),
|
|
1273
|
-
social_media: P.clone().optional(),
|
|
1274
|
-
social_media_url: e.string().optional(),
|
|
1275
|
-
server_id: e.number().optional(),
|
|
1276
|
-
server_name: e.string().optional(),
|
|
1277
|
-
role_id: e.string().optional(),
|
|
1278
|
-
role_name: e.string().optional(),
|
|
1279
|
-
total_likes: e.number().optional(),
|
|
1280
|
-
created_at: e.number()
|
|
1281
|
-
})
|
|
1282
|
-
).optional(),
|
|
1283
|
-
next_token: e.string().optional()
|
|
1284
|
-
}), An = e.object({
|
|
1285
|
-
ugcs: e.array(
|
|
1286
|
-
e.object({
|
|
1287
|
-
ugc_id: e.number(),
|
|
1288
|
-
event_id: e.number().optional(),
|
|
1289
|
-
feature_id: e.number().optional(),
|
|
1290
|
-
feature_name: e.string().optional(),
|
|
1291
|
-
review_status: wt,
|
|
1292
|
-
reviewer_comment: e.string().optional(),
|
|
1293
|
-
title: e.string(),
|
|
1294
|
-
content: e.string().optional(),
|
|
1295
|
-
image_urls: e.array(e.string()).optional(),
|
|
1296
|
-
social_media: P.clone().optional(),
|
|
1297
|
-
social_media_url: e.string().optional(),
|
|
1298
|
-
server_id: e.number().optional(),
|
|
1299
|
-
server_name: e.string().optional(),
|
|
1300
|
-
role_id: e.string().optional(),
|
|
1301
|
-
role_name: e.string().optional(),
|
|
1302
|
-
total_likes: e.number().optional(),
|
|
1303
|
-
created_at: e.number()
|
|
1304
|
-
})
|
|
1305
|
-
).optional(),
|
|
1306
|
-
next_token: e.string().optional()
|
|
1307
|
-
}), On = e.object({
|
|
1308
|
-
total_count: e.number()
|
|
1309
|
-
}), Gn = e.object({
|
|
1310
|
-
existed: e.bool(),
|
|
1311
|
-
upload_url: e.string().optional(),
|
|
1312
|
-
image_url: e.string()
|
|
1313
|
-
}), Nn = e.object({
|
|
1314
|
-
ugcs: e.array(
|
|
1315
|
-
e.object({
|
|
1316
|
-
ugc_id: e.number(),
|
|
1317
|
-
rank: e.number(),
|
|
1318
|
-
total_likes: e.number(),
|
|
1319
|
-
image_urls: e.array(e.string()).optional(),
|
|
1320
|
-
server_id: e.number().optional(),
|
|
1321
|
-
server_name: e.string().optional(),
|
|
1322
|
-
role_id: e.string().optional(),
|
|
1323
|
-
role_name: e.string().optional()
|
|
1324
|
-
})
|
|
1325
|
-
).optional()
|
|
1326
|
-
}), Qn = e.object({
|
|
1327
|
-
option_sn: e.string()
|
|
1328
|
-
}), Bn = e.object({
|
|
1329
|
-
candidate_id: e.string(),
|
|
1330
|
-
total_votes: e.number().optional(),
|
|
1331
|
-
my_votes: e.number().optional(),
|
|
1332
|
-
votes: e.number().optional()
|
|
1333
|
-
}), Mn = e.object({
|
|
1334
|
-
rewards_type: yt,
|
|
1335
|
-
rewards: e.array(R).optional()
|
|
1336
|
-
}), Kn = e.object({
|
|
1337
|
-
candidate_id: e.string(),
|
|
1338
|
-
is_winner: e.bool(),
|
|
1339
|
-
total_votes: e.number(),
|
|
1340
|
-
my_votes: e.number()
|
|
1341
|
-
}), Hn = e.object({
|
|
1342
|
-
role: e.string(),
|
|
1343
|
-
content: e.string()
|
|
1344
|
-
}), zn = e.object({
|
|
1345
|
-
conversations: e.array(Hn)
|
|
1346
|
-
}), Jn = e.object({
|
|
1347
|
-
user_id: e.string(),
|
|
1348
|
-
name: e.string(),
|
|
1349
|
-
avatar_url: e.string(),
|
|
1350
|
-
comment: e.string(),
|
|
1351
|
-
video_note: e.number(),
|
|
1352
|
-
created_at: e.number()
|
|
1353
|
-
}), E = e.union(
|
|
1354
|
-
Tn,
|
|
1355
|
-
Rn,
|
|
1356
|
-
En,
|
|
1357
|
-
vn,
|
|
1358
|
-
Sn,
|
|
1359
|
-
Qn,
|
|
1360
|
-
Bn,
|
|
1361
|
-
Pn,
|
|
1362
|
-
ne,
|
|
1363
|
-
kn,
|
|
1364
|
-
In,
|
|
1365
|
-
qn,
|
|
1366
|
-
jn,
|
|
1367
|
-
wn,
|
|
1368
|
-
zn,
|
|
1369
|
-
Dn,
|
|
1370
|
-
Ln,
|
|
1371
|
-
e.custom(
|
|
1372
|
-
"EmptyObject",
|
|
1373
|
-
(o) => y(o) && Object.keys(o).length === 0
|
|
1374
|
-
)
|
|
1375
|
-
).satisfies().lock(), Zn = e.object({
|
|
1376
|
-
reward_id: e.number(),
|
|
1377
|
-
reward_item_id: e.number(),
|
|
1378
|
-
reward_item_type: W,
|
|
1379
|
-
reward_count: e.number(),
|
|
1380
|
-
reward_status: te,
|
|
1381
|
-
reward_source: S,
|
|
1382
|
-
reward_item_name: e.string(),
|
|
1383
|
-
reward_item_icon_url: e.string(),
|
|
1384
|
-
reward_item_desc: e.string().optional(),
|
|
1385
|
-
reward_item_rating: e.number(),
|
|
1386
|
-
receive_time: e.number(),
|
|
1387
|
-
extra_data: e.union(...E.validators, e.record(e.unknown())).satisfies().optional()
|
|
1388
|
-
}), Xn = e.object({
|
|
1389
|
-
reward_id: e.number(),
|
|
1390
|
-
reward_item_id: e.number(),
|
|
1391
|
-
reward_item_name: e.string(),
|
|
1392
|
-
reward_item_type: W,
|
|
1393
|
-
reward_item_icon_url: e.string(),
|
|
1394
|
-
reward_item_desc: e.string().optional(),
|
|
1395
|
-
reward_item_rating: e.number(),
|
|
1396
|
-
reward_amount: e.number(),
|
|
1397
|
-
reward_status: te,
|
|
1398
|
-
reward_source: S,
|
|
1399
|
-
extra_data: e.record(e.unknown()).optional()
|
|
1400
|
-
}), Yn = e.object({
|
|
1401
|
-
engagement_id: e.number(),
|
|
1402
|
-
user_id: e.string(),
|
|
1403
|
-
event_id: e.number(),
|
|
1404
|
-
feature_id: e.number(),
|
|
1405
|
-
sequence: e.number(),
|
|
1406
|
-
data: E.clone().optional(),
|
|
1407
|
-
server_id: e.string().optional(),
|
|
1408
|
-
role_id: e.string().optional(),
|
|
1409
|
-
created_at: e.number(),
|
|
1410
|
-
rewards: e.array(Zn).optional()
|
|
1411
|
-
}).lock(), Wn = e.object({
|
|
1412
|
-
allowed: e.bool(),
|
|
1413
|
-
registered: e.bool()
|
|
1414
|
-
}), er = e.object({
|
|
1415
|
-
feature_id: e.number(),
|
|
1416
|
-
can_engage: e.bool(),
|
|
1417
|
-
has_unclaimed_rewards: e.bool(),
|
|
1418
|
-
final_available_count: e.number(),
|
|
1419
|
-
total_remaining_engagements: e.number(),
|
|
1420
|
-
cycle_remaining_engagements: e.number()
|
|
1421
|
-
}), tr = e.object({
|
|
1422
|
-
engagement_id: e.number(),
|
|
1423
|
-
engagement: e.object({
|
|
1424
|
-
engagement_id: e.number(),
|
|
1425
|
-
sequence: e.number(),
|
|
1426
|
-
feature_id: e.number(),
|
|
1427
|
-
data: E.clone().optional()
|
|
1428
|
-
}).optional(),
|
|
1429
|
-
rewards: e.array(Xn).optional(),
|
|
1430
|
-
scan: e.bool().optional()
|
|
1431
|
-
}), nr = e.object({
|
|
1432
|
-
reward_id: e.number(),
|
|
1433
|
-
reward_status: U
|
|
1434
|
-
}), rr = c.Vote2, or = e.object({
|
|
1435
|
-
candidate_id: e.string(),
|
|
1436
|
-
display_name: e.string(),
|
|
1437
|
-
images: e.array(e.string()).optional(),
|
|
1438
|
-
videos: e.array(e.string()).optional(),
|
|
1439
|
-
description: e.string().optional(),
|
|
1440
|
-
jump_url: e.string()
|
|
1441
|
-
}), ar = e.object({
|
|
1442
|
-
...u.shape,
|
|
1443
|
-
feature_type: e.string().enum(rr),
|
|
1444
|
-
config: e.object({
|
|
1445
|
-
vote_item_id: e.number().optional(),
|
|
1446
|
-
candidates: e.array(or),
|
|
1447
|
-
vote_since: e.number(),
|
|
1448
|
-
vote_until: e.number(),
|
|
1449
|
-
rewards_since: e.number(),
|
|
1450
|
-
rewards_until: e.number(),
|
|
1451
|
-
winner_rewards: e.array(g).optional(),
|
|
1452
|
-
consolation_rewards: e.array(g).optional()
|
|
1453
|
-
})
|
|
1454
|
-
}), ir = c.ZeroChatgpt, sr = e.object({
|
|
1455
|
-
...u.shape,
|
|
1456
|
-
feature_type: e.string().enum(ir)
|
|
1457
|
-
}), cr = e.union(
|
|
1458
|
-
Vt,
|
|
1459
|
-
Tt,
|
|
1460
|
-
Ut,
|
|
1461
|
-
Pt,
|
|
1462
|
-
Ft,
|
|
1463
|
-
$t,
|
|
1464
|
-
Ot,
|
|
1465
|
-
Nt,
|
|
1466
|
-
Kt,
|
|
1467
|
-
zt,
|
|
1468
|
-
Zt,
|
|
1469
|
-
Yt,
|
|
1470
|
-
rn,
|
|
1471
|
-
an,
|
|
1472
|
-
cn,
|
|
1473
|
-
ln,
|
|
1474
|
-
dn,
|
|
1475
|
-
hn,
|
|
1476
|
-
ar,
|
|
1477
|
-
xt,
|
|
1478
|
-
sr,
|
|
1479
|
-
_n,
|
|
1480
|
-
bn,
|
|
1481
|
-
tn
|
|
1482
|
-
).key("feature_type").satisfies(), ur = e.object({
|
|
1483
|
-
event_name: e.string(),
|
|
1484
|
-
rules: e.string(),
|
|
1485
|
-
since: e.number(),
|
|
1486
|
-
until: e.number(),
|
|
1487
|
-
visit_count: e.number().optional(),
|
|
1488
|
-
features: e.array(cr)
|
|
1489
|
-
}).lock(), lr = e.guard(ur), mr = e.guard(Wn), F = s({ count: e.number() }), dr = s({ first_visit: e.bool() }), gr = s({
|
|
1490
|
-
engagements: e.union(e.array(Jn), e.array(Fn))
|
|
1491
|
-
}), _r = s({
|
|
1492
|
-
status: e.array(er)
|
|
1493
|
-
}), pr = s({
|
|
1494
|
-
engagements_counts: e.record(e.number())
|
|
1495
|
-
}), br = s({
|
|
1496
|
-
engagements: e.array(Yn),
|
|
1497
|
-
next_token: e.string().optional()
|
|
1498
|
-
}), yr = e.guard(tr), fr = s({
|
|
1499
|
-
claimed_items: e.array(nr)
|
|
1500
|
-
}), hr = s({
|
|
1501
|
-
rewards: e.array(R)
|
|
1502
|
-
}), wr = s({
|
|
1503
|
-
reward_status: U
|
|
1504
|
-
}), kr = s({
|
|
1505
|
-
user_rewards: e.array(R),
|
|
1506
|
-
next_token: e.string().optional()
|
|
1507
|
-
}), vr = s({
|
|
1508
|
-
unclaimed: e.number()
|
|
1509
|
-
}), Rr = s({
|
|
1510
|
-
scene: e.string()
|
|
1511
|
-
}), Cr = s({
|
|
1512
|
-
params: e.string()
|
|
1513
|
-
}), Vr = s({
|
|
1514
|
-
img: e.string()
|
|
1515
|
-
}), jr = e.guard(xn), Tr = e.guard(Mn), qr = e.guard(
|
|
1516
|
-
e.object({
|
|
1517
|
-
candidate_votes: e.array(Kn)
|
|
1518
|
-
})
|
|
1519
|
-
), xr = e.guard(ne), oe = e.guard(An), Lr = e.guard($n), Ur = e.guard(On), Sr = e.guard(Gn), Pr = e.guard(Nn), Er = e.guard(Un);
|
|
1520
|
-
async function jo(o, t, n) {
|
|
1521
|
-
const { data: r } = await this.req.get(
|
|
1522
|
-
"verify-mobile-allowed",
|
|
1523
|
-
{ game_id: o, mobile: t },
|
|
1524
|
-
mr,
|
|
1525
|
-
n
|
|
1526
|
-
);
|
|
1527
|
-
return r;
|
|
1096
|
+
async function Pr(e, t) {
|
|
1097
|
+
let { data: n } = await this.req.get(`event/${this.event}/feature-engagement-count`, {
|
|
1098
|
+
feature_id: e,
|
|
1099
|
+
type: "engagement"
|
|
1100
|
+
}, B, t);
|
|
1101
|
+
return n?.count ?? null;
|
|
1528
1102
|
}
|
|
1529
|
-
async function
|
|
1530
|
-
|
|
1531
|
-
|
|
1103
|
+
async function Fr(e, t) {
|
|
1104
|
+
let { data: n } = await this.req.get(`event/${this.event}/feature-engagements`, { feature_id: e }, cr, t);
|
|
1105
|
+
return n?.engagements || [];
|
|
1532
1106
|
}
|
|
1533
|
-
async function
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
return n?.count ?? null;
|
|
1107
|
+
async function Ir(e, t) {
|
|
1108
|
+
await this.token.autoLogin();
|
|
1109
|
+
let { data: n, code: r, message: i } = await this.req.post(`event/${this.event}/visit`, a(e || {}), sr, t);
|
|
1110
|
+
return n ?? {
|
|
1111
|
+
message: i,
|
|
1112
|
+
error: r
|
|
1113
|
+
};
|
|
1541
1114
|
}
|
|
1542
|
-
async function
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1115
|
+
async function Lr(e, t) {
|
|
1116
|
+
if (!await this.token.autoLogin()) return [];
|
|
1117
|
+
let { data: n } = await this.req.get("event/user-feature-status", {
|
|
1118
|
+
...e,
|
|
1119
|
+
event_id: this.event
|
|
1120
|
+
}, lr, {
|
|
1121
|
+
...t,
|
|
1122
|
+
message: !1
|
|
1123
|
+
});
|
|
1124
|
+
return n?.status || [];
|
|
1550
1125
|
}
|
|
1551
|
-
async function
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1126
|
+
async function Rr(e, t) {
|
|
1127
|
+
if (!await this.token.autoLogin()) return {};
|
|
1128
|
+
let { data: n } = await this.req.get("event/user-engagements-count", {
|
|
1129
|
+
...t,
|
|
1130
|
+
event_id: this.event,
|
|
1131
|
+
feature_id: e
|
|
1132
|
+
}, ur, { message: !1 });
|
|
1133
|
+
return n?.engagements_counts || {};
|
|
1559
1134
|
}
|
|
1560
|
-
async function
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1135
|
+
async function zr(e, t, n) {
|
|
1136
|
+
if (!await this.token.autoLogin()) return {
|
|
1137
|
+
engagements: [],
|
|
1138
|
+
next_token: ""
|
|
1139
|
+
};
|
|
1140
|
+
let { data: r } = await this.req.get("event/user-engagements", {
|
|
1141
|
+
max_results: 20,
|
|
1142
|
+
...t,
|
|
1143
|
+
event_id: this.event,
|
|
1144
|
+
feature_id: e
|
|
1145
|
+
}, dr, n);
|
|
1146
|
+
return {
|
|
1147
|
+
engagements: r?.engagements || [],
|
|
1148
|
+
next_token: r?.next_token || ""
|
|
1149
|
+
};
|
|
1572
1150
|
}
|
|
1573
|
-
async function
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
return n?.status || [];
|
|
1151
|
+
async function Br(e, t, n, r) {
|
|
1152
|
+
await this.token.autoLogin();
|
|
1153
|
+
let { data: i, code: o, message: s } = await this.req.post(`event/${this.event}/engage`, a({
|
|
1154
|
+
feature_id: e,
|
|
1155
|
+
engagement: t,
|
|
1156
|
+
...n
|
|
1157
|
+
}), fr, r);
|
|
1158
|
+
return i ?? {
|
|
1159
|
+
message: s,
|
|
1160
|
+
error: o
|
|
1161
|
+
};
|
|
1585
1162
|
}
|
|
1586
|
-
async function
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1163
|
+
async function Vr(e, t) {
|
|
1164
|
+
await this.token.autoLogin();
|
|
1165
|
+
let { data: n, code: r, message: i } = await this.req.post("event/claim-rewards", a({
|
|
1166
|
+
...e,
|
|
1167
|
+
server_id: e.server_id ? +e.server_id : void 0
|
|
1168
|
+
}), pr, t);
|
|
1169
|
+
return n?.claimed_items || {
|
|
1170
|
+
message: i,
|
|
1171
|
+
error: r
|
|
1172
|
+
};
|
|
1595
1173
|
}
|
|
1596
|
-
async function
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
"event/user-engagements",
|
|
1604
|
-
{
|
|
1605
|
-
max_results: 20,
|
|
1606
|
-
...t,
|
|
1607
|
-
event_id: this.event,
|
|
1608
|
-
feature_id: o
|
|
1609
|
-
},
|
|
1610
|
-
br,
|
|
1611
|
-
n
|
|
1612
|
-
);
|
|
1613
|
-
return {
|
|
1614
|
-
engagements: r?.engagements || [],
|
|
1615
|
-
next_token: r?.next_token || ""
|
|
1616
|
-
};
|
|
1174
|
+
async function Hr(e, t) {
|
|
1175
|
+
if (!await this.token.autoLogin()) return null;
|
|
1176
|
+
let { ok: n, code: r, message: i } = await this.req.post(`event/${this.event}/user-reward-address`, e, null, t);
|
|
1177
|
+
return n || {
|
|
1178
|
+
message: i,
|
|
1179
|
+
error: r
|
|
1180
|
+
};
|
|
1617
1181
|
}
|
|
1618
|
-
async function
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
l({
|
|
1623
|
-
feature_id: o,
|
|
1624
|
-
engagement: t,
|
|
1625
|
-
...n
|
|
1626
|
-
}),
|
|
1627
|
-
yr,
|
|
1628
|
-
r
|
|
1629
|
-
);
|
|
1630
|
-
return a ?? {
|
|
1631
|
-
message: d,
|
|
1632
|
-
error: i
|
|
1633
|
-
};
|
|
1182
|
+
async function Ur(e, t) {
|
|
1183
|
+
if (!await this.token.autoLogin()) return null;
|
|
1184
|
+
let { data: n } = await this.req.get("event/unlimit-qrcode-scene", { params: e }, vr, t);
|
|
1185
|
+
return n?.scene ?? null;
|
|
1634
1186
|
}
|
|
1635
|
-
async function
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
"event/claim-rewards",
|
|
1639
|
-
l({
|
|
1640
|
-
...o,
|
|
1641
|
-
server_id: o.server_id ? +o.server_id : void 0
|
|
1642
|
-
}),
|
|
1643
|
-
fr,
|
|
1644
|
-
t
|
|
1645
|
-
);
|
|
1646
|
-
return n?.claimed_items || {
|
|
1647
|
-
message: a,
|
|
1648
|
-
error: r
|
|
1649
|
-
};
|
|
1187
|
+
async function Wr(e, t) {
|
|
1188
|
+
let { data: n } = await this.req.get("event/params-by-qrcode-scene", { scene: e }, yr, t);
|
|
1189
|
+
return n?.params ?? null;
|
|
1650
1190
|
}
|
|
1651
|
-
async function
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
o,
|
|
1656
|
-
null,
|
|
1657
|
-
t
|
|
1658
|
-
);
|
|
1659
|
-
return n || {
|
|
1660
|
-
message: a,
|
|
1661
|
-
error: r
|
|
1662
|
-
};
|
|
1191
|
+
async function Gr(e, t) {
|
|
1192
|
+
if (!await this.token.autoLogin()) return null;
|
|
1193
|
+
let { data: n } = await this.req.post("event/unlimit-qrcode", a(e), br, t);
|
|
1194
|
+
return n?.img ?? null;
|
|
1663
1195
|
}
|
|
1664
|
-
async function
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1196
|
+
async function Kr(e, t) {
|
|
1197
|
+
if (!await this.token.autoLogin()) return null;
|
|
1198
|
+
let { data: n, code: r, message: i } = await this.req.get(`event/${this.event}/quest-progress`, { feature_id: e }, xr, {
|
|
1199
|
+
message: !1,
|
|
1200
|
+
...t
|
|
1201
|
+
});
|
|
1202
|
+
return n || {
|
|
1203
|
+
message: i,
|
|
1204
|
+
error: r
|
|
1205
|
+
};
|
|
1673
1206
|
}
|
|
1674
|
-
async function
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1207
|
+
async function qr(e, t) {
|
|
1208
|
+
if (!await this.token.autoLogin()) return null;
|
|
1209
|
+
let { data: n, code: r, message: i } = await this.req.post("event/vote2/rewards", {
|
|
1210
|
+
feature_id: e,
|
|
1211
|
+
event_id: this.event
|
|
1212
|
+
}, Sr, t);
|
|
1213
|
+
return n || {
|
|
1214
|
+
message: i,
|
|
1215
|
+
code: r
|
|
1216
|
+
};
|
|
1682
1217
|
}
|
|
1683
|
-
async function
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
);
|
|
1691
|
-
return n?.img ?? null;
|
|
1218
|
+
async function Jr(e, t) {
|
|
1219
|
+
if (!await this.token.autoLogin()) return [];
|
|
1220
|
+
let { data: n } = await this.req.get("event/vote2/leaderboard", {
|
|
1221
|
+
feature_id: e,
|
|
1222
|
+
event_id: this.event
|
|
1223
|
+
}, Cr, t);
|
|
1224
|
+
return n?.candidate_votes || [];
|
|
1692
1225
|
}
|
|
1693
|
-
async function
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
error: r
|
|
1704
|
-
};
|
|
1226
|
+
async function Yr(e, t) {
|
|
1227
|
+
if (!await this.token.autoLogin()) return null;
|
|
1228
|
+
let { data: n, code: r, message: i } = await this.req.get("event/cashback/query", {
|
|
1229
|
+
feature_id: e,
|
|
1230
|
+
event_id: this.event
|
|
1231
|
+
}, wr, t);
|
|
1232
|
+
return n || {
|
|
1233
|
+
message: i,
|
|
1234
|
+
error: r
|
|
1235
|
+
};
|
|
1705
1236
|
}
|
|
1706
|
-
async function
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
code: r
|
|
1717
|
-
};
|
|
1237
|
+
async function Xr(e, t) {
|
|
1238
|
+
if (!await this.token.autoLogin()) return null;
|
|
1239
|
+
let { data: n, code: r, message: i } = await this.req.get("event/ugc/my", {
|
|
1240
|
+
max_results: 20,
|
|
1241
|
+
...e
|
|
1242
|
+
}, Tr, t);
|
|
1243
|
+
return n || {
|
|
1244
|
+
message: i,
|
|
1245
|
+
error: r
|
|
1246
|
+
};
|
|
1718
1247
|
}
|
|
1719
|
-
async function
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
);
|
|
1727
|
-
return n?.candidate_votes || [];
|
|
1248
|
+
async function Zr(e, t) {
|
|
1249
|
+
if (!await this.token.autoLogin()) return null;
|
|
1250
|
+
let { data: n, code: r, message: i } = await this.req.get("event/ugc/my-count", { ...e }, Dr, t);
|
|
1251
|
+
return n || {
|
|
1252
|
+
message: i,
|
|
1253
|
+
error: r
|
|
1254
|
+
};
|
|
1728
1255
|
}
|
|
1729
|
-
async function
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
error: r
|
|
1740
|
-
};
|
|
1256
|
+
async function Qr(e, t) {
|
|
1257
|
+
await this.token.autoLogin();
|
|
1258
|
+
let { data: n, code: r, message: i } = await this.req.post("event/claim-rewards-v2", a({
|
|
1259
|
+
...e,
|
|
1260
|
+
server_id: e.server_id ? +e.server_id : void 0
|
|
1261
|
+
}), mr, t);
|
|
1262
|
+
return n?.rewards || {
|
|
1263
|
+
message: i,
|
|
1264
|
+
error: r
|
|
1265
|
+
};
|
|
1741
1266
|
}
|
|
1742
|
-
async function
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
);
|
|
1750
|
-
return n || {
|
|
1751
|
-
message: a,
|
|
1752
|
-
error: r
|
|
1753
|
-
};
|
|
1267
|
+
async function $r(e, t) {
|
|
1268
|
+
await this.token.autoLogin();
|
|
1269
|
+
let { data: n, code: r, message: i } = await this.req.post("event/claim-weixin-hongbao", { reward_id: e }, hr, t);
|
|
1270
|
+
return n || {
|
|
1271
|
+
message: i,
|
|
1272
|
+
error: r
|
|
1273
|
+
};
|
|
1754
1274
|
}
|
|
1755
|
-
async function
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
error: r
|
|
1766
|
-
};
|
|
1275
|
+
async function ei(e, t) {
|
|
1276
|
+
if (!this.token.isLoggedIn) return { error: "not_logged_in" };
|
|
1277
|
+
let { ok: n, code: r, message: i } = await this.req.post("verify-activation-key", { activation_key: e }, null, {
|
|
1278
|
+
message: !1,
|
|
1279
|
+
...t
|
|
1280
|
+
});
|
|
1281
|
+
return n || {
|
|
1282
|
+
message: i,
|
|
1283
|
+
error: r
|
|
1284
|
+
};
|
|
1767
1285
|
}
|
|
1768
|
-
async function
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
};
|
|
1286
|
+
async function ti(e, t) {
|
|
1287
|
+
if (!await this.token.autoLogin()) return {
|
|
1288
|
+
user_rewards: [],
|
|
1289
|
+
next_token: ""
|
|
1290
|
+
};
|
|
1291
|
+
let { data: n } = await this.req.post("event/user-rewards", a({
|
|
1292
|
+
max_results: 20,
|
|
1293
|
+
...e,
|
|
1294
|
+
event_id: this.event
|
|
1295
|
+
}), gr, t);
|
|
1296
|
+
return {
|
|
1297
|
+
user_rewards: n?.user_rewards || [],
|
|
1298
|
+
next_token: n?.next_token || ""
|
|
1299
|
+
};
|
|
1783
1300
|
}
|
|
1784
|
-
async function
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
{ reward_id: o },
|
|
1789
|
-
wr,
|
|
1790
|
-
t
|
|
1791
|
-
);
|
|
1792
|
-
return n || {
|
|
1793
|
-
message: a,
|
|
1794
|
-
error: r
|
|
1795
|
-
};
|
|
1301
|
+
async function ni(e, t) {
|
|
1302
|
+
if (!await this.token.autoLogin()) return { unclaimed: 0 };
|
|
1303
|
+
let { data: n } = await this.req.get("event/user-rewards-count", { ...e }, _r, t);
|
|
1304
|
+
return { unclaimed: n?.unclaimed || 0 };
|
|
1796
1305
|
}
|
|
1797
|
-
async function
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
message: !1,
|
|
1802
|
-
...t
|
|
1803
|
-
});
|
|
1804
|
-
return n || {
|
|
1805
|
-
message: a,
|
|
1806
|
-
error: r
|
|
1807
|
-
};
|
|
1306
|
+
async function ri(e, t) {
|
|
1307
|
+
if (!await this.token.autoLogin()) return null;
|
|
1308
|
+
let { data: n } = await this.req.get(`event/${this.event}/user-item-count`, { item_id: e }, B, t);
|
|
1309
|
+
return n?.count ?? null;
|
|
1808
1310
|
}
|
|
1809
|
-
async function
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
);
|
|
1821
|
-
return {
|
|
1822
|
-
user_rewards: n?.user_rewards || [],
|
|
1823
|
-
next_token: n?.next_token || ""
|
|
1824
|
-
};
|
|
1311
|
+
async function ii(e, t, n) {
|
|
1312
|
+
if (!await this.token.autoLogin()) return null;
|
|
1313
|
+
let { data: r, code: i, message: a } = await this.req.post("event/ugc/upload-image", {
|
|
1314
|
+
feature_id: e,
|
|
1315
|
+
...t,
|
|
1316
|
+
event_id: this.event
|
|
1317
|
+
}, Or, n);
|
|
1318
|
+
return r || {
|
|
1319
|
+
message: a,
|
|
1320
|
+
error: i
|
|
1321
|
+
};
|
|
1825
1322
|
}
|
|
1826
|
-
async function
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
t
|
|
1836
|
-
);
|
|
1837
|
-
return {
|
|
1838
|
-
unclaimed: n?.unclaimed || 0
|
|
1839
|
-
};
|
|
1323
|
+
async function ai(e, t) {
|
|
1324
|
+
let { data: n, code: r, message: i } = await this.req.get("event/ugc/recommendation", {
|
|
1325
|
+
feature_id: e,
|
|
1326
|
+
event_id: this.event
|
|
1327
|
+
}, Tr, t);
|
|
1328
|
+
return n || {
|
|
1329
|
+
message: i,
|
|
1330
|
+
error: r
|
|
1331
|
+
};
|
|
1840
1332
|
}
|
|
1841
|
-
async function
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1333
|
+
async function oi(e, t, n) {
|
|
1334
|
+
let { data: r, code: i, message: a } = await this.req.get("event/ugc/ugcs", {
|
|
1335
|
+
event_id: this.event,
|
|
1336
|
+
feature_id: e,
|
|
1337
|
+
max_results: 20,
|
|
1338
|
+
...t
|
|
1339
|
+
}, Er, n);
|
|
1340
|
+
return r || {
|
|
1341
|
+
message: a,
|
|
1342
|
+
error: i
|
|
1343
|
+
};
|
|
1850
1344
|
}
|
|
1851
|
-
async function
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
error: a
|
|
1862
|
-
};
|
|
1345
|
+
async function si(e, t) {
|
|
1346
|
+
if (!await this.token.autoLogin()) return null;
|
|
1347
|
+
let { data: n, code: r, message: i } = await this.req.get("event/ugc/leaderboard", {
|
|
1348
|
+
feature_id: e,
|
|
1349
|
+
event_id: this.event
|
|
1350
|
+
}, kr, t);
|
|
1351
|
+
return n || {
|
|
1352
|
+
message: i,
|
|
1353
|
+
error: r
|
|
1354
|
+
};
|
|
1863
1355
|
}
|
|
1864
|
-
async function
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
return n || {
|
|
1875
|
-
message: a,
|
|
1876
|
-
error: r
|
|
1877
|
-
};
|
|
1356
|
+
async function ci(e, t) {
|
|
1357
|
+
if (!await this.token.autoLogin()) return null;
|
|
1358
|
+
let { data: n, code: r, message: i } = await this.req.get("event/redeem/item-stocks", {
|
|
1359
|
+
event_id: this.event,
|
|
1360
|
+
feature_id: e
|
|
1361
|
+
}, Ar, t);
|
|
1362
|
+
return n || {
|
|
1363
|
+
message: i,
|
|
1364
|
+
error: r
|
|
1365
|
+
};
|
|
1878
1366
|
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region src/community.enums.ts
|
|
1369
|
+
var li = {
|
|
1370
|
+
All: "all",
|
|
1371
|
+
Limit: "limit"
|
|
1372
|
+
}, ui = u.string().enum(li).lock(), di = {
|
|
1373
|
+
Pending: "pending",
|
|
1374
|
+
Approved: "approved",
|
|
1375
|
+
Failed: "failed",
|
|
1376
|
+
Suspect: "suspect"
|
|
1377
|
+
}, V = u.string().enum(di).lock(), fi = {
|
|
1378
|
+
System: "system",
|
|
1379
|
+
Comment: "comment",
|
|
1380
|
+
Like: "like"
|
|
1381
|
+
}, pi = u.string().enum(fi).lock(), H = {
|
|
1382
|
+
System: "system",
|
|
1383
|
+
PostPinned: "post_pinned",
|
|
1384
|
+
PostHighlighted: "post_highlighted",
|
|
1385
|
+
PostDeleted: "post_deleted",
|
|
1386
|
+
PostCommented: "post_commented",
|
|
1387
|
+
PostLiked: "post_liked",
|
|
1388
|
+
CommentReplied: "comment_replied",
|
|
1389
|
+
CommentLiked: "comment_liked",
|
|
1390
|
+
CommentDeleted: "comment_deleted",
|
|
1391
|
+
ReplyReplied: "reply_replied",
|
|
1392
|
+
ReplyLiked: "reply_liked",
|
|
1393
|
+
ReplyDeleted: "reply_deleted"
|
|
1394
|
+
}, mi = u.string().enum(H).lock(), U = u.object({
|
|
1395
|
+
forum_id: u.number(),
|
|
1396
|
+
icon_url: u.string(),
|
|
1397
|
+
name: u.string(),
|
|
1398
|
+
tags: u.array(u.string()),
|
|
1399
|
+
sort: u.number(),
|
|
1400
|
+
mode: ui,
|
|
1401
|
+
member_ids: u.array(u.number())
|
|
1402
|
+
}).lock(), W = u.object({
|
|
1403
|
+
topic_id: u.number(),
|
|
1404
|
+
cover_url: u.string(),
|
|
1405
|
+
name: u.string(),
|
|
1406
|
+
description: u.string(),
|
|
1407
|
+
tags: u.array(u.string()),
|
|
1408
|
+
post_num: u.number()
|
|
1409
|
+
}).lock(), G = u.object({
|
|
1410
|
+
post_id: u.number(),
|
|
1411
|
+
forum: U,
|
|
1412
|
+
posted_by: u.string(),
|
|
1413
|
+
nickname: u.string(),
|
|
1414
|
+
avatar_url: u.string(),
|
|
1415
|
+
title: u.string().optional(),
|
|
1416
|
+
content: u.string(),
|
|
1417
|
+
content_text_count: u.number(),
|
|
1418
|
+
summary: u.string(),
|
|
1419
|
+
like_num: u.number(),
|
|
1420
|
+
comments_num: u.number(),
|
|
1421
|
+
liked: u.bool(),
|
|
1422
|
+
image_urls: u.array(u.string()),
|
|
1423
|
+
topics: u.array(W),
|
|
1424
|
+
event_ids: u.array(u.number()),
|
|
1425
|
+
is_pinned: u.bool(),
|
|
1426
|
+
is_highlighted: u.bool(),
|
|
1427
|
+
status: V,
|
|
1428
|
+
create_time: u.number()
|
|
1429
|
+
}).lock(), K = u.object({ err_msg: u.string().optional() }).optional().lock(), hi = u.object({
|
|
1430
|
+
reply_id: u.number(),
|
|
1431
|
+
reply_content: u.string().optional(),
|
|
1432
|
+
replied_by: u.string(),
|
|
1433
|
+
nickname: u.string(),
|
|
1434
|
+
avatar_url: u.string()
|
|
1435
|
+
}).lock(), q = u.object({
|
|
1436
|
+
reply_id: u.number(),
|
|
1437
|
+
comment_id: u.number(),
|
|
1438
|
+
comment_content: u.string().optional(),
|
|
1439
|
+
commented_by: u.string().optional(),
|
|
1440
|
+
commented_by_nickname: u.string().optional(),
|
|
1441
|
+
commented_by_avatar_url: u.string().optional(),
|
|
1442
|
+
replied_by: u.string(),
|
|
1443
|
+
nickname: u.string(),
|
|
1444
|
+
avatar_url: u.string(),
|
|
1445
|
+
content: u.string(),
|
|
1446
|
+
like_num: u.number(),
|
|
1447
|
+
liked: u.bool(),
|
|
1448
|
+
reply_to: hi,
|
|
1449
|
+
create_time: u.number()
|
|
1450
|
+
}).lock(), J = u.object({
|
|
1451
|
+
comment_id: u.number(),
|
|
1452
|
+
post_id: u.number(),
|
|
1453
|
+
post_subject: u.string().optional(),
|
|
1454
|
+
post_summary: u.string().optional(),
|
|
1455
|
+
post_image_url: u.string().optional(),
|
|
1456
|
+
posted_by: u.string().optional(),
|
|
1457
|
+
posted_by_nickname: u.string().optional(),
|
|
1458
|
+
posted_by_avatar_url: u.string().optional(),
|
|
1459
|
+
commented_by: u.string(),
|
|
1460
|
+
nickname: u.string(),
|
|
1461
|
+
avatar_url: u.string(),
|
|
1462
|
+
content: u.string(),
|
|
1463
|
+
like_num: u.number(),
|
|
1464
|
+
reply_num: u.number(),
|
|
1465
|
+
liked: u.bool(),
|
|
1466
|
+
image_url: u.string(),
|
|
1467
|
+
create_time: u.number(),
|
|
1468
|
+
status: V,
|
|
1469
|
+
replies: u.array(q).optional()
|
|
1470
|
+
}).lock(), gi = u.object({
|
|
1471
|
+
image_url: u.string(),
|
|
1472
|
+
upload_url: u.string(),
|
|
1473
|
+
existed: u.bool()
|
|
1474
|
+
}).lock(), Y = u.object({
|
|
1475
|
+
notification_id: u.string(),
|
|
1476
|
+
notification_type: mi,
|
|
1477
|
+
is_read: u.bool(),
|
|
1478
|
+
create_time: u.number(),
|
|
1479
|
+
origin_user_id: u.string(),
|
|
1480
|
+
origin_user_name: u.string(),
|
|
1481
|
+
origin_user_avatar_url: u.string()
|
|
1482
|
+
}).lock(), _i = u.object({
|
|
1483
|
+
system_message_subject: u.string(),
|
|
1484
|
+
system_message_content: u.string()
|
|
1485
|
+
}).lock(), X = u.object({
|
|
1486
|
+
post_id: u.number(),
|
|
1487
|
+
post_subject: u.string(),
|
|
1488
|
+
post_summary: u.string(),
|
|
1489
|
+
post_image_url: u.string()
|
|
1490
|
+
}).lock(), Z = u.object({
|
|
1491
|
+
comment_id: u.number(),
|
|
1492
|
+
comment_content: u.string()
|
|
1493
|
+
}).lock(), Q = u.object({
|
|
1494
|
+
reply_id: u.number(),
|
|
1495
|
+
reply_content: u.string()
|
|
1496
|
+
}).lock(), vi = u.object({
|
|
1497
|
+
...Y.shape,
|
|
1498
|
+
..._i.shape,
|
|
1499
|
+
notification_type: u.string().enum(H.System)
|
|
1500
|
+
}), yi = u.object({
|
|
1501
|
+
...Y.shape,
|
|
1502
|
+
...X.shape,
|
|
1503
|
+
notification_type: u.string().enum(H.PostPinned, H.PostHighlighted, H.PostDeleted, H.PostLiked)
|
|
1504
|
+
}), bi = u.object({
|
|
1505
|
+
...Y.shape,
|
|
1506
|
+
...X.shape,
|
|
1507
|
+
...Z.shape,
|
|
1508
|
+
notification_type: u.string().enum(H.PostCommented)
|
|
1509
|
+
}), xi = u.object({
|
|
1510
|
+
...Y.shape,
|
|
1511
|
+
...Z.shape,
|
|
1512
|
+
...Q.shape,
|
|
1513
|
+
notification_type: u.string().enum(H.CommentReplied)
|
|
1514
|
+
}), Si = u.object({
|
|
1515
|
+
...Y.shape,
|
|
1516
|
+
...Z.shape,
|
|
1517
|
+
...X.shape,
|
|
1518
|
+
notification_type: u.string().enum(H.CommentLiked, H.CommentDeleted)
|
|
1519
|
+
}), Ci = u.object({
|
|
1520
|
+
...Y.shape,
|
|
1521
|
+
...Q.shape,
|
|
1522
|
+
notification_type: u.string().enum(H.ReplyReplied),
|
|
1523
|
+
comment_id: u.number(),
|
|
1524
|
+
reply_to_reply_id: u.number(),
|
|
1525
|
+
reply_to_reply_content: u.string()
|
|
1526
|
+
}), wi = u.object({
|
|
1527
|
+
...Y.shape,
|
|
1528
|
+
...Q.shape,
|
|
1529
|
+
...Z.shape,
|
|
1530
|
+
notification_type: u.string().enum(H.ReplyLiked, H.ReplyDeleted)
|
|
1531
|
+
}), Ti = u.union(vi, yi, bi, xi, Si, Ci, wi).satisfies().lock(), Ei = l({ forums: u.array(U) }), Di = l({ topics: u.array(W) }), Oi = l({ topic: W }), ki = l({ post: G }), Ai = l({
|
|
1532
|
+
posts: u.array(G),
|
|
1533
|
+
next_token: u.string().optional()
|
|
1534
|
+
}), ji = l({
|
|
1535
|
+
post: G.clone().optional(),
|
|
1536
|
+
antispam: K.clone().optional()
|
|
1537
|
+
}), Mi = l({
|
|
1538
|
+
replies: u.array(q),
|
|
1539
|
+
next_token: u.string().optional()
|
|
1540
|
+
}), Ni = l({ reply: q }), Pi = l({
|
|
1541
|
+
reply: q.clone().optional(),
|
|
1542
|
+
antispam: K.clone().optional()
|
|
1543
|
+
}), Fi = l({ comment: J }), Ii = l({
|
|
1544
|
+
comments: u.array(J),
|
|
1545
|
+
next_token: u.string().optional()
|
|
1546
|
+
}), Li = l({
|
|
1547
|
+
comment: J.clone().optional(),
|
|
1548
|
+
antispam: J.clone().optional()
|
|
1549
|
+
}), Ri = u.guard(gi), zi = l({
|
|
1550
|
+
notifications: u.array(Ti),
|
|
1551
|
+
next_token: u.string().optional()
|
|
1552
|
+
}), Bi = l({
|
|
1553
|
+
system: u.number(),
|
|
1554
|
+
comment: u.number(),
|
|
1555
|
+
like: u.number()
|
|
1556
|
+
}), Vi = class {
|
|
1557
|
+
token;
|
|
1558
|
+
req;
|
|
1559
|
+
constructor(e) {
|
|
1560
|
+
this.token = e, this.req = e.req;
|
|
1561
|
+
}
|
|
1562
|
+
async getForums(e) {
|
|
1563
|
+
let { data: t } = await this.req.get("community/forums", null, Ei, e);
|
|
1564
|
+
return t?.forums || [];
|
|
1565
|
+
}
|
|
1566
|
+
async getTopics(e) {
|
|
1567
|
+
let { data: t } = await this.req.get("community/topics", null, Di, e);
|
|
1568
|
+
return t?.topics || [];
|
|
1569
|
+
}
|
|
1570
|
+
async getTopic(e, t) {
|
|
1571
|
+
let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e }, Oi, t);
|
|
1572
|
+
return n?.topic ?? { error: r };
|
|
1573
|
+
}
|
|
1574
|
+
async getPosts(e, t) {
|
|
1575
|
+
let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null, Ai, t);
|
|
1576
|
+
return n ?? {
|
|
1577
|
+
message: i,
|
|
1578
|
+
error: r
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
async getPinnedPosts(e, t, n, r) {
|
|
1582
|
+
let { data: i, code: a, message: o } = await this.req.get("community/pinned-posts", {
|
|
1583
|
+
forum_id: e,
|
|
1584
|
+
max_results: t,
|
|
1585
|
+
next_token: n
|
|
1586
|
+
}, Ai, r);
|
|
1587
|
+
return i ?? {
|
|
1588
|
+
message: o,
|
|
1589
|
+
error: a
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
async getPost(e, t) {
|
|
1593
|
+
let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e }, ki, t);
|
|
1594
|
+
return n?.post ?? {
|
|
1595
|
+
message: i,
|
|
1596
|
+
error: r
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
async post(e, t) {
|
|
1600
|
+
let { data: n, code: r, message: i } = await this.req.post("community/post", a(e), ji, t);
|
|
1601
|
+
return n ?? {
|
|
1602
|
+
message: i,
|
|
1603
|
+
error: r
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
async getComments(e, t) {
|
|
1607
|
+
let { data: n, code: r, message: i } = await this.req.get("community/comments", e, Ii, t);
|
|
1608
|
+
return n ?? {
|
|
1609
|
+
message: i,
|
|
1610
|
+
error: r
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
async getComment(e, t) {
|
|
1614
|
+
let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e }, Fi, t);
|
|
1615
|
+
return n?.comment ?? {
|
|
1616
|
+
message: i,
|
|
1617
|
+
error: r
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
async comment(e, t) {
|
|
1621
|
+
await this.token.autoLogin();
|
|
1622
|
+
let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e), Li, t);
|
|
1623
|
+
return n ?? {
|
|
1624
|
+
message: i,
|
|
1625
|
+
error: r
|
|
1626
|
+
};
|
|
1627
|
+
}
|
|
1628
|
+
async getReplies(e, t) {
|
|
1629
|
+
let { data: n } = await this.req.get("community/replies", {
|
|
1630
|
+
max_results: 20,
|
|
1631
|
+
...e
|
|
1632
|
+
}, Mi, t);
|
|
1633
|
+
return {
|
|
1634
|
+
replies: n?.replies || [],
|
|
1635
|
+
next_token: n?.next_token || ""
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
async getReply(e, t) {
|
|
1639
|
+
let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e }, Ni, t);
|
|
1640
|
+
return n?.reply ?? {
|
|
1641
|
+
message: i,
|
|
1642
|
+
error: r
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
async reply(e, t) {
|
|
1646
|
+
await this.token.autoLogin();
|
|
1647
|
+
let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e), Pi, t);
|
|
1648
|
+
return n ?? {
|
|
1649
|
+
message: i,
|
|
1650
|
+
error: r
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
async like(e, t) {
|
|
1654
|
+
await this.token.autoLogin();
|
|
1655
|
+
let { ok: n, code: r, message: i } = await this.req.post("community/like", {
|
|
1656
|
+
...e,
|
|
1657
|
+
action: "like"
|
|
1658
|
+
}, null, t);
|
|
1659
|
+
return n || {
|
|
1660
|
+
message: i,
|
|
1661
|
+
error: r
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
async unlike(e, t) {
|
|
1665
|
+
await this.token.autoLogin();
|
|
1666
|
+
let { ok: n, code: r, message: i } = await this.req.post("community/like", {
|
|
1667
|
+
...e,
|
|
1668
|
+
action: "unlike"
|
|
1669
|
+
}, null, t);
|
|
1670
|
+
return n || {
|
|
1671
|
+
message: i,
|
|
1672
|
+
error: r
|
|
1673
|
+
};
|
|
1674
|
+
}
|
|
1675
|
+
async getMediaPresignedUrl(e, t) {
|
|
1676
|
+
await this.token.autoLogin();
|
|
1677
|
+
let { data: n } = await this.req.get("community/media-presign-url", e, Ri, t);
|
|
1678
|
+
return n;
|
|
1679
|
+
}
|
|
1680
|
+
async getNotifications(e, t) {
|
|
1681
|
+
await this.token.autoLogin();
|
|
1682
|
+
let { data: n } = await this.req.get("community/notifications", {
|
|
1683
|
+
max_results: 20,
|
|
1684
|
+
...e
|
|
1685
|
+
}, zi, t);
|
|
1686
|
+
return {
|
|
1687
|
+
notifications: n?.notifications || [],
|
|
1688
|
+
next_token: n?.next_token || ""
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
async getUnreadNotificationsCount(e) {
|
|
1692
|
+
if (!await this.token.autoLogin()) return null;
|
|
1693
|
+
let { data: t } = await this.req.get("community/unread-notifications-count", null, Bi, e);
|
|
1694
|
+
return t;
|
|
1695
|
+
}
|
|
1696
|
+
async clearUnreadNotifications(e, t) {
|
|
1697
|
+
if (!await this.token.autoLogin()) return !1;
|
|
1698
|
+
let { ok: n } = await this.req.post("community/clear-unread-notifications", { category: e }, null, t);
|
|
1699
|
+
return n;
|
|
1700
|
+
}
|
|
1701
|
+
}, Hi = l({
|
|
1702
|
+
nonce_str: u.string(),
|
|
1703
|
+
timestamp: u.number(),
|
|
1704
|
+
signature: u.string()
|
|
1705
|
+
}), Ui = /* @__PURE__ */ function(e) {
|
|
1706
|
+
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;
|
|
1707
|
+
}({});
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region src/weixin.guards.ts
|
|
1710
|
+
function $(e) {
|
|
1711
|
+
return t(e, "open_id", "union_id", "weixin_token");
|
|
1895
1712
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
}
|
|
1975
|
-
forum_id: e.number(),
|
|
1976
|
-
icon_url: e.string(),
|
|
1977
|
-
name: e.string(),
|
|
1978
|
-
tags: e.array(e.string()),
|
|
1979
|
-
sort: e.number(),
|
|
1980
|
-
mode: Ir,
|
|
1981
|
-
member_ids: e.array(e.number())
|
|
1982
|
-
}).lock(), I = e.object({
|
|
1983
|
-
topic_id: e.number(),
|
|
1984
|
-
cover_url: e.string(),
|
|
1985
|
-
name: e.string(),
|
|
1986
|
-
description: e.string(),
|
|
1987
|
-
tags: e.array(e.string()),
|
|
1988
|
-
post_num: e.number()
|
|
1989
|
-
}).lock(), D = e.object({
|
|
1990
|
-
post_id: e.number(),
|
|
1991
|
-
forum: ie,
|
|
1992
|
-
posted_by: e.string(),
|
|
1993
|
-
nickname: e.string(),
|
|
1994
|
-
avatar_url: e.string(),
|
|
1995
|
-
title: e.string().optional(),
|
|
1996
|
-
content: e.string(),
|
|
1997
|
-
content_text_count: e.number(),
|
|
1998
|
-
summary: e.string(),
|
|
1999
|
-
like_num: e.number(),
|
|
2000
|
-
comments_num: e.number(),
|
|
2001
|
-
liked: e.bool(),
|
|
2002
|
-
image_urls: e.array(e.string()),
|
|
2003
|
-
topics: e.array(I),
|
|
2004
|
-
event_ids: e.array(e.number()),
|
|
2005
|
-
is_pinned: e.bool(),
|
|
2006
|
-
is_highlighted: e.bool(),
|
|
2007
|
-
status: ae,
|
|
2008
|
-
create_time: e.number()
|
|
2009
|
-
}).lock(), se = e.object({
|
|
2010
|
-
err_msg: e.string().optional()
|
|
2011
|
-
}).optional().lock(), Or = e.object({
|
|
2012
|
-
reply_id: e.number(),
|
|
2013
|
-
reply_content: e.string().optional(),
|
|
2014
|
-
replied_by: e.string(),
|
|
2015
|
-
nickname: e.string(),
|
|
2016
|
-
avatar_url: e.string()
|
|
2017
|
-
}).lock(), C = e.object({
|
|
2018
|
-
reply_id: e.number(),
|
|
2019
|
-
comment_id: e.number(),
|
|
2020
|
-
comment_content: e.string().optional(),
|
|
2021
|
-
commented_by: e.string().optional(),
|
|
2022
|
-
commented_by_nickname: e.string().optional(),
|
|
2023
|
-
commented_by_avatar_url: e.string().optional(),
|
|
2024
|
-
replied_by: e.string(),
|
|
2025
|
-
nickname: e.string(),
|
|
2026
|
-
avatar_url: e.string(),
|
|
2027
|
-
content: e.string(),
|
|
2028
|
-
like_num: e.number(),
|
|
2029
|
-
liked: e.bool(),
|
|
2030
|
-
reply_to: Or,
|
|
2031
|
-
create_time: e.number()
|
|
2032
|
-
}).lock(), k = e.object({
|
|
2033
|
-
comment_id: e.number(),
|
|
2034
|
-
post_id: e.number(),
|
|
2035
|
-
post_subject: e.string().optional(),
|
|
2036
|
-
post_summary: e.string().optional(),
|
|
2037
|
-
post_image_url: e.string().optional(),
|
|
2038
|
-
posted_by: e.string().optional(),
|
|
2039
|
-
posted_by_nickname: e.string().optional(),
|
|
2040
|
-
posted_by_avatar_url: e.string().optional(),
|
|
2041
|
-
commented_by: e.string(),
|
|
2042
|
-
nickname: e.string(),
|
|
2043
|
-
avatar_url: e.string(),
|
|
2044
|
-
content: e.string(),
|
|
2045
|
-
like_num: e.number(),
|
|
2046
|
-
reply_num: e.number(),
|
|
2047
|
-
liked: e.bool(),
|
|
2048
|
-
image_url: e.string(),
|
|
2049
|
-
create_time: e.number(),
|
|
2050
|
-
status: ae,
|
|
2051
|
-
replies: e.array(C).optional()
|
|
2052
|
-
}).lock(), Gr = e.object({
|
|
2053
|
-
image_url: e.string(),
|
|
2054
|
-
upload_url: e.string(),
|
|
2055
|
-
existed: e.bool()
|
|
2056
|
-
}).lock(), _ = e.object({
|
|
2057
|
-
notification_id: e.string(),
|
|
2058
|
-
notification_type: Ar,
|
|
2059
|
-
is_read: e.bool(),
|
|
2060
|
-
create_time: e.number(),
|
|
2061
|
-
origin_user_id: e.string(),
|
|
2062
|
-
origin_user_name: e.string(),
|
|
2063
|
-
origin_user_avatar_url: e.string()
|
|
2064
|
-
}).lock(), Nr = e.object({
|
|
2065
|
-
system_message_subject: e.string(),
|
|
2066
|
-
system_message_content: e.string()
|
|
2067
|
-
}).lock(), $ = e.object({
|
|
2068
|
-
post_id: e.number(),
|
|
2069
|
-
post_subject: e.string(),
|
|
2070
|
-
post_summary: e.string(),
|
|
2071
|
-
post_image_url: e.string()
|
|
2072
|
-
}).lock(), V = e.object({
|
|
2073
|
-
comment_id: e.number(),
|
|
2074
|
-
comment_content: e.string()
|
|
2075
|
-
}).lock(), A = e.object({
|
|
2076
|
-
reply_id: e.number(),
|
|
2077
|
-
reply_content: e.string()
|
|
2078
|
-
}).lock(), Qr = e.object({
|
|
2079
|
-
..._.shape,
|
|
2080
|
-
...Nr.shape,
|
|
2081
|
-
notification_type: e.string().enum(m.System)
|
|
2082
|
-
}), Br = e.object({
|
|
2083
|
-
..._.shape,
|
|
2084
|
-
...$.shape,
|
|
2085
|
-
notification_type: e.string().enum(
|
|
2086
|
-
m.PostPinned,
|
|
2087
|
-
m.PostHighlighted,
|
|
2088
|
-
m.PostDeleted,
|
|
2089
|
-
m.PostLiked
|
|
2090
|
-
)
|
|
2091
|
-
}), Mr = e.object({
|
|
2092
|
-
..._.shape,
|
|
2093
|
-
...$.shape,
|
|
2094
|
-
...V.shape,
|
|
2095
|
-
notification_type: e.string().enum(m.PostCommented)
|
|
2096
|
-
}), Kr = e.object({
|
|
2097
|
-
..._.shape,
|
|
2098
|
-
...V.shape,
|
|
2099
|
-
...A.shape,
|
|
2100
|
-
notification_type: e.string().enum(m.CommentReplied)
|
|
2101
|
-
}), Hr = e.object({
|
|
2102
|
-
..._.shape,
|
|
2103
|
-
...V.shape,
|
|
2104
|
-
...$.shape,
|
|
2105
|
-
notification_type: e.string().enum(m.CommentLiked, m.CommentDeleted)
|
|
2106
|
-
}), zr = e.object({
|
|
2107
|
-
..._.shape,
|
|
2108
|
-
...A.shape,
|
|
2109
|
-
notification_type: e.string().enum(m.ReplyReplied),
|
|
2110
|
-
comment_id: e.number(),
|
|
2111
|
-
reply_to_reply_id: e.number(),
|
|
2112
|
-
reply_to_reply_content: e.string()
|
|
2113
|
-
}), Jr = e.object({
|
|
2114
|
-
..._.shape,
|
|
2115
|
-
...A.shape,
|
|
2116
|
-
...V.shape,
|
|
2117
|
-
notification_type: e.string().enum(m.ReplyLiked, m.ReplyDeleted)
|
|
2118
|
-
}), Zr = e.union(
|
|
2119
|
-
Qr,
|
|
2120
|
-
Br,
|
|
2121
|
-
Mr,
|
|
2122
|
-
Kr,
|
|
2123
|
-
Hr,
|
|
2124
|
-
zr,
|
|
2125
|
-
Jr
|
|
2126
|
-
).satisfies().lock(), Xr = s({ forums: e.array(ie) }), Yr = s({ topics: e.array(I) }), Wr = s({ topic: I }), eo = s({ post: D }), M = s({
|
|
2127
|
-
posts: e.array(D),
|
|
2128
|
-
next_token: e.string().optional()
|
|
2129
|
-
}), to = s({
|
|
2130
|
-
post: D.clone().optional(),
|
|
2131
|
-
antispam: se.clone().optional()
|
|
2132
|
-
}), no = s({
|
|
2133
|
-
replies: e.array(C),
|
|
2134
|
-
next_token: e.string().optional()
|
|
2135
|
-
}), ro = s({ reply: C }), oo = s({
|
|
2136
|
-
reply: C.clone().optional(),
|
|
2137
|
-
antispam: se.clone().optional()
|
|
2138
|
-
}), ao = s({ comment: k }), io = s({
|
|
2139
|
-
comments: e.array(k),
|
|
2140
|
-
next_token: e.string().optional()
|
|
2141
|
-
}), so = s({
|
|
2142
|
-
comment: k.clone().optional(),
|
|
2143
|
-
antispam: k.clone().optional()
|
|
2144
|
-
}), co = e.guard(Gr), uo = s({
|
|
2145
|
-
notifications: e.array(Zr),
|
|
2146
|
-
next_token: e.string().optional()
|
|
2147
|
-
}), lo = s({
|
|
2148
|
-
system: e.number(),
|
|
2149
|
-
comment: e.number(),
|
|
2150
|
-
like: e.number()
|
|
2151
|
-
});
|
|
2152
|
-
class aa {
|
|
2153
|
-
token;
|
|
2154
|
-
req;
|
|
2155
|
-
constructor(t) {
|
|
2156
|
-
this.token = t, this.req = t.req;
|
|
2157
|
-
}
|
|
2158
|
-
/**
|
|
2159
|
-
* 获取社区版块列表,仅返回启用状态的版块
|
|
2160
|
-
*
|
|
2161
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=QaqUa2K0z0
|
|
2162
|
-
*/
|
|
2163
|
-
async getForums(t) {
|
|
2164
|
-
const { data: n } = await this.req.get("community/forums", null, Xr, t);
|
|
2165
|
-
return n?.forums || [];
|
|
2166
|
-
}
|
|
2167
|
-
/**
|
|
2168
|
-
* 获取社区话题列表,仅返回启用状态的话题
|
|
2169
|
-
*
|
|
2170
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=mIwpymAQom
|
|
2171
|
-
*/
|
|
2172
|
-
async getTopics(t) {
|
|
2173
|
-
const { data: n } = await this.req.get("community/topics", null, Yr, t);
|
|
2174
|
-
return n?.topics || [];
|
|
2175
|
-
}
|
|
2176
|
-
/**
|
|
2177
|
-
* 根据话题 ID 获取社区话题信息
|
|
2178
|
-
*
|
|
2179
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
2180
|
-
*/
|
|
2181
|
-
async getTopic(t, n) {
|
|
2182
|
-
const { data: r, code: a } = await this.req.get(
|
|
2183
|
-
"community/topic",
|
|
2184
|
-
{ topic_id: t },
|
|
2185
|
-
Wr,
|
|
2186
|
-
n
|
|
2187
|
-
);
|
|
2188
|
-
return r?.topic ?? { error: a };
|
|
2189
|
-
}
|
|
2190
|
-
/**
|
|
2191
|
-
* 获取社区帖子列表
|
|
2192
|
-
*
|
|
2193
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=XKI9lDVrPq
|
|
2194
|
-
*/
|
|
2195
|
-
async getPosts(t, n) {
|
|
2196
|
-
const { data: r, code: a, message: i } = await this.req.get(
|
|
2197
|
-
"community/posts",
|
|
2198
|
-
t || null,
|
|
2199
|
-
M,
|
|
2200
|
-
n
|
|
2201
|
-
);
|
|
2202
|
-
return r ?? {
|
|
2203
|
-
message: i,
|
|
2204
|
-
error: a
|
|
2205
|
-
};
|
|
2206
|
-
}
|
|
2207
|
-
/**
|
|
2208
|
-
* 获取社区置顶帖子列表
|
|
2209
|
-
*
|
|
2210
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=yXubbZuDlC
|
|
2211
|
-
*/
|
|
2212
|
-
async getPinnedPosts(t, n, r, a) {
|
|
2213
|
-
const { data: i, code: d, message: b } = await this.req.get(
|
|
2214
|
-
"community/pinned-posts",
|
|
2215
|
-
{ forum_id: t, max_results: n, next_token: r },
|
|
2216
|
-
M,
|
|
2217
|
-
a
|
|
2218
|
-
);
|
|
2219
|
-
return i ?? {
|
|
2220
|
-
message: b,
|
|
2221
|
-
error: d
|
|
2222
|
-
};
|
|
2223
|
-
}
|
|
2224
|
-
/**
|
|
2225
|
-
* 根据帖子 id 获取帖子详情
|
|
2226
|
-
*
|
|
2227
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
2228
|
-
*/
|
|
2229
|
-
async getPost(t, n) {
|
|
2230
|
-
const { data: r, code: a, message: i } = await this.req.get(
|
|
2231
|
-
"community/post",
|
|
2232
|
-
{ post_id: t },
|
|
2233
|
-
eo,
|
|
2234
|
-
n
|
|
2235
|
-
);
|
|
2236
|
-
return r?.post ?? {
|
|
2237
|
-
message: i,
|
|
2238
|
-
error: a
|
|
2239
|
-
};
|
|
2240
|
-
}
|
|
2241
|
-
/**
|
|
2242
|
-
* 发布帖子
|
|
2243
|
-
*
|
|
2244
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=M5okHBuaVk
|
|
2245
|
-
*/
|
|
2246
|
-
async post(t, n) {
|
|
2247
|
-
const { data: r, code: a, message: i } = await this.req.post(
|
|
2248
|
-
"community/post",
|
|
2249
|
-
l(t),
|
|
2250
|
-
to,
|
|
2251
|
-
n
|
|
2252
|
-
);
|
|
2253
|
-
return r ?? {
|
|
2254
|
-
message: i,
|
|
2255
|
-
error: a
|
|
2256
|
-
};
|
|
2257
|
-
}
|
|
2258
|
-
/**
|
|
2259
|
-
* 获取社区帖子评论列表
|
|
2260
|
-
*
|
|
2261
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=djKbX7lFdp
|
|
2262
|
-
*/
|
|
2263
|
-
async getComments(t, n) {
|
|
2264
|
-
const { data: r, code: a, message: i } = await this.req.get(
|
|
2265
|
-
"community/comments",
|
|
2266
|
-
t,
|
|
2267
|
-
io,
|
|
2268
|
-
n
|
|
2269
|
-
);
|
|
2270
|
-
return r ?? {
|
|
2271
|
-
message: i,
|
|
2272
|
-
error: a
|
|
2273
|
-
};
|
|
2274
|
-
}
|
|
2275
|
-
/**
|
|
2276
|
-
* 根据评论 id 获取评论详情
|
|
2277
|
-
*
|
|
2278
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
2279
|
-
*/
|
|
2280
|
-
async getComment(t, n) {
|
|
2281
|
-
const { data: r, code: a, message: i } = await this.req.get(
|
|
2282
|
-
"community/comment",
|
|
2283
|
-
{ comment_id: t },
|
|
2284
|
-
ao,
|
|
2285
|
-
n
|
|
2286
|
-
);
|
|
2287
|
-
return r?.comment ?? {
|
|
2288
|
-
message: i,
|
|
2289
|
-
error: a
|
|
2290
|
-
};
|
|
2291
|
-
}
|
|
2292
|
-
/**
|
|
2293
|
-
* 帖子下发表评论
|
|
2294
|
-
*
|
|
2295
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Nv7lk0nTmr
|
|
2296
|
-
*/
|
|
2297
|
-
async comment(t, n) {
|
|
2298
|
-
await this.token.autoLogin();
|
|
2299
|
-
const { data: r, code: a, message: i } = await this.req.post(
|
|
2300
|
-
"community/comment",
|
|
2301
|
-
l(t),
|
|
2302
|
-
so,
|
|
2303
|
-
n
|
|
2304
|
-
);
|
|
2305
|
-
return r ?? {
|
|
2306
|
-
message: i,
|
|
2307
|
-
error: a
|
|
2308
|
-
};
|
|
2309
|
-
}
|
|
2310
|
-
/**
|
|
2311
|
-
* 获取社区帖子评论回复列表
|
|
2312
|
-
*
|
|
2313
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=sVKBbY83MY
|
|
2314
|
-
*/
|
|
2315
|
-
async getReplies(t, n) {
|
|
2316
|
-
const { data: r } = await this.req.get(
|
|
2317
|
-
"community/replies",
|
|
2318
|
-
{ max_results: 20, ...t },
|
|
2319
|
-
no,
|
|
2320
|
-
n
|
|
2321
|
-
);
|
|
2322
|
-
return {
|
|
2323
|
-
replies: r?.replies || [],
|
|
2324
|
-
next_token: r?.next_token || ""
|
|
2325
|
-
};
|
|
2326
|
-
}
|
|
2327
|
-
/**
|
|
2328
|
-
* 根据回复 id 获取回复详情
|
|
2329
|
-
*
|
|
2330
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
2331
|
-
*/
|
|
2332
|
-
async getReply(t, n) {
|
|
2333
|
-
const { data: r, code: a, message: i } = await this.req.get(
|
|
2334
|
-
"community/reply",
|
|
2335
|
-
{ reply_id: t },
|
|
2336
|
-
ro,
|
|
2337
|
-
n
|
|
2338
|
-
);
|
|
2339
|
-
return r?.reply ?? {
|
|
2340
|
-
message: i,
|
|
2341
|
-
error: a
|
|
2342
|
-
};
|
|
2343
|
-
}
|
|
2344
|
-
/**
|
|
2345
|
-
* 回复帖子评论或回复
|
|
2346
|
-
*
|
|
2347
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=KA8WpTX2pg
|
|
2348
|
-
*/
|
|
2349
|
-
async reply(t, n) {
|
|
2350
|
-
await this.token.autoLogin();
|
|
2351
|
-
const { data: r, code: a, message: i } = await this.req.post(
|
|
2352
|
-
"community/reply",
|
|
2353
|
-
l(t),
|
|
2354
|
-
oo,
|
|
2355
|
-
n
|
|
2356
|
-
);
|
|
2357
|
-
return r ?? {
|
|
2358
|
-
message: i,
|
|
2359
|
-
error: a
|
|
2360
|
-
};
|
|
2361
|
-
}
|
|
2362
|
-
/**
|
|
2363
|
-
* 对 帖子/评论/回复 点赞
|
|
2364
|
-
*
|
|
2365
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CR3m6PyXfZ
|
|
2366
|
-
*/
|
|
2367
|
-
async like(t, n) {
|
|
2368
|
-
await this.token.autoLogin();
|
|
2369
|
-
const { ok: r, code: a, message: i } = await this.req.post(
|
|
2370
|
-
"community/like",
|
|
2371
|
-
{ ...t, action: "like" },
|
|
2372
|
-
null,
|
|
2373
|
-
n
|
|
2374
|
-
);
|
|
2375
|
-
return r || {
|
|
2376
|
-
message: i,
|
|
2377
|
-
error: a
|
|
2378
|
-
};
|
|
2379
|
-
}
|
|
2380
|
-
/**
|
|
2381
|
-
* 对 帖子/评论/回复 取消点赞
|
|
2382
|
-
*
|
|
2383
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CR3m6PyXfZ
|
|
2384
|
-
*/
|
|
2385
|
-
async unlike(t, n) {
|
|
2386
|
-
await this.token.autoLogin();
|
|
2387
|
-
const { ok: r, code: a, message: i } = await this.req.post(
|
|
2388
|
-
"community/like",
|
|
2389
|
-
{ ...t, action: "unlike" },
|
|
2390
|
-
null,
|
|
2391
|
-
n
|
|
2392
|
-
);
|
|
2393
|
-
return r || {
|
|
2394
|
-
message: i,
|
|
2395
|
-
error: a
|
|
2396
|
-
};
|
|
2397
|
-
}
|
|
2398
|
-
/**
|
|
2399
|
-
* 获取资源预上传地址
|
|
2400
|
-
*
|
|
2401
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=dWWhpoShxZ
|
|
2402
|
-
*/
|
|
2403
|
-
async getMediaPresignedUrl(t, n) {
|
|
2404
|
-
await this.token.autoLogin();
|
|
2405
|
-
const { data: r } = await this.req.get(
|
|
2406
|
-
"community/media-presign-url",
|
|
2407
|
-
t,
|
|
2408
|
-
co,
|
|
2409
|
-
n
|
|
2410
|
-
);
|
|
2411
|
-
return r;
|
|
2412
|
-
}
|
|
2413
|
-
/**
|
|
2414
|
-
* 获取用户社区通知
|
|
2415
|
-
*
|
|
2416
|
-
* 了解更多[通知的分类](https://kdocs.cn/l/cbggfJodHLIz?linkname=AiCR5khgOr)。
|
|
2417
|
-
*
|
|
2418
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=W5lceDgbBG
|
|
2419
|
-
*/
|
|
2420
|
-
async getNotifications(t, n) {
|
|
2421
|
-
await this.token.autoLogin();
|
|
2422
|
-
const { data: r } = await this.req.get(
|
|
2423
|
-
"community/notifications",
|
|
2424
|
-
{ max_results: 20, ...t },
|
|
2425
|
-
uo,
|
|
2426
|
-
n
|
|
2427
|
-
);
|
|
2428
|
-
return {
|
|
2429
|
-
notifications: r?.notifications || [],
|
|
2430
|
-
next_token: r?.next_token || ""
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
/**
|
|
2434
|
-
* 获取用户未读通知数量
|
|
2435
|
-
*
|
|
2436
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=CwIOMjAfMU
|
|
2437
|
-
*/
|
|
2438
|
-
async getUnreadNotificationsCount(t) {
|
|
2439
|
-
if (!await this.token.autoLogin()) return null;
|
|
2440
|
-
const { data: n } = await this.req.get(
|
|
2441
|
-
"community/unread-notifications-count",
|
|
2442
|
-
null,
|
|
2443
|
-
lo,
|
|
2444
|
-
t
|
|
2445
|
-
);
|
|
2446
|
-
return n;
|
|
2447
|
-
}
|
|
2448
|
-
/**
|
|
2449
|
-
* 社区用户将通知标为已读
|
|
2450
|
-
*
|
|
2451
|
-
* https://kdocs.cn/l/cbggfJodHLIz?linkname=TCJQxnOjJe
|
|
2452
|
-
*/
|
|
2453
|
-
async clearUnreadNotifications(t, n) {
|
|
2454
|
-
if (!await this.token.autoLogin()) return !1;
|
|
2455
|
-
const { ok: r } = await this.req.post("community/clear-unread-notifications", { category: t }, null, n);
|
|
2456
|
-
return r;
|
|
2457
|
-
}
|
|
2458
|
-
}
|
|
2459
|
-
const mo = s({
|
|
2460
|
-
nonce_str: e.string(),
|
|
2461
|
-
timestamp: e.number(),
|
|
2462
|
-
signature: e.string()
|
|
2463
|
-
});
|
|
2464
|
-
var go = /* @__PURE__ */ ((o) => (o.RedirectUriDisMatch = "10003", o.AppidError = "10016", o.AuthorizationError = "10015", o.NoRightForScope = "10005", o.Frequently = "10009", o.AppBanded = "10004", o.ShouldFollow = "10006", o.ScopeNull = "10010", o.RedirectUriNull = "10011", o.AppidNull = "10012", o.StateNull = "10013", o))(go || {});
|
|
2465
|
-
function q(o) {
|
|
2466
|
-
return y(o, "open_id", "union_id", "weixin_token");
|
|
2467
|
-
}
|
|
2468
|
-
const K = "wx_login_cache";
|
|
2469
|
-
class ia {
|
|
2470
|
-
token;
|
|
2471
|
-
_appid;
|
|
2472
|
-
req;
|
|
2473
|
-
/**
|
|
2474
|
-
* 创建微信相关功能接口
|
|
2475
|
-
*
|
|
2476
|
-
* - authToken 需要导入 AuthToken 进行初始化后传入
|
|
2477
|
-
* - appid 可以静态设置,也可以在小程序中动态获取,见下示例代码
|
|
2478
|
-
*
|
|
2479
|
-
* ```js
|
|
2480
|
-
* const info = wx.getAccountInfoSync();
|
|
2481
|
-
* console.log(info.miniProgram.appId)
|
|
2482
|
-
* ```
|
|
2483
|
-
*
|
|
2484
|
-
* https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
|
|
2485
|
-
*/
|
|
2486
|
-
constructor(t, n) {
|
|
2487
|
-
this.token = t, this.req = t.req, this._appid = n, this.getLoginCache();
|
|
2488
|
-
}
|
|
2489
|
-
get appid() {
|
|
2490
|
-
return this._appid;
|
|
2491
|
-
}
|
|
2492
|
-
/**
|
|
2493
|
-
* 检查缓存中的登录数据
|
|
2494
|
-
*
|
|
2495
|
-
* 如果没有缓存或缓存数据错误,则需要调用 [wx.login](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) 后调用 login 方法
|
|
2496
|
-
*
|
|
2497
|
-
* 也可以直接调用 login 方法,并传入 weixin code 的读取函数
|
|
2498
|
-
*/
|
|
2499
|
-
async getLoginCache() {
|
|
2500
|
-
const t = this.token.storage.get(K);
|
|
2501
|
-
if (!t)
|
|
2502
|
-
return null;
|
|
2503
|
-
const n = fe(t);
|
|
2504
|
-
return q(n) ? (this.token.weixinToken = n.weixin_token, await this.token.autoLogin(), n) : null;
|
|
2505
|
-
}
|
|
2506
|
-
/**
|
|
2507
|
-
* 小程序页面微信静默登录,获取 weixinToken / open_id / union_id。
|
|
2508
|
-
*
|
|
2509
|
-
* 使用场景:
|
|
2510
|
-
*
|
|
2511
|
-
* - 小程序的任意页面打开后应该优先调用此方法以获取登录状态
|
|
2512
|
-
*
|
|
2513
|
-
* 注意:
|
|
2514
|
-
*
|
|
2515
|
-
* - 登录成功后会将登录信息缓存到本地,重复或并发调用不会引起任何副作用。
|
|
2516
|
-
* - 由于小程序的存储是以用户维度隔离的,每个微信用户在每个小程序下只要成功调用一次此 API 就会缓存请求结果。
|
|
2517
|
-
* - 微信公众号网页授权请使用 webLogin 方法
|
|
2518
|
-
*
|
|
2519
|
-
* 🔕请求静默进行,无消息提示
|
|
2520
|
-
*
|
|
2521
|
-
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=GwIZ0givCb
|
|
2522
|
-
*/
|
|
2523
|
-
async login(t) {
|
|
2524
|
-
if (!h())
|
|
2525
|
-
throw new Error("当前环境非微信小程序");
|
|
2526
|
-
const n = await this.getLoginCache();
|
|
2527
|
-
if (n)
|
|
2528
|
-
return n;
|
|
2529
|
-
const r = await ve(), { data: a, code: i, message: d } = await this.req.post(
|
|
2530
|
-
"weixin/login",
|
|
2531
|
-
{ code: r, appid: this.appid },
|
|
2532
|
-
q,
|
|
2533
|
-
{ ...t, message: !1 }
|
|
2534
|
-
);
|
|
2535
|
-
return a && (this.token.weixinToken = a.weixin_token, this.token.storage.set(K, JSON.stringify(a))), a ?? {
|
|
2536
|
-
message: d,
|
|
2537
|
-
error: i
|
|
2538
|
-
};
|
|
2539
|
-
}
|
|
2540
|
-
/**
|
|
2541
|
-
* 在微信内嵌网页中调用微信公众号授权登录【暂未启用】
|
|
2542
|
-
*
|
|
2543
|
-
* 注意:
|
|
2544
|
-
*
|
|
2545
|
-
* - 登录回调地址强制是当前页面,包括 location search 和 location hash 部分
|
|
2546
|
-
* - 登录跳转返回 code 后,会将 code 从 url 中删除以防止 code 泄露,如需设置分享则需要在此方法执行完毕之后
|
|
2547
|
-
*
|
|
2548
|
-
* 官方参考资料:
|
|
2549
|
-
*
|
|
2550
|
-
* - [微信网页开发 / 网页授权](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html)
|
|
2551
|
-
*
|
|
2552
|
-
* @param scope - 网页授权作用域
|
|
2553
|
-
* - snsapi_base 不弹出授权页面,用户无感知,只能获取用户 openid,如果需要获取 union_id 则需要 snsapi_userinfo
|
|
2554
|
-
* - snsapi_userinfo 【默认】弹出授权页面,可拿到 openid、union_id、昵称、头像等信息,但用户也可能会拒绝授权
|
|
2555
|
-
*/
|
|
2556
|
-
async webLogin(t = "snsapi_userinfo", n) {
|
|
2557
|
-
const r = x("code"), a = Date.now(), i = +x("state");
|
|
2558
|
-
if (!r || !i || i < a - 1e3 * 60 * 5 || i > a) {
|
|
2559
|
-
const le = O(["code", "state"]);
|
|
2560
|
-
location.replace(
|
|
2561
|
-
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(le)}&response_type=code&scope=${t}&state=${a}#wechat_redirect`
|
|
2562
|
-
);
|
|
2563
|
-
return;
|
|
2564
|
-
}
|
|
2565
|
-
if (/^100\d{2}$/.test(r))
|
|
2566
|
-
return {
|
|
2567
|
-
message: "Error: " + r,
|
|
2568
|
-
error: r
|
|
2569
|
-
};
|
|
2570
|
-
const d = O(["code", "state"]);
|
|
2571
|
-
"replaceState" in history && history.replaceState({}, "", d);
|
|
2572
|
-
const {
|
|
2573
|
-
data: b,
|
|
2574
|
-
code: ce,
|
|
2575
|
-
message: ue
|
|
2576
|
-
} = await this.req.post("weixin/login", { code: r, appid: this.appid }, q, n);
|
|
2577
|
-
return b && (this.token.weixinToken = b.weixin_token, await this.token.autoLogin()), b ?? {
|
|
2578
|
-
message: ue,
|
|
2579
|
-
error: ce
|
|
2580
|
-
};
|
|
2581
|
-
}
|
|
2582
|
-
/**
|
|
2583
|
-
* 关联游戏账号,无返回值,全程静默
|
|
2584
|
-
*
|
|
2585
|
-
* 用于从游戏内跳转至小程序时,将微信用户身份和游戏内身份关联起来,使得后续的企业微信客服流程能够知道该微信用户在游戏内的身份。
|
|
2586
|
-
*
|
|
2587
|
-
* 🔕请求静默进行,无消息提示
|
|
2588
|
-
*
|
|
2589
|
-
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=ci73N833Mk
|
|
2590
|
-
*
|
|
2591
|
-
* @param weixinToken 调用 login 后,得到的 weixinToken,如果 weixinToken 为空则跳过不处理
|
|
2592
|
-
* @param gameCode 从游戏内跳转至小程序时,通过请求参数 query 携带的 game_code,如果值为空则跳过不处理
|
|
2593
|
-
*/
|
|
2594
|
-
async linkPlayer(t, n, r) {
|
|
2595
|
-
if (!t || !n)
|
|
2596
|
-
return !1;
|
|
2597
|
-
const { ok: a } = await this.req.post("weixin/link-player", { weixin_token: t, game_code: n }, null, {
|
|
2598
|
-
...r,
|
|
2599
|
-
message: !1
|
|
2600
|
-
});
|
|
2601
|
-
return a;
|
|
2602
|
-
}
|
|
2603
|
-
/**
|
|
2604
|
-
* 获取集成 JSSDK 所需的签名信息
|
|
2605
|
-
*
|
|
2606
|
-
* https://kdocs.cn/l/cf2mO2uRLqh9?linkname=CuWOqxr9Ue
|
|
2607
|
-
*/
|
|
2608
|
-
async getJSSDKConfig(t) {
|
|
2609
|
-
const { data: n } = await this.req.get(
|
|
2610
|
-
"weixin/offiaccount/jssdk-sign",
|
|
2611
|
-
{
|
|
2612
|
-
appid: this.appid,
|
|
2613
|
-
url: location.href.split("#")[0]
|
|
2614
|
-
},
|
|
2615
|
-
mo,
|
|
2616
|
-
t
|
|
2617
|
-
);
|
|
2618
|
-
return n ? {
|
|
2619
|
-
appid: this.appid,
|
|
2620
|
-
nonceStr: n.nonce_str,
|
|
2621
|
-
timestamp: n.timestamp,
|
|
2622
|
-
signature: n.signature
|
|
2623
|
-
} : null;
|
|
2624
|
-
}
|
|
2625
|
-
}
|
|
2626
|
-
export {
|
|
2627
|
-
se as AntispamValidator,
|
|
2628
|
-
yo as AuthToken,
|
|
2629
|
-
Kn as CandidateVoteValidator,
|
|
2630
|
-
ne as CashbackEngagementDataValidator,
|
|
2631
|
-
wn as ClaimActivationKeyEngagementDataValidator,
|
|
2632
|
-
ct as ClaimRewardStatus,
|
|
2633
|
-
U as ClaimRewardStatusValidator,
|
|
2634
|
-
nr as ClaimedItemValidator,
|
|
2635
|
-
J as ClubAddressValidator,
|
|
2636
|
-
ho as ClubApi,
|
|
2637
|
-
Z as ClubBenefitSummaryValidator,
|
|
2638
|
-
Oe as ClubBenefitValidator,
|
|
2639
|
-
Te as ClubCreditChangeScene,
|
|
2640
|
-
qe as ClubCreditChangeSceneValidator,
|
|
2641
|
-
Ve as ClubCreditChangeType,
|
|
2642
|
-
je as ClubCreditChangeTypeValidator,
|
|
2643
|
-
Ae as ClubCreditLogValidator,
|
|
2644
|
-
Se as ClubGlobalConfigValidator,
|
|
2645
|
-
xe as ClubItemType,
|
|
2646
|
-
H as ClubItemTypeValidator,
|
|
2647
|
-
Pe as ClubPlayerValidator,
|
|
2648
|
-
X as ClubProductValidator,
|
|
2649
|
-
Le as ClubRedemptionStatus,
|
|
2650
|
-
Ue as ClubRedemptionStatusValidator,
|
|
2651
|
-
$e as ClubUserCreditValidator,
|
|
2652
|
-
De as ClubUserProfileValidator,
|
|
2653
|
-
Jn as CommentEngagementValidator,
|
|
2654
|
-
k as CommentValidator,
|
|
2655
|
-
aa as CommunityApi,
|
|
2656
|
-
Hn as ConversationValidator,
|
|
2657
|
-
et as EngageAccountType,
|
|
2658
|
-
tt as EngageAccountTypeValidator,
|
|
2659
|
-
tr as EngageResponseValidator,
|
|
2660
|
-
Xn as EngageRewardValidator,
|
|
2661
|
-
wo as EventApi,
|
|
2662
|
-
ur as EventConfigValidator,
|
|
2663
|
-
Vt as EventFeatureConfigOfCashbackValidator,
|
|
2664
|
-
Tt as EventFeatureConfigOfCheckInValidator,
|
|
2665
|
-
xt as EventFeatureConfigOfClaimActivationKeyValidator,
|
|
2666
|
-
Ut as EventFeatureConfigOfClaimRewardsValidator,
|
|
2667
|
-
Pt as EventFeatureConfigOfCommentValidator,
|
|
2668
|
-
Ft as EventFeatureConfigOfFollowValidator,
|
|
2669
|
-
$t as EventFeatureConfigOfGiftCodeValidator,
|
|
2670
|
-
Ot as EventFeatureConfigOfInviteValidator,
|
|
2671
|
-
Nt as EventFeatureConfigOfInvitedRegisterValidator,
|
|
2672
|
-
zt as EventFeatureConfigOfLotteryDrawValidator,
|
|
2673
|
-
Kt as EventFeatureConfigOfLotteryValidator,
|
|
2674
|
-
Zt as EventFeatureConfigOfPreregisterValidator,
|
|
2675
|
-
Yt as EventFeatureConfigOfQuestValidator,
|
|
2676
|
-
tn as EventFeatureConfigOfRedeemValidator,
|
|
2677
|
-
rn as EventFeatureConfigOfRegisterValidator,
|
|
2678
|
-
an as EventFeatureConfigOfShareValidator,
|
|
2679
|
-
cn as EventFeatureConfigOfSubscribeValidator,
|
|
2680
|
-
ln as EventFeatureConfigOfSurveyValidator,
|
|
2681
|
-
dn as EventFeatureConfigOfTeamValidator,
|
|
2682
|
-
bn as EventFeatureConfigOfUgcLikeValidator,
|
|
2683
|
-
_n as EventFeatureConfigOfUgcValidator,
|
|
2684
|
-
ar as EventFeatureConfigOfVote2Validator,
|
|
2685
|
-
hn as EventFeatureConfigOfVoteValidator,
|
|
2686
|
-
cr as EventFeatureConfigValidator,
|
|
2687
|
-
nt as EventPeriodType,
|
|
2688
|
-
rt as EventPeriodTypeValidator,
|
|
2689
|
-
g as EventRewardItemConfigValidator,
|
|
2690
|
-
Ne as ExtraGameRewardValidator,
|
|
2691
|
-
Ge as ExtraPhysicalShipmentValidator,
|
|
2692
|
-
en as FeatureRedeemItemConfigValidator,
|
|
2693
|
-
Rt as FeatureRewardValidator,
|
|
2694
|
-
c as FeatureType,
|
|
2695
|
-
ot as FeatureTypeValidator,
|
|
2696
|
-
Fr as ForumMode,
|
|
2697
|
-
Ir as ForumModeValidator,
|
|
2698
|
-
ie as ForumValidator,
|
|
2699
|
-
v as GamerItemType,
|
|
2700
|
-
Y as GamerItemTypeValidator,
|
|
2701
|
-
Re as Gender,
|
|
2702
|
-
Ce as GenderValidator,
|
|
2703
|
-
kn as GiftCodeEngagementDataValidator,
|
|
2704
|
-
vn as InviteEngagementDataValidator,
|
|
2705
|
-
gt as LotteryDrawAction,
|
|
2706
|
-
Co as LotteryDrawActionValidator,
|
|
2707
|
-
jn as LotteryDrawEngagementDataValidator,
|
|
2708
|
-
Rn as LotteryEngagementDataValidator,
|
|
2709
|
-
w as LotteryTicketStatus,
|
|
2710
|
-
vo as LotteryTicketStatusValidator,
|
|
2711
|
-
_ as NotificationBaseValidator,
|
|
2712
|
-
$r as NotificationCategory,
|
|
2713
|
-
oa as NotificationCategoryValidator,
|
|
2714
|
-
Kr as NotificationCommentReplyValidator,
|
|
2715
|
-
Hr as NotificationCommentValidator,
|
|
2716
|
-
V as NotificationPayloadCommentValidator,
|
|
2717
|
-
$ as NotificationPayloadPostValidator,
|
|
2718
|
-
A as NotificationPayloadReplyValidator,
|
|
2719
|
-
Nr as NotificationPayloadSystemValidator,
|
|
2720
|
-
Mr as NotificationPostCommentValidator,
|
|
2721
|
-
Br as NotificationPostValidator,
|
|
2722
|
-
zr as NotificationReplyRepliedValidator,
|
|
2723
|
-
Jr as NotificationReplyValidator,
|
|
2724
|
-
Qr as NotificationSystemValidator,
|
|
2725
|
-
m as NotificationType,
|
|
2726
|
-
Ar as NotificationTypeValidator,
|
|
2727
|
-
Zr as NotificationValidator,
|
|
2728
|
-
Ie as PlayerRoleCardValidator,
|
|
2729
|
-
z as PlayerRoleValidator,
|
|
2730
|
-
Dr as PostStatus,
|
|
2731
|
-
ae as PostStatusValidator,
|
|
2732
|
-
D as PostValidator,
|
|
2733
|
-
Tn as PreregisterEngagementDataValidator,
|
|
2734
|
-
Gr as PresignedUrlResponseValidator,
|
|
2735
|
-
qn as QuestEngagementDataValidator,
|
|
2736
|
-
at as QuestObjective,
|
|
2737
|
-
ee as QuestObjectiveValidator,
|
|
2738
|
-
_t as QuestProgressAlgorithm,
|
|
2739
|
-
pt as QuestProgressAlgorithmValidator,
|
|
2740
|
-
xn as QuestProgressValidator,
|
|
2741
|
-
Ln as RedeemEngagementDataValidator,
|
|
2742
|
-
fo as RedeemParamsValidator,
|
|
2743
|
-
Un as RedeemStocksResponseValidator,
|
|
2744
|
-
Qe as RedemptionValidator,
|
|
2745
|
-
vt as RegularRewardValidator,
|
|
2746
|
-
Or as ReplyToValidator,
|
|
2747
|
-
C as ReplyValidator,
|
|
2748
|
-
ko as RewardItemType,
|
|
2749
|
-
W as RewardItemTypeValidator,
|
|
2750
|
-
ut as RewardSource,
|
|
2751
|
-
S as RewardSourceValidator,
|
|
2752
|
-
p as RewardStatus,
|
|
2753
|
-
te as RewardStatusValidator,
|
|
2754
|
-
Zn as RewardValidator,
|
|
2755
|
-
Fe as RoleBaseInfoValidator,
|
|
2756
|
-
Ee as ServerBaseInfoValidator,
|
|
2757
|
-
Sn as ShareEngagementDataValidator,
|
|
2758
|
-
En as SurveyEngagementDataValidator,
|
|
2759
|
-
dt as TeamAction,
|
|
2760
|
-
Ro as TeamActionValidator,
|
|
2761
|
-
In as TeamEngagementDataValidator,
|
|
2762
|
-
Fn as TeamEngagementValidator,
|
|
2763
|
-
Vo as TeamMemberValidator,
|
|
2764
|
-
lt as TeamVisibility,
|
|
2765
|
-
mt as TeamVisibilityValidator,
|
|
2766
|
-
I as TopicValidator,
|
|
2767
|
-
On as UgcCountResponseValidator,
|
|
2768
|
-
Dn as UgcEngagementDataValidator,
|
|
2769
|
-
Nn as UgcLeaderboardResponseValidator,
|
|
2770
|
-
$n as UgcRecordBaseResponseValidator,
|
|
2771
|
-
An as UgcRecordResponseValidator,
|
|
2772
|
-
ht as UgcReviewStatus,
|
|
2773
|
-
wt as UgcReviewStatusValidator,
|
|
2774
|
-
ft as UgcSocialMedia,
|
|
2775
|
-
P as UgcSocialMediaValidator,
|
|
2776
|
-
Gn as UgcUploadImageValidator,
|
|
2777
|
-
E as UserEngagementDataValidator,
|
|
2778
|
-
Yn as UserEngagementValidator,
|
|
2779
|
-
er as UserFeatureStatusValidator,
|
|
2780
|
-
R as UserRewardValidator,
|
|
2781
|
-
Wn as VerifyMobileResultValidator,
|
|
2782
|
-
Mn as Vote2ClaimRewardsResponseValidator,
|
|
2783
|
-
Bn as Vote2EngagementDataValidator,
|
|
2784
|
-
bt as Vote2RewardType,
|
|
2785
|
-
yt as Vote2RewardTypeValidator,
|
|
2786
|
-
Qn as VoteEngagementDataValidator,
|
|
2787
|
-
it as VoteOptionSource,
|
|
2788
|
-
st as VoteOptionSourceValidator,
|
|
2789
|
-
ia as WeixinApi,
|
|
2790
|
-
Pn as WeixinSubscribeEngagementDataValidator,
|
|
2791
|
-
go as WeixinWebLoginErrorCode,
|
|
2792
|
-
zn as ZeroChatGPTDataValidator,
|
|
2793
|
-
Io as claimRewards,
|
|
2794
|
-
Ho as claimRewardsV2,
|
|
2795
|
-
zo as claimWeixinHongbao,
|
|
2796
|
-
Fo as engage,
|
|
2797
|
-
Oo as generateUnlimitQrcode,
|
|
2798
|
-
Bo as getCashbackQuery,
|
|
2799
|
-
To as getConfig,
|
|
2800
|
-
Lo as getEngagements,
|
|
2801
|
-
xo as getEngagementsCount,
|
|
2802
|
-
qo as getEngagementsUserCount,
|
|
2803
|
-
Ao as getParamsByQrcodeScene,
|
|
2804
|
-
Go as getQuestProgress,
|
|
2805
|
-
ra as getRedeemItemStocks,
|
|
2806
|
-
na as getUgcLeaderboard,
|
|
2807
|
-
Ko as getUgcMyCount,
|
|
2808
|
-
ea as getUgcRecommendation,
|
|
2809
|
-
Mo as getUgcRecord,
|
|
2810
|
-
ta as getUgcs,
|
|
2811
|
-
$o as getUnlimitQrcodeScene,
|
|
2812
|
-
Po as getUserEngagementCount,
|
|
2813
|
-
Eo as getUserEngagements,
|
|
2814
|
-
So as getUserFeatureStatus,
|
|
2815
|
-
Yo as getUserItemCount,
|
|
2816
|
-
Zo as getUserRewards,
|
|
2817
|
-
Xo as getUserRewardsCount,
|
|
2818
|
-
Qo as getVote2Leaderboard,
|
|
2819
|
-
mo as isWeixinSignResponse,
|
|
2820
|
-
Do as submitUserRewardAddress,
|
|
2821
|
-
Wo as ugcUploadImage,
|
|
2822
|
-
Jo as verifyActivationKey,
|
|
2823
|
-
jo as verifyMobileAllowed,
|
|
2824
|
-
Uo as visit,
|
|
2825
|
-
No as vote2Rewards
|
|
1713
|
+
//#endregion
|
|
1714
|
+
//#region src/weixin.ts
|
|
1715
|
+
var Wi = "wx_login_cache", Gi = class {
|
|
1716
|
+
token;
|
|
1717
|
+
_appid;
|
|
1718
|
+
req;
|
|
1719
|
+
constructor(e, t) {
|
|
1720
|
+
this.token = e, this.req = e.req, this._appid = t, this.getLoginCache();
|
|
1721
|
+
}
|
|
1722
|
+
get appid() {
|
|
1723
|
+
return this._appid;
|
|
1724
|
+
}
|
|
1725
|
+
async getLoginCache() {
|
|
1726
|
+
let e = this.token.storage.get(Wi);
|
|
1727
|
+
if (!e) return null;
|
|
1728
|
+
let t = i(e);
|
|
1729
|
+
return $(t) ? (this.token.weixinToken = t.weixin_token, await this.token.autoLogin(), t) : null;
|
|
1730
|
+
}
|
|
1731
|
+
async login(e) {
|
|
1732
|
+
if (!c()) throw Error("当前环境非微信小程序");
|
|
1733
|
+
let t = await this.getLoginCache();
|
|
1734
|
+
if (t) return t;
|
|
1735
|
+
let n = await le(), { data: r, code: i, message: a } = await this.req.post("weixin/login", {
|
|
1736
|
+
code: n,
|
|
1737
|
+
appid: this.appid
|
|
1738
|
+
}, $, {
|
|
1739
|
+
...e,
|
|
1740
|
+
message: !1
|
|
1741
|
+
});
|
|
1742
|
+
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(Wi, JSON.stringify(r))), r ?? {
|
|
1743
|
+
message: a,
|
|
1744
|
+
error: i
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
async webLogin(e = "snsapi_userinfo", t) {
|
|
1748
|
+
let n = s("code"), r = Date.now(), i = +s("state");
|
|
1749
|
+
if (!n || !i || i < r - 1e3 * 60 * 5 || i > r) {
|
|
1750
|
+
let t = ee(["code", "state"]);
|
|
1751
|
+
location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${this.appid}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${r}#wechat_redirect`);
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
if (/^100\d{2}$/.test(n)) return {
|
|
1755
|
+
message: "Error: " + n,
|
|
1756
|
+
error: n
|
|
1757
|
+
};
|
|
1758
|
+
let a = ee(["code", "state"]);
|
|
1759
|
+
"replaceState" in history && history.replaceState({}, "", a);
|
|
1760
|
+
let { data: o, code: te, message: c } = await this.req.post("weixin/login", {
|
|
1761
|
+
code: n,
|
|
1762
|
+
appid: this.appid
|
|
1763
|
+
}, $, t);
|
|
1764
|
+
return o && (this.token.weixinToken = o.weixin_token, await this.token.autoLogin()), o ?? {
|
|
1765
|
+
message: c,
|
|
1766
|
+
error: te
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
async linkPlayer(e, t, n) {
|
|
1770
|
+
if (!e || !t) return !1;
|
|
1771
|
+
let { ok: r } = await this.req.post("weixin/link-player", {
|
|
1772
|
+
weixin_token: e,
|
|
1773
|
+
game_code: t
|
|
1774
|
+
}, null, {
|
|
1775
|
+
...n,
|
|
1776
|
+
message: !1
|
|
1777
|
+
});
|
|
1778
|
+
return r;
|
|
1779
|
+
}
|
|
1780
|
+
async getJSSDKConfig(e) {
|
|
1781
|
+
let { data: t } = await this.req.get("weixin/offiaccount/jssdk-sign", {
|
|
1782
|
+
appid: this.appid,
|
|
1783
|
+
url: location.href.split("#")[0]
|
|
1784
|
+
}, Hi, e);
|
|
1785
|
+
return t ? {
|
|
1786
|
+
appid: this.appid,
|
|
1787
|
+
nonceStr: t.nonce_str,
|
|
1788
|
+
timestamp: t.timestamp,
|
|
1789
|
+
signature: t.signature
|
|
1790
|
+
} : null;
|
|
1791
|
+
}
|
|
2826
1792
|
};
|
|
1793
|
+
//#endregion
|
|
1794
|
+
export { K as AntispamValidator, ue as AuthToken, Vn as CandidateVoteValidator, I as CashbackEngagementDataValidator, mn as ClaimActivationKeyEngagementDataValidator, $e as ClaimRewardStatus, k as ClaimRewardStatusValidator, Zn as ClaimedItemValidator, m as ClubAddressValidator, Ue as ClubApi, h as ClubBenefitSummaryValidator, Oe as ClubBenefitValidator, he as ClubCreditChangeScene, ge as ClubCreditChangeSceneValidator, pe as ClubCreditChangeType, me as ClubCreditChangeTypeValidator, De as ClubCreditLogValidator, be as ClubGlobalConfigValidator, _e as ClubItemType, f as ClubItemTypeValidator, xe as ClubPlayerValidator, g as ClubProductValidator, ve as ClubRedemptionStatus, ye as ClubRedemptionStatusValidator, Ee as ClubUserCreditValidator, Te as ClubUserProfileValidator, Wn as CommentEngagementValidator, J as CommentValidator, Vi as CommunityApi, Hn as ConversationValidator, w as EngageAccountType, Ke as EngageAccountTypeValidator, Xn as EngageResponseValidator, Kn as EngageRewardValidator, We as EventApi, ir as EventConfigValidator, yt as EventFeatureConfigOfCashbackValidator, xt as EventFeatureConfigOfCheckInValidator, Ct as EventFeatureConfigOfClaimActivationKeyValidator, Tt as EventFeatureConfigOfClaimRewardsValidator, Dt as EventFeatureConfigOfCommentValidator, kt as EventFeatureConfigOfFollowValidator, Mt as EventFeatureConfigOfGiftCodeValidator, Pt as EventFeatureConfigOfInviteValidator, It as EventFeatureConfigOfInvitedRegisterValidator, Ht as EventFeatureConfigOfLotteryDrawValidator, Bt as EventFeatureConfigOfLotteryValidator, Wt as EventFeatureConfigOfPreregisterValidator, Kt as EventFeatureConfigOfQuestValidator, Yt as EventFeatureConfigOfRedeemValidator, Zt as EventFeatureConfigOfRegisterValidator, $t as EventFeatureConfigOfShareValidator, tn as EventFeatureConfigOfSubscribeValidator, rn as EventFeatureConfigOfSurveyValidator, on as EventFeatureConfigOfTeamValidator, un as EventFeatureConfigOfUgcLikeValidator, cn as EventFeatureConfigOfUgcValidator, er as EventFeatureConfigOfVote2Validator, pn as EventFeatureConfigOfVoteValidator, rr as EventFeatureConfigValidator, qe as EventPeriodType, Je as EventPeriodTypeValidator, N as EventRewardItemConfigValidator, je as ExtraGameRewardValidator, Ae as ExtraPhysicalShipmentValidator, Jt as FeatureRedeemItemConfigValidator, _t as FeatureRewardValidator, T as FeatureType, Ye as FeatureTypeValidator, li as ForumMode, ui as ForumModeValidator, U as ForumValidator, x as GamerItemType, S as GamerItemTypeValidator, de as Gender, fe as GenderValidator, hn as GiftCodeEngagementDataValidator, gn as InviteEngagementDataValidator, ot as LotteryDrawAction, st as LotteryDrawActionValidator, bn as LotteryDrawEngagementDataValidator, _n as LotteryEngagementDataValidator, j as LotteryTicketStatus, rt as LotteryTicketStatusValidator, Y as NotificationBaseValidator, fi as NotificationCategory, pi as NotificationCategoryValidator, xi as NotificationCommentReplyValidator, Si as NotificationCommentValidator, Z as NotificationPayloadCommentValidator, X as NotificationPayloadPostValidator, Q as NotificationPayloadReplyValidator, _i as NotificationPayloadSystemValidator, bi as NotificationPostCommentValidator, yi as NotificationPostValidator, Ci as NotificationReplyRepliedValidator, wi as NotificationReplyValidator, vi as NotificationSystemValidator, H as NotificationType, mi as NotificationTypeValidator, Ti as NotificationValidator, we as PlayerRoleCardValidator, p as PlayerRoleValidator, di as PostStatus, V as PostStatusValidator, G as PostValidator, xn as PreregisterEngagementDataValidator, gi as PresignedUrlResponseValidator, Cn as QuestEngagementDataValidator, Xe as QuestObjective, E as QuestObjectiveValidator, ct as QuestProgressAlgorithm, lt as QuestProgressAlgorithmValidator, wn as QuestProgressValidator, Tn as RedeemEngagementDataValidator, ke as RedeemParamsValidator, En as RedeemStocksResponseValidator, Me as RedemptionValidator, gt as RegularRewardValidator, hi as ReplyToValidator, q as ReplyValidator, Ge as RewardItemType, C as RewardItemTypeValidator, et as RewardSource, A as RewardSourceValidator, D as RewardStatus, O as RewardStatusValidator, Gn as RewardValidator, Ce as RoleBaseInfoValidator, Se as ServerBaseInfoValidator, Dn as ShareEngagementDataValidator, kn as SurveyEngagementDataValidator, it as TeamAction, at as TeamActionValidator, Mn as TeamEngagementDataValidator, An as TeamEngagementValidator, jn as TeamMemberValidator, tt as TeamVisibility, nt as TeamVisibilityValidator, W as TopicValidator, In as UgcCountResponseValidator, Nn as UgcEngagementDataValidator, Rn as UgcLeaderboardResponseValidator, Pn as UgcRecordBaseResponseValidator, Fn as UgcRecordResponseValidator, pt as UgcReviewStatus, mt as UgcReviewStatusValidator, ft as UgcSocialMedia, M as UgcSocialMediaValidator, Ln as UgcUploadImageValidator, z as UserEngagementDataValidator, qn as UserEngagementValidator, Yn as UserFeatureStatusValidator, L as UserRewardValidator, Jn as VerifyMobileResultValidator, Bn as Vote2ClaimRewardsResponseValidator, zn as Vote2EngagementDataValidator, ut as Vote2RewardType, dt as Vote2RewardTypeValidator, R as VoteEngagementDataValidator, Ze as VoteOptionSource, Qe as VoteOptionSourceValidator, Gi as WeixinApi, On as WeixinSubscribeEngagementDataValidator, Ui as WeixinWebLoginErrorCode, Un as ZeroChatGPTDataValidator, Vr as claimRewards, Qr as claimRewardsV2, $r as claimWeixinHongbao, Br as engage, Gr as generateUnlimitQrcode, Yr as getCashbackQuery, Mr as getConfig, Fr as getEngagements, Pr as getEngagementsCount, Nr as getEngagementsUserCount, Wr as getParamsByQrcodeScene, Kr as getQuestProgress, ci as getRedeemItemStocks, si as getUgcLeaderboard, Zr as getUgcMyCount, ai as getUgcRecommendation, Xr as getUgcRecord, oi as getUgcs, Ur as getUnlimitQrcodeScene, Rr as getUserEngagementCount, zr as getUserEngagements, Lr as getUserFeatureStatus, ri as getUserItemCount, ti as getUserRewards, ni as getUserRewardsCount, Jr as getVote2Leaderboard, Hi as isWeixinSignResponse, Hr as submitUserRewardAddress, ii as ugcUploadImage, ei as verifyActivationKey, jr as verifyMobileAllowed, Ir as visit, qr as vote2Rewards };
|