@seayoo-web/gamer-api 4.3.3 → 4.3.4
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 +140 -140
- package/package.json +3 -3
- package/types/src/event.config/feature.referral.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -12,10 +12,10 @@ function ae(e) {
|
|
|
12
12
|
return t(e);
|
|
13
13
|
}
|
|
14
14
|
ee("GamerApiSDK");
|
|
15
|
-
function
|
|
15
|
+
function p(e) {
|
|
16
16
|
return /^\/[a-z\d-]+$/.test(e);
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
18
|
+
async function oe() {
|
|
19
19
|
let { promise: e, resolve: t } = te();
|
|
20
20
|
return wx.login({
|
|
21
21
|
success(e) {
|
|
@@ -28,7 +28,7 @@ async function se() {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/token.ts
|
|
31
|
-
var
|
|
31
|
+
var m = "gamer_token", se = class {
|
|
32
32
|
_NetRequest;
|
|
33
33
|
_idToken = "";
|
|
34
34
|
_weixinToken = "";
|
|
@@ -37,7 +37,7 @@ var p = "gamer_token", ce = class {
|
|
|
37
37
|
storage;
|
|
38
38
|
constructor(t, r) {
|
|
39
39
|
this.storage = u() ? ne : n;
|
|
40
|
-
let i =
|
|
40
|
+
let i = p(t) ? t : `https://${o(t)}`;
|
|
41
41
|
if (this._NetRequest = r, this.req = r({
|
|
42
42
|
baseURL: `${i}/v1`,
|
|
43
43
|
timeout: 1e4,
|
|
@@ -64,7 +64,7 @@ var p = "gamer_token", ce = class {
|
|
|
64
64
|
return this._NetRequest;
|
|
65
65
|
}
|
|
66
66
|
loadGamerTokenCache() {
|
|
67
|
-
let e = this.storage.get(
|
|
67
|
+
let e = this.storage.get(m).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 p = "gamer_token", ce = class {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
this.storage.remove(
|
|
75
|
+
this.storage.remove(m);
|
|
76
76
|
}
|
|
77
77
|
get isLoggedIn() {
|
|
78
78
|
return this._gamerToken !== "";
|
|
@@ -93,7 +93,7 @@ var p = "gamer_token", ce = 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(m, `${Date.now()}#${e}`) : this.storage.remove(m);
|
|
97
97
|
}
|
|
98
98
|
logout() {
|
|
99
99
|
this._idToken = "", this._weixinToken = "", this.gamerToken = "";
|
|
@@ -142,30 +142,30 @@ var p = "gamer_token", ce = class {
|
|
|
142
142
|
let { data: t } = await this.req.post("auth-real-name", a(e), ae);
|
|
143
143
|
return t;
|
|
144
144
|
}
|
|
145
|
-
},
|
|
145
|
+
}, ce = {
|
|
146
146
|
Unknown: "unknown",
|
|
147
147
|
Male: "male",
|
|
148
148
|
Female: "female"
|
|
149
|
-
},
|
|
149
|
+
}, le = f.string().enum(ce).lock(), ue = {
|
|
150
150
|
Increase: "increase",
|
|
151
151
|
Decrease: "decrease",
|
|
152
152
|
Expired: "expired"
|
|
153
|
-
},
|
|
153
|
+
}, de = f.string().enum(ue).lock(), fe = {
|
|
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
|
+
}, pe = f.string().enum(fe).lock(), me = {
|
|
161
161
|
GameReward: "game_reward",
|
|
162
162
|
Physical: "physical",
|
|
163
163
|
Virtual: "virtual"
|
|
164
|
-
},
|
|
164
|
+
}, h = f.string().enum(me).lock(), he = {
|
|
165
165
|
Pending: "pending",
|
|
166
166
|
Issued: "issued",
|
|
167
167
|
Failed: "failed"
|
|
168
|
-
},
|
|
168
|
+
}, ge = f.string().enum(he).lock(), _e = f.object({
|
|
169
169
|
default_avatar_url: f.string(),
|
|
170
170
|
official_avatar_urls: f.array(f.string()),
|
|
171
171
|
default_nickname: f.string(),
|
|
@@ -181,7 +181,7 @@ var p = "gamer_token", ce = class {
|
|
|
181
181
|
exp_description: f.string(),
|
|
182
182
|
credit_description: f.string(),
|
|
183
183
|
send_role_mail_rate_limit: f.number()
|
|
184
|
-
}).lock(),
|
|
184
|
+
}).lock(), ve = f.object({
|
|
185
185
|
member_id: f.string(),
|
|
186
186
|
player_id: f.string(),
|
|
187
187
|
exp: f.number(),
|
|
@@ -190,7 +190,7 @@ var p = "gamer_token", ce = class {
|
|
|
190
190
|
credit_expiring: f.number(),
|
|
191
191
|
level_change_time: f.number(),
|
|
192
192
|
level_expire_time: f.number()
|
|
193
|
-
}).lock(),
|
|
193
|
+
}).lock(), ye = f.object({
|
|
194
194
|
server_id: f.string(),
|
|
195
195
|
server_name: f.string()
|
|
196
196
|
}).lock(), be = f.object({
|
|
@@ -198,7 +198,7 @@ var p = "gamer_token", ce = class {
|
|
|
198
198
|
role_name: f.string()
|
|
199
199
|
}).lock(), g = f.object({
|
|
200
200
|
...be.shape,
|
|
201
|
-
...
|
|
201
|
+
...ye.shape,
|
|
202
202
|
role_level: f.number(),
|
|
203
203
|
last_login_time: f.number()
|
|
204
204
|
}).lock(), xe = f.object({
|
|
@@ -211,7 +211,7 @@ var p = "gamer_token", ce = class {
|
|
|
211
211
|
name: f.string(),
|
|
212
212
|
avatar_url: f.string(),
|
|
213
213
|
bio: f.string(),
|
|
214
|
-
gender:
|
|
214
|
+
gender: le,
|
|
215
215
|
birthday: f.object({
|
|
216
216
|
year: f.number(),
|
|
217
217
|
month: f.number(),
|
|
@@ -237,8 +237,8 @@ var p = "gamer_token", ce = class {
|
|
|
237
237
|
balance_credit: f.number()
|
|
238
238
|
}).lock(), we = f.object({
|
|
239
239
|
id: f.number(),
|
|
240
|
-
change_type:
|
|
241
|
-
change_scene:
|
|
240
|
+
change_type: de,
|
|
241
|
+
change_scene: pe,
|
|
242
242
|
change_credit: f.number(),
|
|
243
243
|
balance: f.number(),
|
|
244
244
|
change_time: f.number(),
|
|
@@ -256,7 +256,7 @@ var p = "gamer_token", ce = class {
|
|
|
256
256
|
product_id: f.number(),
|
|
257
257
|
catalog_id: f.number(),
|
|
258
258
|
catalog_name: f.string(),
|
|
259
|
-
item_type:
|
|
259
|
+
item_type: h,
|
|
260
260
|
name: f.string(),
|
|
261
261
|
img_url: f.string(),
|
|
262
262
|
description: f.string(),
|
|
@@ -303,15 +303,15 @@ var p = "gamer_token", ce = class {
|
|
|
303
303
|
product_id: f.number(),
|
|
304
304
|
name: f.string(),
|
|
305
305
|
img_url: f.string(),
|
|
306
|
-
item_type:
|
|
306
|
+
item_type: h,
|
|
307
307
|
catalog_id: f.number(),
|
|
308
308
|
catalog_name: f.string(),
|
|
309
309
|
quantity: f.number(),
|
|
310
310
|
amount: f.number(),
|
|
311
|
-
status:
|
|
311
|
+
status: ge,
|
|
312
312
|
created_at: f.number(),
|
|
313
313
|
extra_data: f.union(De.clone(), Oe.clone()).satisfies().optional()
|
|
314
|
-
}), Ae = f.guard(
|
|
314
|
+
}), Ae = f.guard(_e), je = d({ player: ve }), 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
315
|
credit_logs: f.array(we),
|
|
316
316
|
next_token: f.string().optional()
|
|
317
317
|
}), Le = d({ products: f.array(y) }), Re = d({ benefits: f.array(v) }), ze = d({ benefit: Te }), Be = d({
|
|
@@ -758,15 +758,86 @@ var p = "gamer_token", ce = class {
|
|
|
758
758
|
event_item_id: f.number(),
|
|
759
759
|
redeem_catalog: f.array(Xt)
|
|
760
760
|
})
|
|
761
|
+
}), Qt = T.Referral, $t = f.object({
|
|
762
|
+
required_invitees: f.number(),
|
|
763
|
+
rewards: f.array(N)
|
|
764
|
+
}), en = f.object({
|
|
765
|
+
...P.shape,
|
|
766
|
+
feature_type: f.string().enum(Qt),
|
|
767
|
+
config: f.object({
|
|
768
|
+
max_recent_invitees: f.number(),
|
|
769
|
+
referral_tiers: f.array($t).optional()
|
|
770
|
+
})
|
|
771
|
+
}), tn = T.Register, nn = f.object({
|
|
772
|
+
...P.shape,
|
|
773
|
+
feature_type: f.string().enum(tn)
|
|
774
|
+
}), rn = T.Share, an = f.object({
|
|
775
|
+
...P.shape,
|
|
776
|
+
feature_type: f.string().enum(rn),
|
|
777
|
+
config: f.object({
|
|
778
|
+
share_platform: f.string(),
|
|
779
|
+
jump_url: f.string().optional(),
|
|
780
|
+
icon_url: f.string().optional()
|
|
781
|
+
})
|
|
782
|
+
}), on = T.Subscribe, sn = f.object({
|
|
783
|
+
...P.shape,
|
|
784
|
+
feature_type: f.string().enum(on),
|
|
785
|
+
config: f.object({ weixin_template_ids: f.array(f.string()) })
|
|
786
|
+
}), cn = T.Survey, ln = f.object({
|
|
787
|
+
...P.shape,
|
|
788
|
+
feature_type: f.string().enum(cn),
|
|
789
|
+
config: f.object({
|
|
790
|
+
survey_id: f.string(),
|
|
791
|
+
survey_url: f.string()
|
|
792
|
+
})
|
|
793
|
+
}), un = T.Team, dn = f.object({
|
|
794
|
+
...P.shape,
|
|
795
|
+
feature_type: f.string().enum(un),
|
|
796
|
+
config: f.object({
|
|
797
|
+
max_members: f.number().min(1),
|
|
798
|
+
min_members: f.number().min(1)
|
|
799
|
+
})
|
|
800
|
+
}), fn = T.Ugc, pn = f.object({
|
|
801
|
+
...P.shape,
|
|
802
|
+
feature_type: f.string().enum(fn),
|
|
803
|
+
config: f.object({
|
|
804
|
+
allowed_social_medias: f.array(f.string()).optional(),
|
|
805
|
+
acceptance_rewards: f.array(N).optional()
|
|
806
|
+
})
|
|
807
|
+
}), mn = T.UgcLike, hn = f.object({
|
|
808
|
+
...P.shape,
|
|
809
|
+
feature_type: f.string().enum(mn),
|
|
810
|
+
config: f.object({ ugc_feature_id: f.number() })
|
|
811
|
+
}), gn = T.Vote, _n = f.object({
|
|
812
|
+
sn: f.string(),
|
|
813
|
+
name: f.string(),
|
|
814
|
+
img_urls: f.array(f.string()).optional(),
|
|
815
|
+
video_urls: f.array(f.string()).optional(),
|
|
816
|
+
descriptions: f.array(f.string()).optional(),
|
|
817
|
+
jump_url: f.string(),
|
|
818
|
+
amount: f.number(),
|
|
819
|
+
finalists: f.bool(),
|
|
820
|
+
last_vote_time: f.number()
|
|
821
|
+
}), vn = f.object({
|
|
822
|
+
...P.shape,
|
|
823
|
+
feature_type: f.string().enum(gn),
|
|
824
|
+
config: f.object({
|
|
825
|
+
vote_feature_ids: f.array(f.number()),
|
|
826
|
+
submission_feature_ids: f.array(f.number()),
|
|
827
|
+
finalists_amount: f.number(),
|
|
828
|
+
source: Qe,
|
|
829
|
+
options: f.array(_n),
|
|
830
|
+
rewards: f.array(N)
|
|
831
|
+
})
|
|
761
832
|
}), F = f.union(f.string().pattern("NumberString", /^\d+$/), f.number()), I = f.object({
|
|
762
833
|
order_total_amount: F,
|
|
763
834
|
cashback_total_amount: F,
|
|
764
835
|
game_item_count: F
|
|
765
|
-
}),
|
|
836
|
+
}), yn = f.object({ activation_key: f.string().disallow("") }), bn = f.object({ gift_code: f.string() }), xn = f.object({
|
|
766
837
|
user_id: f.string(),
|
|
767
838
|
name: f.string().optional(),
|
|
768
839
|
avatar_url: f.string().optional()
|
|
769
|
-
}),
|
|
840
|
+
}), Sn = f.object({ lottery_count: f.number() }), L = f.object({
|
|
770
841
|
reward_id: f.number(),
|
|
771
842
|
reward_item_id: f.number(),
|
|
772
843
|
reward_source: A,
|
|
@@ -784,71 +855,71 @@ var p = "gamer_token", ce = class {
|
|
|
784
855
|
feature_type: Ye,
|
|
785
856
|
receive_time: f.number(),
|
|
786
857
|
extra_data: f.record(f.unknown()).optional()
|
|
787
|
-
}),
|
|
858
|
+
}), Cn = f.string().enum(j.Unknown, j.Pending), wn = f.union(f.object({
|
|
788
859
|
ticket: f.string(),
|
|
789
|
-
status:
|
|
860
|
+
status: Cn,
|
|
790
861
|
created_at: f.number()
|
|
791
862
|
}), f.object({
|
|
792
863
|
ticket: f.string(),
|
|
793
864
|
status: f.string().enum(r(j, "Unknown", "Pending")),
|
|
794
865
|
created_at: f.number(),
|
|
795
866
|
reward: L
|
|
796
|
-
})).satisfies(),
|
|
867
|
+
})).satisfies(), Tn = f.object({ tickets: f.array(wn) }), En = f.object({ platforms: f.array(f.string()) }), Dn = f.object({
|
|
797
868
|
role_name: f.string(),
|
|
798
869
|
is_leader: f.bool(),
|
|
799
870
|
is_myself: f.bool().optional(),
|
|
800
871
|
progress: f.number().optional(),
|
|
801
872
|
avatar_url: f.string().optional()
|
|
802
|
-
}).lock(),
|
|
873
|
+
}).lock(), On = f.object({
|
|
803
874
|
objective: E,
|
|
804
875
|
progress: f.number(),
|
|
805
876
|
completion_value: f.number().optional(),
|
|
806
877
|
team: f.object({
|
|
807
878
|
progress: f.number(),
|
|
808
879
|
completion_value: f.number().optional(),
|
|
809
|
-
players: f.array(
|
|
880
|
+
players: f.array(Dn)
|
|
810
881
|
}).optional()
|
|
811
|
-
}),
|
|
882
|
+
}), kn = f.object({
|
|
812
883
|
progress: f.number(),
|
|
813
884
|
team: f.object({
|
|
814
885
|
progress: f.number(),
|
|
815
|
-
team_members: f.array(
|
|
886
|
+
team_members: f.array(Dn).optional()
|
|
816
887
|
}).optional()
|
|
817
|
-
}),
|
|
888
|
+
}), An = f.object({
|
|
818
889
|
item_id: f.number(),
|
|
819
890
|
item_count: f.number(),
|
|
820
891
|
redeem_count: f.number()
|
|
821
|
-
}),
|
|
892
|
+
}), jn = f.object({ item_stocks: f.array(f.object({
|
|
822
893
|
item_id: f.number(),
|
|
823
894
|
item_stock: f.number(),
|
|
824
895
|
user_limit: f.number()
|
|
825
|
-
})) }),
|
|
896
|
+
})) }), Mn = f.object({
|
|
826
897
|
avatar_url: f.string().optional(),
|
|
827
898
|
role_name: f.string(),
|
|
828
899
|
server_name: f.string()
|
|
829
|
-
}),
|
|
900
|
+
}), Nn = f.object({
|
|
830
901
|
referral_code: f.string().optional(),
|
|
831
902
|
invitee_count: f.number().optional(),
|
|
832
|
-
invitees: f.array(
|
|
833
|
-
}),
|
|
903
|
+
invitees: f.array(Mn).optional()
|
|
904
|
+
}), Pn = f.object({
|
|
834
905
|
required_invitees: f.number(),
|
|
835
906
|
unlocked: f.bool(),
|
|
836
907
|
generated: f.bool()
|
|
837
|
-
}),
|
|
908
|
+
}), Fn = f.object({
|
|
838
909
|
invitee_count: f.number().optional(),
|
|
839
910
|
generated_rewards: f.array(L).optional(),
|
|
840
|
-
referral_tier_status: f.array(
|
|
841
|
-
}),
|
|
911
|
+
referral_tier_status: f.array(Pn).optional()
|
|
912
|
+
}), In = f.object({ platform: f.string().optional() }), Ln = f.object({ weixin_openid: f.string() }), Rn = f.object({ serial_number: f.number() }), R = f.object({
|
|
842
913
|
team_code: f.string(),
|
|
843
914
|
leader_name: f.string(),
|
|
844
915
|
total_members: f.number()
|
|
845
|
-
}),
|
|
916
|
+
}), zn = f.object({
|
|
846
917
|
is_leader: f.bool(),
|
|
847
918
|
is_myself: f.bool().optional(),
|
|
848
919
|
role_name: f.string(),
|
|
849
920
|
server_name: f.string(),
|
|
850
921
|
avatar_url: f.string().optional()
|
|
851
|
-
}),
|
|
922
|
+
}), Bn = f.object({
|
|
852
923
|
team_code: f.string(),
|
|
853
924
|
visibility: nt,
|
|
854
925
|
members: f.array(f.object({
|
|
@@ -856,14 +927,14 @@ var p = "gamer_token", ce = class {
|
|
|
856
927
|
role_name: f.string(),
|
|
857
928
|
server_name: f.string()
|
|
858
929
|
}))
|
|
859
|
-
}),
|
|
930
|
+
}), Vn = f.object({
|
|
860
931
|
ugc_id: f.number(),
|
|
861
932
|
title: f.string(),
|
|
862
933
|
content: f.string().optional(),
|
|
863
934
|
image_urls: f.array(f.string()).optional(),
|
|
864
935
|
social_media: M.clone().optional(),
|
|
865
936
|
social_media_url: f.string().optional()
|
|
866
|
-
}),
|
|
937
|
+
}), Hn = f.object({
|
|
867
938
|
ugcs: f.array(f.object({
|
|
868
939
|
ugc_id: f.number(),
|
|
869
940
|
event_id: f.number().optional(),
|
|
@@ -881,7 +952,7 @@ var p = "gamer_token", ce = class {
|
|
|
881
952
|
created_at: f.number()
|
|
882
953
|
})).optional(),
|
|
883
954
|
next_token: f.string().optional()
|
|
884
|
-
}),
|
|
955
|
+
}), Un = f.object({
|
|
885
956
|
ugcs: f.array(f.object({
|
|
886
957
|
ugc_id: f.number(),
|
|
887
958
|
event_id: f.number().optional(),
|
|
@@ -902,11 +973,11 @@ var p = "gamer_token", ce = class {
|
|
|
902
973
|
created_at: f.number()
|
|
903
974
|
})).optional(),
|
|
904
975
|
next_token: f.string().optional()
|
|
905
|
-
}),
|
|
976
|
+
}), Wn = f.object({ total_count: f.number() }), Gn = f.object({
|
|
906
977
|
existed: f.bool(),
|
|
907
978
|
upload_url: f.string().optional(),
|
|
908
979
|
image_url: f.string()
|
|
909
|
-
}),
|
|
980
|
+
}), Kn = f.object({ ugcs: f.array(f.object({
|
|
910
981
|
ugc_id: f.number(),
|
|
911
982
|
rank: f.number(),
|
|
912
983
|
total_likes: f.number(),
|
|
@@ -915,32 +986,32 @@ var p = "gamer_token", ce = class {
|
|
|
915
986
|
server_name: f.string().optional(),
|
|
916
987
|
role_id: f.string().optional(),
|
|
917
988
|
role_name: f.string().optional()
|
|
918
|
-
})).optional() }),
|
|
989
|
+
})).optional() }), qn = f.object({ option_sn: f.string() }), Jn = f.object({
|
|
919
990
|
candidate_id: f.string(),
|
|
920
991
|
total_votes: f.number().optional(),
|
|
921
992
|
my_votes: f.number().optional(),
|
|
922
993
|
cycle_votes: f.number().optional(),
|
|
923
994
|
votes: f.number().optional()
|
|
924
|
-
}),
|
|
995
|
+
}), Yn = f.object({
|
|
925
996
|
rewards_type: pt,
|
|
926
997
|
rewards: f.array(L).optional()
|
|
927
|
-
}),
|
|
998
|
+
}), Xn = f.object({
|
|
928
999
|
candidate_id: f.string(),
|
|
929
1000
|
is_winner: f.bool(),
|
|
930
1001
|
total_votes: f.number(),
|
|
931
1002
|
my_votes: f.number(),
|
|
932
1003
|
cycle_votes: f.number().optional()
|
|
933
|
-
}),
|
|
1004
|
+
}), Zn = f.object({
|
|
934
1005
|
role: f.string(),
|
|
935
1006
|
content: f.string()
|
|
936
|
-
}),
|
|
1007
|
+
}), Qn = f.object({ conversations: f.array(Zn) }), $n = f.object({
|
|
937
1008
|
user_id: f.string(),
|
|
938
1009
|
name: f.string(),
|
|
939
1010
|
avatar_url: f.string(),
|
|
940
1011
|
comment: f.string(),
|
|
941
1012
|
video_note: f.number(),
|
|
942
1013
|
created_at: f.number()
|
|
943
|
-
}),
|
|
1014
|
+
}), z = f.union(En, Sn, Rn, xn, In, qn, Jn, Ln, I, bn, Bn, On, Tn, yn, Qn, Vn, An, Nn, f.custom("EmptyObject", (e) => t(e) && Object.keys(e).length === 0)).satisfies().lock(), er = f.object({
|
|
944
1015
|
reward_id: f.number(),
|
|
945
1016
|
reward_item_id: f.number(),
|
|
946
1017
|
reward_item_type: w,
|
|
@@ -952,8 +1023,8 @@ var p = "gamer_token", ce = class {
|
|
|
952
1023
|
reward_item_desc: f.string().optional(),
|
|
953
1024
|
reward_item_rating: f.number(),
|
|
954
1025
|
receive_time: f.number(),
|
|
955
|
-
extra_data: f.union(...
|
|
956
|
-
}),
|
|
1026
|
+
extra_data: f.union(...z.validators, f.record(f.unknown())).satisfies().optional()
|
|
1027
|
+
}), tr = f.object({
|
|
957
1028
|
reward_id: f.number(),
|
|
958
1029
|
reward_item_id: f.number(),
|
|
959
1030
|
reward_item_name: f.string(),
|
|
@@ -965,89 +1036,18 @@ var p = "gamer_token", ce = class {
|
|
|
965
1036
|
reward_status: O,
|
|
966
1037
|
reward_source: A,
|
|
967
1038
|
extra_data: f.record(f.unknown()).optional()
|
|
968
|
-
}),
|
|
1039
|
+
}), nr = f.object({
|
|
969
1040
|
engagement_id: f.number(),
|
|
970
1041
|
user_id: f.string(),
|
|
971
1042
|
event_id: f.number(),
|
|
972
1043
|
feature_id: f.number(),
|
|
973
1044
|
sequence: f.number(),
|
|
974
|
-
data:
|
|
1045
|
+
data: z.clone().optional(),
|
|
975
1046
|
server_id: f.string().optional(),
|
|
976
1047
|
role_id: f.string().optional(),
|
|
977
1048
|
created_at: f.number(),
|
|
978
|
-
rewards: f.array(
|
|
979
|
-
}).lock(),
|
|
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_tiers: f.array(Rn).optional()
|
|
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({
|
|
1049
|
+
rewards: f.array(er).optional()
|
|
1050
|
+
}).lock(), rr = f.object({
|
|
1051
1051
|
allowed: f.bool(),
|
|
1052
1052
|
registered: f.bool()
|
|
1053
1053
|
}), ir = f.object({
|
|
@@ -1068,9 +1068,9 @@ var p = "gamer_token", ce = class {
|
|
|
1068
1068
|
engagement_id: f.number(),
|
|
1069
1069
|
sequence: f.number(),
|
|
1070
1070
|
feature_id: f.number(),
|
|
1071
|
-
data:
|
|
1071
|
+
data: z.clone().optional()
|
|
1072
1072
|
}).optional(),
|
|
1073
|
-
rewards: f.array(
|
|
1073
|
+
rewards: f.array(tr).optional(),
|
|
1074
1074
|
scan: f.bool().optional()
|
|
1075
1075
|
}), or = f.object({
|
|
1076
1076
|
reward_id: f.number(),
|
|
@@ -1099,20 +1099,20 @@ var p = "gamer_token", ce = class {
|
|
|
1099
1099
|
}), ur = T.ZeroChatgpt, dr = f.object({
|
|
1100
1100
|
...P.shape,
|
|
1101
1101
|
feature_type: f.string().enum(ur)
|
|
1102
|
-
}), fr = f.union(xt, Ct, Dt, kt, jt, Pt, It, Rt, Ht, Wt, Kt, Jt,
|
|
1102
|
+
}), fr = f.union(xt, Ct, Dt, kt, jt, Pt, It, Rt, Ht, Wt, Kt, Jt, nn, an, sn, ln, dn, vn, lr, Tt, dr, pn, hn, Zt, en).key("feature_type").satisfies(), pr = f.object({
|
|
1103
1103
|
event_name: f.string(),
|
|
1104
1104
|
rules: f.string(),
|
|
1105
1105
|
since: f.number(),
|
|
1106
1106
|
until: f.number(),
|
|
1107
1107
|
visit_count: f.number().optional(),
|
|
1108
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(
|
|
1110
|
-
engagements: f.array(
|
|
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($n), f.array(R)) }), vr = d({ status: f.array(ir) }), yr = d({ engagements_counts: f.record(f.number()) }), br = d({
|
|
1110
|
+
engagements: f.array(nr),
|
|
1111
1111
|
next_token: f.string().optional()
|
|
1112
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
1113
|
user_rewards: f.array(L),
|
|
1114
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(
|
|
1115
|
+
}), Er = d({ unclaimed: f.number() }), Dr = d({ scene: f.string() }), Or = d({ params: f.string() }), kr = d({ img: f.string() }), Ar = f.guard(kn), jr = f.guard(Yn), Mr = f.guard(f.object({ candidate_votes: f.array(Xn) })), Nr = f.guard(I), Pr = f.guard(Un), Fr = f.guard(Hn), Ir = f.guard(Wn), Lr = f.guard(Gn), Rr = f.guard(Kn), zr = f.guard(jn), Br = f.guard(Fn);
|
|
1116
1116
|
//#endregion
|
|
1117
1117
|
//#region src/event.methods.ts
|
|
1118
1118
|
async function Vr(e, t, n) {
|
|
@@ -1424,7 +1424,7 @@ var bi = {
|
|
|
1424
1424
|
req;
|
|
1425
1425
|
constructor(e, t) {
|
|
1426
1426
|
this.req = t({
|
|
1427
|
-
baseURL: `${
|
|
1427
|
+
baseURL: `${p(e) ? e : `https://${o(e)}`}/v1/ggd`,
|
|
1428
1428
|
timeout: 1e4,
|
|
1429
1429
|
maxRetry: 2,
|
|
1430
1430
|
retryInterval: "2EB",
|
|
@@ -1835,7 +1835,7 @@ var ia = "wx_login_cache", aa = class {
|
|
|
1835
1835
|
if (!u()) throw Error("当前环境非微信小程序");
|
|
1836
1836
|
let t = await this.getLoginCache();
|
|
1837
1837
|
if (t) return t;
|
|
1838
|
-
let n = await
|
|
1838
|
+
let n = await oe(), { data: r, code: i, message: a } = await this.req.post("weixin/login", {
|
|
1839
1839
|
code: n,
|
|
1840
1840
|
appid: this.appid
|
|
1841
1841
|
}, $, {
|
|
@@ -1894,4 +1894,4 @@ var ia = "wx_login_cache", aa = class {
|
|
|
1894
1894
|
}
|
|
1895
1895
|
};
|
|
1896
1896
|
//#endregion
|
|
1897
|
-
export { K as AntispamValidator,
|
|
1897
|
+
export { K as AntispamValidator, se as AuthToken, Xn as CandidateVoteValidator, I as CashbackEngagementDataValidator, yn as ClaimActivationKeyEngagementDataValidator, $e as ClaimRewardStatus, k as ClaimRewardStatusValidator, or as ClaimedItemValidator, _ as ClubAddressValidator, He as ClubApi, v as ClubBenefitSummaryValidator, Te as ClubBenefitValidator, fe as ClubCreditChangeScene, pe as ClubCreditChangeSceneValidator, ue as ClubCreditChangeType, de as ClubCreditChangeTypeValidator, we as ClubCreditLogValidator, _e as ClubGlobalConfigValidator, me as ClubItemType, h as ClubItemTypeValidator, ve as ClubPlayerValidator, y as ClubProductValidator, he as ClubRedemptionStatus, ge as ClubRedemptionStatusValidator, Ce as ClubUserCreditValidator, Se as ClubUserProfileValidator, $n as CommentEngagementValidator, J as CommentValidator, ta as CommunityApi, Zn as ConversationValidator, Ge as EngageAccountType, Ke as EngageAccountTypeValidator, ar as EngageResponseValidator, tr 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, en as EventFeatureConfigOfReferralValidator, nn as EventFeatureConfigOfRegisterValidator, an as EventFeatureConfigOfShareValidator, sn as EventFeatureConfigOfSubscribeValidator, ln as EventFeatureConfigOfSurveyValidator, dn as EventFeatureConfigOfTeamValidator, hn as EventFeatureConfigOfUgcLikeValidator, pn as EventFeatureConfigOfUgcValidator, lr as EventFeatureConfigOfVote2Validator, vn as EventFeatureConfigOfVoteValidator, fr as EventFeatureConfigValidator, qe as EventPeriodType, Je as EventPeriodTypeValidator, N as EventRewardItemConfigValidator, Oe as ExtraGameRewardValidator, De as ExtraPhysicalShipmentValidator, Xt as FeatureRedeemItemConfigValidator, $t 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, ce as Gender, le as GenderValidator, Fn as GenerateReferralRewardsResponseValidator, bn as GiftCodeEngagementDataValidator, xn as InviteEngagementDataValidator, ct as LotteryDrawAction, lt as LotteryDrawActionValidator, Tn as LotteryDrawEngagementDataValidator, Sn 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, En as PreregisterEngagementDataValidator, Ai as PresignedUrlResponseValidator, On as QuestEngagementDataValidator, Xe as QuestObjective, E as QuestObjectiveValidator, ut as QuestProgressAlgorithm, dt as QuestProgressAlgorithmValidator, kn as QuestProgressValidator, An as RedeemEngagementDataValidator, Ee as RedeemParamsValidator, jn as RedeemStocksResponseValidator, ke as RedemptionValidator, ot as ReferralAction, st as ReferralActionValidator, Nn as ReferralEngagementDataValidator, Mn as ReferralInviteValidator, Pn 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, er as RewardValidator, be as RoleBaseInfoValidator, ye as ServerBaseInfoValidator, In as ShareEngagementDataValidator, Rn as SurveyEngagementDataValidator, it as TeamAction, at as TeamActionValidator, Bn as TeamEngagementDataValidator, R as TeamEngagementValidator, zn as TeamMemberValidator, tt as TeamVisibility, nt as TeamVisibilityValidator, W as TopicValidator, Wn as UgcCountResponseValidator, Vn as UgcEngagementDataValidator, Kn as UgcLeaderboardResponseValidator, Hn as UgcRecordBaseResponseValidator, Un as UgcRecordResponseValidator, ht as UgcReviewStatus, gt as UgcReviewStatusValidator, mt as UgcSocialMedia, M as UgcSocialMediaValidator, Gn as UgcUploadImageValidator, z as UserEngagementDataValidator, nr as UserEngagementValidator, ir as UserFeatureStatusValidator, L as UserRewardValidator, rr as VerifyMobileResultValidator, Yn as Vote2ClaimRewardsResponseValidator, Jn as Vote2EngagementDataValidator, ft as Vote2RewardType, pt as Vote2RewardTypeValidator, qn as VoteEngagementDataValidator, Ze as VoteOptionSource, Qe as VoteOptionSourceValidator, aa as WeixinApi, Ln as WeixinSubscribeEngagementDataValidator, ra as WeixinWebLoginErrorCode, Qn 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/gamer-api",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.4",
|
|
4
4
|
"description": "agent for gamer api",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "web@seayoo.com",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@seayoo-web/combo-webview": "2.9.7",
|
|
31
31
|
"@seayoo-web/request": "4.1.0",
|
|
32
32
|
"@seayoo-web/scripts": "4.3.6",
|
|
33
|
-
"@seayoo-web/tsconfig": "1.0.6",
|
|
34
33
|
"@seayoo-web/utils": "4.4.1",
|
|
35
|
-
"@seayoo-web/validator": "2.3.0"
|
|
34
|
+
"@seayoo-web/validator": "2.3.0",
|
|
35
|
+
"@seayoo-web/tsconfig": "1.0.6"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@seayoo-web/combo-webview": "^2.9.7",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Reward } from "../event.engage";
|
|
2
1
|
import type { EventFeatureBaseConfig } from "./feature.base";
|
|
2
|
+
import { type EventRewardItemConfig } from "./reward";
|
|
3
3
|
declare const featureType: "referral";
|
|
4
4
|
export interface FeatureReferralConfig {
|
|
5
5
|
/** 允许返回的最近被邀请人最大数量 */
|
|
@@ -11,7 +11,7 @@ export interface FeatureReferralTierItem {
|
|
|
11
11
|
/** 邀请数量要求 */
|
|
12
12
|
required_invitees: number;
|
|
13
13
|
/** 奖励 */
|
|
14
|
-
rewards:
|
|
14
|
+
rewards: EventRewardItemConfig[];
|
|
15
15
|
}
|
|
16
16
|
export declare const FeatureReferralTierItemValidator: import("@seayoo-web/validator").ObjectValidator<FeatureReferralTierItem, false, false>;
|
|
17
17
|
export type EventFeatureConfigOfReferral = EventFeatureBaseConfig & {
|