@cloudbase/manager-node 5.6.0-beta.2 → 5.6.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/lib/integration/index.js +13 -10
- package/package.json +1 -1
package/lib/integration/index.js
CHANGED
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
23
23
|
exports.IntegrationService = void 0;
|
|
24
24
|
const error_1 = require("../error");
|
|
25
25
|
const utils_1 = require("../utils");
|
|
26
|
+
const constants_1 = require("./constants");
|
|
26
27
|
__exportStar(require("./types"), exports);
|
|
27
28
|
/**
|
|
28
29
|
* 集成中心(UserKey)服务
|
|
@@ -41,7 +42,7 @@ class IntegrationService {
|
|
|
41
42
|
// =========== 只读 API ===========
|
|
42
43
|
/** 列出集成模板(密钥对模版列表) */
|
|
43
44
|
async listTemplates(params = {}) {
|
|
44
|
-
var _a, _b;
|
|
45
|
+
var _a, _b, _c;
|
|
45
46
|
const { envId } = this.getEnvInfo();
|
|
46
47
|
return this.tcbService.request('GetUserKeyTemplateList', {
|
|
47
48
|
EnvId: envId,
|
|
@@ -49,12 +50,12 @@ class IntegrationService {
|
|
|
49
50
|
Limit: (_b = params.limit) !== null && _b !== void 0 ? _b : 100,
|
|
50
51
|
AuthTypeCode: params.authTypeCode,
|
|
51
52
|
AuthTypeName: params.authTypeName,
|
|
52
|
-
Business: params.business //
|
|
53
|
+
Business: (_c = params.business) !== null && _c !== void 0 ? _c : constants_1.USER_KEY_BUSINESS // 默认 integration
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
/** 列出集成实例(密钥对列表) */
|
|
56
57
|
async listUserKeys(params = {}) {
|
|
57
|
-
var _a, _b;
|
|
58
|
+
var _a, _b, _c;
|
|
58
59
|
const { envId } = this.getEnvInfo();
|
|
59
60
|
return this.tcbService.request('GetUserKeyList', {
|
|
60
61
|
EnvId: envId,
|
|
@@ -62,19 +63,19 @@ class IntegrationService {
|
|
|
62
63
|
Limit: (_b = params.limit) !== null && _b !== void 0 ? _b : 100,
|
|
63
64
|
Name: params.name,
|
|
64
65
|
AuthTypeCode: params.authTypeCode,
|
|
65
|
-
Business: params.business //
|
|
66
|
+
Business: (_c = params.business) !== null && _c !== void 0 ? _c : constants_1.USER_KEY_BUSINESS // 默认 integration
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
/** 查询单个集成实例详情 */
|
|
69
70
|
async getUserKey(params) {
|
|
70
|
-
var _a;
|
|
71
|
+
var _a, _b;
|
|
71
72
|
this.validateRequiredParams(params, ['keyId']);
|
|
72
73
|
const { envId } = this.getEnvInfo();
|
|
73
74
|
return this.tcbService.request('GetOneUserKey', {
|
|
74
75
|
EnvId: envId,
|
|
75
76
|
KeyID: params.keyId,
|
|
76
77
|
NeedPwd: (_a = params.needPwd) !== null && _a !== void 0 ? _a : false,
|
|
77
|
-
Business: params.business //
|
|
78
|
+
Business: (_b = params.business) !== null && _b !== void 0 ? _b : constants_1.USER_KEY_BUSINESS // 默认 integration
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
// =========== 写 API ===========
|
|
@@ -85,6 +86,7 @@ class IntegrationService {
|
|
|
85
86
|
* 加密),本方法不做任何解析或加工,原样传递给云 API。
|
|
86
87
|
*/
|
|
87
88
|
async createUserKey(params) {
|
|
89
|
+
var _a;
|
|
88
90
|
this.validateRequiredParams(params, ['name', 'authTypeCode']);
|
|
89
91
|
const { envId } = this.getEnvInfo();
|
|
90
92
|
return this.tcbService.request('CreateUserKey', {
|
|
@@ -95,9 +97,9 @@ class IntegrationService {
|
|
|
95
97
|
Description: params.description,
|
|
96
98
|
Ext: params.ext,
|
|
97
99
|
TicketID: params.ticketId,
|
|
98
|
-
Business: params.business, //
|
|
99
|
-
DemoCodeFunctionName: params.demoCodeFunctionName,
|
|
100
|
-
RuntimeConfig: params.runtimeConfig
|
|
100
|
+
Business: (_a = params.business) !== null && _a !== void 0 ? _a : constants_1.USER_KEY_BUSINESS, // 默认 integration
|
|
101
|
+
DemoCodeFunctionName: params.demoCodeFunctionName,
|
|
102
|
+
RuntimeConfig: params.runtimeConfig
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
@@ -107,6 +109,7 @@ class IntegrationService {
|
|
|
107
109
|
* "敏感字段加密"等编排后传入;未传 `ext` 时后端保留原有 Ext 不变。
|
|
108
110
|
*/
|
|
109
111
|
async updateUserKey(params) {
|
|
112
|
+
var _a;
|
|
110
113
|
this.validateRequiredParams(params, ['keyId']);
|
|
111
114
|
const { envId } = this.getEnvInfo();
|
|
112
115
|
return this.tcbService.request('UpdateUserKey', {
|
|
@@ -117,7 +120,7 @@ class IntegrationService {
|
|
|
117
120
|
Description: params.description,
|
|
118
121
|
Ext: params.ext,
|
|
119
122
|
DemoCodeFunctionName: params.demoCodeFunctionName,
|
|
120
|
-
Business: params.business,
|
|
123
|
+
Business: (_a = params.business) !== null && _a !== void 0 ? _a : constants_1.USER_KEY_BUSINESS, // 默认 integration
|
|
121
124
|
RuntimeConfig: params.runtimeConfig
|
|
122
125
|
});
|
|
123
126
|
}
|