module-develop-kit 0.2.2 → 0.3.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/index.d.ts +8 -9
- package/dist/index.es.js +2840 -2212
- package/dist/index.umd.js +3 -3
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -43,17 +43,16 @@ declare type TData = _TData | _TData[];
|
|
|
43
43
|
|
|
44
44
|
declare type _TData = null | undefined | number | string | Record<string, any>;
|
|
45
45
|
|
|
46
|
+
declare type TEncryptionType = "sm4" | "ase";
|
|
47
|
+
|
|
46
48
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param
|
|
51
|
-
* @
|
|
52
|
-
* @return 返回一个对象,包含加密后的数据和相关的HTTP头部信息。
|
|
53
|
-
* 其中,headers包含初始化向量(iv)和内容类型(Content-Type),
|
|
54
|
-
* data包含加密后的数据主体。
|
|
49
|
+
* 传输数据加密方法,用于在发送数据前对其进行加密。
|
|
50
|
+
* @param key - 加密使用的密钥字符串。
|
|
51
|
+
* @param _data - 待加密的数据对象,默认为undefined。
|
|
52
|
+
* @param type - 加密算法类型,可选值包括"sm4"和"ase",默认使用"ase"。
|
|
53
|
+
* @returns 返回一个对象,包含headers(含有初始化向量iv及Content-Type)和data(含有加密后的body),适用于HTTP请求的格式。
|
|
55
54
|
*/
|
|
56
|
-
export declare function transmissionDataEncryption(key: string,
|
|
55
|
+
export declare function transmissionDataEncryption(key: string, _data?: TData, type?: TEncryptionType): {
|
|
57
56
|
headers: {
|
|
58
57
|
iv: string;
|
|
59
58
|
"Content-Type": string;
|