zcw-shared 2.23.3 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/api.d.ts +4 -0
- package/dist/constants/api.js +5 -0
- package/dist/constants/api.js.map +1 -0
- package/dist/functions/ai/applyLlmExtraBody.d.ts +3 -0
- package/dist/functions/ai/applyLlmExtraBody.js +34 -0
- package/dist/functions/ai/applyLlmExtraBody.js.map +1 -0
- package/dist/functions/ai/buildOpenAiChatCompletionsRequestBody.d.ts +9 -0
- package/dist/functions/ai/buildOpenAiChatCompletionsRequestBody.js +32 -0
- package/dist/functions/ai/buildOpenAiChatCompletionsRequestBody.js.map +1 -0
- package/dist/functions/ai/buildResolvedLlmToolsList.d.ts +14 -0
- package/dist/functions/ai/buildResolvedLlmToolsList.js +29 -0
- package/dist/functions/ai/buildResolvedLlmToolsList.js.map +1 -0
- package/dist/functions/ai/catalogLinkMode.d.ts +3 -0
- package/dist/functions/ai/catalogLinkMode.js +9 -0
- package/dist/functions/ai/catalogLinkMode.js.map +1 -0
- package/dist/functions/ai/createSyntheticAgentEmail.d.ts +4 -0
- package/dist/functions/ai/createSyntheticAgentEmail.js +4 -0
- package/dist/functions/ai/createSyntheticAgentEmail.js.map +1 -0
- package/dist/functions/ai/isValidMcpToolWirePayload.d.ts +2 -0
- package/dist/functions/ai/isValidMcpToolWirePayload.js +16 -0
- package/dist/functions/ai/isValidMcpToolWirePayload.js.map +1 -0
- package/dist/functions/ai/mcpUpstreamAuthHeaders.d.ts +4 -0
- package/dist/functions/ai/mcpUpstreamAuthHeaders.js +28 -0
- package/dist/functions/ai/mcpUpstreamAuthHeaders.js.map +1 -0
- package/dist/functions/ai/normalizeAiAgentReplyFormat.d.ts +3 -0
- package/dist/functions/ai/normalizeAiAgentReplyFormat.js +13 -0
- package/dist/functions/ai/normalizeAiAgentReplyFormat.js.map +1 -0
- package/dist/functions/ai/normalizeAiAttachmentPayloadFormat.d.ts +2 -0
- package/dist/functions/ai/normalizeAiAttachmentPayloadFormat.js +11 -0
- package/dist/functions/ai/normalizeAiAttachmentPayloadFormat.js.map +1 -0
- package/dist/functions/ai/normalizeMcpToolsWireFormat.d.ts +4 -0
- package/dist/functions/ai/normalizeMcpToolsWireFormat.js +13 -0
- package/dist/functions/ai/normalizeMcpToolsWireFormat.js.map +1 -0
- package/dist/functions/ai/normalizeToolProcessEnv.d.ts +4 -0
- package/dist/functions/ai/normalizeToolProcessEnv.js +25 -0
- package/dist/functions/ai/normalizeToolProcessEnv.js.map +1 -0
- package/dist/functions/ai/pickToolChoiceFromAgentToolsConfig.d.ts +1 -0
- package/dist/functions/ai/pickToolChoiceFromAgentToolsConfig.js +12 -0
- package/dist/functions/ai/pickToolChoiceFromAgentToolsConfig.js.map +1 -0
- package/dist/functions/ai/toolCatalogInlineEnv.d.ts +10 -0
- package/dist/functions/ai/toolCatalogInlineEnv.js +37 -0
- package/dist/functions/ai/toolCatalogInlineEnv.js.map +1 -0
- package/dist/functions/android/integrateFacebookLogin.js +1 -1
- package/dist/functions/android/integrateGoogleLogin.js +1 -1
- package/dist/functions/android/integrateMiuiLogin.js +1 -1
- package/dist/functions/android/integrateQQLogin.js +1 -1
- package/dist/functions/android/integrateShareTrace.js +1 -1
- package/dist/functions/android/integrateSinaLogin.js +1 -1
- package/dist/functions/android/integrateThirdPartyModule.js +1 -1
- package/dist/functions/android/integrateUniAppNativePlugin.js +1 -1
- package/dist/functions/android/integrateUniPushAndroid.js +1 -1
- package/dist/functions/android/integrateUniverifyLogin.js +1 -1
- package/dist/functions/android/integrateWechatLogin.js +1 -1
- package/dist/functions/android/integrateWechatShare.js +1 -1
- package/dist/functions/android/permission.js +1 -1
- package/dist/functions/api/apiErrorMessageFrom.d.ts +1 -0
- package/dist/functions/api/apiErrorMessageFrom.js +8 -0
- package/dist/functions/api/apiErrorMessageFrom.js.map +1 -0
- package/dist/functions/api/buildApiUrl.d.ts +2 -0
- package/dist/functions/api/buildApiUrl.js +11 -0
- package/dist/functions/api/buildApiUrl.js.map +1 -0
- package/dist/functions/api/createApiClient.d.ts +25 -0
- package/dist/functions/api/createApiClient.js +100 -0
- package/dist/functions/api/createApiClient.js.map +1 -0
- package/dist/functions/api/createApiErrorHandler.d.ts +18 -0
- package/dist/functions/api/createApiErrorHandler.js +39 -0
- package/dist/functions/api/createApiErrorHandler.js.map +1 -0
- package/dist/functions/api/createDefaultApiErrorHandler.d.ts +2 -0
- package/dist/functions/api/createDefaultApiErrorHandler.js +9 -0
- package/dist/functions/api/createDefaultApiErrorHandler.js.map +1 -0
- package/dist/functions/api/createFormDataApiUpload.d.ts +26 -0
- package/dist/functions/api/createFormDataApiUpload.js +107 -0
- package/dist/functions/api/createFormDataApiUpload.js.map +1 -0
- package/dist/functions/api/createInFlightFetchCoalescer.d.ts +4 -0
- package/dist/functions/api/createInFlightFetchCoalescer.js +22 -0
- package/dist/functions/api/createInFlightFetchCoalescer.js.map +1 -0
- package/dist/functions/api/createPublicAuthRequest.d.ts +14 -0
- package/dist/functions/api/createPublicAuthRequest.js +26 -0
- package/dist/functions/api/createPublicAuthRequest.js.map +1 -0
- package/dist/functions/api/createSpaBuildApiUrl.d.ts +2 -0
- package/dist/functions/api/createSpaBuildApiUrl.js +15 -0
- package/dist/functions/api/createSpaBuildApiUrl.js.map +1 -0
- package/dist/functions/api/estimateFormDataMultipartBodyBytes.d.ts +6 -0
- package/dist/functions/api/estimateFormDataMultipartBodyBytes.js +20 -0
- package/dist/functions/api/estimateFormDataMultipartBodyBytes.js.map +1 -0
- package/dist/functions/api/getUseMockFromSearch.d.ts +6 -0
- package/dist/functions/api/getUseMockFromSearch.js +9 -0
- package/dist/functions/api/getUseMockFromSearch.js.map +1 -0
- package/dist/functions/api/putSignedUploadWithProgress.d.ts +16 -0
- package/dist/functions/api/putSignedUploadWithProgress.js +41 -0
- package/dist/functions/api/putSignedUploadWithProgress.js.map +1 -0
- package/dist/functions/api/putXhrUploadWithProgress.d.ts +15 -0
- package/dist/functions/api/putXhrUploadWithProgress.js +28 -0
- package/dist/functions/api/putXhrUploadWithProgress.js.map +1 -0
- package/dist/functions/api/responseFromXhr.d.ts +12 -0
- package/dist/functions/api/responseFromXhr.js +9 -0
- package/dist/functions/api/responseFromXhr.js.map +1 -0
- package/dist/functions/api/unwrapApiJsonBody.d.ts +3 -0
- package/dist/functions/api/unwrapApiJsonBody.js +7 -0
- package/dist/functions/api/unwrapApiJsonBody.js.map +1 -0
- package/dist/functions/async/cachedAsync.js +1 -1
- package/dist/functions/auth/createAuthRecovery.d.ts +13 -0
- package/dist/functions/auth/createAuthRecovery.js +49 -0
- package/dist/functions/auth/createAuthRecovery.js.map +1 -0
- package/dist/functions/auth/createAuthStorageEnvironment.d.ts +17 -0
- package/dist/functions/auth/createAuthStorageEnvironment.js +29 -0
- package/dist/functions/auth/createAuthStorageEnvironment.js.map +1 -0
- package/dist/functions/auth/createAuthTokenStorage.d.ts +33 -0
- package/dist/functions/auth/createAuthTokenStorage.js +112 -0
- package/dist/functions/auth/createAuthTokenStorage.js.map +1 -0
- package/dist/functions/auth/createLoginRedirectAuthRecovery.d.ts +6 -0
- package/dist/functions/auth/createLoginRedirectAuthRecovery.js +14 -0
- package/dist/functions/auth/createLoginRedirectAuthRecovery.js.map +1 -0
- package/dist/functions/auth/createTokenManagerAuthStorageAdapter.d.ts +3 -0
- package/dist/functions/auth/createTokenManagerAuthStorageAdapter.js +59 -0
- package/dist/functions/auth/createTokenManagerAuthStorageAdapter.js.map +1 -0
- package/dist/functions/auth/createTokenManagerRuntime.d.ts +22 -0
- package/dist/functions/auth/createTokenManagerRuntime.js +61 -0
- package/dist/functions/auth/createTokenManagerRuntime.js.map +1 -0
- package/dist/functions/auth/createTokenRefreshGate.d.ts +4 -0
- package/dist/functions/auth/createTokenRefreshGate.js +13 -0
- package/dist/functions/auth/createTokenRefreshGate.js.map +1 -0
- package/dist/functions/auth/permissionSatisfies.js +1 -1
- package/dist/functions/auth/permissionSatisfies.js.map +1 -1
- package/dist/functions/browser/detectAppSafeAreaProfile.d.ts +16 -0
- package/dist/functions/browser/detectAppSafeAreaProfile.js +22 -0
- package/dist/functions/browser/detectAppSafeAreaProfile.js.map +1 -0
- package/dist/functions/browser/shortcutModKeyHint.js +1 -1
- package/dist/functions/cloudDisk/cloudDiskFileCategories.d.ts +6 -0
- package/dist/functions/cloudDisk/cloudDiskFileCategories.js +8 -0
- package/dist/functions/cloudDisk/cloudDiskFileCategories.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskFilePreviewUi.d.ts +4 -0
- package/dist/functions/cloudDisk/cloudDiskFilePreviewUi.js +23 -0
- package/dist/functions/cloudDisk/cloudDiskFilePreviewUi.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskIconConstants.d.ts +6 -0
- package/dist/functions/cloudDisk/cloudDiskIconConstants.js +7 -0
- package/dist/functions/cloudDisk/cloudDiskIconConstants.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskListContextMenuSpecs.d.ts +6 -0
- package/dist/functions/cloudDisk/cloudDiskListContextMenuSpecs.js +54 -0
- package/dist/functions/cloudDisk/cloudDiskListContextMenuSpecs.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskNodeDragPayload.d.ts +5 -0
- package/dist/functions/cloudDisk/cloudDiskNodeDragPayload.js +20 -0
- package/dist/functions/cloudDisk/cloudDiskNodeDragPayload.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskNodeUi.d.ts +19 -0
- package/dist/functions/cloudDisk/cloudDiskNodeUi.js +170 -0
- package/dist/functions/cloudDisk/cloudDiskNodeUi.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskPrivacyCrypto.d.ts +5 -0
- package/dist/functions/cloudDisk/cloudDiskPrivacyCrypto.js +39 -0
- package/dist/functions/cloudDisk/cloudDiskPrivacyCrypto.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskPrivateFolderTree.d.ts +4 -0
- package/dist/functions/cloudDisk/cloudDiskPrivateFolderTree.js +28 -0
- package/dist/functions/cloudDisk/cloudDiskPrivateFolderTree.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskUniappFileIcon.d.ts +2 -0
- package/dist/functions/cloudDisk/cloudDiskUniappFileIcon.js +27 -0
- package/dist/functions/cloudDisk/cloudDiskUniappFileIcon.js.map +1 -0
- package/dist/functions/cloudDisk/cloudDiskUploadTaskUi.d.ts +3 -0
- package/dist/functions/cloudDisk/cloudDiskUploadTaskUi.js +26 -0
- package/dist/functions/cloudDisk/cloudDiskUploadTaskUi.js.map +1 -0
- package/dist/functions/cloudDisk/mapCloudDiskFileToNode.d.ts +2 -0
- package/dist/functions/cloudDisk/mapCloudDiskFileToNode.js +21 -0
- package/dist/functions/cloudDisk/mapCloudDiskFileToNode.js.map +1 -0
- package/dist/functions/code/index.js +1 -1
- package/dist/functions/color/convertColor.js +4 -4
- package/dist/functions/color/detectColorFormat.js +3 -3
- package/dist/functions/color/extractColors.js +2 -2
- package/dist/functions/design-tokens/buildTokens.js +3 -3
- package/dist/functions/dom/computePosition.js +2 -2
- package/dist/functions/dom/copyHtmlAndPlainToClipboard.js +1 -1
- package/dist/functions/dom/createSharedKeyboardCenter.js +1 -1
- package/dist/functions/dom/detectOverflow.js +1 -1
- package/dist/functions/dom/getCrossAxisFlip.js +2 -2
- package/dist/functions/dom/getFlipPlacements.js +2 -2
- package/dist/functions/dom/getMainAxisFlip.js +2 -2
- package/dist/functions/download/createDownloadDispatcher.d.ts +16 -0
- package/dist/functions/download/createDownloadDispatcher.js +31 -0
- package/dist/functions/download/createDownloadDispatcher.js.map +1 -0
- package/dist/functions/download/downloadInBrowser.d.ts +14 -0
- package/dist/functions/download/downloadInBrowser.js +56 -0
- package/dist/functions/download/downloadInBrowser.js.map +1 -0
- package/dist/functions/download/downloadInBrowserResolved.d.ts +12 -0
- package/dist/functions/download/downloadInBrowserResolved.js +47 -0
- package/dist/functions/download/downloadInBrowserResolved.js.map +1 -0
- package/dist/functions/fake/generateFakeDrivingLicense.js +1 -1
- package/dist/functions/fake/generateFakeIdCard.js +1 -1
- package/dist/functions/file/getIconfontNameByExtension.js +6 -1
- package/dist/functions/file/getIconfontNameByExtension.js.map +1 -1
- package/dist/functions/file/guessMimeTypeFromFileName.d.ts +1 -0
- package/dist/functions/file/guessMimeTypeFromFileName.js +9 -0
- package/dist/functions/file/guessMimeTypeFromFileName.js.map +1 -0
- package/dist/functions/file/index.d.ts +4 -0
- package/dist/functions/file/index.js +8 -4
- package/dist/functions/file/index.js.map +1 -1
- package/dist/functions/file/isJpegImageFile.d.ts +4 -0
- package/dist/functions/file/isJpegImageFile.js +12 -0
- package/dist/functions/file/isJpegImageFile.js.map +1 -0
- package/dist/functions/file/isRasterImageFile.d.ts +3 -0
- package/dist/functions/file/isRasterImageFile.js +26 -0
- package/dist/functions/file/isRasterImageFile.js.map +1 -0
- package/dist/functions/file/mediaProbePathFromUrl.d.ts +1 -0
- package/dist/functions/file/mediaProbePathFromUrl.js +17 -0
- package/dist/functions/file/mediaProbePathFromUrl.js.map +1 -0
- package/dist/functions/file/resolveFileMimeType.d.ts +5 -0
- package/dist/functions/file/resolveFileMimeType.js +8 -0
- package/dist/functions/file/resolveFileMimeType.js.map +1 -0
- package/dist/functions/file/sanitizeDownloadFilename.d.ts +6 -0
- package/dist/functions/file/sanitizeDownloadFilename.js +20 -0
- package/dist/functions/file/sanitizeDownloadFilename.js.map +1 -0
- package/dist/functions/file/suggestFilenameFromUrl.d.ts +1 -0
- package/dist/functions/file/suggestFilenameFromUrl.js +23 -0
- package/dist/functions/file/suggestFilenameFromUrl.js.map +1 -0
- package/dist/functions/hybrid/createBridgeMessage.js +1 -1
- package/dist/functions/im/chatMessageList.d.ts +15 -0
- package/dist/functions/im/chatMessageList.js +201 -0
- package/dist/functions/im/chatMessageList.js.map +1 -0
- package/dist/functions/im/chatMessageSocialActions.d.ts +3 -0
- package/dist/functions/im/chatMessageSocialActions.js +23 -0
- package/dist/functions/im/chatMessageSocialActions.js.map +1 -0
- package/dist/functions/im/classifyAgentProxyRetryable.d.ts +4 -0
- package/dist/functions/im/classifyAgentProxyRetryable.js +18 -0
- package/dist/functions/im/classifyAgentProxyRetryable.js.map +1 -0
- package/dist/functions/im/forwardBundleItemToChatMessage.d.ts +3 -0
- package/dist/functions/im/forwardBundleItemToChatMessage.js +129 -0
- package/dist/functions/im/forwardBundleItemToChatMessage.js.map +1 -0
- package/dist/functions/im/imAccountKind.d.ts +3 -0
- package/dist/functions/im/imAccountKind.js +7 -0
- package/dist/functions/im/imAccountKind.js.map +1 -0
- package/dist/functions/im/imAiChatSessionTitle.d.ts +2 -0
- package/dist/functions/im/imAiChatSessionTitle.js +16 -0
- package/dist/functions/im/imAiChatSessionTitle.js.map +1 -0
- package/dist/functions/im/imApiMessageMerge.d.ts +2 -0
- package/dist/functions/im/imApiMessageMerge.js +71 -0
- package/dist/functions/im/imApiMessageMerge.js.map +1 -0
- package/dist/functions/im/imApiResponseParse.d.ts +2 -0
- package/dist/functions/im/imApiResponseParse.js +35 -0
- package/dist/functions/im/imApiResponseParse.js.map +1 -0
- package/dist/functions/im/imBubbleSelectionClipboard.js +2 -2
- package/dist/functions/im/imChatContextMenuSpecs.d.ts +10 -0
- package/dist/functions/im/imChatContextMenuSpecs.js +45 -0
- package/dist/functions/im/imChatContextMenuSpecs.js.map +1 -0
- package/dist/functions/im/imChatInlineAttachmentDisplay.d.ts +16 -0
- package/dist/functions/im/imChatInlineAttachmentDisplay.js +53 -0
- package/dist/functions/im/imChatInlineAttachmentDisplay.js.map +1 -0
- package/dist/functions/im/imChatInlineAttachmentKind.d.ts +5 -0
- package/dist/functions/im/imChatInlineAttachmentKind.js +24 -0
- package/dist/functions/im/imChatInlineAttachmentKind.js.map +1 -0
- package/dist/functions/im/imChatMessageContextMenuCopy.d.ts +3 -0
- package/dist/functions/im/imChatMessageContextMenuCopy.js +34 -0
- package/dist/functions/im/imChatMessageContextMenuCopy.js.map +1 -0
- package/dist/functions/im/imChatMessageCopyPlain.d.ts +5 -0
- package/dist/functions/im/imChatMessageCopyPlain.js +71 -0
- package/dist/functions/im/imChatMessageCopyPlain.js.map +1 -0
- package/dist/functions/im/imChatMessageInbound.d.ts +9 -0
- package/dist/functions/im/imChatMessageInbound.js +94 -0
- package/dist/functions/im/imChatMessageInbound.js.map +1 -0
- package/dist/functions/im/imChatMessageLayout.d.ts +3 -0
- package/dist/functions/im/imChatMessageLayout.js +4 -0
- package/dist/functions/im/imChatMessageLayout.js.map +1 -0
- package/dist/functions/im/imChatMessageMap.d.ts +13 -0
- package/dist/functions/im/imChatMessageMap.js +62 -0
- package/dist/functions/im/imChatMessageMap.js.map +1 -0
- package/dist/functions/im/imChatMessageMediaAsset.d.ts +5 -0
- package/dist/functions/im/imChatMessageMediaAsset.js +32 -0
- package/dist/functions/im/imChatMessageMediaAsset.js.map +1 -0
- package/dist/functions/im/imChatMessagePagination.d.ts +18 -0
- package/dist/functions/im/imChatMessagePagination.js +153 -0
- package/dist/functions/im/imChatMessagePagination.js.map +1 -0
- package/dist/functions/im/imChatMessageTime.d.ts +2 -0
- package/dist/functions/im/imChatMessageTime.js +24 -0
- package/dist/functions/im/imChatMessageTime.js.map +1 -0
- package/dist/functions/im/imChatViewContextMenu.d.ts +12 -0
- package/dist/functions/im/imChatViewContextMenu.js +91 -0
- package/dist/functions/im/imChatViewContextMenu.js.map +1 -0
- package/dist/functions/im/imClientMessageId.d.ts +1 -0
- package/dist/functions/im/imClientMessageId.js +4 -0
- package/dist/functions/im/imClientMessageId.js.map +1 -0
- package/dist/functions/im/imCodeProjectPath.d.ts +6 -0
- package/dist/functions/im/imCodeProjectPath.js +29 -0
- package/dist/functions/im/imCodeProjectPath.js.map +1 -0
- package/dist/functions/im/imComposerDraft.d.ts +3 -0
- package/dist/functions/im/imComposerDraft.js +30 -0
- package/dist/functions/im/imComposerDraft.js.map +1 -0
- package/dist/functions/im/imComposerToolbar.d.ts +5 -0
- package/dist/functions/im/imComposerToolbar.js +80 -0
- package/dist/functions/im/imComposerToolbar.js.map +1 -0
- package/dist/functions/im/imContactDisplay.d.ts +5 -0
- package/dist/functions/im/imContactDisplay.js +30 -0
- package/dist/functions/im/imContactDisplay.js.map +1 -0
- package/dist/functions/im/imContactIndexLetter.d.ts +7 -0
- package/dist/functions/im/imContactIndexLetter.js +62 -0
- package/dist/functions/im/imContactIndexLetter.js.map +1 -0
- package/dist/functions/im/imConversationAdminIds.d.ts +2 -0
- package/dist/functions/im/imConversationAdminIds.js +11 -0
- package/dist/functions/im/imConversationAdminIds.js.map +1 -0
- package/dist/functions/im/imConversationDisplay.d.ts +9 -0
- package/dist/functions/im/imConversationDisplay.js +50 -0
- package/dist/functions/im/imConversationDisplay.js.map +1 -0
- package/dist/functions/im/imConversationDraftHighlight.d.ts +1 -0
- package/dist/functions/im/imConversationDraftHighlight.js +10 -0
- package/dist/functions/im/imConversationDraftHighlight.js.map +1 -0
- package/dist/functions/im/imConversationHistoryFilter.d.ts +18 -0
- package/dist/functions/im/imConversationHistoryFilter.js +144 -0
- package/dist/functions/im/imConversationHistoryFilter.js.map +1 -0
- package/dist/functions/im/imConversationId.d.ts +7 -0
- package/dist/functions/im/imConversationId.js +28 -0
- package/dist/functions/im/imConversationId.js.map +1 -0
- package/dist/functions/im/imConversationLastMessageMerge.d.ts +2 -0
- package/dist/functions/im/imConversationLastMessageMerge.js +29 -0
- package/dist/functions/im/imConversationLastMessageMerge.js.map +1 -0
- package/dist/functions/im/imConversationListHighlights.d.ts +21 -0
- package/dist/functions/im/imConversationListHighlights.js +144 -0
- package/dist/functions/im/imConversationListHighlights.js.map +1 -0
- package/dist/functions/im/imConversationListOnlinePresence.d.ts +4 -0
- package/dist/functions/im/imConversationListOnlinePresence.js +23 -0
- package/dist/functions/im/imConversationListOnlinePresence.js.map +1 -0
- package/dist/functions/im/imConversationListOutboundContext.d.ts +6 -0
- package/dist/functions/im/imConversationListOutboundContext.js +70 -0
- package/dist/functions/im/imConversationListOutboundContext.js.map +1 -0
- package/dist/functions/im/imConversationListSummary.d.ts +21 -0
- package/dist/functions/im/imConversationListSummary.js +87 -0
- package/dist/functions/im/imConversationListSummary.js.map +1 -0
- package/dist/functions/im/imConversationParty.d.ts +4 -0
- package/dist/functions/im/imConversationParty.js +10 -0
- package/dist/functions/im/imConversationParty.js.map +1 -0
- package/dist/functions/im/imConversationRowFields.d.ts +3 -0
- package/dist/functions/im/imConversationRowFields.js +23 -0
- package/dist/functions/im/imConversationRowFields.js.map +1 -0
- package/dist/functions/im/imConversationServerTime.d.ts +8 -0
- package/dist/functions/im/imConversationServerTime.js +59 -0
- package/dist/functions/im/imConversationServerTime.js.map +1 -0
- package/dist/functions/im/imConversationToChatViewUi.d.ts +21 -0
- package/dist/functions/im/imConversationToChatViewUi.js +69 -0
- package/dist/functions/im/imConversationToChatViewUi.js.map +1 -0
- package/dist/functions/im/imDesktopMachineExtra.d.ts +5 -0
- package/dist/functions/im/imDesktopMachineExtra.js +32 -0
- package/dist/functions/im/imDesktopMachineExtra.js.map +1 -0
- package/dist/functions/im/imDesktopNotificationContent.d.ts +29 -0
- package/dist/functions/im/imDesktopNotificationContent.js +65 -0
- package/dist/functions/im/imDesktopNotificationContent.js.map +1 -0
- package/dist/functions/im/imDexieMessageId.d.ts +2 -0
- package/dist/functions/im/imDexieMessageId.js +30 -0
- package/dist/functions/im/imDexieMessageId.js.map +1 -0
- package/dist/functions/im/imDisplayExtra.d.ts +11 -0
- package/dist/functions/im/imDisplayExtra.js +130 -0
- package/dist/functions/im/imDisplayExtra.js.map +1 -0
- package/dist/functions/im/imForwardBundlePreviewText.d.ts +1 -0
- package/dist/functions/im/imForwardBundlePreviewText.js +10 -0
- package/dist/functions/im/imForwardBundlePreviewText.js.map +1 -0
- package/dist/functions/im/imForwardBundleTitle.d.ts +5 -0
- package/dist/functions/im/imForwardBundleTitle.js +32 -0
- package/dist/functions/im/imForwardBundleTitle.js.map +1 -0
- package/dist/functions/im/imForwardSnapshot.d.ts +18 -0
- package/dist/functions/im/imForwardSnapshot.js +264 -0
- package/dist/functions/im/imForwardSnapshot.js.map +1 -0
- package/dist/functions/im/imForwardSnapshotMentions.d.ts +7 -0
- package/dist/functions/im/imForwardSnapshotMentions.js +76 -0
- package/dist/functions/im/imForwardSnapshotMentions.js.map +1 -0
- package/dist/functions/im/imImagePixelExtra.d.ts +24 -0
- package/dist/functions/im/imImagePixelExtra.js +52 -0
- package/dist/functions/im/imImagePixelExtra.js.map +1 -0
- package/dist/functions/im/imInlineContentTokens.js +1 -1
- package/dist/functions/im/imInlineMediaUrlVideo.d.ts +4 -0
- package/dist/functions/im/imInlineMediaUrlVideo.js +14 -0
- package/dist/functions/im/imInlineMediaUrlVideo.js.map +1 -0
- package/dist/functions/im/imLlmContextExtra.d.ts +2 -0
- package/dist/functions/im/imLlmContextExtra.js +37 -0
- package/dist/functions/im/imLlmContextExtra.js.map +1 -0
- package/dist/functions/im/imLlmContextLabel.d.ts +2 -0
- package/dist/functions/im/imLlmContextLabel.js +32 -0
- package/dist/functions/im/imLlmContextLabel.js.map +1 -0
- package/dist/functions/im/imLocalMessageId.d.ts +4 -0
- package/dist/functions/im/imLocalMessageId.js +18 -0
- package/dist/functions/im/imLocalMessageId.js.map +1 -0
- package/dist/functions/im/imLooseMessageRow.d.ts +3 -0
- package/dist/functions/im/imLooseMessageRow.js +88 -0
- package/dist/functions/im/imLooseMessageRow.js.map +1 -0
- package/dist/functions/im/imMediaExtra.d.ts +11 -0
- package/dist/functions/im/imMediaExtra.js +71 -0
- package/dist/functions/im/imMediaExtra.js.map +1 -0
- package/dist/functions/im/imMemberIdsInput.d.ts +1 -0
- package/dist/functions/im/imMemberIdsInput.js +9 -0
- package/dist/functions/im/imMemberIdsInput.js.map +1 -0
- package/dist/functions/im/imMentionAllowedUserIds.d.ts +15 -0
- package/dist/functions/im/imMentionAllowedUserIds.js +47 -0
- package/dist/functions/im/imMentionAllowedUserIds.js.map +1 -0
- package/dist/functions/im/imMessageExtraRecord.d.ts +7 -0
- package/dist/functions/im/imMessageExtraRecord.js +13 -0
- package/dist/functions/im/imMessageExtraRecord.js.map +1 -0
- package/dist/functions/im/imMessageHistoryWindow.d.ts +17 -0
- package/dist/functions/im/imMessageHistoryWindow.js +117 -0
- package/dist/functions/im/imMessageHistoryWindow.js.map +1 -0
- package/dist/functions/im/imMessageId.d.ts +8 -0
- package/dist/functions/im/imMessageId.js +35 -0
- package/dist/functions/im/imMessageId.js.map +1 -0
- package/dist/functions/im/imMessageIdForApiDelete.d.ts +2 -0
- package/dist/functions/im/imMessageIdForApiDelete.js +14 -0
- package/dist/functions/im/imMessageIdForApiDelete.js.map +1 -0
- package/dist/functions/im/imMessageListActivity.d.ts +5 -0
- package/dist/functions/im/imMessageListActivity.js +52 -0
- package/dist/functions/im/imMessageListActivity.js.map +1 -0
- package/dist/functions/im/imMessageListOps.d.ts +5 -0
- package/dist/functions/im/imMessageListOps.js +51 -0
- package/dist/functions/im/imMessageListOps.js.map +1 -0
- package/dist/functions/im/imMessageListSummaryBody.d.ts +16 -0
- package/dist/functions/im/imMessageListSummaryBody.js +174 -0
- package/dist/functions/im/imMessageListSummaryBody.js.map +1 -0
- package/dist/functions/im/imMessageNormalize.d.ts +14 -0
- package/dist/functions/im/imMessageNormalize.js +220 -0
- package/dist/functions/im/imMessageNormalize.js.map +1 -0
- package/dist/functions/im/imMessageToChatMessage.d.ts +9 -0
- package/dist/functions/im/imMessageToChatMessage.js +190 -0
- package/dist/functions/im/imMessageToChatMessage.js.map +1 -0
- package/dist/functions/im/imOutboundListSummary.d.ts +12 -0
- package/dist/functions/im/imOutboundListSummary.js +106 -0
- package/dist/functions/im/imOutboundListSummary.js.map +1 -0
- package/dist/functions/im/imOutboundMediaHelpers.d.ts +4 -0
- package/dist/functions/im/imOutboundMediaHelpers.js +22 -0
- package/dist/functions/im/imOutboundMediaHelpers.js.map +1 -0
- package/dist/functions/im/imOutboundPatch.d.ts +5 -0
- package/dist/functions/im/imOutboundPatch.js +61 -0
- package/dist/functions/im/imOutboundPatch.js.map +1 -0
- package/dist/functions/im/imOutboundStatus.d.ts +4 -0
- package/dist/functions/im/imOutboundStatus.js +15 -0
- package/dist/functions/im/imOutboundStatus.js.map +1 -0
- package/dist/functions/im/imPendingOpenConversation.d.ts +3 -0
- package/dist/functions/im/imPendingOpenConversation.js +14 -0
- package/dist/functions/im/imPendingOpenConversation.js.map +1 -0
- package/dist/functions/im/imPlaceholderSnippet.d.ts +2 -0
- package/dist/functions/im/imPlaceholderSnippet.js +13 -0
- package/dist/functions/im/imPlaceholderSnippet.js.map +1 -0
- package/dist/functions/im/imProxyAgentContent.d.ts +8 -0
- package/dist/functions/im/imProxyAgentContent.js +56 -0
- package/dist/functions/im/imProxyAgentContent.js.map +1 -0
- package/dist/functions/im/imProxyAgentDiagnostics.d.ts +16 -0
- package/dist/functions/im/imProxyAgentDiagnostics.js +70 -0
- package/dist/functions/im/imProxyAgentDiagnostics.js.map +1 -0
- package/dist/functions/im/imProxyAgentMessage.d.ts +23 -0
- package/dist/functions/im/imProxyAgentMessage.js +146 -0
- package/dist/functions/im/imProxyAgentMessage.js.map +1 -0
- package/dist/functions/im/imProxySelfIdentityTemplate.d.ts +13 -0
- package/dist/functions/im/imProxySelfIdentityTemplate.js +34 -0
- package/dist/functions/im/imProxySelfIdentityTemplate.js.map +1 -0
- package/dist/functions/im/imQuotePreview.d.ts +13 -0
- package/dist/functions/im/imQuotePreview.js +156 -0
- package/dist/functions/im/imQuotePreview.js.map +1 -0
- package/dist/functions/im/imReplyExtra.d.ts +3 -0
- package/dist/functions/im/imReplyExtra.js +26 -0
- package/dist/functions/im/imReplyExtra.js.map +1 -0
- package/dist/functions/im/imRichClipboardPlain.js +1 -1
- package/dist/functions/im/imRichContentPlain.d.ts +3 -0
- package/dist/functions/im/imRichContentPlain.js +18 -0
- package/dist/functions/im/imRichContentPlain.js.map +1 -0
- package/dist/functions/im/imSendPayloadValidation.d.ts +6 -0
- package/dist/functions/im/imSendPayloadValidation.js +136 -0
- package/dist/functions/im/imSendPayloadValidation.js.map +1 -0
- package/dist/functions/im/imSnakeChatMessage.d.ts +5 -0
- package/dist/functions/im/imSnakeChatMessage.js +62 -0
- package/dist/functions/im/imSnakeChatMessage.js.map +1 -0
- package/dist/functions/im/imWalletExtra.d.ts +3 -0
- package/dist/functions/im/imWalletExtra.js +114 -0
- package/dist/functions/im/imWalletExtra.js.map +1 -0
- package/dist/functions/im/index.d.ts +81 -0
- package/dist/functions/im/index.js +85 -4
- package/dist/functions/im/index.js.map +1 -1
- package/dist/functions/im/mapAgentToImProxyItem.d.ts +21 -0
- package/dist/functions/im/mapAgentToImProxyItem.js +23 -0
- package/dist/functions/im/mapAgentToImProxyItem.js.map +1 -0
- package/dist/functions/im/validateImPeerInput.d.ts +8 -0
- package/dist/functions/im/validateImPeerInput.js +14 -0
- package/dist/functions/im/validateImPeerInput.js.map +1 -0
- package/dist/functions/image/compressImageToWidth.js +1 -1
- package/dist/functions/image/compressImageToWidthJpgOrWebp.js +2 -2
- package/dist/functions/image/compressJpgToTargetSize.js +1 -1
- package/dist/functions/image/compressToTargetSizeJpg.js +1 -1
- package/dist/functions/image/compressToTargetSizeJpgOrWebp.js +2 -2
- package/dist/functions/image/generateMacIcons.js +2 -2
- package/dist/functions/image/generatePwaIcons.js +2 -2
- package/dist/functions/image/scaleDimensionsToMaxSide.d.ts +4 -0
- package/dist/functions/image/scaleDimensionsToMaxSide.js +14 -0
- package/dist/functions/image/scaleDimensionsToMaxSide.js.map +1 -0
- package/dist/functions/ios/configurePermissions.js +1 -1
- package/dist/functions/ios/integrateCameraGallery.js +1 -1
- package/dist/functions/ios/integrateNativePlugin.js +1 -1
- package/dist/functions/ios/integrateQQShare.js +1 -1
- package/dist/functions/ios/integrateSinaShare.js +1 -1
- package/dist/functions/ios/integrateThirdPartyModule.js +1 -1
- package/dist/functions/ios/integrateUniPushIOS.js +1 -1
- package/dist/functions/ios/integrateWechatOauth.js +1 -1
- package/dist/functions/ios/integrateWechatShare.js +1 -1
- package/dist/functions/llm/backfillReasoningInMessages.d.ts +3 -0
- package/dist/functions/llm/backfillReasoningInMessages.js +28 -0
- package/dist/functions/llm/backfillReasoningInMessages.js.map +1 -0
- package/dist/functions/llm/createLlmReasoningStore.d.ts +16 -0
- package/dist/functions/llm/createLlmReasoningStore.js +167 -0
- package/dist/functions/llm/createLlmReasoningStore.js.map +1 -0
- package/dist/functions/markdown/cwMarkdownAst.d.ts +68 -0
- package/dist/functions/markdown/cwMarkdownAst.js +2 -0
- package/dist/functions/markdown/cwMarkdownAst.js.map +1 -0
- package/dist/functions/markdown/markdownToSpeechPlainText.d.ts +5 -0
- package/dist/functions/markdown/markdownToSpeechPlainText.js +123 -0
- package/dist/functions/markdown/markdownToSpeechPlainText.js.map +1 -0
- package/dist/functions/markdown/parseGfmTable.d.ts +6 -0
- package/dist/functions/markdown/parseGfmTable.js +87 -0
- package/dist/functions/markdown/parseGfmTable.js.map +1 -0
- package/dist/functions/markdown/parseInline.d.ts +2 -0
- package/dist/functions/markdown/parseInline.js +227 -0
- package/dist/functions/markdown/parseInline.js.map +1 -0
- package/dist/functions/markdown/parseMarkdownBlocks.d.ts +2 -0
- package/dist/functions/markdown/parseMarkdownBlocks.js +197 -0
- package/dist/functions/markdown/parseMarkdownBlocks.js.map +1 -0
- package/dist/functions/observability/createObservabilityReporter.d.ts +29 -0
- package/dist/functions/observability/createObservabilityReporter.js +77 -0
- package/dist/functions/observability/createObservabilityReporter.js.map +1 -0
- package/dist/functions/observability/createObservabilityRingBuffer.d.ts +5 -0
- package/dist/functions/observability/createObservabilityRingBuffer.js +14 -0
- package/dist/functions/observability/createObservabilityRingBuffer.js.map +1 -0
- package/dist/functions/observability/isBenignObservabilityError.d.ts +2 -0
- package/dist/functions/observability/isBenignObservabilityError.js +17 -0
- package/dist/functions/observability/isBenignObservabilityError.js.map +1 -0
- package/dist/functions/observability/sanitizeApiPath.d.ts +1 -0
- package/dist/functions/observability/sanitizeApiPath.js +5 -0
- package/dist/functions/observability/sanitizeApiPath.js.map +1 -0
- package/dist/functions/oss/buildCosObjectKey.d.ts +1 -0
- package/dist/functions/oss/buildCosObjectKey.js +6 -0
- package/dist/functions/oss/buildCosObjectKey.js.map +1 -0
- package/dist/functions/oss/buildCosUnsignedObjectUrl.d.ts +7 -0
- package/dist/functions/oss/buildCosUnsignedObjectUrl.js +10 -0
- package/dist/functions/oss/buildCosUnsignedObjectUrl.js.map +1 -0
- package/dist/functions/oss/buildOssVideoPosterPath.d.ts +1 -0
- package/dist/functions/oss/buildOssVideoPosterPath.js +7 -0
- package/dist/functions/oss/buildOssVideoPosterPath.js.map +1 -0
- package/dist/functions/oss/buildTimestampedOssObjectPath.d.ts +1 -0
- package/dist/functions/oss/buildTimestampedOssObjectPath.js +10 -0
- package/dist/functions/oss/buildTimestampedOssObjectPath.js.map +1 -0
- package/dist/functions/oss/cosSliceUploadWithSts.d.ts +7 -0
- package/dist/functions/oss/cosSliceUploadWithSts.js +30 -0
- package/dist/functions/oss/cosSliceUploadWithSts.js.map +1 -0
- package/dist/functions/oss/createOssBrowserUploadClient.d.ts +5 -0
- package/dist/functions/oss/createOssBrowserUploadClient.js +5 -0
- package/dist/functions/oss/createOssBrowserUploadClient.js.map +1 -0
- package/dist/functions/oss/createOssSignedUploadApi.d.ts +20 -0
- package/dist/functions/oss/createOssSignedUploadApi.js +71 -0
- package/dist/functions/oss/createOssSignedUploadApi.js.map +1 -0
- package/dist/functions/oss/parseOssDownloadRequest.d.ts +9 -0
- package/dist/functions/oss/parseOssDownloadRequest.js +42 -0
- package/dist/functions/oss/parseOssDownloadRequest.js.map +1 -0
- package/dist/functions/oss/resolveOssUploadContentType.d.ts +2 -0
- package/dist/functions/oss/resolveOssUploadContentType.js +12 -0
- package/dist/functions/oss/resolveOssUploadContentType.js.map +1 -0
- package/dist/functions/oss/sanitizeOssObjectName.d.ts +1 -0
- package/dist/functions/oss/sanitizeOssObjectName.js +7 -0
- package/dist/functions/oss/sanitizeOssObjectName.js.map +1 -0
- package/dist/functions/oss/uploadBlobViaSignedPut.d.ts +21 -0
- package/dist/functions/oss/uploadBlobViaSignedPut.js +17 -0
- package/dist/functions/oss/uploadBlobViaSignedPut.js.map +1 -0
- package/dist/functions/oss/uploadOssFileFromBrowser.d.ts +11 -0
- package/dist/functions/oss/uploadOssFileFromBrowser.js +38 -0
- package/dist/functions/oss/uploadOssFileFromBrowser.js.map +1 -0
- package/dist/functions/path/index.js +4 -4
- package/dist/functions/performance/debounceWithCancel.d.ts +9 -0
- package/dist/functions/performance/debounceWithCancel.js +18 -0
- package/dist/functions/performance/debounceWithCancel.js.map +1 -0
- package/dist/functions/router/readRouteQuery.d.ts +4 -0
- package/dist/functions/router/readRouteQuery.js +14 -0
- package/dist/functions/router/readRouteQuery.js.map +1 -0
- package/dist/functions/software/findSoftware.js +1 -1
- package/dist/functions/string/caseConverter.js +1 -1
- package/dist/functions/string/similarity.js +1 -1
- package/dist/functions/tree/index.js +1 -1
- package/dist/functions/ui/materializeImUiContextMenuItems.d.ts +2 -0
- package/dist/functions/ui/materializeImUiContextMenuItems.js +17 -0
- package/dist/functions/ui/materializeImUiContextMenuItems.js.map +1 -0
- package/dist/functions/ui/resolveGalleryPreviewContextMenuEvent.d.ts +6 -0
- package/dist/functions/ui/resolveGalleryPreviewContextMenuEvent.js +9 -0
- package/dist/functions/ui/resolveGalleryPreviewContextMenuEvent.js.map +1 -0
- package/dist/functions/uniapp/api/index.js +10 -10
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +21 -21
- package/dist/functions/uniapp/app-plus/buildIOSApp.js +13 -13
- package/dist/functions/uniapp/camera/showCamera.js +3 -3
- package/dist/functions/uniapp/customer-service/showWxCustomerService.js +1 -1
- package/dist/functions/uniapp/file/showFile.js +3 -3
- package/dist/functions/uniapp/image/showImage.js +3 -3
- package/dist/functions/uniapp/login/showLogin.js +2 -2
- package/dist/functions/uniapp/parseManifest.js +1 -1
- package/dist/functions/uniapp/pay/showPay.js +3 -3
- package/dist/functions/uniapp/phone/showWxPhone.js +1 -1
- package/dist/functions/uniapp/platform.js +1 -1
- package/dist/functions/uniapp/record/showRecord.js +3 -3
- package/dist/functions/uniapp/scan-code/showScanCode.js +2 -2
- package/dist/functions/uniapp/subscribe-message/showWxSubscribeMessage.js +1 -1
- package/dist/functions/uniapp/video/showVideo.js +3 -3
- package/dist/functions/url/assetUrlGuards.d.ts +3 -0
- package/dist/functions/url/assetUrlGuards.js +19 -0
- package/dist/functions/url/assetUrlGuards.js.map +1 -0
- package/dist/functions/utils/generateExports.d.ts +2 -0
- package/dist/functions/utils/generateExports.js +9 -1
- package/dist/functions/utils/generateExports.js.map +1 -1
- package/dist/functions/utils/parseJsonObjectFromText.d.ts +1 -0
- package/dist/functions/utils/parseJsonObjectFromText.js +18 -0
- package/dist/functions/utils/parseJsonObjectFromText.js.map +1 -0
- package/dist/functions/validation/normalizeExternalId.d.ts +4 -0
- package/dist/functions/validation/normalizeExternalId.js +19 -0
- package/dist/functions/validation/normalizeExternalId.js.map +1 -0
- package/dist/functions/version/incrementVersion.js +1 -1
- package/dist/functions/vue/extractColorsFromVueFile.js +5 -5
- package/dist/functions/vue/extractColorsFromVueSection.js +1 -1
- package/dist/permissions/allPermissionCode.js.map +1 -1
- package/dist/permissions/catalog.d.ts +78 -4
- package/dist/permissions/catalog.js +283 -5
- package/dist/permissions/catalog.js.map +1 -1
- package/dist/permissions/definePermissionGroup.js.map +1 -1
- package/dist/permissions/groups.js.map +1 -1
- package/dist/reactive/useReactiveCookie.js +1 -1
- package/dist/schemas/auth.schema.d.ts +32 -32
- package/dist/schemas/video.schema.d.ts +80 -80
- package/dist/vue-hooks/browser/useBridgeMessage.js +2 -2
- package/dist/vue-hooks/browser/useWechatJSSDK.js +1 -1
- package/dist/vue-hooks/dom/useAutoUpdate.js +1 -1
- package/dist/vue-hooks/history/useDebouncedRefHistory.js +1 -1
- package/dist/vue-hooks/history/useRefHistory.js +1 -1
- package/dist/vue-hooks/worker/useWorkerPool.js +1 -1
- package/package.json +235 -18
- package/references/cos-js-sdk-v5.d.ts +36 -0
- package/references/crypto.d.ts +10 -0
- package/references/dom.d.ts +2 -0
- package/references/xhr.d.ts +11 -0
- package/types/agent-input-content.d.ts +12 -0
- package/types/ai-agent.d.ts +5 -0
- package/types/ai-mcp.d.ts +18 -0
- package/types/api-client.d.ts +35 -0
- package/types/app-safe-area.d.ts +9 -0
- package/types/cloud-disk.d.ts +82 -0
- package/types/download.d.ts +54 -0
- package/types/im-account-kind.d.ts +2 -0
- package/types/im-api.d.ts +3 -0
- package/types/im-chat.d.ts +14 -0
- package/types/im-code-project.d.ts +32 -0
- package/types/im-composer.d.ts +23 -0
- package/types/im-contact.d.ts +22 -0
- package/types/im-snake-chat.d.ts +33 -0
- package/types/llm-openai-wire.d.ts +1 -0
- package/types/observability.d.ts +39 -0
- package/types/oss-signed-upload.d.ts +68 -0
- package/dist/permissions/allPermissionCode.d.ts +0 -3
- package/dist/permissions/allPermissionCode.js +0 -14
- package/dist/permissions/definePermissionGroup.d.ts +0 -26
- package/dist/permissions/definePermissionGroup.js +0 -22
- package/dist/permissions/groups.d.ts +0 -50
- package/dist/permissions/groups.js +0 -251
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { isHttpOrHttpsUrl } from '../url/assetUrlGuards.js';
|
|
2
|
+
import { readAttachmentSizeBytesFromRecord } from './imMediaExtra.js';
|
|
3
|
+
export const IM_DISPLAY_V2_BLOCK_TYPES = new Set([
|
|
4
|
+
'im.text',
|
|
5
|
+
'im.markdown',
|
|
6
|
+
'im.agent_tool',
|
|
7
|
+
'im.image',
|
|
8
|
+
'im.video',
|
|
9
|
+
'im.file',
|
|
10
|
+
]);
|
|
11
|
+
export function parseImDisplayFromExtra(extra) {
|
|
12
|
+
if (!extra)
|
|
13
|
+
return undefined;
|
|
14
|
+
const raw = extra.im_display;
|
|
15
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
16
|
+
return undefined;
|
|
17
|
+
const rec = raw;
|
|
18
|
+
const ver = Number(rec.version);
|
|
19
|
+
const blocksRaw = rec.blocks;
|
|
20
|
+
if (!Array.isArray(blocksRaw) || blocksRaw.length === 0)
|
|
21
|
+
return undefined;
|
|
22
|
+
if (ver !== 2)
|
|
23
|
+
return undefined;
|
|
24
|
+
const blocks = [];
|
|
25
|
+
for (const br of blocksRaw) {
|
|
26
|
+
if (!br || typeof br !== 'object' || Array.isArray(br))
|
|
27
|
+
continue;
|
|
28
|
+
const b = br;
|
|
29
|
+
const type = typeof b.type === 'string' ? b.type.trim() : '';
|
|
30
|
+
if (!IM_DISPLAY_V2_BLOCK_TYPES.has(type))
|
|
31
|
+
continue;
|
|
32
|
+
const pr = b.props;
|
|
33
|
+
if (!pr || typeof pr !== 'object' || Array.isArray(pr))
|
|
34
|
+
continue;
|
|
35
|
+
if (type === 'im.agent_tool') {
|
|
36
|
+
const id = String(pr.id ?? '').trim();
|
|
37
|
+
const name = String(pr.name ?? '').trim();
|
|
38
|
+
if (!id || !name)
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (type === 'im.markdown' || type === 'im.text') {
|
|
42
|
+
const content = String(pr.content ?? '').trim();
|
|
43
|
+
if (!content)
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
blocks.push({ type, props: { ...pr } });
|
|
47
|
+
}
|
|
48
|
+
if (blocks.length === 0)
|
|
49
|
+
return undefined;
|
|
50
|
+
return { version: 2, blocks };
|
|
51
|
+
}
|
|
52
|
+
export function parseInlineAttachmentsFromExtra(extra) {
|
|
53
|
+
if (!extra)
|
|
54
|
+
return [];
|
|
55
|
+
const raw = extra.attachments;
|
|
56
|
+
if (!Array.isArray(raw))
|
|
57
|
+
return [];
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const item of raw) {
|
|
60
|
+
if (!item || typeof item !== 'object')
|
|
61
|
+
continue;
|
|
62
|
+
const rec = item;
|
|
63
|
+
const url = String(rec.url ?? '').trim();
|
|
64
|
+
if (!url)
|
|
65
|
+
continue;
|
|
66
|
+
const name = typeof rec.name === 'string' ? rec.name.trim() : undefined;
|
|
67
|
+
const mimeType = typeof rec.mimeType === 'string' && rec.mimeType.trim()
|
|
68
|
+
? rec.mimeType.trim()
|
|
69
|
+
: typeof rec.type === 'string' && rec.type.trim()
|
|
70
|
+
? rec.type.trim()
|
|
71
|
+
: undefined;
|
|
72
|
+
const size = readAttachmentSizeBytesFromRecord(rec);
|
|
73
|
+
out.push({
|
|
74
|
+
url,
|
|
75
|
+
...(name ? { name } : {}),
|
|
76
|
+
...(mimeType ? { mimeType } : {}),
|
|
77
|
+
...(size != null ? { size } : {}),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function isRemoteHttpUrl(url) {
|
|
83
|
+
const u = url?.trim() ?? '';
|
|
84
|
+
return u.length > 0 && isHttpOrHttpsUrl(u);
|
|
85
|
+
}
|
|
86
|
+
export function primaryRemoteUrlFromDisplayBlocks(blocks) {
|
|
87
|
+
for (const b of blocks) {
|
|
88
|
+
if (b.type === 'im.image') {
|
|
89
|
+
const u = String(b.props.thumbnailUrl ?? '').trim();
|
|
90
|
+
if (isRemoteHttpUrl(u))
|
|
91
|
+
return u;
|
|
92
|
+
}
|
|
93
|
+
if (b.type === 'im.video') {
|
|
94
|
+
const u = String(b.props.videoUrl ?? '').trim();
|
|
95
|
+
if (isRemoteHttpUrl(u))
|
|
96
|
+
return u;
|
|
97
|
+
}
|
|
98
|
+
if (b.type === 'im.file') {
|
|
99
|
+
const u = String(b.props.downloadUrl ?? '').trim();
|
|
100
|
+
if (isRemoteHttpUrl(u))
|
|
101
|
+
return u;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
106
|
+
export function fileMetaFromDisplayBlocks(blocks) {
|
|
107
|
+
const file = blocks.find((b) => b.type === 'im.file');
|
|
108
|
+
if (!file)
|
|
109
|
+
return {};
|
|
110
|
+
const name = typeof file.props.originalFileName === 'string'
|
|
111
|
+
? file.props.originalFileName.trim()
|
|
112
|
+
: undefined;
|
|
113
|
+
const sizeBytes = typeof file.props.fileSizeBytes === 'number' && Number.isFinite(file.props.fileSizeBytes)
|
|
114
|
+
? Math.floor(file.props.fileSizeBytes)
|
|
115
|
+
: undefined;
|
|
116
|
+
return { name: name || undefined, sizeBytes };
|
|
117
|
+
}
|
|
118
|
+
export function inferStandaloneMessageTypeFromDisplayBlocks(blocks) {
|
|
119
|
+
const hasText = blocks.some((b) => b.type === 'im.text');
|
|
120
|
+
if (hasText)
|
|
121
|
+
return 'text';
|
|
122
|
+
if (blocks.some((b) => b.type === 'im.image'))
|
|
123
|
+
return 'image';
|
|
124
|
+
if (blocks.some((b) => b.type === 'im.file'))
|
|
125
|
+
return 'file';
|
|
126
|
+
if (blocks.some((b) => b.type === 'im.video'))
|
|
127
|
+
return 'video';
|
|
128
|
+
return 'text';
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=imDisplayExtra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imDisplayExtra.js","sourceRoot":"","sources":["../../../src/functions/im/imDisplayExtra.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAA;AAGlE,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IAC/C,SAAS;IACT,aAAa;IACb,eAAe;IACf,UAAU;IACV,UAAU;IACV,SAAS;CACV,CAAC,CAAA;AAGF,MAAM,UAAU,uBAAuB,CACrC,KAA0C;IAE1C,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAA;IAC5B,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAA;IAC3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AAA;AAC/C,CAAC;AAGD,MAAM,UAAU,2CAA2C,CACzD,MAAiC;IAEjC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;IACxD,IAAI,OAAO;QAAE,OAAO,MAAM,CAAA;IAC1B,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;QAAE,OAAO,OAAO,CAAA;IAC7D,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;QAAE,OAAO,MAAM,CAAA;IAC3D,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC;QAAE,OAAO,OAAO,CAAA;IAC7D,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function materializeImForwardBundlePreviewText(text: string, resolveLabel?: (userId: string) => string, fallbackLabel?: (userId: string) => string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { materializeImRichHtmlToPlainText } from './imRichContentHtml.js';
|
|
2
|
+
export function materializeImForwardBundlePreviewText(text, resolveLabel, fallbackLabel) {
|
|
3
|
+
return materializeImRichHtmlToPlainText(text ?? '', {
|
|
4
|
+
resolveMentionLabel: resolveLabel,
|
|
5
|
+
mentionFallbackLabel: fallbackLabel,
|
|
6
|
+
formatImage: () => '[图片]',
|
|
7
|
+
formatFile: () => '[文件]',
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=imForwardBundlePreviewText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imForwardBundlePreviewText.js","sourceRoot":"","sources":["../../../src/functions/im/imForwardBundlePreviewText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAA;AAGtE,MAAM,UAAU,qCAAqC,CACnD,IAAY,EACZ,YAAyC,EACzC,aAA0C;IAE1C,OAAO,gCAAgC,CAAC,IAAI,IAAI,EAAE,EAAE;QAClD,mBAAmB,EAAE,YAAY;QACjC,oBAAoB,EAAE,aAAa;QACnC,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM;QACzB,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM;KACzB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChatForwardBundleItem } from '../../../types/im-chat';
|
|
2
|
+
export declare function buildForwardBundleTitle(items: readonly {
|
|
3
|
+
senderName: string;
|
|
4
|
+
}[]): string;
|
|
5
|
+
export declare function buildForwardBundlePlainText(items: readonly ChatForwardBundleItem[]): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function buildForwardBundleTitle(items) {
|
|
2
|
+
const seen = new Set();
|
|
3
|
+
const names = [];
|
|
4
|
+
for (const it of items) {
|
|
5
|
+
const n = String(it.senderName ?? '').trim() || '未知';
|
|
6
|
+
if (seen.has(n))
|
|
7
|
+
continue;
|
|
8
|
+
seen.add(n);
|
|
9
|
+
names.push(n);
|
|
10
|
+
}
|
|
11
|
+
if (names.length === 0)
|
|
12
|
+
return '聊天记录';
|
|
13
|
+
if (names.length === 1)
|
|
14
|
+
return `${names[0]}的聊天记录`;
|
|
15
|
+
if (names.length === 2)
|
|
16
|
+
return `${names[0]}和${names[1]}的聊天记录`;
|
|
17
|
+
if (names.length === 3)
|
|
18
|
+
return `${names[0]}、${names[1]}和${names[2]}的聊天记录`;
|
|
19
|
+
return `${names[0]}、${names[1]}等${names.length}人的聊天记录`;
|
|
20
|
+
}
|
|
21
|
+
export function buildForwardBundlePlainText(items) {
|
|
22
|
+
if (!items.length)
|
|
23
|
+
return '';
|
|
24
|
+
const title = buildForwardBundleTitle(items);
|
|
25
|
+
const lines = items.map((it) => {
|
|
26
|
+
const name = it.senderName.trim() || '未知';
|
|
27
|
+
const body = it.snippet.trim() || '[消息]';
|
|
28
|
+
return `${name}:${body}`;
|
|
29
|
+
});
|
|
30
|
+
return [title, ...lines].join('\n');
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=imForwardBundleTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imForwardBundleTitle.js","sourceRoot":"","sources":["../../../src/functions/im/imForwardBundleTitle.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,uBAAuB,CACrC,KAAwC;IAExC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,KAAK,MAAM,EAAE,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,CAAA;QACpD,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,SAAQ;QACzB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QACX,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACf,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,CAAA;IACrC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;IACjD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;IAC7D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;IACzE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,QAAQ,CAAA;AACxD,CAAC;AAGD,MAAM,UAAU,2BAA2B,CAAC,KAAuC;IACjF,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO,EAAE,CAAA;IAC5B,MAAM,KAAK,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,IAAI,CAAA;QACzC,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,MAAM,CAAA;QACxC,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;IACF,OAAO,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACrC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChatForwardBundleItem, ChatMessage } from '../../../types/im-chat';
|
|
2
|
+
import type { ImMessage } from '../../../types/im-api';
|
|
3
|
+
import { type ImMentionLabelResolver } from './imQuotePreview';
|
|
4
|
+
export type { ImMentionLabelResolver };
|
|
5
|
+
export type BuildForwardSnapshotOptions = {
|
|
6
|
+
resolveMentionLabel?: ImMentionLabelResolver;
|
|
7
|
+
};
|
|
8
|
+
export type ForwardOutboundSnapshot = {
|
|
9
|
+
type: ImMessage['type'];
|
|
10
|
+
content: string;
|
|
11
|
+
extraData?: Record<string, unknown>;
|
|
12
|
+
};
|
|
13
|
+
export declare function chatMessageCanForward(m: ChatMessage): boolean;
|
|
14
|
+
export declare function buildForwardSnapshotFromChatMessage(m: ChatMessage, options?: BuildForwardSnapshotOptions): ForwardOutboundSnapshot | null;
|
|
15
|
+
export declare function orderForwardableMessages(messages: readonly ChatMessage[], orderedIds?: readonly string[]): ChatMessage[];
|
|
16
|
+
export declare function canForwardMessageBatch(messages: readonly ChatMessage[]): boolean;
|
|
17
|
+
export declare function parseForwardBundleFromImRow(type: string, content: string | undefined, extra: Record<string, unknown> | undefined): ChatForwardBundleItem[] | undefined;
|
|
18
|
+
export declare function buildMergedForwardBundleSnapshot(messages: readonly ChatMessage[], orderedIds?: readonly string[], options?: BuildForwardSnapshotOptions): ForwardOutboundSnapshot | null;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { parseForwardBundleFromContent, parseForwardBundleFromImMessage, serializeForwardBundleContent, } from './forwardBundlePayload.js';
|
|
2
|
+
import { isLocalImMessageId } from './imLocalMessageId.js';
|
|
3
|
+
import { chatMessageBlocksImSocialActions } from './chatMessageSocialActions.js';
|
|
4
|
+
import { buildQuoteSnippetFromChatMessage, mergeReplyFieldsIntoForwardExtra, } from './imQuotePreview.js';
|
|
5
|
+
const URL_LIKE = /^https?:\/\/.+/i;
|
|
6
|
+
function isRemoteUrl(url) {
|
|
7
|
+
const u = url?.trim() ?? '';
|
|
8
|
+
return u.length > 0 && URL_LIKE.test(u);
|
|
9
|
+
}
|
|
10
|
+
function mapChatTypeToIm(t) {
|
|
11
|
+
if (t === 'markdown')
|
|
12
|
+
return 'markdown';
|
|
13
|
+
if (t === 'voice')
|
|
14
|
+
return 'audio';
|
|
15
|
+
if (t === 'image' || t === 'file' || t === 'video')
|
|
16
|
+
return t;
|
|
17
|
+
return 'text';
|
|
18
|
+
}
|
|
19
|
+
function buildMediaExtraFromMessage(m) {
|
|
20
|
+
const extra = {};
|
|
21
|
+
const thumb = m.mediaThumbnailUrl?.trim();
|
|
22
|
+
if (thumb && isRemoteUrl(thumb))
|
|
23
|
+
extra.thumbnail_url = thumb;
|
|
24
|
+
if (m.mediaWidth != null)
|
|
25
|
+
extra.media_width = m.mediaWidth;
|
|
26
|
+
if (m.mediaHeight != null)
|
|
27
|
+
extra.media_height = m.mediaHeight;
|
|
28
|
+
const name = m.mediaOriginalFileName?.trim();
|
|
29
|
+
if (name)
|
|
30
|
+
extra.original_file_name = name;
|
|
31
|
+
if (m.mediaFileSizeBytes != null)
|
|
32
|
+
extra.size_bytes = m.mediaFileSizeBytes;
|
|
33
|
+
return extra;
|
|
34
|
+
}
|
|
35
|
+
function sanitizeDisplayBlock(b) {
|
|
36
|
+
const props = { ...b.props };
|
|
37
|
+
if (b.type === 'im.text' || b.type === 'im.markdown') {
|
|
38
|
+
const content = String(props.content ?? '').trim();
|
|
39
|
+
if (!content)
|
|
40
|
+
return null;
|
|
41
|
+
return { type: b.type, props: { content } };
|
|
42
|
+
}
|
|
43
|
+
if (b.type === 'im.image') {
|
|
44
|
+
const thumbnailUrl = String(props.thumbnailUrl ?? '').trim();
|
|
45
|
+
if (!isRemoteUrl(thumbnailUrl))
|
|
46
|
+
return null;
|
|
47
|
+
return {
|
|
48
|
+
type: b.type,
|
|
49
|
+
props: {
|
|
50
|
+
thumbnailUrl,
|
|
51
|
+
...(props.width != null ? { width: props.width } : {}),
|
|
52
|
+
...(props.height != null ? { height: props.height } : {}),
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (b.type === 'im.video') {
|
|
57
|
+
const videoUrl = String(props.videoUrl ?? '').trim();
|
|
58
|
+
if (!isRemoteUrl(videoUrl))
|
|
59
|
+
return null;
|
|
60
|
+
const thumbnailUrl = String(props.thumbnailUrl ?? '').trim();
|
|
61
|
+
return {
|
|
62
|
+
type: b.type,
|
|
63
|
+
props: {
|
|
64
|
+
videoUrl,
|
|
65
|
+
...(isRemoteUrl(thumbnailUrl) ? { thumbnailUrl } : {}),
|
|
66
|
+
...(props.width != null ? { width: props.width } : {}),
|
|
67
|
+
...(props.height != null ? { height: props.height } : {}),
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (b.type === 'im.file') {
|
|
72
|
+
const downloadUrl = String(props.downloadUrl ?? '').trim();
|
|
73
|
+
if (!isRemoteUrl(downloadUrl))
|
|
74
|
+
return null;
|
|
75
|
+
const originalFileName = typeof props.originalFileName === 'string' ? props.originalFileName.trim() : '';
|
|
76
|
+
return {
|
|
77
|
+
type: b.type,
|
|
78
|
+
props: {
|
|
79
|
+
downloadUrl,
|
|
80
|
+
...(originalFileName ? { originalFileName } : {}),
|
|
81
|
+
...(props.fileSizeBytes != null ? { fileSizeBytes: props.fileSizeBytes } : {}),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
function buildSnapshotFromDisplaySpec(spec) {
|
|
88
|
+
if (spec.version !== 2 || !Array.isArray(spec.blocks) || spec.blocks.length === 0) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
const blocks = [];
|
|
92
|
+
for (const raw of spec.blocks) {
|
|
93
|
+
const b = sanitizeDisplayBlock(raw);
|
|
94
|
+
if (b)
|
|
95
|
+
blocks.push(b);
|
|
96
|
+
}
|
|
97
|
+
if (blocks.length === 0)
|
|
98
|
+
return null;
|
|
99
|
+
const textBlock = blocks.find((b) => b.type === 'im.text' || b.type === 'im.markdown');
|
|
100
|
+
const content = textBlock
|
|
101
|
+
? String(textBlock.props.content ?? '').trim()
|
|
102
|
+
: blocks[0].type === 'im.file'
|
|
103
|
+
? String(blocks[0].props.downloadUrl ?? '').trim()
|
|
104
|
+
: blocks[0].type === 'im.image'
|
|
105
|
+
? String(blocks[0].props.thumbnailUrl ?? '').trim()
|
|
106
|
+
: blocks[0].type === 'im.video'
|
|
107
|
+
? String(blocks[0].props.videoUrl ?? '').trim()
|
|
108
|
+
: '';
|
|
109
|
+
if (!content)
|
|
110
|
+
return null;
|
|
111
|
+
const imDisplay = { version: 2, blocks };
|
|
112
|
+
return {
|
|
113
|
+
type: 'text',
|
|
114
|
+
content,
|
|
115
|
+
extraData: { im_display: imDisplay },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export function chatMessageCanForward(m) {
|
|
119
|
+
if (String(m.id).startsWith('ai_stream_'))
|
|
120
|
+
return false;
|
|
121
|
+
if (chatMessageBlocksImSocialActions(m))
|
|
122
|
+
return false;
|
|
123
|
+
return buildForwardSnapshotFromChatMessage(m) != null;
|
|
124
|
+
}
|
|
125
|
+
export function buildForwardSnapshotFromChatMessage(m, options) {
|
|
126
|
+
if (m.displaySpec?.version === 2) {
|
|
127
|
+
const fromDisplay = buildSnapshotFromDisplaySpec(m.displaySpec);
|
|
128
|
+
if (fromDisplay)
|
|
129
|
+
return fromDisplay;
|
|
130
|
+
}
|
|
131
|
+
const inline = (m.inlineAttachments ?? []).filter((a) => isRemoteUrl(a.url));
|
|
132
|
+
if (inline.length > 0) {
|
|
133
|
+
const content = m.content?.replace(/\s+/g, ' ').trim() ?? '';
|
|
134
|
+
if (!content)
|
|
135
|
+
return null;
|
|
136
|
+
return {
|
|
137
|
+
type: 'text',
|
|
138
|
+
content,
|
|
139
|
+
extraData: {
|
|
140
|
+
attachments: inline.map((a) => ({
|
|
141
|
+
url: a.url,
|
|
142
|
+
...(a.name ? { name: a.name } : {}),
|
|
143
|
+
...(a.mimeType ? { mimeType: a.mimeType } : {}),
|
|
144
|
+
})),
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const content = m.content?.trim() ?? '';
|
|
149
|
+
if (m.type === 'text' || m.type === 'markdown') {
|
|
150
|
+
if (!content)
|
|
151
|
+
return null;
|
|
152
|
+
return { type: mapChatTypeToIm(m.type), content };
|
|
153
|
+
}
|
|
154
|
+
if (['image', 'video', 'file', 'voice'].includes(m.type)) {
|
|
155
|
+
if (!isRemoteUrl(content))
|
|
156
|
+
return null;
|
|
157
|
+
const extra = buildMediaExtraFromMessage(m);
|
|
158
|
+
return {
|
|
159
|
+
type: mapChatTypeToIm(m.type),
|
|
160
|
+
content,
|
|
161
|
+
...(Object.keys(extra).length > 0 ? { extraData: extra } : {}),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (m.type === 'forward_bundle') {
|
|
165
|
+
const items = m.forwardBundle;
|
|
166
|
+
if (!items?.length)
|
|
167
|
+
return null;
|
|
168
|
+
const stored = items.map((it) => {
|
|
169
|
+
const rawContent = it.content?.trim() ?? '';
|
|
170
|
+
const rawSnippet = it.snippet.trim() || '[消息]';
|
|
171
|
+
return {
|
|
172
|
+
sender_name: it.senderName.trim() || '未知',
|
|
173
|
+
type: it.type?.trim() || 'text',
|
|
174
|
+
content: rawContent,
|
|
175
|
+
snippet: rawSnippet,
|
|
176
|
+
...(it.messageId?.trim() ? { message_id: it.messageId.trim() } : {}),
|
|
177
|
+
...(it.extraData && Object.keys(it.extraData).length > 0
|
|
178
|
+
? { extra_data: it.extraData }
|
|
179
|
+
: {}),
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
return {
|
|
183
|
+
type: 'forward_bundle',
|
|
184
|
+
content: serializeForwardBundleContent(stored),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
function persistableSourceMessageId(m) {
|
|
190
|
+
const id = String(m.id ?? '').trim();
|
|
191
|
+
if (!id || id.startsWith('ai_stream_'))
|
|
192
|
+
return undefined;
|
|
193
|
+
if (isLocalImMessageId(id))
|
|
194
|
+
return undefined;
|
|
195
|
+
return id;
|
|
196
|
+
}
|
|
197
|
+
function buildForwardBundleStoredItem(m, snapshot, resolveMentionLabel) {
|
|
198
|
+
const messageId = persistableSourceMessageId(m);
|
|
199
|
+
const extraData = mergeReplyFieldsIntoForwardExtra(snapshot.extraData, m, resolveMentionLabel);
|
|
200
|
+
return {
|
|
201
|
+
sender_id: m.sender?.id,
|
|
202
|
+
sender_name: m.sender?.name?.trim() || '未知',
|
|
203
|
+
type: snapshot.type,
|
|
204
|
+
content: snapshot.content,
|
|
205
|
+
snippet: buildQuoteSnippetFromChatMessage(m, resolveMentionLabel),
|
|
206
|
+
...(messageId ? { message_id: messageId } : {}),
|
|
207
|
+
...(extraData ? { extra_data: extraData } : {}),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
export function orderForwardableMessages(messages, orderedIds) {
|
|
211
|
+
const forwardable = messages.filter((m) => chatMessageCanForward(m));
|
|
212
|
+
if (!orderedIds?.length)
|
|
213
|
+
return forwardable;
|
|
214
|
+
const byId = new Map(forwardable.map((m) => [String(m.id), m]));
|
|
215
|
+
const out = [];
|
|
216
|
+
for (const id of orderedIds) {
|
|
217
|
+
const hit = byId.get(String(id));
|
|
218
|
+
if (hit)
|
|
219
|
+
out.push(hit);
|
|
220
|
+
}
|
|
221
|
+
return out;
|
|
222
|
+
}
|
|
223
|
+
export function canForwardMessageBatch(messages) {
|
|
224
|
+
return orderForwardableMessages(messages).length > 0;
|
|
225
|
+
}
|
|
226
|
+
function forwardBundleExtraToChatItems(bundle) {
|
|
227
|
+
return bundle.items.map((it) => ({
|
|
228
|
+
senderName: String(it.sender_name ?? '').trim() || '未知',
|
|
229
|
+
snippet: String(it.snippet ?? '').trim() || '[消息]',
|
|
230
|
+
type: String(it.type ?? '').trim() || undefined,
|
|
231
|
+
content: String(it.content ?? '').trim() || undefined,
|
|
232
|
+
...(it.message_id?.trim() ? { messageId: it.message_id.trim() } : {}),
|
|
233
|
+
...(it.extra_data && Object.keys(it.extra_data).length > 0
|
|
234
|
+
? { extraData: it.extra_data }
|
|
235
|
+
: {}),
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
238
|
+
export function parseForwardBundleFromImRow(type, content, extra) {
|
|
239
|
+
let bundle = parseForwardBundleFromImMessage(type, content, extra);
|
|
240
|
+
if (!bundle) {
|
|
241
|
+
bundle = parseForwardBundleFromContent(content);
|
|
242
|
+
}
|
|
243
|
+
if (!bundle)
|
|
244
|
+
return undefined;
|
|
245
|
+
return forwardBundleExtraToChatItems(bundle);
|
|
246
|
+
}
|
|
247
|
+
export function buildMergedForwardBundleSnapshot(messages, orderedIds, options) {
|
|
248
|
+
const ordered = orderForwardableMessages(messages, orderedIds);
|
|
249
|
+
const resolveMentionLabel = options?.resolveMentionLabel;
|
|
250
|
+
const items = [];
|
|
251
|
+
for (const m of ordered) {
|
|
252
|
+
const snap = buildForwardSnapshotFromChatMessage(m, options);
|
|
253
|
+
if (!snap)
|
|
254
|
+
continue;
|
|
255
|
+
items.push(buildForwardBundleStoredItem(m, snap, resolveMentionLabel));
|
|
256
|
+
}
|
|
257
|
+
if (items.length === 0)
|
|
258
|
+
return null;
|
|
259
|
+
return {
|
|
260
|
+
type: 'forward_bundle',
|
|
261
|
+
content: serializeForwardBundleContent(items),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=imForwardSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imForwardSnapshot.js","sourceRoot":"","sources":["../../../src/functions/im/imForwardSnapshot.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GAEjC,MAAM,kBAAkB,CAAA;AASzB,MAAM,QAAQ,GAAG,iBAAiB,CAAA;AAQlC,SAAS,WAAW,CAAC,GAAuB;IAC1C,MAAM,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAC3B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACzC,CAAC;AAED,SAAS,eAAe,CAAC,CAAsB;IAC7C,IAAI,CAAC,KAAK,UAAU;QAAE,OAAO,UAAU,CAAA;IACvC,IAAI,CAAC,KAAK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Resolver } from './imQuotePreview';
|
|
3
|
+
export type AdaptForwardSnapshotMentionsOptions = {
|
|
4
|
+
allowedUserIds: ReadonlySet<string> | readonly string[];
|
|
5
|
+
resolveMentionLabel?: ImMentionLabelResolver;
|
|
6
|
+
};
|
|
7
|
+
export declare function adaptForwardSnapshotMentions(snapshot: ForwardOutboundSnapshot, options: AdaptForwardSnapshotMentionsOptions): ForwardOutboundSnapshot;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { demoteOutOfScopeMentionsInImRichHtml } from './imRichContentHtml.js';
|
|
2
|
+
import { parseForwardBundleFromContent, serializeForwardBundleContent, } from './forwardBundlePayload.js';
|
|
3
|
+
function demoteRichText(content, options) {
|
|
4
|
+
return demoteOutOfScopeMentionsInImRichHtml(content, {
|
|
5
|
+
allowedUserIds: options.allowedUserIds,
|
|
6
|
+
resolveMentionLabel: options.resolveMentionLabel,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
function demoteImDisplayBlocks(blocks, options) {
|
|
10
|
+
let changed = false;
|
|
11
|
+
const next = blocks.map((block) => {
|
|
12
|
+
if (block.type !== 'im.text' && block.type !== 'im.markdown')
|
|
13
|
+
return block;
|
|
14
|
+
const content = String(block.props.content ?? '');
|
|
15
|
+
const demoted = demoteRichText(content, options);
|
|
16
|
+
if (demoted === content)
|
|
17
|
+
return block;
|
|
18
|
+
changed = true;
|
|
19
|
+
return { ...block, props: { ...block.props, content: demoted } };
|
|
20
|
+
});
|
|
21
|
+
return { blocks: next, changed };
|
|
22
|
+
}
|
|
23
|
+
function demoteExtraData(extra, options) {
|
|
24
|
+
if (!extra || typeof extra !== 'object' || Array.isArray(extra))
|
|
25
|
+
return extra;
|
|
26
|
+
const rawDisplay = extra.im_display;
|
|
27
|
+
if (rawDisplay && typeof rawDisplay === 'object' && !Array.isArray(rawDisplay)) {
|
|
28
|
+
const spec = rawDisplay;
|
|
29
|
+
if (spec.version === 2 && Array.isArray(spec.blocks) && spec.blocks.length > 0) {
|
|
30
|
+
const { blocks, changed } = demoteImDisplayBlocks(spec.blocks, options);
|
|
31
|
+
if (changed) {
|
|
32
|
+
return { ...extra, im_display: { ...spec, blocks } };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return extra;
|
|
37
|
+
}
|
|
38
|
+
function demoteForwardBundleStoredItem(item, options) {
|
|
39
|
+
let content = demoteRichText(item.content, options);
|
|
40
|
+
const snippet = demoteRichText(item.snippet, options);
|
|
41
|
+
if (String(item.type ?? '').trim() === 'forward_bundle') {
|
|
42
|
+
const bundle = parseForwardBundleFromContent(content);
|
|
43
|
+
if (bundle?.items.length) {
|
|
44
|
+
content = serializeForwardBundleContent(bundle.items.map((it) => demoteForwardBundleStoredItem(it, options)));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const extra_data = demoteExtraData(item.extra_data, options);
|
|
48
|
+
const changed = content !== item.content || snippet !== item.snippet || extra_data !== item.extra_data;
|
|
49
|
+
if (!changed)
|
|
50
|
+
return item;
|
|
51
|
+
return {
|
|
52
|
+
...item,
|
|
53
|
+
content,
|
|
54
|
+
snippet,
|
|
55
|
+
...(extra_data !== item.extra_data ? { extra_data } : {}),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function adaptForwardSnapshotMentions(snapshot, options) {
|
|
59
|
+
let content = demoteRichText(snapshot.content, options);
|
|
60
|
+
let extraData = demoteExtraData(snapshot.extraData, options);
|
|
61
|
+
if (String(snapshot.type ?? '').trim() === 'forward_bundle') {
|
|
62
|
+
const bundle = parseForwardBundleFromContent(content);
|
|
63
|
+
if (bundle?.items.length) {
|
|
64
|
+
content = serializeForwardBundleContent(bundle.items.map((it) => demoteForwardBundleStoredItem(it, options)));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (content === snapshot.content && extraData === snapshot.extraData) {
|
|
68
|
+
return snapshot;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
...snapshot,
|
|
72
|
+
content,
|
|
73
|
+
...(extraData !== snapshot.extraData ? { extraData } : {}),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=imForwardSnapshotMentions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imForwardSnapshotMentions.js","sourceRoot":"","sources":["../../../src/functions/im/imForwardSnapshotMentions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAE9B,MAAM,wBAAwB,CAAA;AAU/B,SAAS,cAAc,CACrB,OAAe,EACf,OAA4C;IAE5C,OAAO,oCAAoC,CAAC,OAAO,EAAE;QACnD,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;KACjD,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAiC,EACjC,OAA4C;IAE5C,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa;YAAE,OAAO,KAAK,CAAA;QAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAA;QACjD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAChD,IAAI,OAAO,KAAK,OAAO;YAAE,OAAO,KAAK,CAAA;QACrC,OAAO,GAAG,IAAI,CAAA;QACd,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAA;IAClE,CAAC,CAAC,CAAA;IACF,OAAO,EAAE,MAAM,EAAE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E,OAAO,CAAC,CAAC,CACrE,CAAA;QACH,CAAC;IACH,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,CAAC,OAAO,IAAI,SAAS,KAAK,QAAQ,CAAC,SAAS,EAAE,CAAC;QACrE,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO;QACL,GAAG,QAAQ;QACX,OAAO;QACP,GAAG,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function pickPositiveNumber(v: unknown): number | undefined;
|
|
2
|
+
export declare function imagePixelExtraFromSize(size: {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
} | undefined): Record<string, number> | undefined;
|
|
6
|
+
export declare const IM_VIDEO_POSTER_JPEG_MAX_SIDE = 720;
|
|
7
|
+
export declare const VIDEO_POSTER_JPEG_MAX_SIDE = 720;
|
|
8
|
+
export type ImStandaloneMediaType = 'image' | 'video' | 'file' | 'audio';
|
|
9
|
+
export declare function isImStandaloneMediaType(type: unknown): type is ImStandaloneMediaType;
|
|
10
|
+
export declare function buildImMediaDimensionExtras(messageType: ImStandaloneMediaType, mediaPixelSize?: {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}, videoPosterDataUrl?: string): Record<string, unknown>;
|
|
14
|
+
export declare function imRegisterMediaDimensionPayload(messageType: ImStandaloneMediaType, mediaPixelSize?: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}): {
|
|
18
|
+
imageWidth: number;
|
|
19
|
+
imageHeight: number;
|
|
20
|
+
} | Record<string, never>;
|
|
21
|
+
export declare function readImagePixelSizeFromExtra(extra: Record<string, unknown> | undefined): {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
} | undefined;
|