@cloudbase/cli 1.9.9 → 1.10.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.
Files changed (61) hide show
  1. package/lib/commands/common.js +3 -9
  2. package/lib/commands/functions/alias/getRoute.js +98 -0
  3. package/lib/commands/functions/alias/index.js +14 -0
  4. package/lib/commands/functions/alias/setRoute.js +100 -0
  5. package/lib/commands/functions/concurrency/delete.js +70 -0
  6. package/lib/commands/functions/concurrency/index.js +15 -0
  7. package/lib/commands/functions/concurrency/list.js +81 -0
  8. package/lib/commands/functions/concurrency/set.js +72 -0
  9. package/lib/commands/functions/index.js +3 -0
  10. package/lib/commands/functions/list.js +2 -8
  11. package/lib/commands/functions/version/index.js +14 -0
  12. package/lib/commands/functions/version/list.js +96 -0
  13. package/lib/commands/functions/version/publish.js +70 -0
  14. package/lib/commands/lowcode/comps.js +4 -115
  15. package/lib/commands/storage/storage.js +5 -20
  16. package/lib/constant.js +23 -1
  17. package/lib/function/alias.js +53 -0
  18. package/lib/function/concurrency.js +69 -0
  19. package/lib/function/index.js +3 -0
  20. package/lib/function/version.js +51 -0
  21. package/lib/storage.js +2 -5
  22. package/package.json +3 -3
  23. package/src/commands/functions/alias/getRoute.ts +76 -0
  24. package/src/commands/functions/alias/index.ts +2 -0
  25. package/src/commands/functions/alias/setRoute.ts +82 -0
  26. package/src/commands/functions/concurrency/delete.ts +45 -0
  27. package/src/commands/functions/concurrency/index.ts +3 -0
  28. package/src/commands/functions/concurrency/list.ts +58 -0
  29. package/src/commands/functions/concurrency/set.ts +47 -0
  30. package/src/commands/functions/index.ts +3 -0
  31. package/src/commands/functions/list.ts +1 -8
  32. package/src/commands/functions/version/index.ts +2 -0
  33. package/src/commands/functions/version/list.ts +73 -0
  34. package/src/commands/functions/version/publish.ts +43 -0
  35. package/src/constant.ts +24 -0
  36. package/src/function/alias.ts +43 -0
  37. package/src/function/concurrency.ts +57 -0
  38. package/src/function/index.ts +4 -1
  39. package/src/function/version.ts +39 -0
  40. package/src/types.ts +95 -0
  41. package/types/commands/common.d.ts +0 -1
  42. package/types/commands/functions/alias/getRoute.d.ts +13 -0
  43. package/types/commands/functions/alias/index.d.ts +2 -0
  44. package/types/commands/functions/alias/setRoute.d.ts +13 -0
  45. package/types/commands/functions/concurrency/delete.d.ts +13 -0
  46. package/types/commands/functions/concurrency/index.d.ts +3 -0
  47. package/types/commands/functions/concurrency/list.d.ts +13 -0
  48. package/types/commands/functions/concurrency/set.d.ts +13 -0
  49. package/types/commands/functions/index.d.ts +3 -0
  50. package/types/commands/functions/version/index.d.ts +2 -0
  51. package/types/commands/functions/version/list.d.ts +13 -0
  52. package/types/commands/functions/version/publish.d.ts +13 -0
  53. package/types/commands/lowcode/comps.d.ts +3 -26
  54. package/types/commands/storage/storage.d.ts +1 -1
  55. package/types/constant.d.ts +16 -0
  56. package/types/function/alias.d.ts +3 -0
  57. package/types/function/concurrency.d.ts +4 -0
  58. package/types/function/index.d.ts +3 -0
  59. package/types/function/version.d.ts +3 -0
  60. package/types/storage.d.ts +0 -3
  61. package/types/types.d.ts +82 -0
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class getFunctionRoutingConfig extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any): Promise<void>;
13
+ }
@@ -0,0 +1,2 @@
1
+ export * from './setRoute';
2
+ export * from './getRoute';
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class setFunctionRoutingConfig extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any): Promise<void>;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class deleteProvisionedConcurrency extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any): Promise<void>;
13
+ }
@@ -0,0 +1,3 @@
1
+ export * from './delete';
2
+ export * from './list';
3
+ export * from './set';
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class getProvisionedConcurrency extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any, options: any): Promise<void>;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class setProvisionedConcurrency extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any): Promise<void>;
13
+ }
@@ -11,3 +11,6 @@ export * from './trigger-create';
11
11
  export * from './trigger-delete';
12
12
  export * from './code-update';
13
13
  export * from './code-download';
14
+ export * from './version';
15
+ export * from './concurrency';
16
+ export * from './alias';
@@ -0,0 +1,2 @@
1
+ export * from './publish';
2
+ export * from './list';
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class ListFunctionVersion extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any, options: any): Promise<void>;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { Command } from '../../common';
2
+ export declare class PublishFunctionVersion extends Command {
3
+ get options(): {
4
+ cmd: string;
5
+ childCmd: string;
6
+ options: {
7
+ flags: string;
8
+ desc: string;
9
+ }[];
10
+ desc: string;
11
+ };
12
+ execute(ctx: any, params: any): Promise<void>;
13
+ }
@@ -43,35 +43,12 @@ export declare class LowCodePublishComps extends Command {
43
43
  get options(): {
44
44
  cmd: string;
45
45
  childCmd: string;
46
- options: ({
47
- flags: string;
48
- desc: string;
49
- hideHelp?: undefined;
50
- } | {
51
- flags: string;
52
- desc: string;
53
- hideHelp: boolean;
54
- })[];
55
- desc: string;
56
- requiredEnvId: boolean;
57
- };
58
- execute(ctx: any, log: Logger, options: any): Promise<void>;
59
- }
60
- export declare class LowCodePublishVersionComps extends Command {
61
- get options(): {
62
- cmd: string;
63
- childCmd: string;
64
- options: ({
65
- flags: string;
66
- desc: string;
67
- hideHelp?: undefined;
68
- } | {
46
+ options: {
69
47
  flags: string;
70
48
  desc: string;
71
- hideHelp: boolean;
72
- })[];
49
+ }[];
73
50
  desc: string;
74
51
  requiredEnvId: boolean;
75
52
  };
76
- execute(ctx: any, options: any, log?: Logger): Promise<void>;
53
+ execute(ctx: any, log?: Logger): Promise<void>;
77
54
  }
@@ -11,7 +11,7 @@ export declare class UploadCommand extends Command {
11
11
  }[];
12
12
  desc: string;
13
13
  };
14
- execute(envId: any, params: any, options: any, log: Logger): Promise<void>;
14
+ execute(envId: any, params: any, log: Logger): Promise<void>;
15
15
  }
16
16
  export declare class DownloadCommand extends Command {
17
17
  get options(): {
@@ -29,3 +29,19 @@ export declare const STATUS_TEXT: {
29
29
  ERROR: string;
30
30
  };
31
31
  export declare const ALL_COMMANDS: string[];
32
+ export declare const StatusMap: {
33
+ Active: string;
34
+ Creating: string;
35
+ CreateFailed: string;
36
+ Updating: string;
37
+ UpdateFailed: string;
38
+ Publishing: string;
39
+ PublishFailed: string;
40
+ Deleting: string;
41
+ DeleteFailed: string;
42
+ };
43
+ export declare const ConcurrencyTaskStatus: {
44
+ Done: string;
45
+ InProgress: string;
46
+ Failed: string;
47
+ };
@@ -0,0 +1,3 @@
1
+ import { IUpdateFunctionAliasConfig, IGetFunctionAlias, IGetFunctionAliasRes } from '../types';
2
+ export declare function setFunctionAliasConfig(options: IUpdateFunctionAliasConfig): Promise<void>;
3
+ export declare function getFunctionAliasConfig(options: IGetFunctionAlias): Promise<IGetFunctionAliasRes>;
@@ -0,0 +1,4 @@
1
+ import { ISetProvisionedConcurrencyConfig, IGetProvisionedConcurrencyConfig, IGetProvisionedConcurrencyRes } from '../types';
2
+ export declare function setProvisionedConcurrencyConfig(options: ISetProvisionedConcurrencyConfig): Promise<void>;
3
+ export declare function getProvisionedConcurrencyConfig(options: IGetProvisionedConcurrencyConfig): Promise<IGetProvisionedConcurrencyRes>;
4
+ export declare function deleteProvisionedConcurrencyConfig(options: IGetProvisionedConcurrencyConfig): Promise<void>;
@@ -6,3 +6,6 @@ export * from './delete';
6
6
  export * from './update';
7
7
  export * from './layer';
8
8
  export * from './vpc';
9
+ export * from './version';
10
+ export * from './concurrency';
11
+ export * from './alias';
@@ -0,0 +1,3 @@
1
+ import { IPublishVersionParams, IListFunctionVersionParams, IFunctionVersionsRes } from '../types';
2
+ export declare function publishVersion(options: IPublishVersionParams): Promise<void>;
3
+ export declare function listFunctionVersions(options: IListFunctionVersionParams): Promise<IFunctionVersionsRes>;
@@ -3,9 +3,6 @@ interface IStorageOptions {
3
3
  envId: string;
4
4
  localPath: string;
5
5
  cloudPath: string;
6
- parallel?: number;
7
- retryCount?: number;
8
- retryInterval?: number;
9
6
  }
10
7
  interface IStorageCloudOptions {
11
8
  envId: string;
package/types/types.d.ts CHANGED
@@ -376,3 +376,85 @@ export interface IDestroyStandaloneGateway {
376
376
  envId: string;
377
377
  gatewayName: string;
378
378
  }
379
+ export interface IPublishVersionParams {
380
+ envId: string;
381
+ functionName: string;
382
+ description?: string;
383
+ }
384
+ export interface IListFunctionVersionParams {
385
+ envId: string;
386
+ functionName: string;
387
+ offset?: number;
388
+ limit?: number;
389
+ order?: string;
390
+ orderBy?: string;
391
+ }
392
+ export interface IFunctionVersion {
393
+ Version: string;
394
+ Description: string;
395
+ AddTime: string;
396
+ ModTime: string;
397
+ Status: string;
398
+ }
399
+ export interface IFunctionVersionsRes {
400
+ FunctionVersion: string[];
401
+ Versions: IFunctionVersion[];
402
+ TotalCount: number;
403
+ }
404
+ export interface ISetProvisionedConcurrencyConfig {
405
+ envId: string;
406
+ functionName: string;
407
+ qualifier: string;
408
+ versionProvisionedConcurrencyNum: number;
409
+ }
410
+ export interface IGetProvisionedConcurrencyConfig {
411
+ functionName: string;
412
+ qualifier?: string;
413
+ envId: string;
414
+ }
415
+ export interface IGetProvisionedConcurrencyRes {
416
+ UnallocatedConcurrencyNum: number;
417
+ Allocated: IVersionProvisionedConcurrencyInfo[];
418
+ }
419
+ export interface IVersionProvisionedConcurrencyInfo {
420
+ AllocatedProvisionedConcurrencyNum: number;
421
+ AvailableProvisionedConcurrencyNum: number;
422
+ Status: string;
423
+ StatusReason: string;
424
+ Qualifier: string;
425
+ }
426
+ export interface IUpdateFunctionAliasConfig {
427
+ envId: string;
428
+ functionName: string;
429
+ name: string;
430
+ functionVersion: string;
431
+ description?: string;
432
+ routingConfig?: IRoutingConfig;
433
+ }
434
+ export interface IRoutingConfig {
435
+ AdditionalVersionWeights?: IVersionWeight[];
436
+ AddtionVersionMatchs?: IVersionMatch[];
437
+ }
438
+ export interface IVersionMatch {
439
+ Version: string;
440
+ Key: string;
441
+ Method: string;
442
+ Expression: string;
443
+ }
444
+ export interface IVersionWeight {
445
+ Version: string;
446
+ Weight: number;
447
+ }
448
+ export interface IGetFunctionAlias {
449
+ envId: string;
450
+ functionName: string;
451
+ name: string;
452
+ }
453
+ export interface IGetFunctionAliasRes {
454
+ FunctionVersion: string;
455
+ Name: string;
456
+ RoutingConfig: IRoutingConfig;
457
+ Description: string;
458
+ AddTime: string;
459
+ ModTime: string;
460
+ }