Skip to content

fetchAppBundle

This content is not available in your language yet.

function fetchAppBundle(
base,
token,
fetchImpl,
ifNoneMatch?,
clientFeatures?
): Promise<FetchedAppBundle>;

拉 bundle(GET {baseUrl}/t1/config,令牌头鉴权)并解析;失败一律 TansrSdkError(‘assembly_failed’) 携修复指引。ifNoneMatch 在场即条件请求 (平台支持 ETag/304),304 返回 bundle=null 由缓存续期。既有逐会话拉取径 (assemblePlatformModel 无 bundleCache)与缓存径共用本函数——单一拉取实现。

恒携 x-tansr-client-features(缺省 platform-audio)——声明本 SDK 可理解的可选 bundle 扩展词表, 平台据此分档下发(缺头 = 旧 SDK,只下发基础键)。声明值进 bundle 缓存键指纹,条件重拉同携 (平台侧 ETag 按实际下发形计算);serve 托管拓扑经同一函数自动继承。bundle 拉取与 heartbeat 同携同值(平台侧 bundleEtag 按头分档计算,见 fetchTwpHeartbeat 注);exchange 不携(与 bundle 形无关)。

string

string

any

string

readonly string[]

声明的客户端 features(缺省 CLIENT_FEATURES;缓存键指纹与本头同源)

Promise<FetchedAppBundle>