k2-im 0.2.15 → 0.2.17
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/chat-kit-pinia.d.ts +77 -18
- package/dist/chat-kit-vue.d.ts +7 -5
- package/dist/chat-kit.d.ts +138 -23
- package/dist/index.d.ts +142 -26
- package/dist/modules/api-protocol-client/src/client.js +1 -1
- package/dist/modules/api-protocol-client/src/nonce.js +1 -1
- package/dist/modules/crypto/browser.js +1 -1
- package/dist/modules/crypto/driver.js +1 -1
- package/dist/modules/crypto/vendor/crypto/index_bg.js +1 -1
- package/dist/modules/im-browser/src/http/cm-http-adapter.js +1 -1
- package/dist/modules/im-browser/src/http/request-timeout.js +1 -0
- package/dist/modules/im-browser/src/http/requests/core-json-request.js +1 -1
- package/dist/modules/im-browser/src/http/requests/get-conversation-background-presets.js +1 -1
- package/dist/modules/im-browser/src/http/requests/pull-offline-channel.js +1 -1
- package/dist/modules/im-browser/src/http/session-favorite-http-adapter.js +1 -1
- package/dist/modules/im-browser/src/media/media-download-request.js +1 -0
- package/dist/modules/im-browser/src/media/media-downloader.js +1 -1
- package/dist/modules/im-browser/src/media/media-preview-adapter.js +1 -1
- package/dist/modules/im-browser/src/media/media-preview-preparation-executor.js +1 -1
- package/dist/modules/im-browser/src/media/media-transfer-adapter.js +1 -1
- package/dist/modules/im-browser/src/media/media-transfer-policy.js +1 -1
- package/dist/modules/im-browser/src/media/webp-encoder.js +1 -0
- package/dist/modules/im-browser/src/media/webp-worker-factory.js +1 -0
- package/dist/modules/im-browser/src/network/browser-connection-ownership.js +1 -1
- package/dist/modules/im-browser/src/storage/indexed-db-storage-adapter.js +1 -1
- package/dist/modules/im-chat-kit/src/pinia/composer.store.js +1 -1
- package/dist/modules/im-chat-kit/src/pinia/expression.store.js +1 -1
- package/dist/modules/im-chat-kit/src/runtime/chat-runtime.js +1 -1
- package/dist/modules/im-chat-kit/src/runtime/media-object-url-registry.js +1 -1
- package/dist/modules/im-chat-kit/src/services/media.service.js +1 -1
- package/dist/modules/im-chat-kit/src/utils/emoji/unicode.js +1 -1
- package/dist/modules/im-chat-kit/src/utils/media-transfer-presentation.js +1 -1
- package/dist/modules/im-chat-kit/src/vue/thread/thread-visibility-target-group.js +1 -1
- package/dist/modules/im-chat-kit/src/vue/thread/thread-visibility-targets.js +1 -1
- package/dist/modules/im-core/src/abort.js +1 -1
- package/dist/modules/im-core/src/mapping/group-offline-mapper.js +1 -1
- package/dist/modules/im-core/src/mapping/message-id.js +1 -1
- package/dist/modules/im-core/src/media-thumbnail-policy.js +1 -1
- package/dist/modules/im-core/src/media-thumbnail.js +1 -1
- package/dist/modules/im-core/src/message-flow/media/media-sender.js +1 -1
- package/dist/modules/im-core/src/state/domain-state.js +1 -1
- package/dist/modules/im-sdk/src/create-im-client.js +1 -1
- package/dist/modules/im-sdk/src/product/conversation-handle.js +1 -1
- package/dist/modules/im-sdk/src/product/diagnostic-memory-buffer.js +1 -1
- package/dist/modules/im-sdk/src/product/media.js +1 -1
- package/dist/modules/im-sdk/src/runtime/history-page-size.js +1 -0
- package/dist/modules/im-sdk/src/runtime/local-media-preview.js +1 -1
- package/dist/modules/im-sdk/src/runtime/recent-history-fetcher.js +1 -1
- package/dist/modules/im-sdk/src/runtime/recent-history-prefetch.js +1 -1
- package/dist/modules/im-sdk/src/runtime/session-runtime.js +1 -1
- package/dist/request-crypto.d.ts +3 -2
- package/dist/sdk.d.ts +75 -21
- package/dist/vendor/crypto/index_bg.wasm +0 -0
- package/dist/vendor/webp/LICENSE.jsquash +201 -0
- package/dist/vendor/webp/LICENSE.libwebp +29 -0
- package/dist/vendor/webp/NOTICE +3 -0
- package/dist/webp.worker.js +3 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1981,7 +1981,7 @@ interface ImHttpPort {
|
|
|
1981
1981
|
}
|
|
1982
1982
|
|
|
1983
1983
|
/** 可持久化的媒体资产类型;未注册类型必须跳过缓存,不能回退到其它类型。 */
|
|
1984
|
-
type MediaAssetKind = 'image' | 'video' | 'file';
|
|
1984
|
+
type MediaAssetKind = 'image' | 'image-display' | 'video-poster' | 'video' | 'file';
|
|
1985
1985
|
/** 持久媒体资产的稳定键。resourceVersion 由远端资源标识派生,避免同消息替换资源后误命中旧缓存。 */
|
|
1986
1986
|
interface MediaAssetCacheKey {
|
|
1987
1987
|
kind: MediaAssetKind;
|
|
@@ -2030,7 +2030,10 @@ interface MediaAssetCachePort {
|
|
|
2030
2030
|
get: (key: MediaAssetCacheKey) => Promise<MediaAssetCacheEntry | null>;
|
|
2031
2031
|
/** 按输入顺序检查完整资源是否存在且未过期;不读取 Blob、不延长闲置期限,存储故障必须抛出。 */
|
|
2032
2032
|
hasMany?: (keys: readonly MediaAssetCacheKey[]) => Promise<readonly boolean[]>;
|
|
2033
|
-
|
|
2033
|
+
/** isCurrent 在排队结束和写事务开始前复核;已失效的生成结果返回 skipped,已开始的事务不撤销。 */
|
|
2034
|
+
put: (entry: MediaAssetCacheEntry, options?: {
|
|
2035
|
+
isCurrent?: () => boolean;
|
|
2036
|
+
}) => Promise<'stored' | 'skipped'>;
|
|
2034
2037
|
clear: () => Promise<void>;
|
|
2035
2038
|
/** 删除超过闲置期限的完整持久副本;不撤销已经返回的 Blob 或宿主持有的播放地址。 */
|
|
2036
2039
|
prune?: () => Promise<void>;
|
|
@@ -3079,12 +3082,12 @@ declare function canReactToMessage(message: ReactionParentMessage): boolean;
|
|
|
3079
3082
|
type RecallFailReason = 'not-found' | 'not-own' | 'pinned' | 'not-sent' | 'expired' | 'unsupported' | 'timeout' | 'server-expired' | 'failed' | 'disconnected';
|
|
3080
3083
|
|
|
3081
3084
|
/**
|
|
3082
|
-
* 根据缩略图签名选择 PNG 或 JPEG 的显示类型,供 SDK 和 PC/H5 创建 Blob、data URL。
|
|
3083
|
-
* 输入是消息中的原始字节或纯 base64;旧消息没有独立 MIME
|
|
3085
|
+
* 根据缩略图签名选择 PNG、WebP 或 JPEG 的显示类型,供 SDK 和 PC/H5 创建 Blob、data URL。
|
|
3086
|
+
* 输入是消息中的原始字节或纯 base64;旧消息没有独立 MIME 字段,未知格式沿用 JPEG 解码,
|
|
3084
3087
|
* 损坏数据仍交给图片解码器报告失败。本函数不修改字节,也不将历史 JPEG 转码为 PNG。
|
|
3085
3088
|
* @example resolveMediaThumbnailMimeType(new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10])) // 'image/png'
|
|
3086
3089
|
*/
|
|
3087
|
-
declare function resolveMediaThumbnailMimeType(source: Uint8Array | string): 'image/png' | 'image/jpeg';
|
|
3090
|
+
declare function resolveMediaThumbnailMimeType(source: Uint8Array | string): 'image/png' | 'image/webp' | 'image/jpeg';
|
|
3088
3091
|
|
|
3089
3092
|
/** 浏览器 PushSubscription.toJSON() 的可移植数据;不依赖 DOM 或浏览器全局。 */
|
|
3090
3093
|
interface ImWebPushSubscription {
|
|
@@ -3473,13 +3476,13 @@ interface MediaTransferAdapterConfig {
|
|
|
3473
3476
|
useAccelerateEndpoint?: boolean;
|
|
3474
3477
|
/**
|
|
3475
3478
|
* 统一允许 S3 分片上传和 Range 分段下载,默认 false(单次 PUT / 普通 GET)。
|
|
3476
|
-
* 显式 true
|
|
3479
|
+
* 显式 true 后,上传对象达到 8 MiB 使用 Multipart;上传片长与下载段长均为 16 MiB。
|
|
3477
3480
|
* 开启前各桶须支持分片请求方法,并暴露上传 ETag、下载 Content-Range 与强 ETag。
|
|
3478
3481
|
* @example { multipartTransfer: true } 同时允许大资源分片上传、下载。
|
|
3479
3482
|
*/
|
|
3480
3483
|
multipartTransfer?: boolean;
|
|
3481
3484
|
/**
|
|
3482
|
-
*
|
|
3485
|
+
* 总开关开启后,是否允许达到分片阈值(8 MiB)的上传使用 S3 分片上传。
|
|
3483
3486
|
*
|
|
3484
3487
|
* 分片相比单次 PUT 需要各物理桶的 CORS 额外放行 POST(Create/CompleteMultipartUpload)、
|
|
3485
3488
|
* DELETE(AbortMultipartUpload)并 `ExposeHeaders: ETag`;未配齐时分片会直接失败。
|
|
@@ -3495,8 +3498,8 @@ interface MediaTransferAdapterConfig {
|
|
|
3495
3498
|
/**
|
|
3496
3499
|
* 媒体发送阶段的并发上限;由 im-core 消费,限制媒体任务数而非分片请求数。
|
|
3497
3500
|
*
|
|
3498
|
-
*
|
|
3499
|
-
* 缺省 5
|
|
3501
|
+
* 并发按媒体体积分两档:小于分片阈值(8 MiB)的非视频媒体走小文件档,
|
|
3502
|
+
* 缺省 5;视频与达到阈值(或字节数未知)的内容走大文件档,缺省 3。
|
|
3500
3503
|
* 分档只限制媒体任务数;实际 PUT/UploadPart 另受 adapter 的六路数据请求限制。
|
|
3501
3504
|
* 两档都只接受 1-6 的整数,超出范围由 core 显式报错。
|
|
3502
3505
|
* - 传一个数字:所有媒体共用这一个并发数,与分档前的语义一致。
|
|
@@ -3523,11 +3526,12 @@ interface MediaTransferAdapterConfig {
|
|
|
3523
3526
|
* - `multipart-etag-missing`:分片响应读不到 ETag,**桶 CORS 缺 `ExposeHeaders: ETag`**,不是网络问题。
|
|
3524
3527
|
* - `multipart-abort-failed`:分片失败后的 `AbortMultipartUpload` 清理本身失败,已上传分片可能残留并计费。
|
|
3525
3528
|
* - `multipart-upload-failed`:分片上传因其它原因失败;`cause` 保留原始错误,消息列出分片对 CORS 的额外要求。
|
|
3529
|
+
* - `download-timeout`:下载连续 30 秒无新数据,或单次 GET 超过 30 分钟。
|
|
3526
3530
|
* - `download-range-invalid`:分段状态、范围、长度或可读响应头不符合合同。
|
|
3527
3531
|
* - `download-object-changed`:分段之间的强 ETag 或总长度改变,拒绝混合不同文件版本。
|
|
3528
3532
|
* - `download-range-failed`:下载返回非成功 HTTP 状态。
|
|
3529
3533
|
*/
|
|
3530
|
-
type MediaTransferErrorCode = 'upload-timeout' | 'bucket-unconfigured' | 'credentials-provider-missing' | 'credentials-request-failed' | 'credentials-invalid' | 'upload-source-invalid' | 'upload-size-exceeded' | 'upload-resume-unavailable' | 'multipart-etag-missing' | 'multipart-abort-failed' | 'multipart-upload-failed' | 'download-range-invalid' | 'download-object-changed' | 'download-range-failed';
|
|
3534
|
+
type MediaTransferErrorCode = 'upload-timeout' | 'bucket-unconfigured' | 'credentials-provider-missing' | 'credentials-request-failed' | 'credentials-invalid' | 'upload-source-invalid' | 'upload-size-exceeded' | 'upload-resume-unavailable' | 'multipart-etag-missing' | 'multipart-abort-failed' | 'multipart-upload-failed' | 'download-timeout' | 'download-range-invalid' | 'download-object-changed' | 'download-range-failed';
|
|
3531
3535
|
/** 媒体传输统一错误:携带稳定业务码 + 可选底层 cause(诊断用,永不携带凭证明文)。 */
|
|
3532
3536
|
declare class MediaTransferError extends Error {
|
|
3533
3537
|
readonly code: MediaTransferErrorCode;
|
|
@@ -4000,13 +4004,13 @@ interface MediaAlbumMessageOptions {
|
|
|
4000
4004
|
* 本地视频的固有尺寸、时长与首帧封面。
|
|
4001
4005
|
*
|
|
4002
4006
|
* @remarks 宿主可从本地 object URL 解码首个可展示帧,使上传占位从首次渲染就使用真实比例和主图。
|
|
4003
|
-
* `posterData`
|
|
4007
|
+
* `posterData` 是等比缩放后的静态 WebP(兼容已有 JPEG/PNG);存在时会作为消息 `thumbData` 随正文发送。宽高必须是有限正数,
|
|
4004
4008
|
* duration 存在时必须是有限正数,posterData 必须是非空且不超过共享单项消息容量的 Uint8Array;合集发送会按项数复核容量。
|
|
4005
4009
|
*/
|
|
4006
4010
|
interface VideoPreviewMetadata extends ImagePreviewMetadata {
|
|
4007
4011
|
/** 秒。 */
|
|
4008
4012
|
duration?: number;
|
|
4009
|
-
/** 本地首个可展示帧生成的
|
|
4013
|
+
/** 本地首个可展示帧生成的 WebP 或已有 JPEG/PNG 字节。 */
|
|
4010
4014
|
posterData?: Uint8Array;
|
|
4011
4015
|
}
|
|
4012
4016
|
/**
|
|
@@ -6080,6 +6084,17 @@ interface ImMessageRef {
|
|
|
6080
6084
|
*/
|
|
6081
6085
|
itemIndex?: number;
|
|
6082
6086
|
}
|
|
6087
|
+
/** 单次媒体下载的等待与调度选项;相同精确消息引用仍共用一次实际下载。 */
|
|
6088
|
+
interface ImMediaDownloadOptions {
|
|
6089
|
+
/**
|
|
6090
|
+
* 只取消本次调用;其它调用者仍需要结果时保留共享下载。
|
|
6091
|
+
* 最后一个可取消调用者退出且没有无 signal 调用者时,才中止底层任务。
|
|
6092
|
+
* 取消以 IM_SDK_MEDIA_DOWNLOAD_CANCELED 拒绝本次 Promise,不返回部分文件。
|
|
6093
|
+
*/
|
|
6094
|
+
signal?: AbortSignal;
|
|
6095
|
+
/** 默认 interactive;background 在空闲名额中排在交互下载之后,不能抢占已发请求。 */
|
|
6096
|
+
priority?: 'background' | 'interactive';
|
|
6097
|
+
}
|
|
6083
6098
|
/**
|
|
6084
6099
|
* 可观察媒体上传/下载任务的只读产品投影。
|
|
6085
6100
|
*
|
|
@@ -6178,7 +6193,8 @@ interface ImMediaTasksApi {
|
|
|
6178
6193
|
*/
|
|
6179
6194
|
subscribe: (listener: (tasks: readonly ImMediaTask[]) => void) => () => void;
|
|
6180
6195
|
/**
|
|
6181
|
-
* 取消 queued/running 任务;上传委托 core
|
|
6196
|
+
* 取消 queued/running 任务;上传委托 core,下载中止共享任务并取消所有调用者。
|
|
6197
|
+
* 只需结束某次下载等待时,应使用 download 的 signal。
|
|
6182
6198
|
* @throws 未知任务、非法状态或底层未受理时以稳定 `IM_SDK_MEDIA_TASK_*` 错误拒绝。
|
|
6183
6199
|
*/
|
|
6184
6200
|
cancel: (taskId: string, options?: {
|
|
@@ -6213,10 +6229,13 @@ interface ImMediaTasksApi {
|
|
|
6213
6229
|
restartDownload?: boolean;
|
|
6214
6230
|
}) => Promise<void>;
|
|
6215
6231
|
/**
|
|
6216
|
-
*
|
|
6232
|
+
* 下载并按消息正文合同解密,同一精确消息引用共用实际下载,成功返回 Blob。
|
|
6233
|
+
* 不带 signal 的并发调用保留共享 Promise;带 signal 的调用独立等待和取消,不影响其它调用者。
|
|
6234
|
+
* 后加入的交互调用会提高共享下载优先级;prioritizeDownload 指定的最近预览仍优先于其它任务。
|
|
6217
6235
|
* @throws 消息不存在/非媒体/无远端 URL/未装配 capability、传输失败、取消或 teardown 均以稳定错误拒绝,不返回空 Blob。
|
|
6236
|
+
* @example const blob = await client.media.download(messageRef, { signal: controller.signal, priority: 'background' })
|
|
6218
6237
|
*/
|
|
6219
|
-
download: (message: ImMessageRef) => Promise<Blob>;
|
|
6238
|
+
download: (message: ImMessageRef, options?: ImMediaDownloadOptions) => Promise<Blob>;
|
|
6220
6239
|
/**
|
|
6221
6240
|
* 将最近预览的精确媒体项设为最高下载优先级,不新建或取消任务。
|
|
6222
6241
|
* 下一空闲任务/分片请求名额优先给该项;已发请求不中断,关闭播放器不撤销优先级。
|
|
@@ -6232,7 +6251,7 @@ interface ImMediaTasksApi {
|
|
|
6232
6251
|
*/
|
|
6233
6252
|
getCached: (message: ImMessageRef) => Promise<Blob | null>;
|
|
6234
6253
|
/**
|
|
6235
|
-
* 为宿主手里的**本地**图片/视频文件预读展示元信息:尺寸、视频时长、视频首帧封面的
|
|
6254
|
+
* 为宿主手里的**本地**图片/视频文件预读展示元信息:尺寸、视频时长、视频首帧封面的 WebP 字节。
|
|
6236
6255
|
*
|
|
6237
6256
|
* 给「发送前预览」这类场景用:宿主要在用户还没点发送时就把缩略图画出来,而浏览器读不出视频的
|
|
6238
6257
|
* 首帧——`<video preload="metadata">` 在 iOS Safari 上只加载元信息、**不解码任何一帧**,
|
|
@@ -6240,7 +6259,7 @@ interface ImMediaTasksApi {
|
|
|
6240
6259
|
*
|
|
6241
6260
|
* 返回的对象可以**原样**作为 `localPreviewMetadata` 交给 `sendImage` / `sendVideo` /
|
|
6242
6261
|
* `sendMediaAlbum`:发送链路会复用可用元信息;合集项超出其可用消息空间时重新生成封面。
|
|
6243
|
-
* posterData 使用共享自适应发送规格(视频
|
|
6262
|
+
* posterData 使用共享自适应发送规格(视频 WebP,长边最多 1440px,目标 16 KiB、硬上限 32 KiB);includeDisplayPoster 可在同一次解码中额外生成
|
|
6244
6263
|
* 仅供页面显示的高清 displayPoster(长边最多 960),不得绕过发送校验直接用它替换 posterData。
|
|
6245
6264
|
*
|
|
6246
6265
|
* @param input.kind 按文件类型选解码路径;`'video'` 才会抽首帧与读时长。
|
|
@@ -6260,16 +6279,26 @@ interface ImMediaTasksApi {
|
|
|
6260
6279
|
includeDisplayPoster?: boolean;
|
|
6261
6280
|
}) => Promise<(TKind extends 'video' ? LocalVideoPreviewMetadata : ImagePreviewMetadata) | null>;
|
|
6262
6281
|
/**
|
|
6263
|
-
*
|
|
6282
|
+
* 从本地视频或已有截图生成气泡封面;传入消息身份时复用独立持久缓存,不下载或上传。
|
|
6264
6283
|
*
|
|
6265
6284
|
* 长边最多 960px 且不放大原视频;与发送预读共用同一解码执行器。返回 Blob 由宿主创建和释放
|
|
6266
6285
|
* object URL,不能作为 localPreviewMetadata 发进消息正文。读取失败返回 null 并记录诊断;
|
|
6267
6286
|
* 宿主取消抛 AbortError,运行时失效或未装配能力时抛与 prepareLocalPreview 相同的明确错误。
|
|
6268
|
-
* @param input.file 本地或已解密的完整视频 Blob
|
|
6287
|
+
* @param input.file 本地或已解密的完整视频 Blob;已有 poster 时可以不传。
|
|
6288
|
+
* @param input.poster 发送前已经提取的截图,避免重新加载视频抽帧。
|
|
6289
|
+
* @param input.message 可选消息身份,用于持久保存封面。
|
|
6290
|
+
* @param input.expectedResourceUrl 取得源文件前的资源地址,防止换图后的旧结果污染缓存。
|
|
6269
6291
|
* @param input.signal 页面卸载、换源或切会话时取消这次抽帧。
|
|
6270
6292
|
*/
|
|
6271
6293
|
prepareLocalVideoPoster: (input: {
|
|
6272
|
-
file
|
|
6294
|
+
file?: Blob;
|
|
6295
|
+
poster?: Blob;
|
|
6296
|
+
message?: ImMessageRef;
|
|
6297
|
+
expectedResourceUrl?: string;
|
|
6298
|
+
signal?: AbortSignal;
|
|
6299
|
+
}) => Promise<Blob | null>;
|
|
6300
|
+
/** 只读视频气泡封面缓存;不下载、不抽帧,未命中返回 null。 */
|
|
6301
|
+
getCachedVideoPoster: (message: ImMessageRef, options?: {
|
|
6273
6302
|
signal?: AbortSignal;
|
|
6274
6303
|
}) => Promise<Blob | null>;
|
|
6275
6304
|
/**
|
|
@@ -6285,6 +6314,34 @@ interface ImMediaTasksApi {
|
|
|
6285
6314
|
file: Blob;
|
|
6286
6315
|
signal?: AbortSignal;
|
|
6287
6316
|
}) => Promise<Blob | null>;
|
|
6317
|
+
/**
|
|
6318
|
+
* 从本机原图生成独立的静态显示图,供 PC/H5 气泡使用;不下载、不上传、不改原图与消息尺寸。
|
|
6319
|
+
* 传入消息引用时先查独立的显示图缓存;稳定远端资源的结果可持久保存,本地待上传资源只生成。
|
|
6320
|
+
* 所有浏览器可解码格式均处理;最长边不超过 maxSize 且不放大,透明图优先保留透明度。
|
|
6321
|
+
* WebP 质量 0.85,最低 0.82,目标 256 KiB、最多 512 KiB;超过字节预算时可继续缩小,失败返回 null 并记录诊断。
|
|
6322
|
+
* 取消、账号失效、能力缺失和非法参数明确拒绝;返回 Blob 的 object URL 由宿主管理。
|
|
6323
|
+
* @param input.file 原始或已解密的完整图片 Blob,不会被修改。
|
|
6324
|
+
* @param input.maxSize 显示图最长边上限,必须是 1 到 2048 的整数。
|
|
6325
|
+
* @param input.signal 页面退出、资源失效时取消准备。
|
|
6326
|
+
* @param input.message 可选的精确消息引用,用于按消息、合集项、资源版本和尺寸隔离显示图缓存。
|
|
6327
|
+
* @param input.expectedResourceUrl 取得 file 前记录的消息资源地址;与 message 配合使用,不匹配时返回 null,防止旧文件写入新资源缓存。
|
|
6328
|
+
* @example const display = await client.media.prepareLocalImageDisplay({ file: original, maxSize: 1440 })
|
|
6329
|
+
*/
|
|
6330
|
+
prepareLocalImageDisplay: (input: {
|
|
6331
|
+
file: Blob;
|
|
6332
|
+
maxSize: number;
|
|
6333
|
+
message?: ImMessageRef;
|
|
6334
|
+
expectedResourceUrl?: string;
|
|
6335
|
+
signal?: AbortSignal;
|
|
6336
|
+
}) => Promise<Blob | null>;
|
|
6337
|
+
/**
|
|
6338
|
+
* 仅读取指定消息和尺寸的持久显示图,不下载原图、不编码;未命中或读取期间资源失效返回 null。
|
|
6339
|
+
* maxSize 必须是 1 到 2048 的整数;取消、账号失效、存储读取失败明确拒绝。
|
|
6340
|
+
*/
|
|
6341
|
+
getCachedImageDisplay: (message: ImMessageRef, options: {
|
|
6342
|
+
maxSize: number;
|
|
6343
|
+
signal?: AbortSignal;
|
|
6344
|
+
}) => Promise<Blob | null>;
|
|
6288
6345
|
}
|
|
6289
6346
|
|
|
6290
6347
|
/**
|
|
@@ -6988,7 +7045,7 @@ declare function resolveImEmojiToken(token: string): ImEmojiCatalogEntry | undef
|
|
|
6988
7045
|
* 1 小时、按服务端过期时间提前 5 分钟失效)、同桶并发请求复用和失败后重新签发由 SDK 负责,宿主只需提供「打一次接口」的纯函数。
|
|
6989
7046
|
*
|
|
6990
7047
|
* 默认单次 PUT/GET;仅 multipartTransfer=true 才允许大资源分片上传、下载。
|
|
6991
|
-
* 各 bucket 需在对象存储侧配置 CORS 允许本站 origin 的 PUT + GET
|
|
7048
|
+
* 各 bucket 需在对象存储侧配置 CORS 允许本站 origin 的 PUT + GET;开启分片后,达到 8 MiB 的上传另需放行
|
|
6992
7049
|
* POST(Create/CompleteMultipartUpload)、DELETE(AbortMultipartUpload)并 ExposeHeaders: ETag。CORS 未配齐时
|
|
6993
7050
|
* 下载还需暴露 Content-Range 与强 ETag;multipartTransfer=false 统一关闭分片上传和下载。
|
|
6994
7051
|
* ⚠ 并发字段只由 SDK core 的媒体编排消费;adapter 会忽略该字段。高内存设备可设置 5-6,低内存设备建议 2-3。
|
|
@@ -7676,7 +7733,7 @@ interface ImResourceUploadResult {
|
|
|
7676
7733
|
/** 独立资源上传器;不创建消息、Outbox 项或 client.media 任务。 */
|
|
7677
7734
|
interface ImResourceUploader {
|
|
7678
7735
|
/**
|
|
7679
|
-
* 上传原始文件。默认单次 PUT;multipartTransfer=true 且
|
|
7736
|
+
* 上传原始文件。默认单次 PUT;multipartTransfer=true 且 ≥8 MiB 才允许分片,沿用既有凭证刷新策略。
|
|
7680
7737
|
* 失败会清理未完成分片并保留错误,显式重试须再次调用 upload;不会退回旧 HTTP 上传接口。
|
|
7681
7738
|
* @throws 取消为 AbortError;若取消后的分片清理失败,仍报告 multipart-abort-failed。
|
|
7682
7739
|
* 配置、凭证、S3 或清理失败直接拒绝;dispose 后不可再使用。
|
|
@@ -8958,6 +9015,8 @@ interface ChatMediaMessageRef {
|
|
|
8958
9015
|
* 后绑定的一格把先绑定的挤掉并撤销其地址。单媒体消息不传这个字段。
|
|
8959
9016
|
*/
|
|
8960
9017
|
itemIndex?: number;
|
|
9018
|
+
/** 查询时校验当前正文资源地址;不匹配即未命中,不根据页面历史推断租约身份。 */
|
|
9019
|
+
resourceUrl?: string;
|
|
8961
9020
|
}
|
|
8962
9021
|
/**
|
|
8963
9022
|
* Chat Kit 提供给共享 Store 和业务 Service 的账号运行接口。
|
|
@@ -9150,8 +9209,9 @@ interface ChatRuntime {
|
|
|
9150
9209
|
* 媒体上传成功并获得远端资源后,结束本地预览的“上传源”职责。
|
|
9151
9210
|
*
|
|
9152
9211
|
* 图片和视频保留为可淘汰本地缓存,使发送者短时间内查看无需重新下载;GIF 直接释放。
|
|
9212
|
+
* resourceUrl 指定上传完成后的正文地址,用于绑定源文件身份;后续换地址会移除旧缓存。
|
|
9153
9213
|
*/
|
|
9154
|
-
resolveMediaPreviewToRemote: (ref: ChatMediaMessageRef, contentType: 'image' | 'video' | 'sticker', byteSize?: number) => void;
|
|
9214
|
+
resolveMediaPreviewToRemote: (ref: ChatMediaMessageRef, contentType: 'image' | 'video' | 'sticker', byteSize?: number, resourceUrl?: string) => void;
|
|
9155
9215
|
/** 为指定消息取得本地媒体播放租约;没有本地缓存时返回 `undefined`,调用方应改用远端资源。 */
|
|
9156
9216
|
acquireMediaBlob: (ref: ChatMediaMessageRef) => MediaObjectUrlLease | undefined;
|
|
9157
9217
|
/** 只读检查完整本地媒体是否可用,不取得租约、不改变缓存淘汰顺序。 */
|
|
@@ -9540,6 +9600,38 @@ type GifFileClassification = 'gif' | 'not-gif' | 'invalid-gif';
|
|
|
9540
9600
|
declare function classifyGifFile(file: Blob): Promise<GifFileClassification>;
|
|
9541
9601
|
declare function isGifFile(file: Blob): Promise<boolean>;
|
|
9542
9602
|
|
|
9603
|
+
/** 气泡显示图的像素规格;两端共用,完整原图和消息内嵌缩略图不使用此预算。 */
|
|
9604
|
+
declare function resolveImageDisplayMaxSize(message: ImMessageView, itemIndex?: number): number;
|
|
9605
|
+
/**
|
|
9606
|
+
* 从借用的本机原图生成独立气泡地址。不会撤销输入 URL,也不会触发远端下载。
|
|
9607
|
+
* identity 让 SDK 按完整资源身份复用持久显示缓存;调用方负责撤销返回的 URL。
|
|
9608
|
+
* 预览必须继续使用原图,不能使用此方法的返回值。
|
|
9609
|
+
*/
|
|
9610
|
+
declare function prepareImageDisplayObjectUrl(runtime: ChatRuntime, url: string, maxSize: number, signal?: AbortSignal, identity?: {
|
|
9611
|
+
message: ImMessageView;
|
|
9612
|
+
itemIndex?: number;
|
|
9613
|
+
}): Promise<string | null>;
|
|
9614
|
+
/**
|
|
9615
|
+
* 气泡优先读持久显示图;未命中才用已缓存的原图生成,不发起网络下载。
|
|
9616
|
+
* 仅产生一个由调用方拥有的显示 URL,整个过程不创建或持有原图 URL。
|
|
9617
|
+
*/
|
|
9618
|
+
declare function loadCachedImageDisplayObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex?: number, signal?: AbortSignal): Promise<string | null>;
|
|
9619
|
+
/**
|
|
9620
|
+
* 自动加载气泡显示图:优先恢复派生缓存或本机原图,均未命中才下载。
|
|
9621
|
+
* 原图地址只在生成期间持有并始终释放;返回的独立显示地址归宿主。
|
|
9622
|
+
* 显示缓存命中即可满足气泡,完整原件已被淘汰时留待用户预览再下载。
|
|
9623
|
+
*/
|
|
9624
|
+
declare function loadImageDisplayObjectUrl(runtime: ChatRuntime, message: ImMessageView, hooks: ServiceNoteHooks, options: ImMediaDownloadOptions, itemIndex?: number): Promise<string | null>;
|
|
9625
|
+
/**
|
|
9626
|
+
* 借用本机视频地址或发送前截图生成气泡封面,优先命中持久缓存。
|
|
9627
|
+
* 不触发远端下载;输入地址仍归调用方,返回的封面地址由调用方释放。
|
|
9628
|
+
*/
|
|
9629
|
+
declare function prepareVideoPosterObjectUrl(runtime: ChatRuntime, url: string, signal?: AbortSignal, identity?: {
|
|
9630
|
+
message: ImMessageView;
|
|
9631
|
+
itemIndex?: number;
|
|
9632
|
+
}, poster?: Blob): Promise<string | null>;
|
|
9633
|
+
/** 只恢复本机视频封面:先读派生缓存,未命中才读完整视频并抽帧;不触发视频下载。 */
|
|
9634
|
+
declare function loadCachedVideoPosterObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex?: number, signal?: AbortSignal): Promise<string | null>;
|
|
9543
9635
|
/**
|
|
9544
9636
|
* 将用户最后预览的媒体项交给 SDK 提高下载优先级,不创建任务或持有页面资源。
|
|
9545
9637
|
* 在异步查缓存、加载 URL 之前调用,重复打开已有下载也会更新优先级。
|
|
@@ -9613,8 +9705,14 @@ declare function loadCachedVideoObjectUrl(runtime: ChatRuntime, message: ImMessa
|
|
|
9613
9705
|
* 返回 `null` 表示下标越界、正文不是合集、内容非法或下载失败,失败原因经 `setNote` 反馈。
|
|
9614
9706
|
* **唯一不反馈的失败是用户自己取消**(点击停止按钮取消这一项的在途下载):同样返回 `null`,但不提示。
|
|
9615
9707
|
* **调用方在不再使用地址时必须 `URL.revokeObjectURL`。**
|
|
9708
|
+
* @param runtime 当前账号的运行时,用于访问 SDK 并阻止切账号后交付旧资源。
|
|
9709
|
+
* @param message 包含媒体合集正文与精确会话身份的消息。
|
|
9710
|
+
* @param itemIndex 要下载的合集项下标,从 0 开始。
|
|
9711
|
+
* @param hooks 失败文案及提示入口;取消不提示失败。
|
|
9712
|
+
* @param onProgress 可选的当前项下载进度回调,范围为 0–100。
|
|
9713
|
+
* @param options 可选的下载优先级与本次调用取消信号;取消不影响同一资源的其它消费者,也不交付迟到的地址。
|
|
9616
9714
|
*/
|
|
9617
|
-
declare function loadMediaAlbumItemObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex: number, hooks: ServiceNoteHooks, onProgress?: (percent: number) => void): Promise<string | null>;
|
|
9715
|
+
declare function loadMediaAlbumItemObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex: number, hooks: ServiceNoteHooks, onProgress?: (percent: number) => void, options?: ImMediaDownloadOptions): Promise<string | null>;
|
|
9618
9716
|
/**
|
|
9619
9717
|
* 只读取合集某一项已持久化的明文资产并创建 object URL。
|
|
9620
9718
|
*
|
|
@@ -9628,8 +9726,12 @@ declare function loadCachedMediaAlbumItemObjectUrl(runtime: ChatRuntime, message
|
|
|
9628
9726
|
*
|
|
9629
9727
|
* 解密结果不是已支持图片、内容为空或下载失败时返回 `null` 并显示明确提示,不把无效二进制交给
|
|
9630
9728
|
* `<img>`。调用方关闭大图后必须撤销成功返回的地址。
|
|
9729
|
+
* @param runtime 当前账号的运行时,用于访问 SDK 并阻止切账号后交付旧资源。
|
|
9730
|
+
* @param message 包含原图正文与精确会话身份的消息。
|
|
9731
|
+
* @param hooks 失败文案及提示入口;取消不提示失败。
|
|
9732
|
+
* @param options 可选的下载优先级与本次调用取消信号;取消只结束本次等待并返回 null,不提示失败。
|
|
9631
9733
|
*/
|
|
9632
|
-
declare function loadImageObjectUrl(runtime: ChatRuntime, message: ImMessageView, hooks: ServiceNoteHooks): Promise<string | null>;
|
|
9734
|
+
declare function loadImageObjectUrl(runtime: ChatRuntime, message: ImMessageView, hooks: ServiceNoteHooks, options?: ImMediaDownloadOptions): Promise<string | null>;
|
|
9633
9735
|
/**
|
|
9634
9736
|
* 仅读取 SDK 已持久化的图片明文资产并创建 object URL。
|
|
9635
9737
|
*
|
|
@@ -9647,31 +9749,43 @@ declare function loadFileObjectUrl(runtime: ChatRuntime, message: ImMessageView,
|
|
|
9647
9749
|
declare const media_service_acquireMediaBlob: typeof acquireMediaBlob;
|
|
9648
9750
|
declare const media_service_detectImageMime: typeof detectImageMime;
|
|
9649
9751
|
declare const media_service_detectVideoMime: typeof detectVideoMime;
|
|
9752
|
+
declare const media_service_loadCachedImageDisplayObjectUrl: typeof loadCachedImageDisplayObjectUrl;
|
|
9650
9753
|
declare const media_service_loadCachedImageObjectUrl: typeof loadCachedImageObjectUrl;
|
|
9651
9754
|
declare const media_service_loadCachedMediaAlbumItemObjectUrl: typeof loadCachedMediaAlbumItemObjectUrl;
|
|
9652
9755
|
declare const media_service_loadCachedVideoObjectUrl: typeof loadCachedVideoObjectUrl;
|
|
9756
|
+
declare const media_service_loadCachedVideoPosterObjectUrl: typeof loadCachedVideoPosterObjectUrl;
|
|
9653
9757
|
declare const media_service_loadFileObjectUrl: typeof loadFileObjectUrl;
|
|
9758
|
+
declare const media_service_loadImageDisplayObjectUrl: typeof loadImageDisplayObjectUrl;
|
|
9654
9759
|
declare const media_service_loadImageObjectUrl: typeof loadImageObjectUrl;
|
|
9655
9760
|
declare const media_service_loadMediaAlbumItemObjectUrl: typeof loadMediaAlbumItemObjectUrl;
|
|
9656
9761
|
declare const media_service_loadVideoObjectUrl: typeof loadVideoObjectUrl;
|
|
9657
9762
|
declare const media_service_loadVoiceBytes: typeof loadVoiceBytes;
|
|
9763
|
+
declare const media_service_prepareImageDisplayObjectUrl: typeof prepareImageDisplayObjectUrl;
|
|
9658
9764
|
declare const media_service_prepareLocalMediaPreview: typeof prepareLocalMediaPreview;
|
|
9765
|
+
declare const media_service_prepareVideoPosterObjectUrl: typeof prepareVideoPosterObjectUrl;
|
|
9659
9766
|
declare const media_service_prioritizeMediaDownload: typeof prioritizeMediaDownload;
|
|
9767
|
+
declare const media_service_resolveImageDisplayMaxSize: typeof resolveImageDisplayMaxSize;
|
|
9660
9768
|
declare namespace media_service {
|
|
9661
9769
|
export {
|
|
9662
9770
|
media_service_acquireMediaBlob as acquireMediaBlob,
|
|
9663
9771
|
media_service_detectImageMime as detectImageMime,
|
|
9664
9772
|
media_service_detectVideoMime as detectVideoMime,
|
|
9773
|
+
media_service_loadCachedImageDisplayObjectUrl as loadCachedImageDisplayObjectUrl,
|
|
9665
9774
|
media_service_loadCachedImageObjectUrl as loadCachedImageObjectUrl,
|
|
9666
9775
|
media_service_loadCachedMediaAlbumItemObjectUrl as loadCachedMediaAlbumItemObjectUrl,
|
|
9667
9776
|
media_service_loadCachedVideoObjectUrl as loadCachedVideoObjectUrl,
|
|
9777
|
+
media_service_loadCachedVideoPosterObjectUrl as loadCachedVideoPosterObjectUrl,
|
|
9668
9778
|
media_service_loadFileObjectUrl as loadFileObjectUrl,
|
|
9779
|
+
media_service_loadImageDisplayObjectUrl as loadImageDisplayObjectUrl,
|
|
9669
9780
|
media_service_loadImageObjectUrl as loadImageObjectUrl,
|
|
9670
9781
|
media_service_loadMediaAlbumItemObjectUrl as loadMediaAlbumItemObjectUrl,
|
|
9671
9782
|
media_service_loadVideoObjectUrl as loadVideoObjectUrl,
|
|
9672
9783
|
media_service_loadVoiceBytes as loadVoiceBytes,
|
|
9784
|
+
media_service_prepareImageDisplayObjectUrl as prepareImageDisplayObjectUrl,
|
|
9673
9785
|
media_service_prepareLocalMediaPreview as prepareLocalMediaPreview,
|
|
9786
|
+
media_service_prepareVideoPosterObjectUrl as prepareVideoPosterObjectUrl,
|
|
9674
9787
|
media_service_prioritizeMediaDownload as prioritizeMediaDownload,
|
|
9788
|
+
media_service_resolveImageDisplayMaxSize as resolveImageDisplayMaxSize,
|
|
9675
9789
|
};
|
|
9676
9790
|
}
|
|
9677
9791
|
|
|
@@ -10888,6 +11002,8 @@ declare function resolveMediaTransferPresentation(input: {
|
|
|
10888
11002
|
aggregateFrom?: number;
|
|
10889
11003
|
/** 宿主确实持有的完整本地资源;单条媒体以 undefined 表示,缩略图不属于完整资源。 */
|
|
10890
11004
|
availableItemIndices?: readonly (number | undefined)[];
|
|
11005
|
+
/** 仅气泡传入:已有清晰显示图或完整本机资源的项不显示下载胶囊;不能用作预览可用性证据。 */
|
|
11006
|
+
displayAvailableItemIndices?: readonly (number | undefined)[];
|
|
10891
11007
|
/** SDK 明确查到完整缓存已不存在;历史 completed 任务不能替代当前资源证据。 */
|
|
10892
11008
|
unavailableItemIndices?: readonly (number | undefined)[];
|
|
10893
11009
|
/** 当前窗口正在查询的媒体项,不表示未下载。 */
|
|
@@ -10996,4 +11112,4 @@ declare function resampleWaveform(data: readonly number[], targetCount: number):
|
|
|
10996
11112
|
declare function placeholderWaveform(seed: string, count: number): number[];
|
|
10997
11113
|
|
|
10998
11114
|
export { DEFAULT_EMOJI_ASSET_BASE, DEFAULT_LOADING_MINIMUM_VISIBLE_MS, DEFAULT_LOADING_SHOW_DELAY_MS, DEFAULT_LOCALE, EDIT_WINDOW_MS, EMOJI_CATALOG, EMOJI_GAME_DICE_STABLE_KEY, EMOJI_GAME_RPS_STABLE_KEY, EMOJI_TOKEN_RE, IMAGE_MESSAGE_ACCEPT, IM_CHAT_FONT_SCALES, IM_DIAGNOSTIC_CATEGORIES, IM_EMOJI_CATALOG, ImPinnedMessageOperationError, MAX_BATCH_FILES, MAX_RECENT_EMOJI_COUNT, MEDIA_ALBUM_CAPTION_MAX_LENGTH, MEDIA_ALBUM_MAX_ITEMS, MINI_PROGRAM_GAME_PREVIEW_FALLBACK_HEIGHT, MINI_PROGRAM_GAME_PREVIEW_FALLBACK_WIDTH, MINI_PROGRAM_LANG_NUMBERS, MediaTransferError, REACTION_SUPPORTED_CONTENT_TYPES, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, buildSessionFavoritePlainBody, calculateMediaBox, canCopyMessageImage, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canReactToMessage, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, channelMiniProgramRelKey, classifyGifFile, classifyMediaFile, classifyStickerImageType, countUnreadConversations, createChatRuntime, createConversationPrefetchController, createDelayedLoadingIndicator, createEmojiMatcher, createFaceToFaceGroupQrPayload, createImClient, createImConsoleDiagnosticSink, createImDiagnosticMemoryBuffer, createImI18n, createImResourceUploader, createImTextSearchMatcher, createLinkMatcher, createMessageImageCopySource, createNewMessageBadgeController, createSdkDiagnosticWriter, createThreadItems, createVoicePlayer, createVoiceRecordingSession, csvIncludes, decideChannelMiniProgramRelOpen, decideConversationAction, decideMemberTargetAction, decideMessageAction, detectVoiceCapabilities, emojiAssetUrl, emojiUrlByCode, extractSearchText, fetchConversationFileBatch, fetchConversationImageBatch, fetchConversationMessageBatch, fetchConversationVideoBatch, fetchConversationVoiceBatch, fetchNextConversationSearchBatch, formatChatDateSeparator, formatConversationDisplayTime, formatConversationUnreadBadge, formatFailure, formatFileSize, formatLastMessageSummary, formatMediaDuration, formatMediaPlaceholder, formatMentionAll, formatServiceText, formatSystemMessage, forward_service as forwardService, getFileExtension, getImTextSearchInitial, getImTimeCatalog, getLocalDayKey, getMessageCopyImageUrl, getMessageCopyText, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isMiniProgramShowTypeOpenable, isPinnedMessageProtected, isSupportedImageFile, isVoiceStorageConfigured, loadOlderUntilBoundary, mediaBatchBudgetBytes, media_service as mediaService, mediaTransferErrorCodeOf, message_service as messageService, migrateImCachePrefix, normalizeImLocale, normalizeLinkHref, normalizeMediaUploadCredentials, parseSessionFavoriteAlbumItems, parseSessionFavoriteFileItems, parseUnicodeEmojiCode, pinnedMessage_service as pinnedMessageService, placeholderWaveform, prependRecentEmoji, profile_service as profileService, read_service as readService, refreshPrependMessageAnchorPosition, registerImCatalogOverrides, replaceInterruptedMediaFile, requiresConversationEncryption, requiresForwardTypeConfirmation, resampleWaveform, resetImCatalogOverrides, resolveBestMediaPresentationSource, resolveCenteredMessageScrollTop, resolveChannelAccess, resolveChannelMemberAvatarUrl, resolveChannelMemberDisplayName, resolveChannelMiniProgramRelIcon, resolveChannelMiniProgramRelName, resolveChannelMiniProgramRelOpenSurface, resolveChannelMiniProgramRelUrl, resolveChannelPinnedGameCopy, resolveConversationListPresentation, resolveDisplayTimestamp, resolveEmojiToken, resolveFriendDisplayName, resolveImEmojiToken, resolveImProfileAccessDestination, resolveImThreadActiveDate, resolveMediaAlbumSendContentType, resolveMediaPresentation, resolveMediaThumbnailMimeType, resolveMediaTransferPresentation, resolveMemberDisplayName, resolveMessageBodyKind, resolveMessageNotificationDecision, resolveMessageSearchPreview, resolveMessageTimelineTimestamp, resolveMiniProgramFloatLinkUrl, resolveMiniProgramGamePreviewLayout, resolveMiniProgramOpenUrl, resolvePrependMessageAnchor, resolvePrependMessageAnchorAdjustment, resolvePrependMessageAnchorPosition, resolvePublicNickname, resolveQuotedMessagePresentation, resolveSenderAvatarUrl, resolveSessionFavoriteAlbumCaption, resolveSessionFavoriteAlbumItemPreviewUrl, resolveSessionFavoriteKindFromMessage, resolveStandaloneEmojiMessage, resolveSurvivingMessageAnchorAdjustment, resolveTextSegments, resolveUnicodeEmoji, resolveVisibleChannelMiniProgramRels, resolveVisibleMessageAnchorPositions, retryMessage, runMediaSendBatch, sendAsFilesBatch, sendBlockReasonForDecision, sendMediaAlbum, sendMediaFile, sendMediaFilesBatch, sendText, sendVoice, shouldCompleteInitialViewport, shouldFillInitialHistoryViewport, shouldFollowIncomingMessage, shouldLoadNewerHistoryPage, shouldPrefetchOlderHistory, shouldRestoreMessageViewportFocus, shouldShowChatDateSeparator, shouldTrackRemoteMessageForBadge, sortChannelMiniProgramFloatingItems, sortSessions, spikeCountForDuration, sumSessionsUnread, supportsConversationMention, unicodeEmojiTextFromCode, voiceErrorCodeOf };
|
|
10999
|
-
export type { ApplySessionResult, BrowseMessagesInput, CanPinMessageInput, CapabilityAvailability, CapabilityDecision, CapabilityReason, CenteredMessageScrollInput, ChannelAccessSnapshot, ChannelBaseSessionState, ChannelConversationCapabilities, ChannelConversationMessageApi, ChannelJoinApplication, ChannelJoinApplicationNotification, ChannelJoinApplicationPage, ChannelMember, ChannelMemberPage, ChannelMentionMember, ChannelMentionMemberPage, ChannelMiniProgramOpenGame, ChannelMiniProgramRel, ChannelMiniProgramRelConfigType, ChannelMiniProgramRelOpenDecision, ChannelMiniProgramRelOpenSurface, ChannelMuteReason, ChannelPermissionSet, ChannelProfile, ChannelRole, ChannelSessionState, ChatMediaMessageRef, ChatProfileAdapter, ChatRuntime, ChatRuntimeCredentials, ChatRuntimeFactories, ChatRuntimeHostDeps, ChatRuntimeOpResult, ContactCardInput, ContactMessageOptions, ConversationBackgroundPreset, ConversationBackgroundSelection, ConversationCapabilityAction, ConversationCapabilitySnapshot, ConversationDraft, ConversationDraftApi, ConversationEntryUnreadNavigation, ConversationEntryUnreadSnapshot, ConversationHandle, ConversationHandleSnapshot, ConversationInitialPosition, ConversationLastMessageSummary, ConversationListItem, ConversationListMention, ConversationListPresentation, ConversationListPresentationLabels, ConversationListPresentationOptions, ConversationListPreviewMediaKind, ConversationListPreviewSegment, ConversationMessageApi, ConversationOpenOptions, ConversationPrefetchController, ConversationPrefetchControllerOptions, ConversationPrefetchOptions, ConversationPrefetchResult, ConversationRef, ConversationSearchCategory, ConversationSearchPage, ConversationSearchResult, ConversationSystemSummary, ConversationType, CreateThreadItemsInput, CustomerServiceConversationCapabilities, DelayedLoadingIndicator, DelayedLoadingIndicatorOptions, DirectConversationCapabilities, DirectConversationMessageApi, DraftInput, EditTextOptions, EmojiEntry, EmojiRecentItem, EmojiSegment, ExpressionMessageOptions, FileMessageOptions, FormatFailureContext, FormatLastMessageContext, FormatMediaPlaceholderContext, FormatServiceTextContext, FormatSystemMessageContext, FormatTimeDisplayContext, ForwardCommandHooks, ForwardFailReason, ForwardItemStatus, ForwardMessageFailure, ForwardMessagesInput, ForwardMessagesResult, ForwardTarget, ForwardedMessageRef, GameMessageOptions, GifFileClassification, GifMessageOptions, GiftMessageOptions, GroupConversationCapabilities, GroupConversationMessageApi, GroupMemberItem, GroupProfile, HighlightSegment, ImAppearanceSettingsApi, ImApplicationItem, ImApplicationRef, ImApplicationsApi, ImAuthIssue, ImAuthProvider, ImBlockedContact, ImCacheOptions, ImCachePrefixMigrationContext, ImCachePrefixMigrator, ImCallKind, ImCallOutcome, ImCallRecordBody, ImCatalog, ImCatalogOverrides, ImChannelConversationAccessSnapshot, ImChannelMemberPresentation, ImChannelMentionApi, ImChannelMentionPresentation, ImChannelMiniProgramRel, ImChannelPermissions, ImChannelPinnedMessage, ImChannelProfile, ImChannelProfilePresentation, ImChannelRole, ImChannelState, ImChannelsApi, ImChatFontScale, ImClientActivityApi, ImClientActivitySnapshot, ImClientOptions, ImConnectionState, ImContactBody, ImContactKind, ImContactProfile, ImContactRelationship, ImContactRemarkPhone, ImContactSearchResult, ImContactsApi, ImConversationBackgroundApi, ImConversationCapabilitiesApi, ImConversationListApi, ImConversationListSnapshot, ImConversationListState, ImConversationSearchApi, ImCoreApiOptions, ImCreateChannelInput, ImCreateChannelResult, ImCreateFaceToFaceGroupResult, ImCreateGroupInput, ImCreateGroupResult, ImCreatedChannel, ImCreatedGroup, ImCustomerServiceApi, ImDebugOptions, ImDiagnosticCategory, ImDiagnosticError, ImDiagnosticLayer, ImDiagnosticLevel, ImDiagnosticMemoryBuffer, ImDiagnosticMemoryBufferFilter, ImDiagnosticMemoryBufferOptions, ImDiagnosticMemoryBufferSnapshot, ImDiagnosticMessage, ImDiagnosticRecord, ImDiagnosticSink, ImDiagnosticWriter, ImDirectCallAnswerResult, ImDirectCallFailReason, ImDirectCallHangupInput, ImDirectCallHangupReason, ImDirectCallInviteInput, ImDirectCallNotifyAudioInput, ImDirectCallTargetInput, ImDirectCallsApi, ImDirectReadReceiptSettings, ImDirectoryApi, ImDirectoryFieldMatch, ImDirectoryItem, ImDirectoryKind, ImDirectoryPage, ImDirectorySearchApi, ImDirectorySearchItem, ImDirectorySearchResult, ImDraftsApi, ImEmojiCatalogEntry, ImEndpointProvider, ImEventsApi, ImExpressionAsset, ImExpressionAssetInput, ImExpressionEmojiRecentInput, ImExpressionFavoriteKind, ImExpressionOptions, ImExpressionRecentInput, ImExpressionRecentItem, ImExpressionRecentItemKind, ImExpressionsApi, ImFaceToFaceGroup, ImFailureCatalog, ImFileBody, ImFilesAlbumBody, ImForwardOperationResult, ImFriendshipRequestResult, ImGameBody, ImGameType, ImGifAssetInput, ImGiftBody, ImGiftSessionType, ImGiftStatus, ImGiftType, ImGiphyAsset, ImGiphyPage, ImGiphyPageOptions, ImGroupCallAnswerInput, ImGroupCallBusyInput, ImGroupCallCreateInput, ImGroupCallJoinInput, ImGroupCallMeetingSnapshot, ImGroupCallMember, ImGroupCallMemberStatus, ImGroupCallStatusInput, ImGroupCallTargetInput, ImGroupCallsApi, ImGroupConversationState, ImGroupMemberPresentation, ImGroupMentionApi, ImGroupPinnedMessage, ImGroupProfile, ImGroupsApi, ImI18n, ImImageBody, ImLastMessageCatalog, ImLifecycleSnapshot, ImLiveRoomBody, ImLiveRoomStatus, ImLiveRoomType, ImLocalDataApi, ImLocalDataInfo, ImLocale, ImLogoutOptions, ImMediaAlbumBody, ImMediaAlbumItem, ImMediaBatchSendResult, ImMediaCatalog, ImMediaConfig, ImMediaTask, ImMediaTasksApi, ImMembershipJoinResult, ImMentionCatalog, ImMessageActionResult, ImMessageBodyKind, ImMessageMention, ImMessageReactionAggregate, ImMessageReactions, ImMessageRef, ImMessageSearchApi, ImMessageView, ImMessageViewBody, ImMessagesByIdResult, ImMiniProgramBody, ImMiniProgramShowType, ImOutboxApi, ImOutboxItem, ImPageToken, ImPartialCatalog, ImPinnedMessageActionResult, ImPinnedMessageErrorKind, ImPinnedMessageOperation, ImPinnedMessageSnapshot, ImProductApplicationUpdate, ImProductAuthInvalidReason, ImProductClient, ImProductEvent, ImProductEventError, ImProductEventMap, ImProductMessage, ImProfileAccessDestination, ImPushApi, ImPushSnapshot, ImQuotedMessagePresentation, ImReactionChangeAction, ImReactionChangeResult, ImReadReceiptSettingsApi, ImRedPacketBody, ImRedPacketType, ImRequestError, ImRequestErrorHandler, ImResourceKind, ImResourceUploadInput, ImResourceUploadProgress, ImResourceUploadResult, ImResourceUploader, ImResourceUploaderConfig, ImRobotBody, ImRobotChatMenuItem, ImRobotCommand, ImRobotConversationBindInput, ImRobotDirectoryItem, ImRobotDirectoryPage, ImRobotDirectoryScope, ImRobotMenuReplyInput, ImRobotModule, ImRobotProfile, ImRobotProfileInput, ImRobotsApi, ImSdkErrorCategory, ImSdkErrorShape, ImSearchApi, ImServiceCatalog, ImServiceTextKey, ImSessionApi, ImSessionFavoriteAlbumItem, ImSessionFavoriteFileItem, ImSessionFavoriteItem, ImSessionFavoriteKind, ImSessionFavoritesApi, ImSessionLifecycleState, ImSettingsApi, ImStickerAssetInput, ImStickerBody, ImStickerPack, ImSupportedConversationRef, ImSystemCatalog, ImTextResolver, ImTextSearchMatch, ImTextSearchMatchOptions, ImTextSearchMatcher, ImTextSearchRange, ImThreadActiveDateSnapshot, ImThreadDateMarkerMetric, ImThreadDecoration, ImThreadEncryptionItem, ImThreadIntent, ImThreadItem, ImThreadPresentationAdapter, ImThreadReadActions, ImThreadReadTargetResolver, ImThreadViewportMetrics, ImTimeCatalog, ImTransferBody, ImTransferSessionType, ImTransferStatus, ImVideoBody, ImVoiceBody, ImWebPushSubscription, ImWeekdayKey, ImageMessageOptions, ImagePreviewMetadata, IncomingMessageFollowInput, InitialHistoryViewportFillInput, InitialViewportCompletionInput, LinkSegment, LiveRoomMessageOptions, LocalConversationHistoryClearResult, LocalMessageDeletionResult, LocalVideoPreviewMetadata, MediaAlbumItemInput, MediaAlbumMessageOptions, MediaBatchBudgetOptions, MediaBatchLimitInfo, MediaFileClassification, MediaLimitItem, MediaObjectUrlLease, MediaPresentationFit, MediaPresentationPolicy, MediaPresentationRule, MediaPresentationSourceCandidate, MediaPresentationSourceQuality, MediaSendBatchResult, MediaTransferErrorCode, MediaTransferPresentation, MediaUploadCredentials, MediaUploadCredentialsProvider, MediaUploadCredentialsRequest, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MentionCandidate, MentionCandidatePage, MentionInput, MessageCapabilityAction, MessageCapabilityInput, MessageContentType, MessageLocateScrollProtectionInput, MessageNotificationDecision, MessageNotificationInput, MessageSearchPreviewOptions, MessageSearchPreviewSegment, MessageWindowInfo, MessageWindowPage, MessagesByIdFailure, MigrateImCachePrefixInput, MiniProgramGamePreviewInput, MiniProgramGamePreviewLayout, MiniProgramHostLocale, MiniProgramMessageOptions, MiniProgramOpenUrlInput, NewMessageBadgeController, NewMessageBadgeCountListener, NewMessageBadgeVisibilityInput, NewerHistoryPageTriggerInput, OlderHistoryPrefetchInput, PrependAnchorCandidate, PrependAnchorViewport, PrependMessageAnchorPosition, ProductConversationListType, ProductHandleConversationType, ProductMessageSearchPage, ProductMessageSearchPreviewPart, ProductMessageSearchResult, RemoteMessageBadgeTrackingInput, ResolveMediaPresentationInput, ResolveTextOptions, ResolvedConversationBackground, ResolvedMediaPresentation, RichExtraSegment, RobotConversationCapabilities, RuntimeClientOperation, RuntimeOperation, SearchBatchResult, SearchFilesInput, SearchMessagesInput, SearchTextMessagesInput, SegmentMatch, SegmentMatcher, SendCapabilityMode, SendCommandHooks, SendMessageResult, SendVoicePayload, SenderProfileEntry, ServiceNoteHooks, StandaloneEmojiMessage, StickerAssetKind, TextMessageOptions, TextSegment, TransferMessageOptions, UnicodeEmojiEntry, UnknownMessageBody, UserProfile, VideoMessageOptions, VideoPreviewMetadata, VisibleChannelMiniProgramRels, VoiceCapabilities, VoiceErrorCode, VoiceMessageMetadata, VoicePlayer, VoicePlayerOptions, VoicePlayerState, VoiceRecordingResult, VoiceRecordingSession, VoiceRecordingSessionOptions, VoiceRecordingState, VoiceToggleOptions };
|
|
11115
|
+
export type { ApplySessionResult, BrowseMessagesInput, CanPinMessageInput, CapabilityAvailability, CapabilityDecision, CapabilityReason, CenteredMessageScrollInput, ChannelAccessSnapshot, ChannelBaseSessionState, ChannelConversationCapabilities, ChannelConversationMessageApi, ChannelJoinApplication, ChannelJoinApplicationNotification, ChannelJoinApplicationPage, ChannelMember, ChannelMemberPage, ChannelMentionMember, ChannelMentionMemberPage, ChannelMiniProgramOpenGame, ChannelMiniProgramRel, ChannelMiniProgramRelConfigType, ChannelMiniProgramRelOpenDecision, ChannelMiniProgramRelOpenSurface, ChannelMuteReason, ChannelPermissionSet, ChannelProfile, ChannelRole, ChannelSessionState, ChatMediaMessageRef, ChatProfileAdapter, ChatRuntime, ChatRuntimeCredentials, ChatRuntimeFactories, ChatRuntimeHostDeps, ChatRuntimeOpResult, ContactCardInput, ContactMessageOptions, ConversationBackgroundPreset, ConversationBackgroundSelection, ConversationCapabilityAction, ConversationCapabilitySnapshot, ConversationDraft, ConversationDraftApi, ConversationEntryUnreadNavigation, ConversationEntryUnreadSnapshot, ConversationHandle, ConversationHandleSnapshot, ConversationInitialPosition, ConversationLastMessageSummary, ConversationListItem, ConversationListMention, ConversationListPresentation, ConversationListPresentationLabels, ConversationListPresentationOptions, ConversationListPreviewMediaKind, ConversationListPreviewSegment, ConversationMessageApi, ConversationOpenOptions, ConversationPrefetchController, ConversationPrefetchControllerOptions, ConversationPrefetchOptions, ConversationPrefetchResult, ConversationRef, ConversationSearchCategory, ConversationSearchPage, ConversationSearchResult, ConversationSystemSummary, ConversationType, CreateThreadItemsInput, CustomerServiceConversationCapabilities, DelayedLoadingIndicator, DelayedLoadingIndicatorOptions, DirectConversationCapabilities, DirectConversationMessageApi, DraftInput, EditTextOptions, EmojiEntry, EmojiRecentItem, EmojiSegment, ExpressionMessageOptions, FileMessageOptions, FormatFailureContext, FormatLastMessageContext, FormatMediaPlaceholderContext, FormatServiceTextContext, FormatSystemMessageContext, FormatTimeDisplayContext, ForwardCommandHooks, ForwardFailReason, ForwardItemStatus, ForwardMessageFailure, ForwardMessagesInput, ForwardMessagesResult, ForwardTarget, ForwardedMessageRef, GameMessageOptions, GifFileClassification, GifMessageOptions, GiftMessageOptions, GroupConversationCapabilities, GroupConversationMessageApi, GroupMemberItem, GroupProfile, HighlightSegment, ImAppearanceSettingsApi, ImApplicationItem, ImApplicationRef, ImApplicationsApi, ImAuthIssue, ImAuthProvider, ImBlockedContact, ImCacheOptions, ImCachePrefixMigrationContext, ImCachePrefixMigrator, ImCallKind, ImCallOutcome, ImCallRecordBody, ImCatalog, ImCatalogOverrides, ImChannelConversationAccessSnapshot, ImChannelMemberPresentation, ImChannelMentionApi, ImChannelMentionPresentation, ImChannelMiniProgramRel, ImChannelPermissions, ImChannelPinnedMessage, ImChannelProfile, ImChannelProfilePresentation, ImChannelRole, ImChannelState, ImChannelsApi, ImChatFontScale, ImClientActivityApi, ImClientActivitySnapshot, ImClientOptions, ImConnectionState, ImContactBody, ImContactKind, ImContactProfile, ImContactRelationship, ImContactRemarkPhone, ImContactSearchResult, ImContactsApi, ImConversationBackgroundApi, ImConversationCapabilitiesApi, ImConversationListApi, ImConversationListSnapshot, ImConversationListState, ImConversationSearchApi, ImCoreApiOptions, ImCreateChannelInput, ImCreateChannelResult, ImCreateFaceToFaceGroupResult, ImCreateGroupInput, ImCreateGroupResult, ImCreatedChannel, ImCreatedGroup, ImCustomerServiceApi, ImDebugOptions, ImDiagnosticCategory, ImDiagnosticError, ImDiagnosticLayer, ImDiagnosticLevel, ImDiagnosticMemoryBuffer, ImDiagnosticMemoryBufferFilter, ImDiagnosticMemoryBufferOptions, ImDiagnosticMemoryBufferSnapshot, ImDiagnosticMessage, ImDiagnosticRecord, ImDiagnosticSink, ImDiagnosticWriter, ImDirectCallAnswerResult, ImDirectCallFailReason, ImDirectCallHangupInput, ImDirectCallHangupReason, ImDirectCallInviteInput, ImDirectCallNotifyAudioInput, ImDirectCallTargetInput, ImDirectCallsApi, ImDirectReadReceiptSettings, ImDirectoryApi, ImDirectoryFieldMatch, ImDirectoryItem, ImDirectoryKind, ImDirectoryPage, ImDirectorySearchApi, ImDirectorySearchItem, ImDirectorySearchResult, ImDraftsApi, ImEmojiCatalogEntry, ImEndpointProvider, ImEventsApi, ImExpressionAsset, ImExpressionAssetInput, ImExpressionEmojiRecentInput, ImExpressionFavoriteKind, ImExpressionOptions, ImExpressionRecentInput, ImExpressionRecentItem, ImExpressionRecentItemKind, ImExpressionsApi, ImFaceToFaceGroup, ImFailureCatalog, ImFileBody, ImFilesAlbumBody, ImForwardOperationResult, ImFriendshipRequestResult, ImGameBody, ImGameType, ImGifAssetInput, ImGiftBody, ImGiftSessionType, ImGiftStatus, ImGiftType, ImGiphyAsset, ImGiphyPage, ImGiphyPageOptions, ImGroupCallAnswerInput, ImGroupCallBusyInput, ImGroupCallCreateInput, ImGroupCallJoinInput, ImGroupCallMeetingSnapshot, ImGroupCallMember, ImGroupCallMemberStatus, ImGroupCallStatusInput, ImGroupCallTargetInput, ImGroupCallsApi, ImGroupConversationState, ImGroupMemberPresentation, ImGroupMentionApi, ImGroupPinnedMessage, ImGroupProfile, ImGroupsApi, ImI18n, ImImageBody, ImLastMessageCatalog, ImLifecycleSnapshot, ImLiveRoomBody, ImLiveRoomStatus, ImLiveRoomType, ImLocalDataApi, ImLocalDataInfo, ImLocale, ImLogoutOptions, ImMediaAlbumBody, ImMediaAlbumItem, ImMediaBatchSendResult, ImMediaCatalog, ImMediaConfig, ImMediaDownloadOptions, ImMediaTask, ImMediaTasksApi, ImMembershipJoinResult, ImMentionCatalog, ImMessageActionResult, ImMessageBodyKind, ImMessageMention, ImMessageReactionAggregate, ImMessageReactions, ImMessageRef, ImMessageSearchApi, ImMessageView, ImMessageViewBody, ImMessagesByIdResult, ImMiniProgramBody, ImMiniProgramShowType, ImOutboxApi, ImOutboxItem, ImPageToken, ImPartialCatalog, ImPinnedMessageActionResult, ImPinnedMessageErrorKind, ImPinnedMessageOperation, ImPinnedMessageSnapshot, ImProductApplicationUpdate, ImProductAuthInvalidReason, ImProductClient, ImProductEvent, ImProductEventError, ImProductEventMap, ImProductMessage, ImProfileAccessDestination, ImPushApi, ImPushSnapshot, ImQuotedMessagePresentation, ImReactionChangeAction, ImReactionChangeResult, ImReadReceiptSettingsApi, ImRedPacketBody, ImRedPacketType, ImRequestError, ImRequestErrorHandler, ImResourceKind, ImResourceUploadInput, ImResourceUploadProgress, ImResourceUploadResult, ImResourceUploader, ImResourceUploaderConfig, ImRobotBody, ImRobotChatMenuItem, ImRobotCommand, ImRobotConversationBindInput, ImRobotDirectoryItem, ImRobotDirectoryPage, ImRobotDirectoryScope, ImRobotMenuReplyInput, ImRobotModule, ImRobotProfile, ImRobotProfileInput, ImRobotsApi, ImSdkErrorCategory, ImSdkErrorShape, ImSearchApi, ImServiceCatalog, ImServiceTextKey, ImSessionApi, ImSessionFavoriteAlbumItem, ImSessionFavoriteFileItem, ImSessionFavoriteItem, ImSessionFavoriteKind, ImSessionFavoritesApi, ImSessionLifecycleState, ImSettingsApi, ImStickerAssetInput, ImStickerBody, ImStickerPack, ImSupportedConversationRef, ImSystemCatalog, ImTextResolver, ImTextSearchMatch, ImTextSearchMatchOptions, ImTextSearchMatcher, ImTextSearchRange, ImThreadActiveDateSnapshot, ImThreadDateMarkerMetric, ImThreadDecoration, ImThreadEncryptionItem, ImThreadIntent, ImThreadItem, ImThreadPresentationAdapter, ImThreadReadActions, ImThreadReadTargetResolver, ImThreadViewportMetrics, ImTimeCatalog, ImTransferBody, ImTransferSessionType, ImTransferStatus, ImVideoBody, ImVoiceBody, ImWebPushSubscription, ImWeekdayKey, ImageMessageOptions, ImagePreviewMetadata, IncomingMessageFollowInput, InitialHistoryViewportFillInput, InitialViewportCompletionInput, LinkSegment, LiveRoomMessageOptions, LocalConversationHistoryClearResult, LocalMessageDeletionResult, LocalVideoPreviewMetadata, MediaAlbumItemInput, MediaAlbumMessageOptions, MediaBatchBudgetOptions, MediaBatchLimitInfo, MediaFileClassification, MediaLimitItem, MediaObjectUrlLease, MediaPresentationFit, MediaPresentationPolicy, MediaPresentationRule, MediaPresentationSourceCandidate, MediaPresentationSourceQuality, MediaSendBatchResult, MediaTransferErrorCode, MediaTransferPresentation, MediaUploadCredentials, MediaUploadCredentialsProvider, MediaUploadCredentialsRequest, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MentionCandidate, MentionCandidatePage, MentionInput, MessageCapabilityAction, MessageCapabilityInput, MessageContentType, MessageLocateScrollProtectionInput, MessageNotificationDecision, MessageNotificationInput, MessageSearchPreviewOptions, MessageSearchPreviewSegment, MessageWindowInfo, MessageWindowPage, MessagesByIdFailure, MigrateImCachePrefixInput, MiniProgramGamePreviewInput, MiniProgramGamePreviewLayout, MiniProgramHostLocale, MiniProgramMessageOptions, MiniProgramOpenUrlInput, NewMessageBadgeController, NewMessageBadgeCountListener, NewMessageBadgeVisibilityInput, NewerHistoryPageTriggerInput, OlderHistoryPrefetchInput, PrependAnchorCandidate, PrependAnchorViewport, PrependMessageAnchorPosition, ProductConversationListType, ProductHandleConversationType, ProductMessageSearchPage, ProductMessageSearchPreviewPart, ProductMessageSearchResult, RemoteMessageBadgeTrackingInput, ResolveMediaPresentationInput, ResolveTextOptions, ResolvedConversationBackground, ResolvedMediaPresentation, RichExtraSegment, RobotConversationCapabilities, RuntimeClientOperation, RuntimeOperation, SearchBatchResult, SearchFilesInput, SearchMessagesInput, SearchTextMessagesInput, SegmentMatch, SegmentMatcher, SendCapabilityMode, SendCommandHooks, SendMessageResult, SendVoicePayload, SenderProfileEntry, ServiceNoteHooks, StandaloneEmojiMessage, StickerAssetKind, TextMessageOptions, TextSegment, TransferMessageOptions, UnicodeEmojiEntry, UnknownMessageBody, UserProfile, VideoMessageOptions, VideoPreviewMetadata, VisibleChannelMiniProgramRels, VoiceCapabilities, VoiceErrorCode, VoiceMessageMetadata, VoicePlayer, VoicePlayerOptions, VoicePlayerState, VoiceRecordingResult, VoiceRecordingSession, VoiceRecordingSessionOptions, VoiceRecordingState, VoiceToggleOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{computeBiFeedbackHeaderSign as t}from"./bi-feedback.js";import{API_PROTOCOL_OS_TYPE as e,API_PROTOCOL_APP_ID as s,API_PROTOCOL_APP_TYPE as n,API_PROTOCOL_BI_FEEDBACK_APP_ID as o,API_PROTOCOL_CLIENT_TYPE as r}from"./constants.js";import{parseApiProtocolJson as a}from"./json.js";import{generateRequestNonce as
|
|
1
|
+
import{computeBiFeedbackHeaderSign as t}from"./bi-feedback.js";import{API_PROTOCOL_OS_TYPE as e,API_PROTOCOL_APP_ID as s,API_PROTOCOL_APP_TYPE as n,API_PROTOCOL_BI_FEEDBACK_APP_ID as o,API_PROTOCOL_CLIENT_TYPE as r}from"./constants.js";import{parseApiProtocolJson as a}from"./json.js";import{generateRequestId as i,generateRequestNonce as c}from"./nonce.js";import{resolveTargetConfig as p,normalizeProtocolParams as u,resolveProtocolLang as d,resolveBrowserInfo as m,formatTimestamp as l,normalizeHeaders as f,appendQueryParams as g,isFormDataBody as y,createRandomAlphaNumericString as w,joinUrlParts as b,collectResponseHeaders as h,readResponseHeader as v,transportDataToUint8Array as S,isJsonResponse as T,isTextResponse as M,transportDataToText as D}from"./utils.js";const C=/* @__PURE__ */new Set(["content-etag","token","req-id"]);function E(t){const e=t.rawBody,s=null!==e&&"object"==typeof e&&"code"in e?e.code:void 0;return{transportStatus:t.transportStatus,...void 0===t.httpStatus?{}:{httpStatus:t.httpStatus},..."number"==typeof s&&Number.isFinite(s)?{businessCode:s}:{}}}function j(t,e){return{code:502,msg:t instanceof Error?t.message:String(t),data:null,time:Math.floor(e/1e3)}}function B(t,e,s,n){if(T(s))return a(D(e.data));if(M(s))return D(e.data);const o=S(e.data),r=n?t.crypto.decryptAes(o):o,i=(new TextDecoder).decode(r);return a(i)}async function _(t,e,s){if(!t.onDebugRecord)return;const n={...e.meta,response:e.response,...s?{error:{name:s instanceof Error?s.name:void 0,message:s instanceof Error?s.message:String(s)}}:{}};try{await t.onDebugRecord(n)}catch{}}async function N(t,e,s,n,o,r,i){const c=h(e.headers),p=v(c,"content-type");if(e.status<200||e.status>=300){let a;if(n)a=void 0;else try{a=B(t,e,p,s)}catch{a=void 0}const u=function(t){if(!t||"object"!=typeof t)return!1;const e=t;return Number.isFinite(e.code)&&"data"in e}(a)?a:function(t,e){return{code:t.status,msg:t.statusText,data:null,time:Math.floor(e/1e3)}}(e,i);return{response:u,meta:{...o,transportStatus:"http_error",httpStatus:e.status,contentType:p,responseHeaders:c,...void 0!==a?{rawBody:a}:{},timings:{totalMs:i-r,upstreamMs:i-r}}}}const u=Date.now();if(n){const t=S(e.data),s=Date.now();return{response:{code:e.status,data:t,time:Math.floor(s/1e3)},meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:t,timings:{totalMs:s-r,upstreamMs:i-r,parseMs:s-u}}}}try{if(T(p)){const s=B(t,e,p,!1),n=Date.now();return{response:s,meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:s,timings:{totalMs:n-r,upstreamMs:i-r,parseMs:n-u}}}}if(M(p)){const t=D(e.data),s=Date.now();return{response:{code:e.status,msg:e.statusText,data:t,time:Math.floor(s/1e3)},meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:t,timings:{totalMs:s-r,upstreamMs:i-r,parseMs:s-u}}}}const n=S(e.data),d=Date.now(),m=s?t.crypto.decryptAes(n):n,l=Date.now(),f=(new TextDecoder).decode(m),g=a(f),y=Date.now();return{response:g,meta:{...o,transportStatus:"success",httpStatus:e.status,contentType:p,responseHeaders:c,rawBody:g,timings:{totalMs:y-r,upstreamMs:i-r,parseMs:y-u,...s?{decryptMs:l-d}:{}}}}}catch(t){const s=Date.now();return{response:{code:(d=e.status,Number.isInteger(d)&&d>=400&&d<=599?d:502),msg:t instanceof Error?t.message:String(t),data:null,time:Math.floor(s/1e3)},meta:{...o,transportStatus:"invalid_response",httpStatus:e.status,contentType:p,responseHeaders:c,timings:{totalMs:s-r,upstreamMs:i-r,parseMs:s-u}}}}var d}function k(a){return async function(h,v={}){const S=a.now??(()=>/* @__PURE__ */new Date),T=a.randomNonce??c,M=a.randomRequestId??i,D=a.randomETag??(()=>w()),B=(v.method??"POST").toUpperCase(),k=v.target??"core",I=p(k,a.config.targets[k]),q=v.prefix??I.prefix??"",P=null!=v.body,R=u(v.data??{}),x="/v1/feedback"===h&&"/bi/h5"===q,H=!x&&(v.encrypt??!P),O=!x&&(v.sign??!P),U=S(),A=D(),V=M(),L=v.token??await(a.getToken?.())??"",J=d(v.locale??a.getLocale?.()),F=a.getBrowserInfo?.()??m(v.userAgent),X={app_id:s,os_type:e,app_version:a.config.appVersion,sign_method:"md5",timestamp:l(U),nonce:T()},G={...X,...R,nonce:X.nonce};let Y=X,z=R,K=G;!x&&O&&(G.sign=a.crypto.generateSign("api",a.config.envType,G,A),X.sign=G.sign);const Q={app_version:a.config.appVersion,"X-ENC-VERSION":a.config.appVersion,"X-APP-TYPE":n,"Client-type":r,"Content-ETag":A,"brand-id":a.config.brandId,"channel-id":v.channelId||a.config.channelId,device_brand:F.deviceBrand,device_info:F.deviceInfo,device_number:F.deviceNumber,device_token:F.deviceToken,lang:J,"mch-id":a.config.merchantId,"req-id":V,token:L},W=f(v.headers);let Z,$=h,tt={...Q,...Object.fromEntries(Object.entries(W).filter(([t])=>!C.has(t.toLowerCase())))};if(P)Z=v.body??void 0,Y=null,z=v.data??null,K=v.data??null;else if(x){const e=String(U.getTime()),s={"app-id":o,"app-version":a.config.appVersion,"sys-type":n,"sys-version":F.deviceNumber,time:e};Y=s,tt={...tt,...s,sign:t(a.crypto,s),"Content-Type":"application/json"},Z=JSON.stringify(R),K=R}else"GET"===B?($=g($,G),K=G):H?(Z=a.crypto.encryptAes((new TextEncoder).encode(JSON.stringify(G))),tt["Content-Type"]=tt["Content-Type"]||"application/octet-stream",K=G):(Z=JSON.stringify(G),tt["Content-Type"]=tt["Content-Type"]||"application/json",K=G);y(Z)&&delete tt["Content-Type"];const et=function(t,e,s,n,o){if(s.customUrl)return t;const r=p(n,e.config.targets[n]),a=s.baseUrl??r.baseUrl;return b(a,o,t)}($,a,v,k,q),st=Date.now(),nt=v.timeoutMs??6e4,ot=function(t,e){const s=new AbortController,n=setTimeout(()=>s.abort(),t),o=()=>s.abort();return e&&(e.aborted?s.abort():e.addEventListener("abort",o,{once:!0})),{signal:s.signal,dispose:()=>{clearTimeout(n),e?.removeEventListener("abort",o)}}}(nt,v.signal),rt={requestId:V,eTag:A,method:B,upstreamUrl:et,requestHeaders:tt,requestCommonParams:Y,requestBusinessParams:z,requestParams:K};let at;try{const t=await a.transport({url:et,method:B,headers:tt,body:Z,signal:ot.signal,timeoutMs:nt,onUploadProgress:v.onUploadProgress}),e=Date.now(),s=await N(a,t,H&&!x,"raw"===v.responseMode,rt,st,e);return v.onResponse&&(at=E(s.meta),s.observation=at),await _(a,s),!v.skipBusinessResponseHandler&&a.onBusinessResponse&&await a.onBusinessResponse(s.response,{request:{path:h,method:B,target:k,url:et},options:v}),s}catch(t){const e=Date.now(),s={response:j(t,e),...void 0===at?{}:{observation:at},meta:{...rt,transportStatus:"network_error",timings:{totalMs:e-st,upstreamMs:e-st}}};return await _(a,s,t),s}finally{ot.dispose()}}}function I(t){const e=k(t);return async function(t,s={}){const n=await e(t,s);return await(s.onResponse?.(n.observation??E(n.meta))),n.response}}export{I as createApiProtocolClient};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function n(n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("随机字符串长度必须是非负整数");const t=new Uint8Array(16);let
|
|
1
|
+
const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function n(n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("随机字符串长度必须是非负整数");const t=new Uint8Array(16);let o="";for(;o.length<n;){globalThis.crypto.getRandomValues(t);for(const e of t)if(!(e>=248)&&(o+=r.charAt(e%62),o.length===n))return o}return o}function t(){return n(10)}function o(){const r=globalThis.crypto;if("function"==typeof r?.randomUUID)return`req-${r.randomUUID().replace(/-/g,"")}`;if("function"!=typeof r?.getRandomValues)throw new Error("生成请求标识需要系统安全随机源 crypto.getRandomValues");const n=new Uint8Array(16);return r.getRandomValues(n),n[6]=15&n[6]|64,n[8]=63&n[8]|128,`req-${Array.from(n,r=>r.toString(16).padStart(2,"0")).join("")}`}export{o as generateRequestId,t as generateRequestNonce,n as generateSecureRandomString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createManagedCryptoDriver as t}from"./driver.js";import{createCryptoModule as e}from"./vendor/crypto/index_bg.js";let n=null,r=null;async function a(){r||(r=async function(){if("undefined"==typeof WebAssembly)throw new ReferenceError("WebAssembly is not defined");const n=e(),r=new URL("../../vendor/crypto/index_bg.wasm",import.meta.url),a=await fetch(r);if(!a.ok)throw new Error(`crypto wasm 加载失败:HTTP ${a.status} (${r.origin}${r.pathname})`);const i={"./index_bg.js":n};let s;const o=a.headers.get("Content-Type");s="function"==typeof WebAssembly.instantiateStreaming&&"application/wasm"===o?await WebAssembly.instantiateStreaming(a,i):await WebAssembly.instantiate(await a.arrayBuffer(),i),n.__wbg_set_wasm(s.instance.exports),s.instance.exports.__wbindgen_start();const c=s.module;return t(n,async()=>{const t=e(),n=await WebAssembly.instantiate(c,{"./index_bg.js":t});return t.__wbg_set_wasm(n.exports),n.exports.__wbindgen_start(),t})}().catch(t=>{throw r=null,t}));const a=await r;return n=await a.ready(),n}function i(){if(!n)throw new Error("crypto driver 尚未初始化,请先 await loadBrowserCryptoDriver()");return n}function s(t){return i().cryptMd5(t)}function o(t,e,n,r=null){return i().generateSign(t,e,n,r)}function c(t){return i().encryptAes(t)}function w(t){return i().decryptAes(t)}await a();export{s as cryptMd5,w as decryptAes,c as encryptAes,o as generateSign,a as loadBrowserCryptoDriver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return{cryptMd5:e.crypt_md5,generateSign:e.generate_sign,encryptAes:e.encrypt_aes,decryptAes:e.decrypt_aes}}export{
|
|
1
|
+
function t(t,e){let r,n,o,i=0,c=!1,f=!1;function s(e){t=e,r=void 0,f=!1,o=void 0}function y(t){c=!0,n=t,f=!1,o=void 0}function a(a){if(c)throw n;if(r)throw r;i++;try{const e=a(t);if(r)throw r;return e}catch(t){throw!r&&t instanceof WebAssembly.RuntimeError&&(r=t),void 0===r?t:r}finally{i--,0===i&&r&&function(){if(!f&&!c){f=!0;try{const t=e();"function"==typeof t.then?o=Promise.resolve(t).then(s,y):s(t)}catch(t){y(t)}}}()}}const d={cryptMd5:t=>a(e=>e.crypt_md5(t)),generateSign:(t,e,r,n)=>a(o=>o.generate_sign(t,e,r,n)),encryptAes:t=>a(e=>e.encrypt_aes(t)),decryptAes:t=>a(e=>e.decrypt_aes(t))};return{driver:d,async ready(){for(let t=o;t;t=o)await t;if(c)throw n;if(r)throw r;return d}}}export{t as createManagedCryptoDriver};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let n;function
|
|
1
|
+
function e(){if("undefined"==typeof TextEncoder)throw new ReferenceError("TextEncoder is not defined");if("undefined"==typeof TextDecoder)throw new ReferenceError("TextDecoder is not defined");let e,n,t=[null];function r(e){return t.push(e),t.length-1}function _(e){if((e>>>=0)>=t.length)throw new WebAssembly.RuntimeError("crypto reference index out of bounds");return t[e]}function o(n,t){try{return n.apply(this,t)}catch(n){const t=function(n){const t=e.__externref_table_alloc();return e.__wbindgen_export_2.set(t,n),t}(n);e.__wbindgen_exn_store(t)}}function c(e){const n=typeof e;if("number"==n||"boolean"==n||null==e)return`${e}`;if("string"==n)return`"${e}"`;if("symbol"==n){const n=e.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==n){const n=e.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(e)){const n=e.length;let t="[";n>0&&(t+=c(e[0]));for(let r=1;r<n;r++)t+=`, ${c(e[r])}`;return t+="]",t}const t=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(!(t&&t.length>1))return toString.call(e);if(r=t[1],"Object"==r)try{return`Object(${JSON.stringify(e)})`}catch(e){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}let i=0,l=null;function u(){return null!==l&&0!==l.byteLength||(l=new Uint8Array(e.memory.buffer)),l}const f=new TextEncoder,g="function"==typeof f.encodeInto?function(e,n){return f.encodeInto(e,n)}:function(e,n){const t=f.encode(e);return n.set(t),{read:e.length,written:t.length}};function s(e,n,t){if(void 0===t){const t=f.encode(e),r=n(t.length,1)>>>0;return u().subarray(r,r+t.length).set(t),i=t.length,r}let r=e.length,_=n(r,1)>>>0;const o=u();let c=0;for(;c<r;c++){const n=e.charCodeAt(c);if(n>127)break;o[_+c]=n}if(c!==r){0!==c&&(e=e.slice(c)),_=t(_,r,r=c+3*e.length,1)>>>0;const n=u().subarray(_+c,_+r);c+=g(e,n).written,_=t(_,r,c,1)>>>0}return i=c,_}let a=null;function b(){return(null===a||!0===a.buffer.detached||void 0===a.buffer.detached&&a.buffer!==e.memory.buffer)&&(a=new DataView(e.memory.buffer)),a}function d(e){return null==e}const w=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});function y(e,n){return e>>>=0,w.decode(u().subarray(e,e+n))}function p(e,n){const t=n(1*e.length,1)>>>0;return u().set(e,t/1),i=e.length,t}function m(e,n){return e>>>=0,u().subarray(e/1,e/1+n)}return w.decode(),{__wbg_set_wasm:function(_){for(const e of["__compat_result_1","__compat_result_2","__compat_result_3"])if("function"!=typeof _[e])throw new Error("crypto WASM ABI mismatch");t=[null],n=function(){const e=Array(128).fill(null),n=n=>{if((n>>>=0)>=e.length)throw new WebAssembly.RuntimeError("crypto reference table index out of bounds");return n};return{get length(){return e.length},get:t=>e[n(t)],set:(t,r)=>{e[n(t)]=r},grow(n,t=null){n>>>=0;const r=e.length;if(n>4294967295-r)throw new RangeError("crypto reference table cannot grow");return e.length+=n,e.fill(t,r),r}}}(),i=0,l=null,a=null;const o=(e,n,o=-1)=>(...c)=>{const i=t.length;try{o>=0&&(c[o]=r(c[o]));const t=_[e](...c);return 2===n?[t,_.__compat_result_1()]:[t,_.__compat_result_1(),_.__compat_result_2(),_.__compat_result_3()]}finally{t.length=i}};e={..._,__wbindgen_export_2:n,crypt_md5:o("crypt_md5",2),generate_sign:o("generate_sign",4,4),encrypt_aes:o("encrypt_aes",2),decrypt_aes:o("decrypt_aes",2)}},__compat_table_get:function(e){return r(n.get(e))},__compat_table_set:function(e,t){n.set(e,_(t))},__compat_table_grow:function(e,t){const r=_(e);try{return n.grow(t,r)}catch(e){if(e instanceof RangeError)return-1;throw e}},crypt_md5:function(n){let t,r;try{const _=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,c=e.crypt_md5(_,o);return t=c[0],r=c[1],y(c[0],c[1])}finally{e.__wbindgen_free(t,r,1)}},generate_sign:function(n,t,r,_){let o,c;try{const l=s(n,e.__wbindgen_malloc,e.__wbindgen_realloc),u=i,f=s(t,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i,a=d(_)?0:s(_,e.__wbindgen_malloc,e.__wbindgen_realloc),b=i,w=e.generate_sign(l,u,f,g,r,a,b);let p=w[0],m=w[1];if(w[3])throw p=0,m=0,function(n){const t=e.__wbindgen_export_2.get(n);return e.__externref_table_dealloc(n),t}(w[2]);return o=p,c=m,y(p,m)}finally{e.__wbindgen_free(o,c,1)}},encrypt_aes:function(n){const t=p(n,e.__wbindgen_malloc),r=i,_=e.encrypt_aes(t,r),o=m(_[0],_[1]).slice();return e.__wbindgen_free(_[0],1*_[1],1),o},decrypt_aes:function(n){const t=p(n,e.__wbindgen_malloc),r=i,_=e.decrypt_aes(t,r),o=m(_[0],_[1]).slice();return e.__wbindgen_free(_[0],1*_[1],1),o},__wbg_get_67b2ba62fc30de12:function(){return r(o((e,n)=>Reflect.get(_(e),_(n)),arguments))},__wbg_get_b9b93047fe3cf45b:function(e,n){return r(_(e)[n>>>0])},__wbg_length_e2d2a49132c1b256:function(e){return _(e).length},__wbg_ownKeys_3930041068756f1f:function(){return r(o(e=>Reflect.ownKeys(_(e)),arguments))},__wbindgen_debug_string:function(n,t){const r=s(c(_(t)),e.__wbindgen_malloc,e.__wbindgen_realloc),o=i;b().setInt32(n+4,o,!0),b().setInt32(n+0,r,!0)},__wbindgen_init_externref_table:function(){const n=e.__wbindgen_export_2,t=n.grow(4);n.set(0,void 0),n.set(t+0,void 0),n.set(t+1,null),n.set(t+2,!0),n.set(t+3,!1)},__wbindgen_is_object:function(e){const n=_(e);return"object"==typeof n&&null!==n},__wbindgen_string_get:function(n,t){const r=_(t),o="string"==typeof r?r:void 0,c=d(o)?0:s(o,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i;b().setInt32(n+4,l,!0),b().setInt32(n+0,c,!0)},__wbindgen_string_new:function(e,n){return r(y(e,n))},__wbindgen_throw:function(e,n){throw new Error(y(e,n))}}}const n=/* @__PURE__ */e(),{__wbg_set_wasm:t,__compat_table_get:r,__compat_table_set:_,__compat_table_grow:o,crypt_md5:c,generate_sign:i,encrypt_aes:l,decrypt_aes:u,__wbg_get_67b2ba62fc30de12:f,__wbg_get_b9b93047fe3cf45b:g,__wbg_length_e2d2a49132c1b256:s,__wbg_ownKeys_3930041068756f1f:a,__wbindgen_debug_string:b,__wbindgen_init_externref_table:d,__wbindgen_is_object:w,__wbindgen_string_get:y,__wbindgen_string_new:p,__wbindgen_throw:m}=n;export{r as __compat_table_get,o as __compat_table_grow,_ as __compat_table_set,f as __wbg_get_67b2ba62fc30de12,g as __wbg_get_b9b93047fe3cf45b,s as __wbg_length_e2d2a49132c1b256,a as __wbg_ownKeys_3930041068756f1f,t as __wbg_set_wasm,b as __wbindgen_debug_string,d as __wbindgen_init_externref_table,w as __wbindgen_is_object,y as __wbindgen_string_get,p as __wbindgen_string_new,m as __wbindgen_throw,e as createCryptoModule,c as crypt_md5,u as decrypt_aes,l as encrypt_aes,i as generate_sign};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{withRequestTimeout as t,trackResponseActivity as e}from"./request-timeout.js";import{ImHttpRequestError as o}from"../../../im-core/src/ports/http-port.js";function r(r){const s=r.fetch??((t,e)=>globalThis.fetch(t,e));return{async postProtobuf({path:a,body:n,headers:i,signal:c}){const u=await r.getBaseUrl();if(!u)throw new Error("CmHttp.postProtobuf:缺少 CM HTTP 基址(getCmHttpBaseUrl 为空)");const p={"Content-Type":"application/octet-stream"},l=r.getClientType?.();void 0!==l&&(p["Client-type"]=String(l)),Object.assign(p,i);const h=await r.getAuth();return null!==h&&""!==h.token&&""!==h.userId&&(p.Authorization=`${h.token}:${h.userId}`),t({signal:c,idleMs:15e3,timeoutError:()=>new DOMException("CM 请求连续 15 秒没有收到新数据","TimeoutError")},async t=>{const r=await s(`${u}${a}`,{method:"POST",body:n,headers:p,signal:t.signal});if(!r.ok)throw await(r.body?.cancel().catch(()=>{})),new o({path:a,status:r.status,statusText:r.statusText});const i=await e(r,t).arrayBuffer();return new Uint8Array(i)})}}}export{r as createCmHttpAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(e,t){const r=new AbortController;let o,n,s,a,i=!1;const u=new Promise((e,t)=>{a=t}),l=e=>{i||(i=!0,s=e,r.abort(e),a(e))},c=()=>l(e.signal?.reason??new DOMException("Request canceled","AbortError")),h=()=>{i||(clearTimeout(o),o=setTimeout(()=>l(e.timeoutError()),e.idleMs))};e.signal?.addEventListener("abort",c,{once:!0});try{if(e.signal?.aborted)throw e.signal.reason??new DOMException("Request canceled","AbortError");h(),void 0!==e.totalMs&&(n=setTimeout(()=>l(e.timeoutError()),e.totalMs));const o=Promise.resolve().then(()=>{if(i)throw s;return t({signal:r.signal,touch:h})}),a=await Promise.race([o,u]);if(i)throw s;return a}catch(e){throw r.abort(e),e}finally{i=!0,clearTimeout(o),clearTimeout(n),e.signal?.removeEventListener("abort",c)}}function t(e,t){if(t.touch(),null==e.body)return e;const r=e.body.pipeThrough(new TransformStream({transform(e,r){e.byteLength>0&&t.touch(),r.enqueue(e)}}),{signal:t.signal});return new Response(r,{status:e.status,statusText:e.statusText,headers:e.headers})}export{t as trackResponseActivity,e as withRequestTimeout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,
|
|
1
|
+
var e=Object.defineProperty,r=(r,o,s)=>((r,o,s)=>o in r?e(r,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[o]=s)(r,"symbol"!=typeof o?o+"":o,s);const o="core",s=200,t=502,a=/* @__PURE__ */new Set(["/friend/list","/friend/apply/list_paginated","/user_group/list","/user_radio/list","/user_radio/users"]);class i extends Error{constructor(e,o){super(`core JSON 传输失败:${e||"unknown transport error"}`,void 0===o?void 0:{cause:o}),r(this,"code",502),this.name="CoreJsonTransportError"}}class n extends Error{constructor(e,o,s){super(`${e}失败:code=${o}${s?` ${s}`:""}`),r(this,"businessCode"),r(this,"operation"),this.name="CoreJsonBusinessError",this.businessCode=o,this.operation=e}}async function d(e,r,t,n){const d=void 0!==n&&"responseMode"in n&&"strict"===n.responseMode;let c;try{c=await e(r,{target:o,data:t,timeoutMs:a.has(r)?6e4:15e3,...void 0===n?.method?{}:{method:n.method},...void 0===n?.headers?{}:{headers:n.headers},...void 0===n?.prefix?{}:{prefix:n.prefix}})}catch(e){if(d)throw new i(e instanceof Error?e.message:String(e),e);throw e}if(d){const e="string"==typeof c.msg?c.msg:"";if(502===c.code)throw new i(e);return c.code!==s?{ok:!1,code:c.code,message:e,data:c.data}:{ok:!0,code:s,message:e,data:c.data}}return{code:c.code,data:c.code===s&&null!=c.data?c.data:null}}export{s as CORE_JSON_CODE_SUCCESS,o as CORE_JSON_TARGET,t as CORE_JSON_TRANSPORT_FAILURE_CODE,n as CoreJsonBusinessError,i as CoreJsonTransportError,d as requestCoreJson};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t){if("string"!=typeof t||0===t.length)return!1;try{const r=new URL(t);return"http:"===r.protocol||"https:"===r.protocol}catch{return!1}}async function r(r){const
|
|
1
|
+
function t(t){if("string"!=typeof t||0===t.length)return!1;try{const r=new URL(t);return"http:"===r.protocol||"https:"===r.protocol}catch{return!1}}async function r(r){const e=await r("/system/background/list",{target:"core",method:"POST",timeoutMs:15e3,data:{}});if(200!==e.code)throw new Error(`会话背景预置列表请求失败:${e.code}${e.msg?` ${e.msg}`:""}`);if(!Array.isArray(e.data?.lists))throw new Error("会话背景预置列表响应缺少 lists");const n=[],o=/* @__PURE__ */new Set;for(const r of e.data.lists){const e="string"==typeof r.id||"number"==typeof r.id?String(r.id):"";0!==e.length&&1===r.is_enabled&&t(r.img_url)&&(o.has(e)||(o.add(e),n.push({id:e,url:r.img_url,..."string"==typeof r.name&&r.name.length>0?{name:r.name}:{}})))}return n}export{r as getConversationBackgroundPresets};
|