@cloudbase/manager-node 5.7.1-beta.0 → 5.7.1-beta.1

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 CHANGED
@@ -28,6 +28,7 @@ class EnvService {
28
28
  this.tcbService = new utils_1.CloudService(environment.cloudBaseContext, 'tcb', '2018-06-08');
29
29
  this.commonService = environment.getCommonService('lowcode', '2021-01-08');
30
30
  this.billingService = new billing_1.BillingService(environment.cloudBaseContext);
31
+ this.certificateCloudService = new utils_1.CloudService(environment.cloudBaseContext, 'ssl', '2019-12-05');
31
32
  this.tokenCache = new Map();
32
33
  }
33
34
  /**
@@ -769,6 +770,23 @@ class EnvService {
769
770
  async describeCreditsUsageDetail(params) {
770
771
  return this.cloudService.request('DescribeCreditsUsageDetail', Object.assign({}, params));
771
772
  }
773
+ /**
774
+ * 获取当前凭证有权限访问的 SSL 证书列表。
775
+ *
776
+ * 证书用于自定义域名 HTTPS 配置,本接口不依赖 CloudBase 环境信息。
777
+ * @param {DescribeCertificatesParams} params 查询参数
778
+ * @returns {Promise<DescribeCertificatesRes>}
779
+ */
780
+ async describeCertificates(params = {}) {
781
+ if (params.Offset !== undefined && (!Number.isInteger(params.Offset) || params.Offset < 0)) {
782
+ throw new error_1.CloudBaseError('Offset 必须是大于等于 0 的整数');
783
+ }
784
+ if (params.Limit !== undefined &&
785
+ (!Number.isInteger(params.Limit) || params.Limit < 1 || params.Limit > 1000)) {
786
+ throw new error_1.CloudBaseError('Limit 必须是 1 至 1000 的整数');
787
+ }
788
+ return this.certificateCloudService.request('DescribeCertificates', params);
789
+ }
772
790
  /**
773
791
  * 查询HTTP访问服务域名路由信息
774
792
  * @param {DescribeHttpServiceRouteParams} params 查询参数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/manager-node",
3
- "version": "5.7.1-beta.0",
3
+ "version": "5.7.1-beta.1",
4
4
  "description": "The node manage service api for cloudbase.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  import { Environment } from '../environment';
2
2
  import { IResponseInfo, AuthDomain, EnvInfo, LoginConfigItem, ICheckTcbServiceRes, ICreatePostpayRes, EnvBillingInfoItem, PriceResult } from '../interfaces';
3
- import { CalculatePackageCreatePriceParams, CalculatePackageRenewPriceParams, CalculatePackageModifyPriceParams, DescribeHttpServiceRouteParams, DescribeHttpServiceRouteRes, VerifyHttpServiceRouteParams, VerifyHttpServiceRouteRes, CreateHttpServiceRouteParams, CreateHttpServiceRouteRes, ModifyHttpServiceRouteParams, ModifyHttpServiceRouteRes, DeleteHttpServiceRouteParams, DeleteHttpServiceRouteRes, BindCustomDomainParams, BindCustomDomainRes, DeleteCustomDomainParams, DeleteCustomDomainRes } from './type';
3
+ import { CalculatePackageCreatePriceParams, CalculatePackageRenewPriceParams, CalculatePackageModifyPriceParams, DescribeHttpServiceRouteParams, DescribeHttpServiceRouteRes, VerifyHttpServiceRouteParams, VerifyHttpServiceRouteRes, CreateHttpServiceRouteParams, CreateHttpServiceRouteRes, ModifyHttpServiceRouteParams, ModifyHttpServiceRouteRes, DeleteHttpServiceRouteParams, DeleteHttpServiceRouteRes, BindCustomDomainParams, BindCustomDomainRes, DeleteCustomDomainParams, DeleteCustomDomainRes, DescribeCertificatesParams, DescribeCertificatesRes } from './type';
4
4
  import { CreateBillingDealParams, CreateEnvParams, BaasPackageInfo, DescribeBaasPackageListParams, ModifyEnvPlanParams, RenewEnvParams, DestroyEnvParams, DescribeEnvsParams, DescribeEnvInfoParams, DescribeEnvInfoResponse, DescribeEnvAccountCircleParams, DescribeEnvAccountCircleRes, DescribeCreditsUsageDetailParams, EnvPkgCreditsUsage } from '../interfaces/tcb.interface';
5
5
  type SOURCE = 'miniapp' | 'qcloud';
6
6
  interface IDeleteDomainRes {
@@ -559,6 +559,7 @@ export declare class EnvService {
559
559
  private envType?;
560
560
  private commonService;
561
561
  private billingService;
562
+ private certificateCloudService;
562
563
  private tokenCache;
563
564
  constructor(environment: Environment);
564
565
  /**
@@ -882,6 +883,14 @@ export declare class EnvService {
882
883
  Usages: EnvPkgCreditsUsage[];
883
884
  RequestId: string;
884
885
  }>;
886
+ /**
887
+ * 获取当前凭证有权限访问的 SSL 证书列表。
888
+ *
889
+ * 证书用于自定义域名 HTTPS 配置,本接口不依赖 CloudBase 环境信息。
890
+ * @param {DescribeCertificatesParams} params 查询参数
891
+ * @returns {Promise<DescribeCertificatesRes>}
892
+ */
893
+ describeCertificates(params?: DescribeCertificatesParams): Promise<DescribeCertificatesRes>;
885
894
  /**
886
895
  * 查询HTTP访问服务域名路由信息
887
896
  * @param {DescribeHttpServiceRouteParams} params 查询参数
@@ -14,6 +14,169 @@ export interface CalculatePackageModifyPriceParams {
14
14
  envId: string;
15
15
  currency?: 'CNY' | 'USD';
16
16
  }
17
+ /** 获取 SSL 证书列表请求参数。 */
18
+ export interface DescribeCertificatesParams {
19
+ /** 分页偏移量,从 0 开始。 */
20
+ Offset?: number;
21
+ /** 每页数量,范围为 1 至 1000。 */
22
+ Limit?: number;
23
+ /** 模糊匹配证书 ID、备注名称或证书域名。 */
24
+ SearchKey?: string;
25
+ /** 证书类型:CA 为客户端证书,SVR 为服务器证书。 */
26
+ CertificateType?: 'CA' | 'SVR';
27
+ /** 项目 ID。 */
28
+ ProjectId?: number;
29
+ /** 按证书到期时间排序。 */
30
+ ExpirationSort?: 'ASC' | 'DESC';
31
+ /** 证书状态筛选。 */
32
+ CertificateStatus?: number[];
33
+ /** 是否仅返回可部署证书:1 是,0 否。 */
34
+ Deployable?: 0 | 1;
35
+ /** 是否仅返回上传托管证书:1 是,0 否。 */
36
+ Upload?: 0 | 1;
37
+ /** 是否仅返回可续期证书:1 是,0 否。 */
38
+ Renew?: 0 | 1;
39
+ /** 来源筛选。 */
40
+ FilterSource?: 'upload' | 'buy';
41
+ /** 是否仅返回国密证书:1 是,0 否。 */
42
+ IsSM?: 0 | 1;
43
+ /** 是否仅返回即将过期证书:1 是,0 否。 */
44
+ FilterExpiring?: 0 | 1;
45
+ /** 是否仅返回可托管证书:1 是,0 否。 */
46
+ Hostable?: 0 | 1;
47
+ /** 标签筛选条件。 */
48
+ Tags?: Array<{
49
+ TagKey: string;
50
+ TagValue?: string;
51
+ }>;
52
+ /** 是否仅返回等待签发证书:1 是,0 否。 */
53
+ IsPendingIssue?: 0 | 1;
54
+ /** 指定证书 ID 列表。 */
55
+ CertIds?: string[];
56
+ /** 订阅服务 ID。 */
57
+ ServiceId?: string;
58
+ }
59
+ /** Certificates.CertificateExtra:证书扩展信息。 */
60
+ export interface CertificateExtra {
61
+ DomainNumber: string;
62
+ OriginCertificateId: string | null;
63
+ ReplacedBy: string | null;
64
+ ReplacedFor: string | null;
65
+ RenewOrder: string | null;
66
+ SMCert: number;
67
+ CompanyType: number;
68
+ ServiceRenewCertificateId: string;
69
+ ServiceOriginCertificateId: string;
70
+ }
71
+ /** Certificates.ProjectInfo:项目信息。 */
72
+ export interface ProjectInfo {
73
+ ProjectName: string;
74
+ ProjectCreatorUin: number;
75
+ ProjectCreateTime: string;
76
+ ProjectResume: string;
77
+ OwnerUin: number;
78
+ ProjectId: string;
79
+ }
80
+ /** Certificates.PreAuditInfo:证书预审核信息。 */
81
+ export interface PreAuditInfo {
82
+ TotalPeriod: number;
83
+ NowPeriod: number;
84
+ ManagerId: string;
85
+ }
86
+ /** Certificates.HostingConfig:托管配置。 */
87
+ export interface HostingConfig {
88
+ ReplaceTime?: number;
89
+ MessageTypes?: number[];
90
+ ReplaceStartTime?: string;
91
+ ReplaceEndTime?: string;
92
+ }
93
+ /** Certificates.SupportDownloadType:支持下载的服务器格式。 */
94
+ export interface SupportDownloadType {
95
+ NGINX: boolean;
96
+ APACHE: boolean;
97
+ TOMCAT: boolean;
98
+ IIS: boolean;
99
+ JKS: boolean;
100
+ OTHER: boolean;
101
+ ROOT: boolean;
102
+ }
103
+ /** Certificates.Tags:标签信息。 */
104
+ export interface CertificateTag {
105
+ TagKey: string;
106
+ TagValue: string;
107
+ }
108
+ /** SSL 证书列表项,对应 DescribeCertificates 响应中的 Certificates 元素。 */
109
+ export interface Certificates {
110
+ OwnerUin: string;
111
+ ProjectId: string;
112
+ From: string;
113
+ PackageType: string;
114
+ CertificateType: 'CA' | 'SVR';
115
+ ProductZhName: string;
116
+ Domain: string;
117
+ Alias: string;
118
+ Status: number;
119
+ CertificateExtra: CertificateExtra;
120
+ VulnerabilityStatus: 'INACTIVE' | 'ACTIVE';
121
+ StatusMsg: string;
122
+ VerifyType: 'DNS_AUTO' | 'DNS' | 'FILE' | 'DNS_PROXY' | 'FILE_PROXY';
123
+ CertBeginTime: string;
124
+ CertEndTime: string;
125
+ ValidityPeriod: string;
126
+ InsertTime: string;
127
+ CertificateId: string;
128
+ SubjectAltName: string[];
129
+ PackageTypeName: string;
130
+ StatusName: string;
131
+ IsVip: boolean;
132
+ IsDv: boolean;
133
+ IsWildcard: boolean;
134
+ IsVulnerability: boolean;
135
+ RenewAble: boolean;
136
+ ProjectInfo: ProjectInfo;
137
+ BoundResource: string[];
138
+ Deployable: boolean;
139
+ Tags: CertificateTag[];
140
+ IsIgnore: boolean;
141
+ IsSM: boolean;
142
+ EncryptAlgorithm: string;
143
+ CAEncryptAlgorithms: string[];
144
+ CAEndTimes: string[];
145
+ CACommonNames: string[];
146
+ PreAuditInfo: PreAuditInfo;
147
+ AutoRenewFlag: number;
148
+ HostingStatus: number;
149
+ HostingCompleteTime: string;
150
+ HostingRenewCertId: string;
151
+ HasRenewOrder: string;
152
+ ReplaceOriCertIsDelete: boolean;
153
+ IsExpiring: boolean;
154
+ DVAuthDeadline: string;
155
+ ValidationPassedTime: string;
156
+ CertSANs: string[];
157
+ AwaitingValidationMsg: string;
158
+ AllowDownload: boolean;
159
+ IsDNSPODResolve: boolean;
160
+ IsPackage: boolean;
161
+ KeyPasswordCustomFlag: boolean;
162
+ SupportDownloadType: SupportDownloadType;
163
+ CertRevokedTime: string;
164
+ HostingResourceTypes: string[];
165
+ HostingConfig: HostingConfig | null;
166
+ IsHostingUploadRenewCert: boolean;
167
+ ServiceId: string;
168
+ ServiceStatus: 'initing' | 'running' | 'expired' | 'refunded' | 'nearExpire';
169
+ CertServiceBeginTime: string;
170
+ CertServiceEndTime: string;
171
+ CertServiceShareEnabled: boolean;
172
+ CertServiceValidCertificateCount: number;
173
+ }
174
+ /** 获取 SSL 证书列表响应。 */
175
+ export interface DescribeCertificatesRes {
176
+ TotalCount: number;
177
+ Certificates: Certificates[];
178
+ RequestId: string;
179
+ }
17
180
  /**
18
181
  * 客户端限频配置
19
182
  */