@cloudbase/manager-node 4.7.4 → 4.7.5-beta.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/env/index.js +24 -0
- package/package.json +1 -1
- package/types/env/index.d.ts +57 -0
package/lib/env/index.js
CHANGED
|
@@ -240,6 +240,30 @@ class EnvService {
|
|
|
240
240
|
EnvId: this.envId
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* 创建环境订单
|
|
245
|
+
*/
|
|
246
|
+
async createBillingDeal(params) {
|
|
247
|
+
return this.cloudService.request('CreateBillDeal', Object.assign({}, params));
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* 取消未支付的订单
|
|
251
|
+
*/
|
|
252
|
+
async cancelDeal(params) {
|
|
253
|
+
return this.cloudService.request('CancelDeal', Object.assign({}, params));
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* 删除已取消的订单
|
|
257
|
+
*/
|
|
258
|
+
// public async deleteDeal(params: {
|
|
259
|
+
// TranId: string
|
|
260
|
+
// UserClientIp: string
|
|
261
|
+
// WxAppId?: string
|
|
262
|
+
// }) {
|
|
263
|
+
// return this.cloudService.request<any>('DeleteDeal', {
|
|
264
|
+
// ...params
|
|
265
|
+
// })
|
|
266
|
+
// }
|
|
243
267
|
// 获取 COS CORS 域名
|
|
244
268
|
async getCOSDomains() {
|
|
245
269
|
const cos = this.getCos();
|
package/package.json
CHANGED
package/types/env/index.d.ts
CHANGED
|
@@ -63,6 +63,42 @@ interface IInitParam {
|
|
|
63
63
|
Channel?: string;
|
|
64
64
|
Source?: string;
|
|
65
65
|
}
|
|
66
|
+
interface CreateBillingDealParams {
|
|
67
|
+
/** 下单操作类型 purchase 购买 | renew 续费 | modify 变配 */
|
|
68
|
+
DealType: 'purchase' | 'renew' | 'modify';
|
|
69
|
+
/** 购买的产品类型,可取[tcb-baas,tcb-promotion,tcb-package], 分别代表baas套餐、大促包、资源包 */
|
|
70
|
+
ProductType: 'tcb-baas' | 'tcb-promotion' | 'tcb-package';
|
|
71
|
+
/** 目标下单产品/套餐Id */
|
|
72
|
+
PackageId: string;
|
|
73
|
+
/** 是否自动支付 */
|
|
74
|
+
CreateAndPay?: boolean;
|
|
75
|
+
/** 购买时长 */
|
|
76
|
+
TimeSpan?: number;
|
|
77
|
+
/** 购买时长单位 d 天 | m 月 | y 年 | p 一次性 */
|
|
78
|
+
TimeUnit?: 'd' | 'm' | 'y' | 'p';
|
|
79
|
+
/** 资源唯一标识符 */
|
|
80
|
+
ResourceId?: string;
|
|
81
|
+
/** 来源 */
|
|
82
|
+
Source?: 'qcloud' | 'miniapp';
|
|
83
|
+
/** 资源别名 */
|
|
84
|
+
Alias?: string;
|
|
85
|
+
/** 环境id */
|
|
86
|
+
EnvId?: string;
|
|
87
|
+
/** 开启超限按量计费 */
|
|
88
|
+
EnableExcess?: boolean;
|
|
89
|
+
/** 变配目标产品/套餐id */
|
|
90
|
+
ModifyPackageId?: string;
|
|
91
|
+
/** jsonstr 附加信息 */
|
|
92
|
+
Extension?: string;
|
|
93
|
+
/** 是否自动选择代金券支付 */
|
|
94
|
+
AutoVoucher?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* 资源类型
|
|
97
|
+
* 代表新购环境(DealType=purchase 并且 ProductType=tcb-baas )时需要发货哪些资源。
|
|
98
|
+
* 可取值:flexdb, cos, cdn, scf
|
|
99
|
+
*/
|
|
100
|
+
ResourceTypes?: string[];
|
|
101
|
+
}
|
|
66
102
|
export declare class EnvService {
|
|
67
103
|
private environment;
|
|
68
104
|
private envId;
|
|
@@ -174,6 +210,27 @@ export declare class EnvService {
|
|
|
174
210
|
KeyID: string;
|
|
175
211
|
RequestId: string;
|
|
176
212
|
}>;
|
|
213
|
+
/**
|
|
214
|
+
* 创建环境订单
|
|
215
|
+
*/
|
|
216
|
+
createBillingDeal(params: CreateBillingDealParams): Promise<{
|
|
217
|
+
EnvId: string;
|
|
218
|
+
TranId: string;
|
|
219
|
+
RequestId: string;
|
|
220
|
+
}>;
|
|
221
|
+
/**
|
|
222
|
+
* 取消未支付的订单
|
|
223
|
+
*/
|
|
224
|
+
cancelDeal(params: {
|
|
225
|
+
TranId: string;
|
|
226
|
+
UserClientIp: string;
|
|
227
|
+
WxAppId?: string;
|
|
228
|
+
}): Promise<{
|
|
229
|
+
RequestId: string;
|
|
230
|
+
}>;
|
|
231
|
+
/**
|
|
232
|
+
* 删除已取消的订单
|
|
233
|
+
*/
|
|
177
234
|
private getCOSDomains;
|
|
178
235
|
private modifyCosCorsDomain;
|
|
179
236
|
private getCos;
|