k2-im 0.1.58 → 0.2.1
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 +3 -1
- package/dist/browser.js +1 -1
- package/dist/chat-kit-pinia.d.ts +225 -170
- package/dist/chat-kit-pinia.js +1 -1
- package/dist/chat-kit-vue.d.ts +64 -44
- package/dist/chat-kit-vue.js +1 -1
- package/dist/chat-kit.d.ts +226 -171
- package/dist/chat-kit.js +1 -1
- package/dist/crypto.worker.js +17 -25
- package/dist/i18n.d.ts +61 -41
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +241 -186
- package/dist/index.js +1 -1
- package/dist/modules/api-protocol-client/src/bi-feedback.js +1 -0
- package/dist/modules/api-protocol-client/src/browser.js +1 -0
- package/dist/modules/api-protocol-client/src/client.js +1 -0
- package/dist/modules/api-protocol-client/src/config.js +1 -0
- package/dist/modules/api-protocol-client/src/constants.js +1 -0
- package/dist/modules/api-protocol-client/src/json.js +1 -0
- package/dist/modules/api-protocol-client/src/nonce.js +1 -0
- package/dist/modules/api-protocol-client/src/transports/axios.js +1 -0
- package/dist/modules/api-protocol-client/src/utils.js +1 -0
- package/dist/modules/crypto/browser.js +1 -0
- package/dist/modules/crypto/driver.js +1 -0
- package/dist/modules/crypto/vendor/crypto/index_bg.js +1 -0
- package/dist/modules/im-browser/src/crypto/channel-key-service.js +1 -0
- package/dist/modules/im-browser/src/crypto/collect-tea.js +1 -0
- package/dist/modules/im-browser/src/crypto/crypto-task-executor.js +1 -0
- package/dist/modules/im-browser/src/crypto/crypto-worker-factory.js +1 -0
- package/dist/modules/im-browser/src/crypto/crypto-worker-protocol.js +1 -0
- package/dist/modules/im-browser/src/crypto/encrypt-key-service.js +1 -0
- package/dist/modules/im-browser/src/crypto/group-key-service.js +1 -0
- package/dist/modules/im-browser/src/crypto/peer-public-key-service.js +1 -0
- package/dist/modules/im-browser/src/crypto/rsa-private-key.js +1 -0
- package/dist/modules/im-browser/src/crypto/rsa-tea-crypto-adapter.js +1 -0
- package/dist/modules/im-browser/src/crypto/stale-key-refresh.js +1 -0
- package/dist/modules/im-browser/src/crypto/tea.js +1 -0
- package/dist/modules/im-browser/src/crypto/wait-for-key-signal.js +1 -0
- package/dist/modules/im-browser/src/http/application-http-adapters.js +1 -0
- package/dist/modules/im-browser/src/http/channel-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/channel-join-application-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/channel-member-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/channel-mention-member-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/cm-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/directory-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/expression-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/lazy-api-protocol-client.js +1 -0
- package/dist/modules/im-browser/src/http/profile-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/http/requests/applications.js +1 -0
- package/dist/modules/im-browser/src/http/requests/bind-robot-conversation.js +1 -0
- package/dist/modules/im-browser/src/http/requests/board-pinned-message-validation.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-join-applications.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-management.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-members.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-mention-members.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-message-context.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-mini-program-rel.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-profile.js +1 -0
- package/dist/modules/im-browser/src/http/requests/channel-read-index.js +1 -0
- package/dist/modules/im-browser/src/http/requests/contact-blocklist.js +1 -0
- package/dist/modules/im-browser/src/http/requests/contact-friendship.js +1 -0
- package/dist/modules/im-browser/src/http/requests/contact-report.js +1 -0
- package/dist/modules/im-browser/src/http/requests/core-json-request.js +1 -0
- package/dist/modules/im-browser/src/http/requests/create-channel.js +1 -0
- package/dist/modules/im-browser/src/http/requests/create-face-to-face-group.js +1 -0
- package/dist/modules/im-browser/src/http/requests/create-group.js +1 -0
- package/dist/modules/im-browser/src/http/requests/customer-service-profile.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-board-pinned-message.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-channel-board-pinned-message.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-channel-secret-key.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-conversation-background-presets.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-group-encrypt-info.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-group-info.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-group-member-list.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-user-encrypt-info.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-user-info-friend.js +1 -0
- package/dist/modules/im-browser/src/http/requests/get-user-info-other.js +1 -0
- package/dist/modules/im-browser/src/http/requests/group-management.js +1 -0
- package/dist/modules/im-browser/src/http/requests/mark-group-read-all.js +1 -0
- package/dist/modules/im-browser/src/http/requests/membership-join.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pin-board-message.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pin-channel-board-message.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pull-messages-by-id.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pull-offline-channel.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pull-offline-chat.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pull-offline-group.js +1 -0
- package/dist/modules/im-browser/src/http/requests/pull-offline-signal.js +1 -0
- package/dist/modules/im-browser/src/http/requests/robot-menu-reply.js +1 -0
- package/dist/modules/im-browser/src/http/requests/robot-profile.js +1 -0
- package/dist/modules/im-browser/src/http/requests/search-robots.js +1 -0
- package/dist/modules/im-browser/src/http/requests/set-conversation-undisturb.js +1 -0
- package/dist/modules/im-browser/src/http/requests/set-friend-remark.js +1 -0
- package/dist/modules/im-browser/src/http/requests/set-group-nickname.js +1 -0
- package/dist/modules/im-browser/src/http/requests/unpin-board-message.js +1 -0
- package/dist/modules/im-browser/src/http/requests/unpin-channel-board-message.js +1 -0
- package/dist/modules/im-browser/src/http/requests/update-group-info.js +1 -0
- package/dist/modules/im-browser/src/http/session-favorite-http-adapter.js +1 -0
- package/dist/modules/im-browser/src/media/file-md5.js +1 -0
- package/dist/modules/im-browser/src/media/image-clipboard.js +1 -0
- package/dist/modules/im-browser/src/media/image-header-dimensions.js +1 -0
- package/dist/modules/im-browser/src/media/media-downloader.js +1 -0
- package/dist/modules/im-browser/src/media/media-preview-adapter.js +1 -0
- package/dist/modules/im-browser/src/media/media-preview-preparation-executor.js +1 -0
- package/dist/modules/im-browser/src/media/media-request-limiter.js +1 -0
- package/dist/modules/im-browser/src/media/media-transfer-adapter.js +1 -0
- package/dist/modules/im-browser/src/media/media-transfer-errors.js +1 -0
- package/dist/modules/im-browser/src/media/media-transfer-policy.js +1 -0
- package/dist/modules/im-browser/src/media/media-upload-credentials.js +1 -0
- package/dist/modules/im-browser/src/media/media-upload-recovery-codec.js +1 -0
- package/dist/modules/im-browser/src/media/media-upload-recovery-store.js +1 -0
- package/dist/modules/im-browser/src/media/media-upload-source-fingerprint.js +1 -0
- package/dist/modules/im-browser/src/media/s3-multipart-uploader.js +1 -0
- package/dist/modules/im-browser/src/media/xhr-upload-idle-timeout.js +1 -0
- package/dist/modules/im-browser/src/network/browser-connection-ownership.js +1 -0
- package/dist/modules/im-browser/src/network/network-monitor.js +1 -0
- package/dist/modules/im-browser/src/scheduling/yield-to-browser.js +1 -0
- package/dist/modules/im-browser/src/storage/indexed-db-storage-adapter.js +1 -0
- package/dist/modules/im-browser/src/transport/ws-transport.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-amplitude.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-capabilities.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-codec.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-errors.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-playback.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-player.js +1 -0
- package/dist/modules/im-browser/src/voice/voice-recorder.js +1 -0
- package/dist/modules/im-chat-kit/src/i18n/use-im-text.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/applications.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/capabilities.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/composer.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/context.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/conversation-activation.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/conversation-deletion.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/conversation-list.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/expression.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/history-return-after-send.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/media-transfer-estimate.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/media.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/message-operations.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/profile-directory.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/quoted-message.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/reaction.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/search-senders.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/search.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/session-favorites.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/session.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/thread-paging.store.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/thread-return-to-latest.js +1 -0
- package/dist/modules/im-chat-kit/src/pinia/thread.store.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/channel-mini-program-open.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/channel-mini-program-rels.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/conversation-list.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/conversation-unread.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/delayed-loading-indicator.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/media-source-priority.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/message-notification.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/message-search.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/mini-program-game-preview.js +1 -0
- package/dist/modules/im-chat-kit/src/presentation/mini-program-open-url.js +1 -0
- package/dist/modules/im-chat-kit/src/runtime/chat-runtime.js +1 -0
- package/dist/modules/im-chat-kit/src/runtime/conversation-prefetch-controller.js +1 -0
- package/dist/modules/im-chat-kit/src/runtime/media-object-url-registry.js +1 -0
- package/dist/modules/im-chat-kit/src/runtime/runtime-operation.js +1 -0
- package/dist/modules/im-chat-kit/src/services/capabilities.js +1 -0
- package/dist/modules/im-chat-kit/src/services/channel-member-management.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/channel-profile-management.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/channel-send-restriction.js +1 -0
- package/dist/modules/im-chat-kit/src/services/direct-contact-management.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/forward.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/group-member-management.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/group-profile-management.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/image-copy.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/media-file-classification.js +1 -0
- package/dist/modules/im-chat-kit/src/services/media.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/message.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/pinned-message-rules.js +1 -0
- package/dist/modules/im-chat-kit/src/services/pinned-message.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/profile-access.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/profile-directory.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/profile-display.js +1 -0
- package/dist/modules/im-chat-kit/src/services/profile.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/read.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/robot-sender-profile.js +1 -0
- package/dist/modules/im-chat-kit/src/services/search.service.js +1 -0
- package/dist/modules/im-chat-kit/src/services/send.service.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/active-date.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/create-thread-items.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/message-locate-result.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/new-message-badge.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/resolve-message-body-kind.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/resolve-quoted-message-presentation.js +1 -0
- package/dist/modules/im-chat-kit/src/thread/viewport-rules.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/emoji/emoji-legacy-catalog.json.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/emoji/index.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/emoji/recent.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/emoji/unicode-emoji-catalog.json.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/emoji/unicode.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/highlight.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/link.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/media-batch.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/media-dimensions.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/media-format.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/media-transfer-presentation.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/time-display.js +1 -0
- package/dist/modules/im-chat-kit/src/utils/waveform.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/ImThreadBodySwitch.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/ImThreadItems.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/ImThreadSurface.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/ImThreadViewport.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/message-renderer-registry.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-idle-task.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-layout-measurements.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-read-actions-context.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-surface-context.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-viewport-context.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-visibility-target-group.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/thread-visibility-targets.js +1 -0
- package/dist/modules/im-chat-kit/src/vue/thread/use-im-thread-layout-measurement.js +1 -0
- package/dist/modules/im-core/src/abort.js +1 -0
- package/dist/modules/im-core/src/cache-namespace.js +1 -0
- package/dist/modules/im-core/src/connection/backoff.js +1 -0
- package/dist/modules/im-core/src/connection/connection-manager.js +1 -0
- package/dist/modules/im-core/src/connection/heartbeat-manager.js +1 -0
- package/dist/modules/im-core/src/conversation-identity.js +1 -0
- package/dist/modules/im-core/src/diagnostics.js +1 -0
- package/dist/modules/im-core/src/event-emitter.js +1 -0
- package/dist/modules/im-core/src/login/login-handler.js +1 -0
- package/dist/modules/im-core/src/mapping/bot-sender.js +1 -0
- package/dist/modules/im-core/src/mapping/call-record-body.js +1 -0
- package/dist/modules/im-core/src/mapping/channel-message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/channel-notify-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/channel-offline-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/channel-pinned-message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/channel-read-position.js +1 -0
- package/dist/modules/im-core/src/mapping/contact-body.js +1 -0
- package/dist/modules/im-core/src/mapping/content-body.js +1 -0
- package/dist/modules/im-core/src/mapping/conversation.js +1 -0
- package/dist/modules/im-core/src/mapping/crypto-batch-preparation.js +1 -0
- package/dist/modules/im-core/src/mapping/customer-service-body.js +1 -0
- package/dist/modules/im-core/src/mapping/customer-service-message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/decrypt-recovery.js +1 -0
- package/dist/modules/im-core/src/mapping/file-body.js +1 -0
- package/dist/modules/im-core/src/mapping/files-album-body.js +1 -0
- package/dist/modules/im-core/src/mapping/game-body.js +1 -0
- package/dist/modules/im-core/src/mapping/gift-body.js +1 -0
- package/dist/modules/im-core/src/mapping/group-message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/group-notify-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/group-offline-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/image-body.js +1 -0
- package/dist/modules/im-core/src/mapping/live-room-body.js +1 -0
- package/dist/modules/im-core/src/mapping/media-album-body.js +1 -0
- package/dist/modules/im-core/src/mapping/merge.js +1 -0
- package/dist/modules/im-core/src/mapping/mes-chat-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/message-id.js +1 -0
- package/dist/modules/im-core/src/mapping/message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/messages-by-id.js +1 -0
- package/dist/modules/im-core/src/mapping/mini-program-body.js +1 -0
- package/dist/modules/im-core/src/mapping/offline-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/pinned-message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/profile-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/reaction-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/recall-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/red-packet-body.js +1 -0
- package/dist/modules/im-core/src/mapping/robot-body.js +1 -0
- package/dist/modules/im-core/src/mapping/robot-message-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/search-text.js +1 -0
- package/dist/modules/im-core/src/mapping/session-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/signal-offline-mapper.js +1 -0
- package/dist/modules/im-core/src/mapping/sort.js +1 -0
- package/dist/modules/im-core/src/mapping/sticker-body.js +1 -0
- package/dist/modules/im-core/src/mapping/stored-message.js +1 -0
- package/dist/modules/im-core/src/mapping/system-event-timeline-policy.js +1 -0
- package/dist/modules/im-core/src/mapping/text-segments.js +1 -0
- package/dist/modules/im-core/src/mapping/transfer-body.js +1 -0
- package/dist/modules/im-core/src/mapping/transfer-status.js +1 -0
- package/dist/modules/im-core/src/mapping/unread-divider.js +1 -0
- package/dist/modules/im-core/src/mapping/video-body.js +1 -0
- package/dist/modules/im-core/src/mapping/voice-body.js +1 -0
- package/dist/modules/im-core/src/message-flow/call/direct-call-manager.js +1 -0
- package/dist/modules/im-core/src/message-flow/call/direct-call-record.js +1 -0
- package/dist/modules/im-core/src/message-flow/call/direct-p2p-call.js +1 -0
- package/dist/modules/im-core/src/message-flow/call/group-call-manager.js +1 -0
- package/dist/modules/im-core/src/message-flow/call/group-call-record.js +1 -0
- package/dist/modules/im-core/src/message-flow/conversation-support.js +1 -0
- package/dist/modules/im-core/src/message-flow/edit/edit-frame.js +1 -0
- package/dist/modules/im-core/src/message-flow/edit/edit-manager.js +1 -0
- package/dist/modules/im-core/src/message-flow/edit/edit-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/edit/edit-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/expression/expression-message.js +1 -0
- package/dist/modules/im-core/src/message-flow/forward/can-transmit.js +1 -0
- package/dist/modules/im-core/src/message-flow/forward/forward-content-spec.js +1 -0
- package/dist/modules/im-core/src/message-flow/forward/forward-messages.js +1 -0
- package/dist/modules/im-core/src/message-flow/game/game-message.js +1 -0
- package/dist/modules/im-core/src/message-flow/gift/gift-message.js +1 -0
- package/dist/modules/im-core/src/message-flow/live-room/live-room-message.js +1 -0
- package/dist/modules/im-core/src/message-flow/media/media-sender.js +1 -0
- package/dist/modules/im-core/src/message-flow/mini-program/mini-program-message.js +1 -0
- package/dist/modules/im-core/src/message-flow/reaction/can-react.js +1 -0
- package/dist/modules/im-core/src/message-flow/reaction/reaction-manager.js +1 -0
- package/dist/modules/im-core/src/message-flow/reaction/reaction-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/channel-read-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/channel-read-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/customer-service-read-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/direct-read-sync.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/group-read-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/read-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/read/robot-read-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/recall/channel-message-deletion-manager.js +1 -0
- package/dist/modules/im-core/src/message-flow/recall/recall-frame.js +1 -0
- package/dist/modules/im-core/src/message-flow/recall/recall-manager.js +1 -0
- package/dist/modules/im-core/src/message-flow/recall/recall-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/recall/recall-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/channel-application-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/channel-notify-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/channel-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/command-handler-registry.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/contact-application-answer-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/contact-application-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/direct-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/friend-action-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/group-event-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/group-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/mes-chat-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/robot-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/session-favorite-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/receive/wallet-notify-receive-handlers.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/channel-outgoing-frame.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/channel-send-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/direct-outgoing-frame.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/direct-send-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/group-outgoing-frame.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/group-send-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/robot-outgoing-frame.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/robot-send-strategy.js +1 -0
- package/dist/modules/im-core/src/message-flow/send/send-strategy-registry.js +1 -0
- package/dist/modules/im-core/src/message-flow/transfer/transfer-message.js +1 -0
- package/dist/modules/im-core/src/outbox/outbox-manager.js +1 -0
- package/dist/modules/im-core/src/packet-router.js +1 -0
- package/dist/modules/im-core/src/ports/crypto-port.js +1 -0
- package/dist/modules/im-core/src/ports/crypto-task-executor.js +1 -0
- package/dist/modules/im-core/src/ports/http-port.js +1 -0
- package/dist/modules/im-core/src/ports/media-asset-cache-port.js +1 -0
- package/dist/modules/im-core/src/push/push-registration.js +1 -0
- package/dist/modules/im-core/src/read/read-reporter.js +1 -0
- package/dist/modules/im-core/src/request-tracker.js +1 -0
- package/dist/modules/im-core/src/session-favorite-album.js +1 -0
- package/dist/modules/im-core/src/session-favorite-files.js +1 -0
- package/dist/modules/im-core/src/state/channel-permissions.js +1 -0
- package/dist/modules/im-core/src/state/channel-restriction-coordinator.js +1 -0
- package/dist/modules/im-core/src/state/domain-state.js +1 -0
- package/dist/modules/im-core/src/state/draft-store.js +1 -0
- package/dist/modules/im-core/src/state/group-restriction-coordinator.js +1 -0
- package/dist/modules/im-core/src/state/local-message-window-read-error.js +1 -0
- package/dist/modules/im-core/src/state/message-reactions.js +1 -0
- package/dist/modules/im-core/src/state/message-store.js +1 -0
- package/dist/modules/im-core/src/state/message-window-store.js +1 -0
- package/dist/modules/im-core/src/state/pinned-message-coordinator.js +1 -0
- package/dist/modules/im-core/src/state/pinned-message-store.js +1 -0
- package/dist/modules/im-core/src/state/read-store.js +1 -0
- package/dist/modules/im-core/src/state/session-sort.js +1 -0
- package/dist/modules/im-core/src/state/session-store.js +1 -0
- package/dist/modules/im-core/src/sync/channel-sync-checkpoint.js +1 -0
- package/dist/modules/im-core/src/sync/sync-manager.js +1 -0
- package/dist/modules/im-i18n/src/catalog/en-US.js +1 -0
- package/dist/modules/im-i18n/src/catalog/index.js +1 -0
- package/dist/modules/im-i18n/src/catalog/th-TH.js +1 -0
- package/dist/modules/im-i18n/src/catalog/vi-VN.js +1 -0
- package/dist/modules/im-i18n/src/catalog/zh-CN.js +1 -0
- package/dist/modules/im-i18n/src/catalog/zh-TW.js +1 -0
- package/dist/modules/im-i18n/src/create-im-i18n.js +1 -0
- package/dist/modules/im-i18n/src/format/failure.js +1 -0
- package/dist/modules/im-i18n/src/format/last-message.js +1 -0
- package/dist/modules/im-i18n/src/format/media.js +1 -0
- package/dist/modules/im-i18n/src/format/mention.js +1 -0
- package/dist/modules/im-i18n/src/format/service-text.js +1 -0
- package/dist/modules/im-i18n/src/format/system-message.js +1 -0
- package/dist/modules/im-i18n/src/internal/duration.js +1 -0
- package/dist/modules/im-i18n/src/internal/interpolate.js +1 -0
- package/dist/modules/im-i18n/src/locale.js +1 -0
- package/dist/modules/im-protocol/src/board-pinned-message.js +1 -0
- package/dist/modules/im-protocol/src/frame-codec.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/channel_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/group_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.app.msg_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.channel_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.group_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.login_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.msg_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.pub_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.robot_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/im.sig_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/gen/msg_pb.js +1 -0
- package/dist/modules/im-protocol/src/protobuf/registry.js +1 -0
- package/dist/modules/im-sdk/src/cache-prefix-migration.js +1 -0
- package/dist/modules/im-sdk/src/create-im-client.js +1 -0
- package/dist/modules/im-sdk/src/domains/channel.js +1 -0
- package/dist/modules/im-sdk/src/domains/contact.js +1 -0
- package/dist/modules/im-sdk/src/domains/conversation.js +1 -0
- package/dist/modules/im-sdk/src/domains/group.js +1 -0
- package/dist/modules/im-sdk/src/domains/media-byte-computation.js +1 -0
- package/dist/modules/im-sdk/src/domains/media.js +1 -0
- package/dist/modules/im-sdk/src/domains/message.js +1 -0
- package/dist/modules/im-sdk/src/domains/pinned-message-source.js +1 -0
- package/dist/modules/im-sdk/src/domains/pinned-message.js +1 -0
- package/dist/modules/im-sdk/src/domains/session.js +1 -0
- package/dist/modules/im-sdk/src/product/applications.js +1 -0
- package/dist/modules/im-sdk/src/product/calls.js +1 -0
- package/dist/modules/im-sdk/src/product/capabilities.js +1 -0
- package/dist/modules/im-sdk/src/product/channel-mention-candidates.js +1 -0
- package/dist/modules/im-sdk/src/product/conversation-background.js +1 -0
- package/dist/modules/im-sdk/src/product/conversation-entry-unread.js +1 -0
- package/dist/modules/im-sdk/src/product/conversation-handle.js +1 -0
- package/dist/modules/im-sdk/src/product/conversations.js +1 -0
- package/dist/modules/im-sdk/src/product/customer-service.js +1 -0
- package/dist/modules/im-sdk/src/product/diagnostic-memory-buffer.js +1 -0
- package/dist/modules/im-sdk/src/product/diagnostics.js +1 -0
- package/dist/modules/im-sdk/src/product/directory.js +1 -0
- package/dist/modules/im-sdk/src/product/draft.js +1 -0
- package/dist/modules/im-sdk/src/product/emoji-catalog.js +1 -0
- package/dist/modules/im-sdk/src/product/emoji-catalog.json.js +1 -0
- package/dist/modules/im-sdk/src/product/events.js +1 -0
- package/dist/modules/im-sdk/src/product/expressions.js +1 -0
- package/dist/modules/im-sdk/src/product/face-to-face-group.js +1 -0
- package/dist/modules/im-sdk/src/product/group-calls.js +1 -0
- package/dist/modules/im-sdk/src/product/image-format.js +1 -0
- package/dist/modules/im-sdk/src/product/local-data.js +1 -0
- package/dist/modules/im-sdk/src/product/media.js +1 -0
- package/dist/modules/im-sdk/src/product/mention.js +1 -0
- package/dist/modules/im-sdk/src/product/message.js +1 -0
- package/dist/modules/im-sdk/src/product/messages-by-id.js +1 -0
- package/dist/modules/im-sdk/src/product/outbox.js +1 -0
- package/dist/modules/im-sdk/src/product/profiles.js +1 -0
- package/dist/modules/im-sdk/src/product/resource-uploader.js +1 -0
- package/dist/modules/im-sdk/src/product/robots.js +1 -0
- package/dist/modules/im-sdk/src/product/search.js +1 -0
- package/dist/modules/im-sdk/src/product/session-favorites.js +1 -0
- package/dist/modules/im-sdk/src/product/settings.js +1 -0
- package/dist/modules/im-sdk/src/runtime/advanced-message-diagnostics.js +1 -0
- package/dist/modules/im-sdk/src/runtime/channel-read-summary-refresh.js +1 -0
- package/dist/modules/im-sdk/src/runtime/customer-service-legacy-recovery.js +1 -0
- package/dist/modules/im-sdk/src/runtime/decrypt-diagnostics.js +1 -0
- package/dist/modules/im-sdk/src/runtime/foreground-work-coordinator.js +1 -0
- package/dist/modules/im-sdk/src/runtime/group-history-page-boundary.js +1 -0
- package/dist/modules/im-sdk/src/runtime/key-prefetch.js +1 -0
- package/dist/modules/im-sdk/src/runtime/local-media-preview.js +1 -0
- package/dist/modules/im-sdk/src/runtime/media-cache-maintenance.js +1 -0
- package/dist/modules/im-sdk/src/runtime/media-upload-recovery.js +1 -0
- package/dist/modules/im-sdk/src/runtime/protobuf-wire-shape.js +1 -0
- package/dist/modules/im-sdk/src/runtime/receiving-activity.js +1 -0
- package/dist/modules/im-sdk/src/runtime/recent-history-fetcher.js +1 -0
- package/dist/modules/im-sdk/src/runtime/recent-history-prefetch.js +1 -0
- package/dist/modules/im-sdk/src/runtime/session-http-clients.js +1 -0
- package/dist/modules/im-sdk/src/runtime/session-runtime.js +1 -0
- package/dist/modules/im-sdk/src/runtime/signal-offline-poller.js +1 -0
- package/dist/request-crypto.js +1 -1
- package/dist/sdk.d.ts +170 -111
- package/dist/sdk.js +1 -1
- package/package.json +2 -2
- package/dist/browser-GFKMMRZD.js +0 -1
- package/dist/browser-RTCHWSQ2.js +0 -2
- package/dist/chunk-2U2JMY5V.js +0 -1
- package/dist/chunk-B5V2O54N.js +0 -1
- package/dist/chunk-I7YY5G76.js +0 -1
- package/dist/chunk-IDECJJXC.js +0 -0
- package/dist/chunk-PHJQ6QKU.js +0 -2
- package/dist/chunk-Q2DEFN53.js +0 -1
- package/dist/chunk-SXY56EVC.js +0 -0
- package/dist/chunk-TIQ37Q7E.js +0 -2
- package/dist/chunk-VMNZGJNM.js +0 -2
- package/dist/chunk-WOT6VMZA.js +0 -1
- package/dist/chunk-X7ZBIWYF.js +0 -8
package/dist/chat-kit-pinia.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { Pinia, Store } from 'pinia';
|
|
|
4
4
|
/** 媒体业务类型:实现据此选对象存储逻辑桶;sticker 对应 app-sticker。 */
|
|
5
5
|
type MediaKind = 'image' | 'video' | 'voice' | 'file' | 'sticker';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
type ConversationType = 'direct' | 'group' | 'channel' | 'supergroup' | 'robot';
|
|
7
|
+
/** 会话类型;各类型分别处理权限、收发和历史。supergroup 仅预留类型,尚未提供业务实现。 */
|
|
8
|
+
type ConversationType = 'direct' | 'group' | 'channel' | 'supergroup' | 'robot' | 'customerService';
|
|
9
9
|
/**
|
|
10
10
|
* 会话复合身份;`conversationId` 只在对应 `conversationType` 的领域内唯一。
|
|
11
11
|
*
|
|
@@ -42,8 +42,8 @@ interface ConversationDraft$1 {
|
|
|
42
42
|
attachments: readonly [];
|
|
43
43
|
updatedAt: number;
|
|
44
44
|
}
|
|
45
|
-
/** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);gift=礼品/刮刮卡(contentType=17);robot=机器人卡片(contentType=18);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);liveRoom=直播间分享(contentType=30);未知 wire
|
|
46
|
-
type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'gift' | 'call' | 'redPacket' | 'mediaAlbum' | 'filesAlbum' | 'robot' | 'liveRoom' | 'unknown';
|
|
45
|
+
/** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);gift=礼品/刮刮卡(contentType=17);robot=机器人卡片(contentType=18);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);liveRoom=直播间分享(contentType=30);未知 wire 正文统一转换为 unknown。 */
|
|
46
|
+
type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'gift' | 'call' | 'redPacket' | 'mediaAlbum' | 'filesAlbum' | 'robot' | 'liveRoom' | 'customerService' | 'unknown';
|
|
47
47
|
/**
|
|
48
48
|
* 发送态(客户端态):消息从本地创建到服务端确认的生命周期。
|
|
49
49
|
* `uploading` 仅媒体消息使用:文件上传阶段(uploading→pending→sending→sent);
|
|
@@ -83,10 +83,10 @@ interface ImSystemMessageBody {
|
|
|
83
83
|
pinnedMessageAction?: ImPinnedMessageAction;
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
87
|
-
* `system`
|
|
88
|
-
* EXPRESSION
|
|
89
|
-
*
|
|
86
|
+
* 会话最后一条消息的语义摘要,供存储和 im-i18n 展示使用。
|
|
87
|
+
* `system` 保存解析后的 ImSystemMessageBody,formatSystemMessage 在展示时接收 selfId。
|
|
88
|
+
* EXPRESSION 按 imageType 区分 gif 与静态 sticker。
|
|
89
|
+
* 与 lastMessagePreview 同时保存;变化检查逐字段调用 lastMessageSummaryEqual,不比较对象引用。
|
|
90
90
|
*/
|
|
91
91
|
type LastMessageSummary = {
|
|
92
92
|
kind: 'text';
|
|
@@ -282,7 +282,7 @@ interface ImVoiceBody {
|
|
|
282
282
|
teaKey?: Uint8Array;
|
|
283
283
|
/** 文件加密类型:0=跟随消息,1=不加密,3=完整 TEA(BMessage.fileEncryptType;语音与图片/视频同走完整 TEA)。 */
|
|
284
284
|
fileEncryptType?: number;
|
|
285
|
-
/** 录音振幅波形(0-255
|
|
285
|
+
/** 录音振幅波形(0-255):仅发送端本地展示缓存(随消息写入本地存储、刷新后仍可画波形),**不写入 BMessage**(协议无波形字段)。 */
|
|
286
286
|
waveform?: number[];
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
@@ -389,7 +389,7 @@ interface ImRobotImageGroupModule {
|
|
|
389
389
|
/**
|
|
390
390
|
* 机器人卡片倒计时。
|
|
391
391
|
*
|
|
392
|
-
* `endTimeMs`
|
|
392
|
+
* `endTimeMs` 已转换为 epoch 毫秒;wire 秒/毫秒混用只在 mapper 转换,宿主不要再猜单位。
|
|
393
393
|
*/
|
|
394
394
|
interface ImRobotCountdownModule {
|
|
395
395
|
type: 'countdown';
|
|
@@ -482,10 +482,10 @@ interface ImGiftBody {
|
|
|
482
482
|
benCount?: string;
|
|
483
483
|
fissionNumber?: string;
|
|
484
484
|
}
|
|
485
|
-
/**
|
|
485
|
+
/** 通话媒体类型;各端 wire 0/1 的不同含义已转换成统一业务值,宿主无需读取 raw callType。 */
|
|
486
486
|
type ImCallKind = 'audio' | 'video';
|
|
487
487
|
/**
|
|
488
|
-
* 通话结束结果。Android 跨端同步把未接与取消都写成 callStatus=0
|
|
488
|
+
* 通话结束结果。Android 跨端同步把未接与取消都写成 callStatus=0,只能转换为 missed。
|
|
489
489
|
* `unknown` 仅表示该端 status 数字无法识别,不得猜成 completed。
|
|
490
490
|
*/
|
|
491
491
|
type ImCallOutcome = 'missed' | 'rejected' | 'cancelled' | 'completed' | 'busy' | 'no-permission' | 'interrupted' | 'unknown';
|
|
@@ -493,7 +493,7 @@ type ImCallOutcome = 'missed' | 'rejected' | 'cancelled' | 'completed' | 'busy'
|
|
|
493
493
|
* 单聊通话记录正文(contentType==='call',协议 BMessage.contentType=10)。
|
|
494
494
|
*
|
|
495
495
|
* @remarks JSON 在 BMessage.content。Android 本地 / Android 跨端同步 / iOS 三套字段名与 0/1 含义不同,
|
|
496
|
-
*
|
|
496
|
+
* 仅由 mapping/call-record-body 转换成统一业务值。记录由各端本地插入,不能当普通聊天发出。
|
|
497
497
|
*/
|
|
498
498
|
interface ImCallRecordBody {
|
|
499
499
|
callKind: ImCallKind;
|
|
@@ -520,7 +520,7 @@ type ImRedPacketType = 1 | 2 | 3 | 4;
|
|
|
520
520
|
* @remarks 字段来自 proto 72-79 + 复用 34/35/38/49。领域名 `packetId` 对应 wire `rad_packet_id`。
|
|
521
521
|
* 金额保持 proto string,单位是否微单位未证实,禁止默认套转账 ×1e6。
|
|
522
522
|
* HTTP 详情状态与本地「自己已领」属于宿主投影,不进本 DTO(status 39 / state 53 未裁定)。
|
|
523
|
-
*
|
|
523
|
+
* 当前不提供 `sendRedPacket`;出站字段仅用于 codec 往返闭合。
|
|
524
524
|
*/
|
|
525
525
|
interface ImRedPacketBody {
|
|
526
526
|
packetId: string;
|
|
@@ -540,7 +540,7 @@ interface ImRedPacketBody {
|
|
|
540
540
|
type ImContactKind = 'individual' | 'group' | 'channel' | 'robot' | 'unknown';
|
|
541
541
|
/**
|
|
542
542
|
* 名片消息内容体(contentType==='contact')。字段来自 BMessage contentType=8,但使用领域友好命名:
|
|
543
|
-
* id/icon/name
|
|
543
|
+
* id/icon/name 分别转换为 targetId/avatar/displayName;visitCardKey 转换为 kind,未知值放 rawKind。
|
|
544
544
|
*/
|
|
545
545
|
interface ImContactBody {
|
|
546
546
|
/** 被分享对象 id:个人 userId、普通群 groupId、频道 id 或机器人 id。 */
|
|
@@ -572,7 +572,7 @@ interface UnknownMessageBody {
|
|
|
572
572
|
* 若干项共享消息级的撤回、已读、引用与转发语义。
|
|
573
573
|
*/
|
|
574
574
|
interface ImMediaAlbumItem {
|
|
575
|
-
/** 该项是图片还是视频;由协议
|
|
575
|
+
/** 该项是图片还是视频;由协议 mediaType 转换,无法识别的项会在解析时丢弃。 */
|
|
576
576
|
kind: 'image' | 'video';
|
|
577
577
|
/** 远端地址。加密项也是这个地址,解密用本项自己的 `teaKey`。 */
|
|
578
578
|
url: string;
|
|
@@ -654,8 +654,28 @@ interface ImLiveRoomBody {
|
|
|
654
654
|
/** 点赞数十进制字符串,保持协议原文,不在 Core 换算。 */
|
|
655
655
|
liveRoomLikes?: string;
|
|
656
656
|
}
|
|
657
|
+
/** 客服正文保留一条消息内的全部附件;图片和文件各自保持服务端顺序。 */
|
|
658
|
+
interface ImCustomerServiceBody {
|
|
659
|
+
/** 原始文字;空白不被当作不存在。 */
|
|
660
|
+
text: string;
|
|
661
|
+
/** 图片直达地址,不套用普通消息的加密文件结构。 */
|
|
662
|
+
images: readonly string[];
|
|
663
|
+
/** 文件与名称、大小按协议数组索引配对,不创建伪消息 ID。 */
|
|
664
|
+
files: readonly ImCustomerServiceFile[];
|
|
665
|
+
}
|
|
666
|
+
/** 客服文件元数据。大小是服务端展示文字,不能据此认定下载完整。 */
|
|
667
|
+
interface ImCustomerServiceFile {
|
|
668
|
+
/** 服务端给出的资源地址。 */
|
|
669
|
+
url: string;
|
|
670
|
+
/** 服务端名称;缺省时从 URL 最后一个路径片段提取。 */
|
|
671
|
+
name: string;
|
|
672
|
+
/** 可缺省的原始大小描述,例如 1.5MB,并非精确字节数。 */
|
|
673
|
+
sizeLabel?: string;
|
|
674
|
+
}
|
|
657
675
|
interface ImMessageBody {
|
|
658
|
-
/**
|
|
676
|
+
/** 客服专用复合正文;不能直接作为普通消息发送。 */
|
|
677
|
+
customerService?: ImCustomerServiceBody;
|
|
678
|
+
/** 文本内容(明文,解密后的结果)。 */
|
|
659
679
|
text?: string;
|
|
660
680
|
/** contentType==='system' 时的结构化系统提示体(群通知;text 忽略)。 */
|
|
661
681
|
system?: ImSystemMessageBody;
|
|
@@ -705,7 +725,7 @@ interface MentionRange {
|
|
|
705
725
|
end: number;
|
|
706
726
|
}
|
|
707
727
|
/**
|
|
708
|
-
* 群消息 @ 提及(Android
|
|
728
|
+
* 群消息 @ 提及(Android 三写载体的统一解析):`atAll`(MESGrpChat.nNotifyCount=-1)、`atUserIds`(sNotifyUsers 被 @ 成员,
|
|
709
729
|
* 含正文 token 读边界补全)、`ranges`(extend.atRange,可选、仅诊断/兼容——展示**不依赖其坐标**)。正文 `body.text` 保留 `[userId]` token 原样(真相不变);
|
|
710
730
|
* **展示权威来源 = 正文 token + atUserIds/atAll**,由纯函数 `resolveMentionSegments` 还原为高亮段(含 @昵称/@所有人/@我),UI 不自行解析。
|
|
711
731
|
*/
|
|
@@ -727,21 +747,21 @@ type ImMessageFailureReason = 'timeout' | 'rejected' | 'encrypt_failed' | 'netwo
|
|
|
727
747
|
*/
|
|
728
748
|
type ImFailureDisplayCode = 'media.empty' | 'media.noCrypto' | 'media.previewFailed' | 'media.encryptFailed' | 'media.resumeUnavailable' | 'media.cleanupUnconfirmed' | 'media.uploadFailed' | 'media.uploadTimeout' | 'media.cancelled' | 'media.invalidDuration' | 'media.uploadInterrupted' | 'media.contentTooLarge' | 'contactRequired' | 'messageRefused' | 'forbiddenOrLeft' | 'contentRejected' | 'groupDismissed' | 'groupUnavailable' | 'channelDismissed' | 'channelMuted' | 'channelNotMember' | 'channelAdminRequired' | 'conversationUnsupported' | 'sendCanceled' | 'sessionLoggedOut' | 'timeout' | 'network' | 'unknown';
|
|
729
749
|
interface ImMessageFailure {
|
|
730
|
-
/**
|
|
750
|
+
/** 转换后的错误码(来自 MESChatAck.errcode 或本地失败码,本地码用负值)。 */
|
|
731
751
|
code: number;
|
|
732
752
|
/** 失败机器分类(重试 / fail-fast / 统计消费)。 */
|
|
733
753
|
reason: ImMessageFailureReason;
|
|
734
|
-
/**
|
|
754
|
+
/** 失败展示语义码:UI 经 im-i18n 按语言渲染,缺省时使用 message;不单独触发消息状态更新。 */
|
|
735
755
|
displayCode?: ImFailureDisplayCode;
|
|
736
|
-
/** 展示模板参数(如未支持会话类型的 type
|
|
756
|
+
/** 展示模板参数(如未支持会话类型的 type);不单独触发消息状态更新。 */
|
|
737
757
|
params?: Record<string, string | number>;
|
|
738
758
|
/** 媒体失败的媒体类型(图片/视频/语音/文件):供 displayCode 为 media.* 时渲染 label。 */
|
|
739
759
|
mediaKind?: MediaKind;
|
|
740
|
-
/**
|
|
760
|
+
/** 后端原文或诊断文案;没有专门展示码时用于展示,不单独触发消息状态更新(见 merge.failureEqual)。 */
|
|
741
761
|
message?: string;
|
|
742
762
|
/**
|
|
743
763
|
* 是否可重试(false=业务级不可重试):如 direct 非好友或 GROUP 不在群(0x8201)、内容为空/违规(0x8202)、群已解散(0x8315)→ UI 隐藏「重发」。
|
|
744
|
-
* 缺省(undefined)视为可重试(向后兼容)。由 code 决定(classifyAckFailure
|
|
764
|
+
* 缺省(undefined)视为可重试(向后兼容)。由 code 决定(classifyAckFailure),不单独触发消息状态更新。
|
|
745
765
|
*/
|
|
746
766
|
retryable?: boolean;
|
|
747
767
|
}
|
|
@@ -784,7 +804,7 @@ interface MediaTaskUpdate {
|
|
|
784
804
|
failure?: ImMessageFailure;
|
|
785
805
|
}
|
|
786
806
|
interface ImMessageEncryption {
|
|
787
|
-
/**
|
|
807
|
+
/** true=消息密文链路, false=明文链路(encrypt=0)。 */
|
|
788
808
|
encrypted: boolean;
|
|
789
809
|
/** 扩展:加密方案标识,默认 'rsa-tea'。 */
|
|
790
810
|
scheme?: 'rsa-tea';
|
|
@@ -793,16 +813,16 @@ interface ImMessageEncryption {
|
|
|
793
813
|
}
|
|
794
814
|
/** 单条消息领域模型(§4.1)。主键为客户端生成的 id(无 serverId)。 */
|
|
795
815
|
interface ImMessage {
|
|
796
|
-
/**
|
|
816
|
+
/** 客户端生成的稳定消息 ID(UUID),同时作幂等键;刷新后保持。 */
|
|
797
817
|
id: string;
|
|
798
|
-
/**
|
|
818
|
+
/** 消息所属会话的字符串 ID;必须结合 conversationType 使用。 */
|
|
799
819
|
conversationId: string;
|
|
800
820
|
conversationType: ConversationType;
|
|
801
|
-
/**
|
|
821
|
+
/** 发送者的字符串用户 ID。 */
|
|
802
822
|
senderId: string;
|
|
803
823
|
contentType: MessageContentType;
|
|
804
824
|
body: ImMessageBody;
|
|
805
|
-
/**
|
|
825
|
+
/** 统一毫秒 number(本地创建时间,乐观渲染用)。 */
|
|
806
826
|
createdAt: number;
|
|
807
827
|
/** SDK 内部排序键;有效服务端时间优先,ACK 后可以更新。宿主不解析它,消息身份始终使用 id。 */
|
|
808
828
|
sortKey: string;
|
|
@@ -811,7 +831,7 @@ interface ImMessage {
|
|
|
811
831
|
failure?: ImMessageFailure;
|
|
812
832
|
/** 服务端回传的 epoch 毫秒时间;有效时用于正式排序与展示,createdAt 仍保留创建记录。 */
|
|
813
833
|
serverTime?: number;
|
|
814
|
-
/**
|
|
834
|
+
/** 默认 'unread'。 */
|
|
815
835
|
receipt: MessageReceipt;
|
|
816
836
|
/** 离线单聊服务端标记当前账号已在其它端读过;仅用于本地未读投影,不改变对端回执 receipt。 */
|
|
817
837
|
readBySelf?: boolean;
|
|
@@ -844,7 +864,7 @@ interface ImMessage {
|
|
|
844
864
|
/** 扩展位:后端新增语义先落这里,避免污染核心字段。 */
|
|
845
865
|
extensions?: Record<string, unknown>;
|
|
846
866
|
/**
|
|
847
|
-
* 诊断快照(§4.1
|
|
867
|
+
* 诊断快照(§4.1 诊断口径):后端下发的原始协议字段(已转换为可 JSON 序列化形态)。
|
|
848
868
|
* 默认不填充,仅当映射开启 keepRaw 时附带,便于联调、与后端核对原始下发;不参与任何业务逻辑。
|
|
849
869
|
*/
|
|
850
870
|
raw?: ImMessageRaw;
|
|
@@ -961,17 +981,17 @@ type ChannelSessionState = 'active' | 'guest' | 'left' | 'removed' | 'dismissed'
|
|
|
961
981
|
interface ImSession {
|
|
962
982
|
id: string;
|
|
963
983
|
type: ConversationType;
|
|
964
|
-
/**
|
|
984
|
+
/** 由映射层从用户/群资料补齐。 */
|
|
965
985
|
title: string;
|
|
966
986
|
avatar?: string;
|
|
967
987
|
/**
|
|
968
|
-
*
|
|
988
|
+
* 会话最后一条的预览串(**已收窄**):仅承载 text 消息的正文(供会话列表 previewSegments 解析 @/表情,需原始正文串);
|
|
969
989
|
* 媒体 / 加密 / 系统 / 撤回一律空串——其语义改由 lastMessageSummary 承载、UI 经 im-i18n 渲染。旧盘遗留的中文占位在 hydrate / projectSession 重算时清空。
|
|
970
990
|
*/
|
|
971
991
|
lastMessagePreview: string;
|
|
972
992
|
/**
|
|
973
|
-
*
|
|
974
|
-
*
|
|
993
|
+
* 最后一条消息的语义摘要,持久保存并由 im-i18n 按语言生成文案。
|
|
994
|
+
* 与 lastMessagePreview 同时保存,变化检查使用逐字段比较;旧会话缺此字段时可使用 lastMessagePreview。
|
|
975
995
|
*/
|
|
976
996
|
lastMessageSummary?: LastMessageSummary;
|
|
977
997
|
/** 最后一条消息发送者 id(群会话列表预览「发送者名: 内容」前缀用;`'system'`=系统提示、==自己=我发的,前缀策略由宿主定)。 */
|
|
@@ -995,7 +1015,7 @@ interface ImSession {
|
|
|
995
1015
|
* 会话内容仍显示最新一条消息。收到别人 @我 +1、查看/已读该会话清零。投影自 ReadState.mentionUnreadCount,与 unreadCount 同源持久化。
|
|
996
1016
|
*/
|
|
997
1017
|
mentionUnreadCount?: number;
|
|
998
|
-
/**
|
|
1018
|
+
/** 排序时间(毫秒 number)。 */
|
|
999
1019
|
timestamp: number;
|
|
1000
1020
|
/**
|
|
1001
1021
|
* 用户手工添加的本地“稍后处理”提醒。
|
|
@@ -1011,7 +1031,7 @@ interface ImSession {
|
|
|
1011
1031
|
topTime?: number;
|
|
1012
1032
|
/**
|
|
1013
1033
|
* 最新一条消息若为「己方且未完成发送」的态:'sending'(pending/uploading/sending 统一)/ 'failed'。
|
|
1014
|
-
* 派生展示字段(随最新消息变化,会话列表据此显示发送中 loading / 失败图标);运行期真相,不持久化(persistSession
|
|
1034
|
+
* 派生展示字段(随最新消息变化,会话列表据此显示发送中 loading / 失败图标);运行期真相,不持久化(persistSession 写入本地存储时剔除)。
|
|
1015
1035
|
*/
|
|
1016
1036
|
lastMessageSendState?: 'sending' | 'failed';
|
|
1017
1037
|
/**
|
|
@@ -1019,11 +1039,11 @@ interface ImSession {
|
|
|
1019
1039
|
*
|
|
1020
1040
|
* 只在自己发出且 `status='sent'` 时投影;发送中/失败、对端消息、撤回、全员删除和系统提示都不给。
|
|
1021
1041
|
* `delivered` 与尚未回执一样投影为 `unread`;当前协议没有送达通知,不能把 `sent` 当作对端已收到。
|
|
1022
|
-
*
|
|
1042
|
+
* 该字段随最新消息变化,并随会话写入本地存储,避免冷启动后
|
|
1023
1043
|
* 因「盘中缺字段 / 内存有字段」反复广播;对端已读变化必须刷新会话行。
|
|
1024
1044
|
*/
|
|
1025
1045
|
lastMessageReceipt?: 'unread' | 'read';
|
|
1026
|
-
/**
|
|
1046
|
+
/** 我方已读游标(见 §4.3)。 */
|
|
1027
1047
|
readCursor?: string;
|
|
1028
1048
|
/** 群受限状态(仅 group;来自 0x2204 群通知 side-effect)。缺省视为 'active'(可正常发送)。 */
|
|
1029
1049
|
groupState?: GroupSessionState;
|
|
@@ -1041,11 +1061,11 @@ interface ImSession {
|
|
|
1041
1061
|
interface ReadState {
|
|
1042
1062
|
conversationId: string;
|
|
1043
1063
|
/**
|
|
1044
|
-
*
|
|
1045
|
-
*
|
|
1064
|
+
* 新写入必须携带会话类型;可选用于兼容迁移前的存储记录。
|
|
1065
|
+
* storage migration 会根据对应 session 补齐旧记录。
|
|
1046
1066
|
*/
|
|
1047
1067
|
conversationType?: ConversationType;
|
|
1048
|
-
/**
|
|
1068
|
+
/** 当前账号已读到的位置,以消息 id 或后端游标表示。 */
|
|
1049
1069
|
readCursor: string;
|
|
1050
1070
|
/**
|
|
1051
1071
|
* 已读游标消息的 sortKey(位置)持久化快照:重启后 readCursor 对应消息未必被 hydrate 到内存,
|
|
@@ -1079,12 +1099,12 @@ interface OutboxUpdate {
|
|
|
1079
1099
|
}
|
|
1080
1100
|
/** 发送队列项(§4.4)。id 复用对应 ImMessage.id 以保证重试幂等。 */
|
|
1081
1101
|
interface OutboxMessage {
|
|
1082
|
-
/**
|
|
1102
|
+
/** == 对应 ImMessage.id(客户端生成,重试时复用以保证幂等)。 */
|
|
1083
1103
|
id: string;
|
|
1084
1104
|
conversationId: string;
|
|
1085
1105
|
conversationType: ConversationType;
|
|
1086
1106
|
contentType: MessageContentType;
|
|
1087
|
-
/**
|
|
1107
|
+
/** 待发送内容(明文;加密在发送管线内按 encryption 处理)。 */
|
|
1088
1108
|
body: ImMessageBody;
|
|
1089
1109
|
/** 群 @ 提及(发送侧:宿主从输入框提取;正文 body.text 已含 [userId] token / @所有人 文字,本字段供群发送策略编码 sNotifyUsers/nNotifyCount/extend)。仅群 @ 消息有。 */
|
|
1090
1110
|
mention?: ImMessageMention;
|
|
@@ -1098,7 +1118,7 @@ interface OutboxMessage {
|
|
|
1098
1118
|
/**
|
|
1099
1119
|
* 复发策略(生命周期 logout 语义):`automatic`(默认,缺省视同)= onAuthenticated/断线重连时自动复发;
|
|
1100
1120
|
* `manual` = 仅用户显式 retry 才发(logout 时把在途消息置 manual,避免退账号后下次登录无提示自动补发)。
|
|
1101
|
-
*
|
|
1121
|
+
* 持久化随账本写入本地存储,故 logout(preserve)→重登后仍为 manual,不被自动复发;retry 会翻回 automatic。缺省(旧账本)按 automatic 处理(向后兼容)。
|
|
1102
1122
|
*/
|
|
1103
1123
|
resumePolicy?: 'automatic' | 'manual';
|
|
1104
1124
|
}
|
|
@@ -1118,7 +1138,7 @@ interface ContactRemarkPhone {
|
|
|
1118
1138
|
countryCode: string;
|
|
1119
1139
|
mobile: string;
|
|
1120
1140
|
}
|
|
1121
|
-
/** 用户资料领域模型(§4.5)。由 ImProfilePort
|
|
1141
|
+
/** 用户资料领域模型(§4.5)。由 ImProfilePort 拉取、映射层转换字段。 */
|
|
1122
1142
|
interface UserProfile {
|
|
1123
1143
|
id: string;
|
|
1124
1144
|
/** 用户自设昵称(后端 `nick_name`)。 */
|
|
@@ -1143,7 +1163,7 @@ interface UserProfile {
|
|
|
1143
1163
|
remarkPhones?: ContactRemarkPhone[];
|
|
1144
1164
|
/** 扩展:消息加密公钥来源(§7 复用)。 */
|
|
1145
1165
|
publicKey?: string;
|
|
1146
|
-
/** 会话免打扰态(好友关系 `is_undisturb`
|
|
1166
|
+
/** 会话免打扰态(好友关系 `is_undisturb` 转换为布尔值):仅好友资料返回,供领域层回填 `ImSession.muted` 做多端/冷启动恢复;非好友无此字段(undefined,不覆盖本地)。 */
|
|
1147
1167
|
muted?: boolean;
|
|
1148
1168
|
extensions?: Record<string, unknown>;
|
|
1149
1169
|
}
|
|
@@ -1159,11 +1179,11 @@ interface GroupProfile {
|
|
|
1159
1179
|
verifyWay?: number;
|
|
1160
1180
|
/** 普通群邀请码;仅 `verifyWay === 4` 时有业务意义。 */
|
|
1161
1181
|
inviteCode?: string;
|
|
1162
|
-
/** 群状态(后端 status
|
|
1182
|
+
/** 群状态(后端 status,具体值语义待后端明确):保留不丢弃,供「普通成员感知群解散」兜底(解散仅通知群主)。 */
|
|
1163
1183
|
status?: number;
|
|
1164
|
-
/** 当前用户是否在群(后端 is_ingroup:false
|
|
1184
|
+
/** 当前用户是否在群(后端 is_ingroup:false=已不在群,被踢/退群的兜底禁发来源)。 */
|
|
1165
1185
|
isInGroup?: boolean;
|
|
1166
|
-
/** 当前用户对该群的免打扰态(`to_user.is_undisturb`
|
|
1186
|
+
/** 当前用户对该群的免打扰态(`to_user.is_undisturb` 转换为布尔值):供领域层回填 `ImSession.muted` 恢复;缺省(undefined)表示后端未返回,不覆盖本地。 */
|
|
1167
1187
|
muted?: boolean;
|
|
1168
1188
|
/** 扩展位:members[] 等明细留扩展。 */
|
|
1169
1189
|
extensions?: Record<string, unknown>;
|
|
@@ -1275,9 +1295,9 @@ interface ChannelProfile {
|
|
|
1275
1295
|
/** CHANNEL 独立访问限制事实;browser 新映射必须提供,legacy storage 可能缺失。 */
|
|
1276
1296
|
accessSnapshot?: ChannelAccessSnapshot;
|
|
1277
1297
|
muted?: boolean;
|
|
1278
|
-
/**
|
|
1298
|
+
/** 服务端频道类型转换后的业务值;不得用它把频道改路由到 `supergroup`。 */
|
|
1279
1299
|
channelKind?: string;
|
|
1280
|
-
/**
|
|
1300
|
+
/** 本地密钥缓存操作编号/服务端未来版本的非敏感标识;不承载 secret_key。 */
|
|
1281
1301
|
secretKeyVersion?: string;
|
|
1282
1302
|
/** `/user_radio/list` 的资料增量版本;与 secretKeyVersion 无关。 */
|
|
1283
1303
|
updateVersion?: string;
|
|
@@ -1307,7 +1327,7 @@ interface ChannelMemberPage {
|
|
|
1307
1327
|
}
|
|
1308
1328
|
/** CHANNEL @ 选择器返回的用户项;专用 UserInfo 协议不提供角色,不得写入 role-rich 成员缓存。 */
|
|
1309
1329
|
interface ChannelMentionMember {
|
|
1310
|
-
/**
|
|
1330
|
+
/** 用户 ID,以字符串表示;来自 `/user_radio/member/*` 的 `user_id`。 */
|
|
1311
1331
|
userId: string;
|
|
1312
1332
|
/** CHANNEL @ 面板展示名;按频道昵称、全局昵称、协议备用名、用户 ID 的顺序降级。 */
|
|
1313
1333
|
displayName: string;
|
|
@@ -1340,7 +1360,7 @@ interface ImError {
|
|
|
1340
1360
|
* 诊断日志钩子(§5.3,可选):宿主注入以观察核心诊断(如 ACK 原始 errcode)。
|
|
1341
1361
|
* core 不内置 console;不注入则不产生诊断输出。
|
|
1342
1362
|
*/
|
|
1343
|
-
/**
|
|
1363
|
+
/** 当前连接策略固定为 single,只连接首个端点。 */
|
|
1344
1364
|
type ConnectionStrategy = 'single' | 'race' | 'sequential';
|
|
1345
1365
|
interface ImReconnectOptions {
|
|
1346
1366
|
/** 退避基数毫秒,默认 1000。 */
|
|
@@ -1386,7 +1406,7 @@ interface ContactApplication {
|
|
|
1386
1406
|
/** 申请人的产品展示 ID,例如服务端 `user_info.mid`。 */
|
|
1387
1407
|
applicantDisplayId?: string;
|
|
1388
1408
|
message: string;
|
|
1389
|
-
/**
|
|
1409
|
+
/** 服务端时间戳转换后的 Unix 毫秒;源字段缺失时保持未知。 */
|
|
1390
1410
|
createdAt?: number;
|
|
1391
1411
|
}
|
|
1392
1412
|
/** 联系人申请页;分页耗尽依据原始 type=1 页,不依据产品聚合结果。 */
|
|
@@ -1442,7 +1462,7 @@ interface ApplicationTarget {
|
|
|
1442
1462
|
* GROUP 申请/邀请 provider 的权威记录。
|
|
1443
1463
|
*
|
|
1444
1464
|
* @remarks `applicationId` 是审核命令参数,`groupId` 是会话身份,两者不可互换;actor/target
|
|
1445
|
-
* 是申请时快照,最终成员关系和群资料仍由各自领域 API
|
|
1465
|
+
* 是申请时快照,最终成员关系和群资料仍由各自领域 API 统一更新。
|
|
1446
1466
|
*/
|
|
1447
1467
|
interface GroupApplication {
|
|
1448
1468
|
applicationId: string;
|
|
@@ -1453,7 +1473,7 @@ interface GroupApplication {
|
|
|
1453
1473
|
target: ApplicationTarget;
|
|
1454
1474
|
/** 申请附言或邀请说明,服务端允许为空。 */
|
|
1455
1475
|
message: string;
|
|
1456
|
-
/**
|
|
1476
|
+
/** 服务端时间戳转换后的 Unix 毫秒;源字段缺失时保持未知。 */
|
|
1457
1477
|
createdAt?: number;
|
|
1458
1478
|
}
|
|
1459
1479
|
/** GROUP 申请页;分页耗尽依据原始 type=2 混合页。 */
|
|
@@ -1552,7 +1572,7 @@ interface ChannelJoinApplication {
|
|
|
1552
1572
|
channelAvatar?: string;
|
|
1553
1573
|
/** 申请人填写的入群说明,服务端允许为空。 */
|
|
1554
1574
|
message: string;
|
|
1555
|
-
/**
|
|
1575
|
+
/** 服务端创建时间转换为 Unix 毫秒;源字段缺失或非法时不提供。 */
|
|
1556
1576
|
createdAt?: number;
|
|
1557
1577
|
}
|
|
1558
1578
|
/** CHANNEL 申请列表的页号 cursor 输入;cursor 是下一原始混合页页号。 */
|
|
@@ -1621,7 +1641,7 @@ interface ImChannelProfilePort {
|
|
|
1621
1641
|
getProfile: (channelId: string, options?: {
|
|
1622
1642
|
forceRefresh?: boolean;
|
|
1623
1643
|
}) => Promise<ChannelProfile | null>;
|
|
1624
|
-
/** 清空 CHANNEL profile
|
|
1644
|
+
/** 清空 CHANNEL profile 内存缓存,并阻止旧请求写回;与 GROUP profile 保持 sibling。 */
|
|
1625
1645
|
clearCache?: () => void;
|
|
1626
1646
|
}
|
|
1627
1647
|
/** CHANNEL 成员查询。cursor 是频道成员接口的不透明游标。 */
|
|
@@ -1634,7 +1654,7 @@ interface ChannelMemberPageQuery {
|
|
|
1634
1654
|
}
|
|
1635
1655
|
/** CHANNEL 成员读取 capability;分页列表与当前消息窗口的稀疏批量读取共用同一独立 adapter。 */
|
|
1636
1656
|
interface ImChannelMemberPort {
|
|
1637
|
-
/** hydrate
|
|
1657
|
+
/** hydrate 有界公共快照;快照新鲜时不重新请求服务端,过期时按完整页重建约 200 人。 */
|
|
1638
1658
|
prefetchMembers?: (channelId: string) => Promise<void>;
|
|
1639
1659
|
/** 只读取公共快照或其本地直接/拼音搜索结果;允许返回过期快照供 UI 先显,不发 HTTP。 */
|
|
1640
1660
|
getCachedMembers?: (input: {
|
|
@@ -1658,9 +1678,9 @@ interface ImChannelMemberPort {
|
|
|
1658
1678
|
getMembersByIds: (channelId: string, userIds: readonly string[], options?: {
|
|
1659
1679
|
forceRefresh?: boolean;
|
|
1660
1680
|
}) => Promise<ChannelMember[]>;
|
|
1661
|
-
/**
|
|
1681
|
+
/** 使频道成员缓存失效;旧请求可以返回原调用方,但不得写回当前缓存。 */
|
|
1662
1682
|
invalidateChannelMembers: (channelId: string) => Promise<void>;
|
|
1663
|
-
/** 清空全部 CHANNEL role-rich
|
|
1683
|
+
/** 清空全部 CHANNEL role-rich 成员内存缓存,并阻止旧请求写回;持久层由 storage 分类清理统一处理。 */
|
|
1664
1684
|
clearCache?: () => void;
|
|
1665
1685
|
}
|
|
1666
1686
|
/** CHANNEL @ 专用成员页查询;不得复用 role-rich 管理列表的 query/response 语义。 */
|
|
@@ -1744,10 +1764,9 @@ interface TransportEvents {
|
|
|
1744
1764
|
interface TransportPort {
|
|
1745
1765
|
readonly state: TransportState;
|
|
1746
1766
|
/**
|
|
1747
|
-
*
|
|
1748
|
-
*
|
|
1749
|
-
*
|
|
1750
|
-
* 该清理契约由 @k2/im-browser 的 WsTransport 实现并锁测(切片 04)。
|
|
1767
|
+
* 候选连接地址数组;当前实现仅连接 endpoints[0]。
|
|
1768
|
+
* 再次 connect() 时必须先关闭旧连接,保证任一时刻至多存在一个活跃传输连接。
|
|
1769
|
+
* @k2/im-browser 的 WsTransport 实现该约定。
|
|
1751
1770
|
*/
|
|
1752
1771
|
connect: (endpoints: TransportEndpoint[], options?: TransportConnectOptions) => Promise<void>;
|
|
1753
1772
|
/** 发送一帧(已编码字节)。 */
|
|
@@ -1758,7 +1777,7 @@ interface TransportPort {
|
|
|
1758
1777
|
}
|
|
1759
1778
|
|
|
1760
1779
|
interface ImEndpointProvider {
|
|
1761
|
-
/** WS
|
|
1780
|
+
/** WS 候选地址。返回单元素数组;后端下发多 host 时返回多元素。 */
|
|
1762
1781
|
getEndpoints: () => Promise<TransportEndpoint[]>;
|
|
1763
1782
|
/** CM Protobuf HTTP 基址。 */
|
|
1764
1783
|
getCmHttpBaseUrl: () => Promise<string>;
|
|
@@ -1947,7 +1966,7 @@ interface ImProfilePort {
|
|
|
1947
1966
|
getGroupProfile: (groupId: string, opts?: {
|
|
1948
1967
|
forceRefresh?: boolean;
|
|
1949
1968
|
}) => Promise<GroupProfile | null>;
|
|
1950
|
-
/** 清空实现持有的 user/GROUP profile/member
|
|
1969
|
+
/** 清空实现持有的 user/GROUP profile/member 内存缓存,并阻止旧请求写回;无缓存的实现可省略。 */
|
|
1951
1970
|
clearCache?: () => void;
|
|
1952
1971
|
}
|
|
1953
1972
|
|
|
@@ -2082,53 +2101,49 @@ interface ImDecryptRecoveryRecord {
|
|
|
2082
2101
|
createdAt: number;
|
|
2083
2102
|
}
|
|
2084
2103
|
/**
|
|
2085
|
-
*
|
|
2104
|
+
* 持久化用户资料:领域 `UserProfile` + 写入本地存储时间戳。跨刷新持久化以消除群历史发送者「占位→回填」闪动。
|
|
2086
2105
|
* 分字段存(remark/nickname/avatar),展示名优先级在读取侧算,避免固化合并结果。
|
|
2087
2106
|
*/
|
|
2088
2107
|
interface StoredUserProfile extends UserProfile {
|
|
2089
|
-
/**
|
|
2108
|
+
/** 写入本地存储/刷新时间(毫秒),供 TTL 过期判断。 */
|
|
2090
2109
|
updatedAt: number;
|
|
2091
2110
|
}
|
|
2092
2111
|
/**
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2112
|
+
* 持久化群成员项:群内昵称 + 预留角色/加入方式。
|
|
2113
|
+
* roleId/joinType 供群成员列表展示,可缺省;头像保存在 userProfiles,避免重复存储。
|
|
2095
2114
|
*/
|
|
2096
2115
|
interface StoredGroupMember {
|
|
2097
2116
|
userId: string;
|
|
2098
2117
|
/** 群内昵称(展示名优先级第 2 级,仅次于好友备注)。 */
|
|
2099
2118
|
groupNick: string;
|
|
2100
|
-
/**
|
|
2119
|
+
/** 成员角色 roleId(1 普通 / 9 管理员 / 10 群主);响应缺少时可省略。 */
|
|
2101
2120
|
roleId?: number;
|
|
2102
|
-
/**
|
|
2121
|
+
/** 加入方式 joinType(0 退群 / 1 主动 / 2 邀请 / 3 群主);响应缺少时可省略。 */
|
|
2103
2122
|
joinType?: number;
|
|
2104
2123
|
}
|
|
2105
2124
|
/**
|
|
2106
|
-
*
|
|
2107
|
-
*
|
|
2108
|
-
* 【前瞻·P-B】结构对普通群/超级群通用;超级群海量成员按需 per-sender 填充由各会话类型策略决定,store 不感知类型。
|
|
2125
|
+
* 持久保存群成员列表,按 groupId 保存整份数据,同时记录 updateVersion 与更新时间。
|
|
2126
|
+
* 增量响应由资料适配层合并后写入;存储层不解释成员变更。
|
|
2109
2127
|
*/
|
|
2110
2128
|
interface StoredGroupMemberList {
|
|
2111
2129
|
groupId: string;
|
|
2112
2130
|
members: StoredGroupMember[];
|
|
2113
|
-
/**
|
|
2131
|
+
/** 成员列表增量版本 update_version;服务端未返回时可省略。 */
|
|
2114
2132
|
updateVersion?: number;
|
|
2115
|
-
/**
|
|
2133
|
+
/** 写入本地存储/刷新时间(毫秒),供 TTL 过期判断。 */
|
|
2116
2134
|
updatedAt: number;
|
|
2117
2135
|
}
|
|
2118
2136
|
/**
|
|
2119
|
-
*
|
|
2120
|
-
*
|
|
2121
|
-
* 故须在正常态把群主信息落盘。
|
|
2122
|
-
* 【前瞻·P-B】结构对普通群/超级群通用(群主体系 `roleId=10` 两类群共用);超级群特有字段(返佣/游客/管理员)由各会话类型
|
|
2123
|
-
* 策略在 `extensions` 扩展,store 不感知类型——新增群类型走 sibling 策略填充,不改本结构语义。
|
|
2137
|
+
* 持久保存普通群资料,包括群主 ownerId、名称、头像、成员数和更新时间。
|
|
2138
|
+
* 被踢、退群或解散后无法访问远端群资料时,产品仍可读取此前保存的群主标识。
|
|
2124
2139
|
*/
|
|
2125
2140
|
interface StoredGroupProfile extends GroupProfile {
|
|
2126
|
-
/**
|
|
2141
|
+
/** 写入本地存储/刷新时间(毫秒),供 TTL 过期判断。 */
|
|
2127
2142
|
updatedAt: number;
|
|
2128
2143
|
}
|
|
2129
2144
|
/** CHANNEL 资料的账号级持久化副本;不得包含 `secret_key`。 */
|
|
2130
2145
|
interface StoredChannelProfile extends ChannelProfile {
|
|
2131
|
-
/**
|
|
2146
|
+
/** 写入本地存储/刷新时间(毫秒),供后续资料 TTL 与诊断使用。 */
|
|
2132
2147
|
updatedAt: number;
|
|
2133
2148
|
}
|
|
2134
2149
|
/** CHANNEL 稀疏成员缓存项;按 `{channelId,userId}` 存储,不允许把整频道成员全量塞入单条记录。 */
|
|
@@ -2178,7 +2193,7 @@ type StoredConversationBackground = {
|
|
|
2178
2193
|
* 本地存储端口(DB 无关、异步、可测试)。面向消息/会话/已读/发送账本/元数据等领域实体。
|
|
2179
2194
|
*
|
|
2180
2195
|
* 生命周期:宿主(SDK)在拿到登录 userId 后先 `open({ namespace: userId })`(幂等,内部跑 schema 迁移),
|
|
2181
|
-
* 再由 domainState `hydrate()` 回读;登出/切账号时 `close()`。所有写入源自 domainState
|
|
2196
|
+
* 再由 domainState `hydrate()` 回读;登出/切账号时 `close()`。所有写入源自 domainState 统一更新入口,
|
|
2182
2197
|
* 失败经 `error` 事件(scope:'storage')暴露、不静默吞、不阻塞内存主流程。
|
|
2183
2198
|
*/
|
|
2184
2199
|
interface ImStoragePort {
|
|
@@ -2194,7 +2209,7 @@ interface ImStoragePort {
|
|
|
2194
2209
|
/** 关闭库句柄(登出/切账号)。 */
|
|
2195
2210
|
close: () => Promise<void>;
|
|
2196
2211
|
/**
|
|
2197
|
-
* 只清当前已打开账号的可重建缓存;messages/sessions/read/drafts/outbox/pinned
|
|
2212
|
+
* 只清当前已打开账号的可重建缓存;messages/sessions/read/drafts/outbox/pinned/删除标记/sync meta 等 durable 数据必须保留。
|
|
2198
2213
|
* 自定义 adapter 可省略;产品清理入口检测缺失后显式拒绝,不能伪装成功。
|
|
2199
2214
|
*/
|
|
2200
2215
|
clearRebuildableCaches?: () => Promise<void>;
|
|
@@ -2247,7 +2262,7 @@ interface ImStoragePort {
|
|
|
2247
2262
|
deleteConversationDecryptRecoveries?: (conversation: ConversationRef) => Promise<void>;
|
|
2248
2263
|
/** 全量会话(hydrate 用)。 */
|
|
2249
2264
|
getSessions: () => Promise<ImSession[]>;
|
|
2250
|
-
/**
|
|
2265
|
+
/** 批量写入本地存储会话(按 id 覆盖写)。 */
|
|
2251
2266
|
saveSessions: (sessions: readonly ImSession[]) => Promise<void>;
|
|
2252
2267
|
/** 删除单会话行(删除会话用)。 */
|
|
2253
2268
|
deleteSession: (conversation: ImStorageConversation) => Promise<void>;
|
|
@@ -2265,7 +2280,7 @@ interface ImStoragePort {
|
|
|
2265
2280
|
clearConversationHistory?: (conversation: ConversationRef, nextSession?: ImSession, nextReadState?: ReadState) => Promise<void>;
|
|
2266
2281
|
/** 全量已读态(hydrate 用)。 */
|
|
2267
2282
|
getReadStates: () => Promise<ReadState[]>;
|
|
2268
|
-
/**
|
|
2283
|
+
/** 写入本地存储单条已读态(按 conversationId 覆盖写)。 */
|
|
2269
2284
|
saveReadState: (state: ReadState) => Promise<void>;
|
|
2270
2285
|
/** 全量读取当前账号草稿,供账号 runtime hydrate。 */
|
|
2271
2286
|
getDrafts: () => Promise<ConversationDraft$1[]>;
|
|
@@ -2287,7 +2302,7 @@ interface ImStoragePort {
|
|
|
2287
2302
|
deleteDefaultConversationBackground?: () => Promise<void>;
|
|
2288
2303
|
/** 全量在途发送账本(回读用)。 */
|
|
2289
2304
|
getOutbox: () => Promise<OutboxMessage[]>;
|
|
2290
|
-
/**
|
|
2305
|
+
/** 写入本地存储/更新单条 Outbox(按 id 覆盖写)。 */
|
|
2291
2306
|
saveOutboxMessage: (message: OutboxMessage) => Promise<void>;
|
|
2292
2307
|
/** 出队删除单条 Outbox(sent 后)。 */
|
|
2293
2308
|
removeOutboxMessage: (id: string) => Promise<void>;
|
|
@@ -2299,15 +2314,15 @@ interface ImStoragePort {
|
|
|
2299
2314
|
removePinnedMessage: (conversation: ImStorageConversation) => Promise<void>;
|
|
2300
2315
|
/** 按 userId 取持久化用户资料(含 updatedAt 供 TTL 判断);无则 null。best-effort,失败降级不阻塞主流程。 */
|
|
2301
2316
|
getUserProfile: (userId: string) => Promise<StoredUserProfile | null>;
|
|
2302
|
-
/**
|
|
2317
|
+
/** 写入本地存储用户资料(按 userId 覆盖写)。 */
|
|
2303
2318
|
saveUserProfile: (profile: StoredUserProfile) => Promise<void>;
|
|
2304
2319
|
/** 按 groupId 取持久化群成员列表(含 updateVersion/updatedAt);无则 null。 */
|
|
2305
2320
|
getGroupMembers: (groupId: string) => Promise<StoredGroupMemberList | null>;
|
|
2306
|
-
/**
|
|
2321
|
+
/** 按 groupId 保存完整群成员列表;增量响应应由调用方先合并。 */
|
|
2307
2322
|
saveGroupMembers: (list: StoredGroupMemberList) => Promise<void>;
|
|
2308
2323
|
/** 按 groupId 取持久化群资料(含 ownerId/updatedAt);无则 null。供受限群本地标群主(受限群不调群资料接口)。 */
|
|
2309
2324
|
getGroupProfile: (groupId: string) => Promise<StoredGroupProfile | null>;
|
|
2310
|
-
/**
|
|
2325
|
+
/** 写入本地存储群资料(按 id 覆盖写)。 */
|
|
2311
2326
|
saveGroupProfile: (profile: StoredGroupProfile) => Promise<void>;
|
|
2312
2327
|
/** 按 channelId 读取资料;无则 null。 */
|
|
2313
2328
|
getChannelProfile: (channelId: string) => Promise<StoredChannelProfile | null>;
|
|
@@ -2865,16 +2880,16 @@ interface GroupMemberItem {
|
|
|
2865
2880
|
interface ProfileHttpAdapterDeps {
|
|
2866
2881
|
/** 宿主注入的协议客户端(如 Nuxt `$clientApi`);本适配作为调用方走 core JSON 链路拉资料。 */
|
|
2867
2882
|
client: ApiProtocolClient;
|
|
2868
|
-
/** 端类型 clientType(Web/H5=2):透传给群资料/成员接口写 `Client-type` header
|
|
2883
|
+
/** 端类型 clientType(Web/H5=2):透传给群资料/成员接口写 `Client-type` header,对齐后端全链路一致建议。缺省不带。 */
|
|
2869
2884
|
clientType?: number;
|
|
2870
2885
|
/**
|
|
2871
|
-
*
|
|
2886
|
+
* 本地持久化端口:注入后 `getUserProfile`/`getGroupMemberNames` 走三级缓存(内存→持久化→HTTP),跨刷新消除群历史发送者「占位→回填」闪动。
|
|
2872
2887
|
* 只用 profile/member 四方法;**缺省 = 纯内存**(向后兼容)。storage 未 open / 读写异常时自动**降级 HTTP-only**(不阻塞不报错,符合 storage=downstream 原则)。
|
|
2873
2888
|
* open 时序:与 SDK 共享同一 storage 实例,SDK `connect()` 统一 `open(namespace=userId)`;本适配读写前 open 未完成即降级。
|
|
2874
2889
|
*/
|
|
2875
2890
|
storage?: Pick<ImStoragePort, 'getUserProfile' | 'saveUserProfile' | 'getGroupMembers' | 'saveGroupMembers' | 'getGroupProfile' | 'saveGroupProfile'>;
|
|
2876
2891
|
}
|
|
2877
|
-
/**
|
|
2892
|
+
/** 群成员昵称接口,作为 ImProfilePort 的补充;提供群消息发送者的群内昵称,最终展示优先级由调用方决定。 */
|
|
2878
2893
|
interface GroupMemberNameProvider {
|
|
2879
2894
|
/** 取群内成员昵称映射(userId → 群内昵称,空昵称成员不含);空/失败 → null(调用方回退用户资料名)。缓存 + 同 id 去抖 + forceRefresh。 */
|
|
2880
2895
|
getGroupMemberNames: (groupId: string, opts?: {
|
|
@@ -2884,30 +2899,38 @@ interface GroupMemberNameProvider {
|
|
|
2884
2899
|
listGroupMembers: (groupId: string, opts?: {
|
|
2885
2900
|
forceRefresh?: boolean;
|
|
2886
2901
|
}) => Promise<GroupMemberItem[] | null>;
|
|
2887
|
-
/**
|
|
2902
|
+
/** 仅读取内存或本地用户资料,不发 HTTP 请求;命中返回 { value, stale },未命中返回 null,stale 表示本地记录已过期。 */
|
|
2888
2903
|
peekUserProfile: (userId: string) => Promise<{
|
|
2889
2904
|
value: UserProfile;
|
|
2890
2905
|
stale: boolean;
|
|
2891
2906
|
} | null>;
|
|
2892
|
-
/**
|
|
2907
|
+
/** 仅读取内存或本地的群成员昵称,不发 HTTP 请求;命中返回 { value, stale },未命中返回 null。 */
|
|
2893
2908
|
peekGroupMemberNames: (groupId: string) => Promise<{
|
|
2894
2909
|
value: Record<string, string>;
|
|
2895
2910
|
stale: boolean;
|
|
2896
2911
|
} | null>;
|
|
2897
|
-
/**
|
|
2912
|
+
/** 仅读取内存或本地的有序群成员列表,不发 HTTP 请求;命中返回 { value, stale },供面板先展示已有内容。 */
|
|
2898
2913
|
peekGroupMembers: (groupId: string) => Promise<{
|
|
2899
2914
|
value: GroupMemberItem[];
|
|
2900
2915
|
stale: boolean;
|
|
2901
2916
|
} | null>;
|
|
2902
|
-
/**
|
|
2917
|
+
/** 仅读取内存或本地群资料,不发 HTTP 请求;命中返回 { value, stale },供受限群展示已缓存的群主等信息。 */
|
|
2903
2918
|
peekGroupProfile: (groupId: string) => Promise<{
|
|
2904
2919
|
value: GroupProfile;
|
|
2905
2920
|
stale: boolean;
|
|
2906
2921
|
} | null>;
|
|
2907
2922
|
}
|
|
2908
|
-
/** 创建用户 / 群资料 HTTP 适配(实现 ImProfilePort +
|
|
2923
|
+
/** 创建用户 / 群资料 HTTP 适配(实现 ImProfilePort + 群成员昵称):组合 requests/ 请求、回退、缓存和字段转换。 */
|
|
2909
2924
|
declare function createProfileHttpAdapter(deps: ProfileHttpAdapterDeps): ImProfilePort & GroupMemberNameProvider;
|
|
2910
2925
|
|
|
2926
|
+
/** 客服号公开展示资料;不携带后台发送者身份或网络路由参数。 */
|
|
2927
|
+
interface CustomerServiceProfile {
|
|
2928
|
+
/** 当前语言的客服名称。 */
|
|
2929
|
+
displayName: string;
|
|
2930
|
+
/** 当前语言的头像地址;服务端未配置时为空。 */
|
|
2931
|
+
avatarUrl: string;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2911
2934
|
/** 服务端对入群请求的最终裁决:已入群,或已提交并等待管理员审核。 */
|
|
2912
2935
|
type MembershipJoinOutcome = 'joined' | 'waiting';
|
|
2913
2936
|
/** Browser adapter 暴露给 SDK 的稳定入群结果,不携带具体 HTTP 响应结构。 */
|
|
@@ -2916,7 +2939,7 @@ interface MembershipJoinResult {
|
|
|
2916
2939
|
outcome: MembershipJoinOutcome;
|
|
2917
2940
|
}
|
|
2918
2941
|
|
|
2919
|
-
/** 服务端按逻辑桶签发的 S3
|
|
2942
|
+
/** 服务端按逻辑桶签发的 S3 临时上传凭证(已转换为 SDK 合同字段)。 */
|
|
2920
2943
|
interface MediaUploadCredentials {
|
|
2921
2944
|
/** STS access key id(服务端字段 `access_key_id`)。 */
|
|
2922
2945
|
accessKeyId: string;
|
|
@@ -2932,7 +2955,7 @@ interface MediaUploadCredentials {
|
|
|
2932
2955
|
region: string;
|
|
2933
2956
|
/** 对象 key 前缀;STS 策略只允许写该前缀下的对象,SDK 生成的 key 必须以它开头。 */
|
|
2934
2957
|
keyPrefix?: string;
|
|
2935
|
-
/**
|
|
2958
|
+
/** 公开访问域名(已转换为带 scheme、无尾斜杠);写进消息体的媒体 URL 以它为准。 */
|
|
2936
2959
|
dnsPoint: string;
|
|
2937
2960
|
/** 服务端身份标识;SDK 不使用,仅原样透出供宿主排查。 */
|
|
2938
2961
|
identityId?: string;
|
|
@@ -3387,7 +3410,7 @@ interface MentionCandidatePage {
|
|
|
3387
3410
|
/**
|
|
3388
3411
|
* CHANNEL role-free @候选产品 sibling。
|
|
3389
3412
|
*
|
|
3390
|
-
* @remarks list/search 使用独立缓存与 token 上下文;token 只在创建它的账号 runtime
|
|
3413
|
+
* @remarks list/search 使用独立缓存与 token 上下文;token 只在创建它的账号 runtime、查询类型和频道缓存版本号内有效。
|
|
3391
3414
|
* 本 API 不读取 role-rich 成员 provider,也不包含已退场的 @消息索引/定位能力。
|
|
3392
3415
|
* @example
|
|
3393
3416
|
* ```ts
|
|
@@ -3401,13 +3424,13 @@ interface ImChannelMentionApi {
|
|
|
3401
3424
|
peekFirstPage: (channel: ConversationRef<'channel'>) => MentionCandidatePage | null;
|
|
3402
3425
|
/** 从已 hydrate 的常用候选快照做同步直接文本过滤;不发远端搜索请求。 */
|
|
3403
3426
|
peekSearchCandidates: (channel: ConversationRef<'channel'>, keyword: string) => readonly MentionCandidate[];
|
|
3404
|
-
/** hydrate 持久快照并返回本地首页或直接/拼音搜索结果;cache miss 返回 null
|
|
3427
|
+
/** hydrate 持久快照并返回本地首页或直接/拼音搜索结果;cache miss 返回 null,绝不请求服务端。 */
|
|
3405
3428
|
getCachedPage: (channel: ConversationRef<'channel'>, keyword?: string) => Promise<MentionCandidatePage | null>;
|
|
3406
3429
|
/** hydrate 持久快照,并在缺失/过期时按完整页预热约 200 人;同频道在途任务复用。 */
|
|
3407
3430
|
prefetchFirstPage: (channel: ConversationRef<'channel'>) => Promise<void>;
|
|
3408
3431
|
/** 强制从专用 mention provider 重建约 200 人常用候选快照。 */
|
|
3409
3432
|
refreshFirstPage: (channel: ConversationRef<'channel'>) => Promise<MentionCandidatePage>;
|
|
3410
|
-
/**
|
|
3433
|
+
/** 读取常用候选;内存未命中时先读本地存储,两处都没有才查询服务端。 */
|
|
3411
3434
|
listFirstPage: (channel: ConversationRef<'channel'>) => Promise<MentionCandidatePage>;
|
|
3412
3435
|
/** 使用 list 页产生的 token 继续分页;search token 会被拒绝。 */
|
|
3413
3436
|
listNextPage: (pageToken: ImPageToken) => Promise<MentionCandidatePage>;
|
|
@@ -3466,7 +3489,7 @@ interface ImDirectorySearchApi {
|
|
|
3466
3489
|
search: (keyword: string) => Promise<ImDirectorySearchResult>;
|
|
3467
3490
|
}
|
|
3468
3491
|
|
|
3469
|
-
/**
|
|
3492
|
+
/** 服务端消息查询失败的原因,以及是否允许重试。 */
|
|
3470
3493
|
interface MessagesByIdFailure {
|
|
3471
3494
|
/**
|
|
3472
3495
|
* 能否稍后重试。
|
|
@@ -3478,7 +3501,10 @@ interface MessagesByIdFailure {
|
|
|
3478
3501
|
/** 原始错误,供诊断与上报。 */
|
|
3479
3502
|
error: unknown;
|
|
3480
3503
|
}
|
|
3481
|
-
/**
|
|
3504
|
+
/**
|
|
3505
|
+
* 服务端消息查询汇总。三组 ID 互不重叠,合起来覆盖调用方传入的全部有效 ID。
|
|
3506
|
+
* @template TMessage 调用方需要的消息展示类型,由 projectMessage 从领域消息转换得到。
|
|
3507
|
+
*/
|
|
3482
3508
|
interface ImMessagesByIdResult<TMessage> {
|
|
3483
3509
|
/** 成功取回的消息。已经进了本地历史,后续本地查询就能命中。 */
|
|
3484
3510
|
readonly messages: readonly TMessage[];
|
|
@@ -3500,7 +3526,7 @@ interface ImMessagesByIdResult<TMessage> {
|
|
|
3500
3526
|
* SDK 内部 CHANNEL sibling:装配资料、成员、申请、置顶、历史限制与通知修复能力。
|
|
3501
3527
|
*
|
|
3502
3528
|
* 所有入口都要求精确 CHANNEL 身份,并把协议 I/O 结果提交到当前账号的同一 DomainState;不会复用
|
|
3503
|
-
* GROUP 端口或为 `supergroup` fallback。运行时 dispose 后,在途 HTTP
|
|
3529
|
+
* GROUP 端口或为 `supergroup` fallback。运行时 dispose 后,在途 HTTP 查询的结果必须失效,不能广播旧账号事件。
|
|
3504
3530
|
*/
|
|
3505
3531
|
|
|
3506
3532
|
/** CHANNEL 资料、成员和申请门面;已退场的 Mention 历史定位不进入产品面。 */
|
|
@@ -3525,7 +3551,7 @@ interface ImChannelApi extends ImDirectoryApi<'channel'> {
|
|
|
3525
3551
|
cursor?: string;
|
|
3526
3552
|
limit?: number;
|
|
3527
3553
|
}) => Promise<ChannelMemberPage>;
|
|
3528
|
-
/** 进入 CHANNEL
|
|
3554
|
+
/** 进入 CHANNEL 时预取含成员角色的有限列表;缓存未过期时不重复请求服务端。 */
|
|
3529
3555
|
prefetchMembers: (channelId: string) => Promise<void>;
|
|
3530
3556
|
/** 读取 role-rich 有界快照或本地搜索命中;不触发远端请求。 */
|
|
3531
3557
|
getCachedMembers: (input: {
|
|
@@ -3674,7 +3700,7 @@ interface ImContactApi extends ImDirectoryApi<'individual'> {
|
|
|
3674
3700
|
getProfile: (userId: string, opts?: {
|
|
3675
3701
|
forceRefresh?: boolean;
|
|
3676
3702
|
}) => Promise<UserProfile | null>;
|
|
3677
|
-
/**
|
|
3703
|
+
/** 只读内存或本地存储,不发 HTTP;命中时明确返回 stale,提醒调用方缓存可能已过期。 */
|
|
3678
3704
|
peekProfile: (userId: string) => Promise<{
|
|
3679
3705
|
value: UserProfile;
|
|
3680
3706
|
stale: boolean;
|
|
@@ -3724,7 +3750,7 @@ interface ConversationPrefetchOptions {
|
|
|
3724
3750
|
* skipped 表示当前类型、权限、存储或预算不允许预取;失败不改变正常打开会话的行为。
|
|
3725
3751
|
*/
|
|
3726
3752
|
interface ConversationPrefetchResult {
|
|
3727
|
-
ref: ConversationRef<'direct' | 'group' | 'channel' | 'robot'>;
|
|
3753
|
+
ref: ConversationRef<'direct' | 'group' | 'channel' | 'robot' | 'customerService'>;
|
|
3728
3754
|
status: 'ready' | 'skipped' | 'failed' | 'cancelled';
|
|
3729
3755
|
reason?: 'unsupported' | 'unavailable' | 'storage-unavailable' | 'budget' | 'page-too-large' | 'decrypt-failed' | 'invalidated' | 'cancelled';
|
|
3730
3756
|
error?: ImSdkErrorShape;
|
|
@@ -3732,7 +3758,7 @@ interface ConversationPrefetchResult {
|
|
|
3732
3758
|
|
|
3733
3759
|
/**
|
|
3734
3760
|
* 当前账号草稿的产品 DTO、跨组件 API 与 handle 绑定门面。
|
|
3735
|
-
*
|
|
3761
|
+
* 草稿按会话类型和 ID 串行保存,统一由 SDK DomainState 管理;当前不支持保存附件,非空附件输入会被明确拒绝。
|
|
3736
3762
|
*/
|
|
3737
3763
|
|
|
3738
3764
|
/** 当前产品草稿实体;只包含可持久化的 text/mention/reply,附件集合固定为空。 */
|
|
@@ -3795,7 +3821,7 @@ interface ImDraftsApi {
|
|
|
3795
3821
|
*/
|
|
3796
3822
|
|
|
3797
3823
|
/** 当前兼容门面支持的精确会话 ref。 */
|
|
3798
|
-
type ImSupportedConversationRef = ConversationRef<'direct' | 'group' | 'channel' | 'robot'>;
|
|
3824
|
+
type ImSupportedConversationRef = ConversationRef<'direct' | 'group' | 'channel' | 'robot' | 'customerService'>;
|
|
3799
3825
|
/**
|
|
3800
3826
|
* 会话 API 的迁移期入参。优先传完整 ref;旧 string 仅在当前 session 中唯一命中时可用。
|
|
3801
3827
|
*
|
|
@@ -3803,10 +3829,10 @@ type ImSupportedConversationRef = ConversationRef<'direct' | 'group' | 'channel'
|
|
|
3803
3829
|
*/
|
|
3804
3830
|
type ImConversationInput = ImSupportedConversationRef | string;
|
|
3805
3831
|
/**
|
|
3806
|
-
*
|
|
3832
|
+
* 内部会话列表数据。草稿反映当前账号的本机输入,不写入会话持久记录,也不跨端同步。
|
|
3807
3833
|
*
|
|
3808
|
-
*
|
|
3809
|
-
* @example
|
|
3834
|
+
* 保留 ImSession 的展示字段供内部调用方使用;跨类型识别会话时必须使用会话类型 + ID,不自行拼接主键。
|
|
3835
|
+
* @example client.conversations.list().find(item => item.draft !== null) 可找到当前账号有未发送草稿的会话。
|
|
3810
3836
|
*/
|
|
3811
3837
|
interface ConversationListItem$1 extends ImSession {
|
|
3812
3838
|
draft: ConversationDraft | null;
|
|
@@ -3833,7 +3859,7 @@ interface ImConversationsApi {
|
|
|
3833
3859
|
markConversationRead: (conversation: ImConversationInput) => Promise<void>;
|
|
3834
3860
|
/** 给已无真实未读的会话添加本地未读提醒;不回退消息已读状态,也不发网络请求。 */
|
|
3835
3861
|
markConversationUnread: (conversation: ImConversationInput) => void;
|
|
3836
|
-
/**
|
|
3862
|
+
/** 删除本机会话、消息、已读状态和草稿并立即发布本地事件;存储删除失败会报告 storage error,本地删除标记阻止离线消息恢复已删除内容。 */
|
|
3837
3863
|
deleteConversation: (conversation: ImConversationInput) => void;
|
|
3838
3864
|
}
|
|
3839
3865
|
|
|
@@ -3903,16 +3929,16 @@ interface ImCreateGroupResult {
|
|
|
3903
3929
|
}
|
|
3904
3930
|
|
|
3905
3931
|
/**
|
|
3906
|
-
* SDK
|
|
3932
|
+
* SDK 内部普通群模块:提供群资料、成员名称、@ 候选和群置顶操作。
|
|
3907
3933
|
*
|
|
3908
3934
|
* 本模块只接收 GROUP `ConversationRef`,使用普通群独立 HTTP/mapper,并回写当前账号唯一 DomainState。
|
|
3909
|
-
* CHANNEL
|
|
3935
|
+
* CHANNEL 的角色、申请、成员管理和置顶协议由独立模块处理;dispose 后旧查询和协调任务的结果不再生效。
|
|
3910
3936
|
*/
|
|
3911
3937
|
|
|
3912
3938
|
/**
|
|
3913
3939
|
* GROUP 完整 @候选集合产品面。
|
|
3914
3940
|
*
|
|
3915
|
-
* @remarks `listAll` 使用账号级产品缓存;`refreshAll`
|
|
3941
|
+
* @remarks `listAll` 使用账号级产品缓存;`refreshAll` 绕过缓存重新请求服务端。两者只消费普通群完整成员 provider,
|
|
3916
3942
|
* 不接受 CHANNEL 分页 cursor/provider。缺少 provider、远端失败或不完整结果会拒绝,不用空数组伪装失败。
|
|
3917
3943
|
* @example
|
|
3918
3944
|
* ```ts
|
|
@@ -3924,7 +3950,7 @@ interface ImCreateGroupResult {
|
|
|
3924
3950
|
interface ImGroupMentionApi {
|
|
3925
3951
|
/** 读取完整候选集合;同群并发读取复用请求,成功结果按 userId 稳定去重并缓存。 */
|
|
3926
3952
|
listAll: (group: ConversationRef<'group'>) => Promise<readonly MentionCandidate[]>;
|
|
3927
|
-
/**
|
|
3953
|
+
/** 显式向服务端重新查询完整候选;并发刷新复用请求,失败保留此前成功缓存。 */
|
|
3928
3954
|
refreshAll: (group: ConversationRef<'group'>) => Promise<readonly MentionCandidate[]>;
|
|
3929
3955
|
}
|
|
3930
3956
|
/** GROUP 资料、成员缓存、@候选与单条置顶门面;不与 CHANNEL 合并。 */
|
|
@@ -3943,17 +3969,17 @@ interface ImGroupApi extends ImDirectoryApi<'group'> {
|
|
|
3943
3969
|
getMemberNames: (groupId: string, opts?: {
|
|
3944
3970
|
forceRefresh?: boolean;
|
|
3945
3971
|
}) => Promise<Record<string, string> | null>;
|
|
3946
|
-
/**
|
|
3972
|
+
/** 仅读普通群成员缓存,不请求服务端。 */
|
|
3947
3973
|
peekMembers: (groupId: string) => Promise<{
|
|
3948
3974
|
value: GroupMemberItem[];
|
|
3949
3975
|
stale: boolean;
|
|
3950
3976
|
} | null>;
|
|
3951
|
-
/**
|
|
3977
|
+
/** 仅读普通群昵称缓存,不请求服务端。 */
|
|
3952
3978
|
peekMemberNames: (groupId: string) => Promise<{
|
|
3953
3979
|
value: Record<string, string>;
|
|
3954
3980
|
stale: boolean;
|
|
3955
3981
|
} | null>;
|
|
3956
|
-
/**
|
|
3982
|
+
/** 仅读普通群资料缓存,不请求服务端。 */
|
|
3957
3983
|
peekProfile: (groupId: string) => Promise<{
|
|
3958
3984
|
value: GroupProfile;
|
|
3959
3985
|
stale: boolean;
|
|
@@ -4002,7 +4028,7 @@ interface ImGroupApi extends ImDirectoryApi<'group'> {
|
|
|
4002
4028
|
}
|
|
4003
4029
|
|
|
4004
4030
|
/**
|
|
4005
|
-
* SDK
|
|
4031
|
+
* SDK 账号资源和网络连接的稳定生命周期合同。
|
|
4006
4032
|
* 账号准备、联网和 logout 保持可区分;快照不包含 token、transport、storage 句柄或宿主认证状态。
|
|
4007
4033
|
*/
|
|
4008
4034
|
|
|
@@ -4011,9 +4037,9 @@ interface ImClientSnapshot {
|
|
|
4011
4037
|
connectionState: ImConnectionState;
|
|
4012
4038
|
pendingOutbox: OutboxMessage[];
|
|
4013
4039
|
}
|
|
4014
|
-
/**
|
|
4040
|
+
/** 账号资源的准备和释放状态;网络连接状态单独记录,二者互不替代。 */
|
|
4015
4041
|
type ImSessionLifecycleState = 'empty' | 'preparing' | 'ready' | 'logging-out' | 'disposed';
|
|
4016
|
-
/**
|
|
4042
|
+
/** 账号资源状态、网络连接状态,以及由二者计算的便捷状态。 */
|
|
4017
4043
|
interface ImLifecycleSnapshot {
|
|
4018
4044
|
sessionState: ImSessionLifecycleState;
|
|
4019
4045
|
connectionState: ImConnectionState;
|
|
@@ -4122,7 +4148,7 @@ type ImApplicationItem = (ApplicationItemBase<'contact-request', ContactApplicat
|
|
|
4122
4148
|
* typed application inbox 产品面。
|
|
4123
4149
|
*
|
|
4124
4150
|
* @remarks `listPending` 只有在 contact/GROUP/CHANNEL 三个 provider 全部成功时才返回完整快照;审核动作按 ref.domain
|
|
4125
|
-
* 精确回到 sibling。CHANNEL invite type=5
|
|
4151
|
+
* 精确回到 sibling。CHANNEL invite type=5 不属于已确认 provider,因此不会出现在结果中。
|
|
4126
4152
|
* @example
|
|
4127
4153
|
* ```ts
|
|
4128
4154
|
* const pending = await client.applications.listPending()
|
|
@@ -4192,13 +4218,13 @@ interface ImDirectCallsApi {
|
|
|
4192
4218
|
}
|
|
4193
4219
|
|
|
4194
4220
|
/**
|
|
4195
|
-
*
|
|
4221
|
+
* 管理会话背景选择、预设读取和本地保存。
|
|
4196
4222
|
*
|
|
4197
|
-
* SDK 保存 builtin/preset/custom
|
|
4198
|
-
*
|
|
4223
|
+
* SDK 保存 builtin/preset/custom 选择及账号默认值;自定义图片 Blob 经 storage 保存,不持有 DOM、图片元素或 object URL。
|
|
4224
|
+
* 异步读取返回时核对运行环境版本,防止切会话或切账号后应用旧结果;宿主负责最终渲染和 URL 释放。
|
|
4199
4225
|
*/
|
|
4200
4226
|
|
|
4201
|
-
type ConversationBackgroundConversationType = 'direct' | 'group' | 'channel' | 'robot';
|
|
4227
|
+
type ConversationBackgroundConversationType = 'direct' | 'group' | 'channel' | 'robot' | 'customerService';
|
|
4202
4228
|
interface ConversationBackgroundPreset {
|
|
4203
4229
|
id: string;
|
|
4204
4230
|
url: string;
|
|
@@ -4237,9 +4263,9 @@ interface ImConversationBackgroundApi {
|
|
|
4237
4263
|
}
|
|
4238
4264
|
|
|
4239
4265
|
/**
|
|
4240
|
-
*
|
|
4266
|
+
* 把联系人、普通群和 CHANNEL 资料转换为稳定产品数据。
|
|
4241
4267
|
*
|
|
4242
|
-
*
|
|
4268
|
+
* 本文件只复制字段、统一权限格式和转换错误,不缓存资料,也不发 HTTP。GROUP/CHANNEL 各自保留业务字段,
|
|
4243
4269
|
* 公钥、访问快照、密钥版本、协议状态和 core extensions 都不会进入 default API。
|
|
4244
4270
|
*/
|
|
4245
4271
|
|
|
@@ -4262,14 +4288,14 @@ interface ImContactRemarkPhone {
|
|
|
4262
4288
|
countryCode: string;
|
|
4263
4289
|
mobile: string;
|
|
4264
4290
|
}
|
|
4265
|
-
/** default GROUP 资料 DTO
|
|
4291
|
+
/** default GROUP 资料 DTO;后端尚未确认的数值 status 与缓存扩展不进入产品面。 */
|
|
4266
4292
|
interface ImGroupProfile {
|
|
4267
4293
|
ref: ConversationRef<'group'>;
|
|
4268
4294
|
name: string;
|
|
4269
4295
|
avatar?: string;
|
|
4270
4296
|
memberCount?: number;
|
|
4271
4297
|
ownerId?: string;
|
|
4272
|
-
/** 普通群入群验证方式(1/2/4
|
|
4298
|
+
/** 普通群入群验证方式(1/2/4 为当前可设置值);未知值不能在产品层被自动改写。 */
|
|
4273
4299
|
verifyWay?: number;
|
|
4274
4300
|
/** 普通群邀请码;仅邀请码模式有意义。 */
|
|
4275
4301
|
inviteCode?: string;
|
|
@@ -4358,7 +4384,7 @@ interface ImChannelProfile {
|
|
|
4358
4384
|
*/
|
|
4359
4385
|
|
|
4360
4386
|
/** default 会话列表支持的精确类型;`supergroup` 继续受产品 Gate 约束。 */
|
|
4361
|
-
type ProductConversationListType = 'direct' | 'group' | 'channel' | 'robot';
|
|
4387
|
+
type ProductConversationListType = 'direct' | 'group' | 'channel' | 'robot' | 'customerService';
|
|
4362
4388
|
/** GROUP 会话限制状态;与 CHANNEL 状态保持独立 sibling。 */
|
|
4363
4389
|
type ImGroupConversationState = GroupSessionState;
|
|
4364
4390
|
/**
|
|
@@ -4529,8 +4555,8 @@ interface ImConversationListSnapshot {
|
|
|
4529
4555
|
* default 会话列表产品面。
|
|
4530
4556
|
*
|
|
4531
4557
|
* @remarks
|
|
4532
|
-
* `list()`
|
|
4533
|
-
* 所有写动作只接受复合身份。`deleteLocal`
|
|
4558
|
+
* `list()` 同步读取本机会话;`getSnapshot/subscribe` 为普通宿主提供同一时刻的列表和总未读。
|
|
4559
|
+
* 所有写动作只接受复合身份。`deleteLocal` 立即提交内存删除事件,但底层存储删除仍异步执行,失败会报告错误,
|
|
4534
4560
|
* 因此该方法不虚假返回代表“持久化已完成”的 Promise。
|
|
4535
4561
|
*
|
|
4536
4562
|
* @example
|
|
@@ -4592,6 +4618,17 @@ interface DirectConversationCapabilities {
|
|
|
4592
4618
|
canUseMessageActions: CapabilityDecision;
|
|
4593
4619
|
canManageRelationship: CapabilityDecision;
|
|
4594
4620
|
}
|
|
4621
|
+
/** 客服只读能力;资料、发送和消息修改均不可用,历史读取仅限本机已接收消息。 */
|
|
4622
|
+
interface CustomerServiceConversationCapabilities {
|
|
4623
|
+
/** 客服号不可发送消息。 */
|
|
4624
|
+
canSendMessages: CapabilityDecision;
|
|
4625
|
+
/** 客服号没有好友或成员资料页。 */
|
|
4626
|
+
canOpenProfile: CapabilityDecision;
|
|
4627
|
+
/** 客服号不开放消息修改与转发等动作。 */
|
|
4628
|
+
canUseMessageActions: CapabilityDecision;
|
|
4629
|
+
/** 允许读取客服本机历史。 */
|
|
4630
|
+
canReadHistory: CapabilityDecision;
|
|
4631
|
+
}
|
|
4595
4632
|
interface RobotConversationCapabilities {
|
|
4596
4633
|
canSendMessages: CapabilityDecision;
|
|
4597
4634
|
canOpenProfile: CapabilityDecision;
|
|
@@ -4666,6 +4703,8 @@ type ConversationCapabilitySnapshot = (ConversationCapabilityBase<'direct'> & {
|
|
|
4666
4703
|
value: ChannelConversationCapabilities;
|
|
4667
4704
|
}) | (ConversationCapabilityBase<'robot'> & {
|
|
4668
4705
|
value: RobotConversationCapabilities;
|
|
4706
|
+
}) | (ConversationCapabilityBase<'customerService'> & {
|
|
4707
|
+
value: CustomerServiceConversationCapabilities;
|
|
4669
4708
|
});
|
|
4670
4709
|
interface ImConversationCapabilitiesApi {
|
|
4671
4710
|
/** 只读取 SDK 当前本机真相与已刷新过的资料/关系投影,不隐式联网。 */
|
|
@@ -4817,7 +4856,7 @@ interface ImExpressionsApi {
|
|
|
4817
4856
|
*/
|
|
4818
4857
|
|
|
4819
4858
|
/** 当前已接线的产品 handle 会话类型;三者只在无会话语义原子层复用。 */
|
|
4820
|
-
type ProductHandleConversationType = 'direct' | 'group' | 'channel' | 'robot';
|
|
4859
|
+
type ProductHandleConversationType = 'direct' | 'group' | 'channel' | 'robot' | 'customerService';
|
|
4821
4860
|
/**
|
|
4822
4861
|
* 会话 handle 初始打开位置。
|
|
4823
4862
|
*
|
|
@@ -4879,9 +4918,9 @@ interface ConversationHandleSnapshot<TType extends ProductHandleConversationType
|
|
|
4879
4918
|
error?: ImSdkErrorShape;
|
|
4880
4919
|
}
|
|
4881
4920
|
/**
|
|
4882
|
-
*
|
|
4921
|
+
* 单条消息的本机删除结果。
|
|
4883
4922
|
*
|
|
4884
|
-
*
|
|
4923
|
+
* scope 固定为 local-only;该动作不发送撤回或双方删除命令,也不会让服务端标记删除,重新加载远端历史时可能再次出现同一消息。
|
|
4885
4924
|
*/
|
|
4886
4925
|
interface LocalMessageDeletionResult {
|
|
4887
4926
|
scope: 'local-only';
|
|
@@ -5154,8 +5193,8 @@ type ConversationMessageApiFor<TType extends ProductHandleConversationType> = TT
|
|
|
5154
5193
|
/**
|
|
5155
5194
|
* 绑定单个复合会话身份的产品级会话句柄。
|
|
5156
5195
|
*
|
|
5157
|
-
* @remarks 每次打开都持有独立连续窗口;`close()`
|
|
5158
|
-
*
|
|
5196
|
+
* @remarks 每次打开都持有独立连续窗口;`close()` 只释放瞬时窗口和订阅,不删除领域消息。各会话类型
|
|
5197
|
+
* 使用各自工厂;草稿经 drafts API 维护。关闭后继续读取或执行动作都会立即报错。
|
|
5159
5198
|
* @template TType 当前句柄绑定的精确会话类型。
|
|
5160
5199
|
* @example
|
|
5161
5200
|
* ```ts
|
|
@@ -5221,6 +5260,18 @@ interface ConversationHandle<TType extends ProductHandleConversationType = Produ
|
|
|
5221
5260
|
close: () => void;
|
|
5222
5261
|
}
|
|
5223
5262
|
|
|
5263
|
+
/** 只读客服号资料;账号由 SDK runtime 绑定,宿主只提供当前语言。 */
|
|
5264
|
+
interface ImCustomerServiceApi {
|
|
5265
|
+
/** 下载当前账号客服消息的指定文件;返回真实字节,不使用展示大小判断完成。 */
|
|
5266
|
+
downloadFile: (input: {
|
|
5267
|
+
messageId: string;
|
|
5268
|
+
itemIndex: number;
|
|
5269
|
+
signal?: AbortSignal;
|
|
5270
|
+
}) => Promise<Blob>;
|
|
5271
|
+
/** 获取并更新已有会话的显示资料;并发请求按语言合并,过期语言不覆盖当前页面。 */
|
|
5272
|
+
getProfile: (lang: number) => Promise<Readonly<CustomerServiceProfile>>;
|
|
5273
|
+
}
|
|
5274
|
+
|
|
5224
5275
|
/**
|
|
5225
5276
|
* SDK 对外的结构化诊断投影、过滤与 sink 装配。
|
|
5226
5277
|
*
|
|
@@ -5333,7 +5384,7 @@ interface ImMediaTask {
|
|
|
5333
5384
|
direction: 'upload' | 'download';
|
|
5334
5385
|
/** 终态 completed/failed/canceled 不会被同一尝试的迟到 progress 回退。 */
|
|
5335
5386
|
state: 'queued' | 'running' | 'paused' | 'completed' | 'failed' | 'canceled';
|
|
5336
|
-
/** 0
|
|
5387
|
+
/** 范围为 0 到 100 的整数进度。 */
|
|
5337
5388
|
percent: number;
|
|
5338
5389
|
/**
|
|
5339
5390
|
* upload 子阶段。
|
|
@@ -5516,7 +5567,7 @@ interface ImMediaTasksApi {
|
|
|
5516
5567
|
* 可靠发送账本的产品查询、订阅、重试和取消门面。
|
|
5517
5568
|
*
|
|
5518
5569
|
* Core Outbox 是唯一发送真相;产品项只暴露消息身份、状态和安全错误,不泄漏尝试次数或恢复策略。
|
|
5519
|
-
* 控制动作始终回到当前账号 connection,dispose
|
|
5570
|
+
* 控制动作始终回到当前账号 connection,dispose 后旧订阅失效,随后返回的旧结果不再生效,取消 queued 不等价于远端撤回。
|
|
5520
5571
|
*/
|
|
5521
5572
|
|
|
5522
5573
|
/** 产品可观察 Outbox 项;不包含正文、帧、ACK、attempts、加密信息或 resumePolicy。 */
|
|
@@ -6077,7 +6128,7 @@ interface ImMessageSearchApi {
|
|
|
6077
6128
|
inDirect: (conversation: ConversationRef<'direct'>, keyword: string) => Promise<ProductMessageSearchPage<MessageContentType>>;
|
|
6078
6129
|
/** 搜索 GROUP 本地历史;不得接受 CHANNEL ref 或回退 direct。 */
|
|
6079
6130
|
inGroup: (conversation: ConversationRef<'group'>, keyword: string) => Promise<ProductMessageSearchPage<MessageContentType>>;
|
|
6080
|
-
/** 搜索 CHANNEL
|
|
6131
|
+
/** 搜索 CHANNEL 本地历史;当前不调用尚未确认的远端 CHANNEL 搜索/定位协议。 */
|
|
6081
6132
|
inChannel: (conversation: ConversationRef<'channel'>, keyword: string) => Promise<ProductMessageSearchPage<MessageContentType>>;
|
|
6082
6133
|
/** 搜索 robot 本地历史;无远端历史,不得回退 direct。 */
|
|
6083
6134
|
inRobot: (conversation: ConversationRef<'robot'>, keyword: string) => Promise<ProductMessageSearchPage<MessageContentType>>;
|
|
@@ -6186,7 +6237,7 @@ interface ImSettingsApi {
|
|
|
6186
6237
|
*
|
|
6187
6238
|
* 上传凭证由业务后端按登录态签发(与 iOS、prod H5 同一个接口),回包同时给出**物理桶**、区域、`key_prefix` 和
|
|
6188
6239
|
* 公开访问域名;SDK 据此拼 object key 与消息体 URL,宿主 env 里配的只是申请凭证用的逻辑桶名。凭证缓存(本地
|
|
6189
|
-
* 1 小时、按服务端过期时间提前 5
|
|
6240
|
+
* 1 小时、按服务端过期时间提前 5 分钟失效)、同桶并发请求复用和失败后重新签发由 SDK 负责,宿主只需提供「打一次接口」的纯函数。
|
|
6190
6241
|
*
|
|
6191
6242
|
* 默认单次 PUT/GET;仅 multipartTransfer=true 才允许大资源分片上传、下载。
|
|
6192
6243
|
* 各 bucket 需在对象存储侧配置 CORS 允许本站 origin 的 PUT + GET;开启分片后,超过 16MiB 的上传另需放行
|
|
@@ -6265,6 +6316,7 @@ interface ImAccountAdapterContext extends ImClientAdapterContext {
|
|
|
6265
6316
|
* @remarks create/purge 必须消费传入的 namespace factory;SDK 会先 close 返回的 storage,再调用 purge。
|
|
6266
6317
|
*/
|
|
6267
6318
|
interface ImStorageAdapterFactory {
|
|
6319
|
+
/** 创建或复用当前运行环境的存储;返回 undefined 明确使用纯内存,即使浏览器支持 IndexedDB 也不启用默认库。 */
|
|
6268
6320
|
create: (context: ImClientAdapterContext) => ImStoragePort | undefined;
|
|
6269
6321
|
purgeCurrentAccount: (context: ImAccountAdapterContext) => Promise<void>;
|
|
6270
6322
|
}
|
|
@@ -6355,7 +6407,7 @@ interface ImAdvancedClientOptions extends ImClientOptions {
|
|
|
6355
6407
|
channelMembers?: ImChannelMemberPort;
|
|
6356
6408
|
/** CHANNEL Mention 候选 provider;不复用 role-rich 成员治理列表。 */
|
|
6357
6409
|
channelMentionMembers?: ImChannelMentionMemberPort;
|
|
6358
|
-
/** CHANNEL 申请审核 provider
|
|
6410
|
+
/** CHANNEL 申请审核 provider;当前只装配已确认的 18A 审核能力。 */
|
|
6359
6411
|
channelJoinApplications?: ImChannelJoinApplicationPort;
|
|
6360
6412
|
/** 联系人申请 provider;与 GROUP/CHANNEL 审核 sibling 独立。 */
|
|
6361
6413
|
contactApplications?: ImContactApplicationPort;
|
|
@@ -6412,7 +6464,7 @@ interface ImContactsApi extends ImDirectoryApi<'individual'> {
|
|
|
6412
6464
|
* 发送好友申请。
|
|
6413
6465
|
*
|
|
6414
6466
|
* @remarks `remark` 是当前账号对目标用户设置的私有备注,按后端申请合同作为
|
|
6415
|
-
* `remark_nick_name` 提交。SDK
|
|
6467
|
+
* `remark_nick_name` 提交。SDK 不另存待处理副本;关系建立后从当前账号的权威好友资料读取并展示。
|
|
6416
6468
|
*/
|
|
6417
6469
|
requestFriendship: (userId: string, options: {
|
|
6418
6470
|
message: string;
|
|
@@ -6636,7 +6688,7 @@ interface AdvancedConversationsApi extends ImConversationsApi, ImConversationBac
|
|
|
6636
6688
|
*
|
|
6637
6689
|
* @internal
|
|
6638
6690
|
*/
|
|
6639
|
-
ensureOpenableConversation: (ref: ConversationRef) => Promise<ConversationRef<'direct' | 'group' | 'channel' | 'robot'>>;
|
|
6691
|
+
ensureOpenableConversation: (ref: ConversationRef) => Promise<ConversationRef<'direct' | 'group' | 'channel' | 'robot' | 'customerService'>>;
|
|
6640
6692
|
/**
|
|
6641
6693
|
* 读取已有会话或本次账号内已校验的目标资料;返回值不代表列表成员资格。
|
|
6642
6694
|
* @internal
|
|
@@ -6666,6 +6718,8 @@ interface ImProductClient {
|
|
|
6666
6718
|
/** 当前账号完整联系人、群组和社群目录的统一搜索。 */
|
|
6667
6719
|
readonly directory: ImDirectorySearchApi;
|
|
6668
6720
|
/** 机器人公开目录;通讯录查找与群/社群绑定列表共用分页合同。 */
|
|
6721
|
+
/** 客服号只读资料能力。 */
|
|
6722
|
+
readonly customerService: ImCustomerServiceApi;
|
|
6669
6723
|
readonly robots: ImRobotsApi;
|
|
6670
6724
|
readonly contacts: ImContactsApi;
|
|
6671
6725
|
readonly groups: ImGroupsApi;
|
|
@@ -6717,6 +6771,7 @@ interface ImClient extends Omit<ImProductClient, 'capabilities' | 'channels' | '
|
|
|
6717
6771
|
(ref: ConversationRef<'group'>, options?: ConversationOpenOptions): Promise<ConversationHandle<'group'>>;
|
|
6718
6772
|
(ref: ConversationRef<'channel'>, options?: ConversationOpenOptions): Promise<ConversationHandle<'channel'>>;
|
|
6719
6773
|
(ref: ConversationRef<'robot'>, options?: ConversationOpenOptions): Promise<ConversationHandle<'robot'>>;
|
|
6774
|
+
(ref: ConversationRef<'customerService'>, options?: ConversationOpenOptions): Promise<ConversationHandle<'customerService'>>;
|
|
6720
6775
|
};
|
|
6721
6776
|
/** 当前账号草稿产品面;按复合身份持久化,handle.draft 委托同一状态源。 */
|
|
6722
6777
|
drafts: ImDraftsApi;
|
|
@@ -6734,7 +6789,7 @@ interface ImClient extends Omit<ImProductClient, 'capabilities' | 'channels' | '
|
|
|
6734
6789
|
contact: ImContactApi;
|
|
6735
6790
|
/** 群域:群资料读取 + 修改群名/群头像/群内昵称。 */
|
|
6736
6791
|
group: ImGroupApi;
|
|
6737
|
-
/** CHANNEL
|
|
6792
|
+
/** CHANNEL 域:资料、成员管理与独立置顶能力;尚未确认的动作不进入此门面。 */
|
|
6738
6793
|
channel: ImChannelApi;
|
|
6739
6794
|
/** 可观察媒体任务与按精确消息引用下载。 */
|
|
6740
6795
|
media: ImMediaTasksApi;
|
|
@@ -6864,9 +6919,9 @@ declare function useImApplicationsStore(pinia?: Pinia): ImApplicationsStore;
|
|
|
6864
6919
|
*/
|
|
6865
6920
|
|
|
6866
6921
|
/**
|
|
6867
|
-
*
|
|
6868
|
-
*
|
|
6869
|
-
*
|
|
6922
|
+
* 命令和生命周期操作提示的文案 key,供 formatServiceText 使用。
|
|
6923
|
+
* kit service/runtime 返回语义码与参数,由宿主根据语言生成文案。
|
|
6924
|
+
* 动态 error.message 作为 {reason} 参数,不纳入 catalog 翻译。
|
|
6870
6925
|
*/
|
|
6871
6926
|
type ImServiceTextKey = 'common.notConnected' | 'common.selectOrOpenConversation' | 'common.conversationTypeNotReady' | 'common.conversationNotReady' | `recall.${RecallFailReason}` | `edit.${EditFailReason}` | 'localDelete.done' | 'localDelete.notFound' | 'localDelete.inFlight' | 'localDelete.failed' | 'channelDelete.notFound' | 'channelDelete.unsupported' | 'channelDelete.notSent' | 'channelDelete.unavailable' | 'channelDelete.forbidden' | 'channelDelete.timeout' | 'channelDelete.failed' | 'channelDelete.disconnected' | 'directBlock.contactRequired' | 'groupBlock.left' | 'groupBlock.removed' | 'groupBlock.dismissed' | 'groupBlock.unknownRestricted' | 'channelBlock.guest' | 'channelBlock.left' | 'channelBlock.removed' | 'channelBlock.dismissed' | 'channelBlock.muted' | 'channelBlock.allMembersMuted' | 'channelBlock.currentUserMuted' | 'channelBlock.blacklisted' | 'channelBlock.unknownRestricted' | 'channelProfile.loadFailed' | 'channelProfile.notFound' | 'channelProfile.retryAction' | 'channelMembers.title' | 'channelMembers.searchPlaceholder' | 'channelMembers.loading' | 'channelMembers.loadFailed' | 'channelMembers.retryAction' | 'channelMembers.empty' | 'channelMembers.loadingMore' | 'channelMembers.loadMoreFailed' | 'channelMembers.exhausted' | 'channelMembers.loadMoreAction' | 'label.image' | 'label.video' | 'label.file' | 'label.sticker' | 'send.failed' | 'send.retryFailed' | 'send.cancelFailed' | 'send.mediaFailed' | 'send.mediaEmpty' | 'send.mediaCancelled' | 'send.mediaCountLimit' | 'send.mediaTooLarge' | 'send.mediaFormatMismatch' | 'send.imageFormatUnsupported' | 'send.videoTooLong' | 'send.videoDurationUnavailable' | 'send.voiceEmpty' | 'send.voiceStorageNotConfigured' | 'send.voiceCancelled' | 'send.voiceFailed' | 'media.uploadWaiting' | 'media.voiceNotReady' | 'media.voiceLoadEmpty' | 'media.voiceLoadFailed' | 'media.videoOpenEmpty' | 'media.videoLoadFailed' | 'media.imageInvalid' | 'media.imageLoadFailed' | 'media.fileDownloadEmpty' | 'media.fileDownloadFailed' | 'conversation.muteEnableFailed' | 'conversation.muteDisableFailed' | 'conversation.backgroundLoadFailed' | 'read.markReadFailed' | 'storage.failed' | 'sync.failed' | 'draft.saveFailed' | 'history.returnLatestFailed' | 'pinned.forbidden' | 'pinned.network' | 'pinned.contract' | 'pinned.unsupported' | 'pinned.failed' | 'pinned.previewUnavailable' | 'pinned.locateFailed' | 'pinned.messageNotFound' | 'pinned.recalled' | 'pinned.deleted' | 'pinned.protected' | 'pinned.pinAction' | 'pinned.unpinAction' | 'pinned.unpinConfirm' | 'pinned.cancelAction' | 'lifecycle.missingLoginState' | 'lifecycle.prepareFailed' | 'lifecycle.missingConnectParams' | 'lifecycle.connectFailed' | 'lifecycle.disposed' | 'lifecycle.connectionOccupied' | 'lifecycle.connectionCoordinationUnavailable' | 'forward.emptyInput' | 'forward.allSkipped' | 'forward.partialSkipped' | 'forward.done' | 'forward.failed';
|
|
6872
6927
|
|
|
@@ -7442,7 +7497,7 @@ interface ImExpressionRecentPersistencePort {
|
|
|
7442
7497
|
* - `createImChatKitContext`:把宿主准备好的 Runtime 包成不可修改的安装对象。
|
|
7443
7498
|
* - `installImChatKit`:绑定到指定 Pinia;已绑定另一个 Runtime 时明确报错。
|
|
7444
7499
|
* - `getImChatKitContext`:供 Store 取得已安装 Runtime;没有安装或已经释放时明确报错。
|
|
7445
|
-
* - `registerImChatKitStoreDisposer`:登记 Store
|
|
7500
|
+
* - `registerImChatKitStoreDisposer`:登记 Store 的退订、清定时器和使旧异步结果失效的函数。
|
|
7446
7501
|
* - `disposeImChatKit`:先释放全部 Store,再永久销毁 Runtime;之后同一 Pinia 可重新安装新 Runtime。
|
|
7447
7502
|
*
|
|
7448
7503
|
* 【资源所有权与隔离】
|
|
@@ -7699,7 +7754,7 @@ interface EmojiRecentItem {
|
|
|
7699
7754
|
* 不可变 DTO、加载状态和编辑选择;SDK 继续拥有请求合同、账号资源和消息发送真相。
|
|
7700
7755
|
*
|
|
7701
7756
|
* 【并发与账号隔离】
|
|
7702
|
-
*
|
|
7757
|
+
* 每类列表都有独立请求序号,并同时校验 Product Client、Runtime generation 和 Store 生命周期。
|
|
7703
7758
|
* 搜索词、Tab、账号或 reset 改变后,旧请求不能覆盖新页面,也不能关闭新请求的 loading。
|
|
7704
7759
|
*
|
|
7705
7760
|
* 【发送与最近使用】
|
|
@@ -7718,7 +7773,7 @@ type ProductConversationHandle$1 = ConversationHandle<ProductHandleConversationT
|
|
|
7718
7773
|
type ImExpressionGiphyMode = 'idle' | 'trending' | 'search';
|
|
7719
7774
|
/** Store 对宿主公开的安全错误;底层 cause/details 不进入响应式状态或持久化。 */
|
|
7720
7775
|
type ImExpressionStoreError = Readonly<Pick<ImSdkErrorShape, 'code' | 'category' | 'operation' | 'retryable'>>;
|
|
7721
|
-
/**
|
|
7776
|
+
/** 单类列表供页面使用的完整状态,包括 loading、空态、错误和重试。 */
|
|
7722
7777
|
interface ImExpressionLoadStatus {
|
|
7723
7778
|
readonly loading: boolean;
|
|
7724
7779
|
readonly loaded: boolean;
|
|
@@ -7772,7 +7827,7 @@ interface ImExpressionStoreState {
|
|
|
7772
7827
|
giphyItems: readonly ImGiphyAsset[];
|
|
7773
7828
|
giphyTotalCount: number;
|
|
7774
7829
|
}
|
|
7775
|
-
/** Expression Store
|
|
7830
|
+
/** Expression Store 的只读派生状态;各类列表可独立驱动 loading、empty、error 与重试 UI。 */
|
|
7776
7831
|
interface ImExpressionStoreGetters {
|
|
7777
7832
|
packStatus: () => ImExpressionLoadStatus;
|
|
7778
7833
|
packItemStatus: () => Record<string, ImExpressionLoadStatus>;
|
|
@@ -8259,7 +8314,7 @@ type ResultFor$1<TResult, TOperation extends ImChannelMemberManagementOperation>
|
|
|
8259
8314
|
type ImChannelMemberManagementResultFor<TOperation extends ImChannelMemberManagementOperation> = ResultFor$1<ImChannelMemberManagementResult, TOperation>;
|
|
8260
8315
|
|
|
8261
8316
|
/**
|
|
8262
|
-
* 执行 CHANNEL 资料写入,并把 default SDK
|
|
8317
|
+
* 执行 CHANNEL 资料写入,并把 default SDK 结果转换为跨宿主稳定合同。
|
|
8263
8318
|
*
|
|
8264
8319
|
* 本服务只消费 `client.channels` 和 CHANNEL capability;文件、路由、Dialog、Toast 与 object URL
|
|
8265
8320
|
* 不进入共享层。成员昵称额外校验目标角色,避免管理员修改 owner/admin 等越权目标。
|
|
@@ -8328,10 +8383,10 @@ type ChannelProfileResultFor<TResult, TOperation extends ImChannelProfileOperati
|
|
|
8328
8383
|
type ImChannelProfileActionResultFor<TOperation extends ImChannelProfileOperation> = ChannelProfileResultFor<ImChannelProfileActionResult, TOperation>;
|
|
8329
8384
|
|
|
8330
8385
|
/**
|
|
8331
|
-
* 执行 Direct 联系人资料与关系操作,并把 SDK
|
|
8386
|
+
* 执行 Direct 联系人资料与关系操作,并把 SDK 结果转换为跨宿主稳定合同。
|
|
8332
8387
|
*
|
|
8333
8388
|
* SDK 继续拥有远端关系真相,以及拉黑/删除好友成功后的精确 direct 会话清理。本服务只调用 default
|
|
8334
|
-
* `client.contacts
|
|
8389
|
+
* `client.contacts`,捕获账号版本号,过滤底层错误,并返回可由共享 Store 决定局部投影的结果;不接触
|
|
8335
8390
|
* Pinia、路由、Dialog、Toast 或页面节点。
|
|
8336
8391
|
*/
|
|
8337
8392
|
|
|
@@ -8409,7 +8464,7 @@ type DirectContactResultFor<TResult, TOperation extends ImDirectContactOperation
|
|
|
8409
8464
|
type ImDirectContactActionResultFor<TOperation extends ImDirectContactOperation> = DirectContactResultFor<ImDirectContactActionResult, TOperation>;
|
|
8410
8465
|
|
|
8411
8466
|
/**
|
|
8412
|
-
*
|
|
8467
|
+
* 编排普通群成员邀请、移除、群主转让和退出,并转换为跨宿主稳定结果。
|
|
8413
8468
|
*
|
|
8414
8469
|
* 服务只消费 default `client.groups` 和 GROUP capability;成员投影、资料校准、Toast、
|
|
8415
8470
|
* Dialog 与路由退场分别由共享 Store 和宿主负责。底层 cause/details 不会进入返回结果。
|
|
@@ -8461,7 +8516,7 @@ type ResultFor<TResult, TOperation extends ImGroupMemberManagementOperation> = T
|
|
|
8461
8516
|
type ImGroupMemberManagementResultFor<TOperation extends ImGroupMemberManagementOperation> = ResultFor<ImGroupMemberManagementResult, TOperation>;
|
|
8462
8517
|
|
|
8463
8518
|
/**
|
|
8464
|
-
* 执行普通群资料写入,并把 default SDK
|
|
8519
|
+
* 执行普通群资料写入,并把 default SDK 结果转换为跨宿主稳定合同。
|
|
8465
8520
|
*
|
|
8466
8521
|
* 本服务只接触 `client.groups` 和 GROUP capability 快照。文件/Blob 只作为调用参数直达 SDK,
|
|
8467
8522
|
* 不进入 Pinia 状态;路由、表单、文件预览、Dialog 和 Toast 继续由宿主负责。
|
|
@@ -9125,10 +9180,10 @@ declare function useImProfileDirectoryStore(pinia?: Pinia): ImProfileDirectorySt
|
|
|
9125
9180
|
* 2. 调 SDK `resolveMessage` 查本机历史;
|
|
9126
9181
|
* 3. 本机缺失或单聊原文解密失败时,批量交给 SDK 补取;已有失败占位每个活动句柄只自动尝试一次。
|
|
9127
9182
|
*
|
|
9128
|
-
*
|
|
9183
|
+
* 第三步是批量的:一屏引用可能几十条,逐条打接口会给服务端制造无谓压力。向服务端查询不会改会话摘要、
|
|
9129
9184
|
* 不产生未读、不推进已读游标,所以为了渲染而调用是安全的。
|
|
9130
9185
|
*
|
|
9131
|
-
* 本 Store 只保存解析状态缓存,不保存消息领域真相——消息本身由 SDK 唯一 DomainState
|
|
9186
|
+
* 本 Store 只保存解析状态缓存,不保存消息领域真相——消息本身由 SDK 唯一 DomainState 持有,服务端查询
|
|
9132
9187
|
* 取回的消息也已经回填进本机历史。切会话、切账号或原消息发生变化时缓存会失效重读。
|
|
9133
9188
|
*/
|
|
9134
9189
|
|
|
@@ -9178,7 +9233,7 @@ interface ImQuotedMessageStoreActions {
|
|
|
9178
9233
|
* 声明当前这一屏需要哪些被引原消息,并按需解析尚未解析的部分。
|
|
9179
9234
|
*
|
|
9180
9235
|
* 幂等且可以高频调用:已有结论的(解析成功、确认缺失、解析失败)都不会重复查询,窗口内已有的
|
|
9181
|
-
*
|
|
9236
|
+
* 消息也不占用服务端查询额度。同一活动线程只允许一批解析在跑,连续翻页产生的多次调用会自动合并,
|
|
9182
9237
|
* 所以在消息列表变化时无脑调一次就行,不需要宿主自己做防抖。
|
|
9183
9238
|
*
|
|
9184
9239
|
* 传入顺序就是解析顺序。默认按窗口顺序传即可;如果宿主能判断用户正在看哪一段,把那段的 id 放
|
|
@@ -9267,7 +9322,7 @@ declare function useImReactionStore(pinia?: Pinia): ImReactionStore;
|
|
|
9267
9322
|
* - `loadAround`:为搜索定位加载目标消息附近窗口。
|
|
9268
9323
|
* - `resolveMessage`:解析当前窗口之外但属于同一会话的本地消息。
|
|
9269
9324
|
* - `retainHandle`:让已经开始的发送或上传在用户切会话后仍能安全完成,再关闭旧句柄。
|
|
9270
|
-
* - `reset` / `dispose
|
|
9325
|
+
* - `reset` / `dispose`:切账号或销毁时停止订阅、丢弃旧分页结果并关闭全部会话句柄。
|
|
9271
9326
|
*
|
|
9272
9327
|
* 【并发与资源所有权】
|
|
9273
9328
|
* 同一 Store 同时只有一个活动会话句柄。异步结果必须同时匹配最新操作序号、当前账号版本号、当前句柄
|
|
@@ -9596,7 +9651,7 @@ declare function useImSessionStore(pinia?: Pinia): InternalImSessionStore;
|
|
|
9596
9651
|
*
|
|
9597
9652
|
* Thread Store 仍是消息、会话句柄和历史窗口的唯一真相;本 Store 只保存页面需要的
|
|
9598
9653
|
* loading/error 投影和同一分页边界的失败熔断,避免 PC/H5 各自实现一套容易漂移的时序。
|
|
9599
|
-
* 请求结算前会重新核对会话复合身份、账号 generation
|
|
9654
|
+
* 请求结算前会重新核对会话复合身份、账号 generation 和消息边界,旧会话的延迟返回结果只能被丢弃。
|
|
9600
9655
|
*/
|
|
9601
9656
|
|
|
9602
9657
|
type ProductConversationRef$1 = ConversationRef<ProductHandleConversationType>;
|