@seayoo-web/gamer-api 1.1.18 → 2.0.0
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 +1415 -1072
- package/package.json +6 -6
- package/types/src/club.d.ts +11 -8
- package/types/src/club.define.d.ts +157 -55
- package/types/src/club.enums.d.ts +84 -33
- package/types/src/club.guards.d.ts +13 -23
- package/types/src/community.d.ts +20 -20
- package/types/src/community.define.d.ts +155 -62
- package/types/src/community.enums.d.ts +74 -33
- package/types/src/community.guards.d.ts +20 -28
- package/types/src/event.config/feature.base.d.ts +23 -0
- package/types/src/event.config/feature.cashback.d.ts +18 -0
- package/types/src/event.config/feature.checkIn.d.ts +7 -0
- package/types/src/event.config/feature.claimRewards.d.ts +7 -0
- package/types/src/event.config/feature.comment.d.ts +14 -0
- package/types/src/event.config/feature.d.ts +38 -0
- package/types/src/event.config/feature.follow.d.ts +24 -0
- package/types/src/event.config/feature.giftcode.d.ts +24 -0
- package/types/src/event.config/feature.invite.d.ts +12 -0
- package/types/src/event.config/feature.invitedRegister.d.ts +7 -0
- package/types/src/event.config/feature.lottery.d.ts +40 -0
- package/types/src/event.config/feature.lotteryDraw.d.ts +14 -0
- package/types/src/event.config/feature.preregister.d.ts +7 -0
- package/types/src/event.config/feature.quest.d.ts +22 -0
- package/types/src/event.config/feature.register.d.ts +7 -0
- package/types/src/event.config/feature.share.d.ts +16 -0
- package/types/src/event.config/feature.subscribe.d.ts +12 -0
- package/types/src/event.config/feature.survey.d.ts +14 -0
- package/types/src/event.config/feature.team.d.ts +14 -0
- package/types/src/event.config/feature.vote.d.ts +44 -0
- package/types/src/event.config/index.d.ts +23 -0
- package/types/src/event.config/reward.d.ts +55 -0
- package/types/src/event.d.ts +47 -38
- package/types/src/event.define.d.ts +20 -309
- package/types/src/event.engage/engage.cashback.d.ts +9 -0
- package/types/src/event.engage/engage.comment.d.ts +22 -0
- package/types/src/event.engage/engage.giftcode.d.ts +5 -0
- package/types/src/event.engage/engage.invite.d.ts +9 -0
- package/types/src/event.engage/engage.lottery.d.ts +9 -0
- package/types/src/event.engage/engage.lotteryDraw.d.ts +40 -0
- package/types/src/event.engage/engage.preregister.d.ts +11 -0
- package/types/src/event.engage/engage.quest.d.ts +28 -0
- package/types/src/event.engage/engage.share.d.ts +9 -0
- package/types/src/event.engage/engage.subscribe.d.ts +14 -0
- package/types/src/event.engage/engage.survey.d.ts +7 -0
- package/types/src/event.engage/engage.team.d.ts +53 -0
- package/types/src/event.engage/engage.vote.d.ts +9 -0
- package/types/src/event.engage/index.d.ts +83 -0
- package/types/src/event.engage/reward.d.ts +89 -0
- package/types/src/event.enums.d.ts +298 -109
- package/types/src/event.guards.d.ts +22 -26
- package/types/src/token.d.ts +2 -2
- package/types/src/weixin.d.ts +4 -4
- package/types/src/weixin.define.d.ts +1 -1
package/types/src/community.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NotificationCategory } from "./community.enums";
|
|
2
2
|
import type { AuthToken } from "./token";
|
|
3
|
-
import type {
|
|
3
|
+
import type { RequestInternalError } from "@seayoo-web/request";
|
|
4
4
|
export * from "./community.enums";
|
|
5
5
|
export * from "./community.define";
|
|
6
6
|
export declare class CommunityApi {
|
|
@@ -25,7 +25,7 @@ export declare class CommunityApi {
|
|
|
25
25
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=Jvw7xMK31K
|
|
26
26
|
*/
|
|
27
27
|
getTopic(topicId: number): Promise<import("./community.define").Topic | {
|
|
28
|
-
error:
|
|
28
|
+
error: RequestInternalError | "topic_not_enabled" | "topic_not_found";
|
|
29
29
|
}>;
|
|
30
30
|
/**
|
|
31
31
|
* 获取社区帖子列表
|
|
@@ -60,7 +60,7 @@ export declare class CommunityApi {
|
|
|
60
60
|
posts: import("./community.define").Post[];
|
|
61
61
|
next_token: string | undefined;
|
|
62
62
|
} | {
|
|
63
|
-
error:
|
|
63
|
+
error: RequestInternalError | "forum_not_found" | "topic_not_found";
|
|
64
64
|
}>;
|
|
65
65
|
/**
|
|
66
66
|
* 获取社区置顶帖子列表
|
|
@@ -71,7 +71,7 @@ export declare class CommunityApi {
|
|
|
71
71
|
posts: import("./community.define").Post[];
|
|
72
72
|
next_token: string | undefined;
|
|
73
73
|
} | {
|
|
74
|
-
error:
|
|
74
|
+
error: RequestInternalError | "forum_not_found";
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
77
77
|
* 根据帖子 id 获取帖子详情
|
|
@@ -79,7 +79,7 @@ export declare class CommunityApi {
|
|
|
79
79
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=hj1AZy5rcP
|
|
80
80
|
*/
|
|
81
81
|
getPost(postId: number): Promise<import("./community.define").Post | {
|
|
82
|
-
error:
|
|
82
|
+
error: RequestInternalError | "post_deleted";
|
|
83
83
|
}>;
|
|
84
84
|
/**
|
|
85
85
|
* 发布帖子
|
|
@@ -93,10 +93,10 @@ export declare class CommunityApi {
|
|
|
93
93
|
image_urls?: string[];
|
|
94
94
|
topic_ids?: number[];
|
|
95
95
|
}): Promise<{
|
|
96
|
-
post: import("./community.define").Post
|
|
96
|
+
post: import("./community.define").Post;
|
|
97
97
|
antispam: import("./community.define").Antispam;
|
|
98
98
|
} | {
|
|
99
|
-
error:
|
|
99
|
+
error: RequestInternalError | "post_body_too_long" | "post_subject_too_long" | "post_tag_already_exists" | "moderation_check_text_error" | "moderation_check_image_error" | "unknown_moderation_suggestion" | "invalid_content_length" | "forum_disabled" | "not_allowed_to_post" | "please_real_name" | "post_tag_not_exists";
|
|
100
100
|
}>;
|
|
101
101
|
/**
|
|
102
102
|
* 获取社区帖子评论列表
|
|
@@ -116,7 +116,7 @@ export declare class CommunityApi {
|
|
|
116
116
|
comments: import("./community.define").Comment[];
|
|
117
117
|
next_token: string | undefined;
|
|
118
118
|
} | {
|
|
119
|
-
error:
|
|
119
|
+
error: RequestInternalError | "post_not_found" | "post_deleted";
|
|
120
120
|
}>;
|
|
121
121
|
/**
|
|
122
122
|
* 根据评论 id 获取评论详情
|
|
@@ -124,7 +124,7 @@ export declare class CommunityApi {
|
|
|
124
124
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=RIc7oxVGae
|
|
125
125
|
*/
|
|
126
126
|
getComment(commentId: number): Promise<import("./community.define").Comment | {
|
|
127
|
-
error:
|
|
127
|
+
error: RequestInternalError | "comment_not_found" | "comment_deleted";
|
|
128
128
|
}>;
|
|
129
129
|
/**
|
|
130
130
|
* 帖子下发表评论
|
|
@@ -140,9 +140,9 @@ export declare class CommunityApi {
|
|
|
140
140
|
image_url?: string;
|
|
141
141
|
}): Promise<{
|
|
142
142
|
comment: import("./community.define").Comment | undefined;
|
|
143
|
-
antispam: import("./community.define").
|
|
143
|
+
antispam: import("./community.define").Comment | undefined;
|
|
144
144
|
} | {
|
|
145
|
-
error:
|
|
145
|
+
error: RequestInternalError | "moderation_check_text_error" | "moderation_check_image_error" | "unknown_moderation_suggestion" | "invalid_content_length" | "forum_disabled" | "post_not_found" | "post_already_deleted";
|
|
146
146
|
}>;
|
|
147
147
|
/**
|
|
148
148
|
* 获取社区帖子评论回复列表
|
|
@@ -170,7 +170,7 @@ export declare class CommunityApi {
|
|
|
170
170
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=kxhcSXD3MG
|
|
171
171
|
*/
|
|
172
172
|
getReply(replyId: number): Promise<import("./community.define").Reply | {
|
|
173
|
-
error:
|
|
173
|
+
error: RequestInternalError | "reply_not_found" | "reply_deleted";
|
|
174
174
|
}>;
|
|
175
175
|
/**
|
|
176
176
|
* 回复帖子评论或回复
|
|
@@ -185,10 +185,10 @@ export declare class CommunityApi {
|
|
|
185
185
|
/** 回复的回复 ID (仅当回复回复的时候需要) */
|
|
186
186
|
reply_id?: number;
|
|
187
187
|
}): Promise<{
|
|
188
|
-
reply
|
|
189
|
-
antispam
|
|
188
|
+
reply: import("./community.define").Reply | undefined;
|
|
189
|
+
antispam: import("./community.define").Antispam | undefined;
|
|
190
190
|
} | {
|
|
191
|
-
error:
|
|
191
|
+
error: RequestInternalError | "moderation_check_text_error" | "moderation_check_image_error" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
|
|
192
192
|
}>;
|
|
193
193
|
/**
|
|
194
194
|
* 对 帖子/评论/回复 点赞
|
|
@@ -201,7 +201,7 @@ export declare class CommunityApi {
|
|
|
201
201
|
/** 目标 ID */
|
|
202
202
|
target_id: number;
|
|
203
203
|
}): Promise<true | {
|
|
204
|
-
error:
|
|
204
|
+
error: RequestInternalError | "post_not_found" | "post_deleted" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
|
|
205
205
|
}>;
|
|
206
206
|
/**
|
|
207
207
|
* 对 帖子/评论/回复 取消点赞
|
|
@@ -214,14 +214,14 @@ export declare class CommunityApi {
|
|
|
214
214
|
/** 目标 ID */
|
|
215
215
|
target_id: number;
|
|
216
216
|
}): Promise<true | {
|
|
217
|
-
error:
|
|
217
|
+
error: RequestInternalError | "post_not_found" | "post_deleted" | "comment_not_found" | "comment_deleted" | "reply_not_found" | "reply_deleted";
|
|
218
218
|
}>;
|
|
219
219
|
/**
|
|
220
220
|
* 获取资源预上传地址
|
|
221
221
|
*
|
|
222
222
|
* https://kdocs.cn/l/cbggfJodHLIz?linkname=dWWhpoShxZ
|
|
223
223
|
*/
|
|
224
|
-
|
|
224
|
+
getMediaPresignedUrl(option: {
|
|
225
225
|
/** 资源文件大小 */
|
|
226
226
|
content_length: number;
|
|
227
227
|
/** 资源文件 MIME 类型 */
|
|
@@ -230,7 +230,7 @@ export declare class CommunityApi {
|
|
|
230
230
|
filename: string;
|
|
231
231
|
/** 资源文件内容的 SHA-256 哈希值,用于校验上传对象的完整性 */
|
|
232
232
|
content_sha256: string;
|
|
233
|
-
}): Promise<import("./community.define").
|
|
233
|
+
}): Promise<import("./community.define").PresignedUrlResponse | null>;
|
|
234
234
|
/**
|
|
235
235
|
* 获取用户社区通知
|
|
236
236
|
*
|
|
@@ -246,7 +246,7 @@ export declare class CommunityApi {
|
|
|
246
246
|
/** 分页标识,不传默认首次查询 */
|
|
247
247
|
next_token?: string;
|
|
248
248
|
}): Promise<{
|
|
249
|
-
notifications: import("./community.define").
|
|
249
|
+
notifications: (import("./community.define").NotificationSystem | import("./community.define").NotificationPost | import("./community.define").NotificationPostComment | import("./community.define").NotificationCommentReply | import("./community.define").NotificationComment | import("./community.define").NotificationReplyReplied | import("./community.define").NotificationReply)[];
|
|
250
250
|
next_token: string | undefined;
|
|
251
251
|
} | {
|
|
252
252
|
notifications: never[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NotificationType, ForumMode, PostStatus } from "./community.enums";
|
|
2
|
+
/** spell-checker:ignore antispam */
|
|
2
3
|
export interface Forum {
|
|
3
4
|
/** 版块 id */
|
|
4
5
|
forum_id: number;
|
|
@@ -15,6 +16,12 @@ export interface Forum {
|
|
|
15
16
|
/** 指定可发帖的用户 id */
|
|
16
17
|
member_ids: number[];
|
|
17
18
|
}
|
|
19
|
+
export declare const ForumValidator: import("@seayoo-web/utils").ObjectValidator<Forum, false, false> & {
|
|
20
|
+
plain: never;
|
|
21
|
+
optional: never;
|
|
22
|
+
maybeNull: never;
|
|
23
|
+
lock: never;
|
|
24
|
+
};
|
|
18
25
|
export interface Topic {
|
|
19
26
|
/** 话题 ID */
|
|
20
27
|
topic_id: number;
|
|
@@ -29,6 +36,12 @@ export interface Topic {
|
|
|
29
36
|
/** 话题下帖子数量 */
|
|
30
37
|
post_num: number;
|
|
31
38
|
}
|
|
39
|
+
export declare const TopicValidator: import("@seayoo-web/utils").ObjectValidator<Topic, false, false> & {
|
|
40
|
+
plain: never;
|
|
41
|
+
optional: never;
|
|
42
|
+
maybeNull: never;
|
|
43
|
+
lock: never;
|
|
44
|
+
};
|
|
32
45
|
export interface Post {
|
|
33
46
|
/** 帖子 ID */
|
|
34
47
|
post_id: number;
|
|
@@ -67,10 +80,76 @@ export interface Post {
|
|
|
67
80
|
/** 帖子发布时间 */
|
|
68
81
|
create_time: number;
|
|
69
82
|
}
|
|
83
|
+
export declare const PostValidator: import("@seayoo-web/utils").ObjectValidator<Post, false, false> & {
|
|
84
|
+
plain: never;
|
|
85
|
+
optional: never;
|
|
86
|
+
maybeNull: never;
|
|
87
|
+
lock: never;
|
|
88
|
+
};
|
|
70
89
|
export interface Antispam {
|
|
71
90
|
/** 安全检测返回异常提示 */
|
|
72
91
|
err_msg?: string;
|
|
73
92
|
}
|
|
93
|
+
export declare const AntispamValidator: import("@seayoo-web/utils").ObjectValidator<Antispam, false, false> & {
|
|
94
|
+
plain: never;
|
|
95
|
+
optional: never;
|
|
96
|
+
maybeNull: never;
|
|
97
|
+
lock: never;
|
|
98
|
+
};
|
|
99
|
+
export interface ReplyTo {
|
|
100
|
+
/** 回复 ID */
|
|
101
|
+
reply_id: number;
|
|
102
|
+
/** 回复内容 */
|
|
103
|
+
reply_content?: string;
|
|
104
|
+
/** 回复者的 ID */
|
|
105
|
+
replied_by: string;
|
|
106
|
+
/** 回复者的昵称 */
|
|
107
|
+
nickname: string;
|
|
108
|
+
/** 回复者的头像 */
|
|
109
|
+
avatar_url: string;
|
|
110
|
+
}
|
|
111
|
+
export declare const ReplyToValidator: import("@seayoo-web/utils").ObjectValidator<ReplyTo, false, false> & {
|
|
112
|
+
plain: never;
|
|
113
|
+
optional: never;
|
|
114
|
+
maybeNull: never;
|
|
115
|
+
lock: never;
|
|
116
|
+
};
|
|
117
|
+
export interface Reply {
|
|
118
|
+
/** 回复 ID */
|
|
119
|
+
reply_id: number;
|
|
120
|
+
/** 评论 ID */
|
|
121
|
+
comment_id: number;
|
|
122
|
+
/** 评论内容 */
|
|
123
|
+
comment_content?: string;
|
|
124
|
+
/** 评论发布者的 ID */
|
|
125
|
+
commented_by?: string;
|
|
126
|
+
/** 评论发布者的昵称 */
|
|
127
|
+
commented_by_nickname?: string;
|
|
128
|
+
/** 评论发布者的头像 */
|
|
129
|
+
commented_by_avatar_url?: string;
|
|
130
|
+
/** 回复者的 ID */
|
|
131
|
+
replied_by: string;
|
|
132
|
+
/** 回复者的昵称 */
|
|
133
|
+
nickname: string;
|
|
134
|
+
/** 回复者的头像 */
|
|
135
|
+
avatar_url: string;
|
|
136
|
+
/** 回复内容 */
|
|
137
|
+
content: string;
|
|
138
|
+
/** 点赞数量 */
|
|
139
|
+
like_num: number;
|
|
140
|
+
/** 当前用户是否点赞 */
|
|
141
|
+
liked: boolean;
|
|
142
|
+
/** 回复的目标 */
|
|
143
|
+
reply_to: ReplyTo;
|
|
144
|
+
/** 回复发布时间 */
|
|
145
|
+
create_time: number;
|
|
146
|
+
}
|
|
147
|
+
export declare const ReplyValidator: import("@seayoo-web/utils").ObjectValidator<Reply, false, false> & {
|
|
148
|
+
plain: never;
|
|
149
|
+
optional: never;
|
|
150
|
+
maybeNull: never;
|
|
151
|
+
lock: never;
|
|
152
|
+
};
|
|
74
153
|
export interface Comment {
|
|
75
154
|
/** 评论 ID */
|
|
76
155
|
comment_id: number;
|
|
@@ -111,49 +190,13 @@ export interface Comment {
|
|
|
111
190
|
/** 评论下最新两条回复 */
|
|
112
191
|
replies?: Reply[];
|
|
113
192
|
}
|
|
114
|
-
export
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
/** 评论发布者的 ID */
|
|
122
|
-
commented_by?: string;
|
|
123
|
-
/** 评论发布者的昵称 */
|
|
124
|
-
commented_by_nickname?: string;
|
|
125
|
-
/** 评论发布者的头像 */
|
|
126
|
-
commented_by_avatar_url?: string;
|
|
127
|
-
/** 回复者的 ID */
|
|
128
|
-
replied_by: string;
|
|
129
|
-
/** 回复者的昵称 */
|
|
130
|
-
nickname: string;
|
|
131
|
-
/** 回复者的头像 */
|
|
132
|
-
avatar_url: string;
|
|
133
|
-
/** 回复内容 */
|
|
134
|
-
content: string;
|
|
135
|
-
/** 点赞数量 */
|
|
136
|
-
like_num: number;
|
|
137
|
-
/** 当前用户是否点赞 */
|
|
138
|
-
liked: boolean;
|
|
139
|
-
/** 回复的目标 */
|
|
140
|
-
reply_to: ReplyTo;
|
|
141
|
-
/** 回复发布时间 */
|
|
142
|
-
create_time: number;
|
|
143
|
-
}
|
|
144
|
-
export interface ReplyTo {
|
|
145
|
-
/** 回复 ID */
|
|
146
|
-
reply_id: number;
|
|
147
|
-
/** 回复内容 */
|
|
148
|
-
reply_content?: string;
|
|
149
|
-
/** 回复者的 ID */
|
|
150
|
-
replied_by: string;
|
|
151
|
-
/** 回复者的昵称 */
|
|
152
|
-
nickname: string;
|
|
153
|
-
/** 回复者的头像 */
|
|
154
|
-
avatar_url: string;
|
|
155
|
-
}
|
|
156
|
-
export interface PresignUrlResponse {
|
|
193
|
+
export declare const CommentValidator: import("@seayoo-web/utils").ObjectValidator<Comment, false, false> & {
|
|
194
|
+
plain: never;
|
|
195
|
+
optional: never;
|
|
196
|
+
maybeNull: never;
|
|
197
|
+
lock: never;
|
|
198
|
+
};
|
|
199
|
+
export interface PresignedUrlResponse {
|
|
157
200
|
/** 资源文件的真实地址 */
|
|
158
201
|
image_url: string;
|
|
159
202
|
/** 媒体文件临时上传地址(有效期 5min) */
|
|
@@ -161,6 +204,12 @@ export interface PresignUrlResponse {
|
|
|
161
204
|
/** 媒体文件是否已存在,已存在无需上传 */
|
|
162
205
|
existed: boolean;
|
|
163
206
|
}
|
|
207
|
+
export declare const PresignedUrlResponseValidator: import("@seayoo-web/utils").ObjectValidator<PresignedUrlResponse, false, false> & {
|
|
208
|
+
plain: never;
|
|
209
|
+
optional: never;
|
|
210
|
+
maybeNull: never;
|
|
211
|
+
lock: never;
|
|
212
|
+
};
|
|
164
213
|
export interface NotificationBase {
|
|
165
214
|
/** 通知的 ID */
|
|
166
215
|
notification_id: string;
|
|
@@ -177,13 +226,25 @@ export interface NotificationBase {
|
|
|
177
226
|
/** 触发通知的用户头像 */
|
|
178
227
|
origin_user_avatar_url: string;
|
|
179
228
|
}
|
|
180
|
-
export
|
|
229
|
+
export declare const NotificationBaseValidator: import("@seayoo-web/utils").ObjectValidator<NotificationBase, false, false> & {
|
|
230
|
+
plain: never;
|
|
231
|
+
optional: never;
|
|
232
|
+
maybeNull: never;
|
|
233
|
+
lock: never;
|
|
234
|
+
};
|
|
235
|
+
export interface NotificationPayloadSystem {
|
|
181
236
|
/** 系统通知的标题 */
|
|
182
237
|
system_message_subject: string;
|
|
183
238
|
/** 系统通知的内容 */
|
|
184
239
|
system_message_content: string;
|
|
185
240
|
}
|
|
186
|
-
export
|
|
241
|
+
export declare const NotificationPayloadSystemValidator: import("@seayoo-web/utils").ObjectValidator<NotificationPayloadSystem, false, false> & {
|
|
242
|
+
plain: never;
|
|
243
|
+
optional: never;
|
|
244
|
+
maybeNull: never;
|
|
245
|
+
lock: never;
|
|
246
|
+
};
|
|
247
|
+
export interface NotificationPayloadPost {
|
|
187
248
|
/** 帖子 ID */
|
|
188
249
|
post_id: number;
|
|
189
250
|
/** 帖子标题 */
|
|
@@ -193,35 +254,58 @@ export interface NotificationPaylodPost {
|
|
|
193
254
|
/** 帖子的首张图片地址 */
|
|
194
255
|
post_image_url: string;
|
|
195
256
|
}
|
|
196
|
-
export
|
|
257
|
+
export declare const NotificationPayloadPostValidator: import("@seayoo-web/utils").ObjectValidator<NotificationPayloadPost, false, false> & {
|
|
258
|
+
plain: never;
|
|
259
|
+
optional: never;
|
|
260
|
+
maybeNull: never;
|
|
261
|
+
lock: never;
|
|
262
|
+
};
|
|
263
|
+
export interface NotificationPayloadComment {
|
|
197
264
|
/** 评论 ID */
|
|
198
265
|
comment_id: number;
|
|
199
266
|
/** 评论内容 */
|
|
200
267
|
comment_content: string;
|
|
201
268
|
}
|
|
202
|
-
export
|
|
269
|
+
export declare const NotificationPayloadCommentValidator: import("@seayoo-web/utils").ObjectValidator<NotificationPayloadComment, false, false> & {
|
|
270
|
+
plain: never;
|
|
271
|
+
optional: never;
|
|
272
|
+
maybeNull: never;
|
|
273
|
+
lock: never;
|
|
274
|
+
};
|
|
275
|
+
export interface NotificationPayloadReply {
|
|
203
276
|
/** 回复 ID */
|
|
204
277
|
reply_id: number;
|
|
205
278
|
/** 回复内容 */
|
|
206
279
|
reply_content: string;
|
|
207
280
|
}
|
|
208
|
-
export
|
|
209
|
-
|
|
281
|
+
export declare const NotificationPayloadReplyValidator: import("@seayoo-web/utils").ObjectValidator<NotificationPayloadReply, false, false> & {
|
|
282
|
+
plain: never;
|
|
283
|
+
optional: never;
|
|
284
|
+
maybeNull: never;
|
|
285
|
+
lock: never;
|
|
286
|
+
};
|
|
287
|
+
export interface NotificationSystem extends NotificationBase, NotificationPayloadSystem {
|
|
288
|
+
notification_type: typeof NotificationType.System;
|
|
210
289
|
}
|
|
211
|
-
export
|
|
212
|
-
|
|
290
|
+
export declare const NotificationSystemValidator: import("@seayoo-web/utils").ObjectValidator<NotificationSystem, false, false>;
|
|
291
|
+
export interface NotificationPost extends NotificationBase, NotificationPayloadPost {
|
|
292
|
+
notification_type: typeof NotificationType.PostPinned | typeof NotificationType.PostHighlighted | typeof NotificationType.PostDeleted | typeof NotificationType.PostLiked;
|
|
213
293
|
}
|
|
214
|
-
export
|
|
215
|
-
|
|
294
|
+
export declare const NotificationPostValidator: import("@seayoo-web/utils").ObjectValidator<NotificationPost, false, false>;
|
|
295
|
+
export interface NotificationPostComment extends NotificationBase, NotificationPayloadPost, NotificationPayloadComment {
|
|
296
|
+
notification_type: typeof NotificationType.PostCommented;
|
|
216
297
|
}
|
|
217
|
-
export
|
|
218
|
-
|
|
298
|
+
export declare const NotificationPostCommentValidator: import("@seayoo-web/utils").ObjectValidator<NotificationPostComment, false, false>;
|
|
299
|
+
export interface NotificationCommentReply extends NotificationBase, NotificationPayloadComment, NotificationPayloadReply {
|
|
300
|
+
notification_type: typeof NotificationType.CommentReplied;
|
|
219
301
|
}
|
|
220
|
-
export
|
|
221
|
-
|
|
302
|
+
export declare const NotificationCommentReplyValidator: import("@seayoo-web/utils").ObjectValidator<NotificationCommentReply, false, false>;
|
|
303
|
+
export interface NotificationComment extends NotificationBase, NotificationPayloadComment, NotificationPayloadPost {
|
|
304
|
+
notification_type: typeof NotificationType.CommentLiked | typeof NotificationType.CommentDeleted;
|
|
222
305
|
}
|
|
223
|
-
export
|
|
224
|
-
|
|
306
|
+
export declare const NotificationCommentValidator: import("@seayoo-web/utils").ObjectValidator<NotificationComment, false, false>;
|
|
307
|
+
export interface NotificationReplyReplied extends NotificationBase, NotificationPayloadReply {
|
|
308
|
+
notification_type: typeof NotificationType.ReplyReplied;
|
|
225
309
|
/** 评论 ID */
|
|
226
310
|
comment_id: number;
|
|
227
311
|
/** 回复的回复 ID */
|
|
@@ -229,8 +313,17 @@ export interface NotificationReplyReplied extends NotificationBase, Notification
|
|
|
229
313
|
/** 回复的回复内容 */
|
|
230
314
|
reply_to_reply_content: string;
|
|
231
315
|
}
|
|
232
|
-
export
|
|
233
|
-
|
|
316
|
+
export declare const NotificationReplyRepliedValidator: import("@seayoo-web/utils").ObjectValidator<NotificationReplyReplied, false, false>;
|
|
317
|
+
export interface NotificationReply extends NotificationBase, NotificationPayloadReply, NotificationPayloadComment {
|
|
318
|
+
notification_type: typeof NotificationType.ReplyLiked | typeof NotificationType.ReplyDeleted;
|
|
234
319
|
}
|
|
320
|
+
export declare const NotificationReplyValidator: import("@seayoo-web/utils").ObjectValidator<NotificationReply, false, false>;
|
|
235
321
|
/** 社区通知 */
|
|
236
322
|
export type Notification = NotificationSystem | NotificationPost | NotificationPostComment | NotificationCommentReply | NotificationComment | NotificationReplyReplied | NotificationReply;
|
|
323
|
+
export declare const NotificationValidator: import("@seayoo-web/utils").UnionValidator<[import("@seayoo-web/utils").ObjectValidator<NotificationSystem, false, false>, import("@seayoo-web/utils").ObjectValidator<NotificationPost, false, false>, import("@seayoo-web/utils").ObjectValidator<NotificationPostComment, false, false>, import("@seayoo-web/utils").ObjectValidator<NotificationCommentReply, false, false>, import("@seayoo-web/utils").ObjectValidator<NotificationComment, false, false>, import("@seayoo-web/utils").ObjectValidator<NotificationReplyReplied, false, false>, import("@seayoo-web/utils").ObjectValidator<NotificationReply, false, false>], false, false> & {
|
|
324
|
+
optional: never;
|
|
325
|
+
maybeNull: never;
|
|
326
|
+
key: never;
|
|
327
|
+
satisfies: never;
|
|
328
|
+
lock: never;
|
|
329
|
+
};
|
|
@@ -1,58 +1,99 @@
|
|
|
1
|
+
import { type ValueOf } from "@seayoo-web/utils";
|
|
1
2
|
/** 社区板块模式 */
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const ForumMode: {
|
|
3
4
|
/** 所有人均可以发帖 */
|
|
4
|
-
All
|
|
5
|
+
readonly All: "all";
|
|
5
6
|
/** 指定用户可发帖 */
|
|
6
|
-
Limit
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
readonly Limit: "limit";
|
|
8
|
+
};
|
|
9
|
+
export type ForumMode = ValueOf<typeof ForumMode>;
|
|
10
|
+
export declare const ForumModeValidator: import("@seayoo-web/utils").StringValidator<ForumMode, false, false> & {
|
|
11
|
+
pattern: never;
|
|
12
|
+
url: never;
|
|
13
|
+
dataUri: never;
|
|
14
|
+
enum: never;
|
|
15
|
+
disallow: never;
|
|
16
|
+
optional: never;
|
|
17
|
+
maybeNull: never;
|
|
18
|
+
lock: never;
|
|
19
|
+
};
|
|
9
20
|
/** 社区帖子状态 */
|
|
10
|
-
export declare const
|
|
21
|
+
export declare const PostStatus: {
|
|
11
22
|
/** 待审核(仅自己可见) */
|
|
12
|
-
Pending
|
|
23
|
+
readonly Pending: "pending";
|
|
13
24
|
/** 审核通过 */
|
|
14
|
-
Approved
|
|
25
|
+
readonly Approved: "approved";
|
|
15
26
|
/** 审核不通过 */
|
|
16
|
-
Failed
|
|
27
|
+
readonly Failed: "failed";
|
|
17
28
|
/** 嫌疑(仅自己可见) */
|
|
18
|
-
Suspect
|
|
19
|
-
}
|
|
20
|
-
export
|
|
29
|
+
readonly Suspect: "suspect";
|
|
30
|
+
};
|
|
31
|
+
export type PostStatus = ValueOf<typeof PostStatus>;
|
|
32
|
+
export declare const PostStatusValidator: import("@seayoo-web/utils").StringValidator<PostStatus, false, false> & {
|
|
33
|
+
pattern: never;
|
|
34
|
+
url: never;
|
|
35
|
+
dataUri: never;
|
|
36
|
+
enum: never;
|
|
37
|
+
disallow: never;
|
|
38
|
+
optional: never;
|
|
39
|
+
maybeNull: never;
|
|
40
|
+
lock: never;
|
|
41
|
+
};
|
|
21
42
|
/** 社区通知分类 */
|
|
22
|
-
export declare const
|
|
43
|
+
export declare const NotificationCategory: {
|
|
23
44
|
/** 系统通知 */
|
|
24
|
-
System
|
|
45
|
+
readonly System: "system";
|
|
25
46
|
/** 评论我的 */
|
|
26
|
-
Comment
|
|
47
|
+
readonly Comment: "comment";
|
|
27
48
|
/** 点赞通知 */
|
|
28
|
-
Like
|
|
29
|
-
}
|
|
30
|
-
export
|
|
49
|
+
readonly Like: "like";
|
|
50
|
+
};
|
|
51
|
+
export type NotificationCategory = ValueOf<typeof NotificationCategory>;
|
|
52
|
+
export declare const NotificationCategoryValidator: import("@seayoo-web/utils").StringValidator<NotificationCategory, false, false> & {
|
|
53
|
+
pattern: never;
|
|
54
|
+
url: never;
|
|
55
|
+
dataUri: never;
|
|
56
|
+
enum: never;
|
|
57
|
+
disallow: never;
|
|
58
|
+
optional: never;
|
|
59
|
+
maybeNull: never;
|
|
60
|
+
lock: never;
|
|
61
|
+
};
|
|
31
62
|
/** 社区通知类型 */
|
|
32
|
-
export declare const
|
|
63
|
+
export declare const NotificationType: {
|
|
33
64
|
/** 系统通知 */
|
|
34
|
-
System
|
|
65
|
+
readonly System: "system";
|
|
35
66
|
/** 帖子被置顶 */
|
|
36
|
-
PostPinned
|
|
67
|
+
readonly PostPinned: "post_pinned";
|
|
37
68
|
/** 帖子被加精 */
|
|
38
|
-
PostHighlighted
|
|
69
|
+
readonly PostHighlighted: "post_highlighted";
|
|
39
70
|
/** 帖子被删除 */
|
|
40
|
-
PostDeleted
|
|
71
|
+
readonly PostDeleted: "post_deleted";
|
|
41
72
|
/** 帖子被评论 */
|
|
42
|
-
PostCommented
|
|
73
|
+
readonly PostCommented: "post_commented";
|
|
43
74
|
/** 帖子被点赞 */
|
|
44
|
-
PostLiked
|
|
75
|
+
readonly PostLiked: "post_liked";
|
|
45
76
|
/** 评论被回复 */
|
|
46
|
-
CommentReplied
|
|
77
|
+
readonly CommentReplied: "comment_replied";
|
|
47
78
|
/** 评论被点赞 */
|
|
48
|
-
CommentLiked
|
|
79
|
+
readonly CommentLiked: "comment_liked";
|
|
49
80
|
/** 评论被删除 */
|
|
50
|
-
CommentDeleted
|
|
81
|
+
readonly CommentDeleted: "comment_deleted";
|
|
51
82
|
/** 回复被回复 */
|
|
52
|
-
ReplyReplied
|
|
83
|
+
readonly ReplyReplied: "reply_replied";
|
|
53
84
|
/** 回复被点赞 */
|
|
54
|
-
ReplyLiked
|
|
85
|
+
readonly ReplyLiked: "reply_liked";
|
|
55
86
|
/** 回复被删除 */
|
|
56
|
-
ReplyDeleted
|
|
57
|
-
}
|
|
58
|
-
export
|
|
87
|
+
readonly ReplyDeleted: "reply_deleted";
|
|
88
|
+
};
|
|
89
|
+
export type NotificationType = ValueOf<typeof NotificationType>;
|
|
90
|
+
export declare const NotificationTypeValidator: import("@seayoo-web/utils").StringValidator<NotificationType, false, false> & {
|
|
91
|
+
pattern: never;
|
|
92
|
+
url: never;
|
|
93
|
+
dataUri: never;
|
|
94
|
+
enum: never;
|
|
95
|
+
disallow: never;
|
|
96
|
+
optional: never;
|
|
97
|
+
maybeNull: never;
|
|
98
|
+
lock: never;
|
|
99
|
+
};
|
|
@@ -1,56 +1,48 @@
|
|
|
1
|
-
import type { Antispam, Forum, Post, Topic, Comment, Reply, ReplyTo, Notification, PresignUrlResponse } from "./community.define";
|
|
2
|
-
export declare const isForum: (data: unknown) => data is Forum;
|
|
3
1
|
export declare const isGetForumsResponse: (data: unknown) => data is {
|
|
4
|
-
forums: Forum[];
|
|
2
|
+
forums: import("./community.define").Forum[];
|
|
5
3
|
};
|
|
6
|
-
export declare const isTopic: (data: unknown) => data is Topic;
|
|
7
4
|
export declare const isGetTopicsResponse: (data: unknown) => data is {
|
|
8
|
-
topics: Topic[];
|
|
5
|
+
topics: import("./community.define").Topic[];
|
|
9
6
|
};
|
|
10
7
|
export declare const isGetTopicResponse: (data: unknown) => data is {
|
|
11
|
-
topic: Topic;
|
|
8
|
+
topic: import("./community.define").Topic;
|
|
9
|
+
};
|
|
10
|
+
export declare const isGetPostResponse: (data: unknown) => data is {
|
|
11
|
+
post: import("./community.define").Post;
|
|
12
12
|
};
|
|
13
|
-
export declare const isPost: (data: unknown) => data is Post;
|
|
14
13
|
export declare const isGetPostsResponse: (data: unknown) => data is {
|
|
15
|
-
posts: Post[];
|
|
14
|
+
posts: import("./community.define").Post[];
|
|
16
15
|
next_token: string | undefined;
|
|
17
16
|
};
|
|
18
|
-
export declare const isGetPostResponse: (data: unknown) => data is {
|
|
19
|
-
post: Post;
|
|
20
|
-
};
|
|
21
|
-
export declare const isAntispam: (data: unknown) => data is Antispam;
|
|
22
17
|
export declare const isCreatePostResponse: (data: unknown) => data is {
|
|
23
|
-
post: Post
|
|
24
|
-
antispam: Antispam;
|
|
18
|
+
post: import("./community.define").Post;
|
|
19
|
+
antispam: import("./community.define").Antispam;
|
|
25
20
|
};
|
|
26
|
-
export declare const isReplyTo: (data: unknown) => data is ReplyTo;
|
|
27
|
-
export declare const isReply: (data: unknown) => data is Reply;
|
|
28
21
|
export declare const isRelyListResponse: (data: unknown) => data is {
|
|
29
|
-
replies: Reply[];
|
|
22
|
+
replies: import("./community.define").Reply[];
|
|
30
23
|
next_token: string | undefined;
|
|
31
24
|
};
|
|
32
25
|
export declare const isRelyResponse: (data: unknown) => data is {
|
|
33
|
-
reply: Reply;
|
|
26
|
+
reply: import("./community.define").Reply;
|
|
34
27
|
};
|
|
35
|
-
export declare
|
|
36
|
-
reply
|
|
37
|
-
antispam
|
|
28
|
+
export declare const isCreateReplyResponse: (data: unknown) => data is {
|
|
29
|
+
reply: import("./community.define").Reply | undefined;
|
|
30
|
+
antispam: import("./community.define").Antispam | undefined;
|
|
38
31
|
};
|
|
39
|
-
export declare const isComment: (data: unknown) => data is Comment;
|
|
40
32
|
export declare const isCommentResponse: (data: unknown) => data is {
|
|
41
|
-
comment: Comment;
|
|
33
|
+
comment: import("./community.define").Comment;
|
|
42
34
|
};
|
|
43
35
|
export declare const isCommentListResponse: (data: unknown) => data is {
|
|
44
|
-
comments: Comment[];
|
|
36
|
+
comments: import("./community.define").Comment[];
|
|
45
37
|
next_token: string | undefined;
|
|
46
38
|
};
|
|
47
39
|
export declare const isCreateCommentResponse: (data: unknown) => data is {
|
|
48
|
-
comment: Comment | undefined;
|
|
49
|
-
antispam:
|
|
40
|
+
comment: import("./community.define").Comment | undefined;
|
|
41
|
+
antispam: import("./community.define").Comment | undefined;
|
|
50
42
|
};
|
|
51
|
-
export declare const
|
|
43
|
+
export declare const isGetPresignedUrlResponse: (data: unknown) => data is import("./community.define").PresignedUrlResponse;
|
|
52
44
|
export declare const isNotificationListWithToken: (data: unknown) => data is {
|
|
53
|
-
notifications:
|
|
45
|
+
notifications: (import("./community.define").NotificationSystem | import("./community.define").NotificationPost | import("./community.define").NotificationPostComment | import("./community.define").NotificationCommentReply | import("./community.define").NotificationComment | import("./community.define").NotificationReplyReplied | import("./community.define").NotificationReply)[];
|
|
54
46
|
next_token: string | undefined;
|
|
55
47
|
};
|
|
56
48
|
export declare const isUnreadNotificationsCountResponse: (data: unknown) => data is {
|