@seayoo-web/gamer-api 2.12.6 → 2.13.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 +281 -271
- package/package.json +3 -3
- package/types/src/event.config/feature.d.ts +4 -2
- package/types/src/event.config/feature.ugcLike.d.ts +12 -0
- package/types/src/event.engage/engage.d.ts +1 -0
- package/types/src/event.engage/engage.ugcLike.d.ts +4 -0
- package/types/src/event.engage/index.d.ts +3 -3
- package/types/src/event.enums.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/gamer-api",
|
|
3
3
|
"description": "agent for gamer api",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.13.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@seayoo-web/validator": "1.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@seayoo-web/combo-webview": "^2.8.0",
|
|
42
41
|
"@seayoo-web/utils": "^4.1.3",
|
|
43
|
-
"@seayoo-web/validator": "^1.1.1"
|
|
42
|
+
"@seayoo-web/validator": "^1.1.1",
|
|
43
|
+
"@seayoo-web/combo-webview": "^2.8.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prebuild": "pnpm -F validator build && pnpm -F request build && pnpm -F combo-webview build",
|
|
@@ -17,6 +17,7 @@ import type { EventFeatureConfigOfSubscribe } from "./feature.subscribe";
|
|
|
17
17
|
import type { EventFeatureConfigOfSurvey } from "./feature.survey";
|
|
18
18
|
import type { EventFeatureConfigOfTeam } from "./feature.team";
|
|
19
19
|
import type { EventFeatureConfigOfUgc } from "./feature.ugc";
|
|
20
|
+
import type { EventFeatureConfigOfUgcLike } from "./feature.ugcLike";
|
|
20
21
|
import type { EventFeatureConfigOfVote } from "./feature.vote";
|
|
21
22
|
import type { EventFeatureConfigOfVote2 } from "./feature.vote2";
|
|
22
23
|
import type { EventFeatureConfigOfZeroChatgpt } from "./feature.zeroChatgpt";
|
|
@@ -41,5 +42,6 @@ export * from "./feature.vote";
|
|
|
41
42
|
export * from "./feature.vote2";
|
|
42
43
|
export * from "./feature.claimActivationKey";
|
|
43
44
|
export * from "./feature.ugc";
|
|
44
|
-
export
|
|
45
|
-
export
|
|
45
|
+
export * from "./feature.ugcLike";
|
|
46
|
+
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;
|
|
47
|
+
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>], false, false>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EventFeatureBaseConfig } from "./feature.base";
|
|
2
|
+
declare const featureType: "ugc";
|
|
3
|
+
export interface FeatureUgcLikeConfig {
|
|
4
|
+
/** 关联的投稿玩法 ID */
|
|
5
|
+
ugc_feature_id: number;
|
|
6
|
+
}
|
|
7
|
+
export type EventFeatureConfigOfUgcLike = EventFeatureBaseConfig & {
|
|
8
|
+
feature_type: typeof featureType;
|
|
9
|
+
config: FeatureUgcLikeConfig;
|
|
10
|
+
};
|
|
11
|
+
export declare const EventFeatureConfigOfUgcLikeValidator: import("@seayoo-web/validator").ObjectValidator<EventFeatureConfigOfUgcLike, false, false>;
|
|
12
|
+
export {};
|
|
@@ -31,6 +31,7 @@ export * from "./engage.vote2";
|
|
|
31
31
|
export * from "./engage.claimActivationKey";
|
|
32
32
|
export * from "./engage.zeroChatGPT";
|
|
33
33
|
export * from "./engage.ugc";
|
|
34
|
+
export * from "./engage.ugcLike";
|
|
34
35
|
export type EmptyObject = Record<string | number | symbol, never>;
|
|
35
36
|
export type UserEngagementData = PreregisterEngagementData | LotteryEngagementData | SurveyEngagementData | InviteEngagementData | ShareEngagementData | VoteEngagementData | Vote2EngagementData | WeixinSubscribeEngagementData | CashbackEngagementData | GiftCodeEngagementData | TeamEngagementData | QuestEngagementData | LotteryDrawEngagementData | ClaimActivationKeyEngagementData | ZeroChatGPTData | UgcEngagementData | EmptyObject;
|
|
36
37
|
export declare const UserEngagementDataValidator: import("@seayoo-web/validator").UnionValidator<[import("@seayoo-web/validator").ObjectValidator<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UserEngagementData, CommentEngagementParam, PreregisterEngagementParam, LotteryEngagementParam, LotteryDrawEngagementParam, ShareEngagementParam, SubscribeEngagementParam, TeamEngagementParam, VoteEngagementParam, Vote2EngagementParam, UgcEngagementParam, Vote2EngagementError, LotteryEngagementError, ClaimActivationKeyEngagementError, LotteryDrawEngagementError, TeamEngagementError, GiftCodeEngagementError } from "./engage";
|
|
1
|
+
import type { UserEngagementData, CommentEngagementParam, PreregisterEngagementParam, LotteryEngagementParam, LotteryDrawEngagementParam, ShareEngagementParam, SubscribeEngagementParam, TeamEngagementParam, VoteEngagementParam, Vote2EngagementParam, UgcEngagementParam, UgcLikeEngagementParam, Vote2EngagementError, LotteryEngagementError, ClaimActivationKeyEngagementError, LotteryDrawEngagementError, TeamEngagementError, GiftCodeEngagementError } from "./engage";
|
|
2
2
|
import type { Reward } from "./reward";
|
|
3
3
|
import type { FeatureType } from "../event.enums";
|
|
4
4
|
import type { ZeroChatGPTEngagementParam } from "./engage.zeroChatGPT";
|
|
@@ -32,12 +32,12 @@ export declare const UserEngagementValidator: import("@seayoo-web/validator").Ob
|
|
|
32
32
|
/**
|
|
33
33
|
* 部分玩法参与时需要提供的参数
|
|
34
34
|
*/
|
|
35
|
-
export type EngagementParam = null | PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | Vote2EngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam | ZeroChatGPTEngagementParam | UgcEngagementParam;
|
|
35
|
+
export type EngagementParam = null | PreregisterEngagementParam | LotteryEngagementParam | CommentEngagementParam | ShareEngagementParam | VoteEngagementParam | Vote2EngagementParam | SubscribeEngagementParam | TeamEngagementParam | LotteryDrawEngagementParam | ZeroChatGPTEngagementParam | UgcEngagementParam | UgcLikeEngagementParam;
|
|
36
36
|
export type EngagementFeatureType = FeatureType | unknown;
|
|
37
37
|
/**
|
|
38
38
|
* 根据玩法类型推导需要提交的参数数据类型
|
|
39
39
|
*/
|
|
40
|
-
export type InferEngagementParam<T extends EngagementFeatureType> = [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam : [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 : EngagementParam;
|
|
40
|
+
export type InferEngagementParam<T extends EngagementFeatureType> = [T] extends ["preregister"] ? PreregisterEngagementParam : [T] extends ["lottery"] ? LotteryEngagementParam : [T] extends ["comment"] ? CommentEngagementParam : [T] extends ["share"] ? ShareEngagementParam : [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 : EngagementParam;
|
|
41
41
|
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
42
|
export type EngagementError = EngagementCommonError | TeamEngagementError | Vote2EngagementError | ClaimActivationKeyEngagementError | LotteryDrawEngagementError | LotteryEngagementError | GiftCodeEngagementError;
|
|
43
43
|
/**
|
|
@@ -148,6 +148,8 @@ export declare const FeatureType: {
|
|
|
148
148
|
readonly ZeroChatgpt: "zero_chatgpt";
|
|
149
149
|
/** 投稿 */
|
|
150
150
|
readonly Ugc: "ugc";
|
|
151
|
+
/** 投稿点赞 */
|
|
152
|
+
readonly UgcLike: "ugc_like";
|
|
151
153
|
};
|
|
152
154
|
export type FeatureType = ValueOf<typeof FeatureType>;
|
|
153
155
|
export declare const FeatureTypeValidator: import("@seayoo-web/validator").StringValidator<FeatureType, false, false> & {
|