@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/gamer-api",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"description": "agent for gamer api",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "web@seayoo.com",
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.13.1",
|
|
30
|
-
"@seayoo-web/scripts": "4.3.6",
|
|
31
|
-
"@seayoo-web/utils": "4.4.1",
|
|
32
30
|
"@seayoo-web/combo-webview": "2.9.7",
|
|
33
31
|
"@seayoo-web/request": "4.1.0",
|
|
32
|
+
"@seayoo-web/scripts": "4.3.6",
|
|
34
33
|
"@seayoo-web/tsconfig": "1.0.6",
|
|
34
|
+
"@seayoo-web/utils": "4.4.1",
|
|
35
35
|
"@seayoo-web/validator": "2.3.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@seayoo-web/combo-webview": "^2.9.7",
|
|
39
|
-
"@seayoo-web/
|
|
40
|
-
"@seayoo-web/
|
|
39
|
+
"@seayoo-web/utils": "^4.4.1",
|
|
40
|
+
"@seayoo-web/validator": "^2.3.0"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=22"
|
|
@@ -12,6 +12,7 @@ import type { EventFeatureConfigOfLotteryDraw } from "./feature.lotteryDraw";
|
|
|
12
12
|
import type { EventFeatureConfigOfPreregister } from "./feature.preregister";
|
|
13
13
|
import type { EventFeatureConfigOfQuest } from "./feature.quest";
|
|
14
14
|
import type { EventFeatureConfigOfRedeem } from "./feature.redeem";
|
|
15
|
+
import type { EventFeatureConfigOfReferral } from "./feature.referral";
|
|
15
16
|
import type { EventFeatureConfigOfRegister } from "./feature.register";
|
|
16
17
|
import type { EventFeatureConfigOfShare } from "./feature.share";
|
|
17
18
|
import type { EventFeatureConfigOfSubscribe } from "./feature.subscribe";
|
|
@@ -45,5 +46,6 @@ export * from "./feature.claimActivationKey";
|
|
|
45
46
|
export * from "./feature.ugc";
|
|
46
47
|
export * from "./feature.ugcLike";
|
|
47
48
|
export * from "./feature.redeem";
|
|
48
|
-
export
|
|
49
|
-
export
|
|
49
|
+
export * from "./feature.referral";
|
|
50
|
+
export type EventFeatureConfig = EventFeatureConfigOfCashback | EventFeatureConfigOfCheckIn | EventFeatureConfigOfClaimRewards | EventFeatureConfigOfComment | EventFeatureConfigOfFollow | EventFeatureConfigOfGiftCode | EventFeatureConfigOfInvite | EventFeatureConfigOfInvitedRegister | EventFeatureConfigOfLottery | EventFeatureConfigOfLotteryDraw | EventFeatureConfigOfPreregister | EventFeatureConfigOfQuest | EventFeatureConfigOfRegister | EventFeatureConfigOfShare | EventFeatureConfigOfSubscribe | EventFeatureConfigOfSurvey | EventFeatureConfigOfTeam | EventFeatureConfigOfVote | EventFeatureConfigOfVote2 | EventFeatureConfigOfClaimActivationKey | EventFeatureConfigOfZeroChatgpt | EventFeatureConfigOfUgc | EventFeatureConfigOfUgcLike | EventFeatureConfigOfRedeem | EventFeatureConfigOfReferral;
|
|
51
|
+
export declare const EventFeatureConfigValidator: import("@seayoo-web/validator").UnionValidator<[import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfCashback, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfCheckIn, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfClaimRewards, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfComment, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfFollow, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfGiftCode, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfInvite, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfInvitedRegister, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfLottery, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfLotteryDraw, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfPreregister, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfQuest, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfRegister, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfShare, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfSubscribe, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfSurvey, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfTeam, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfVote, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfVote2, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfClaimActivationKey, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfZeroChatgpt, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfUgc, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfUgcLike, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfRedeem, false, false>, import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfReferral, false, false>], false, false>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Reward } from "../event.engage";
|
|
2
|
+
import type { EventFeatureBaseConfig } from "./feature.base";
|
|
3
|
+
declare const featureType: "referral";
|
|
4
|
+
export interface FeatureReferralConfig {
|
|
5
|
+
/** 允许返回的最近被邀请人最大数量 */
|
|
6
|
+
max_recent_invitees: number;
|
|
7
|
+
/** 分级奖励配置 */
|
|
8
|
+
referral_tier: FeatureReferralTierItem[];
|
|
9
|
+
}
|
|
10
|
+
export interface FeatureReferralTierItem {
|
|
11
|
+
/** 邀请数量要求 */
|
|
12
|
+
required_invitees: number;
|
|
13
|
+
/** 奖励 */
|
|
14
|
+
rewards: Reward[];
|
|
15
|
+
}
|
|
16
|
+
export declare const FeatureReferralTierItemValidator: import("@seayoo-web/validator").ObjectValidator<FeatureReferralTierItem, false, false>;
|
|
17
|
+
export type EventFeatureConfigOfReferral = EventFeatureBaseConfig & {
|
|
18
|
+
feature_type: typeof featureType;
|
|
19
|
+
config: FeatureReferralConfig;
|
|
20
|
+
};
|
|
21
|
+
export declare const EventFeatureConfigOfReferralValidator: import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfReferral, false, false>;
|
|
22
|
+
export {};
|
|
@@ -7,6 +7,7 @@ import type { LotteryDrawEngagementData } from "./engage.lotteryDraw";
|
|
|
7
7
|
import type { PreregisterEngagementData } from "./engage.preregister";
|
|
8
8
|
import type { QuestEngagementData } from "./engage.quest";
|
|
9
9
|
import type { RedeemEngagementData } from "./engage.redeem";
|
|
10
|
+
import type { ReferralEngagementData } from "./engage.referral";
|
|
10
11
|
import type { ShareEngagementData } from "./engage.share";
|
|
11
12
|
import type { WeixinSubscribeEngagementData } from "./engage.subscribe";
|
|
12
13
|
import type { SurveyEngagementData } from "./engage.survey";
|
|
@@ -34,8 +35,9 @@ export * from "./engage.zeroChatGPT";
|
|
|
34
35
|
export * from "./engage.ugc";
|
|
35
36
|
export * from "./engage.ugcLike";
|
|
36
37
|
export * from "./engage.redeem";
|
|
38
|
+
export * from "./engage.referral";
|
|
37
39
|
export type EmptyObject = Record<string | number | symbol, never>;
|
|
38
|
-
export type UserEngagementData = PreregisterEngagementData | LotteryEngagementData | SurveyEngagementData | InviteEngagementData | ShareEngagementData | VoteEngagementData | Vote2EngagementData | WeixinSubscribeEngagementData | CashbackEngagementData | GiftCodeEngagementData | TeamEngagementData | QuestEngagementData | LotteryDrawEngagementData | ClaimActivationKeyEngagementData | ZeroChatGPTData | UgcEngagementData | RedeemEngagementData | EmptyObject;
|
|
40
|
+
export type UserEngagementData = PreregisterEngagementData | LotteryEngagementData | SurveyEngagementData | InviteEngagementData | ShareEngagementData | VoteEngagementData | Vote2EngagementData | WeixinSubscribeEngagementData | CashbackEngagementData | GiftCodeEngagementData | TeamEngagementData | QuestEngagementData | LotteryDrawEngagementData | ClaimActivationKeyEngagementData | ZeroChatGPTData | UgcEngagementData | RedeemEngagementData | ReferralEngagementData | EmptyObject;
|
|
39
41
|
export declare const UserEngagementDataValidator: import("@seayoo-web/validator").UnionValidator<[import("@seayoo-web/validator").ObjectValidator<{
|
|
40
42
|
platforms: string[];
|
|
41
43
|
}, false, false>, import("@seayoo-web/validator").ObjectValidator<LotteryEngagementData, false, false>, import("@seayoo-web/validator").ObjectValidator<{
|
|
@@ -56,7 +58,7 @@ export declare const UserEngagementDataValidator: import("@seayoo-web/validator"
|
|
|
56
58
|
role: /*elided*/ any;
|
|
57
59
|
content: /*elided*/ any;
|
|
58
60
|
}[];
|
|
59
|
-
}, false, false>, import("@seayoo-web/validator").ObjectValidator<UgcEngagementData, false, false>, import("@seayoo-web/validator").ObjectValidator<RedeemEngagementData, false, false>, import("@seayoo-web/validator").CustomValidator<EmptyObject, false, false>], false, false> & {
|
|
61
|
+
}, false, false>, import("@seayoo-web/validator").ObjectValidator<UgcEngagementData, false, false>, import("@seayoo-web/validator").ObjectValidator<RedeemEngagementData, false, false>, import("@seayoo-web/validator").ObjectValidator<ReferralEngagementData, false, false>, import("@seayoo-web/validator").CustomValidator<EmptyObject, false, false>], false, false> & {
|
|
60
62
|
optional: never;
|
|
61
63
|
maybeNull: never;
|
|
62
64
|
key: never;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type UserReward } from "./engage.lotteryDraw.reward";
|
|
2
|
+
import type { ReferralAction } from "../event.enums";
|
|
3
|
+
export interface ReferralInvite {
|
|
4
|
+
avatar_url?: string;
|
|
5
|
+
role_name: string;
|
|
6
|
+
server_name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ReferralInviteValidator: import("@seayoo-web/validator").ObjectValidator<ReferralInvite, false, false>;
|
|
9
|
+
export interface ReferralEngagementData {
|
|
10
|
+
/** 邀请码 */
|
|
11
|
+
referral_code?: string;
|
|
12
|
+
/** 已邀请人数(真实邀请人数) */
|
|
13
|
+
invitee_count?: number;
|
|
14
|
+
/** 被邀请人列表,受 max_recent_invitees 配置限制返回条数 */
|
|
15
|
+
invitees?: ReferralInvite[];
|
|
16
|
+
}
|
|
17
|
+
export declare const ReferralEngagementDataValidator: import("@seayoo-web/validator").ObjectValidator<ReferralEngagementData, false, false>;
|
|
18
|
+
export type ReferralEngagementParam = {
|
|
19
|
+
/** 操作类型 */
|
|
20
|
+
action: typeof ReferralAction.Share;
|
|
21
|
+
} | {
|
|
22
|
+
/** 操作类型 */
|
|
23
|
+
action: typeof ReferralAction.Join;
|
|
24
|
+
/** 邀请码 */
|
|
25
|
+
referral_code: string;
|
|
26
|
+
} | {
|
|
27
|
+
/** 操作类型 */
|
|
28
|
+
action: typeof ReferralAction.Query;
|
|
29
|
+
};
|
|
30
|
+
export type ReferralEngagementError = "referral_code_required" | "referral_code_invalid" | "referral_code_not_found" | "cannot_invite_self" | "user_already_invited";
|
|
31
|
+
export interface GenerateReferralRewardsResponse {
|
|
32
|
+
/** 已邀请人数 */
|
|
33
|
+
invitee_count?: number;
|
|
34
|
+
/** 本次获得的奖励 */
|
|
35
|
+
generated_rewards?: UserReward[];
|
|
36
|
+
/** 阶梯邀请奖励状态 */
|
|
37
|
+
referral_tier_status?: ReferralTierStatus[];
|
|
38
|
+
}
|
|
39
|
+
export interface ReferralTierStatus {
|
|
40
|
+
/** 邀请邀请人数 */
|
|
41
|
+
required_invitees: number;
|
|
42
|
+
/** 是否已解锁(达到邀请人数要求) */
|
|
43
|
+
unlocked: boolean;
|
|
44
|
+
/** 是否已获得 */
|
|
45
|
+
generated: boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare const ReferralTierStatusValidator: import("@seayoo-web/validator").ObjectValidator<ReferralTierStatus, false, false>;
|
|
48
|
+
export declare const GenerateReferralRewardsResponseValidator: import("@seayoo-web/validator").ObjectValidator<GenerateReferralRewardsResponse, false, false>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FeatureType } from "../event.enums";
|
|
2
2
|
import type { UserEngagementData, CommentEngagementParam, PreregisterEngagementParam, LotteryEngagementParam, LotteryDrawEngagementParam, ShareEngagementParam, SubscribeEngagementParam, TeamEngagementParam, VoteEngagementParam, Vote2EngagementParam, UgcEngagementParam, UgcLikeEngagementParam, Vote2EngagementError, LotteryEngagementError, ClaimActivationKeyEngagementError, LotteryDrawEngagementError, TeamEngagementError, GiftCodeEngagementError, RedeemEngagementParam, RedeemEngagementError } from "./engage";
|
|
3
|
+
import type { ReferralEngagementError, ReferralEngagementParam } from "./engage.referral";
|
|
3
4
|
import type { ZeroChatGPTEngagementParam } from "./engage.zeroChatGPT";
|
|
4
5
|
import type { Reward } from "./reward";
|
|
5
6
|
export * from "./engage";
|
|
@@ -32,15 +33,15 @@ export declare const UserEngagementValidator: import("@seayoo-web/validator").Ob
|
|
|
32
33
|
/**
|
|
33
34
|
* 部分玩法参与时需要提供的参数
|
|
34
35
|
*/
|
|
35
|
-
export type EngagementParam = null | PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | Vote2EngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam | ZeroChatGPTEngagementParam | UgcEngagementParam | UgcLikeEngagementParam;
|
|
36
|
+
export type EngagementParam = null | PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | Vote2EngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam | ZeroChatGPTEngagementParam | UgcEngagementParam | UgcLikeEngagementParam | RedeemEngagementParam | ReferralEngagementParam;
|
|
36
37
|
export type EngagementFeatureType = FeatureType | unknown;
|
|
37
38
|
/**
|
|
38
39
|
* 根据玩法类型推导需要提交的参数数据类型
|
|
39
40
|
*/
|
|
40
|
-
export type InferEngagementParam<T extends EngagementFeatureType> = [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam | null : [T] extends ["vote"] ? VoteEngagementParam : [T] extends ["vote2"] ? Vote2EngagementParam : [T] extends ["weixin_subscribe"] ? SubscribeEngagementParam : [T] extends ["team"] ? TeamEngagementParam : [T] extends ["lottery_draw"] ? LotteryDrawEngagementParam : [T] extends ["zero_chatgpt"] ? ZeroChatGPTEngagementParam : [T] extends ["ugc"] ? UgcEngagementParam : [T] extends ["ugc_like"] ? UgcLikeEngagementParam : [T] extends ["redeem"] ? RedeemEngagementParam : EngagementParam;
|
|
41
|
+
export type InferEngagementParam<T extends EngagementFeatureType> = [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam | null : [T] extends ["vote"] ? VoteEngagementParam : [T] extends ["vote2"] ? Vote2EngagementParam : [T] extends ["weixin_subscribe"] ? SubscribeEngagementParam : [T] extends ["team"] ? TeamEngagementParam : [T] extends ["lottery_draw"] ? LotteryDrawEngagementParam : [T] extends ["zero_chatgpt"] ? ZeroChatGPTEngagementParam : [T] extends ["ugc"] ? UgcEngagementParam : [T] extends ["ugc_like"] ? UgcLikeEngagementParam : [T] extends ["redeem"] ? RedeemEngagementParam : [T] extends ["referral"] ? ReferralEngagementParam : EngagementParam;
|
|
41
42
|
export type EngagementCommonError = "invalid_token" | "event_not_found" | "feature_not_found" | "visit_record_not_found" | "event_not_started" | "event_already_ended" | "engage_feature_reached_limit" | "invalid_merchant_parameter" | "budget_not_enough" | "combo_id_not_found";
|
|
42
|
-
export type EngagementError = EngagementCommonError | TeamEngagementError | Vote2EngagementError | ClaimActivationKeyEngagementError | LotteryDrawEngagementError | LotteryEngagementError | GiftCodeEngagementError | RedeemEngagementError;
|
|
43
|
+
export type EngagementError = EngagementCommonError | TeamEngagementError | Vote2EngagementError | ClaimActivationKeyEngagementError | LotteryDrawEngagementError | LotteryEngagementError | GiftCodeEngagementError | RedeemEngagementError | ReferralEngagementError;
|
|
43
44
|
/**
|
|
44
45
|
* 根据玩法类型推导额外的错误字段
|
|
45
46
|
*/
|
|
46
|
-
export type InferEngagementError<T extends EngagementFeatureType> = ([T] extends ["vote2"] ? Vote2EngagementError : [T] extends ["claim_activation_key"] ? ClaimActivationKeyEngagementError : [T] extends ["lottery"] ? LotteryEngagementError : [T] extends ["lottery_draw"] ? LotteryDrawEngagementError : [T] extends ["team"] ? TeamEngagementError : [T] extends ["gift_code"] ? GiftCodeEngagementError : [T] extends ["redeem"] ? RedeemEngagementError : EngagementError) | EngagementCommonError;
|
|
47
|
+
export type InferEngagementError<T extends EngagementFeatureType> = ([T] extends ["vote2"] ? Vote2EngagementError : [T] extends ["claim_activation_key"] ? ClaimActivationKeyEngagementError : [T] extends ["lottery"] ? LotteryEngagementError : [T] extends ["lottery_draw"] ? LotteryDrawEngagementError : [T] extends ["team"] ? TeamEngagementError : [T] extends ["gift_code"] ? GiftCodeEngagementError : [T] extends ["redeem"] ? RedeemEngagementError : [T] extends ["referral"] ? ReferralEngagementError : EngagementError) | EngagementCommonError;
|
|
@@ -156,6 +156,8 @@ export declare const FeatureType: {
|
|
|
156
156
|
readonly UgcLike: "ugc_like";
|
|
157
157
|
/** 兑换 */
|
|
158
158
|
readonly Redeem: "redeem";
|
|
159
|
+
/** 裂变拉新 */
|
|
160
|
+
readonly Referral: "referral";
|
|
159
161
|
};
|
|
160
162
|
export type FeatureType = ValueOf<typeof FeatureType>;
|
|
161
163
|
export declare const FeatureTypeValidator: import("@seayoo-web/validator").StringValidator<FeatureType, false, false> & {
|
|
@@ -370,6 +372,26 @@ export declare const TeamActionValidator: import("@seayoo-web/validator").String
|
|
|
370
372
|
maybeNull: never;
|
|
371
373
|
lock: never;
|
|
372
374
|
};
|
|
375
|
+
/** 裂变玩法操作类型 */
|
|
376
|
+
export declare const ReferralAction: {
|
|
377
|
+
/** 获取邀请码 */
|
|
378
|
+
readonly Share: "share";
|
|
379
|
+
/** 被邀请人参与 */
|
|
380
|
+
readonly Join: "join";
|
|
381
|
+
/** 查询邀请码、已邀人数、被邀请人列表 */
|
|
382
|
+
readonly Query: "query";
|
|
383
|
+
};
|
|
384
|
+
export type ReferralAction = ValueOf<typeof ReferralAction>;
|
|
385
|
+
export declare const ReferralActionValidator: import("@seayoo-web/validator").StringValidator<ReferralAction, false, false> & {
|
|
386
|
+
pattern: never;
|
|
387
|
+
url: never;
|
|
388
|
+
dataUri: never;
|
|
389
|
+
enum: never;
|
|
390
|
+
disallow: never;
|
|
391
|
+
optional: never;
|
|
392
|
+
maybeNull: never;
|
|
393
|
+
lock: never;
|
|
394
|
+
};
|
|
373
395
|
/** 抽奖券玩法操作类型 */
|
|
374
396
|
export declare const LotteryDrawAction: {
|
|
375
397
|
/** 查询抽奖券 */
|
|
@@ -63,3 +63,4 @@ export declare const isUgcUploadImageResponse: (data: unknown) => data is {
|
|
|
63
63
|
};
|
|
64
64
|
export declare const isUgcLeaderboardResponse: (data: unknown) => data is import("./event.engage").UgcLeaderboardResponse;
|
|
65
65
|
export declare const isRedeemItemStockResponse: (data: unknown) => data is import("./event.engage").RedeemStocksResponse;
|
|
66
|
+
export declare const isGenerateReferralRewardsResponse: (data: unknown) => data is import("./event.engage").GenerateReferralRewardsResponse;
|
|
@@ -4,7 +4,7 @@ import type { GamerItemType, RewardSource, RewardStatus, UgcReviewStatus } from
|
|
|
4
4
|
import type { RequestOptions, RequestInternalError } from "@seayoo-web/request";
|
|
5
5
|
type ApiInstance = InstanceType<typeof EventApi>;
|
|
6
6
|
/** 支持的 api 方法,用于 TS 类型输入提示 */
|
|
7
|
-
export type ApiMethodNames = "verifyMobileAllowed" | "getConfig" | "getEngagementsUserCount" | "getEngagementsCount" | "getEngagements" | "visit" | "getUserFeatureStatus" | "getUserEngagementCount" | "getUserEngagements" | "engage" | "claimRewards" | "submitUserRewardAddress" | "getUnlimitQrcodeScene" | "getParamsByQrcodeScene" | "generateUnlimitQrcode" | "getQuestProgress" | "vote2Rewards" | "getVote2Leaderboard" | "getCashbackQuery" | "getUgcRecord" | "getUgcMyCount" | "claimRewardsV2" | "claimWeixinHongbao" | "verifyActivationKey" | "getUserRewards" | "getUserRewardsCount" | "getUserItemCount" | "ugcUploadImage" | "getUgcRecommendation" | "getUgcs" | "getUgcLeaderboard" | "getRedeemItemStocks";
|
|
7
|
+
export type ApiMethodNames = "verifyMobileAllowed" | "getConfig" | "getEngagementsUserCount" | "getEngagementsCount" | "getEngagements" | "visit" | "getUserFeatureStatus" | "getUserEngagementCount" | "getUserEngagements" | "engage" | "claimRewards" | "submitUserRewardAddress" | "getUnlimitQrcodeScene" | "getParamsByQrcodeScene" | "generateUnlimitQrcode" | "getQuestProgress" | "vote2Rewards" | "getVote2Leaderboard" | "getCashbackQuery" | "getUgcRecord" | "getUgcMyCount" | "claimRewardsV2" | "claimWeixinHongbao" | "verifyActivationKey" | "getUserRewards" | "getUserRewardsCount" | "getUserItemCount" | "ugcUploadImage" | "getUgcRecommendation" | "getUgcs" | "getUgcLeaderboard" | "getRedeemItemStocks" | "generateReferralRewards";
|
|
8
8
|
/**
|
|
9
9
|
* 根据手机号白名单,检查手机号是否允许登录某个游戏
|
|
10
10
|
*
|
|
@@ -450,4 +450,13 @@ export declare function getRedeemItemStocks(this: ApiInstance, featureId: number
|
|
|
450
450
|
message: string;
|
|
451
451
|
error: RequestInternalError | "event_not_found" | "feature_not_found";
|
|
452
452
|
} | null>;
|
|
453
|
+
/**
|
|
454
|
+
* 在裂变玩法中,生成阶梯奖励;奖励仍通过通用领奖接口领取
|
|
455
|
+
*
|
|
456
|
+
* https://www.kdocs.cn/l/cdB3gn8J4a9S?linkname=JHR4LeqsmE
|
|
457
|
+
*/
|
|
458
|
+
export declare function generateReferralRewards(this: ApiInstance, featureId: number, requestOptions?: RequestOptions): Promise<import("./event.engage").GenerateReferralRewardsResponse | {
|
|
459
|
+
message: string;
|
|
460
|
+
error: string;
|
|
461
|
+
} | null>;
|
|
453
462
|
export {};
|
package/types/src/ggd.d.ts
CHANGED
|
@@ -6,24 +6,28 @@ export declare class GGDPublicApi {
|
|
|
6
6
|
req: ReturnType<NetRequestFactory>;
|
|
7
7
|
constructor(endpoint: string, NetRequest: NetRequestFactory);
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 获取鹅鸭杀房间内详情
|
|
10
|
+
*
|
|
11
|
+
* - 参数 `invitationCode` 默认从 url query 的 `invitation_code` 参数读取
|
|
12
|
+
* - 参数 `serverId` 默认从 url query 的 `server_id` 参数读取
|
|
13
|
+
* - 参数 `expiresAt` 默认从 url query 的 `expires_at` 参数读取
|
|
10
14
|
*
|
|
11
15
|
* 接口文档 https://www.kdocs.cn/l/cf2mO2uRLqh9?linkname=vpkahwYfte
|
|
12
16
|
*
|
|
13
17
|
* 响应依据 GM 协议 https://www.kdocs.cn/l/cnZbBuB5x12C?linkname=pRQPKz6vUa
|
|
14
18
|
*/
|
|
15
|
-
describeRoomByCode(invitationCode?: string): Promise<{
|
|
19
|
+
describeRoomByCode(invitationCode?: string, serverId?: number | string, expiresAt?: number | string): Promise<{
|
|
16
20
|
room_id: string;
|
|
17
21
|
inviter_role_id: number;
|
|
18
22
|
room_status: import("./ggd.enums").GGDRoomStatus;
|
|
19
|
-
room_mode: string;
|
|
20
|
-
room_tags: string[];
|
|
21
|
-
max_members: number;
|
|
23
|
+
room_mode: string | undefined;
|
|
24
|
+
room_tags: string[] | undefined;
|
|
25
|
+
max_members: number | undefined;
|
|
22
26
|
members: {
|
|
23
27
|
role_id: /*elided*/ any;
|
|
24
28
|
role_name: /*elided*/ any;
|
|
25
29
|
avatar_url: /*elided*/ any;
|
|
26
|
-
}[];
|
|
30
|
+
}[] | undefined;
|
|
27
31
|
} | {
|
|
28
32
|
error: RequestInternalError | "room_not_found" | "invitation_code_invalid" | "invitation_code_expired";
|
|
29
33
|
message: string;
|
package/types/src/ggd.enum.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ValueOf } from "@seayoo-web/utils";
|
|
2
|
-
/** 房间状态 */
|
|
3
|
-
export declare const GGDRoomStatus: {
|
|
4
|
-
/** 等待中 */
|
|
5
|
-
readonly Waiting: 1;
|
|
6
|
-
/** 游戏中 */
|
|
7
|
-
readonly Playing: 2;
|
|
8
|
-
};
|
|
9
|
-
export type GGDRoomStatus = ValueOf<typeof GGDRoomStatus>;
|
|
10
|
-
export declare const GGDRoomStatusValidator: import("@seayoo-web/validator").NumberValidator<GGDRoomStatus, false, false> & {
|
|
11
|
-
int: never;
|
|
12
|
-
min: never;
|
|
13
|
-
max: never;
|
|
14
|
-
allowNaN: never;
|
|
15
|
-
allowInfinity: never;
|
|
16
|
-
unsafe: never;
|
|
17
|
-
enum: never;
|
|
18
|
-
disallow: never;
|
|
19
|
-
optional: never;
|
|
20
|
-
maybeNull: never;
|
|
21
|
-
lock: never;
|
|
22
|
-
};
|