@antglobal/voyager-campaign-sdk 0.0.1788950302-dev.9 → 0.0.1790130801-dev.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/adapter/mpWebDevEnv.d.ts +11 -3
- package/dist/mp_web/index.d.ts +3 -2
- package/dist/mp_web.js +11 -11
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* mp_web DEV
|
|
3
|
-
*
|
|
2
|
+
* mp_web DEV 联调信息注入,两种来源:
|
|
3
|
+
* 1. request 第二参数(推荐):setDevEnvInfo({ sofa, pspId, userId, appId }),参数优先、持续生效;
|
|
4
|
+
* 2. URL 参数 `_voyager_dev_env`(兜底,格式 `sofa*pspId*userId*AppId`):缓存 localStorage,传空字符串清空。
|
|
5
|
+
* 仅非 PROD 环境注入。
|
|
4
6
|
*/
|
|
7
|
+
import type { VoyagerDevEnvOptions } from '../types';
|
|
5
8
|
export interface DevEnvInfo {
|
|
6
9
|
sofa?: string;
|
|
7
10
|
pspId?: string;
|
|
@@ -10,6 +13,11 @@ export interface DevEnvInfo {
|
|
|
10
13
|
}
|
|
11
14
|
/** 环境判断:injectInfo 优先,域名兜底,缺省 PROD */
|
|
12
15
|
export declare function getEnv(): string;
|
|
16
|
+
/**
|
|
17
|
+
* 由 request 第二参数注入联调信息(对象格式,appId 映射内部 AppId)。
|
|
18
|
+
* 持续生效:写入后后续未传参的 request 沿用,直至再次注入或 resetDevEnvCache。
|
|
19
|
+
*/
|
|
20
|
+
export declare function setDevEnvInfo(devEnv: VoyagerDevEnvOptions): void;
|
|
13
21
|
export declare function getDevEnvInfo(): DevEnvInfo | undefined;
|
|
14
22
|
/**
|
|
15
23
|
* 非 PROD 环境注入联调信息:sofa -> sofa-group-name 头,pspId -> 请求参数,
|
|
@@ -25,5 +33,5 @@ export declare function getDevGatewayConfig(clientName: string): {
|
|
|
25
33
|
};
|
|
26
34
|
/** 联调环境判定:DEV/TEST 走无鉴权 HTTP 直连,PRE/PROD 走带鉴权容器通道 */
|
|
27
35
|
export declare function isDevLikeEnv(): boolean;
|
|
28
|
-
/**
|
|
36
|
+
/** 测试用:重置模块级缓存(含参数注入与 URL 解析) */
|
|
29
37
|
export declare function resetDevEnvCache(): void;
|
package/dist/mp_web/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { VoyagerRequestOptions } from '../types';
|
|
2
|
-
export
|
|
1
|
+
import type { VoyagerDevEnvOptions, VoyagerRequestOptions } from '../types';
|
|
2
|
+
export type { VoyagerDevEnvOptions };
|
|
3
|
+
export declare function request<TResponse = unknown, TParams extends Record<string, unknown> = Record<string, unknown>>(options: VoyagerRequestOptions<TParams>, devEnv?: VoyagerDevEnvOptions): Promise<TResponse>;
|