@longzai-intelligence-transport/http-adapter-taro 0.1.1 → 0.1.2
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/index.d.ts +8 -7
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -270,19 +270,15 @@ declare function createStreamDownloadFunction<TRoute extends StreamResponseRoute
|
|
|
270
270
|
* 创建 Taro API 客户端 factory
|
|
271
271
|
*
|
|
272
272
|
* 返回的 factory 接受 routes 集合,生成 TaroApi:
|
|
273
|
+
*
|
|
273
274
|
* - JSON 路由:复用 core createApiClientFactory,走 HttpClient.request
|
|
274
275
|
* - 流式路由:走 Taro.downloadFile,返回 Promise<string>(tempFilePath)
|
|
275
276
|
*
|
|
276
|
-
* @param client - core HttpClient(用于 JSON 路由)
|
|
277
|
-
* @param streamConfig - 流式下载配置
|
|
278
|
-
* @returns API factory,接受 routes 返回 TaroApi
|
|
279
|
-
* @throws {@link Error} 类型断言失败时抛出
|
|
280
|
-
*
|
|
281
277
|
* @example
|
|
282
278
|
* ```typescript
|
|
283
279
|
* const factory = createTaroApiClientFactory(client, {
|
|
284
|
-
*
|
|
285
|
-
*
|
|
280
|
+
* baseUrl: 'https://api.example.com',
|
|
281
|
+
* tokenProvider,
|
|
286
282
|
* });
|
|
287
283
|
* const api = factory(orderRoutes);
|
|
288
284
|
*
|
|
@@ -293,6 +289,11 @@ declare function createStreamDownloadFunction<TRoute extends StreamResponseRoute
|
|
|
293
289
|
* const tempPath = await api.downloadExport({ taskId: 'abc' });
|
|
294
290
|
* await Taro.saveFile({ tempFilePath: tempPath, filePath: `${wx.env.USER_DATA_PATH}/export.xlsx` });
|
|
295
291
|
* ```
|
|
292
|
+
*
|
|
293
|
+
* @param client - core HttpClient(用于 JSON 路由)
|
|
294
|
+
* @param streamConfig - 流式下载配置
|
|
295
|
+
* @returns API factory,接受 routes 返回 TaroApi
|
|
296
|
+
* @throws {@link Error} 类型断言失败时抛出
|
|
296
297
|
*/
|
|
297
298
|
declare function createTaroApiClientFactory(client: HttpClient$1, streamConfig: StreamDownloadConfig): <TRoutes extends Record<string, RouteDefinition>>(routes: TRoutes) => TaroApi<TRoutes>;
|
|
298
299
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-transport/http-adapter-taro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"adapter",
|
|
6
6
|
"http",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"clean": "rimraf dist out .cache"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@longzai-intelligence-transport/http-core": "0.1.
|
|
40
|
+
"@longzai-intelligence-transport/http-core": "0.1.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@tarojs/taro": "^4.2.0",
|