feat(sdk): complete action parameter and result types
This commit is contained in:
10 files changed
+1363
-2
No files matched your search
@@ -79,6 +79,46 @@ import type {
|
||||
SendPacketParams,
|
||||
SearchSysFacesParams,
|
||||
GetQzoneMsgDetailParams,
|
||||
ActionGroupIdParams,
|
||||
ActionMessageIdParams,
|
||||
ActionUserIdParams,
|
||||
AddCustomFaceParams,
|
||||
CommentQzoneParams,
|
||||
CreateFlashTaskParams,
|
||||
CustomFaceIdParams,
|
||||
DownloadFileStreamParams,
|
||||
DownloadFilesetParams,
|
||||
FetchCustomFaceDetailParams,
|
||||
FilesetIdParams,
|
||||
GetDoubtFriendsAddRequestParams,
|
||||
GetFilesetIdParams,
|
||||
GetFlashFileUrlParams,
|
||||
GetGroupAlbumMediaListParams,
|
||||
GetQunAlbumListParams,
|
||||
GetQzoneFeedsParams,
|
||||
GetQzoneMsgListParams,
|
||||
GroupAlbumCommentParams,
|
||||
GroupAlbumMediaLikeParams,
|
||||
GroupAlbumMediaParams,
|
||||
LikeQzoneParams,
|
||||
ModifyCustomFaceParams,
|
||||
QzoneMsgIdParams,
|
||||
RenameFlashFileParams,
|
||||
RequestDecryptKeyParams,
|
||||
SendFlashMsgParams,
|
||||
SendQzoneMsgParams,
|
||||
SendTuwenArkParams,
|
||||
SetDoubtFriendsAddRequestParams,
|
||||
SetGroupMemberInvitePolicyParams,
|
||||
SetGroupMemberPermissionsParams,
|
||||
SetGroupNewMemberHistoryVisibilityParams,
|
||||
SetGroupRobotAddOptionParams,
|
||||
SetQzoneBanParams,
|
||||
SetQzoneMsgRightParams,
|
||||
SharePeerParams,
|
||||
TestDownloadStreamParams,
|
||||
UploadFileStreamParams,
|
||||
UploadGroupAlbumMediaParams,
|
||||
} from './params.js';
|
||||
import type {
|
||||
CapabilityInfo,
|
||||
@@ -117,6 +157,39 @@ import type {
|
||||
SystemFaceInfo,
|
||||
SystemFaceSearchInfo,
|
||||
QzoneMsgDetailResult,
|
||||
AddCustomFaceResult,
|
||||
ArkShareResult,
|
||||
CleanStreamTempFileResult,
|
||||
CreateFlashTaskResult,
|
||||
CustomFaceDetail,
|
||||
DecryptKeyResult,
|
||||
DeleteGroupAlbumMediaResult,
|
||||
DoubtFriendsAddRequest,
|
||||
DownloadFileStreamResult,
|
||||
DownloadFilesetResult,
|
||||
FilesetIdResult,
|
||||
FilesetInfo,
|
||||
FlashFileInfo,
|
||||
FlashFileUrl,
|
||||
FriendDressResult,
|
||||
GroupAlbumCommentResult,
|
||||
GroupAlbumInfo,
|
||||
GroupAlbumMediaLikeResult,
|
||||
GroupAlbumMediaResult,
|
||||
GroupSignedMember,
|
||||
MessageEmojiLikeInfo,
|
||||
PttTextResult,
|
||||
QunAlbumListResult,
|
||||
QzoneCommentResult,
|
||||
QzoneFeedsResult,
|
||||
QzoneMsgListResult,
|
||||
QzonePublishResult,
|
||||
QzoneUpdateRightResult,
|
||||
RkeyServerResult,
|
||||
SendFlashMsgResult,
|
||||
TestDownloadStreamResult,
|
||||
UploadFileStreamResult,
|
||||
UploadGroupAlbumVideoResult,
|
||||
} from './results.js';
|
||||
|
||||
export type ActionData = JsonValue;
|
||||
@@ -276,6 +349,91 @@ export interface SnowLumaActionMap {
|
||||
get_ai_characters: { params: GetAiCharactersParams; data: AiCharacterCategory[] };
|
||||
get_ai_record: { params: AiVoiceParams; data: string };
|
||||
send_group_ai_record: { params: AiVoiceParams; data: SendGroupAiRecordResult };
|
||||
// Additional executable actions and compatibility aliases.
|
||||
_get_friend_dress: { params: ActionUserIdParams; data: FriendDressResult };
|
||||
add_custom_face: { params: AddCustomFaceParams; data: AddCustomFaceResult };
|
||||
cancel_group_album_media_like: {
|
||||
params: GroupAlbumMediaLikeParams;
|
||||
data: GroupAlbumMediaLikeResult;
|
||||
};
|
||||
clean_stream_temp_file: { params: JsonObject; data: CleanStreamTempFileResult };
|
||||
comment_qzone: { params: CommentQzoneParams; data: QzoneCommentResult };
|
||||
create_flash_task: { params: CreateFlashTaskParams; data: CreateFlashTaskResult };
|
||||
del_group_album_media: { params: GroupAlbumMediaParams; data: DeleteGroupAlbumMediaResult };
|
||||
delete_custom_face: { params: CustomFaceIdParams; data: EmptyData };
|
||||
delete_flash_file: { params: FilesetIdParams; data: EmptyData };
|
||||
delete_qzone_msg: { params: QzoneMsgIdParams; data: EmptyData };
|
||||
do_group_album_comment: { params: GroupAlbumCommentParams; data: GroupAlbumCommentResult };
|
||||
download_file_image_stream: {
|
||||
params: DownloadFileStreamParams;
|
||||
data: DownloadFileStreamResult;
|
||||
};
|
||||
download_file_record_stream: {
|
||||
params: DownloadFileStreamParams;
|
||||
data: DownloadFileStreamResult;
|
||||
};
|
||||
download_file_stream: { params: DownloadFileStreamParams; data: DownloadFileStreamResult };
|
||||
download_fileset: { params: DownloadFilesetParams; data: DownloadFilesetResult };
|
||||
fetch_custom_face_detail: { params: FetchCustomFaceDetailParams; data: CustomFaceDetail[] };
|
||||
fetch_ptt_text: { params: ActionMessageIdParams; data: PttTextResult };
|
||||
get_ptt_text: { params: ActionMessageIdParams; data: PttTextResult };
|
||||
get_record_text: { params: ActionMessageIdParams; data: PttTextResult };
|
||||
get_doubt_friends_add_request: {
|
||||
params: GetDoubtFriendsAddRequestParams;
|
||||
data: DoubtFriendsAddRequest[];
|
||||
};
|
||||
get_fileset_id: { params: GetFilesetIdParams; data: FilesetIdResult };
|
||||
get_fileset_info: { params: FilesetIdParams; data: FilesetInfo };
|
||||
get_flash_file_list: { params: FilesetIdParams; data: FlashFileInfo[] };
|
||||
get_flash_file_url: { params: GetFlashFileUrlParams; data: FlashFileUrl };
|
||||
get_group_album_list: { params: ActionGroupIdParams; data: GroupAlbumInfo[] };
|
||||
get_group_album_media_list: {
|
||||
params: GetGroupAlbumMediaListParams;
|
||||
data: GroupAlbumMediaResult;
|
||||
};
|
||||
get_group_signed_list: { params: ActionGroupIdParams; data: GroupSignedMember[] };
|
||||
get_msg_emoji_likes: { params: ActionMessageIdParams; data: MessageEmojiLikeInfo[] };
|
||||
get_qun_album_list: { params: GetQunAlbumListParams; data: QunAlbumListResult };
|
||||
get_qzone_feeds: { params: GetQzoneFeedsParams; data: QzoneFeedsResult };
|
||||
get_qzone_msg_list: { params: GetQzoneMsgListParams; data: QzoneMsgListResult };
|
||||
get_rkey_server: { params: JsonObject; data: RkeyServerResult };
|
||||
get_share_link: { params: FilesetIdParams; data: string };
|
||||
like_qzone: { params: LikeQzoneParams; data: EmptyData };
|
||||
list_filesets: { params: JsonObject; data: FlashFileInfo[] };
|
||||
modify_custom_face: { params: ModifyCustomFaceParams; data: EmptyData };
|
||||
move_custom_face_to_front: { params: CustomFaceIdParams; data: EmptyData };
|
||||
rename_flash_file: { params: RenameFlashFileParams; data: EmptyData };
|
||||
request_decrypt_key: { params: RequestDecryptKeyParams; data: DecryptKeyResult };
|
||||
send_ark_share: { params: SharePeerParams; data: ArkShareResult };
|
||||
send_flash_msg: { params: SendFlashMsgParams; data: SendFlashMsgResult };
|
||||
send_group_ark_share: { params: ActionGroupIdParams; data: string };
|
||||
send_qzone_msg: { params: SendQzoneMsgParams; data: QzonePublishResult };
|
||||
send_tuwen_ark: { params: SendTuwenArkParams; data: EmptyData };
|
||||
set_doubt_friends_add_request: { params: SetDoubtFriendsAddRequestParams; data: EmptyData };
|
||||
set_group_album_media_like: {
|
||||
params: GroupAlbumMediaLikeParams;
|
||||
data: GroupAlbumMediaLikeResult;
|
||||
};
|
||||
set_group_member_invite_policy: { params: SetGroupMemberInvitePolicyParams; data: EmptyData };
|
||||
set_group_member_permissions: { params: SetGroupMemberPermissionsParams; data: EmptyData };
|
||||
set_group_new_member_history_visibility: {
|
||||
params: SetGroupNewMemberHistoryVisibilityParams;
|
||||
data: EmptyData;
|
||||
};
|
||||
set_group_robot_add_option: { params: SetGroupRobotAddOptionParams; data: EmptyData };
|
||||
set_qzone_ban: { params: SetQzoneBanParams; data: EmptyData };
|
||||
set_qzone_msg_right: { params: SetQzoneMsgRightParams; data: QzoneUpdateRightResult };
|
||||
share_group_ex: { params: ActionGroupIdParams; data: string };
|
||||
share_peer: { params: SharePeerParams; data: ArkShareResult };
|
||||
test_download_stream: { params: TestDownloadStreamParams; data: TestDownloadStreamResult };
|
||||
unlike_qzone: { params: LikeQzoneParams; data: EmptyData };
|
||||
upload_file_stream: { params: UploadFileStreamParams; data: UploadFileStreamResult };
|
||||
upload_image_to_qun_album: { params: UploadGroupAlbumMediaParams; data: EmptyData };
|
||||
upload_video_to_qun_album: {
|
||||
params: UploadGroupAlbumMediaParams;
|
||||
data: UploadGroupAlbumVideoResult;
|
||||
};
|
||||
'.handle_quick_operation_async': { params: QuickOperationParams; data: EmptyData };
|
||||
}
|
||||
|
||||
export type SnowLumaAction = keyof SnowLumaActionMap | (string & {});
|
||||
|
||||
@@ -433,3 +433,244 @@ export interface GetQzoneMsgDetailParams extends JsonObject {
|
||||
/** Requested page size, 1–100 (default 20); Qzone may return fewer. */
|
||||
num?: number | string;
|
||||
}
|
||||
|
||||
/** Numeric action fields also accept numeric strings; bounds are checked by the server. */
|
||||
export type ActionNumberInput = number | string;
|
||||
/** String action fields preserve the server's number/boolean coercion. */
|
||||
export type ActionStringInput = string | number | boolean;
|
||||
/** Boolean fields accept numbers and strings such as true/false, yes/no and on/off. */
|
||||
export type ActionBooleanInput = boolean | number | string;
|
||||
|
||||
export interface ActionGroupIdParams extends JsonObject {
|
||||
group_id: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface ActionUserIdParams extends JsonObject {
|
||||
user_id: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface ActionMessageIdParams extends JsonObject {
|
||||
/** Non-zero signed message ID; negative values are valid. */
|
||||
message_id: ActionNumberInput;
|
||||
}
|
||||
|
||||
/** Both IDs may be supplied; these actions give group_id precedence. */
|
||||
export type ActionPeerParams = JsonObject &
|
||||
(
|
||||
| { group_id: ActionNumberInput; user_id?: ActionNumberInput }
|
||||
| { user_id: ActionNumberInput; group_id?: ActionNumberInput }
|
||||
);
|
||||
|
||||
export interface AddCustomFaceParams extends JsonObject {
|
||||
file: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface CustomFaceIdParams extends JsonObject {
|
||||
emoji_id: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface ModifyCustomFaceParams extends CustomFaceIdParams {
|
||||
desc?: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface FetchCustomFaceDetailParams extends JsonObject {
|
||||
count?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface GetDoubtFriendsAddRequestParams extends JsonObject {
|
||||
count?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface SetDoubtFriendsAddRequestParams extends JsonObject {
|
||||
flag: ActionStringInput;
|
||||
approve?: ActionBooleanInput;
|
||||
}
|
||||
|
||||
export type SharePeerParams = ActionPeerParams & { phone_number?: ActionStringInput };
|
||||
|
||||
export type SendTuwenArkParams = ActionPeerParams & {
|
||||
title: ActionStringInput;
|
||||
desc: ActionStringInput;
|
||||
summary?: ActionStringInput;
|
||||
preview_url?: ActionStringInput;
|
||||
jump_url: ActionStringInput;
|
||||
};
|
||||
|
||||
export interface RequestDecryptKeyParams extends JsonObject {
|
||||
db_path: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface SetGroupMemberInvitePolicyParams extends ActionGroupIdParams {
|
||||
policy: 'disabled' | 'require_approval' | 'no_approval' | 'no_approval_under_100';
|
||||
}
|
||||
|
||||
export interface SetGroupNewMemberHistoryVisibilityParams extends ActionGroupIdParams {
|
||||
visible: ActionBooleanInput;
|
||||
}
|
||||
|
||||
export type SetGroupMemberPermissionsParams = ActionGroupIdParams &
|
||||
(
|
||||
| {
|
||||
allow_member_upload_album: ActionBooleanInput;
|
||||
allow_member_temporary_session?: ActionBooleanInput;
|
||||
allow_member_create_group?: ActionBooleanInput;
|
||||
}
|
||||
| {
|
||||
allow_member_upload_album?: ActionBooleanInput;
|
||||
allow_member_temporary_session: ActionBooleanInput;
|
||||
allow_member_create_group?: ActionBooleanInput;
|
||||
}
|
||||
| {
|
||||
allow_member_upload_album?: ActionBooleanInput;
|
||||
allow_member_temporary_session?: ActionBooleanInput;
|
||||
allow_member_create_group: ActionBooleanInput;
|
||||
}
|
||||
);
|
||||
|
||||
export interface SetGroupRobotAddOptionParams extends ActionGroupIdParams {
|
||||
robot_member_switch?: ActionNumberInput;
|
||||
robot_member_examine?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface GetQunAlbumListParams extends ActionGroupIdParams {
|
||||
attach_info?: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GroupAlbumParams extends ActionGroupIdParams {
|
||||
album_id: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface UploadGroupAlbumMediaParams extends GroupAlbumParams {
|
||||
album_name: ActionStringInput;
|
||||
file: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GetGroupAlbumMediaListParams extends GroupAlbumParams {
|
||||
attach_info?: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaParams extends GroupAlbumParams {
|
||||
/** Photo locator or video ID. */
|
||||
lloc: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GroupAlbumCommentParams extends GroupAlbumMediaParams {
|
||||
content: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaLikeParams extends GroupAlbumParams {
|
||||
batch_id: ActionStringInput;
|
||||
lloc?: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GetQzoneMsgListParams extends JsonObject {
|
||||
target_uin?: ActionNumberInput;
|
||||
pos?: ActionNumberInput;
|
||||
num?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface GetQzoneFeedsParams extends JsonObject {
|
||||
/** Page number starts at 1; only the first page is reliable upstream. */
|
||||
page_num?: ActionNumberInput;
|
||||
count?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface QzoneMsgIdParams extends JsonObject {
|
||||
tid: ActionStringInput;
|
||||
}
|
||||
|
||||
/** 1=public, 4=friends, 16=selected friends, 64=self, 128=exclude selected friends. */
|
||||
export type QzoneUgcRight = 1 | 4 | 16 | 64 | 128;
|
||||
|
||||
export interface SendQzoneMsgParams extends JsonObject {
|
||||
content: ActionStringInput;
|
||||
images?: ActionStringInput[];
|
||||
/** Defaults to 1. Values are validated as QzoneUgcRight by the server. */
|
||||
ugc_right?: ActionNumberInput;
|
||||
/** Required and non-empty when ugc_right is 16 or 128. */
|
||||
target_uins?: ActionNumberInput[];
|
||||
}
|
||||
|
||||
export interface SetQzoneMsgRightParams extends QzoneMsgIdParams {
|
||||
/** One of the QzoneUgcRight values, also accepted as a numeric string. */
|
||||
ugc_right: ActionNumberInput;
|
||||
/** Required and non-empty when ugc_right is 16 or 128. */
|
||||
target_uins?: ActionNumberInput[];
|
||||
}
|
||||
|
||||
export interface LikeQzoneParams extends QzoneMsgIdParams {
|
||||
target_uin?: ActionNumberInput;
|
||||
/** Post publication time in Unix seconds. */
|
||||
abstime?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface CommentQzoneParams extends QzoneMsgIdParams {
|
||||
content: ActionStringInput;
|
||||
target_uin?: ActionNumberInput;
|
||||
images?: ActionStringInput[];
|
||||
}
|
||||
|
||||
export interface SetQzoneBanParams extends ActionUserIdParams {
|
||||
enable?: ActionBooleanInput;
|
||||
}
|
||||
|
||||
export type FlashTaskFile = string | { file: string; name?: string };
|
||||
|
||||
export interface CreateFlashTaskParams extends JsonObject {
|
||||
/** A path, a named file, or a non-empty array mixing both forms. */
|
||||
files: FlashTaskFile | FlashTaskFile[];
|
||||
name?: ActionStringInput;
|
||||
thumb_path?: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface FilesetIdParams extends JsonObject {
|
||||
fileset_id: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface GetFlashFileUrlParams extends FilesetIdParams {
|
||||
/** Accepted for compatibility; this action selects by file_index. */
|
||||
file_name?: ActionStringInput;
|
||||
file_index?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface DownloadFilesetParams extends FilesetIdParams {
|
||||
file_name?: ActionStringInput;
|
||||
file_index?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export interface RenameFlashFileParams extends FilesetIdParams {
|
||||
new_name: ActionStringInput;
|
||||
}
|
||||
|
||||
export type SendFlashMsgParams = FilesetIdParams & ActionPeerParams;
|
||||
|
||||
export interface GetFilesetIdParams extends JsonObject {
|
||||
share_code: ActionStringInput;
|
||||
}
|
||||
|
||||
export interface UploadFileStreamParams extends JsonObject {
|
||||
stream_id: ActionStringInput;
|
||||
chunk_data?: ActionStringInput;
|
||||
chunk_index?: ActionNumberInput;
|
||||
/** Required when creating a stream; omitted for status, reset and later chunks. */
|
||||
total_chunks?: ActionNumberInput;
|
||||
file_size?: ActionNumberInput;
|
||||
expected_sha256?: ActionStringInput;
|
||||
is_complete?: ActionBooleanInput;
|
||||
filename?: ActionStringInput;
|
||||
reset?: ActionBooleanInput;
|
||||
verify_only?: ActionBooleanInput;
|
||||
/** Retention in milliseconds; 0 disables automatic expiry. */
|
||||
file_retention?: ActionNumberInput;
|
||||
}
|
||||
|
||||
export type DownloadFileStreamParams = JsonObject & {
|
||||
chunk_size?: ActionNumberInput;
|
||||
} & (
|
||||
| { file: ActionStringInput; file_id?: ActionStringInput }
|
||||
| { file_id: ActionStringInput; file?: ActionStringInput }
|
||||
);
|
||||
|
||||
export interface TestDownloadStreamParams extends JsonObject {
|
||||
error?: ActionBooleanInput;
|
||||
}
|
||||
@@ -301,3 +301,386 @@ export interface UserOnlineStatus {
|
||||
export interface SendGroupAiRecordResult {
|
||||
message_id: number;
|
||||
}
|
||||
|
||||
export interface CustomFaceDetail extends JsonObject {
|
||||
emoji_id: string;
|
||||
resId: string;
|
||||
url: string;
|
||||
md5: string;
|
||||
desc: string;
|
||||
}
|
||||
|
||||
export interface AddCustomFaceResult extends JsonObject {
|
||||
emoji_id: string;
|
||||
}
|
||||
|
||||
export interface PttTextResult extends JsonObject {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface MessageEmojiLikeInfo extends JsonObject {
|
||||
emoji_id: string;
|
||||
emoji_type: number;
|
||||
count: number;
|
||||
last_reaction_time: number;
|
||||
users: Array<{ user_id: number }>;
|
||||
}
|
||||
|
||||
export interface GroupSignedMember extends JsonObject {
|
||||
user_id: number;
|
||||
nick: string;
|
||||
time: number;
|
||||
rank: number;
|
||||
}
|
||||
|
||||
export interface DoubtFriendsAddRequest extends JsonObject {
|
||||
/** Pass this UID back as the request's flag. */
|
||||
uid: string;
|
||||
user_id: number;
|
||||
nick: string;
|
||||
source: string;
|
||||
reason: string;
|
||||
msg: string;
|
||||
group_code: string;
|
||||
reqTime: number;
|
||||
}
|
||||
|
||||
export interface FriendDressItem extends JsonObject {
|
||||
app_id: number;
|
||||
kind: string;
|
||||
item_id: number;
|
||||
name: string;
|
||||
preview_url: string;
|
||||
video_url: string;
|
||||
price: number;
|
||||
}
|
||||
|
||||
export interface FriendDressResult extends JsonObject {
|
||||
target_uin: string;
|
||||
is_svip: boolean;
|
||||
avatar_url: string;
|
||||
items: FriendDressItem[];
|
||||
}
|
||||
|
||||
export interface ArkShareResult extends JsonObject {
|
||||
arkMsg: string;
|
||||
}
|
||||
|
||||
export interface DecryptKeyResult extends JsonObject {
|
||||
db_key: string;
|
||||
}
|
||||
|
||||
export interface RkeyServerResult extends JsonObject {
|
||||
/** Unix seconds; either key can be absent. */
|
||||
expired_time: number;
|
||||
name: string;
|
||||
private_rkey?: string;
|
||||
group_rkey?: string;
|
||||
}
|
||||
|
||||
export interface QzoneEmotion extends JsonObject {
|
||||
tid: string;
|
||||
content: string;
|
||||
/** Unix seconds. */
|
||||
time: number;
|
||||
comment_num: number;
|
||||
is_private: boolean;
|
||||
images: string[];
|
||||
}
|
||||
|
||||
export interface QzoneMsgListResult extends JsonObject {
|
||||
total: number;
|
||||
msglist: QzoneEmotion[];
|
||||
}
|
||||
|
||||
export interface QzoneFeed extends JsonObject {
|
||||
uin: number;
|
||||
nickname: string;
|
||||
time: number;
|
||||
appid: number;
|
||||
key: string;
|
||||
html: string;
|
||||
}
|
||||
|
||||
export interface QzoneFeedsResult extends JsonObject {
|
||||
feeds: QzoneFeed[];
|
||||
has_more: boolean;
|
||||
}
|
||||
|
||||
export interface QzonePublishResult extends JsonObject {
|
||||
tid: string;
|
||||
time: number;
|
||||
}
|
||||
|
||||
export interface QzoneCommentResult extends JsonObject {
|
||||
/** Empty string when the upstream response omits the new comment ID. */
|
||||
comment_id: string;
|
||||
}
|
||||
|
||||
export interface QzoneUpdateRightResult extends JsonObject {
|
||||
ugc_right: number;
|
||||
}
|
||||
|
||||
export interface QunAlbumCoverUrl extends JsonObject {
|
||||
url: string;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface QunAlbumCoverPhotoUrl extends JsonObject {
|
||||
spec: number;
|
||||
url: QunAlbumCoverUrl | null;
|
||||
}
|
||||
|
||||
export interface QunAlbumCoverImage extends JsonObject {
|
||||
name: string;
|
||||
sloc: string;
|
||||
lloc: string;
|
||||
photoUrls: QunAlbumCoverPhotoUrl[];
|
||||
defaultUrl: QunAlbumCoverUrl | null;
|
||||
isGif: boolean;
|
||||
hasRaw: boolean;
|
||||
}
|
||||
|
||||
export interface QunAlbumCover extends JsonObject {
|
||||
type: number;
|
||||
image: QunAlbumCoverImage | null;
|
||||
}
|
||||
|
||||
export interface GroupAlbumInfo extends JsonObject {
|
||||
id: string;
|
||||
name: string;
|
||||
picNum: number;
|
||||
createTime: number;
|
||||
desc: string;
|
||||
owner: string;
|
||||
createuin: string;
|
||||
createnickname: string;
|
||||
last_upload_time: number;
|
||||
cover: QunAlbumCover | null;
|
||||
}
|
||||
|
||||
export interface QunAlbumCreator extends JsonObject {
|
||||
uid: string;
|
||||
nick: string;
|
||||
is_sweet: boolean;
|
||||
is_special: boolean;
|
||||
is_super_like: boolean;
|
||||
custom_id: string;
|
||||
poly_id: string;
|
||||
portrait: string;
|
||||
can_follow: number;
|
||||
isfollowed: number;
|
||||
uin: string;
|
||||
ditto_uin: string;
|
||||
}
|
||||
|
||||
export interface QunAlbumInfo extends JsonObject {
|
||||
album_id: string;
|
||||
owner: string;
|
||||
name: string;
|
||||
desc: string;
|
||||
/** The Qun API preserves 64-bit times and counts as decimal strings. */
|
||||
create_time: string;
|
||||
modify_time: string;
|
||||
last_upload_time: string;
|
||||
upload_number: string;
|
||||
cover: QunAlbumCover | null;
|
||||
creator?: QunAlbumCreator;
|
||||
top_flag: string;
|
||||
busi_type: number;
|
||||
status: number;
|
||||
allow_share: boolean;
|
||||
is_subscribe: boolean;
|
||||
bitmap: string;
|
||||
is_share_album: boolean;
|
||||
qz_album_type: number;
|
||||
cover_type: number;
|
||||
default_desc: string;
|
||||
sort_type: number;
|
||||
}
|
||||
|
||||
export interface QunAlbumListResult extends JsonObject {
|
||||
album_list: QunAlbumInfo[];
|
||||
attach_info: string;
|
||||
has_more: boolean;
|
||||
}
|
||||
|
||||
// Media-list fields are passed through from QQ, unlike normalized album covers.
|
||||
// Omitted fields stay optional; explicitly undefined decoded values become null.
|
||||
export interface GroupAlbumMediaUrl extends JsonObject {
|
||||
url?: string | null;
|
||||
width?: number | null;
|
||||
height?: number | null;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaPhotoUrl extends JsonObject {
|
||||
spec?: number | null;
|
||||
url?: GroupAlbumMediaUrl | null;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaImage extends JsonObject {
|
||||
name?: string | null;
|
||||
sloc?: string | null;
|
||||
lloc?: string | null;
|
||||
photoUrls?: GroupAlbumMediaPhotoUrl[] | null;
|
||||
defaultUrl?: GroupAlbumMediaUrl | null;
|
||||
isGif?: boolean | null;
|
||||
hasRaw?: boolean | null;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaVideo extends JsonObject {
|
||||
id?: string | null;
|
||||
url?: string | null;
|
||||
cover?: GroupAlbumMediaImage | null;
|
||||
width?: number | null;
|
||||
height?: number | null;
|
||||
videoTime?: string | null;
|
||||
videoUrl?: GroupAlbumMediaPhotoUrl[] | null;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaInfo extends JsonObject {
|
||||
type?: number | null;
|
||||
image?: GroupAlbumMediaImage | null;
|
||||
video?: GroupAlbumMediaVideo | null;
|
||||
uploader?: string | null;
|
||||
batchId?: string | null;
|
||||
uploadTime?: string | null;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaResult extends JsonObject {
|
||||
mediaList: GroupAlbumMediaInfo[];
|
||||
nextAttachInfo: string;
|
||||
}
|
||||
|
||||
export interface GroupAlbumCommentResult extends JsonObject {
|
||||
id: string;
|
||||
user: { uin: string };
|
||||
content: Array<{ type: number; content: string }>;
|
||||
time: string;
|
||||
clientKey: string;
|
||||
}
|
||||
|
||||
export interface GroupAlbumMediaLikeResult extends JsonObject {
|
||||
id?: string | null;
|
||||
status?: number | null;
|
||||
}
|
||||
|
||||
export interface UploadGroupAlbumVideoResult extends JsonObject {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface DeleteGroupAlbumMediaResult extends JsonObject {
|
||||
success: true;
|
||||
}
|
||||
|
||||
export interface CreateFlashTaskResult extends JsonObject {
|
||||
fileset_id: string;
|
||||
task_id: string;
|
||||
}
|
||||
|
||||
export interface FlashFileInfo extends JsonObject {
|
||||
fileset_id: string;
|
||||
file_name: string;
|
||||
orig_name: string;
|
||||
size: number;
|
||||
share_url: string;
|
||||
file_id: string;
|
||||
download_url: string;
|
||||
}
|
||||
|
||||
export interface FilesetInfo extends JsonObject {
|
||||
fileset_id: string;
|
||||
file_list: FlashFileInfo[];
|
||||
}
|
||||
|
||||
export interface FlashFileUrl extends JsonObject {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface DownloadFilesetResult extends FlashFileUrl {
|
||||
file_name: string;
|
||||
file_size: number;
|
||||
}
|
||||
|
||||
export interface FilesetIdResult extends JsonObject {
|
||||
fileset_id: string;
|
||||
}
|
||||
|
||||
export interface SendFlashMsgResult extends JsonObject {
|
||||
/** Flash sharing has no ordinary message ID; the server returns this sentinel. */
|
||||
message_id: 0;
|
||||
}
|
||||
|
||||
export interface CleanStreamTempFileResult extends JsonObject {
|
||||
message: string;
|
||||
removed: number;
|
||||
freed_bytes: number;
|
||||
skipped_active: number;
|
||||
}
|
||||
|
||||
/** Stream errors are carried by failed envelopes; raw() throws for these. */
|
||||
export interface StreamErrorData extends JsonObject {
|
||||
type: 'error';
|
||||
data_type: 'error';
|
||||
}
|
||||
|
||||
export interface UploadFileStreamStatus extends JsonObject {
|
||||
type: 'stream';
|
||||
stream_id: string;
|
||||
status: 'file_created' | 'chunk_received';
|
||||
received_chunks: number;
|
||||
total_chunks: number;
|
||||
}
|
||||
|
||||
export interface UploadFileStreamComplete extends JsonObject {
|
||||
type: 'response';
|
||||
stream_id: string;
|
||||
status: 'file_complete';
|
||||
received_chunks: number;
|
||||
total_chunks: number;
|
||||
file_path: string;
|
||||
file_name: string;
|
||||
file_size: number;
|
||||
sha256: string;
|
||||
}
|
||||
|
||||
export type UploadFileStreamResult =
|
||||
UploadFileStreamStatus | UploadFileStreamComplete | StreamErrorData;
|
||||
|
||||
export interface DownloadFileStreamInfo extends JsonObject {
|
||||
type: 'stream';
|
||||
data_type: 'file_info';
|
||||
file_name: string;
|
||||
file_size: number;
|
||||
chunk_size: number;
|
||||
}
|
||||
|
||||
export interface DownloadFileStreamChunk extends JsonObject {
|
||||
type: 'stream';
|
||||
data_type: 'file_chunk';
|
||||
index: number;
|
||||
/** Base64-encoded bytes. */
|
||||
data: string;
|
||||
size: number;
|
||||
progress: number;
|
||||
base64_size: number;
|
||||
}
|
||||
|
||||
export interface DownloadFileStreamComplete extends JsonObject {
|
||||
type: 'response';
|
||||
data_type: 'file_complete';
|
||||
file_name: string;
|
||||
total_chunks: number;
|
||||
total_bytes: number;
|
||||
message: string;
|
||||
}
|
||||
|
||||
/** One frame's data, not an aggregated download. A streaming transport is required. */
|
||||
export type DownloadFileStreamResult =
|
||||
DownloadFileStreamInfo | DownloadFileStreamChunk | DownloadFileStreamComplete | StreamErrorData;
|
||||
|
||||
export type TestDownloadStreamResult =
|
||||
| { type: 'stream'; data_type: 'data_chunk'; data: string }
|
||||
| { type: 'response'; data_type: 'data_complete'; data: string }
|
||||
| StreamErrorData;
|
||||
Reference in new issue
Block a user