easemob-websdk 4.24.1 → 5.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/README.md +95 -39
- package/bundle/im-sdk-web.iife.js +1 -0
- package/cache/cache-crypto.d.ts +26 -0
- package/cache/cache-eviction.d.ts +16 -0
- package/cache/cache-keys.d.ts +23 -0
- package/cache/cache-manager.d.ts +254 -0
- package/cache/cache-metadata.d.ts +14 -0
- package/cache/cache-store.d.ts +19 -0
- package/cache/cache-types.d.ts +225 -0
- package/cache/cache-utils.d.ts +7 -0
- package/cache/contact-cache.d.ts +35 -0
- package/cache/conversation-cache.d.ts +21 -0
- package/cache/group-namecard-cache.d.ts +20 -0
- package/cache/index.d.ts +24 -0
- package/cache/joined-group-preview-cache.d.ts +12 -0
- package/cache/session-list-cache.d.ts +10 -0
- package/cache/user-info-cache.d.ts +16 -0
- package/chat-client.d.ts +558 -0
- package/chunks/cache-utils-BwRPIZ7n.js +1 -0
- package/chunks/cache-utils-CKbcYPlM.cjs +1 -0
- package/chunks/chat-manager-ChdK26ck.cjs +1 -0
- package/chunks/chat-manager-DH8a6Qj9.js +2 -0
- package/chunks/common-CfAlncj9.cjs +1 -0
- package/chunks/common-DN_g4O3n.js +1 -0
- package/chunks/event-system-COBJFEIq.cjs +1 -0
- package/chunks/event-system-D6IJA0C4.js +1 -0
- package/chunks/group-user-info-resolver-C5pdiqox.cjs +1 -0
- package/chunks/group-user-info-resolver-FNRqDg18.js +1 -0
- package/chunks/index-BKg4EGcI.cjs +1 -0
- package/chunks/index-CK3GHdGU.cjs +1 -0
- package/chunks/index-CjofwvEQ.js +1 -0
- package/chunks/index-uKWbjx-u.js +1 -0
- package/chunks/profile-version-DLMz8lqW.js +1 -0
- package/chunks/profile-version-njNs7R5-.cjs +1 -0
- package/chunks/reflection-proto-codec-64ocOTHU.js +1 -0
- package/chunks/reflection-proto-codec-BnQFQdZC.cjs +1 -0
- package/chunks/session-list-query-B6dh-b4Y.cjs +1 -0
- package/chunks/session-list-query-Dnp2HbpW.js +1 -0
- package/chunks/user-info-BfRwS4ZA.js +1 -0
- package/chunks/user-info-icpL0Eaw.cjs +1 -0
- package/config/cache.d.ts +12 -0
- package/config/timeouts.d.ts +34 -0
- package/core/connection/connection-manager.d.ts +228 -0
- package/core/connection/connection-retry.d.ts +47 -0
- package/core/connection/heartbeat.d.ts +68 -0
- package/core/contact-sync/contact-roster-event-sidecar.d.ts +3 -0
- package/core/contact-sync/roster-sync-client.d.ts +21 -0
- package/core/contact-sync/roster-sync-controller.d.ts +20 -0
- package/core/contact-sync/roster-sync-session.d.ts +28 -0
- package/core/contact-sync/roster-sync-types.d.ts +74 -0
- package/core/events/event-hub.d.ts +13 -0
- package/core/group-sync/group-sync-client.d.ts +19 -0
- package/core/group-sync/group-sync-controller.d.ts +11 -0
- package/core/group-sync/group-sync-merge.d.ts +3 -0
- package/core/group-sync/group-sync-normalizer.d.ts +4 -0
- package/core/group-sync/group-sync-session.d.ts +17 -0
- package/core/group-sync/group-sync-types.d.ts +24 -0
- package/core/group-sync/index.d.ts +4 -0
- package/core/index.d.ts +95 -0
- package/core/message/attachment-downloader.d.ts +7 -0
- package/core/message/chatroom-operation-types.d.ts +6 -0
- package/core/message/combine-message-downloader.d.ts +7 -0
- package/core/message/message-action-types.d.ts +22 -0
- package/core/message/message-deduplicator.d.ts +11 -0
- package/core/message/message-receiver.d.ts +65 -0
- package/core/message/message-retry.d.ts +33 -0
- package/core/message/message-sender.d.ts +63 -0
- package/core/message/profile-sync/group-namecard-hydration-queue.d.ts +33 -0
- package/core/message/profile-sync/group-namecard-hydrator.d.ts +8 -0
- package/core/message/profile-sync/latest-message-version-projector.d.ts +3 -0
- package/core/message/profile-sync/profile-version-sidecar.d.ts +9 -0
- package/core/message/profile-sync/profile-version.d.ts +3 -0
- package/core/message/profile-sync/user-info-hydration-queue.d.ts +29 -0
- package/core/message/profile-sync/user-info-hydrator.d.ts +8 -0
- package/core/message/stream-message-cache.d.ts +38 -0
- package/core/message/stream-message-handler.d.ts +22 -0
- package/core/session-list-sync/session-list-query.d.ts +26 -0
- package/core/session-list-sync/session-list-sync-controller.d.ts +17 -0
- package/core/session-list-sync/session-list-sync-merge.d.ts +17 -0
- package/core/session-list-sync/session-list-sync-normalizer.d.ts +6 -0
- package/core/session-list-sync/session-list-sync-runner.d.ts +13 -0
- package/core/session-list-sync/session-list-sync-session.d.ts +26 -0
- package/core/session-list-sync/session-list-sync-types.d.ts +24 -0
- package/core/sync/shared-sync-websocket-session.d.ts +61 -0
- package/core/user-info/group-user-info-resolver.d.ts +40 -0
- package/data-report/bridge.d.ts +11 -0
- package/data-report/constants.d.ts +25 -0
- package/data-report/data-reporter.d.ts +21 -0
- package/data-report/event-queue.d.ts +38 -0
- package/data-report/index.d.ts +3 -0
- package/data-report/network-type.d.ts +1 -0
- package/data-report/operation-map.d.ts +8 -0
- package/data-report/transport.d.ts +17 -0
- package/data-report/types.d.ts +61 -0
- package/index.cjs +1 -0
- package/index.d.ts +134 -0
- package/index.js +3 -0
- package/managers/chat/index.cjs +1 -0
- package/managers/chat/index.d.ts +1 -0
- package/managers/chat/index.js +1 -0
- package/managers/chat-manager.d.ts +880 -0
- package/managers/chat-thread/chat-thread.d.ts +126 -0
- package/managers/chat-thread/index.cjs +1 -0
- package/managers/chat-thread/index.d.ts +2 -0
- package/managers/chat-thread/index.js +1 -0
- package/managers/chat-thread-manager.d.ts +257 -0
- package/managers/chatroom/chatroom-event-mapper.d.ts +17 -0
- package/managers/chatroom/chatroom-event-user-info-resolver.d.ts +15 -0
- package/managers/chatroom/chatroom-normalizers.d.ts +23 -0
- package/managers/chatroom/chatroom.d.ts +403 -0
- package/managers/chatroom/index.cjs +1 -0
- package/managers/chatroom/index.d.ts +2 -0
- package/managers/chatroom/index.js +1 -0
- package/managers/chatroom-manager.d.ts +604 -0
- package/managers/contact/contact-user-info-resolver.d.ts +15 -0
- package/managers/contact/index.cjs +1 -0
- package/managers/contact/index.d.ts +1 -0
- package/managers/contact/index.js +1 -0
- package/managers/contact-manager.d.ts +215 -0
- package/managers/group/group-event-mapper.d.ts +18 -0
- package/managers/group/group-event-user-info-resolver.d.ts +15 -0
- package/managers/group/group-normalizers.d.ts +15 -0
- package/managers/group/group.d.ts +504 -0
- package/managers/group/index.cjs +1 -0
- package/managers/group/index.d.ts +2 -0
- package/managers/group/index.js +1 -0
- package/managers/group/internal/group-event-sync.d.ts +13 -0
- package/managers/group/internal/group-repository.d.ts +31 -0
- package/managers/group/internal/group-snapshot-mapper.d.ts +6 -0
- package/managers/group/internal/internal-group.d.ts +24 -0
- package/managers/group-manager.d.ts +371 -0
- package/managers/presence/index.cjs +1 -0
- package/managers/presence/index.d.ts +1 -0
- package/managers/presence/index.js +1 -0
- package/managers/presence-manager.d.ts +201 -0
- package/managers/push/index.cjs +1 -0
- package/managers/push/index.d.ts +1 -0
- package/managers/push/index.js +1 -0
- package/managers/push-manager.d.ts +205 -0
- package/managers/user-info/index.cjs +1 -0
- package/managers/user-info/index.d.ts +4 -0
- package/managers/user-info/index.js +1 -0
- package/managers/user-info/user-info-notify-normalizer.d.ts +2 -0
- package/managers/user-info/user-info-runtime-store.d.ts +28 -0
- package/managers/user-info-manager.d.ts +196 -0
- package/message/combine-compatible-text-sidecar.d.ts +4 -0
- package/message/combine-message-constraints.d.ts +7 -0
- package/message/combine-payload-codec.d.ts +17 -0
- package/message/create-message.d.ts +64 -0
- package/package.json +64 -16
- package/platform/capability-validator.d.ts +7 -0
- package/platform/env.d.ts +68 -0
- package/platform/factory.d.ts +7 -0
- package/platform/image/miniapp-image-processor.d.ts +45 -0
- package/platform/image/web-image-processor.d.ts +2 -0
- package/platform/index.d.ts +17 -0
- package/platform/miniapp/miniapp-adapter.d.ts +3 -0
- package/platform/proto/proto-adapter.d.ts +17 -0
- package/platform/proto/reflection-proto-codec.d.ts +8 -0
- package/platform/proto/static-proto-adapter.d.ts +8 -0
- package/platform/request/web-request-adapter.d.ts +9 -0
- package/platform/runtime/connection-event-normalizer.d.ts +14 -0
- package/platform/runtime/runtime-event-bridge.d.ts +23 -0
- package/platform/runtime/web-runtime-adapter.d.ts +26 -0
- package/platform/socket/web-socket-adapter.d.ts +8 -0
- package/platform/types.d.ts +472 -0
- package/platform/upload/react-native-upload-adapter.d.ts +14 -0
- package/platform/upload/upload-error-mapper.d.ts +7 -0
- package/platform/upload/upload-source.d.ts +20 -0
- package/platform/upload/web-upload-adapter.d.ts +10 -0
- package/protocol/joined-groups/codec.d.ts +11 -0
- package/protocol/joined-groups/gateway.d.ts +2 -0
- package/protocol/joined-groups/index.d.ts +2 -0
- package/protocol/joined-groups/proto.d.ts +174 -0
- package/protocol/joined-groups/types.d.ts +65 -0
- package/protocol/msync/codec.d.ts +191 -0
- package/protocol/msync/context.d.ts +40 -0
- package/protocol/msync/lz4-compressor/index.d.ts +40 -0
- package/protocol/msync/lz4-compressor/utils.d.ts +27 -0
- package/protocol/msync/multi-device-normalizer.d.ts +75 -0
- package/protocol/msync/proto.d.ts +1306 -0
- package/protocol/msync/root.d.ts +5 -0
- package/protocol/msync/types.d.ts +96 -0
- package/protocol/msync/utils.d.ts +26 -0
- package/protocol/protobuf/decoder.d.ts +44 -0
- package/protocol/protobuf/encoder.d.ts +23 -0
- package/protocol/protobuf/types.d.ts +53 -0
- package/protocol/roster/codec.d.ts +9 -0
- package/protocol/roster/proto.d.ts +205 -0
- package/protocol/roster/root.d.ts +5 -0
- package/protocol/roster/types.d.ts +83 -0
- package/protocol/session-list/codec.d.ts +11 -0
- package/protocol/session-list/gateway.d.ts +19 -0
- package/protocol/session-list/payload-decoder.d.ts +1 -0
- package/protocol/session-list/proto.d.ts +207 -0
- package/protocol/session-list/types.d.ts +83 -0
- package/rest/chat-management.d.ts +26 -0
- package/rest/chat-thread-management.d.ts +14 -0
- package/rest/chatroom-management.d.ts +40 -0
- package/rest/client.d.ts +86 -0
- package/rest/contact-management.d.ts +27 -0
- package/rest/contact-metadata.d.ts +11 -0
- package/rest/conversation-management.d.ts +11 -0
- package/rest/dns-config.d.ts +20 -0
- package/rest/error-map-types.d.ts +32 -0
- package/rest/error-maps/chat.d.ts +888 -0
- package/rest/error-maps/chatroom.d.ts +592 -0
- package/rest/error-maps/common.d.ts +208 -0
- package/rest/error-maps/contact.d.ts +185 -0
- package/rest/error-maps/core.d.ts +21 -0
- package/rest/error-maps/group.d.ts +500 -0
- package/rest/error-maps/index.d.ts +9 -0
- package/rest/error-maps/presence.d.ts +62 -0
- package/rest/error-maps/push.d.ts +158 -0
- package/rest/error-maps/thread.d.ts +538 -0
- package/rest/error-maps/user-info.d.ts +289 -0
- package/rest/errors.d.ts +23 -0
- package/rest/group-management.d.ts +55 -0
- package/rest/rtc-token.d.ts +14 -0
- package/rest/speech-helpers.d.ts +24 -0
- package/rest/user-info-subscription.d.ts +10 -0
- package/rest/user-info.d.ts +34 -0
- package/types/chat-client.d.ts +226 -0
- package/types/chat-manager.d.ts +641 -0
- package/types/chat-thread.d.ts +311 -0
- package/types/chatroom.d.ts +1258 -0
- package/types/connection.d.ts +111 -0
- package/types/contact.d.ts +149 -0
- package/types/conversation.d.ts +270 -0
- package/types/event-system.d.ts +721 -0
- package/types/group.d.ts +980 -0
- package/types/index.d.ts +577 -44
- package/types/manager.d.ts +99 -0
- package/types/message-conversation.d.ts +22 -0
- package/types/message-create.d.ts +173 -0
- package/types/multi-device.d.ts +275 -0
- package/types/presence.d.ts +101 -0
- package/types/push.d.ts +296 -0
- package/types/sender.d.ts +12 -0
- package/types/sync-data.d.ts +54 -0
- package/types/user-info.d.ts +178 -0
- package/upload/attachment-file-store.d.ts +11 -0
- package/upload/attachment-uploader.d.ts +36 -0
- package/upload/constants.d.ts +8 -0
- package/upload/index.d.ts +2 -0
- package/upload/multipart-upload.d.ts +14 -0
- package/upload/simple-upload.d.ts +3 -0
- package/upload/types.d.ts +79 -0
- package/upload/utils.d.ts +71 -0
- package/utils/env.d.ts +4 -0
- package/utils/error-codes.d.ts +2 -0
- package/utils/error-codes.generated.d.ts +145 -0
- package/utils/error-sanitizer.d.ts +8 -0
- package/utils/errors.d.ts +139 -0
- package/utils/log-reporter.d.ts +61 -0
- package/utils/log-sanitizer.d.ts +6 -0
- package/utils/logger.d.ts +48 -0
- package/utils/md5.d.ts +1 -0
- package/utils/message-id.d.ts +12 -0
- package/utils/provision-error-mapping.d.ts +21 -0
- package/utils/retry.d.ts +26 -0
- package/utils/runtime-global.d.ts +4 -0
- package/utils/trace-id.d.ts +5 -0
- package/utils/utf8.d.ts +2 -0
- package/validators/chat-client.d.ts +787 -0
- package/validators/message-create.d.ts +419 -0
- package/validators/search-messages.d.ts +127 -0
- package/validators/validator.d.ts +49 -0
- package/version.d.ts +2 -0
- package/Easemob-chat.d.ts +0 -8457
- package/Easemob-chat.js +0 -2
- package/chatroom/chatroom.d.ts +0 -649
- package/chatroom/chatroom.js +0 -1
- package/contact/contact.d.ts +0 -726
- package/contact/contact.js +0 -1
- package/group/group.d.ts +0 -848
- package/group/group.js +0 -1
- package/localCache/localCache.d.ts +0 -59
- package/localCache/localCache.js +0 -1
- package/message/audio.d.ts +0 -183
- package/message/channel.d.ts +0 -82
- package/message/cmd.d.ts +0 -146
- package/message/combine.d.ts +0 -132
- package/message/custom.d.ts +0 -135
- package/message/delivery.d.ts +0 -77
- package/message/file.d.ts +0 -173
- package/message/img.d.ts +0 -200
- package/message/index.d.ts +0 -211
- package/message/location.d.ts +0 -134
- package/message/read.d.ts +0 -85
- package/message/text.d.ts +0 -149
- package/message/video.d.ts +0 -180
- package/miniCore/miniCore.d.ts +0 -217
- package/miniCore/miniCore.js +0 -2
- package/miniProgram/Easemob-chat.js +0 -2
- package/miniProgram/miniProgram.zip +0 -0
- package/presence/presence.d.ts +0 -69
- package/presence/presence.js +0 -1
- package/silent/silent.d.ts +0 -128
- package/silent/silent.js +0 -1
- package/status.d.ts +0 -184
- package/thread/thread.d.ts +0 -159
- package/thread/thread.js +0 -1
- package/translation/translation.d.ts +0 -30
- package/translation/translation.js +0 -1
- package/types/chatRoomApi.d.ts +0 -226
- package/types/common.d.ts +0 -89
- package/types/engineCore.d.ts +0 -194
- package/types/error.d.ts +0 -13
- package/types/eventHandler.d.ts +0 -437
- package/types/groupApi.d.ts +0 -306
- package/types/indexApi.d.ts +0 -366
- package/types/localCache.d.ts +0 -53
- package/types/message.d.ts +0 -959
- package/types/presenceApi.d.ts +0 -61
- package/types/reactionApi.d.ts +0 -74
- package/types/restApis.d.ts +0 -6
- package/types/silentModeApi.d.ts +0 -109
- package/types/threadApi.d.ts +0 -175
- package/types/translation.d.ts +0 -25
- package/types/utils.d.ts +0 -90
- package/uniApp/Easemob-chat.js +0 -2
- package/uniApp/uniApp.zip +0 -0
- package/websdk.zip +0 -0
package/types/push.d.ts
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [zh-CN] PushManager 对外类型定义,供推送 API 调用与文档生成使用。
|
|
3
|
+
* [en-US] Public type definitions for PushManager, used by push APIs and documentation generation.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* [zh-CN] 会话类型常量集合。
|
|
7
|
+
* [en-US] Conversation type constants.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PUSH_CONVERSATION_TYPE: {
|
|
10
|
+
readonly SINGLE_CHAT: "singleChat";
|
|
11
|
+
readonly GROUP_CHAT: "groupChat";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* [zh-CN] PushManager 支持的会话类型。
|
|
15
|
+
* [en-US] Conversation types supported by PushManager.
|
|
16
|
+
*/
|
|
17
|
+
export type PushConversationType = (typeof PUSH_CONVERSATION_TYPE)[keyof typeof PUSH_CONVERSATION_TYPE];
|
|
18
|
+
/**
|
|
19
|
+
* [zh-CN] 推送提醒类型常量集合。
|
|
20
|
+
* [en-US] Push remind type constants.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PUSH_REMIND_TYPE: {
|
|
23
|
+
readonly ALL: "ALL";
|
|
24
|
+
readonly AT: "AT";
|
|
25
|
+
readonly NONE: "NONE";
|
|
26
|
+
readonly DEFAULT: "DEFAULT";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* [zh-CN] 推送提醒类型。
|
|
30
|
+
* [en-US] Push reminder type.
|
|
31
|
+
*/
|
|
32
|
+
export type PushRemindType = (typeof PUSH_REMIND_TYPE)[keyof typeof PUSH_REMIND_TYPE];
|
|
33
|
+
/**
|
|
34
|
+
* [zh-CN] 可设置的推送提醒类型(不包含 DEFAULT)。
|
|
35
|
+
* [en-US] Configurable push reminder types (excluding 'DEFAULT').
|
|
36
|
+
*/
|
|
37
|
+
export type PushRemindTypeWithoutDefault = Exclude<PushRemindType, 'DEFAULT'>;
|
|
38
|
+
/**
|
|
39
|
+
* [zh-CN] 免打扰模式常量集合。
|
|
40
|
+
* [en-US] Do Not Disturb (DND) mode constants.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PUSH_SILENT_MODE: {
|
|
43
|
+
readonly REMIND_TYPE: "REMIND_TYPE";
|
|
44
|
+
readonly DURATION: "DURATION";
|
|
45
|
+
readonly INTERVAL: "INTERVAL";
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* [zh-CN] 免打扰模式类型。
|
|
49
|
+
* [en-US] Do Not Disturb (DND) types.
|
|
50
|
+
*/
|
|
51
|
+
export type PushSilentMode = (typeof PUSH_SILENT_MODE)[keyof typeof PUSH_SILENT_MODE];
|
|
52
|
+
/**
|
|
53
|
+
* [zh-CN] 时间点(24 小时制)。
|
|
54
|
+
* [en-US] Time in 24-hour format.
|
|
55
|
+
*/
|
|
56
|
+
export interface PushTimePoint {
|
|
57
|
+
/** [zh-CN] 小时,范围为 0 至 23。 [en-US] Hour, in the range [0, 23]. */
|
|
58
|
+
readonly hours: number;
|
|
59
|
+
/** [zh-CN] 分钟,范围为 0 至 59。 [en-US] Minute, in the range [0, 59]. */
|
|
60
|
+
readonly minutes: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* [zh-CN] 推送提醒规则配置项(基于提醒类型)。
|
|
64
|
+
* [en-US] Push reminder rule configuration (based on reminder type).
|
|
65
|
+
*/
|
|
66
|
+
export interface PushSilentModeRemindTypeRuleInput {
|
|
67
|
+
/** [zh-CN] 取值必须为 `REMIND_TYPE`。 [en-US] Must be `REMIND_TYPE`. */
|
|
68
|
+
readonly mode: 'REMIND_TYPE';
|
|
69
|
+
/** [zh-CN] 提醒类型。可选值:`ALL`、`AT`、`NONE`。 [en-US] Reminder type. Valid values: `ALL`, `AT`, `NONE`. */
|
|
70
|
+
readonly remindType: PushRemindTypeWithoutDefault;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* [zh-CN] 推送提醒规则配置项(基于持续时长)。
|
|
74
|
+
* [en-US] Push reminder rule configuration (based on duration).
|
|
75
|
+
*/
|
|
76
|
+
export interface PushSilentModeDurationRuleInput {
|
|
77
|
+
/** [zh-CN] 取值必须为 `DURATION`。 [en-US] Must be `DURATION`. */
|
|
78
|
+
readonly mode: 'DURATION';
|
|
79
|
+
/** [zh-CN] 持续时长(分钟),必须为正整数。SDK 会在 REST 请求中转换为毫秒。 [en-US] Duration in minutes, must be a positive integer. The SDK converts it to milliseconds for REST requests. */
|
|
80
|
+
readonly duration: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* [zh-CN] 推送提醒规则配置项(基于时间区间)。
|
|
84
|
+
* [en-US] Push reminder rule configuration (based on time interval).
|
|
85
|
+
*/
|
|
86
|
+
export interface PushSilentModeIntervalRuleInput {
|
|
87
|
+
/** [zh-CN] 取值必须为 `INTERVAL`。 [en-US] Must be `INTERVAL`. */
|
|
88
|
+
readonly mode: 'INTERVAL';
|
|
89
|
+
/** [zh-CN] 开始时间点。 [en-US] Interval start time. */
|
|
90
|
+
readonly startTime: PushTimePoint;
|
|
91
|
+
/** [zh-CN] 结束时间点。 [en-US] Interval end time. */
|
|
92
|
+
readonly endTime: PushTimePoint;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* [zh-CN] 免打扰规则配置项联合类型。
|
|
96
|
+
* [en-US] Union type for DND mode rule configurations.
|
|
97
|
+
*/
|
|
98
|
+
export type PushSilentModeRuleInput = PushSilentModeRemindTypeRuleInput | PushSilentModeDurationRuleInput | PushSilentModeIntervalRuleInput;
|
|
99
|
+
/**
|
|
100
|
+
* [zh-CN] 免打扰规则查询视图(各字段可并存)。
|
|
101
|
+
* [en-US] DND mode rule view (fields can coexist).
|
|
102
|
+
*/
|
|
103
|
+
export interface PushSilentModeRuleView {
|
|
104
|
+
/** [zh-CN] 当前提醒类型。 [en-US] Current reminder type. */
|
|
105
|
+
readonly remindType?: PushRemindType;
|
|
106
|
+
/** [zh-CN] 免打扰到期时间戳(毫秒)。该值直接映射服务端响应中的 `ignoreDuration`,SDK 不自行计算。 [en-US] DND expiration timestamp in milliseconds. This value maps directly from `ignoreDuration` in the server response and is not calculated by the SDK. */
|
|
107
|
+
readonly expireTimestamp?: number;
|
|
108
|
+
/** [zh-CN] 每日免打扰开始时间。 [en-US] Daily DND mode start time. */
|
|
109
|
+
readonly silentModeStartTime?: PushTimePoint;
|
|
110
|
+
/** [zh-CN] 每日免打扰结束时间。 [en-US] Daily DND mode end time. */
|
|
111
|
+
readonly silentModeEndTime?: PushTimePoint;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* [zh-CN] 仅包含提醒类型的规则视图。
|
|
115
|
+
* [en-US] Reminder-type-only rule view.
|
|
116
|
+
*/
|
|
117
|
+
export type PushSilentModeRemindTypeRuleView = Readonly<{
|
|
118
|
+
/** [zh-CN] 当前提醒类型。 [en-US] Current reminder type. */
|
|
119
|
+
remindType: PushRemindType;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* [zh-CN] 仅包含时长模式到期时间的规则视图。
|
|
123
|
+
* [en-US] Expiration-only rule view for duration mode.
|
|
124
|
+
*/
|
|
125
|
+
export type PushSilentModeDurationRuleView = Readonly<{
|
|
126
|
+
/** [zh-CN] 免打扰到期时间戳(毫秒),直接来自服务端响应。 [en-US] DND expiration timestamp in milliseconds, returned directly by the server. */
|
|
127
|
+
expireTimestamp: number;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* [zh-CN] 仅包含时间区间的规则视图。
|
|
131
|
+
* [en-US] Interval-only rule view.
|
|
132
|
+
*/
|
|
133
|
+
export type PushSilentModeIntervalRuleView = Readonly<{
|
|
134
|
+
/** [zh-CN] 每日免打扰开始时间。 [en-US] Daily silent mode start time. */
|
|
135
|
+
silentModeStartTime: PushTimePoint;
|
|
136
|
+
/** [zh-CN] 每日免打扰结束时间。 [en-US] Daily silent mode end time. */
|
|
137
|
+
silentModeEndTime: PushTimePoint;
|
|
138
|
+
}>;
|
|
139
|
+
/**
|
|
140
|
+
* [zh-CN] 全局免打扰响应结果。
|
|
141
|
+
* [en-US] Response for global DND mode.
|
|
142
|
+
*/
|
|
143
|
+
export interface GlobalSilentModeResponse {
|
|
144
|
+
/** [zh-CN] 作用域,必须为 `global`。 [en-US] Scope, always `global`. */
|
|
145
|
+
readonly scope: 'global';
|
|
146
|
+
/** [zh-CN] 全局免打扰规则。 [en-US] Global DND mode rule. */
|
|
147
|
+
readonly rule: PushSilentModeRuleView;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* [zh-CN] 会话免打扰配置响应。
|
|
151
|
+
* [en-US] Response for DND configuration for a single conversation.
|
|
152
|
+
*/
|
|
153
|
+
export interface ConversationSilentModeResponse {
|
|
154
|
+
/** [zh-CN] 会话 ID。 [en-US] Conversation ID. */
|
|
155
|
+
readonly conversationId: string;
|
|
156
|
+
/** [zh-CN] 会话类型。 [en-US] Conversation type. */
|
|
157
|
+
readonly conversationType: PushConversationType;
|
|
158
|
+
/** [zh-CN] 会话免打扰规则。 [en-US] Conversation DND mode rule. */
|
|
159
|
+
readonly rule: PushSilentModeRuleView;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* [zh-CN] 会话标识。
|
|
163
|
+
* [en-US] Conversation identification.
|
|
164
|
+
*/
|
|
165
|
+
export interface ConversationIdentifier {
|
|
166
|
+
/** [zh-CN] 会话 ID。 [en-US] Conversation ID. */
|
|
167
|
+
readonly conversationId: string;
|
|
168
|
+
/** [zh-CN] 会话类型。 [en-US] Conversation type. */
|
|
169
|
+
readonly conversationType: PushConversationType;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* [zh-CN] 批量会话免打扰响应。
|
|
173
|
+
* [en-US] Response for DND settings of a batch of conversations.
|
|
174
|
+
*/
|
|
175
|
+
export interface BatchConversationSilentModeResponse {
|
|
176
|
+
/** [zh-CN] 会话免打扰结果列表。 [en-US] List of conversation DND mode settings. */
|
|
177
|
+
readonly conversations: ReadonlyArray<ConversationSilentModeResponse>;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* [zh-CN] 推送语言响应。
|
|
181
|
+
* [en-US] Push language response.
|
|
182
|
+
*/
|
|
183
|
+
export interface PushLanguageResponse {
|
|
184
|
+
/** [zh-CN] 当前生效的语言。 [en-US] Current push language. */
|
|
185
|
+
readonly language: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* [zh-CN] 免打扰会话条目。
|
|
189
|
+
* [en-US] Muted conversation item.
|
|
190
|
+
*/
|
|
191
|
+
export interface MutedConversationItem {
|
|
192
|
+
/** [zh-CN] 会话 ID。 [en-US] Conversation ID. */
|
|
193
|
+
readonly conversationId: string;
|
|
194
|
+
/** [zh-CN] 会话类型。 [en-US] Conversation type. */
|
|
195
|
+
readonly conversationType: PushConversationType;
|
|
196
|
+
/** [zh-CN] 推送提醒类型。可选值:`ALL`、`AT`、`NONE`。 [en-US] Reminder type. Valid values: `ALL`, `AT`, `NONE`. */
|
|
197
|
+
readonly remindType: PushRemindTypeWithoutDefault;
|
|
198
|
+
}
|
|
199
|
+
/**s
|
|
200
|
+
* [zh-CN] 免打扰会话分页响应结果。
|
|
201
|
+
* [en-US] Paginated response for muted conversations.
|
|
202
|
+
*/
|
|
203
|
+
export interface MutedConversationPageResponse {
|
|
204
|
+
/** [zh-CN] 当前页的免打扰会话列表。 [en-US] List of muted conversations for the current page. */
|
|
205
|
+
readonly conversations: ReadonlyArray<MutedConversationItem>;
|
|
206
|
+
/** [zh-CN] 下一页游标。若为空字符串,则表示没有更多数据。 [en-US] Next-page cursor. An empty string indicates no more data. */
|
|
207
|
+
readonly cursor: string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* [zh-CN] 上传推送 Token 的参数。
|
|
211
|
+
* [en-US] Parameters for uploading the push token.
|
|
212
|
+
*/
|
|
213
|
+
export interface UploadPushTokenParams {
|
|
214
|
+
/** [zh-CN] 设备唯一标识。 [en-US] Unique device ID. */
|
|
215
|
+
readonly deviceId: string;
|
|
216
|
+
/** [zh-CN] 设备推送 Token。 [en-US] Device push token. */
|
|
217
|
+
readonly deviceToken: string;
|
|
218
|
+
/** [zh-CN] 推送通道名称(例如:'FCM')。 [en-US] Push channel name (e.g., 'FCM'). */
|
|
219
|
+
readonly notifierName: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* [zh-CN] 设置全局免打扰的参数。
|
|
223
|
+
* [en-US] Parameters for setting global Do Not Disturb (DND) mode.
|
|
224
|
+
*/
|
|
225
|
+
export interface SetGlobalSilentModeParams {
|
|
226
|
+
/** [zh-CN] 推送提醒规则配置项。 [en-US] Push reminder rule configuration. */
|
|
227
|
+
readonly rule: PushSilentModeRuleInput;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* [zh-CN] 查询全局免打扰设置的参数。
|
|
231
|
+
* [en-US] Parameters for querying global DND settings.
|
|
232
|
+
*/
|
|
233
|
+
export type GetGlobalSilentModeParams = Record<string, never>;
|
|
234
|
+
/**
|
|
235
|
+
* [zh-CN] 设置会话免打扰参数。
|
|
236
|
+
* [en-US] Parameters for setting the conversation DND mode.
|
|
237
|
+
*/
|
|
238
|
+
export interface SetConversationSilentModeParams {
|
|
239
|
+
/** [zh-CN] 会话 ID。 [en-US] Conversation ID. */
|
|
240
|
+
readonly conversationId: string;
|
|
241
|
+
/** [zh-CN] 会话类型。 [en-US] Conversation type. */
|
|
242
|
+
readonly conversationType: PushConversationType;
|
|
243
|
+
/** [zh-CN] 会话免打扰规则。 [en-US] DND mode rule for the conversation. */
|
|
244
|
+
readonly rule: PushSilentModeRuleInput;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* [zh-CN] 查询会话免打扰参数。
|
|
248
|
+
* [en-US]Parameters for querying the conversation DND mode.
|
|
249
|
+
*/
|
|
250
|
+
export interface GetConversationSilentModeParams {
|
|
251
|
+
/** [zh-CN] 会话 ID。 [en-US] Conversation ID. */
|
|
252
|
+
readonly conversationId: string;
|
|
253
|
+
/** [zh-CN] 会话类型。 [en-US] Conversation type. */
|
|
254
|
+
readonly conversationType: PushConversationType;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* [zh-CN] 清除会话推送提醒类型参数。
|
|
258
|
+
* [en-US] Parameters for clearing the conversation push reminder type.
|
|
259
|
+
*/
|
|
260
|
+
export interface ClearConversationRemindTypeParams {
|
|
261
|
+
/** [zh-CN] 会话 ID。 [en-US] Conversation ID. */
|
|
262
|
+
readonly conversationId: string;
|
|
263
|
+
/** [zh-CN] 会话类型。 [en-US] Conversation type. */
|
|
264
|
+
readonly conversationType: PushConversationType;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* [zh-CN] 批量查询会话免打扰设置的参数。
|
|
268
|
+
* [en-US] Parameters for batch querying conversation DND mode.
|
|
269
|
+
*/
|
|
270
|
+
export interface GetConversationSilentModesParams {
|
|
271
|
+
/** [zh-CN] 会话标识列表。单次最多支持 20 条。 [en-US] List of conversation IDs, up to 20 per request. */
|
|
272
|
+
readonly conversationList: ReadonlyArray<ConversationIdentifier>;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* [zh-CN] 设置推送目标语言的参数。
|
|
276
|
+
* [en-US] Parameters for setting the push notification language.
|
|
277
|
+
*/
|
|
278
|
+
export interface SetPushLanguageParams {
|
|
279
|
+
/** [zh-CN] 语言标识符(例如:`zh-Hans`、`en`)。 [en-US] Language identifier (e.g., `zh-Hans`, `en`). */
|
|
280
|
+
readonly language: string;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* [zh-CN] 查询推送目标语言的参数。
|
|
284
|
+
* [en-US] Parameters for querying the push notification language.
|
|
285
|
+
*/
|
|
286
|
+
export type GetPushLanguageParams = Record<string, never>;
|
|
287
|
+
/**
|
|
288
|
+
* [zh-CN] 分页查询会话提醒类型参数。
|
|
289
|
+
* [en-US] Parameters for paginating conversations by reminder type.
|
|
290
|
+
*/
|
|
291
|
+
export interface GetConversationListByRemindTypeParams {
|
|
292
|
+
/** [zh-CN] 分页大小,必须为正整数。 [en-US] Number of conversations per page. It must be a positive integer. */
|
|
293
|
+
readonly pageSize: number;
|
|
294
|
+
/** [zh-CN] 下一页游标。首次查询时无需传入。 [en-US] Cursor for the next page. Omit for the first request. */
|
|
295
|
+
readonly cursor?: string;
|
|
296
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [zh-CN] 发送者信息。
|
|
3
|
+
* [en-US] Sender information.
|
|
4
|
+
*/
|
|
5
|
+
export interface Sender {
|
|
6
|
+
/** [zh-CN] 发送者用户 ID。 [en-US] Sender user ID. */
|
|
7
|
+
userId: string;
|
|
8
|
+
/** [zh-CN] 发送者昵称。 [en-US] Sender nickname. */
|
|
9
|
+
nickname?: string;
|
|
10
|
+
/** [zh-CN] 发送者头像地址。 [en-US] Sender avatar URL. */
|
|
11
|
+
avatarUrl?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ErrorCode } from '../utils/error-codes';
|
|
2
|
+
/**
|
|
3
|
+
* [zh-CN] 登录后自动同步的数据类型。
|
|
4
|
+
* [en-US] Data type synchronized automatically after login.
|
|
5
|
+
*/
|
|
6
|
+
export type SyncDataType = 'conversation' | 'contact' | 'group';
|
|
7
|
+
/**
|
|
8
|
+
* [zh-CN] 同步完成状态。
|
|
9
|
+
* [en-US] Terminal status of a sync round.
|
|
10
|
+
*/
|
|
11
|
+
export type SyncDataStatus = 'success' | 'failed';
|
|
12
|
+
/**
|
|
13
|
+
* [zh-CN] 同步失败阶段。
|
|
14
|
+
* [en-US] Stage where a sync round failed.
|
|
15
|
+
*/
|
|
16
|
+
export type SyncDataErrorStage = 'config' | 'socket_connect' | 'metadata' | 'request_send' | 'sync_page' | 'decode' | 'response_decode' | 'batch_merge' | 'preview_persist' | 'completion_meta' | 'auth' | 'server_limit' | 'cancelled' | 'fallback';
|
|
17
|
+
/**
|
|
18
|
+
* [zh-CN] 同步失败详情。
|
|
19
|
+
* [en-US] Diagnostic error details for a sync round.
|
|
20
|
+
*/
|
|
21
|
+
export interface SyncDataError {
|
|
22
|
+
/** [zh-CN] 同步数据类型。 [en-US] Synchronized data type. */
|
|
23
|
+
readonly dataType: SyncDataType;
|
|
24
|
+
/** [zh-CN] SDK 对外错误码。 [en-US] Public SDK error code. */
|
|
25
|
+
readonly code: ErrorCode;
|
|
26
|
+
/** [zh-CN] 失败阶段。 [en-US] Failure stage. */
|
|
27
|
+
readonly stage: SyncDataErrorStage;
|
|
28
|
+
/** [zh-CN] 错误消息。 [en-US] Error message. */
|
|
29
|
+
readonly message: string;
|
|
30
|
+
/** [zh-CN] 是否建议重试。 [en-US] Whether retrying is recommended. */
|
|
31
|
+
readonly retryable: boolean;
|
|
32
|
+
/** [zh-CN] 服务端原始错误码,仅用于排障。 [en-US] Original service error code for troubleshooting only. */
|
|
33
|
+
readonly serverCode?: number | string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* [zh-CN] 同步开始事件载荷。
|
|
37
|
+
* [en-US] Payload emitted when a sync round starts.
|
|
38
|
+
*/
|
|
39
|
+
export interface SyncDataStartPayload {
|
|
40
|
+
/** [zh-CN] 同步数据类型。 [en-US] Synchronized data type. */
|
|
41
|
+
readonly dataType: SyncDataType;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* [zh-CN] 同步完成事件载荷。
|
|
45
|
+
* [en-US] Payload emitted when a sync round finishes.
|
|
46
|
+
*/
|
|
47
|
+
export interface SyncDataFinishedPayload {
|
|
48
|
+
/** [zh-CN] 同步数据类型。 [en-US] Synchronized data type. */
|
|
49
|
+
readonly dataType: SyncDataType;
|
|
50
|
+
/** [zh-CN] 完成状态。 [en-US] Terminal status. */
|
|
51
|
+
readonly status: SyncDataStatus;
|
|
52
|
+
/** [zh-CN] 失败时的错误详情。 [en-US] Error details when the round failed. */
|
|
53
|
+
readonly error?: SyncDataError;
|
|
54
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [zh-CN] UserInfoManager 对外类型定义。
|
|
3
|
+
* [en-US] Public types for UserInfoManager.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* [zh-CN] 用户资料属性名。
|
|
7
|
+
* [en-US] Public user profile attribute names.
|
|
8
|
+
*/
|
|
9
|
+
export type UserInfoAttribute = 'nickname' | 'avatarUrl' | 'mail' | 'phone' | 'gender' | 'sign' | 'birth' | 'ext';
|
|
10
|
+
/**
|
|
11
|
+
* [zh-CN] 单个用户资料属性允许的值类型。
|
|
12
|
+
* [en-US] Allowed types of values for attributes in the profile of a single user.
|
|
13
|
+
*/
|
|
14
|
+
export type UserInfoAttributeValue = string | number | boolean;
|
|
15
|
+
/**
|
|
16
|
+
* [zh-CN] UserInfoManager 查询/更新成功后返回的标准化用户资料对象。
|
|
17
|
+
* [en-US] Normalized user profile returned by UserInfoManager fetch/update APIs.
|
|
18
|
+
*/
|
|
19
|
+
export interface UserInfo {
|
|
20
|
+
/** [zh-CN] 用户 ID。 [en-US] User ID. */
|
|
21
|
+
readonly userId: string;
|
|
22
|
+
/** [zh-CN] 昵称。 [en-US] Nickname. */
|
|
23
|
+
readonly nickname?: string;
|
|
24
|
+
/** [zh-CN] 头像地址。 [en-US] Avatar URL. */
|
|
25
|
+
readonly avatarUrl?: string;
|
|
26
|
+
/** [zh-CN] 邮箱。 [en-US] Email. */
|
|
27
|
+
readonly mail?: string;
|
|
28
|
+
/** [zh-CN] 手机号。 [en-US] Phone number. */
|
|
29
|
+
readonly phone?: string;
|
|
30
|
+
/** [zh-CN] 性别或自定义标识。 [en-US] Gender or custom gender marker. */
|
|
31
|
+
readonly gender?: UserInfoAttributeValue;
|
|
32
|
+
/** [zh-CN] 签名。 [en-US] Signature. */
|
|
33
|
+
readonly sign?: string;
|
|
34
|
+
/** [zh-CN] 生日。 [en-US] Birthday. */
|
|
35
|
+
readonly birth?: string;
|
|
36
|
+
/** [zh-CN] 扩展字段。 [en-US] Extension field. */
|
|
37
|
+
readonly ext?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* [zh-CN] 用户资料事件监听器。
|
|
41
|
+
* [en-US] User profile event listener.
|
|
42
|
+
*/
|
|
43
|
+
export interface UserInfoListener {
|
|
44
|
+
/**
|
|
45
|
+
* [zh-CN] 当前用户资料更新时触发。
|
|
46
|
+
* [en-US] Triggered when the current user's profile is updated.
|
|
47
|
+
*/
|
|
48
|
+
readonly onOwnInfoUpdated?: (userInfo: UserInfo) => void;
|
|
49
|
+
/**
|
|
50
|
+
* [zh-CN] 他人资料通过消息补位更新时触发。
|
|
51
|
+
* [en-US] Triggered when other users' profiles are hydrated from messages.
|
|
52
|
+
*/
|
|
53
|
+
readonly onUserInfoUpdated?: (userInfos: ReadonlyArray<UserInfo>) => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* [zh-CN] 按用户 ID 查询默认字段的参数。
|
|
57
|
+
* [en-US] Parameters for fetching default profile fields by user IDs.
|
|
58
|
+
*/
|
|
59
|
+
export interface FetchUserInfoByUserIdParams {
|
|
60
|
+
/** [zh-CN] 目标用户 ID 列表。 [en-US] Target user ID list. */
|
|
61
|
+
readonly userIds: ReadonlyArray<string>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* [zh-CN] 按用户 ID 与属性集查询资料的参数。
|
|
65
|
+
* [en-US] Parameters for fetching profiles by user IDs with an explicit attribute projection.
|
|
66
|
+
*/
|
|
67
|
+
export interface FetchUserInfoByAttributeParams {
|
|
68
|
+
/** [zh-CN] 目标用户 ID 列表。 [en-US] Target user ID list. */
|
|
69
|
+
readonly userIds: ReadonlyArray<string>;
|
|
70
|
+
/** [zh-CN] 需要查询的资料属性。 [en-US] Requested profile attributes. */
|
|
71
|
+
readonly attributes: ReadonlyArray<UserInfoAttribute>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* [zh-CN] 批量订阅陌生人资料变化的参数。
|
|
75
|
+
* [en-US] Parameters for subscribing to stranger profile change notifications.
|
|
76
|
+
*/
|
|
77
|
+
export interface SubscribeUsersInfoParams {
|
|
78
|
+
/** [zh-CN] 待订阅的用户 ID 列表。 [en-US] Target user ID list to subscribe. */
|
|
79
|
+
readonly userIds: ReadonlyArray<string>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* [zh-CN] 批量取消订阅陌生人资料变化的参数。
|
|
83
|
+
* [en-US] Parameters for unsubscribing stranger profile change notifications.
|
|
84
|
+
*/
|
|
85
|
+
export interface UnsubscribeUsersInfoParams {
|
|
86
|
+
/** [zh-CN] 待取消订阅的用户 ID 列表。 [en-US] Target user ID list to unsubscribe. */
|
|
87
|
+
readonly userIds: ReadonlyArray<string>;
|
|
88
|
+
}
|
|
89
|
+
/** @internal 用户资料 notify 来源。 */
|
|
90
|
+
export type UserInfoNotifySource = 'subscription' | 'contact' | 'own';
|
|
91
|
+
/** @internal 原始用户资料 notify 类型。 */
|
|
92
|
+
export type UserInfoRawNotifyType = 'subscribe_metadata_updated' | 'contact_metadata_updated' | 'user_metadata_updated';
|
|
93
|
+
/** @internal MessageReceiver 转发给 ChatClient 的用户资料原始 notify。 */
|
|
94
|
+
export interface UserInfoRawNotifyEvent {
|
|
95
|
+
readonly notifyType: UserInfoRawNotifyType;
|
|
96
|
+
readonly userId: string;
|
|
97
|
+
readonly metadata: Record<string, unknown>;
|
|
98
|
+
readonly lastModified: number;
|
|
99
|
+
}
|
|
100
|
+
/** @internal 归一化后的用户资料补丁。 */
|
|
101
|
+
export interface UserInfoNotifyPatch {
|
|
102
|
+
readonly userId: string;
|
|
103
|
+
readonly attributes: Partial<UserInfo>;
|
|
104
|
+
readonly lastModified: number;
|
|
105
|
+
readonly source: UserInfoNotifySource;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* [zh-CN] 当前用户整对象更新参数。
|
|
109
|
+
* [en-US] Patch-style update parameters for the current user's profile.
|
|
110
|
+
*/
|
|
111
|
+
export interface UpdateOwnInfoParams {
|
|
112
|
+
/** [zh-CN] 昵称;传空字符串表示清空。 [en-US] Nickname; pass an empty string to clear it. */
|
|
113
|
+
readonly nickname?: string;
|
|
114
|
+
/** [zh-CN] 头像地址;传空字符串表示清空。 [en-US] Avatar URL; pass an empty string to clear it. */
|
|
115
|
+
readonly avatarUrl?: string;
|
|
116
|
+
/** [zh-CN] 邮箱;传空字符串表示清空。 [en-US] Email; pass an empty string to clear it. */
|
|
117
|
+
readonly mail?: string;
|
|
118
|
+
/** [zh-CN] 手机号;传空字符串表示清空。 [en-US] Phone number; pass an empty string to clear it. */
|
|
119
|
+
readonly phone?: string;
|
|
120
|
+
/** [zh-CN] 性别;`false` / `0` 也是合法值。 [en-US] Gender; `false` and `0` are valid values. */
|
|
121
|
+
readonly gender?: UserInfoAttributeValue;
|
|
122
|
+
/** [zh-CN] 签名;传空字符串表示清空。 [en-US] Signature; pass an empty string to clear it. */
|
|
123
|
+
readonly sign?: string;
|
|
124
|
+
/** [zh-CN] 生日;传空字符串表示清空。 [en-US] Birthday; pass an empty string to clear it. */
|
|
125
|
+
readonly birth?: string;
|
|
126
|
+
/** [zh-CN] 扩展字段;传空字符串表示清空。 [en-US] Extension field; pass an empty string to clear it. */
|
|
127
|
+
readonly ext?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* [zh-CN] 当前用户单属性更新参数模型。
|
|
131
|
+
* [en-US] Data model for updating a single attribute of the current user's profile.
|
|
132
|
+
*/
|
|
133
|
+
export interface UpdateOwnInfoByAttributeParams {
|
|
134
|
+
/** [zh-CN] 目标属性。 [en-US] Target attribute. */
|
|
135
|
+
readonly attribute: UserInfoAttribute;
|
|
136
|
+
/** [zh-CN] 属性值。 [en-US] Attribute value. */
|
|
137
|
+
readonly value: UserInfoAttributeValue;
|
|
138
|
+
}
|
|
139
|
+
/** @internal 服务端用户资料属性结构。 */
|
|
140
|
+
export interface ServerUserInfoAttributes {
|
|
141
|
+
readonly nickname?: unknown;
|
|
142
|
+
readonly avatarurl?: unknown;
|
|
143
|
+
readonly avatarUrl?: unknown;
|
|
144
|
+
readonly mail?: unknown;
|
|
145
|
+
readonly phone?: unknown;
|
|
146
|
+
readonly gender?: unknown;
|
|
147
|
+
readonly sign?: unknown;
|
|
148
|
+
readonly birth?: unknown;
|
|
149
|
+
readonly ext?: unknown;
|
|
150
|
+
}
|
|
151
|
+
/** @internal 查询接口真实响应 envelope。 */
|
|
152
|
+
export interface UserInfoFetchResponseEnvelope {
|
|
153
|
+
readonly timestamp?: unknown;
|
|
154
|
+
readonly data?: unknown;
|
|
155
|
+
readonly lastModified?: unknown;
|
|
156
|
+
readonly duration?: unknown;
|
|
157
|
+
}
|
|
158
|
+
/** @internal 更新接口真实响应 envelope。 */
|
|
159
|
+
export interface UserInfoUpdateResponseEnvelope {
|
|
160
|
+
readonly timestamp?: unknown;
|
|
161
|
+
readonly data?: unknown;
|
|
162
|
+
readonly lastModified?: unknown;
|
|
163
|
+
readonly duration?: unknown;
|
|
164
|
+
}
|
|
165
|
+
/** @internal 订阅相关接口真实响应 envelope。 */
|
|
166
|
+
export interface UserInfoSubscriptionResponseEnvelope {
|
|
167
|
+
readonly path?: unknown;
|
|
168
|
+
readonly uri?: unknown;
|
|
169
|
+
readonly status?: unknown;
|
|
170
|
+
readonly timestamp?: unknown;
|
|
171
|
+
readonly organization?: unknown;
|
|
172
|
+
readonly application?: unknown;
|
|
173
|
+
readonly entities?: unknown;
|
|
174
|
+
readonly count?: unknown;
|
|
175
|
+
readonly data?: unknown;
|
|
176
|
+
readonly duration?: unknown;
|
|
177
|
+
readonly applicationName?: unknown;
|
|
178
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CompatibleFile } from '../types';
|
|
2
|
+
declare class AttachmentFileStore {
|
|
3
|
+
private readonly store;
|
|
4
|
+
set(msgLocalId: string, file: CompatibleFile): void;
|
|
5
|
+
get(msgLocalId: string): CompatibleFile | undefined;
|
|
6
|
+
consume(msgLocalId: string): CompatibleFile | undefined;
|
|
7
|
+
delete(msgLocalId: string): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare const attachmentFileStore: AttachmentFileStore;
|
|
11
|
+
export type { AttachmentFileStore };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { UploadAdapter } from '../platform';
|
|
2
|
+
import type { Message, SendMessageOptions } from '../types';
|
|
3
|
+
import type { UploadConfig } from './types';
|
|
4
|
+
interface AttachmentUploaderConfig extends UploadConfig {
|
|
5
|
+
uploadAdapter?: UploadAdapter;
|
|
6
|
+
}
|
|
7
|
+
export declare class AttachmentUploader {
|
|
8
|
+
private config;
|
|
9
|
+
constructor(config?: AttachmentUploaderConfig);
|
|
10
|
+
updateConfig(config: AttachmentUploaderConfig): void;
|
|
11
|
+
updateAuthToken(token: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* 发送前统一准备附件消息。
|
|
14
|
+
* 这里会串起 029 的主流程:解析本地文件、决定图片发送语义、按门槛做预检、命中则复用远端资源,未命中再进入实际上传。
|
|
15
|
+
*/
|
|
16
|
+
prepareMessage(message: Message, options?: SendMessageOptions): Promise<Message>;
|
|
17
|
+
private resolveUploadUrl;
|
|
18
|
+
private hasUploadedRemoteResource;
|
|
19
|
+
private prepareAttachmentUpload;
|
|
20
|
+
private resolveImageCandidate;
|
|
21
|
+
private maybePrecheck;
|
|
22
|
+
private computeMd5;
|
|
23
|
+
private resolveImageProcessor;
|
|
24
|
+
private requestPrecheck;
|
|
25
|
+
private requestJson;
|
|
26
|
+
private requestByAdapter;
|
|
27
|
+
private requestByFetch;
|
|
28
|
+
private buildPrecheckedUploadResult;
|
|
29
|
+
private uploadAttachment;
|
|
30
|
+
private uploadByAdapter;
|
|
31
|
+
private buildPreparedMessage;
|
|
32
|
+
private resolveThumbnailWidth;
|
|
33
|
+
private resolveThumbnailHeight;
|
|
34
|
+
private resolveUploadMetadata;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const MULTIPART_THRESHOLD: number;
|
|
2
|
+
export declare const DEFAULT_PART_SIZE: number;
|
|
3
|
+
export declare const MAX_POOL = 4;
|
|
4
|
+
export declare const FILE_CONVERSATION_TYPES: {
|
|
5
|
+
readonly single: "CHAT";
|
|
6
|
+
readonly group: "GROUP";
|
|
7
|
+
readonly room: "ROOM";
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UploadRequest } from './types';
|
|
2
|
+
import { buildUploadResult } from './utils';
|
|
3
|
+
import type { RequestAdapter } from '../platform/types';
|
|
4
|
+
import type { DataReportOperationHandle } from '../data-report/types';
|
|
5
|
+
export declare const multipartUpload: (request: UploadRequest) => Promise<ReturnType<typeof buildUploadResult>>;
|
|
6
|
+
export declare const multipartAbort: (options: {
|
|
7
|
+
restBaseUrl: string;
|
|
8
|
+
orgName: string;
|
|
9
|
+
appName: string;
|
|
10
|
+
token: string;
|
|
11
|
+
uuid: string;
|
|
12
|
+
requestAdapter?: RequestAdapter;
|
|
13
|
+
dataReportOperation?: DataReportOperationHandle;
|
|
14
|
+
}) => Promise<void>;
|