@cloudbase/manager-node 4.11.0-alpha.9 → 5.0.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/jest.config.js CHANGED
@@ -10,6 +10,7 @@ module.exports = {
10
10
  },
11
11
  transformIgnorePatterns: ['node_modules'],
12
12
  testEnvironment: 'node',
13
+ forceExit: true,
13
14
  // https://github.com/facebook/jest/issues/5164
14
15
  globalSetup: './test/global-setup-hook.ts',
15
16
  // globalTeardown: './test/global-teardown-hook.js',
@@ -28,14 +28,14 @@ class AgentService {
28
28
  }
29
29
  // ==================== SCF 云函数部署 ====================
30
30
  /**
31
- * 创建 SCF Agent
31
+ * 创建 Agent
32
32
  * 支持两种方式:
33
33
  * 1. 传入 cwd 代码目录,自动打包上传
34
34
  * 2. 传入 ZipFile / CosBucketRegion + TempCosObjectName,直接上传
35
35
  * @param params 创建参数
36
36
  * @returns Agent 创建结果
37
37
  */
38
- async createScfAgent(params) {
38
+ async createAgent(params) {
39
39
  const envConfig = this.environment.lazyEnvironmentConfig;
40
40
  // 默认会话配置
41
41
  const defaultSessionConfig = {
@@ -622,7 +622,7 @@ class AgentService {
622
622
  exports.AgentService = AgentService;
623
623
  __decorate([
624
624
  (0, utils_1.preLazy)()
625
- ], AgentService.prototype, "createScfAgent", null);
625
+ ], AgentService.prototype, "createAgent", null);
626
626
  __decorate([
627
627
  (0, utils_1.preLazy)()
628
628
  ], AgentService.prototype, "describeAgentList", null);
@@ -346,34 +346,6 @@ class CloudRunService {
346
346
  async getTemplates() {
347
347
  return (0, utils_1.fetchTemplates)(['tcbrFunc', 'tcbrContainer']);
348
348
  }
349
- async _checkFunctionExist(name) {
350
- try {
351
- await this.detail({
352
- serverName: name
353
- });
354
- return true;
355
- }
356
- catch (e) {
357
- if (e.code === 'ResourceNotFound' ||
358
- e.code === 'ResourceNotFound.ServerNotFound' ||
359
- // 备注:以下条件当 NotFound 处理(已与 fisheryan 确认过)
360
- (e.code === 'InvalidParameter' && e.original.Message === 'service data illegal')) {
361
- return false;
362
- }
363
- throw e;
364
- }
365
- }
366
- _upsertFunction(isNew, data) {
367
- const { name, deployInfo, serverConfig } = data;
368
- const envConfig = this.environment.lazyEnvironmentConfig;
369
- const Items = parseObjectToDiffConfigItem(serverConfig);
370
- return this.tcbrService.request(isNew ? 'CreateCloudRunServer' : 'UpdateCloudRunServer', {
371
- EnvId: envConfig.EnvId,
372
- ServerName: name,
373
- DeployInfo: deployInfo,
374
- Items,
375
- });
376
- }
377
349
  /**
378
350
  * 获取部署记录列表,按部署时间倒序(最新在前)
379
351
  */
@@ -408,6 +380,34 @@ class CloudRunService {
408
380
  RunId: params.RunId,
409
381
  });
410
382
  }
383
+ async _checkFunctionExist(name) {
384
+ try {
385
+ await this.detail({
386
+ serverName: name
387
+ });
388
+ return true;
389
+ }
390
+ catch (e) {
391
+ if (e.code === 'ResourceNotFound' ||
392
+ e.code === 'ResourceNotFound.ServerNotFound' ||
393
+ // 备注:以下条件当 NotFound 处理(已与 fisheryan 确认过)
394
+ (e.code === 'InvalidParameter' && e.original.Message === 'service data illegal')) {
395
+ return false;
396
+ }
397
+ throw e;
398
+ }
399
+ }
400
+ _upsertFunction(isNew, data) {
401
+ const { name, deployInfo, serverConfig } = data;
402
+ const envConfig = this.environment.lazyEnvironmentConfig;
403
+ const Items = parseObjectToDiffConfigItem(serverConfig);
404
+ return this.tcbrService.request(isNew ? 'CreateCloudRunServer' : 'UpdateCloudRunServer', {
405
+ EnvId: envConfig.EnvId,
406
+ ServerName: name,
407
+ DeployInfo: deployInfo,
408
+ Items,
409
+ });
410
+ }
411
411
  }
412
412
  exports.CloudRunService = CloudRunService;
413
413
  __decorate([
package/lib/env/index.js CHANGED
@@ -508,6 +508,98 @@ class EnvService {
508
508
  async describeCreditsUsageDetail(params) {
509
509
  return this.cloudService.request('DescribeCreditsUsageDetail', Object.assign({}, params));
510
510
  }
511
+ /**
512
+ * 查询HTTP访问服务域名路由信息
513
+ * @param {DescribeHttpServiceRouteParams} params 查询参数
514
+ * @returns {Promise<DescribeHttpServiceRouteRes>}
515
+ */
516
+ async describeHttpServiceRoute(params) {
517
+ return this.cloudService.request('DescribeHTTPServiceRoute', Object.assign({}, params));
518
+ }
519
+ /**
520
+ * 创建HTTP访问服务域名路由
521
+ * @param {CreateHttpServiceRouteParams} params 创建参数
522
+ * @returns {Promise<CreateHttpServiceRouteRes>}
523
+ */
524
+ async createHttpServiceRoute(params) {
525
+ return this.cloudService.request('CreateHTTPServiceRoute', Object.assign({}, params));
526
+ }
527
+ /**
528
+ * 修改HTTP访问服务域名路由
529
+ * @param {ModifyHttpServiceRouteParams} params 修改参数
530
+ * @returns {Promise<ModifyHttpServiceRouteRes>}
531
+ */
532
+ async modifyHttpServiceRoute(params) {
533
+ return this.cloudService.request('ModifyHTTPServiceRoute', Object.assign({}, params));
534
+ }
535
+ /**
536
+ * 删除HTTP访问服务域名路由
537
+ * @param {DeleteHttpServiceRouteParams} params 删除参数
538
+ * @returns {Promise<DeleteHttpServiceRouteRes>}
539
+ */
540
+ async deleteHttpServiceRoute(params) {
541
+ return this.cloudService.request('DeleteHTTPServiceRoute', Object.assign({}, params));
542
+ }
543
+ /**
544
+ * 绑定自定义域名到HTTP访问服务
545
+ * 底层调用 CreateHTTPServiceRoute API,专用于域名绑定场景
546
+ * @param {BindCustomDomainParams} params 绑定参数
547
+ * @returns {Promise<BindCustomDomainRes>}
548
+ */
549
+ async bindCustomDomain(params) {
550
+ const { EnvId, Domain } = params;
551
+ // 构建域名参数,设置默认值
552
+ const domainParam = {
553
+ Domain: Domain.Domain,
554
+ CertId: Domain.CertId,
555
+ AccessType: Domain.AccessType || 'DIRECT',
556
+ Protocol: Domain.Protocol || 'HTTP_AND_HTTPS',
557
+ Enable: Domain.Enable !== undefined ? Domain.Enable : true
558
+ };
559
+ // 自定义接入类型时需要传入 CustomCname
560
+ if (domainParam.AccessType === 'CUSTOM' && Domain.CustomCname) {
561
+ domainParam.CustomCname = Domain.CustomCname;
562
+ }
563
+ return this.cloudService.request('CreateHTTPServiceRoute', {
564
+ EnvId,
565
+ Domain: domainParam
566
+ });
567
+ }
568
+ /**
569
+ * 删除自定义域名
570
+ * 仅当域名下无路由绑定时可删除,否则抛出错误
571
+ * @param {DeleteCustomDomainParams} params 删除参数
572
+ * @returns {Promise<DeleteCustomDomainRes>}
573
+ */
574
+ async deleteCustomDomain(params) {
575
+ const { EnvId, Domain } = params;
576
+ // 查询domain下的路由
577
+ const queryRes = await this.describeHttpServiceRoute({
578
+ EnvId,
579
+ Filters: [
580
+ {
581
+ Name: 'Domain',
582
+ Values: [Domain]
583
+ }
584
+ ]
585
+ });
586
+ const domains = queryRes.Domains || [];
587
+ const targetDomain = domains.find(d => d.Domain === Domain);
588
+ if (!targetDomain) {
589
+ throw new error_1.CloudBaseError(`Domain ${Domain} does not exist`);
590
+ }
591
+ // 检查是否有路由绑定
592
+ const routes = targetDomain.Routes || [];
593
+ if (routes.length > 0) {
594
+ const routePaths = routes.map(r => r.Path).join(', ');
595
+ throw new error_1.CloudBaseError(`Domain ${Domain} has ${routes.length} route binding(s) (${routePaths}). Please delete the routes before deleting the domain.`);
596
+ }
597
+ // 无路由绑定,可以删除域名
598
+ return this.cloudService.request('DeleteHTTPServiceRoute', {
599
+ EnvId,
600
+ Domain
601
+ });
602
+ }
511
603
  // 获取 COS CORS 域名
512
604
  async getCOSDomains() {
513
605
  const cos = this.getCos();
@@ -25,7 +25,9 @@ class PermissionService {
25
25
  if (!resourceType || !PERMISSION_BY_RESOURCE[resourceType]) {
26
26
  throw new Error('Invalid resourceType');
27
27
  }
28
- if (typeof resource !== 'string' || resource.trim().length === 0) {
28
+ const isFunctionResourceType = resourceType === 'function';
29
+ const hasValidResourceValue = typeof resource === 'string' && resource.trim().length > 0;
30
+ if (!isFunctionResourceType && !hasValidResourceValue) {
29
31
  throw new Error('Invalid resource');
30
32
  }
31
33
  const allowed = PERMISSION_BY_RESOURCE[resourceType];
@@ -43,12 +45,7 @@ class PermissionService {
43
45
  // throw new Error('securityRule must be a valid JSON string')
44
46
  // }
45
47
  }
46
- const reqData = {
47
- EnvId,
48
- ResourceType: resourceType,
49
- Resource: resource,
50
- Permission: permission
51
- };
48
+ const reqData = Object.assign({ EnvId, ResourceType: resourceType, Permission: permission }, (hasValidResourceValue || !isFunctionResourceType ? { Resource: resource } : {}));
52
49
  if (permission === 'CUSTOM') {
53
50
  reqData.SecurityRule = securityRule;
54
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/manager-node",
3
- "version": "4.11.0-alpha.9",
3
+ "version": "5.0.0",
4
4
  "description": "The node manage service api for cloudbase.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -52,7 +52,7 @@
52
52
  "node-fetch": "^2.6.0",
53
53
  "query-string": "^6.8.3",
54
54
  "unzipper": "^0.12.3",
55
- "uuid": "^13.0.0",
55
+ "uuid": "^9.0.0",
56
56
  "walkdir": "^0.4.1"
57
57
  },
58
58
  "husky": {
@@ -1,5 +1,5 @@
1
1
  import { Environment } from '../environment';
2
- import { ICreateFunctionAgentParams, ICreateScfAgentParams, ICreateTcbrAgentByImageParams, ICreateTcbrAgentByPackageParams, ICreateTcbrAgentByCodeParams, IDescribeAgentListParams, IDescribeAgentListResponse, IDescribeAgentResponse, IDeleteAgentParams, IDescribeCloudBaseBuildServiceParams, IDescribeCloudBaseBuildServiceResponse, ICreateAgentResponse, IDeleteAgentResponse, ICommonResponse, IUpdateAgentParams, IUpdateScfAgentParams, IUpdateScfAgentResponse, IUpdateTcbrAgentParams, IGetAgentLogsParams } from './type';
2
+ import { ICreateFunctionAgentParams, ICreateAgentParams, ICreateTcbrAgentByImageParams, ICreateTcbrAgentByPackageParams, ICreateTcbrAgentByCodeParams, IDescribeAgentListParams, IDescribeAgentListResponse, IDescribeAgentResponse, IDeleteAgentParams, IDescribeCloudBaseBuildServiceParams, IDescribeCloudBaseBuildServiceResponse, ICreateAgentResponse, IDeleteAgentResponse, ICommonResponse, IUpdateAgentParams, IUpdateScfAgentParams, IUpdateScfAgentResponse, IUpdateTcbrAgentParams, IGetAgentLogsParams } from './type';
3
3
  /**
4
4
  * Agent 管理类
5
5
  * 支持三种部署方式:
@@ -12,14 +12,14 @@ export declare class AgentService {
12
12
  private tcbService;
13
13
  constructor(environment: Environment);
14
14
  /**
15
- * 创建 SCF Agent
15
+ * 创建 Agent
16
16
  * 支持两种方式:
17
17
  * 1. 传入 cwd 代码目录,自动打包上传
18
18
  * 2. 传入 ZipFile / CosBucketRegion + TempCosObjectName,直接上传
19
19
  * @param params 创建参数
20
20
  * @returns Agent 创建结果
21
21
  */
22
- createScfAgent(params: ICreateScfAgentParams): Promise<ICreateAgentResponse>;
22
+ createAgent(params: ICreateAgentParams): Promise<ICreateAgentResponse>;
23
23
  /**
24
24
  * 查询 Agent 列表
25
25
  * @param params 查询参数
@@ -28,12 +28,12 @@ export interface ISessionConfig {
28
28
  MaxConcurrency?: number;
29
29
  }
30
30
  /**
31
- * 创建 SCF Agent 的参数
31
+ * 创建 Agent 的参数
32
32
  * 支持两种方式:
33
33
  * 1. 传入 cwd 代码目录,自动打包上传
34
34
  * 2. 传入 ZipFile / CosBucketRegion + TempCosObjectName,直接上传
35
35
  */
36
- export interface ICreateScfAgentParams {
36
+ export interface ICreateAgentParams {
37
37
  /** Agent 名称 */
38
38
  Name: string;
39
39
  /** Agent ID,不传则自动生成 */
@@ -135,8 +135,6 @@ export declare class CloudRunService {
135
135
  * @returns {Promise<ITemplate[]>} 返回模板数组
136
136
  */
137
137
  getTemplates(): Promise<ITemplate[]>;
138
- private _checkFunctionExist;
139
- private _upsertFunction;
140
138
  /**
141
139
  * 获取部署记录列表,按部署时间倒序(最新在前)
142
140
  */
@@ -150,6 +148,8 @@ export declare class CloudRunService {
150
148
  getProcessLog(params: {
151
149
  RunId: string;
152
150
  }): Promise<IProcessLogResponse>;
151
+ private _checkFunctionExist;
152
+ private _upsertFunction;
153
153
  }
154
154
  export declare function codeToZip(cwd: string, options?: {
155
155
  installDependency?: boolean;
@@ -38,10 +38,12 @@ export interface ICloudrunServerBaseInfo {
38
38
  */
39
39
  CustomDomainName: string;
40
40
  /**
41
- * 服务状态
42
- * @example "running" | "deploying" | "deploy_failed"
41
+ * 服务状态(来自 DescribeCloudRunServers)
42
+ * 常见值:"creating" | "create_failed" | "freezing" | "freeze_fail" | "froze" |
43
+ * "unfreezing" | "unfreeze_fail" | "normal" | "deleting" | "delete_failed" | "abnormal"
44
+ * @example "normal"
43
45
  */
44
- Status: 'running' | 'deploying' | 'deploy_failed';
46
+ Status: 'creating' | 'create_failed' | 'freezing' | 'freeze_fail' | 'froze' | 'unfreezing' | 'unfreeze_fail' | 'normal' | 'deleting' | 'delete_failed' | 'abnormal';
45
47
  /**
46
48
  * 更新时间
47
49
  * @example "2022-03-09 14:00:00"
@@ -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 } from './type';
3
+ import { CalculatePackageCreatePriceParams, CalculatePackageRenewPriceParams, CalculatePackageModifyPriceParams, DescribeHttpServiceRouteParams, DescribeHttpServiceRouteRes, CreateHttpServiceRouteParams, CreateHttpServiceRouteRes, ModifyHttpServiceRouteParams, ModifyHttpServiceRouteRes, DeleteHttpServiceRouteParams, DeleteHttpServiceRouteRes, BindCustomDomainParams, BindCustomDomainRes, DeleteCustomDomainParams, DeleteCustomDomainRes } from './type';
4
4
  import { CreateBillingDealParams, CreateEnvParams, BaasPackageInfo, DescribeBaasPackageListParams, ModifyEnvPlanParams, RenewEnvParams, DestroyEnvParams, DescribeEnvsParams, DescribeEnvAccountCircleParams, DescribeEnvAccountCircleRes, DescribeCreditsUsageDetailParams, EnvPkgCreditsUsage } from '../interfaces/tcb.interface';
5
5
  type SOURCE = 'miniapp' | 'qcloud';
6
6
  interface IDeleteDomainRes {
@@ -264,6 +264,44 @@ export declare class EnvService {
264
264
  Usages: EnvPkgCreditsUsage[];
265
265
  RequestId: string;
266
266
  }>;
267
+ /**
268
+ * 查询HTTP访问服务域名路由信息
269
+ * @param {DescribeHttpServiceRouteParams} params 查询参数
270
+ * @returns {Promise<DescribeHttpServiceRouteRes>}
271
+ */
272
+ describeHttpServiceRoute(params: DescribeHttpServiceRouteParams): Promise<DescribeHttpServiceRouteRes>;
273
+ /**
274
+ * 创建HTTP访问服务域名路由
275
+ * @param {CreateHttpServiceRouteParams} params 创建参数
276
+ * @returns {Promise<CreateHttpServiceRouteRes>}
277
+ */
278
+ createHttpServiceRoute(params: CreateHttpServiceRouteParams): Promise<CreateHttpServiceRouteRes>;
279
+ /**
280
+ * 修改HTTP访问服务域名路由
281
+ * @param {ModifyHttpServiceRouteParams} params 修改参数
282
+ * @returns {Promise<ModifyHttpServiceRouteRes>}
283
+ */
284
+ modifyHttpServiceRoute(params: ModifyHttpServiceRouteParams): Promise<ModifyHttpServiceRouteRes>;
285
+ /**
286
+ * 删除HTTP访问服务域名路由
287
+ * @param {DeleteHttpServiceRouteParams} params 删除参数
288
+ * @returns {Promise<DeleteHttpServiceRouteRes>}
289
+ */
290
+ deleteHttpServiceRoute(params: DeleteHttpServiceRouteParams): Promise<DeleteHttpServiceRouteRes>;
291
+ /**
292
+ * 绑定自定义域名到HTTP访问服务
293
+ * 底层调用 CreateHTTPServiceRoute API,专用于域名绑定场景
294
+ * @param {BindCustomDomainParams} params 绑定参数
295
+ * @returns {Promise<BindCustomDomainRes>}
296
+ */
297
+ bindCustomDomain(params: BindCustomDomainParams): Promise<BindCustomDomainRes>;
298
+ /**
299
+ * 删除自定义域名
300
+ * 仅当域名下无路由绑定时可删除,否则抛出错误
301
+ * @param {DeleteCustomDomainParams} params 删除参数
302
+ * @returns {Promise<DeleteCustomDomainRes>}
303
+ */
304
+ deleteCustomDomain(params: DeleteCustomDomainParams): Promise<DeleteCustomDomainRes>;
267
305
  private getCOSDomains;
268
306
  private modifyCosCorsDomain;
269
307
  private getCos;
@@ -14,3 +14,190 @@ export interface CalculatePackageModifyPriceParams {
14
14
  envId: string;
15
15
  currency?: 'CNY' | 'USD';
16
16
  }
17
+ /**
18
+ * 客户端限频配置
19
+ */
20
+ export interface HTTPServiceQPSPerClient {
21
+ LimitBy?: 'UserID' | 'ClientIP';
22
+ LimitValue?: number;
23
+ }
24
+ /**
25
+ * QPS限频策略
26
+ */
27
+ export interface HTTPServiceRouteQPSPolicy {
28
+ QPSTotal?: number;
29
+ QPSPerClient?: HTTPServiceQPSPerClient;
30
+ }
31
+ /**
32
+ * 路径重写
33
+ */
34
+ export interface HTTPServicePathRewrite {
35
+ StaticStorePrefix?: string;
36
+ Prefix?: string;
37
+ }
38
+ /**
39
+ * HTTP访问服务路由信息
40
+ */
41
+ export interface HTTPServiceRoute {
42
+ Path: string;
43
+ PathRewrite?: HTTPServicePathRewrite;
44
+ UpstreamResourceType: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
45
+ UpstreamResourceName: string;
46
+ EnableSafeDomain: boolean;
47
+ EnableAuth: boolean;
48
+ EnablePathTransmission: boolean;
49
+ QPSPolicy?: HTTPServiceRouteQPSPolicy;
50
+ Enable: boolean;
51
+ CreateTime: string;
52
+ UpdateTime: string;
53
+ }
54
+ /**
55
+ * 域名路由信息
56
+ */
57
+ export interface HTTPServiceDomain {
58
+ Domain: string;
59
+ DomainType: 'HTTPSERVICE' | 'CBR' | 'ANYSERVICE' | 'AI_AGENT' | 'VM' | 'INTEGRATION_CALLBACK';
60
+ AccessType: 'DIRECT' | 'CDN' | 'CUSTOM';
61
+ CertId: string;
62
+ Protocol: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
63
+ Cname: string;
64
+ IsDefault: boolean;
65
+ Enable: boolean;
66
+ Status: 'PROCESSING' | 'FAIL' | 'SUCCESS';
67
+ DNSStatus: 'OK' | 'INVALID';
68
+ Routes?: HTTPServiceRoute[];
69
+ CreateTime: string;
70
+ UpdateTime: string;
71
+ }
72
+ /**
73
+ * 过滤条件
74
+ */
75
+ export interface HTTPServiceRouteFilter {
76
+ Name?: 'Domain' | 'Path' | 'DomainType' | 'UpstreamResourceType';
77
+ Values?: string[];
78
+ }
79
+ /**
80
+ * DescribeHTTPServiceRoute 请求参数
81
+ */
82
+ export interface DescribeHttpServiceRouteParams {
83
+ EnvId: string;
84
+ Filters?: HTTPServiceRouteFilter[];
85
+ Offset?: number;
86
+ Limit?: number;
87
+ }
88
+ /**
89
+ * DescribeHTTPServiceRoute 返回结果
90
+ */
91
+ export interface DescribeHttpServiceRouteRes {
92
+ Domains?: HTTPServiceDomain[];
93
+ OriginDomain: string;
94
+ TotalCount: number;
95
+ RequestId: string;
96
+ }
97
+ /**
98
+ * HTTP访问服务路由参数(创建/修改)
99
+ */
100
+ export interface HTTPServiceRouteParam {
101
+ Path: string;
102
+ UpstreamResourceType?: 'SCF' | 'CBR' | 'STATIC_STORE' | 'WEB_SCF' | 'LH';
103
+ UpstreamResourceName?: string;
104
+ PathRewrite?: HTTPServicePathRewrite;
105
+ EnableSafeDomain?: boolean;
106
+ EnableAuth?: boolean;
107
+ EnablePathTransmission?: boolean;
108
+ QPSPolicy?: HTTPServiceRouteQPSPolicy;
109
+ Enable?: boolean;
110
+ }
111
+ /**
112
+ * HTTP访问服务域名参数(创建/修改)
113
+ */
114
+ export interface HTTPServiceDomainParam {
115
+ Domain: string;
116
+ AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM';
117
+ CertId?: string;
118
+ Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
119
+ CustomCname?: string;
120
+ Enable?: boolean;
121
+ Routes?: HTTPServiceRouteParam[];
122
+ }
123
+ /**
124
+ * CreateHTTPServiceRoute 请求参数
125
+ */
126
+ export interface CreateHttpServiceRouteParams {
127
+ EnvId: string;
128
+ Domain: HTTPServiceDomainParam;
129
+ }
130
+ /**
131
+ * CreateHTTPServiceRoute 返回结果
132
+ */
133
+ export interface CreateHttpServiceRouteRes {
134
+ RequestId: string;
135
+ }
136
+ /**
137
+ * ModifyHTTPServiceRoute 请求参数
138
+ */
139
+ export interface ModifyHttpServiceRouteParams {
140
+ EnvId: string;
141
+ Domain: HTTPServiceDomainParam;
142
+ }
143
+ /**
144
+ * ModifyHTTPServiceRoute 返回结果
145
+ */
146
+ export interface ModifyHttpServiceRouteRes {
147
+ RequestId: string;
148
+ }
149
+ /**
150
+ * DeleteHTTPServiceRoute 请求参数
151
+ */
152
+ export interface DeleteHttpServiceRouteParams {
153
+ EnvId: string;
154
+ Domain: string;
155
+ Paths?: string[];
156
+ }
157
+ /**
158
+ * DeleteHTTPServiceRoute 返回结果
159
+ */
160
+ export interface DeleteHttpServiceRouteRes {
161
+ RequestId: string;
162
+ }
163
+ /**
164
+ * 绑定自定义域名的域名参数
165
+ * 与 HTTPServiceDomainParam 类似,但不包含 Routes(绑定域名场景)
166
+ */
167
+ export interface BindCustomDomainDomainParam {
168
+ Domain: string;
169
+ CertId: string;
170
+ AccessType?: 'DIRECT' | 'CDN' | 'CUSTOM';
171
+ Protocol?: 'HTTP_AND_HTTPS' | 'HTTP_TO_HTTPS' | 'HTTPS_TO_HTTP';
172
+ Enable?: boolean;
173
+ CustomCname?: string;
174
+ }
175
+ /**
176
+ * BindCustomDomain 请求参数
177
+ * 用于绑定自定义域名到 HTTP 访问服务
178
+ * 底层调用 CreateHTTPServiceRoute API,但参数配置不同
179
+ */
180
+ export interface BindCustomDomainParams {
181
+ EnvId: string;
182
+ Domain: BindCustomDomainDomainParam;
183
+ }
184
+ /**
185
+ * BindCustomDomain 返回结果
186
+ */
187
+ export interface BindCustomDomainRes {
188
+ RequestId: string;
189
+ }
190
+ /**
191
+ * DeleteCustomDomain 请求参数
192
+ * 用于删除自定义域名(仅当域名下无路由绑定时可删除)
193
+ */
194
+ export interface DeleteCustomDomainParams {
195
+ EnvId: string;
196
+ Domain: string;
197
+ }
198
+ /**
199
+ * DeleteCustomDomain 返回结果
200
+ */
201
+ export interface DeleteCustomDomainRes {
202
+ RequestId: string;
203
+ }
@@ -2,7 +2,7 @@ export type PermissionResourceType = 'function' | 'storage' | 'table' | 'collect
2
2
  export type BasePermission = 'READONLY' | 'PRIVATE' | 'ADMINWRITE' | 'ADMINONLY' | 'CUSTOM';
3
3
  export interface ModifyResourcePermissionOptions {
4
4
  resourceType: PermissionResourceType;
5
- resource: string;
5
+ resource?: string;
6
6
  permission: BasePermission;
7
7
  securityRule?: string;
8
8
  }