@seayoo-web/gamer-api 4.2.2 → 4.3.2
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 +928 -875
- package/package.json +5 -5
- package/types/src/event.config/feature.d.ts +4 -2
- package/types/src/event.config/feature.referral.d.ts +22 -0
- package/types/src/event.engage/engage.d.ts +4 -2
- package/types/src/event.engage/engage.referral.d.ts +48 -0
- package/types/src/event.engage/index.d.ts +5 -4
- package/types/src/event.enums.d.ts +22 -0
- package/types/src/event.guards.d.ts +1 -0
- package/types/src/event.methods.d.ts +10 -1
- package/types/src/ggd.d.ts +10 -6
- package/types/src/ggd.enum.d.ts +0 -22
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
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
|
|
3
|
-
import { objectGuard as
|
|
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 c, supportWindow as l, supportWx as u, useConsole as ee, usePromise as te, weixinStorageHelper as ne } from "@seayoo-web/utils";
|
|
3
|
+
import { objectGuard as d, v as f } from "@seayoo-web/validator";
|
|
4
4
|
//#region src/token.guards.ts
|
|
5
|
-
function
|
|
5
|
+
function re(e) {
|
|
6
6
|
return t(e, "gamer_token") && typeof e.gamer_token == "string";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function ie(e) {
|
|
9
9
|
return t(e, "gamer_token", "game_id") && typeof e.gamer_token == "string" && typeof e.game_id == "string";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function ae(e) {
|
|
12
12
|
return t(e);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
function
|
|
14
|
+
ee("GamerApiSDK");
|
|
15
|
+
function oe(e) {
|
|
16
16
|
return /^\/[a-z\d-]+$/.test(e);
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
19
|
-
let { promise: e, resolve: t } =
|
|
18
|
+
async function se() {
|
|
19
|
+
let { promise: e, resolve: t } = te();
|
|
20
20
|
return wx.login({
|
|
21
21
|
success(e) {
|
|
22
22
|
t(e.code);
|
|
@@ -28,7 +28,7 @@ async function ce() {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/token.ts
|
|
31
|
-
var
|
|
31
|
+
var p = "gamer_token", ce = class {
|
|
32
32
|
_NetRequest;
|
|
33
33
|
_idToken = "";
|
|
34
34
|
_weixinToken = "";
|
|
@@ -36,8 +36,8 @@ var f = "gamer_token", le = class {
|
|
|
36
36
|
req;
|
|
37
37
|
storage;
|
|
38
38
|
constructor(t, r) {
|
|
39
|
-
this.storage =
|
|
40
|
-
let i =
|
|
39
|
+
this.storage = u() ? ne : n;
|
|
40
|
+
let i = oe(t) ? t : `https://${o(t)}`;
|
|
41
41
|
if (this._NetRequest = r, this.req = r({
|
|
42
42
|
baseURL: `${i}/v1`,
|
|
43
43
|
timeout: 1e4,
|
|
@@ -54,7 +54,7 @@ var f = "gamer_token", le = class {
|
|
|
54
54
|
requestTransformer: (e) => {
|
|
55
55
|
this._gamerToken && (e.headers.Authorization = `Bearer ${this._gamerToken}`);
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), l()) {
|
|
58
58
|
let t = /^(?:localhost|[\d.]+):\d{4}$/.test(location.host), n = s("gamer_token");
|
|
59
59
|
(e() || t && n) && (this._gamerToken = n);
|
|
60
60
|
}
|
|
@@ -64,7 +64,7 @@ var f = "gamer_token", le = class {
|
|
|
64
64
|
return this._NetRequest;
|
|
65
65
|
}
|
|
66
66
|
loadGamerTokenCache() {
|
|
67
|
-
let e = this.storage.get(
|
|
67
|
+
let e = this.storage.get(p).match(/^(\d{12,})#(.{8,})$/);
|
|
68
68
|
if (e) {
|
|
69
69
|
let t = parseInt(e[1]), n = e[2];
|
|
70
70
|
if (t > Date.now() - (24 * 3600 - 10) * 1e3) {
|
|
@@ -72,7 +72,7 @@ var f = "gamer_token", le = class {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
this.storage.remove(
|
|
75
|
+
this.storage.remove(p);
|
|
76
76
|
}
|
|
77
77
|
get isLoggedIn() {
|
|
78
78
|
return this._gamerToken !== "";
|
|
@@ -93,19 +93,19 @@ var f = "gamer_token", le = class {
|
|
|
93
93
|
return this._gamerToken;
|
|
94
94
|
}
|
|
95
95
|
set gamerToken(e) {
|
|
96
|
-
this._gamerToken = e, e ? this.storage.set(
|
|
96
|
+
this._gamerToken = e, e ? this.storage.set(p, `${Date.now()}#${e}`) : this.storage.remove(p);
|
|
97
97
|
}
|
|
98
98
|
logout() {
|
|
99
99
|
this._idToken = "", this._weixinToken = "", this.gamerToken = "";
|
|
100
100
|
}
|
|
101
101
|
async autoLogin() {
|
|
102
102
|
if (this.gamerToken) return !0;
|
|
103
|
-
let e =
|
|
103
|
+
let e = u();
|
|
104
104
|
if (!this.idToken || e && !this.weixinToken) return !1;
|
|
105
105
|
let { code: t, data: n } = await this.req.post("login-with-token", a({
|
|
106
106
|
id_token: this.idToken,
|
|
107
107
|
weixin_token: e ? this.weixinToken : null
|
|
108
|
-
}),
|
|
108
|
+
}), re, {
|
|
109
109
|
message: !1,
|
|
110
110
|
cacheTTL: 300,
|
|
111
111
|
cacheResolve: () => `${this.idToken}_${e ? this.weixinToken : "null"}`
|
|
@@ -121,9 +121,9 @@ var f = "gamer_token", le = class {
|
|
|
121
121
|
return this.gamerToken = n?.gamer_token || "", !!this.gamerToken;
|
|
122
122
|
}
|
|
123
123
|
async switchGame(e) {
|
|
124
|
-
let t =
|
|
124
|
+
let t = u();
|
|
125
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 }),
|
|
126
|
+
let { code: n, data: r } = await this.req.post("session/switch-game", a({ game_id: e }), ie, {
|
|
127
127
|
message: !1,
|
|
128
128
|
maxRetry: 2
|
|
129
129
|
});
|
|
@@ -134,193 +134,193 @@ var f = "gamer_token", le = class {
|
|
|
134
134
|
}
|
|
135
135
|
async getSession() {
|
|
136
136
|
if (!await this.autoLogin()) return null;
|
|
137
|
-
let { data: e } = await this.req.get("session", null,
|
|
137
|
+
let { data: e } = await this.req.get("session", null, ae, { message: !1 });
|
|
138
138
|
return e;
|
|
139
139
|
}
|
|
140
140
|
async authRealName(e) {
|
|
141
141
|
if (!await this.autoLogin()) return null;
|
|
142
|
-
let { data: t } = await this.req.post("auth-real-name", a(e),
|
|
142
|
+
let { data: t } = await this.req.post("auth-real-name", a(e), ae);
|
|
143
143
|
return t;
|
|
144
144
|
}
|
|
145
|
-
},
|
|
145
|
+
}, le = {
|
|
146
146
|
Unknown: "unknown",
|
|
147
147
|
Male: "male",
|
|
148
148
|
Female: "female"
|
|
149
|
-
},
|
|
149
|
+
}, ue = f.string().enum(le).lock(), de = {
|
|
150
150
|
Increase: "increase",
|
|
151
151
|
Decrease: "decrease",
|
|
152
152
|
Expired: "expired"
|
|
153
|
-
},
|
|
153
|
+
}, fe = f.string().enum(de).lock(), pe = {
|
|
154
154
|
Order: "order",
|
|
155
155
|
Consumption: "consumption",
|
|
156
156
|
Redeem: "redeem",
|
|
157
157
|
Expire: "expire",
|
|
158
158
|
Admin: "admin",
|
|
159
159
|
Event: "event"
|
|
160
|
-
},
|
|
160
|
+
}, me = f.string().enum(pe).lock(), he = {
|
|
161
161
|
GameReward: "game_reward",
|
|
162
162
|
Physical: "physical",
|
|
163
163
|
Virtual: "virtual"
|
|
164
|
-
},
|
|
164
|
+
}, m = f.string().enum(he).lock(), ge = {
|
|
165
165
|
Pending: "pending",
|
|
166
166
|
Issued: "issued",
|
|
167
167
|
Failed: "failed"
|
|
168
|
-
},
|
|
169
|
-
default_avatar_url:
|
|
170
|
-
official_avatar_urls:
|
|
171
|
-
default_nickname:
|
|
172
|
-
default_bio:
|
|
173
|
-
default_role_avatar_url:
|
|
174
|
-
level_configs:
|
|
175
|
-
level:
|
|
176
|
-
exp:
|
|
177
|
-
title:
|
|
168
|
+
}, _e = f.string().enum(ge).lock(), ve = f.object({
|
|
169
|
+
default_avatar_url: f.string(),
|
|
170
|
+
official_avatar_urls: f.array(f.string()),
|
|
171
|
+
default_nickname: f.string(),
|
|
172
|
+
default_bio: f.string(),
|
|
173
|
+
default_role_avatar_url: f.string(),
|
|
174
|
+
level_configs: f.array(f.object({
|
|
175
|
+
level: f.number(),
|
|
176
|
+
exp: f.number(),
|
|
177
|
+
title: f.string()
|
|
178
178
|
})),
|
|
179
|
-
level_valid_days:
|
|
180
|
-
benefit_description:
|
|
181
|
-
exp_description:
|
|
182
|
-
credit_description:
|
|
183
|
-
send_role_mail_rate_limit:
|
|
184
|
-
}).lock(),
|
|
185
|
-
member_id:
|
|
186
|
-
player_id:
|
|
187
|
-
exp:
|
|
188
|
-
level:
|
|
189
|
-
credit:
|
|
190
|
-
credit_expiring:
|
|
191
|
-
level_change_time:
|
|
192
|
-
level_expire_time:
|
|
193
|
-
}).lock(),
|
|
194
|
-
server_id:
|
|
195
|
-
server_name:
|
|
196
|
-
}).lock(),
|
|
197
|
-
role_id:
|
|
198
|
-
role_name:
|
|
199
|
-
}).lock(),
|
|
200
|
-
...
|
|
201
|
-
...
|
|
202
|
-
role_level:
|
|
203
|
-
last_login_time:
|
|
204
|
-
}).lock(),
|
|
205
|
-
...
|
|
206
|
-
role_fighting:
|
|
207
|
-
kin_id:
|
|
208
|
-
kin_name:
|
|
209
|
-
kin_position:
|
|
210
|
-
}).lock(),
|
|
211
|
-
name:
|
|
212
|
-
avatar_url:
|
|
213
|
-
bio:
|
|
214
|
-
gender:
|
|
215
|
-
birthday:
|
|
216
|
-
year:
|
|
217
|
-
month:
|
|
218
|
-
day:
|
|
179
|
+
level_valid_days: f.number(),
|
|
180
|
+
benefit_description: f.string(),
|
|
181
|
+
exp_description: f.string(),
|
|
182
|
+
credit_description: f.string(),
|
|
183
|
+
send_role_mail_rate_limit: f.number()
|
|
184
|
+
}).lock(), ye = f.object({
|
|
185
|
+
member_id: f.string(),
|
|
186
|
+
player_id: f.string(),
|
|
187
|
+
exp: f.number(),
|
|
188
|
+
level: f.number(),
|
|
189
|
+
credit: f.number(),
|
|
190
|
+
credit_expiring: f.number(),
|
|
191
|
+
level_change_time: f.number(),
|
|
192
|
+
level_expire_time: f.number()
|
|
193
|
+
}).lock(), h = f.object({
|
|
194
|
+
server_id: f.string(),
|
|
195
|
+
server_name: f.string()
|
|
196
|
+
}).lock(), be = f.object({
|
|
197
|
+
role_id: f.string(),
|
|
198
|
+
role_name: f.string()
|
|
199
|
+
}).lock(), g = f.object({
|
|
200
|
+
...be.shape,
|
|
201
|
+
...h.shape,
|
|
202
|
+
role_level: f.number(),
|
|
203
|
+
last_login_time: f.number()
|
|
204
|
+
}).lock(), xe = f.object({
|
|
205
|
+
...g.shape,
|
|
206
|
+
role_fighting: f.number(),
|
|
207
|
+
kin_id: f.string().optional(),
|
|
208
|
+
kin_name: f.string().optional(),
|
|
209
|
+
kin_position: f.string().optional()
|
|
210
|
+
}).lock(), Se = f.object({
|
|
211
|
+
name: f.string(),
|
|
212
|
+
avatar_url: f.string(),
|
|
213
|
+
bio: f.string(),
|
|
214
|
+
gender: ue,
|
|
215
|
+
birthday: f.object({
|
|
216
|
+
year: f.number(),
|
|
217
|
+
month: f.number(),
|
|
218
|
+
day: f.number()
|
|
219
219
|
}),
|
|
220
|
-
social_medias:
|
|
221
|
-
homepage_url:
|
|
222
|
-
homepage_image_url:
|
|
220
|
+
social_medias: f.record(f.object({
|
|
221
|
+
homepage_url: f.string(),
|
|
222
|
+
homepage_image_url: f.string()
|
|
223
223
|
}).optional()).optional()
|
|
224
|
-
}).lock(),
|
|
225
|
-
address_id:
|
|
226
|
-
recipient:
|
|
227
|
-
mobile:
|
|
228
|
-
province:
|
|
229
|
-
city:
|
|
230
|
-
district:
|
|
231
|
-
address:
|
|
232
|
-
is_default:
|
|
233
|
-
}).lock(),
|
|
234
|
-
increased_credit:
|
|
235
|
-
decreased_credit:
|
|
236
|
-
expired_credit:
|
|
237
|
-
balance_credit:
|
|
238
|
-
}).lock(),
|
|
239
|
-
id:
|
|
240
|
-
change_type:
|
|
241
|
-
change_scene:
|
|
242
|
-
change_credit:
|
|
243
|
-
balance:
|
|
244
|
-
change_time:
|
|
245
|
-
metadata:
|
|
246
|
-
}).lock(),
|
|
247
|
-
benefit_id:
|
|
248
|
-
name:
|
|
249
|
-
img_url:
|
|
250
|
-
description:
|
|
251
|
-
min_level:
|
|
252
|
-
max_level:
|
|
253
|
-
product_id:
|
|
254
|
-
tag:
|
|
255
|
-
}).lock(),
|
|
256
|
-
product_id:
|
|
257
|
-
catalog_id:
|
|
258
|
-
catalog_name:
|
|
259
|
-
item_type:
|
|
260
|
-
name:
|
|
261
|
-
img_url:
|
|
262
|
-
description:
|
|
263
|
-
tag:
|
|
264
|
-
price:
|
|
265
|
-
stock:
|
|
266
|
-
redeem_quantity:
|
|
267
|
-
not_visible_before:
|
|
268
|
-
not_visible_after:
|
|
269
|
-
not_before:
|
|
270
|
-
not_after:
|
|
271
|
-
min_level:
|
|
272
|
-
max_level:
|
|
273
|
-
limit_daily:
|
|
274
|
-
limit_monthly:
|
|
275
|
-
limit_yearly:
|
|
276
|
-
limit_total:
|
|
277
|
-
weight:
|
|
278
|
-
created_at:
|
|
279
|
-
updated_at:
|
|
280
|
-
redeemable_quantity:
|
|
281
|
-
}).lock(),
|
|
282
|
-
...r(
|
|
283
|
-
product:
|
|
284
|
-
}).lock(),
|
|
285
|
-
server_id:
|
|
286
|
-
role_id:
|
|
287
|
-
}),
|
|
288
|
-
recipient:
|
|
289
|
-
mobile:
|
|
290
|
-
province:
|
|
291
|
-
city:
|
|
292
|
-
district:
|
|
293
|
-
address:
|
|
294
|
-
express_company:
|
|
295
|
-
express_number:
|
|
296
|
-
}).lock(),
|
|
297
|
-
server_id:
|
|
298
|
-
role_id:
|
|
299
|
-
role_name:
|
|
300
|
-
}).lock(),
|
|
301
|
-
redemption_id:
|
|
302
|
-
player_id:
|
|
303
|
-
product_id:
|
|
304
|
-
name:
|
|
305
|
-
img_url:
|
|
306
|
-
item_type:
|
|
307
|
-
catalog_id:
|
|
308
|
-
catalog_name:
|
|
309
|
-
quantity:
|
|
310
|
-
amount:
|
|
311
|
-
status:
|
|
312
|
-
created_at:
|
|
313
|
-
extra_data:
|
|
314
|
-
}),
|
|
315
|
-
credit_logs:
|
|
316
|
-
next_token:
|
|
317
|
-
}), Le =
|
|
318
|
-
redemptions:
|
|
319
|
-
next_token:
|
|
320
|
-
}), Ve =
|
|
321
|
-
existed:
|
|
322
|
-
image_upload_url:
|
|
323
|
-
image_id:
|
|
224
|
+
}).lock(), _ = f.object({
|
|
225
|
+
address_id: f.number(),
|
|
226
|
+
recipient: f.string(),
|
|
227
|
+
mobile: f.string(),
|
|
228
|
+
province: f.string(),
|
|
229
|
+
city: f.string(),
|
|
230
|
+
district: f.string(),
|
|
231
|
+
address: f.string(),
|
|
232
|
+
is_default: f.bool()
|
|
233
|
+
}).lock(), Ce = f.object({
|
|
234
|
+
increased_credit: f.number(),
|
|
235
|
+
decreased_credit: f.number(),
|
|
236
|
+
expired_credit: f.number(),
|
|
237
|
+
balance_credit: f.number()
|
|
238
|
+
}).lock(), we = f.object({
|
|
239
|
+
id: f.number(),
|
|
240
|
+
change_type: fe,
|
|
241
|
+
change_scene: me,
|
|
242
|
+
change_credit: f.number(),
|
|
243
|
+
balance: f.number(),
|
|
244
|
+
change_time: f.number(),
|
|
245
|
+
metadata: f.record(f.unknown()).optional()
|
|
246
|
+
}).lock(), v = f.object({
|
|
247
|
+
benefit_id: f.number(),
|
|
248
|
+
name: f.string(),
|
|
249
|
+
img_url: f.string(),
|
|
250
|
+
description: f.string(),
|
|
251
|
+
min_level: f.number(),
|
|
252
|
+
max_level: f.number(),
|
|
253
|
+
product_id: f.number(),
|
|
254
|
+
tag: f.string()
|
|
255
|
+
}).lock(), y = f.object({
|
|
256
|
+
product_id: f.number(),
|
|
257
|
+
catalog_id: f.number(),
|
|
258
|
+
catalog_name: f.string(),
|
|
259
|
+
item_type: m,
|
|
260
|
+
name: f.string(),
|
|
261
|
+
img_url: f.string(),
|
|
262
|
+
description: f.string(),
|
|
263
|
+
tag: f.string(),
|
|
264
|
+
price: f.number(),
|
|
265
|
+
stock: f.number(),
|
|
266
|
+
redeem_quantity: f.number(),
|
|
267
|
+
not_visible_before: f.number(),
|
|
268
|
+
not_visible_after: f.number(),
|
|
269
|
+
not_before: f.number(),
|
|
270
|
+
not_after: f.number(),
|
|
271
|
+
min_level: f.number(),
|
|
272
|
+
max_level: f.number(),
|
|
273
|
+
limit_daily: f.number(),
|
|
274
|
+
limit_monthly: f.number(),
|
|
275
|
+
limit_yearly: f.number(),
|
|
276
|
+
limit_total: f.number(),
|
|
277
|
+
weight: f.number(),
|
|
278
|
+
created_at: f.number(),
|
|
279
|
+
updated_at: f.number(),
|
|
280
|
+
redeemable_quantity: f.number().optional()
|
|
281
|
+
}).lock(), Te = f.object({
|
|
282
|
+
...r(v.shape, "tag"),
|
|
283
|
+
product: y.clone().optional()
|
|
284
|
+
}).lock(), Ee = f.union(f.object({
|
|
285
|
+
server_id: f.string(),
|
|
286
|
+
role_id: f.string()
|
|
287
|
+
}), f.object({ address_id: f.number() })).satisfies().lock(), De = f.object({
|
|
288
|
+
recipient: f.string(),
|
|
289
|
+
mobile: f.string(),
|
|
290
|
+
province: f.string(),
|
|
291
|
+
city: f.string(),
|
|
292
|
+
district: f.string(),
|
|
293
|
+
address: f.string(),
|
|
294
|
+
express_company: f.string(),
|
|
295
|
+
express_number: f.string()
|
|
296
|
+
}).lock(), Oe = f.object({
|
|
297
|
+
server_id: f.string(),
|
|
298
|
+
role_id: f.string(),
|
|
299
|
+
role_name: f.string()
|
|
300
|
+
}).lock(), ke = f.object({
|
|
301
|
+
redemption_id: f.number(),
|
|
302
|
+
player_id: f.string(),
|
|
303
|
+
product_id: f.number(),
|
|
304
|
+
name: f.string(),
|
|
305
|
+
img_url: f.string(),
|
|
306
|
+
item_type: m,
|
|
307
|
+
catalog_id: f.number(),
|
|
308
|
+
catalog_name: f.string(),
|
|
309
|
+
quantity: f.number(),
|
|
310
|
+
amount: f.number(),
|
|
311
|
+
status: _e,
|
|
312
|
+
created_at: f.number(),
|
|
313
|
+
extra_data: f.union(De.clone(), Oe.clone()).satisfies().optional()
|
|
314
|
+
}), Ae = f.guard(ve), je = d({ player: ye }), Me = d({ roles: f.array(g) }), b = d({ role_card: xe }), x = f.guard(Se), Ne = f.guard(_), Pe = d({ addresses: f.array(_) }), Fe = f.guard(Ce), Ie = d({
|
|
315
|
+
credit_logs: f.array(we),
|
|
316
|
+
next_token: f.string().optional()
|
|
317
|
+
}), Le = d({ products: f.array(y) }), Re = d({ benefits: f.array(v) }), ze = d({ benefit: Te }), Be = d({
|
|
318
|
+
redemptions: f.array(ke),
|
|
319
|
+
next_token: f.string().optional()
|
|
320
|
+
}), Ve = d({
|
|
321
|
+
existed: f.bool(),
|
|
322
|
+
image_upload_url: f.string().optional(),
|
|
323
|
+
image_id: f.string()
|
|
324
324
|
}), He = class {
|
|
325
325
|
token;
|
|
326
326
|
req;
|
|
@@ -329,12 +329,12 @@ var f = "gamer_token", le = class {
|
|
|
329
329
|
}
|
|
330
330
|
async getConfig(e) {
|
|
331
331
|
await this.token.autoLogin();
|
|
332
|
-
let { data: t } = await this.req.get("club/config", null,
|
|
332
|
+
let { data: t } = await this.req.get("club/config", null, Ae, e);
|
|
333
333
|
return t;
|
|
334
334
|
}
|
|
335
335
|
async getCurrentPlayer(e) {
|
|
336
336
|
await this.token.autoLogin();
|
|
337
|
-
let { data: t, code: n, message: r } = await this.req.get("club/current-player", null,
|
|
337
|
+
let { data: t, code: n, message: r } = await this.req.get("club/current-player", null, je, e);
|
|
338
338
|
return t?.player ?? {
|
|
339
339
|
message: r,
|
|
340
340
|
error: n
|
|
@@ -342,7 +342,7 @@ var f = "gamer_token", le = class {
|
|
|
342
342
|
}
|
|
343
343
|
async linkPlayer(e) {
|
|
344
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 },
|
|
345
|
+
let { data: t, code: n, message: r } = await this.req.post("club/link-player", { id_token: this.token.idToken }, je, e);
|
|
346
346
|
return t?.player ?? {
|
|
347
347
|
message: r,
|
|
348
348
|
error: n
|
|
@@ -353,27 +353,27 @@ var f = "gamer_token", le = class {
|
|
|
353
353
|
let { data: r } = await this.req.get("club/roles", {
|
|
354
354
|
player_id: e,
|
|
355
355
|
refresh: t
|
|
356
|
-
},
|
|
356
|
+
}, Me, n);
|
|
357
357
|
return r?.roles || [];
|
|
358
358
|
}
|
|
359
359
|
async getRoleCard(e, t) {
|
|
360
360
|
await this.token.autoLogin();
|
|
361
|
-
let { data: n } = await this.req.get("club/role-card", { member_id: e },
|
|
361
|
+
let { data: n } = await this.req.get("club/role-card", { member_id: e }, b, t);
|
|
362
362
|
return n?.role_card ?? null;
|
|
363
363
|
}
|
|
364
364
|
async setRoleCard(e, t) {
|
|
365
365
|
if (!await this.token.autoLogin()) return null;
|
|
366
|
-
let { data: n } = await this.req.post("club/role-card", e,
|
|
366
|
+
let { data: n } = await this.req.post("club/role-card", e, b, t);
|
|
367
367
|
return n?.role_card ?? null;
|
|
368
368
|
}
|
|
369
369
|
async refreshRoleCard(e) {
|
|
370
370
|
if (!await this.token.autoLogin()) return null;
|
|
371
|
-
let { data: t } = await this.req.post("club/refresh-role-card", {},
|
|
371
|
+
let { data: t } = await this.req.post("club/refresh-role-card", {}, b, e);
|
|
372
372
|
return t?.role_card ?? null;
|
|
373
373
|
}
|
|
374
374
|
async getUserProfile(e, t) {
|
|
375
375
|
await this.token.autoLogin();
|
|
376
|
-
let { data: n } = await this.req.get("club/user-profile", { member_id: e },
|
|
376
|
+
let { data: n } = await this.req.get("club/user-profile", { member_id: e }, x, t);
|
|
377
377
|
return n;
|
|
378
378
|
}
|
|
379
379
|
async updateUserProfile(e, t) {
|
|
@@ -382,7 +382,7 @@ var f = "gamer_token", le = class {
|
|
|
382
382
|
message: "请提供需要修改的信息"
|
|
383
383
|
};
|
|
384
384
|
await this.token.autoLogin();
|
|
385
|
-
let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e,
|
|
385
|
+
let { data: n, code: r, message: i } = await this.req.post("club/user-profile", e, x, t);
|
|
386
386
|
return n ?? {
|
|
387
387
|
message: i,
|
|
388
388
|
error: r
|
|
@@ -395,7 +395,7 @@ var f = "gamer_token", le = class {
|
|
|
395
395
|
}
|
|
396
396
|
async addAddress(e, t) {
|
|
397
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),
|
|
398
|
+
let { data: n, code: r, message: i } = await this.req.post("/club/add-address", a(e), Ne, t);
|
|
399
399
|
return n ?? {
|
|
400
400
|
message: i,
|
|
401
401
|
error: r
|
|
@@ -403,7 +403,7 @@ var f = "gamer_token", le = class {
|
|
|
403
403
|
}
|
|
404
404
|
async updateAddress(e, t) {
|
|
405
405
|
await this.token.autoLogin();
|
|
406
|
-
let { data: n, code: r, message: i } = await this.req.post("club/update-address", a(e),
|
|
406
|
+
let { data: n, code: r, message: i } = await this.req.post("club/update-address", a(e), Ne, t);
|
|
407
407
|
return n ?? {
|
|
408
408
|
message: i,
|
|
409
409
|
error: r
|
|
@@ -502,15 +502,15 @@ var f = "gamer_token", le = class {
|
|
|
502
502
|
ClubExp: "club_exp",
|
|
503
503
|
ExternalCode: "external_gift_code",
|
|
504
504
|
VoidItem: "void_item"
|
|
505
|
-
}, C =
|
|
505
|
+
}, C = f.string().enum(S).lock(), We = S, w = C, Ge = {
|
|
506
506
|
UserId: "user_id",
|
|
507
507
|
RoleId: "role_id"
|
|
508
|
-
}, Ke =
|
|
508
|
+
}, Ke = f.string().enum(Ge).lock(), qe = {
|
|
509
509
|
None: "none",
|
|
510
510
|
Daily: "daily",
|
|
511
511
|
Weekly: "weekly",
|
|
512
512
|
Monthly: "monthly"
|
|
513
|
-
}, Je =
|
|
513
|
+
}, Je = f.string().enum(qe).lock(), T = {
|
|
514
514
|
Preregister: "preregister",
|
|
515
515
|
Lottery: "lottery",
|
|
516
516
|
Survey: "survey",
|
|
@@ -534,8 +534,9 @@ var f = "gamer_token", le = class {
|
|
|
534
534
|
ZeroChatgpt: "zero_chatgpt",
|
|
535
535
|
Ugc: "ugc",
|
|
536
536
|
UgcLike: "ugc_like",
|
|
537
|
-
Redeem: "redeem"
|
|
538
|
-
|
|
537
|
+
Redeem: "redeem",
|
|
538
|
+
Referral: "referral"
|
|
539
|
+
}, Ye = f.string().enum(T).lock(), Xe = {
|
|
539
540
|
Active: "player_active_points",
|
|
540
541
|
Login: "player_login_days",
|
|
541
542
|
OrderAmount: "order_total_amount",
|
|
@@ -552,52 +553,56 @@ var f = "gamer_token", le = class {
|
|
|
552
553
|
TeamSize: "team_size",
|
|
553
554
|
UserGroup: "user_group",
|
|
554
555
|
engagementCount: "engagement_count"
|
|
555
|
-
}, E =
|
|
556
|
+
}, E = f.string().enum(Xe).lock(), Ze = {
|
|
556
557
|
System: "system",
|
|
557
558
|
UserSubmission: "user_submission",
|
|
558
559
|
Shortlisted: "shortlisted"
|
|
559
|
-
}, Qe =
|
|
560
|
+
}, Qe = f.string().enum(Ze).lock(), D = {
|
|
560
561
|
Ineligible: "ineligible",
|
|
561
562
|
Unclaimed: "unclaimed",
|
|
562
563
|
Received: "received",
|
|
563
564
|
Failed: "failed",
|
|
564
565
|
Delivered: "delivered"
|
|
565
|
-
}, O =
|
|
566
|
+
}, O = f.string().enum(D).lock(), $e = {
|
|
566
567
|
Ineligible: D.Ineligible,
|
|
567
568
|
Unclaimed: D.Unclaimed,
|
|
568
569
|
Received: D.Received,
|
|
569
570
|
Failed: D.Failed,
|
|
570
571
|
Delivered: D.Delivered
|
|
571
|
-
}, k =
|
|
572
|
+
}, k = f.string().enum($e).lock(), et = {
|
|
572
573
|
Output: "output",
|
|
573
574
|
Engage: "engage"
|
|
574
|
-
}, A =
|
|
575
|
+
}, A = f.string().enum(et).lock(), tt = {
|
|
575
576
|
Private: "private",
|
|
576
577
|
Public: "public"
|
|
577
|
-
}, nt =
|
|
578
|
+
}, nt = f.string().enum(tt).lock(), j = {
|
|
578
579
|
Unknown: "unknown",
|
|
579
580
|
Pending: "pending",
|
|
580
581
|
Drawn: "drawn",
|
|
581
582
|
Claimed: "claimed",
|
|
582
583
|
Fail: "fail"
|
|
583
|
-
}, rt =
|
|
584
|
+
}, rt = f.string().enum(j).lock(), it = {
|
|
584
585
|
Assemble: "assemble",
|
|
585
586
|
Join: "join",
|
|
586
587
|
Disband: "disband",
|
|
587
588
|
ChangeVisibility: "change_visibility",
|
|
588
589
|
Query: "query"
|
|
589
|
-
}, at =
|
|
590
|
+
}, at = f.string().enum(it).lock(), ot = {
|
|
591
|
+
Share: "share",
|
|
592
|
+
Join: "join",
|
|
593
|
+
Query: "query"
|
|
594
|
+
}, st = f.string().enum(ot).lock(), ct = {
|
|
590
595
|
Query: "query",
|
|
591
596
|
Draw: "draw",
|
|
592
597
|
Claim: "claim"
|
|
593
|
-
},
|
|
598
|
+
}, lt = f.string().enum(ct).lock(), ut = {
|
|
594
599
|
Sum: "sum",
|
|
595
600
|
TopN: "top_n"
|
|
596
|
-
},
|
|
601
|
+
}, dt = f.string().enum(ut).lock(), ft = {
|
|
597
602
|
None: "none",
|
|
598
603
|
Winner: "winner",
|
|
599
604
|
Consolation: "consolation"
|
|
600
|
-
},
|
|
605
|
+
}, pt = f.string().enum(ft).lock(), mt = {
|
|
601
606
|
Douyin: "douyin",
|
|
602
607
|
Xiaohongshu: "xiaohongshu",
|
|
603
608
|
Taptap: "taptap",
|
|
@@ -606,542 +611,568 @@ var f = "gamer_token", le = class {
|
|
|
606
611
|
Huya: "huya",
|
|
607
612
|
Douyu: "douyu",
|
|
608
613
|
Kuaishou: "kuaishou"
|
|
609
|
-
}, M =
|
|
614
|
+
}, M = f.string().enum(mt).lock(), ht = {
|
|
610
615
|
Submitted: "submitted",
|
|
611
616
|
Accepted: "accepted",
|
|
612
617
|
Rejected: "rejected"
|
|
613
|
-
},
|
|
614
|
-
reward_item_id:
|
|
615
|
-
reward_amount:
|
|
616
|
-
reward_item_name:
|
|
617
|
-
reward_item_icon_url:
|
|
618
|
-
reward_item_desc:
|
|
619
|
-
reward_item_type:
|
|
620
|
-
reward_item_rating:
|
|
621
|
-
}).lock(),
|
|
622
|
-
engage_count:
|
|
623
|
-
rewards:
|
|
624
|
-
}).lock(),
|
|
625
|
-
feature_reward_type:
|
|
626
|
-
reward_details:
|
|
627
|
-
}),
|
|
628
|
-
feature_reward_type:
|
|
629
|
-
reward_details:
|
|
630
|
-
})).satisfies().lock(), P =
|
|
631
|
-
feature_name:
|
|
632
|
-
feature_id:
|
|
633
|
-
description:
|
|
618
|
+
}, gt = f.string().enum(ht).lock(), _t = f.string().enum(S), N = f.object({
|
|
619
|
+
reward_item_id: f.number(),
|
|
620
|
+
reward_amount: f.number(),
|
|
621
|
+
reward_item_name: f.string(),
|
|
622
|
+
reward_item_icon_url: f.string(),
|
|
623
|
+
reward_item_desc: f.string().optional(),
|
|
624
|
+
reward_item_type: _t,
|
|
625
|
+
reward_item_rating: f.number()
|
|
626
|
+
}).lock(), vt = f.object({
|
|
627
|
+
engage_count: f.number(),
|
|
628
|
+
rewards: f.array(N)
|
|
629
|
+
}).lock(), yt = f.union(f.object({
|
|
630
|
+
feature_reward_type: f.string().enum("every"),
|
|
631
|
+
reward_details: f.array(N)
|
|
632
|
+
}), f.object({
|
|
633
|
+
feature_reward_type: f.string().enum("regular"),
|
|
634
|
+
reward_details: f.array(vt)
|
|
635
|
+
})).satisfies().lock(), P = f.object({
|
|
636
|
+
feature_name: f.string(),
|
|
637
|
+
feature_id: f.number(),
|
|
638
|
+
description: f.string(),
|
|
634
639
|
cycle: Je,
|
|
635
|
-
cycle_limit:
|
|
636
|
-
limit:
|
|
637
|
-
since:
|
|
638
|
-
until:
|
|
640
|
+
cycle_limit: f.number(),
|
|
641
|
+
limit: f.number(),
|
|
642
|
+
since: f.number(),
|
|
643
|
+
until: f.number(),
|
|
639
644
|
engage_account: Ke,
|
|
640
|
-
feature_rewards:
|
|
641
|
-
sort:
|
|
642
|
-
}),
|
|
645
|
+
feature_rewards: yt.clone().optional(),
|
|
646
|
+
sort: f.number().optional()
|
|
647
|
+
}), bt = T.Cashback, xt = f.object({
|
|
643
648
|
...P.shape,
|
|
644
|
-
feature_type:
|
|
645
|
-
config:
|
|
646
|
-
order_start_time:
|
|
647
|
-
order_end_time:
|
|
648
|
-
claim_rewards_start_time:
|
|
649
|
-
claim_rewards_end_time:
|
|
649
|
+
feature_type: f.string().enum(bt),
|
|
650
|
+
config: f.object({
|
|
651
|
+
order_start_time: f.number(),
|
|
652
|
+
order_end_time: f.number(),
|
|
653
|
+
claim_rewards_start_time: f.number(),
|
|
654
|
+
claim_rewards_end_time: f.number()
|
|
650
655
|
})
|
|
651
|
-
}),
|
|
656
|
+
}), St = T.CheckIn, Ct = f.object({
|
|
652
657
|
...P.shape,
|
|
653
|
-
feature_type:
|
|
654
|
-
}),
|
|
658
|
+
feature_type: f.string().enum(St)
|
|
659
|
+
}), wt = T.ClaimActivationKey, Tt = f.object({
|
|
655
660
|
...P.shape,
|
|
656
|
-
feature_type:
|
|
657
|
-
}),
|
|
661
|
+
feature_type: f.string().enum(wt)
|
|
662
|
+
}), Et = T.ClaimRewards, Dt = f.object({
|
|
658
663
|
...P.shape,
|
|
659
|
-
feature_type:
|
|
660
|
-
}),
|
|
664
|
+
feature_type: f.string().enum(Et)
|
|
665
|
+
}), Ot = T.Comment, kt = f.object({
|
|
661
666
|
...P.shape,
|
|
662
|
-
feature_type:
|
|
663
|
-
config:
|
|
664
|
-
comments:
|
|
665
|
-
send_rate:
|
|
667
|
+
feature_type: f.string().enum(Ot),
|
|
668
|
+
config: f.object({
|
|
669
|
+
comments: f.array(f.string()),
|
|
670
|
+
send_rate: f.number()
|
|
666
671
|
})
|
|
667
|
-
}),
|
|
672
|
+
}), At = T.Follow, jt = f.object({
|
|
668
673
|
...P.shape,
|
|
669
|
-
feature_type:
|
|
670
|
-
config:
|
|
671
|
-
platform:
|
|
672
|
-
platform_icon:
|
|
673
|
-
link:
|
|
674
|
-
qr_code_url:
|
|
675
|
-
platform_desc:
|
|
674
|
+
feature_type: f.string().enum(At),
|
|
675
|
+
config: f.object({
|
|
676
|
+
platform: f.string(),
|
|
677
|
+
platform_icon: f.string().optional(),
|
|
678
|
+
link: f.string().optional(),
|
|
679
|
+
qr_code_url: f.string().optional(),
|
|
680
|
+
platform_desc: f.string().optional()
|
|
676
681
|
})
|
|
677
|
-
}),
|
|
678
|
-
name:
|
|
679
|
-
icon_url:
|
|
680
|
-
count:
|
|
681
|
-
}),
|
|
682
|
+
}), Mt = T.GiftCode, Nt = f.object({
|
|
683
|
+
name: f.string(),
|
|
684
|
+
icon_url: f.string(),
|
|
685
|
+
count: f.number()
|
|
686
|
+
}), Pt = f.object({
|
|
682
687
|
...P.shape,
|
|
683
|
-
feature_type:
|
|
684
|
-
config:
|
|
685
|
-
gift_items:
|
|
686
|
-
mp_url:
|
|
687
|
-
mp_qrcode_url:
|
|
688
|
+
feature_type: f.string().enum(Mt),
|
|
689
|
+
config: f.object({
|
|
690
|
+
gift_items: f.array(Nt),
|
|
691
|
+
mp_url: f.string().optional(),
|
|
692
|
+
mp_qrcode_url: f.string().optional()
|
|
688
693
|
})
|
|
689
|
-
}),
|
|
694
|
+
}), Ft = T.Invite, It = f.object({
|
|
690
695
|
...P.shape,
|
|
691
|
-
feature_type:
|
|
692
|
-
config:
|
|
693
|
-
}),
|
|
696
|
+
feature_type: f.string().enum(Ft),
|
|
697
|
+
config: f.object({ share_url: f.string() })
|
|
698
|
+
}), Lt = T.InvitedRegister, Rt = f.object({
|
|
694
699
|
...P.shape,
|
|
695
|
-
feature_type:
|
|
696
|
-
}),
|
|
697
|
-
reward_item_id:
|
|
698
|
-
reward_item_name:
|
|
699
|
-
reward_item_type:
|
|
700
|
-
reward_item_icon_url:
|
|
701
|
-
reward_item_desc:
|
|
702
|
-
reward_amount:
|
|
703
|
-
reward_remaining_stock:
|
|
704
|
-
reward_item_rating:
|
|
705
|
-
}),
|
|
700
|
+
feature_type: f.string().enum(Lt)
|
|
701
|
+
}), zt = f.string().enum(r(S, "GiftCode", "LotteryTicket")), Bt = T.Lottery, Vt = f.object({
|
|
702
|
+
reward_item_id: f.number(),
|
|
703
|
+
reward_item_name: f.string(),
|
|
704
|
+
reward_item_type: zt,
|
|
705
|
+
reward_item_icon_url: f.string(),
|
|
706
|
+
reward_item_desc: f.string().optional(),
|
|
707
|
+
reward_amount: f.number(),
|
|
708
|
+
reward_remaining_stock: f.number(),
|
|
709
|
+
reward_item_rating: f.number()
|
|
710
|
+
}), Ht = f.object({
|
|
706
711
|
...P.shape,
|
|
707
|
-
feature_type:
|
|
708
|
-
config:
|
|
709
|
-
consume_item_id:
|
|
710
|
-
consume_item_name:
|
|
711
|
-
consume_item_icon_url:
|
|
712
|
-
consume_item_count:
|
|
713
|
-
consume_item_desc:
|
|
714
|
-
rewards:
|
|
712
|
+
feature_type: f.string().enum(Bt),
|
|
713
|
+
config: f.object({
|
|
714
|
+
consume_item_id: f.number(),
|
|
715
|
+
consume_item_name: f.string(),
|
|
716
|
+
consume_item_icon_url: f.string(),
|
|
717
|
+
consume_item_count: f.array(f.number()),
|
|
718
|
+
consume_item_desc: f.string().optional(),
|
|
719
|
+
rewards: f.array(Vt)
|
|
715
720
|
})
|
|
716
|
-
}),
|
|
721
|
+
}), Ut = T.LotteryDraw, Wt = f.object({
|
|
717
722
|
...P.shape,
|
|
718
|
-
feature_type:
|
|
719
|
-
config:
|
|
720
|
-
draw_not_before:
|
|
721
|
-
draw_not_after:
|
|
723
|
+
feature_type: f.string().enum(Ut),
|
|
724
|
+
config: f.object({
|
|
725
|
+
draw_not_before: f.number(),
|
|
726
|
+
draw_not_after: f.number()
|
|
722
727
|
})
|
|
723
|
-
}),
|
|
728
|
+
}), Gt = T.Preregister, Kt = f.object({
|
|
724
729
|
...P.shape,
|
|
725
|
-
feature_type:
|
|
726
|
-
}),
|
|
730
|
+
feature_type: f.string().enum(Gt)
|
|
731
|
+
}), qt = T.Quest, Jt = f.object({
|
|
727
732
|
...P.shape,
|
|
728
|
-
feature_type:
|
|
729
|
-
config:
|
|
733
|
+
feature_type: f.string().enum(qt),
|
|
734
|
+
config: f.object({
|
|
730
735
|
objective: E,
|
|
731
|
-
completion_value:
|
|
732
|
-
team:
|
|
733
|
-
feature_id:
|
|
734
|
-
completion_value:
|
|
735
|
-
progress_algorithm:
|
|
736
|
-
top_n:
|
|
736
|
+
completion_value: f.number(),
|
|
737
|
+
team: f.object({
|
|
738
|
+
feature_id: f.number().optional(),
|
|
739
|
+
completion_value: f.number(),
|
|
740
|
+
progress_algorithm: dt.clone().optional(),
|
|
741
|
+
top_n: f.number().optional()
|
|
737
742
|
}).optional(),
|
|
738
|
-
config:
|
|
739
|
-
topic_id:
|
|
740
|
-
required_players:
|
|
741
|
-
required_matches:
|
|
742
|
-
event_item_id:
|
|
743
|
+
config: f.object({
|
|
744
|
+
topic_id: f.number().optional(),
|
|
745
|
+
required_players: f.number().min(1).optional(),
|
|
746
|
+
required_matches: f.number().min(1).optional(),
|
|
747
|
+
event_item_id: f.number().optional()
|
|
743
748
|
}).optional()
|
|
744
749
|
})
|
|
745
|
-
}),
|
|
746
|
-
price:
|
|
747
|
-
per_user_limit:
|
|
750
|
+
}), Yt = T.Redeem, Xt = f.object({
|
|
751
|
+
price: f.number(),
|
|
752
|
+
per_user_limit: f.number(),
|
|
748
753
|
item: N
|
|
749
|
-
}),
|
|
750
|
-
...P.shape,
|
|
751
|
-
feature_type: u.string().enum(qt),
|
|
752
|
-
config: u.object({
|
|
753
|
-
event_item_id: u.number(),
|
|
754
|
-
redeem_catalog: u.array(Jt)
|
|
755
|
-
})
|
|
756
|
-
}), Xt = T.Register, Zt = u.object({
|
|
757
|
-
...P.shape,
|
|
758
|
-
feature_type: u.string().enum(Xt)
|
|
759
|
-
}), Qt = T.Share, $t = u.object({
|
|
760
|
-
...P.shape,
|
|
761
|
-
feature_type: u.string().enum(Qt),
|
|
762
|
-
config: u.object({
|
|
763
|
-
share_platform: u.string(),
|
|
764
|
-
jump_url: u.string().optional(),
|
|
765
|
-
icon_url: u.string().optional()
|
|
766
|
-
})
|
|
767
|
-
}), en = T.Subscribe, tn = u.object({
|
|
768
|
-
...P.shape,
|
|
769
|
-
feature_type: u.string().enum(en),
|
|
770
|
-
config: u.object({ weixin_template_ids: u.array(u.string()) })
|
|
771
|
-
}), nn = T.Survey, rn = u.object({
|
|
772
|
-
...P.shape,
|
|
773
|
-
feature_type: u.string().enum(nn),
|
|
774
|
-
config: u.object({
|
|
775
|
-
survey_id: u.string(),
|
|
776
|
-
survey_url: u.string()
|
|
777
|
-
})
|
|
778
|
-
}), an = T.Team, on = u.object({
|
|
779
|
-
...P.shape,
|
|
780
|
-
feature_type: u.string().enum(an),
|
|
781
|
-
config: u.object({
|
|
782
|
-
max_members: u.number().min(1),
|
|
783
|
-
min_members: u.number().min(1)
|
|
784
|
-
})
|
|
785
|
-
}), sn = T.Ugc, cn = u.object({
|
|
786
|
-
...P.shape,
|
|
787
|
-
feature_type: u.string().enum(sn),
|
|
788
|
-
config: u.object({
|
|
789
|
-
allowed_social_medias: u.array(u.string()).optional(),
|
|
790
|
-
acceptance_rewards: u.array(N).optional()
|
|
791
|
-
})
|
|
792
|
-
}), ln = T.UgcLike, un = u.object({
|
|
754
|
+
}), Zt = f.object({
|
|
793
755
|
...P.shape,
|
|
794
|
-
feature_type:
|
|
795
|
-
config:
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
name: u.string(),
|
|
799
|
-
img_urls: u.array(u.string()).optional(),
|
|
800
|
-
video_urls: u.array(u.string()).optional(),
|
|
801
|
-
descriptions: u.array(u.string()).optional(),
|
|
802
|
-
jump_url: u.string(),
|
|
803
|
-
amount: u.number(),
|
|
804
|
-
finalists: u.bool(),
|
|
805
|
-
last_vote_time: u.number()
|
|
806
|
-
}), pn = u.object({
|
|
807
|
-
...P.shape,
|
|
808
|
-
feature_type: u.string().enum(dn),
|
|
809
|
-
config: u.object({
|
|
810
|
-
vote_feature_ids: u.array(u.number()),
|
|
811
|
-
submission_feature_ids: u.array(u.number()),
|
|
812
|
-
finalists_amount: u.number(),
|
|
813
|
-
source: Qe,
|
|
814
|
-
options: u.array(fn),
|
|
815
|
-
rewards: u.array(N)
|
|
756
|
+
feature_type: f.string().enum(Yt),
|
|
757
|
+
config: f.object({
|
|
758
|
+
event_item_id: f.number(),
|
|
759
|
+
redeem_catalog: f.array(Xt)
|
|
816
760
|
})
|
|
817
|
-
}), F =
|
|
761
|
+
}), F = f.union(f.string().pattern("NumberString", /^\d+$/), f.number()), I = f.object({
|
|
818
762
|
order_total_amount: F,
|
|
819
763
|
cashback_total_amount: F,
|
|
820
764
|
game_item_count: F
|
|
821
|
-
}),
|
|
822
|
-
user_id:
|
|
823
|
-
name:
|
|
824
|
-
avatar_url:
|
|
825
|
-
}),
|
|
826
|
-
reward_id:
|
|
827
|
-
reward_item_id:
|
|
765
|
+
}), Qt = f.object({ activation_key: f.string().disallow("") }), $t = f.object({ gift_code: f.string() }), en = f.object({
|
|
766
|
+
user_id: f.string(),
|
|
767
|
+
name: f.string().optional(),
|
|
768
|
+
avatar_url: f.string().optional()
|
|
769
|
+
}), tn = f.object({ lottery_count: f.number() }), L = f.object({
|
|
770
|
+
reward_id: f.number(),
|
|
771
|
+
reward_item_id: f.number(),
|
|
828
772
|
reward_source: A,
|
|
829
|
-
reward_item_name:
|
|
773
|
+
reward_item_name: f.string(),
|
|
830
774
|
reward_item_type: C,
|
|
831
|
-
reward_item_icon_url:
|
|
832
|
-
reward_item_desc:
|
|
833
|
-
reward_item_rating:
|
|
834
|
-
reward_amount:
|
|
775
|
+
reward_item_icon_url: f.string(),
|
|
776
|
+
reward_item_desc: f.string().optional(),
|
|
777
|
+
reward_item_rating: f.number(),
|
|
778
|
+
reward_amount: f.number(),
|
|
835
779
|
reward_status: k,
|
|
836
|
-
event_id:
|
|
837
|
-
event_name:
|
|
838
|
-
feature_id:
|
|
839
|
-
engagement_id:
|
|
780
|
+
event_id: f.number(),
|
|
781
|
+
event_name: f.string(),
|
|
782
|
+
feature_id: f.number(),
|
|
783
|
+
engagement_id: f.number(),
|
|
840
784
|
feature_type: Ye,
|
|
841
|
-
receive_time:
|
|
842
|
-
extra_data:
|
|
843
|
-
}),
|
|
844
|
-
ticket:
|
|
845
|
-
status:
|
|
846
|
-
created_at:
|
|
847
|
-
}),
|
|
848
|
-
ticket:
|
|
849
|
-
status:
|
|
850
|
-
created_at:
|
|
785
|
+
receive_time: f.number(),
|
|
786
|
+
extra_data: f.record(f.unknown()).optional()
|
|
787
|
+
}), nn = f.string().enum(j.Unknown, j.Pending), rn = f.union(f.object({
|
|
788
|
+
ticket: f.string(),
|
|
789
|
+
status: nn,
|
|
790
|
+
created_at: f.number()
|
|
791
|
+
}), f.object({
|
|
792
|
+
ticket: f.string(),
|
|
793
|
+
status: f.string().enum(r(j, "Unknown", "Pending")),
|
|
794
|
+
created_at: f.number(),
|
|
851
795
|
reward: L
|
|
852
|
-
})).satisfies(),
|
|
853
|
-
role_name:
|
|
854
|
-
is_leader:
|
|
855
|
-
is_myself:
|
|
856
|
-
progress:
|
|
857
|
-
avatar_url:
|
|
858
|
-
}).lock(),
|
|
796
|
+
})).satisfies(), an = f.object({ tickets: f.array(rn) }), on = f.object({ platforms: f.array(f.string()) }), sn = f.object({
|
|
797
|
+
role_name: f.string(),
|
|
798
|
+
is_leader: f.bool(),
|
|
799
|
+
is_myself: f.bool().optional(),
|
|
800
|
+
progress: f.number().optional(),
|
|
801
|
+
avatar_url: f.string().optional()
|
|
802
|
+
}).lock(), cn = f.object({
|
|
859
803
|
objective: E,
|
|
860
|
-
progress:
|
|
861
|
-
completion_value:
|
|
862
|
-
team:
|
|
863
|
-
progress:
|
|
864
|
-
completion_value:
|
|
865
|
-
players:
|
|
804
|
+
progress: f.number(),
|
|
805
|
+
completion_value: f.number().optional(),
|
|
806
|
+
team: f.object({
|
|
807
|
+
progress: f.number(),
|
|
808
|
+
completion_value: f.number().optional(),
|
|
809
|
+
players: f.array(sn)
|
|
866
810
|
}).optional()
|
|
867
|
-
}),
|
|
868
|
-
progress:
|
|
869
|
-
team:
|
|
870
|
-
progress:
|
|
871
|
-
team_members:
|
|
811
|
+
}), ln = f.object({
|
|
812
|
+
progress: f.number(),
|
|
813
|
+
team: f.object({
|
|
814
|
+
progress: f.number(),
|
|
815
|
+
team_members: f.array(sn).optional()
|
|
872
816
|
}).optional()
|
|
873
|
-
}),
|
|
874
|
-
item_id:
|
|
875
|
-
item_count:
|
|
876
|
-
redeem_count:
|
|
877
|
-
}),
|
|
878
|
-
item_id:
|
|
879
|
-
item_stock:
|
|
880
|
-
user_limit:
|
|
881
|
-
})) }),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}),
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
817
|
+
}), un = f.object({
|
|
818
|
+
item_id: f.number(),
|
|
819
|
+
item_count: f.number(),
|
|
820
|
+
redeem_count: f.number()
|
|
821
|
+
}), dn = f.object({ item_stocks: f.array(f.object({
|
|
822
|
+
item_id: f.number(),
|
|
823
|
+
item_stock: f.number(),
|
|
824
|
+
user_limit: f.number()
|
|
825
|
+
})) }), fn = f.object({
|
|
826
|
+
avatar_url: f.string().optional(),
|
|
827
|
+
role_name: f.string(),
|
|
828
|
+
server_name: f.string()
|
|
829
|
+
}), pn = f.object({
|
|
830
|
+
referral_code: f.string().optional(),
|
|
831
|
+
invitee_count: f.number().optional(),
|
|
832
|
+
invitees: f.array(fn).optional()
|
|
833
|
+
}), mn = f.object({
|
|
834
|
+
required_invitees: f.number(),
|
|
835
|
+
unlocked: f.bool(),
|
|
836
|
+
generated: f.bool()
|
|
837
|
+
}), hn = f.object({
|
|
838
|
+
invitee_count: f.number().optional(),
|
|
839
|
+
generated_rewards: f.array(L).optional(),
|
|
840
|
+
referral_tier_status: f.array(mn).optional()
|
|
841
|
+
}), gn = f.object({ platform: f.string().optional() }), _n = f.object({ weixin_openid: f.string() }), vn = f.object({ serial_number: f.number() }), yn = f.object({
|
|
842
|
+
team_code: f.string(),
|
|
843
|
+
leader_name: f.string(),
|
|
844
|
+
total_members: f.number()
|
|
845
|
+
}), bn = f.object({
|
|
846
|
+
is_leader: f.bool(),
|
|
847
|
+
is_myself: f.bool().optional(),
|
|
848
|
+
role_name: f.string(),
|
|
849
|
+
server_name: f.string(),
|
|
850
|
+
avatar_url: f.string().optional()
|
|
851
|
+
}), xn = f.object({
|
|
852
|
+
team_code: f.string(),
|
|
893
853
|
visibility: nt,
|
|
894
|
-
members:
|
|
895
|
-
is_leader:
|
|
896
|
-
role_name:
|
|
897
|
-
server_name:
|
|
854
|
+
members: f.array(f.object({
|
|
855
|
+
is_leader: f.bool(),
|
|
856
|
+
role_name: f.string(),
|
|
857
|
+
server_name: f.string()
|
|
898
858
|
}))
|
|
899
|
-
}),
|
|
900
|
-
ugc_id:
|
|
901
|
-
title:
|
|
902
|
-
content:
|
|
903
|
-
image_urls:
|
|
859
|
+
}), Sn = f.object({
|
|
860
|
+
ugc_id: f.number(),
|
|
861
|
+
title: f.string(),
|
|
862
|
+
content: f.string().optional(),
|
|
863
|
+
image_urls: f.array(f.string()).optional(),
|
|
904
864
|
social_media: M.clone().optional(),
|
|
905
|
-
social_media_url:
|
|
906
|
-
}),
|
|
907
|
-
ugcs:
|
|
908
|
-
ugc_id:
|
|
909
|
-
event_id:
|
|
910
|
-
feature_id:
|
|
911
|
-
title:
|
|
912
|
-
content:
|
|
913
|
-
image_urls:
|
|
865
|
+
social_media_url: f.string().optional()
|
|
866
|
+
}), Cn = f.object({
|
|
867
|
+
ugcs: f.array(f.object({
|
|
868
|
+
ugc_id: f.number(),
|
|
869
|
+
event_id: f.number().optional(),
|
|
870
|
+
feature_id: f.number().optional(),
|
|
871
|
+
title: f.string(),
|
|
872
|
+
content: f.string().optional(),
|
|
873
|
+
image_urls: f.array(f.string()).optional(),
|
|
914
874
|
social_media: M.clone().optional(),
|
|
915
|
-
social_media_url:
|
|
916
|
-
server_id:
|
|
917
|
-
server_name:
|
|
918
|
-
role_id:
|
|
919
|
-
role_name:
|
|
920
|
-
total_likes:
|
|
921
|
-
created_at:
|
|
875
|
+
social_media_url: f.string().optional(),
|
|
876
|
+
server_id: f.number().optional(),
|
|
877
|
+
server_name: f.string().optional(),
|
|
878
|
+
role_id: f.string().optional(),
|
|
879
|
+
role_name: f.string().optional(),
|
|
880
|
+
total_likes: f.number().optional(),
|
|
881
|
+
created_at: f.number()
|
|
922
882
|
})).optional(),
|
|
923
|
-
next_token:
|
|
924
|
-
}),
|
|
925
|
-
ugcs:
|
|
926
|
-
ugc_id:
|
|
927
|
-
event_id:
|
|
928
|
-
feature_id:
|
|
929
|
-
feature_name:
|
|
930
|
-
review_status:
|
|
931
|
-
reviewer_comment:
|
|
932
|
-
title:
|
|
933
|
-
content:
|
|
934
|
-
image_urls:
|
|
883
|
+
next_token: f.string().optional()
|
|
884
|
+
}), wn = f.object({
|
|
885
|
+
ugcs: f.array(f.object({
|
|
886
|
+
ugc_id: f.number(),
|
|
887
|
+
event_id: f.number().optional(),
|
|
888
|
+
feature_id: f.number().optional(),
|
|
889
|
+
feature_name: f.string().optional(),
|
|
890
|
+
review_status: gt,
|
|
891
|
+
reviewer_comment: f.string().optional(),
|
|
892
|
+
title: f.string(),
|
|
893
|
+
content: f.string().optional(),
|
|
894
|
+
image_urls: f.array(f.string()).optional(),
|
|
935
895
|
social_media: M.clone().optional(),
|
|
936
|
-
social_media_url:
|
|
937
|
-
server_id:
|
|
938
|
-
server_name:
|
|
939
|
-
role_id:
|
|
940
|
-
role_name:
|
|
941
|
-
total_likes:
|
|
942
|
-
created_at:
|
|
896
|
+
social_media_url: f.string().optional(),
|
|
897
|
+
server_id: f.number().optional(),
|
|
898
|
+
server_name: f.string().optional(),
|
|
899
|
+
role_id: f.string().optional(),
|
|
900
|
+
role_name: f.string().optional(),
|
|
901
|
+
total_likes: f.number().optional(),
|
|
902
|
+
created_at: f.number()
|
|
943
903
|
})).optional(),
|
|
944
|
-
next_token:
|
|
945
|
-
}),
|
|
946
|
-
existed:
|
|
947
|
-
upload_url:
|
|
948
|
-
image_url:
|
|
949
|
-
}),
|
|
950
|
-
ugc_id:
|
|
951
|
-
rank:
|
|
952
|
-
total_likes:
|
|
953
|
-
image_urls:
|
|
954
|
-
server_id:
|
|
955
|
-
server_name:
|
|
956
|
-
role_id:
|
|
957
|
-
role_name:
|
|
958
|
-
})).optional() }),
|
|
959
|
-
candidate_id:
|
|
960
|
-
total_votes:
|
|
961
|
-
my_votes:
|
|
962
|
-
cycle_votes:
|
|
963
|
-
votes:
|
|
964
|
-
}),
|
|
965
|
-
rewards_type:
|
|
966
|
-
rewards:
|
|
967
|
-
}),
|
|
968
|
-
candidate_id:
|
|
969
|
-
is_winner:
|
|
970
|
-
total_votes:
|
|
971
|
-
my_votes:
|
|
972
|
-
cycle_votes:
|
|
973
|
-
}),
|
|
974
|
-
role:
|
|
975
|
-
content:
|
|
976
|
-
}),
|
|
977
|
-
user_id:
|
|
978
|
-
name:
|
|
979
|
-
avatar_url:
|
|
980
|
-
comment:
|
|
981
|
-
video_note:
|
|
982
|
-
created_at:
|
|
983
|
-
}),
|
|
984
|
-
reward_id:
|
|
985
|
-
reward_item_id:
|
|
904
|
+
next_token: f.string().optional()
|
|
905
|
+
}), Tn = f.object({ total_count: f.number() }), En = f.object({
|
|
906
|
+
existed: f.bool(),
|
|
907
|
+
upload_url: f.string().optional(),
|
|
908
|
+
image_url: f.string()
|
|
909
|
+
}), Dn = f.object({ ugcs: f.array(f.object({
|
|
910
|
+
ugc_id: f.number(),
|
|
911
|
+
rank: f.number(),
|
|
912
|
+
total_likes: f.number(),
|
|
913
|
+
image_urls: f.array(f.string()).optional(),
|
|
914
|
+
server_id: f.number().optional(),
|
|
915
|
+
server_name: f.string().optional(),
|
|
916
|
+
role_id: f.string().optional(),
|
|
917
|
+
role_name: f.string().optional()
|
|
918
|
+
})).optional() }), On = f.object({ option_sn: f.string() }), kn = f.object({
|
|
919
|
+
candidate_id: f.string(),
|
|
920
|
+
total_votes: f.number().optional(),
|
|
921
|
+
my_votes: f.number().optional(),
|
|
922
|
+
cycle_votes: f.number().optional(),
|
|
923
|
+
votes: f.number().optional()
|
|
924
|
+
}), An = f.object({
|
|
925
|
+
rewards_type: pt,
|
|
926
|
+
rewards: f.array(L).optional()
|
|
927
|
+
}), jn = f.object({
|
|
928
|
+
candidate_id: f.string(),
|
|
929
|
+
is_winner: f.bool(),
|
|
930
|
+
total_votes: f.number(),
|
|
931
|
+
my_votes: f.number(),
|
|
932
|
+
cycle_votes: f.number().optional()
|
|
933
|
+
}), Mn = f.object({
|
|
934
|
+
role: f.string(),
|
|
935
|
+
content: f.string()
|
|
936
|
+
}), Nn = f.object({ conversations: f.array(Mn) }), Pn = f.object({
|
|
937
|
+
user_id: f.string(),
|
|
938
|
+
name: f.string(),
|
|
939
|
+
avatar_url: f.string(),
|
|
940
|
+
comment: f.string(),
|
|
941
|
+
video_note: f.number(),
|
|
942
|
+
created_at: f.number()
|
|
943
|
+
}), R = f.union(on, tn, vn, en, gn, On, kn, _n, I, $t, xn, cn, an, Qt, Nn, Sn, un, pn, f.custom("EmptyObject", (e) => t(e) && Object.keys(e).length === 0)).satisfies().lock(), z = f.object({
|
|
944
|
+
reward_id: f.number(),
|
|
945
|
+
reward_item_id: f.number(),
|
|
986
946
|
reward_item_type: w,
|
|
987
|
-
reward_count:
|
|
947
|
+
reward_count: f.number(),
|
|
988
948
|
reward_status: O,
|
|
989
949
|
reward_source: A,
|
|
990
|
-
reward_item_name:
|
|
991
|
-
reward_item_icon_url:
|
|
992
|
-
reward_item_desc:
|
|
993
|
-
reward_item_rating:
|
|
994
|
-
receive_time:
|
|
995
|
-
extra_data:
|
|
996
|
-
}),
|
|
997
|
-
reward_id:
|
|
998
|
-
reward_item_id:
|
|
999
|
-
reward_item_name:
|
|
950
|
+
reward_item_name: f.string(),
|
|
951
|
+
reward_item_icon_url: f.string(),
|
|
952
|
+
reward_item_desc: f.string().optional(),
|
|
953
|
+
reward_item_rating: f.number(),
|
|
954
|
+
receive_time: f.number(),
|
|
955
|
+
extra_data: f.union(...R.validators, f.record(f.unknown())).satisfies().optional()
|
|
956
|
+
}), Fn = f.object({
|
|
957
|
+
reward_id: f.number(),
|
|
958
|
+
reward_item_id: f.number(),
|
|
959
|
+
reward_item_name: f.string(),
|
|
1000
960
|
reward_item_type: w,
|
|
1001
|
-
reward_item_icon_url:
|
|
1002
|
-
reward_item_desc:
|
|
1003
|
-
reward_item_rating:
|
|
1004
|
-
reward_amount:
|
|
961
|
+
reward_item_icon_url: f.string(),
|
|
962
|
+
reward_item_desc: f.string().optional(),
|
|
963
|
+
reward_item_rating: f.number(),
|
|
964
|
+
reward_amount: f.number(),
|
|
1005
965
|
reward_status: O,
|
|
1006
966
|
reward_source: A,
|
|
1007
|
-
extra_data:
|
|
1008
|
-
}),
|
|
1009
|
-
engagement_id:
|
|
1010
|
-
user_id:
|
|
1011
|
-
event_id:
|
|
1012
|
-
feature_id:
|
|
1013
|
-
sequence:
|
|
1014
|
-
data:
|
|
1015
|
-
server_id:
|
|
1016
|
-
role_id:
|
|
1017
|
-
created_at:
|
|
1018
|
-
rewards:
|
|
1019
|
-
}).lock(),
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
}),
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
967
|
+
extra_data: f.record(f.unknown()).optional()
|
|
968
|
+
}), In = f.object({
|
|
969
|
+
engagement_id: f.number(),
|
|
970
|
+
user_id: f.string(),
|
|
971
|
+
event_id: f.number(),
|
|
972
|
+
feature_id: f.number(),
|
|
973
|
+
sequence: f.number(),
|
|
974
|
+
data: R.clone().optional(),
|
|
975
|
+
server_id: f.string().optional(),
|
|
976
|
+
role_id: f.string().optional(),
|
|
977
|
+
created_at: f.number(),
|
|
978
|
+
rewards: f.array(z).optional()
|
|
979
|
+
}).lock(), Ln = T.Referral, Rn = f.object({
|
|
980
|
+
required_invitees: f.number(),
|
|
981
|
+
rewards: f.array(z)
|
|
982
|
+
}), zn = f.object({
|
|
983
|
+
...P.shape,
|
|
984
|
+
feature_type: f.string().enum(Ln),
|
|
985
|
+
config: f.object({
|
|
986
|
+
max_recent_invitees: f.number(),
|
|
987
|
+
referral_tier: f.array(Rn)
|
|
988
|
+
})
|
|
989
|
+
}), Bn = T.Register, Vn = f.object({
|
|
990
|
+
...P.shape,
|
|
991
|
+
feature_type: f.string().enum(Bn)
|
|
992
|
+
}), Hn = T.Share, Un = f.object({
|
|
993
|
+
...P.shape,
|
|
994
|
+
feature_type: f.string().enum(Hn),
|
|
995
|
+
config: f.object({
|
|
996
|
+
share_platform: f.string(),
|
|
997
|
+
jump_url: f.string().optional(),
|
|
998
|
+
icon_url: f.string().optional()
|
|
999
|
+
})
|
|
1000
|
+
}), Wn = T.Subscribe, Gn = f.object({
|
|
1001
|
+
...P.shape,
|
|
1002
|
+
feature_type: f.string().enum(Wn),
|
|
1003
|
+
config: f.object({ weixin_template_ids: f.array(f.string()) })
|
|
1004
|
+
}), Kn = T.Survey, qn = f.object({
|
|
1005
|
+
...P.shape,
|
|
1006
|
+
feature_type: f.string().enum(Kn),
|
|
1007
|
+
config: f.object({
|
|
1008
|
+
survey_id: f.string(),
|
|
1009
|
+
survey_url: f.string()
|
|
1010
|
+
})
|
|
1011
|
+
}), Jn = T.Team, Yn = f.object({
|
|
1012
|
+
...P.shape,
|
|
1013
|
+
feature_type: f.string().enum(Jn),
|
|
1014
|
+
config: f.object({
|
|
1015
|
+
max_members: f.number().min(1),
|
|
1016
|
+
min_members: f.number().min(1)
|
|
1017
|
+
})
|
|
1018
|
+
}), Xn = T.Ugc, Zn = f.object({
|
|
1019
|
+
...P.shape,
|
|
1020
|
+
feature_type: f.string().enum(Xn),
|
|
1021
|
+
config: f.object({
|
|
1022
|
+
allowed_social_medias: f.array(f.string()).optional(),
|
|
1023
|
+
acceptance_rewards: f.array(N).optional()
|
|
1024
|
+
})
|
|
1025
|
+
}), Qn = T.UgcLike, $n = f.object({
|
|
1026
|
+
...P.shape,
|
|
1027
|
+
feature_type: f.string().enum(Qn),
|
|
1028
|
+
config: f.object({ ugc_feature_id: f.number() })
|
|
1029
|
+
}), er = T.Vote, tr = f.object({
|
|
1030
|
+
sn: f.string(),
|
|
1031
|
+
name: f.string(),
|
|
1032
|
+
img_urls: f.array(f.string()).optional(),
|
|
1033
|
+
video_urls: f.array(f.string()).optional(),
|
|
1034
|
+
descriptions: f.array(f.string()).optional(),
|
|
1035
|
+
jump_url: f.string(),
|
|
1036
|
+
amount: f.number(),
|
|
1037
|
+
finalists: f.bool(),
|
|
1038
|
+
last_vote_time: f.number()
|
|
1039
|
+
}), nr = f.object({
|
|
1040
|
+
...P.shape,
|
|
1041
|
+
feature_type: f.string().enum(er),
|
|
1042
|
+
config: f.object({
|
|
1043
|
+
vote_feature_ids: f.array(f.number()),
|
|
1044
|
+
submission_feature_ids: f.array(f.number()),
|
|
1045
|
+
finalists_amount: f.number(),
|
|
1046
|
+
source: Qe,
|
|
1047
|
+
options: f.array(tr),
|
|
1048
|
+
rewards: f.array(N)
|
|
1049
|
+
})
|
|
1050
|
+
}), rr = f.object({
|
|
1051
|
+
allowed: f.bool(),
|
|
1052
|
+
registered: f.bool()
|
|
1053
|
+
}), ir = f.object({
|
|
1054
|
+
feature_id: f.number(),
|
|
1055
|
+
can_engage: f.bool(),
|
|
1056
|
+
has_unclaimed_rewards: f.bool(),
|
|
1057
|
+
final_available_count: f.number(),
|
|
1058
|
+
total_remaining_engagements: f.number(),
|
|
1059
|
+
cycle_remaining_engagements: f.number(),
|
|
1060
|
+
eligible: f.bool().optional(),
|
|
1061
|
+
actions: f.array(f.object({
|
|
1062
|
+
action_type: f.string(),
|
|
1063
|
+
allowed: f.bool()
|
|
1033
1064
|
})).optional()
|
|
1034
|
-
}),
|
|
1035
|
-
engagement_id:
|
|
1036
|
-
engagement:
|
|
1037
|
-
engagement_id:
|
|
1038
|
-
sequence:
|
|
1039
|
-
feature_id:
|
|
1040
|
-
data:
|
|
1065
|
+
}), ar = f.object({
|
|
1066
|
+
engagement_id: f.number(),
|
|
1067
|
+
engagement: f.object({
|
|
1068
|
+
engagement_id: f.number(),
|
|
1069
|
+
sequence: f.number(),
|
|
1070
|
+
feature_id: f.number(),
|
|
1071
|
+
data: R.clone().optional()
|
|
1041
1072
|
}).optional(),
|
|
1042
|
-
rewards:
|
|
1043
|
-
scan:
|
|
1044
|
-
}),
|
|
1045
|
-
reward_id:
|
|
1073
|
+
rewards: f.array(Fn).optional(),
|
|
1074
|
+
scan: f.bool().optional()
|
|
1075
|
+
}), or = f.object({
|
|
1076
|
+
reward_id: f.number(),
|
|
1046
1077
|
reward_status: k
|
|
1047
|
-
}),
|
|
1048
|
-
candidate_id:
|
|
1049
|
-
display_name:
|
|
1050
|
-
images:
|
|
1051
|
-
videos:
|
|
1052
|
-
description:
|
|
1053
|
-
jump_url:
|
|
1054
|
-
}),
|
|
1078
|
+
}), sr = T.Vote2, cr = f.object({
|
|
1079
|
+
candidate_id: f.string(),
|
|
1080
|
+
display_name: f.string(),
|
|
1081
|
+
images: f.array(f.string()).optional(),
|
|
1082
|
+
videos: f.array(f.string()).optional(),
|
|
1083
|
+
description: f.string().optional(),
|
|
1084
|
+
jump_url: f.string()
|
|
1085
|
+
}), lr = f.object({
|
|
1055
1086
|
...P.shape,
|
|
1056
|
-
feature_type:
|
|
1057
|
-
config:
|
|
1058
|
-
vote_item_id:
|
|
1059
|
-
candidates:
|
|
1060
|
-
vote_since:
|
|
1061
|
-
vote_until:
|
|
1062
|
-
rewards_since:
|
|
1063
|
-
rewards_until:
|
|
1064
|
-
winner_rewards:
|
|
1065
|
-
consolation_rewards:
|
|
1066
|
-
max_votes_per_user_per_candidate_per_cycle:
|
|
1087
|
+
feature_type: f.string().enum(sr),
|
|
1088
|
+
config: f.object({
|
|
1089
|
+
vote_item_id: f.number().optional(),
|
|
1090
|
+
candidates: f.array(cr),
|
|
1091
|
+
vote_since: f.number(),
|
|
1092
|
+
vote_until: f.number(),
|
|
1093
|
+
rewards_since: f.number(),
|
|
1094
|
+
rewards_until: f.number(),
|
|
1095
|
+
winner_rewards: f.array(N).optional(),
|
|
1096
|
+
consolation_rewards: f.array(N).optional(),
|
|
1097
|
+
max_votes_per_user_per_candidate_per_cycle: f.number().optional()
|
|
1067
1098
|
})
|
|
1068
|
-
}),
|
|
1099
|
+
}), ur = T.ZeroChatgpt, dr = f.object({
|
|
1069
1100
|
...P.shape,
|
|
1070
|
-
feature_type:
|
|
1071
|
-
}),
|
|
1072
|
-
event_name:
|
|
1073
|
-
rules:
|
|
1074
|
-
since:
|
|
1075
|
-
until:
|
|
1076
|
-
visit_count:
|
|
1077
|
-
features:
|
|
1078
|
-
}).lock(),
|
|
1079
|
-
engagements:
|
|
1080
|
-
next_token:
|
|
1081
|
-
}),
|
|
1082
|
-
user_rewards:
|
|
1083
|
-
next_token:
|
|
1084
|
-
}),
|
|
1101
|
+
feature_type: f.string().enum(ur)
|
|
1102
|
+
}), fr = f.union(xt, Ct, Dt, kt, jt, Pt, It, Rt, Ht, Wt, Kt, Jt, Vn, Un, Gn, qn, Yn, nr, lr, Tt, dr, Zn, $n, Zt, zn).key("feature_type").satisfies(), pr = f.object({
|
|
1103
|
+
event_name: f.string(),
|
|
1104
|
+
rules: f.string(),
|
|
1105
|
+
since: f.number(),
|
|
1106
|
+
until: f.number(),
|
|
1107
|
+
visit_count: f.number().optional(),
|
|
1108
|
+
features: f.array(fr)
|
|
1109
|
+
}).lock(), mr = f.guard(pr), hr = f.guard(rr), B = d({ count: f.number() }), gr = d({ first_visit: f.bool() }), _r = d({ engagements: f.union(f.array(Pn), f.array(yn)) }), vr = d({ status: f.array(ir) }), yr = d({ engagements_counts: f.record(f.number()) }), br = d({
|
|
1110
|
+
engagements: f.array(In),
|
|
1111
|
+
next_token: f.string().optional()
|
|
1112
|
+
}), xr = f.guard(ar), Sr = d({ claimed_items: f.array(or) }), Cr = d({ rewards: f.array(L) }), wr = d({ reward_status: k }), Tr = d({
|
|
1113
|
+
user_rewards: f.array(L),
|
|
1114
|
+
next_token: f.string().optional()
|
|
1115
|
+
}), Er = d({ unclaimed: f.number() }), Dr = d({ scene: f.string() }), Or = d({ params: f.string() }), kr = d({ img: f.string() }), Ar = f.guard(ln), jr = f.guard(An), Mr = f.guard(f.object({ candidate_votes: f.array(jn) })), Nr = f.guard(I), Pr = f.guard(wn), Fr = f.guard(Cn), Ir = f.guard(Tn), Lr = f.guard(En), Rr = f.guard(Dn), zr = f.guard(dn), Br = f.guard(hn);
|
|
1085
1116
|
//#endregion
|
|
1086
1117
|
//#region src/event.methods.ts
|
|
1087
|
-
async function
|
|
1118
|
+
async function Vr(e, t, n) {
|
|
1088
1119
|
let { data: r } = await this.req.get("verify-mobile-allowed", {
|
|
1089
1120
|
game_id: e,
|
|
1090
1121
|
mobile: t
|
|
1091
|
-
},
|
|
1122
|
+
}, hr, n);
|
|
1092
1123
|
return r;
|
|
1093
1124
|
}
|
|
1094
|
-
async function
|
|
1095
|
-
let { data: t } = await this.req.get(`event/${this.event}/event-config`, null,
|
|
1125
|
+
async function Hr(e) {
|
|
1126
|
+
let { data: t } = await this.req.get(`event/${this.event}/event-config`, null, mr, e);
|
|
1096
1127
|
return t;
|
|
1097
1128
|
}
|
|
1098
|
-
async function
|
|
1129
|
+
async function Ur(e, t) {
|
|
1099
1130
|
let { data: n } = await this.req.get(`event/${this.event}/feature-engagement-count`, {
|
|
1100
1131
|
feature_id: e,
|
|
1101
1132
|
type: "user"
|
|
1102
1133
|
}, B, t);
|
|
1103
1134
|
return n?.count ?? null;
|
|
1104
1135
|
}
|
|
1105
|
-
async function
|
|
1136
|
+
async function Wr(e, t) {
|
|
1106
1137
|
let { data: n } = await this.req.get(`event/${this.event}/feature-engagement-count`, {
|
|
1107
1138
|
feature_id: e,
|
|
1108
1139
|
type: "engagement"
|
|
1109
1140
|
}, B, t);
|
|
1110
1141
|
return n?.count ?? null;
|
|
1111
1142
|
}
|
|
1112
|
-
async function
|
|
1113
|
-
let { data: n } = await this.req.get(`event/${this.event}/feature-engagements`, { feature_id: e },
|
|
1143
|
+
async function Gr(e, t) {
|
|
1144
|
+
let { data: n } = await this.req.get(`event/${this.event}/feature-engagements`, { feature_id: e }, _r, t);
|
|
1114
1145
|
return n?.engagements || [];
|
|
1115
1146
|
}
|
|
1116
|
-
async function
|
|
1147
|
+
async function Kr(e, t) {
|
|
1117
1148
|
await this.token.autoLogin();
|
|
1118
|
-
let { data: n, code: r, message: i } = await this.req.post(`event/${this.event}/visit`, a(e || {}),
|
|
1149
|
+
let { data: n, code: r, message: i } = await this.req.post(`event/${this.event}/visit`, a(e || {}), gr, t);
|
|
1119
1150
|
return n ?? {
|
|
1120
1151
|
message: i,
|
|
1121
1152
|
error: r
|
|
1122
1153
|
};
|
|
1123
1154
|
}
|
|
1124
|
-
async function
|
|
1155
|
+
async function qr(e, t) {
|
|
1125
1156
|
if (!await this.token.autoLogin()) return [];
|
|
1126
1157
|
let { data: n } = await this.req.get("event/user-feature-status", {
|
|
1127
1158
|
...e,
|
|
1128
1159
|
event_id: this.event
|
|
1129
|
-
},
|
|
1160
|
+
}, vr, {
|
|
1130
1161
|
...t,
|
|
1131
1162
|
message: !1
|
|
1132
1163
|
});
|
|
1133
1164
|
return n?.status || [];
|
|
1134
1165
|
}
|
|
1135
|
-
async function
|
|
1166
|
+
async function Jr(e, t) {
|
|
1136
1167
|
if (!await this.token.autoLogin()) return {};
|
|
1137
1168
|
let { data: n } = await this.req.get("event/user-engagements-count", {
|
|
1138
1169
|
...t,
|
|
1139
1170
|
event_id: this.event,
|
|
1140
1171
|
feature_id: e
|
|
1141
|
-
},
|
|
1172
|
+
}, yr, { message: !1 });
|
|
1142
1173
|
return n?.engagements_counts || {};
|
|
1143
1174
|
}
|
|
1144
|
-
async function
|
|
1175
|
+
async function Yr(e, t, n) {
|
|
1145
1176
|
if (!await this.token.autoLogin()) return {
|
|
1146
1177
|
engagements: [],
|
|
1147
1178
|
next_token: ""
|
|
@@ -1151,36 +1182,36 @@ async function zr(e, t, n) {
|
|
|
1151
1182
|
...t,
|
|
1152
1183
|
event_id: this.event,
|
|
1153
1184
|
feature_id: e
|
|
1154
|
-
},
|
|
1185
|
+
}, br, n);
|
|
1155
1186
|
return {
|
|
1156
1187
|
engagements: r?.engagements || [],
|
|
1157
1188
|
next_token: r?.next_token || ""
|
|
1158
1189
|
};
|
|
1159
1190
|
}
|
|
1160
|
-
async function
|
|
1191
|
+
async function Xr(e, t, n, r) {
|
|
1161
1192
|
await this.token.autoLogin();
|
|
1162
1193
|
let { data: i, code: o, message: s } = await this.req.post(`event/${this.event}/engage`, a({
|
|
1163
1194
|
feature_id: e,
|
|
1164
1195
|
engagement: t,
|
|
1165
1196
|
...n
|
|
1166
|
-
}),
|
|
1197
|
+
}), xr, r);
|
|
1167
1198
|
return i ?? {
|
|
1168
1199
|
message: s,
|
|
1169
1200
|
error: o
|
|
1170
1201
|
};
|
|
1171
1202
|
}
|
|
1172
|
-
async function
|
|
1203
|
+
async function Zr(e, t) {
|
|
1173
1204
|
await this.token.autoLogin();
|
|
1174
1205
|
let { data: n, code: r, message: i } = await this.req.post("event/claim-rewards", a({
|
|
1175
1206
|
...e,
|
|
1176
1207
|
server_id: e.server_id ? +e.server_id : void 0
|
|
1177
|
-
}),
|
|
1208
|
+
}), Sr, t);
|
|
1178
1209
|
return n?.claimed_items || {
|
|
1179
1210
|
message: i,
|
|
1180
1211
|
error: r
|
|
1181
1212
|
};
|
|
1182
1213
|
}
|
|
1183
|
-
async function
|
|
1214
|
+
async function Qr(e, t) {
|
|
1184
1215
|
if (!await this.token.autoLogin()) return null;
|
|
1185
1216
|
let { ok: n, code: r, message: i } = await this.req.post(`event/${this.event}/user-reward-address`, e, null, t);
|
|
1186
1217
|
return n || {
|
|
@@ -1188,23 +1219,23 @@ async function Hr(e, t) {
|
|
|
1188
1219
|
error: r
|
|
1189
1220
|
};
|
|
1190
1221
|
}
|
|
1191
|
-
async function
|
|
1222
|
+
async function $r(e, t) {
|
|
1192
1223
|
if (!await this.token.autoLogin()) return null;
|
|
1193
|
-
let { data: n } = await this.req.get("event/unlimit-qrcode-scene", { params: e },
|
|
1224
|
+
let { data: n } = await this.req.get("event/unlimit-qrcode-scene", { params: e }, Dr, t);
|
|
1194
1225
|
return n?.scene ?? null;
|
|
1195
1226
|
}
|
|
1196
|
-
async function
|
|
1197
|
-
let { data: n } = await this.req.get("event/params-by-qrcode-scene", { scene: e },
|
|
1227
|
+
async function ei(e, t) {
|
|
1228
|
+
let { data: n } = await this.req.get("event/params-by-qrcode-scene", { scene: e }, Or, t);
|
|
1198
1229
|
return n?.params ?? null;
|
|
1199
1230
|
}
|
|
1200
|
-
async function
|
|
1231
|
+
async function ti(e, t) {
|
|
1201
1232
|
if (!await this.token.autoLogin()) return null;
|
|
1202
|
-
let { data: n } = await this.req.post("event/unlimit-qrcode", a(e),
|
|
1233
|
+
let { data: n } = await this.req.post("event/unlimit-qrcode", a(e), kr, t);
|
|
1203
1234
|
return n?.img ?? null;
|
|
1204
1235
|
}
|
|
1205
|
-
async function
|
|
1236
|
+
async function ni(e, t) {
|
|
1206
1237
|
if (!await this.token.autoLogin()) return null;
|
|
1207
|
-
let { data: n, code: r, message: i } = await this.req.get(`event/${this.event}/quest-progress`, { feature_id: e },
|
|
1238
|
+
let { data: n, code: r, message: i } = await this.req.get(`event/${this.event}/quest-progress`, { feature_id: e }, Ar, {
|
|
1208
1239
|
message: !1,
|
|
1209
1240
|
...t
|
|
1210
1241
|
});
|
|
@@ -1213,75 +1244,75 @@ async function Kr(e, t) {
|
|
|
1213
1244
|
error: r
|
|
1214
1245
|
};
|
|
1215
1246
|
}
|
|
1216
|
-
async function
|
|
1247
|
+
async function ri(e, t) {
|
|
1217
1248
|
if (!await this.token.autoLogin()) return null;
|
|
1218
1249
|
let { data: n, code: r, message: i } = await this.req.post("event/vote2/rewards", {
|
|
1219
1250
|
feature_id: e,
|
|
1220
1251
|
event_id: this.event
|
|
1221
|
-
},
|
|
1252
|
+
}, jr, t);
|
|
1222
1253
|
return n || {
|
|
1223
1254
|
message: i,
|
|
1224
1255
|
code: r
|
|
1225
1256
|
};
|
|
1226
1257
|
}
|
|
1227
|
-
async function
|
|
1258
|
+
async function ii(e, t) {
|
|
1228
1259
|
if (!await this.token.autoLogin()) return [];
|
|
1229
1260
|
let { data: n } = await this.req.get("event/vote2/leaderboard", {
|
|
1230
1261
|
feature_id: e,
|
|
1231
1262
|
event_id: this.event
|
|
1232
|
-
},
|
|
1263
|
+
}, Mr, t);
|
|
1233
1264
|
return n?.candidate_votes || [];
|
|
1234
1265
|
}
|
|
1235
|
-
async function
|
|
1266
|
+
async function ai(e, t) {
|
|
1236
1267
|
if (!await this.token.autoLogin()) return null;
|
|
1237
1268
|
let { data: n, code: r, message: i } = await this.req.get("event/cashback/query", {
|
|
1238
1269
|
feature_id: e,
|
|
1239
1270
|
event_id: this.event
|
|
1240
|
-
},
|
|
1271
|
+
}, Nr, t);
|
|
1241
1272
|
return n || {
|
|
1242
1273
|
message: i,
|
|
1243
1274
|
error: r
|
|
1244
1275
|
};
|
|
1245
1276
|
}
|
|
1246
|
-
async function
|
|
1277
|
+
async function oi(e, t) {
|
|
1247
1278
|
if (!await this.token.autoLogin()) return null;
|
|
1248
1279
|
let { data: n, code: r, message: i } = await this.req.get("event/ugc/my", {
|
|
1249
1280
|
max_results: 20,
|
|
1250
1281
|
...e
|
|
1251
|
-
},
|
|
1282
|
+
}, Pr, t);
|
|
1252
1283
|
return n || {
|
|
1253
1284
|
message: i,
|
|
1254
1285
|
error: r
|
|
1255
1286
|
};
|
|
1256
1287
|
}
|
|
1257
|
-
async function
|
|
1288
|
+
async function si(e, t) {
|
|
1258
1289
|
if (!await this.token.autoLogin()) return null;
|
|
1259
|
-
let { data: n, code: r, message: i } = await this.req.get("event/ugc/my-count", { ...e },
|
|
1290
|
+
let { data: n, code: r, message: i } = await this.req.get("event/ugc/my-count", { ...e }, Ir, t);
|
|
1260
1291
|
return n || {
|
|
1261
1292
|
message: i,
|
|
1262
1293
|
error: r
|
|
1263
1294
|
};
|
|
1264
1295
|
}
|
|
1265
|
-
async function
|
|
1296
|
+
async function ci(e, t) {
|
|
1266
1297
|
await this.token.autoLogin();
|
|
1267
1298
|
let { data: n, code: r, message: i } = await this.req.post("event/claim-rewards-v2", a({
|
|
1268
1299
|
...e,
|
|
1269
1300
|
server_id: e.server_id ? +e.server_id : void 0
|
|
1270
|
-
}),
|
|
1301
|
+
}), Cr, t);
|
|
1271
1302
|
return n?.rewards || {
|
|
1272
1303
|
message: i,
|
|
1273
1304
|
error: r
|
|
1274
1305
|
};
|
|
1275
1306
|
}
|
|
1276
|
-
async function
|
|
1307
|
+
async function li(e, t) {
|
|
1277
1308
|
await this.token.autoLogin();
|
|
1278
|
-
let { data: n, code: r, message: i } = await this.req.post("event/claim-weixin-hongbao", { reward_id: e },
|
|
1309
|
+
let { data: n, code: r, message: i } = await this.req.post("event/claim-weixin-hongbao", { reward_id: e }, wr, t);
|
|
1279
1310
|
return n || {
|
|
1280
1311
|
message: i,
|
|
1281
1312
|
error: r
|
|
1282
1313
|
};
|
|
1283
1314
|
}
|
|
1284
|
-
async function
|
|
1315
|
+
async function ui(e, t) {
|
|
1285
1316
|
if (!this.token.isLoggedIn) return { error: "not_logged_in" };
|
|
1286
1317
|
let { ok: n, code: r, message: i } = await this.req.post("verify-activation-key", { activation_key: e }, null, {
|
|
1287
1318
|
message: !1,
|
|
@@ -1292,7 +1323,7 @@ async function ei(e, t) {
|
|
|
1292
1323
|
error: r
|
|
1293
1324
|
};
|
|
1294
1325
|
}
|
|
1295
|
-
async function
|
|
1326
|
+
async function di(e, t) {
|
|
1296
1327
|
if (!await this.token.autoLogin()) return {
|
|
1297
1328
|
user_rewards: [],
|
|
1298
1329
|
next_token: ""
|
|
@@ -1301,73 +1332,84 @@ async function ti(e, t) {
|
|
|
1301
1332
|
max_results: 20,
|
|
1302
1333
|
...e,
|
|
1303
1334
|
event_id: this.event
|
|
1304
|
-
}),
|
|
1335
|
+
}), Tr, t);
|
|
1305
1336
|
return {
|
|
1306
1337
|
user_rewards: n?.user_rewards || [],
|
|
1307
1338
|
next_token: n?.next_token || ""
|
|
1308
1339
|
};
|
|
1309
1340
|
}
|
|
1310
|
-
async function
|
|
1341
|
+
async function fi(e, t) {
|
|
1311
1342
|
if (!await this.token.autoLogin()) return { unclaimed: 0 };
|
|
1312
|
-
let { data: n } = await this.req.get("event/user-rewards-count", { ...e },
|
|
1343
|
+
let { data: n } = await this.req.get("event/user-rewards-count", { ...e }, Er, t);
|
|
1313
1344
|
return { unclaimed: n?.unclaimed || 0 };
|
|
1314
1345
|
}
|
|
1315
|
-
async function
|
|
1346
|
+
async function pi(e, t) {
|
|
1316
1347
|
if (!await this.token.autoLogin()) return null;
|
|
1317
1348
|
let { data: n } = await this.req.get(`event/${this.event}/user-item-count`, { item_id: e }, B, t);
|
|
1318
1349
|
return n?.count ?? null;
|
|
1319
1350
|
}
|
|
1320
|
-
async function
|
|
1351
|
+
async function mi(e, t, n) {
|
|
1321
1352
|
if (!await this.token.autoLogin()) return null;
|
|
1322
1353
|
let { data: r, code: i, message: a } = await this.req.post("event/ugc/upload-image", {
|
|
1323
1354
|
feature_id: e,
|
|
1324
1355
|
...t,
|
|
1325
1356
|
event_id: this.event
|
|
1326
|
-
},
|
|
1357
|
+
}, Lr, n);
|
|
1327
1358
|
return r || {
|
|
1328
1359
|
message: a,
|
|
1329
1360
|
error: i
|
|
1330
1361
|
};
|
|
1331
1362
|
}
|
|
1332
|
-
async function
|
|
1363
|
+
async function hi(e, t) {
|
|
1333
1364
|
let { data: n, code: r, message: i } = await this.req.get("event/ugc/recommendation", {
|
|
1334
1365
|
feature_id: e,
|
|
1335
1366
|
event_id: this.event
|
|
1336
|
-
},
|
|
1367
|
+
}, Pr, t);
|
|
1337
1368
|
return n || {
|
|
1338
1369
|
message: i,
|
|
1339
1370
|
error: r
|
|
1340
1371
|
};
|
|
1341
1372
|
}
|
|
1342
|
-
async function
|
|
1373
|
+
async function gi(e, t, n) {
|
|
1343
1374
|
let { data: r, code: i, message: a } = await this.req.get("event/ugc/ugcs", {
|
|
1344
1375
|
event_id: this.event,
|
|
1345
1376
|
feature_id: e,
|
|
1346
1377
|
max_results: 20,
|
|
1347
1378
|
...t
|
|
1348
|
-
},
|
|
1379
|
+
}, Fr, n);
|
|
1349
1380
|
return r || {
|
|
1350
1381
|
message: a,
|
|
1351
1382
|
error: i
|
|
1352
1383
|
};
|
|
1353
1384
|
}
|
|
1354
|
-
async function
|
|
1385
|
+
async function _i(e, t) {
|
|
1355
1386
|
if (!await this.token.autoLogin()) return null;
|
|
1356
1387
|
let { data: n, code: r, message: i } = await this.req.get("event/ugc/leaderboard", {
|
|
1357
1388
|
feature_id: e,
|
|
1358
1389
|
event_id: this.event
|
|
1359
|
-
},
|
|
1390
|
+
}, Rr, t);
|
|
1360
1391
|
return n || {
|
|
1361
1392
|
message: i,
|
|
1362
1393
|
error: r
|
|
1363
1394
|
};
|
|
1364
1395
|
}
|
|
1365
|
-
async function
|
|
1396
|
+
async function vi(e, t) {
|
|
1366
1397
|
if (!await this.token.autoLogin()) return null;
|
|
1367
1398
|
let { data: n, code: r, message: i } = await this.req.get("event/redeem/item-stocks", {
|
|
1368
1399
|
event_id: this.event,
|
|
1369
1400
|
feature_id: e
|
|
1370
|
-
},
|
|
1401
|
+
}, zr, t);
|
|
1402
|
+
return n || {
|
|
1403
|
+
message: i,
|
|
1404
|
+
error: r
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
async function yi(e, t) {
|
|
1408
|
+
if (!await this.token.autoLogin()) return null;
|
|
1409
|
+
let { data: n, code: r, message: i } = await this.req.post("event/referral/rewards", {
|
|
1410
|
+
event_id: this.event,
|
|
1411
|
+
feature_id: e
|
|
1412
|
+
}, Br, t);
|
|
1371
1413
|
return n || {
|
|
1372
1414
|
message: i,
|
|
1373
1415
|
error: r
|
|
@@ -1375,15 +1417,14 @@ async function ci(e, t) {
|
|
|
1375
1417
|
}
|
|
1376
1418
|
//#endregion
|
|
1377
1419
|
//#region src/ggd.enums.ts
|
|
1378
|
-
var
|
|
1420
|
+
var bi = {
|
|
1379
1421
|
Waiting: 1,
|
|
1380
1422
|
Playing: 2
|
|
1381
|
-
},
|
|
1423
|
+
}, xi = f.number().enum(bi).lock(), Si = class {
|
|
1382
1424
|
req;
|
|
1383
1425
|
constructor(e, t) {
|
|
1384
|
-
let n = d(e) ? e : `https://${o(e)}`;
|
|
1385
1426
|
this.req = t({
|
|
1386
|
-
baseURL: `${
|
|
1427
|
+
baseURL: `${oe(e) ? e : `https://${o(e)}`}/v1/ggd`,
|
|
1387
1428
|
timeout: 1e4,
|
|
1388
1429
|
maxRetry: 2,
|
|
1389
1430
|
retryInterval: "2EB",
|
|
@@ -1397,38 +1438,50 @@ var li = {
|
|
|
1397
1438
|
}
|
|
1398
1439
|
});
|
|
1399
1440
|
}
|
|
1400
|
-
async describeRoomByCode(e) {
|
|
1401
|
-
let
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1441
|
+
async describeRoomByCode(e, t, n) {
|
|
1442
|
+
let r = String(n || s("expires_at")), i = e || s("invitation_code"), a = t || s("server_id");
|
|
1443
|
+
if (!i && !a || !/^\d+$/.test(r)) return {
|
|
1444
|
+
error: "invitation_code_invalid",
|
|
1445
|
+
message: "邀请链接无效"
|
|
1446
|
+
};
|
|
1447
|
+
if (r && Date.now() > Number(r) * 1e3) return {
|
|
1448
|
+
error: "invitation_code_expired",
|
|
1449
|
+
message: "邀请链接已过期"
|
|
1450
|
+
};
|
|
1451
|
+
let { data: o, ok: c, code: l, message: u } = await this.req.get("describe-room", {
|
|
1452
|
+
invitation_code: i,
|
|
1453
|
+
server_id: a
|
|
1454
|
+
}, d({
|
|
1455
|
+
room_id: f.string(),
|
|
1456
|
+
inviter_role_id: f.number(),
|
|
1457
|
+
room_status: xi,
|
|
1458
|
+
room_mode: f.string().optional(),
|
|
1459
|
+
room_tags: f.array(f.string()).optional(),
|
|
1460
|
+
max_members: f.number().optional(),
|
|
1461
|
+
members: f.array(f.object({
|
|
1462
|
+
role_id: f.number(),
|
|
1463
|
+
role_name: f.string(),
|
|
1464
|
+
avatar_url: f.string()
|
|
1465
|
+
})).optional()
|
|
1413
1466
|
}), { message: !1 });
|
|
1414
|
-
return
|
|
1415
|
-
error:
|
|
1416
|
-
message:
|
|
1467
|
+
return c && o ? o : {
|
|
1468
|
+
error: l,
|
|
1469
|
+
message: u
|
|
1417
1470
|
};
|
|
1418
1471
|
}
|
|
1419
|
-
},
|
|
1472
|
+
}, Ci = {
|
|
1420
1473
|
All: "all",
|
|
1421
1474
|
Limit: "limit"
|
|
1422
|
-
},
|
|
1475
|
+
}, wi = f.string().enum(Ci).lock(), Ti = {
|
|
1423
1476
|
Pending: "pending",
|
|
1424
1477
|
Approved: "approved",
|
|
1425
1478
|
Failed: "failed",
|
|
1426
1479
|
Suspect: "suspect"
|
|
1427
|
-
}, V =
|
|
1480
|
+
}, V = f.string().enum(Ti).lock(), Ei = {
|
|
1428
1481
|
System: "system",
|
|
1429
1482
|
Comment: "comment",
|
|
1430
1483
|
Like: "like"
|
|
1431
|
-
},
|
|
1484
|
+
}, Di = f.string().enum(Ei).lock(), H = {
|
|
1432
1485
|
System: "system",
|
|
1433
1486
|
PostPinned: "post_pinned",
|
|
1434
1487
|
PostHighlighted: "post_highlighted",
|
|
@@ -1441,188 +1494,188 @@ var li = {
|
|
|
1441
1494
|
ReplyReplied: "reply_replied",
|
|
1442
1495
|
ReplyLiked: "reply_liked",
|
|
1443
1496
|
ReplyDeleted: "reply_deleted"
|
|
1444
|
-
},
|
|
1445
|
-
forum_id:
|
|
1446
|
-
icon_url:
|
|
1447
|
-
name:
|
|
1448
|
-
tags:
|
|
1449
|
-
sort:
|
|
1450
|
-
mode:
|
|
1451
|
-
member_ids:
|
|
1452
|
-
}).lock(), W =
|
|
1453
|
-
topic_id:
|
|
1454
|
-
cover_url:
|
|
1455
|
-
name:
|
|
1456
|
-
description:
|
|
1457
|
-
tags:
|
|
1458
|
-
post_num:
|
|
1459
|
-
}).lock(), G =
|
|
1460
|
-
post_id:
|
|
1497
|
+
}, Oi = f.string().enum(H).lock(), U = f.object({
|
|
1498
|
+
forum_id: f.number(),
|
|
1499
|
+
icon_url: f.string(),
|
|
1500
|
+
name: f.string(),
|
|
1501
|
+
tags: f.array(f.string()),
|
|
1502
|
+
sort: f.number(),
|
|
1503
|
+
mode: wi,
|
|
1504
|
+
member_ids: f.array(f.number())
|
|
1505
|
+
}).lock(), W = f.object({
|
|
1506
|
+
topic_id: f.number(),
|
|
1507
|
+
cover_url: f.string(),
|
|
1508
|
+
name: f.string(),
|
|
1509
|
+
description: f.string(),
|
|
1510
|
+
tags: f.array(f.string()),
|
|
1511
|
+
post_num: f.number()
|
|
1512
|
+
}).lock(), G = f.object({
|
|
1513
|
+
post_id: f.number(),
|
|
1461
1514
|
forum: U,
|
|
1462
|
-
posted_by:
|
|
1463
|
-
nickname:
|
|
1464
|
-
avatar_url:
|
|
1465
|
-
title:
|
|
1466
|
-
content:
|
|
1467
|
-
content_text_count:
|
|
1468
|
-
summary:
|
|
1469
|
-
like_num:
|
|
1470
|
-
comments_num:
|
|
1471
|
-
liked:
|
|
1472
|
-
image_urls:
|
|
1473
|
-
topics:
|
|
1474
|
-
event_ids:
|
|
1475
|
-
is_pinned:
|
|
1476
|
-
is_highlighted:
|
|
1515
|
+
posted_by: f.string(),
|
|
1516
|
+
nickname: f.string(),
|
|
1517
|
+
avatar_url: f.string(),
|
|
1518
|
+
title: f.string().optional(),
|
|
1519
|
+
content: f.string(),
|
|
1520
|
+
content_text_count: f.number(),
|
|
1521
|
+
summary: f.string(),
|
|
1522
|
+
like_num: f.number(),
|
|
1523
|
+
comments_num: f.number(),
|
|
1524
|
+
liked: f.bool(),
|
|
1525
|
+
image_urls: f.array(f.string()),
|
|
1526
|
+
topics: f.array(W),
|
|
1527
|
+
event_ids: f.array(f.number()),
|
|
1528
|
+
is_pinned: f.bool(),
|
|
1529
|
+
is_highlighted: f.bool(),
|
|
1477
1530
|
status: V,
|
|
1478
|
-
create_time:
|
|
1479
|
-
}).lock(), K =
|
|
1480
|
-
reply_id:
|
|
1481
|
-
reply_content:
|
|
1482
|
-
replied_by:
|
|
1483
|
-
nickname:
|
|
1484
|
-
avatar_url:
|
|
1485
|
-
}).lock(), q =
|
|
1486
|
-
reply_id:
|
|
1487
|
-
comment_id:
|
|
1488
|
-
comment_content:
|
|
1489
|
-
commented_by:
|
|
1490
|
-
commented_by_nickname:
|
|
1491
|
-
commented_by_avatar_url:
|
|
1492
|
-
replied_by:
|
|
1493
|
-
nickname:
|
|
1494
|
-
avatar_url:
|
|
1495
|
-
content:
|
|
1496
|
-
like_num:
|
|
1497
|
-
liked:
|
|
1498
|
-
reply_to:
|
|
1499
|
-
create_time:
|
|
1500
|
-
}).lock(), J =
|
|
1501
|
-
comment_id:
|
|
1502
|
-
post_id:
|
|
1503
|
-
post_subject:
|
|
1504
|
-
post_summary:
|
|
1505
|
-
post_image_url:
|
|
1506
|
-
posted_by:
|
|
1507
|
-
posted_by_nickname:
|
|
1508
|
-
posted_by_avatar_url:
|
|
1509
|
-
commented_by:
|
|
1510
|
-
nickname:
|
|
1511
|
-
avatar_url:
|
|
1512
|
-
content:
|
|
1513
|
-
like_num:
|
|
1514
|
-
reply_num:
|
|
1515
|
-
liked:
|
|
1516
|
-
image_url:
|
|
1517
|
-
create_time:
|
|
1531
|
+
create_time: f.number()
|
|
1532
|
+
}).lock(), K = f.object({ err_msg: f.string().optional() }).optional().lock(), ki = f.object({
|
|
1533
|
+
reply_id: f.number(),
|
|
1534
|
+
reply_content: f.string().optional(),
|
|
1535
|
+
replied_by: f.string(),
|
|
1536
|
+
nickname: f.string(),
|
|
1537
|
+
avatar_url: f.string()
|
|
1538
|
+
}).lock(), q = f.object({
|
|
1539
|
+
reply_id: f.number(),
|
|
1540
|
+
comment_id: f.number(),
|
|
1541
|
+
comment_content: f.string().optional(),
|
|
1542
|
+
commented_by: f.string().optional(),
|
|
1543
|
+
commented_by_nickname: f.string().optional(),
|
|
1544
|
+
commented_by_avatar_url: f.string().optional(),
|
|
1545
|
+
replied_by: f.string(),
|
|
1546
|
+
nickname: f.string(),
|
|
1547
|
+
avatar_url: f.string(),
|
|
1548
|
+
content: f.string(),
|
|
1549
|
+
like_num: f.number(),
|
|
1550
|
+
liked: f.bool(),
|
|
1551
|
+
reply_to: ki,
|
|
1552
|
+
create_time: f.number()
|
|
1553
|
+
}).lock(), J = f.object({
|
|
1554
|
+
comment_id: f.number(),
|
|
1555
|
+
post_id: f.number(),
|
|
1556
|
+
post_subject: f.string().optional(),
|
|
1557
|
+
post_summary: f.string().optional(),
|
|
1558
|
+
post_image_url: f.string().optional(),
|
|
1559
|
+
posted_by: f.string().optional(),
|
|
1560
|
+
posted_by_nickname: f.string().optional(),
|
|
1561
|
+
posted_by_avatar_url: f.string().optional(),
|
|
1562
|
+
commented_by: f.string(),
|
|
1563
|
+
nickname: f.string(),
|
|
1564
|
+
avatar_url: f.string(),
|
|
1565
|
+
content: f.string(),
|
|
1566
|
+
like_num: f.number(),
|
|
1567
|
+
reply_num: f.number(),
|
|
1568
|
+
liked: f.bool(),
|
|
1569
|
+
image_url: f.string(),
|
|
1570
|
+
create_time: f.number(),
|
|
1518
1571
|
status: V,
|
|
1519
|
-
replies:
|
|
1520
|
-
}).lock(),
|
|
1521
|
-
image_url:
|
|
1522
|
-
upload_url:
|
|
1523
|
-
existed:
|
|
1524
|
-
}).lock(), Y =
|
|
1525
|
-
notification_id:
|
|
1526
|
-
notification_type:
|
|
1527
|
-
is_read:
|
|
1528
|
-
create_time:
|
|
1529
|
-
origin_user_id:
|
|
1530
|
-
origin_user_name:
|
|
1531
|
-
origin_user_avatar_url:
|
|
1532
|
-
}).lock(),
|
|
1533
|
-
system_message_subject:
|
|
1534
|
-
system_message_content:
|
|
1535
|
-
}).lock(), X =
|
|
1536
|
-
post_id:
|
|
1537
|
-
post_subject:
|
|
1538
|
-
post_summary:
|
|
1539
|
-
post_image_url:
|
|
1540
|
-
}).lock(), Z =
|
|
1541
|
-
comment_id:
|
|
1542
|
-
comment_content:
|
|
1543
|
-
}).lock(), Q =
|
|
1544
|
-
reply_id:
|
|
1545
|
-
reply_content:
|
|
1546
|
-
}).lock(),
|
|
1572
|
+
replies: f.array(q).optional()
|
|
1573
|
+
}).lock(), Ai = f.object({
|
|
1574
|
+
image_url: f.string(),
|
|
1575
|
+
upload_url: f.string(),
|
|
1576
|
+
existed: f.bool()
|
|
1577
|
+
}).lock(), Y = f.object({
|
|
1578
|
+
notification_id: f.string(),
|
|
1579
|
+
notification_type: Oi,
|
|
1580
|
+
is_read: f.bool(),
|
|
1581
|
+
create_time: f.number(),
|
|
1582
|
+
origin_user_id: f.string(),
|
|
1583
|
+
origin_user_name: f.string(),
|
|
1584
|
+
origin_user_avatar_url: f.string()
|
|
1585
|
+
}).lock(), ji = f.object({
|
|
1586
|
+
system_message_subject: f.string(),
|
|
1587
|
+
system_message_content: f.string()
|
|
1588
|
+
}).lock(), X = f.object({
|
|
1589
|
+
post_id: f.number(),
|
|
1590
|
+
post_subject: f.string(),
|
|
1591
|
+
post_summary: f.string(),
|
|
1592
|
+
post_image_url: f.string()
|
|
1593
|
+
}).lock(), Z = f.object({
|
|
1594
|
+
comment_id: f.number(),
|
|
1595
|
+
comment_content: f.string()
|
|
1596
|
+
}).lock(), Q = f.object({
|
|
1597
|
+
reply_id: f.number(),
|
|
1598
|
+
reply_content: f.string()
|
|
1599
|
+
}).lock(), Mi = f.object({
|
|
1547
1600
|
...Y.shape,
|
|
1548
|
-
...
|
|
1549
|
-
notification_type:
|
|
1550
|
-
}),
|
|
1601
|
+
...ji.shape,
|
|
1602
|
+
notification_type: f.string().enum(H.System)
|
|
1603
|
+
}), Ni = f.object({
|
|
1551
1604
|
...Y.shape,
|
|
1552
1605
|
...X.shape,
|
|
1553
|
-
notification_type:
|
|
1554
|
-
}),
|
|
1606
|
+
notification_type: f.string().enum(H.PostPinned, H.PostHighlighted, H.PostDeleted, H.PostLiked)
|
|
1607
|
+
}), Pi = f.object({
|
|
1555
1608
|
...Y.shape,
|
|
1556
1609
|
...X.shape,
|
|
1557
1610
|
...Z.shape,
|
|
1558
|
-
notification_type:
|
|
1559
|
-
}),
|
|
1611
|
+
notification_type: f.string().enum(H.PostCommented)
|
|
1612
|
+
}), Fi = f.object({
|
|
1560
1613
|
...Y.shape,
|
|
1561
1614
|
...Z.shape,
|
|
1562
1615
|
...Q.shape,
|
|
1563
|
-
notification_type:
|
|
1564
|
-
}),
|
|
1616
|
+
notification_type: f.string().enum(H.CommentReplied)
|
|
1617
|
+
}), Ii = f.object({
|
|
1565
1618
|
...Y.shape,
|
|
1566
1619
|
...Z.shape,
|
|
1567
1620
|
...X.shape,
|
|
1568
|
-
notification_type:
|
|
1569
|
-
}),
|
|
1621
|
+
notification_type: f.string().enum(H.CommentLiked, H.CommentDeleted)
|
|
1622
|
+
}), Li = f.object({
|
|
1570
1623
|
...Y.shape,
|
|
1571
1624
|
...Q.shape,
|
|
1572
|
-
notification_type:
|
|
1573
|
-
comment_id:
|
|
1574
|
-
reply_to_reply_id:
|
|
1575
|
-
reply_to_reply_content:
|
|
1576
|
-
}),
|
|
1625
|
+
notification_type: f.string().enum(H.ReplyReplied),
|
|
1626
|
+
comment_id: f.number(),
|
|
1627
|
+
reply_to_reply_id: f.number(),
|
|
1628
|
+
reply_to_reply_content: f.string()
|
|
1629
|
+
}), Ri = f.object({
|
|
1577
1630
|
...Y.shape,
|
|
1578
1631
|
...Q.shape,
|
|
1579
1632
|
...Z.shape,
|
|
1580
|
-
notification_type:
|
|
1581
|
-
}),
|
|
1582
|
-
posts:
|
|
1583
|
-
next_token:
|
|
1584
|
-
}),
|
|
1633
|
+
notification_type: f.string().enum(H.ReplyLiked, H.ReplyDeleted)
|
|
1634
|
+
}), zi = f.union(Mi, Ni, Pi, Fi, Ii, Li, Ri).satisfies().lock(), Bi = d({ forums: f.array(U) }), Vi = d({ topics: f.array(W) }), Hi = d({ topic: W }), Ui = d({ post: G }), Wi = d({
|
|
1635
|
+
posts: f.array(G),
|
|
1636
|
+
next_token: f.string().optional()
|
|
1637
|
+
}), Gi = d({
|
|
1585
1638
|
post: G.clone().optional(),
|
|
1586
1639
|
antispam: K.clone().optional()
|
|
1587
|
-
}),
|
|
1588
|
-
replies:
|
|
1589
|
-
next_token:
|
|
1590
|
-
}),
|
|
1640
|
+
}), Ki = d({
|
|
1641
|
+
replies: f.array(q),
|
|
1642
|
+
next_token: f.string().optional()
|
|
1643
|
+
}), qi = d({ reply: q }), Ji = d({
|
|
1591
1644
|
reply: q.clone().optional(),
|
|
1592
1645
|
antispam: K.clone().optional()
|
|
1593
|
-
}),
|
|
1594
|
-
comments:
|
|
1595
|
-
next_token:
|
|
1596
|
-
}),
|
|
1646
|
+
}), Yi = d({ comment: J }), Xi = d({
|
|
1647
|
+
comments: f.array(J),
|
|
1648
|
+
next_token: f.string().optional()
|
|
1649
|
+
}), Zi = d({
|
|
1597
1650
|
comment: J.clone().optional(),
|
|
1598
1651
|
antispam: J.clone().optional()
|
|
1599
|
-
}),
|
|
1600
|
-
notifications:
|
|
1601
|
-
next_token:
|
|
1602
|
-
}),
|
|
1603
|
-
system:
|
|
1604
|
-
comment:
|
|
1605
|
-
like:
|
|
1606
|
-
}),
|
|
1652
|
+
}), Qi = f.guard(Ai), $i = d({
|
|
1653
|
+
notifications: f.array(zi),
|
|
1654
|
+
next_token: f.string().optional()
|
|
1655
|
+
}), ea = d({
|
|
1656
|
+
system: f.number(),
|
|
1657
|
+
comment: f.number(),
|
|
1658
|
+
like: f.number()
|
|
1659
|
+
}), ta = class {
|
|
1607
1660
|
token;
|
|
1608
1661
|
req;
|
|
1609
1662
|
constructor(e) {
|
|
1610
1663
|
this.token = e, this.req = e.req;
|
|
1611
1664
|
}
|
|
1612
1665
|
async getForums(e) {
|
|
1613
|
-
let { data: t } = await this.req.get("community/forums", null,
|
|
1666
|
+
let { data: t } = await this.req.get("community/forums", null, Bi, e);
|
|
1614
1667
|
return t?.forums || [];
|
|
1615
1668
|
}
|
|
1616
1669
|
async getTopics(e) {
|
|
1617
|
-
let { data: t } = await this.req.get("community/topics", null,
|
|
1670
|
+
let { data: t } = await this.req.get("community/topics", null, Vi, e);
|
|
1618
1671
|
return t?.topics || [];
|
|
1619
1672
|
}
|
|
1620
1673
|
async getTopic(e, t) {
|
|
1621
|
-
let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e },
|
|
1674
|
+
let { data: n, code: r } = await this.req.get("community/topic", { topic_id: e }, Hi, t);
|
|
1622
1675
|
return n?.topic ?? { error: r };
|
|
1623
1676
|
}
|
|
1624
1677
|
async getPosts(e, t) {
|
|
1625
|
-
let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null,
|
|
1678
|
+
let { data: n, code: r, message: i } = await this.req.get("community/posts", e || null, Wi, t);
|
|
1626
1679
|
return n ?? {
|
|
1627
1680
|
message: i,
|
|
1628
1681
|
error: r
|
|
@@ -1633,35 +1686,35 @@ var li = {
|
|
|
1633
1686
|
forum_id: e,
|
|
1634
1687
|
max_results: t,
|
|
1635
1688
|
next_token: n
|
|
1636
|
-
},
|
|
1689
|
+
}, Wi, r);
|
|
1637
1690
|
return i ?? {
|
|
1638
1691
|
message: o,
|
|
1639
1692
|
error: a
|
|
1640
1693
|
};
|
|
1641
1694
|
}
|
|
1642
1695
|
async getPost(e, t) {
|
|
1643
|
-
let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e },
|
|
1696
|
+
let { data: n, code: r, message: i } = await this.req.get("community/post", { post_id: e }, Ui, t);
|
|
1644
1697
|
return n?.post ?? {
|
|
1645
1698
|
message: i,
|
|
1646
1699
|
error: r
|
|
1647
1700
|
};
|
|
1648
1701
|
}
|
|
1649
1702
|
async post(e, t) {
|
|
1650
|
-
let { data: n, code: r, message: i } = await this.req.post("community/post", a(e),
|
|
1703
|
+
let { data: n, code: r, message: i } = await this.req.post("community/post", a(e), Gi, t);
|
|
1651
1704
|
return n ?? {
|
|
1652
1705
|
message: i,
|
|
1653
1706
|
error: r
|
|
1654
1707
|
};
|
|
1655
1708
|
}
|
|
1656
1709
|
async getComments(e, t) {
|
|
1657
|
-
let { data: n, code: r, message: i } = await this.req.get("community/comments", e,
|
|
1710
|
+
let { data: n, code: r, message: i } = await this.req.get("community/comments", e, Xi, t);
|
|
1658
1711
|
return n ?? {
|
|
1659
1712
|
message: i,
|
|
1660
1713
|
error: r
|
|
1661
1714
|
};
|
|
1662
1715
|
}
|
|
1663
1716
|
async getComment(e, t) {
|
|
1664
|
-
let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e },
|
|
1717
|
+
let { data: n, code: r, message: i } = await this.req.get("community/comment", { comment_id: e }, Yi, t);
|
|
1665
1718
|
return n?.comment ?? {
|
|
1666
1719
|
message: i,
|
|
1667
1720
|
error: r
|
|
@@ -1669,7 +1722,7 @@ var li = {
|
|
|
1669
1722
|
}
|
|
1670
1723
|
async comment(e, t) {
|
|
1671
1724
|
await this.token.autoLogin();
|
|
1672
|
-
let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e),
|
|
1725
|
+
let { data: n, code: r, message: i } = await this.req.post("community/comment", a(e), Zi, t);
|
|
1673
1726
|
return n ?? {
|
|
1674
1727
|
message: i,
|
|
1675
1728
|
error: r
|
|
@@ -1679,14 +1732,14 @@ var li = {
|
|
|
1679
1732
|
let { data: n } = await this.req.get("community/replies", {
|
|
1680
1733
|
max_results: 20,
|
|
1681
1734
|
...e
|
|
1682
|
-
},
|
|
1735
|
+
}, Ki, t);
|
|
1683
1736
|
return {
|
|
1684
1737
|
replies: n?.replies || [],
|
|
1685
1738
|
next_token: n?.next_token || ""
|
|
1686
1739
|
};
|
|
1687
1740
|
}
|
|
1688
1741
|
async getReply(e, t) {
|
|
1689
|
-
let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e },
|
|
1742
|
+
let { data: n, code: r, message: i } = await this.req.get("community/reply", { reply_id: e }, qi, t);
|
|
1690
1743
|
return n?.reply ?? {
|
|
1691
1744
|
message: i,
|
|
1692
1745
|
error: r
|
|
@@ -1694,7 +1747,7 @@ var li = {
|
|
|
1694
1747
|
}
|
|
1695
1748
|
async reply(e, t) {
|
|
1696
1749
|
await this.token.autoLogin();
|
|
1697
|
-
let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e),
|
|
1750
|
+
let { data: n, code: r, message: i } = await this.req.post("community/reply", a(e), Ji, t);
|
|
1698
1751
|
return n ?? {
|
|
1699
1752
|
message: i,
|
|
1700
1753
|
error: r
|
|
@@ -1724,7 +1777,7 @@ var li = {
|
|
|
1724
1777
|
}
|
|
1725
1778
|
async getMediaPresignedUrl(e, t) {
|
|
1726
1779
|
await this.token.autoLogin();
|
|
1727
|
-
let { data: n } = await this.req.get("community/media-presign-url", e,
|
|
1780
|
+
let { data: n } = await this.req.get("community/media-presign-url", e, Qi, t);
|
|
1728
1781
|
return n;
|
|
1729
1782
|
}
|
|
1730
1783
|
async getNotifications(e, t) {
|
|
@@ -1732,7 +1785,7 @@ var li = {
|
|
|
1732
1785
|
let { data: n } = await this.req.get("community/notifications", {
|
|
1733
1786
|
max_results: 20,
|
|
1734
1787
|
...e
|
|
1735
|
-
},
|
|
1788
|
+
}, $i, t);
|
|
1736
1789
|
return {
|
|
1737
1790
|
notifications: n?.notifications || [],
|
|
1738
1791
|
next_token: n?.next_token || ""
|
|
@@ -1740,7 +1793,7 @@ var li = {
|
|
|
1740
1793
|
}
|
|
1741
1794
|
async getUnreadNotificationsCount(e) {
|
|
1742
1795
|
if (!await this.token.autoLogin()) return null;
|
|
1743
|
-
let { data: t } = await this.req.get("community/unread-notifications-count", null,
|
|
1796
|
+
let { data: t } = await this.req.get("community/unread-notifications-count", null, ea, e);
|
|
1744
1797
|
return t;
|
|
1745
1798
|
}
|
|
1746
1799
|
async clearUnreadNotifications(e, t) {
|
|
@@ -1748,11 +1801,11 @@ var li = {
|
|
|
1748
1801
|
let { ok: n } = await this.req.post("community/clear-unread-notifications", { category: e }, null, t);
|
|
1749
1802
|
return n;
|
|
1750
1803
|
}
|
|
1751
|
-
},
|
|
1752
|
-
nonce_str:
|
|
1753
|
-
timestamp:
|
|
1754
|
-
signature:
|
|
1755
|
-
}),
|
|
1804
|
+
}, na = d({
|
|
1805
|
+
nonce_str: f.string(),
|
|
1806
|
+
timestamp: f.number(),
|
|
1807
|
+
signature: f.string()
|
|
1808
|
+
}), ra = /* @__PURE__ */ function(e) {
|
|
1756
1809
|
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;
|
|
1757
1810
|
}({});
|
|
1758
1811
|
//#endregion
|
|
@@ -1762,7 +1815,7 @@ function $(e) {
|
|
|
1762
1815
|
}
|
|
1763
1816
|
//#endregion
|
|
1764
1817
|
//#region src/weixin.ts
|
|
1765
|
-
var
|
|
1818
|
+
var ia = "wx_login_cache", aa = class {
|
|
1766
1819
|
token;
|
|
1767
1820
|
_appid;
|
|
1768
1821
|
req;
|
|
@@ -1773,23 +1826,23 @@ var qi = "wx_login_cache", Ji = class {
|
|
|
1773
1826
|
return this._appid;
|
|
1774
1827
|
}
|
|
1775
1828
|
async getLoginCache() {
|
|
1776
|
-
let e = this.token.storage.get(
|
|
1829
|
+
let e = this.token.storage.get(ia);
|
|
1777
1830
|
if (!e) return null;
|
|
1778
1831
|
let t = i(e);
|
|
1779
1832
|
return $(t) ? (this.token.weixinToken = t.weixin_token, await this.token.autoLogin(), t) : null;
|
|
1780
1833
|
}
|
|
1781
1834
|
async login(e) {
|
|
1782
|
-
if (!
|
|
1835
|
+
if (!u()) throw Error("当前环境非微信小程序");
|
|
1783
1836
|
let t = await this.getLoginCache();
|
|
1784
1837
|
if (t) return t;
|
|
1785
|
-
let n = await
|
|
1838
|
+
let n = await se(), { data: r, code: i, message: a } = await this.req.post("weixin/login", {
|
|
1786
1839
|
code: n,
|
|
1787
1840
|
appid: this.appid
|
|
1788
1841
|
}, $, {
|
|
1789
1842
|
...e,
|
|
1790
1843
|
message: !1
|
|
1791
1844
|
});
|
|
1792
|
-
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(
|
|
1845
|
+
return r && (this.token.weixinToken = r.weixin_token, this.token.storage.set(ia, JSON.stringify(r))), r ?? {
|
|
1793
1846
|
message: a,
|
|
1794
1847
|
error: i
|
|
1795
1848
|
};
|
|
@@ -1797,7 +1850,7 @@ var qi = "wx_login_cache", Ji = class {
|
|
|
1797
1850
|
async webLogin(e = "snsapi_userinfo", t) {
|
|
1798
1851
|
let n = s("code"), r = Date.now(), i = +s("state");
|
|
1799
1852
|
if (!n || !i || i < r - 1e3 * 60 * 5 || i > r) {
|
|
1800
|
-
let t =
|
|
1853
|
+
let t = c(["code", "state"]);
|
|
1801
1854
|
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`);
|
|
1802
1855
|
return;
|
|
1803
1856
|
}
|
|
@@ -1805,15 +1858,15 @@ var qi = "wx_login_cache", Ji = class {
|
|
|
1805
1858
|
message: "Error: " + n,
|
|
1806
1859
|
error: n
|
|
1807
1860
|
};
|
|
1808
|
-
let a =
|
|
1861
|
+
let a = c(["code", "state"]);
|
|
1809
1862
|
"replaceState" in history && history.replaceState({}, "", a);
|
|
1810
|
-
let { data: o, code:
|
|
1863
|
+
let { data: o, code: l, message: u } = await this.req.post("weixin/login", {
|
|
1811
1864
|
code: n,
|
|
1812
1865
|
appid: this.appid
|
|
1813
1866
|
}, $, t);
|
|
1814
1867
|
return o && (this.token.weixinToken = o.weixin_token, await this.token.autoLogin()), o ?? {
|
|
1815
|
-
message:
|
|
1816
|
-
error:
|
|
1868
|
+
message: u,
|
|
1869
|
+
error: l
|
|
1817
1870
|
};
|
|
1818
1871
|
}
|
|
1819
1872
|
async linkPlayer(e, t, n) {
|
|
@@ -1831,7 +1884,7 @@ var qi = "wx_login_cache", Ji = class {
|
|
|
1831
1884
|
let { data: t } = await this.req.get("weixin/offiaccount/jssdk-sign", {
|
|
1832
1885
|
appid: this.appid,
|
|
1833
1886
|
url: location.href.split("#")[0]
|
|
1834
|
-
},
|
|
1887
|
+
}, na, e);
|
|
1835
1888
|
return t ? {
|
|
1836
1889
|
appid: this.appid,
|
|
1837
1890
|
nonceStr: t.nonce_str,
|
|
@@ -1841,4 +1894,4 @@ var qi = "wx_login_cache", Ji = class {
|
|
|
1841
1894
|
}
|
|
1842
1895
|
};
|
|
1843
1896
|
//#endregion
|
|
1844
|
-
export { K as AntispamValidator,
|
|
1897
|
+
export { K as AntispamValidator, ce as AuthToken, jn as CandidateVoteValidator, I as CashbackEngagementDataValidator, Qt as ClaimActivationKeyEngagementDataValidator, $e as ClaimRewardStatus, k as ClaimRewardStatusValidator, or as ClaimedItemValidator, _ as ClubAddressValidator, He as ClubApi, v as ClubBenefitSummaryValidator, Te as ClubBenefitValidator, pe as ClubCreditChangeScene, me as ClubCreditChangeSceneValidator, de as ClubCreditChangeType, fe as ClubCreditChangeTypeValidator, we as ClubCreditLogValidator, ve as ClubGlobalConfigValidator, he as ClubItemType, m as ClubItemTypeValidator, ye as ClubPlayerValidator, y as ClubProductValidator, ge as ClubRedemptionStatus, _e as ClubRedemptionStatusValidator, Ce as ClubUserCreditValidator, Se as ClubUserProfileValidator, Pn as CommentEngagementValidator, J as CommentValidator, ta as CommunityApi, Mn as ConversationValidator, Ge as EngageAccountType, Ke as EngageAccountTypeValidator, ar as EngageResponseValidator, Fn as EngageRewardValidator, Ue as EventApi, pr as EventConfigValidator, xt as EventFeatureConfigOfCashbackValidator, Ct as EventFeatureConfigOfCheckInValidator, Tt as EventFeatureConfigOfClaimActivationKeyValidator, Dt as EventFeatureConfigOfClaimRewardsValidator, kt as EventFeatureConfigOfCommentValidator, jt as EventFeatureConfigOfFollowValidator, Pt as EventFeatureConfigOfGiftCodeValidator, It as EventFeatureConfigOfInviteValidator, Rt as EventFeatureConfigOfInvitedRegisterValidator, Wt as EventFeatureConfigOfLotteryDrawValidator, Ht as EventFeatureConfigOfLotteryValidator, Kt as EventFeatureConfigOfPreregisterValidator, Jt as EventFeatureConfigOfQuestValidator, Zt as EventFeatureConfigOfRedeemValidator, zn as EventFeatureConfigOfReferralValidator, Vn as EventFeatureConfigOfRegisterValidator, Un as EventFeatureConfigOfShareValidator, Gn as EventFeatureConfigOfSubscribeValidator, qn as EventFeatureConfigOfSurveyValidator, Yn as EventFeatureConfigOfTeamValidator, $n as EventFeatureConfigOfUgcLikeValidator, Zn as EventFeatureConfigOfUgcValidator, lr as EventFeatureConfigOfVote2Validator, nr as EventFeatureConfigOfVoteValidator, fr as EventFeatureConfigValidator, qe as EventPeriodType, Je as EventPeriodTypeValidator, N as EventRewardItemConfigValidator, Oe as ExtraGameRewardValidator, De as ExtraPhysicalShipmentValidator, Xt as FeatureRedeemItemConfigValidator, Rn as FeatureReferralTierItemValidator, yt as FeatureRewardValidator, T as FeatureType, Ye as FeatureTypeValidator, Ci as ForumMode, wi as ForumModeValidator, U as ForumValidator, Si as GGDPublicApi, bi as GGDRoomStatus, xi as GGDRoomStatusValidator, S as GamerItemType, C as GamerItemTypeValidator, le as Gender, ue as GenderValidator, hn as GenerateReferralRewardsResponseValidator, $t as GiftCodeEngagementDataValidator, en as InviteEngagementDataValidator, ct as LotteryDrawAction, lt as LotteryDrawActionValidator, an as LotteryDrawEngagementDataValidator, tn as LotteryEngagementDataValidator, j as LotteryTicketStatus, rt as LotteryTicketStatusValidator, Y as NotificationBaseValidator, Ei as NotificationCategory, Di as NotificationCategoryValidator, Fi as NotificationCommentReplyValidator, Ii as NotificationCommentValidator, Z as NotificationPayloadCommentValidator, X as NotificationPayloadPostValidator, Q as NotificationPayloadReplyValidator, ji as NotificationPayloadSystemValidator, Pi as NotificationPostCommentValidator, Ni as NotificationPostValidator, Li as NotificationReplyRepliedValidator, Ri as NotificationReplyValidator, Mi as NotificationSystemValidator, H as NotificationType, Oi as NotificationTypeValidator, zi as NotificationValidator, xe as PlayerRoleCardValidator, g as PlayerRoleValidator, Ti as PostStatus, V as PostStatusValidator, G as PostValidator, on as PreregisterEngagementDataValidator, Ai as PresignedUrlResponseValidator, cn as QuestEngagementDataValidator, Xe as QuestObjective, E as QuestObjectiveValidator, ut as QuestProgressAlgorithm, dt as QuestProgressAlgorithmValidator, ln as QuestProgressValidator, un as RedeemEngagementDataValidator, Ee as RedeemParamsValidator, dn as RedeemStocksResponseValidator, ke as RedemptionValidator, ot as ReferralAction, st as ReferralActionValidator, pn as ReferralEngagementDataValidator, fn as ReferralInviteValidator, mn as ReferralTierStatusValidator, vt as RegularRewardValidator, ki as ReplyToValidator, q as ReplyValidator, We as RewardItemType, w as RewardItemTypeValidator, et as RewardSource, A as RewardSourceValidator, D as RewardStatus, O as RewardStatusValidator, z as RewardValidator, be as RoleBaseInfoValidator, h as ServerBaseInfoValidator, gn as ShareEngagementDataValidator, vn as SurveyEngagementDataValidator, it as TeamAction, at as TeamActionValidator, xn as TeamEngagementDataValidator, yn as TeamEngagementValidator, bn as TeamMemberValidator, tt as TeamVisibility, nt as TeamVisibilityValidator, W as TopicValidator, Tn as UgcCountResponseValidator, Sn as UgcEngagementDataValidator, Dn as UgcLeaderboardResponseValidator, Cn as UgcRecordBaseResponseValidator, wn as UgcRecordResponseValidator, ht as UgcReviewStatus, gt as UgcReviewStatusValidator, mt as UgcSocialMedia, M as UgcSocialMediaValidator, En as UgcUploadImageValidator, R as UserEngagementDataValidator, In as UserEngagementValidator, ir as UserFeatureStatusValidator, L as UserRewardValidator, rr as VerifyMobileResultValidator, An as Vote2ClaimRewardsResponseValidator, kn as Vote2EngagementDataValidator, ft as Vote2RewardType, pt as Vote2RewardTypeValidator, On as VoteEngagementDataValidator, Ze as VoteOptionSource, Qe as VoteOptionSourceValidator, aa as WeixinApi, _n as WeixinSubscribeEngagementDataValidator, ra as WeixinWebLoginErrorCode, Nn as ZeroChatGPTDataValidator, Zr as claimRewards, ci as claimRewardsV2, li as claimWeixinHongbao, Xr as engage, yi as generateReferralRewards, ti as generateUnlimitQrcode, ai as getCashbackQuery, Hr as getConfig, Gr as getEngagements, Wr as getEngagementsCount, Ur as getEngagementsUserCount, ei as getParamsByQrcodeScene, ni as getQuestProgress, vi as getRedeemItemStocks, _i as getUgcLeaderboard, si as getUgcMyCount, hi as getUgcRecommendation, oi as getUgcRecord, gi as getUgcs, $r as getUnlimitQrcodeScene, Jr as getUserEngagementCount, Yr as getUserEngagements, qr as getUserFeatureStatus, pi as getUserItemCount, di as getUserRewards, fi as getUserRewardsCount, ii as getVote2Leaderboard, na as isWeixinSignResponse, Qr as submitUserRewardAddress, mi as ugcUploadImage, ui as verifyActivationKey, Vr as verifyMobileAllowed, Kr as visit, ri as vote2Rewards };
|