esa-cli 0.0.2-beta.10 → 0.0.2-beta.12

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 (42) hide show
  1. package/dist/commands/commit/index.js +34 -24
  2. package/dist/commands/deploy/helper.js +10 -26
  3. package/dist/commands/deploy/index.js +49 -60
  4. package/dist/commands/deployments/delete.js +1 -16
  5. package/dist/commands/deployments/index.js +1 -1
  6. package/dist/commands/deployments/list.js +8 -15
  7. package/dist/commands/dev/ew2/cacheService.js +33 -0
  8. package/dist/commands/dev/ew2/devEntry.js +2 -1
  9. package/dist/commands/dev/ew2/devPack.js +5 -3
  10. package/dist/commands/dev/ew2/kvService.js +27 -0
  11. package/dist/commands/dev/ew2/mock/cache.js +99 -15
  12. package/dist/commands/dev/ew2/mock/kv.js +142 -21
  13. package/dist/commands/dev/ew2/server.js +150 -18
  14. package/dist/commands/dev/index.js +2 -3
  15. package/dist/commands/domain/add.js +1 -1
  16. package/dist/commands/domain/delete.js +4 -4
  17. package/dist/commands/domain/index.js +1 -1
  18. package/dist/commands/domain/list.js +3 -3
  19. package/dist/commands/init/helper.js +28 -4
  20. package/dist/commands/init/index.js +78 -14
  21. package/dist/commands/login/index.js +49 -3
  22. package/dist/commands/logout.js +1 -1
  23. package/dist/commands/route/add.js +50 -52
  24. package/dist/commands/route/delete.js +29 -23
  25. package/dist/commands/route/helper.js +124 -0
  26. package/dist/commands/route/index.js +1 -1
  27. package/dist/commands/route/list.js +53 -14
  28. package/dist/commands/routine/index.js +1 -1
  29. package/dist/commands/routine/list.js +4 -5
  30. package/dist/commands/site/index.js +1 -1
  31. package/dist/commands/utils.js +5 -5
  32. package/dist/docs/Commands_en.md +27 -13
  33. package/dist/docs/Commands_zh_CN.md +14 -0
  34. package/dist/docs/Dev_en.md +0 -0
  35. package/dist/docs/Dev_zh_CN.md +0 -0
  36. package/dist/i18n/locales.json +102 -10
  37. package/dist/index.js +6 -1
  38. package/dist/libs/api.js +32 -9
  39. package/dist/libs/apiService.js +88 -78
  40. package/dist/libs/interface.js +0 -1
  41. package/dist/utils/checkIsRoutineCreated.js +0 -16
  42. package/package.json +3 -4
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { getProjectConfig } from '../../utils/fileUtils/index.js';
11
11
  import Table from 'cli-table3';
12
12
  import { checkDirectory, checkIsLoginSuccess } from '../utils.js';
13
- import { ApiService } from '../../libs/apiService.js';
14
13
  import logger from '../../libs/logger.js';
15
14
  import t from '../../i18n/index.js';
16
15
  import { validRoutine } from '../../utils/checkIsRoutineCreated.js';
16
+ import api from '../../libs/api.js';
17
+ import { transferRuleStringToRoute } from './helper.js';
17
18
  const listRoute = {
18
19
  command: 'list',
19
20
  describe: `🔍 ${t('route_list_describe').d('List all related routes')}`,
@@ -24,7 +25,7 @@ const listRoute = {
24
25
  export default listRoute;
25
26
  export function handleListRoutes() {
26
27
  return __awaiter(this, void 0, void 0, function* () {
27
- var _a, _b;
28
+ var _a;
28
29
  if (!checkDirectory()) {
29
30
  return;
30
31
  }
@@ -35,29 +36,67 @@ export function handleListRoutes() {
35
36
  if (!isSuccess)
36
37
  return;
37
38
  yield validRoutine(projectConfig.name);
38
- const server = yield ApiService.getInstance();
39
- const req = { Name: projectConfig.name };
40
- const routineDetail = yield server.getRoutine(req);
41
- if (!routineDetail)
42
- return;
43
- const relatedRoutes = (_b = (_a = routineDetail.data) === null || _a === void 0 ? void 0 : _a.RelatedRoutes) !== null && _b !== void 0 ? _b : [];
44
- if (relatedRoutes.length === 0) {
39
+ const req = {
40
+ routineName: projectConfig.name
41
+ };
42
+ const res = yield api.listRoutineRoutes(req);
43
+ const configs = ((_a = res.body) === null || _a === void 0 ? void 0 : _a.configs) || [];
44
+ if (configs.length === 0) {
45
45
  logger.warn(`🙅 ${t('route_list_empty').d('No related routes found')}`);
46
46
  return;
47
47
  }
48
- logger.log(`📃 ${t('route_list_title').d('Related routes')}:`);
49
- displayRelatedRouteList(relatedRoutes);
48
+ const simpleRoutes = configs
49
+ .filter((item) => item.mode !== 'custom')
50
+ .map((config) => {
51
+ var _a, _b, _c;
52
+ return {
53
+ RouteName: (_a = config.routeName) !== null && _a !== void 0 ? _a : '',
54
+ Route: transferRuleStringToRoute((_b = config.rule) !== null && _b !== void 0 ? _b : ''),
55
+ SiteName: (_c = config.siteName) !== null && _c !== void 0 ? _c : ''
56
+ };
57
+ });
58
+ if (simpleRoutes.length > 0) {
59
+ logger.log(`📃 ${t('route_list_simple_title').d('Related simple mode routes')}:`);
60
+ displayRelatedRouteList(simpleRoutes);
61
+ }
62
+ const customRoutes = configs
63
+ .filter((item) => item.mode === 'custom')
64
+ .map((config) => {
65
+ var _a, _b, _c;
66
+ return {
67
+ RouteName: (_a = config.routeName) !== null && _a !== void 0 ? _a : '',
68
+ Route: (_b = config.rule) !== null && _b !== void 0 ? _b : '',
69
+ SiteName: (_c = config.siteName) !== null && _c !== void 0 ? _c : ''
70
+ };
71
+ });
72
+ if (customRoutes.length > 0) {
73
+ logger.log(`📃 ${t('route_list_custom_title').d('Related custom mode routes')}:`);
74
+ displayRelatedRouteRuleList(customRoutes);
75
+ }
50
76
  });
51
77
  }
52
78
  export function displayRelatedRouteList(routeList) {
53
79
  return __awaiter(this, void 0, void 0, function* () {
54
80
  const table = new Table({
55
- head: ['Route', 'Site'],
56
- colWidths: [30, 30]
81
+ head: ['Route Name', 'Route', 'Site'],
82
+ colWidths: [20]
83
+ });
84
+ for (let i = 0; i < routeList.length; i++) {
85
+ const route = routeList[i];
86
+ table.push([route.RouteName, route.Route, route.SiteName]);
87
+ }
88
+ console.log(table.toString());
89
+ });
90
+ }
91
+ export function displayRelatedRouteRuleList(routeList) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const table = new Table({
94
+ head: ['Route Name', 'Rule', 'Site'],
95
+ colWidths: [20]
57
96
  });
58
97
  for (let i = 0; i < routeList.length; i++) {
59
98
  const route = routeList[i];
60
- table.push([route.Route, route.SiteName]);
99
+ table.push([route.RouteName, route.Route, route.SiteName]);
61
100
  }
62
101
  console.log(table.toString());
63
102
  });
@@ -4,7 +4,7 @@ import t from '../../i18n/index.js';
4
4
  let yargsIns;
5
5
  const routineCommand = {
6
6
  command: 'routine [script]',
7
- describe: `🚀 ${t('routine_describe').d('Manage your routine')}`,
7
+ describe: `🧭 ${t('routine_describe').d('Manage your routine')}`,
8
8
  builder: (yargs) => {
9
9
  yargsIns = yargs;
10
10
  return yargs
@@ -20,7 +20,6 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  };
21
21
  import Table from 'cli-table3';
22
22
  import logger from '../../libs/logger.js';
23
- import { Base64 } from 'js-base64';
24
23
  import { checkIsLoginSuccess } from '../utils.js';
25
24
  import chalk from 'chalk';
26
25
  import { ApiService } from '../../libs/apiService.js';
@@ -39,7 +38,7 @@ const list = {
39
38
  export default list;
40
39
  export function handleList(argv) {
41
40
  return __awaiter(this, void 0, void 0, function* () {
42
- var _a;
41
+ var _a, _b;
43
42
  const { site } = argv, args = __rest(argv, ["site"]);
44
43
  const isSuccess = yield checkIsLoginSuccess();
45
44
  if (!isSuccess)
@@ -59,8 +58,8 @@ export function handleList(argv) {
59
58
  logger.tree(siteNameList);
60
59
  return;
61
60
  }
62
- const res = yield server.getRoutineUserInfo();
63
- const routineList = res === null || res === void 0 ? void 0 : res.Routines;
61
+ const res = yield server.listUserRoutines();
62
+ const routineList = (_b = res === null || res === void 0 ? void 0 : res.body) === null || _b === void 0 ? void 0 : _b.Routines;
64
63
  if (routineList) {
65
64
  logger.log(chalk.bold.bgGray(`📃 ${t('list_routine_name_title').d('List all of routine')}:`));
66
65
  displayRoutineList(routineList);
@@ -77,7 +76,7 @@ export function displayRoutineList(versionList) {
77
76
  table.push([
78
77
  version.RoutineName,
79
78
  moment(version.CreateTime).format('YYYY/MM/DD HH:mm:ss'),
80
- Base64.decode(version.Description)
79
+ version.Description
81
80
  ]);
82
81
  });
83
82
  console.table(table.toString());
@@ -3,7 +3,7 @@ import t from '../../i18n/index.js';
3
3
  let yargsIns;
4
4
  const siteCommand = {
5
5
  command: 'site [script]',
6
- describe: `🚀 ${t('site_describe').d('Manage your sites')}`,
6
+ describe: `📈 ${t('site_describe').d('Manage your sites')}`,
7
7
  builder: (yargs) => {
8
8
  yargsIns = yargs;
9
9
  return yargs
@@ -16,6 +16,7 @@ import chalk from 'chalk';
16
16
  import t from '../i18n/index.js';
17
17
  import { ApiService } from '../libs/apiService.js';
18
18
  import logger from '../libs/logger.js';
19
+ import api from '../libs/api.js';
19
20
  export const checkDirectory = (isCheckGit = false) => {
20
21
  const root = getRoot();
21
22
  if (fs.existsSync(projectConfigPath)) {
@@ -67,11 +68,10 @@ export const bindRoutineWithDomain = (name, domain) => __awaiter(void 0, void 0,
67
68
  }
68
69
  });
69
70
  export const getRoutineVersionList = (name) => __awaiter(void 0, void 0, void 0, function* () {
70
- var _a;
71
- const server = yield ApiService.getInstance();
72
- const req = { Name: name };
73
- const res = yield server.getRoutine(req);
74
- return ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.CodeVersions) || [];
71
+ var _a, _b;
72
+ const req = { name };
73
+ const res = yield api.listRoutineCodeVersions(req);
74
+ return (_b = (_a = res.body) === null || _a === void 0 ? void 0 : _a.codeVersions) !== null && _b !== void 0 ? _b : [];
75
75
  });
76
76
  export function validName(name) {
77
77
  return /^[a-zA-Z0-9-_]+$/.test(name);
@@ -1,9 +1,23 @@
1
1
  # Commands
2
2
 
3
+ - init - Initialize a new project from a template
4
+ - dev - Start a local development server for testing
5
+ - commit - Commit code and create a version
6
+ - deploy - Build and deploy project to the edge routine
7
+ - deployments - Manage deployments
8
+ - routine - Manage edge routine functions
9
+ - site - Manage site settings
10
+ - domain - Configure edge function trigger domain
11
+ - route - Configure edge function trigger routes
12
+ - login - Authenticate via AK/SK to your account
13
+ - logout - Log out current user
14
+ - config - Modify local/global settings
15
+ - lang - Switch CLI interface language
16
+
3
17
  ### init
4
18
 
5
19
  Initialize a routine with a template.
6
-
20
+
7
21
  ```bash
8
22
  $ esa init [OPTIONS]
9
23
  ```
@@ -14,7 +28,7 @@ $ esa init [OPTIONS]
14
28
  ### routine [script]
15
29
 
16
30
  Manage your routine.
17
-
31
+
18
32
  #### delete <routineName>
19
33
 
20
34
  Delete a routine.
@@ -37,7 +51,7 @@ $ esa routine list
37
51
  ### route [script]
38
52
 
39
53
  Manage the routes bound to your routine.
40
-
54
+
41
55
  #### add [route] [site]
42
56
 
43
57
  Bind a Route to a routine.
@@ -68,7 +82,7 @@ $ esa route list
68
82
  ### login
69
83
 
70
84
  Login to the server.
71
-
85
+
72
86
  ```bash
73
87
  $ esa login
74
88
  ```
@@ -76,7 +90,7 @@ $ esa login
76
90
  ### dev [entry]
77
91
 
78
92
  Start a local server for developing your routine.
79
-
93
+
80
94
  ```bash
81
95
  $ esa dev [entry] [OPTIONS]
82
96
  ```
@@ -102,7 +116,7 @@ $ esa dev [entry] [OPTIONS]
102
116
  ### deployments [script]
103
117
 
104
118
  Manage your deployments.
105
-
119
+
106
120
  #### delete <deploymentId>
107
121
 
108
122
  Delete one or more deployment versions.
@@ -125,7 +139,7 @@ $ esa deployments list
125
139
  ### deploy [entry]
126
140
 
127
141
  Deploy your project.
128
-
142
+
129
143
  ```bash
130
144
  $ esa deploy [entry]
131
145
  ```
@@ -136,7 +150,7 @@ $ esa deploy [entry]
136
150
  ### domain [script]
137
151
 
138
152
  Manage the domain names bound to your routine.
139
-
153
+
140
154
  #### add <domain>
141
155
 
142
156
  Bind a domain to a routine.
@@ -170,7 +184,7 @@ $ esa domain list
170
184
  ### commit [entry]
171
185
 
172
186
  Commit your code, save as a new version.
173
-
187
+
174
188
  ```bash
175
189
  $ esa commit [entry] [OPTIONS]
176
190
  ```
@@ -184,7 +198,7 @@ $ esa commit [entry] [OPTIONS]
184
198
  ### logout
185
199
 
186
200
  Logout.
187
-
201
+
188
202
  ```bash
189
203
  $ esa logout
190
204
  ```
@@ -192,7 +206,7 @@ $ esa logout
192
206
  ### config
193
207
 
194
208
  Modify your local or global configuration using -l, -g.
195
-
209
+
196
210
  ```bash
197
211
  $ esa config [OPTIONS]
198
212
  ```
@@ -206,7 +220,7 @@ $ esa config [OPTIONS]
206
220
  ### lang
207
221
 
208
222
  Set the language of the CLI.
209
-
223
+
210
224
  ```bash
211
225
  $ esa lang
212
226
  ```
@@ -214,7 +228,7 @@ $ esa lang
214
228
  ### site [script]
215
229
 
216
230
  Manage your sites.
217
-
231
+
218
232
  #### list
219
233
 
220
234
  List all your sites.
@@ -1,5 +1,19 @@
1
1
  # Commands
2
2
 
3
+ - init - 使用模板初始化新项目
4
+ - dev - 启动本地开发服务器进行调试
5
+ - commit - 提交代码并创建一个新版本
6
+ - deploy - 部署项目到边缘网络
7
+ - deployments - 管理历史部署版本
8
+ - routine - 管理边缘函数
9
+ - site - 管理站点
10
+ - domain - 管理绑定到边缘函数的域名
11
+ - route - 管理绑定到边缘函数的路由
12
+ - login - 通过AK/SK登录到您的账户
13
+ - logout - 注销当前用户
14
+ - config - 修改本地/全局配置
15
+ - lang - 切换CLI界面语言
16
+
3
17
  ### init
4
18
 
5
19
  选择模版初始化项目。
File without changes
File without changes
@@ -75,10 +75,6 @@
75
75
  "en": "Production",
76
76
  "zh_CN": "生产环境"
77
77
  },
78
- "deploy_env_canary": {
79
- "en": "Canary",
80
- "zh_CN": "灰度环境"
81
- },
82
78
  "deploy_description_routine": {
83
79
  "en": "Enter the description of the routine",
84
80
  "zh_CN": "请输入边缘函数的描述"
@@ -103,10 +99,6 @@
103
99
  "en": "Do you want to create a formal version to deploy on production environment?",
104
100
  "zh_CN": "是否创建正式版本以部署到生产环境?"
105
101
  },
106
- "deploy_select_canary": {
107
- "en": "Please select the canary area(s) you want to deploy to",
108
- "zh_CN": "请选择您要部署的灰度区域"
109
- },
110
102
  "deploy_success": {
111
103
  "en": "Your code has been successfully deployed",
112
104
  "zh_CN": "您的代码已成功部署"
@@ -489,7 +481,7 @@
489
481
  },
490
482
  "route_validate": {
491
483
  "en": "You can add an asterisk (*) as the prefix or suffix to match more URLs, such as \"*.example.com/*\".",
492
- "zh_CN": "您可以通过添加前缀或后缀通配符(*)来匹配更多的URL,例如: “*.example.com/*”。"
484
+ "zh_CN": "您可以通过添加前缀或后缀通配符(*)来匹配更多的URL,例如: \"*.example.com/*\"."
493
485
  },
494
486
  "domain_input": {
495
487
  "en": "Enter the name of domain (Support fuzzy matching on tab press):",
@@ -515,6 +507,18 @@
515
507
  "en": "Generate a config file for your project",
516
508
  "zh_CN": "在您的项目中生成一个esa.toml配置文件"
517
509
  },
510
+ "init_project_name": {
511
+ "en": "Project name",
512
+ "zh_CN": "项目名称"
513
+ },
514
+ "init_template_name": {
515
+ "en": "Template name to use",
516
+ "zh_CN": "要使用的模板名称"
517
+ },
518
+ "init_template_not_found": {
519
+ "en": "Template \"${templateName}\" not found. Please check the template name and try again.",
520
+ "zh_CN": "未找到模板 \"${templateName}\"。请检查模板名称并重试。"
521
+ },
518
522
  "generate_config_error": {
519
523
  "en": "esa.toml already exists",
520
524
  "zh_CN": "esa.toml 文件已经存在"
@@ -527,6 +531,10 @@
527
531
  "en": "Minify code before committing",
528
532
  "zh_CN": "上传前压缩代码"
529
533
  },
534
+ "commit_option_description": {
535
+ "en": "Description for the routine/version (skip interactive input)",
536
+ "zh_CN": "函数/版本的描述(跳过交互式输入)"
537
+ },
530
538
  "dev_entry_describe": {
531
539
  "en": "Entry file of the Routine",
532
540
  "zh_CN": "入口文件路径"
@@ -712,7 +720,7 @@
712
720
  "zh_CN": "无权限:Access Key 或 Secret 错误,或没有必要的权限。"
713
721
  },
714
722
  "init_skip": {
715
- "en": "Initialization was skipped.",
723
+ "en": "Skip the project git and deployment initialization",
716
724
  "zh_CN": "初始化已被跳过。"
717
725
  },
718
726
  "quick_deploy_success": {
@@ -763,6 +771,30 @@
763
771
  "en": "The domain may take some time to take effect, please try again later.",
764
772
  "zh_CN": "域名生效可能需要一段时间,请稍后再试。"
765
773
  },
774
+ "deploy_quick_describe": {
775
+ "en": "Quick deploy the routine to production environment",
776
+ "zh_CN": "快速部署到生产环境"
777
+ },
778
+ "deploy_option_version": {
779
+ "en": "Version to deploy (skip interactive selection)",
780
+ "zh_CN": "要部署的版本(跳过交互式选择)"
781
+ },
782
+ "deploy_option_environment": {
783
+ "en": "Environment to deploy to: staging or production (skip interactive selection)",
784
+ "zh_CN": "部署环境:staging 或 production(跳过交互式选择)"
785
+ },
786
+ "deploy_version_not_found": {
787
+ "en": "Version '${argv.version}' not found",
788
+ "zh_CN": "版本 '${version}' 未找到"
789
+ },
790
+ "deploy_using_version": {
791
+ "en": "Using version",
792
+ "zh_CN": "使用版本"
793
+ },
794
+ "deploy_using_environment": {
795
+ "en": "Using environment",
796
+ "zh_CN": "使用环境"
797
+ },
766
798
  "init_install_dependence": {
767
799
  "en": "⌛️ Installing dependencies...",
768
800
  "zh_CN": "⌛️ 正在安装依赖..."
@@ -934,5 +966,65 @@
934
966
  "routine_create_fail": {
935
967
  "en": "Routine created failed.",
936
968
  "zh_CN": "边缘函数创建失败"
969
+ },
970
+ "create_route_route": {
971
+ "en": "Enter a Route:",
972
+ "zh_CN": "输入路由:"
973
+ },
974
+ "route_name_input_required": {
975
+ "en": "Route name is required",
976
+ "zh_CN": "路由名称是必需的"
977
+ },
978
+ "create_route_mode": {
979
+ "en": "Which mode of route do you want to use?",
980
+ "zh_CN": "您想要使用哪种路由模式?"
981
+ },
982
+ "create_route_site": {
983
+ "en": "Select a site that is active in your account:",
984
+ "zh_CN": "选择您账户中已激活的站点:"
985
+ },
986
+ "route_input_required": {
987
+ "en": "Route is required",
988
+ "zh_CN": "路由是必需的"
989
+ },
990
+ "create_route_rule": {
991
+ "en": "Enter a Rule Expression:",
992
+ "zh_CN": "输入规则表达式:"
993
+ },
994
+ "rule_input_required": {
995
+ "en": "Rule is required",
996
+ "zh_CN": "规则是必需的"
997
+ },
998
+ "route_list_simple_title": {
999
+ "en": "Related simple mode routes",
1000
+ "zh_CN": "相关简单模式路由"
1001
+ },
1002
+ "route_list_custom_title": {
1003
+ "en": "Related custom mode routes",
1004
+ "zh_CN": "相关自定义模式路由"
1005
+ },
1006
+ "create_route_route_name": {
1007
+ "en": "Enter a Route Name (Aliases):",
1008
+ "zh_CN": "输入路由名称(别名):"
1009
+ },
1010
+ "no_route_found": {
1011
+ "en": "No route found! Please check the route name.",
1012
+ "zh_CN": "未找到路由!请检查路由名称。"
1013
+ },
1014
+ "init_template_not_ready": {
1015
+ "en": "Template is not ready. We will install it for you now.",
1016
+ "zh_CN": "模版未准备好,我们为您安装模版。"
1017
+ },
1018
+ "login_option_access_key_id": {
1019
+ "en": "AccessKey ID (AK)",
1020
+ "zh_CN": "AccessKey ID (AK)"
1021
+ },
1022
+ "login_option_access_key_secret": {
1023
+ "en": "AccessKey Secret (SK)",
1024
+ "zh_CN": "AccessKey Secret (SK)"
1025
+ },
1026
+ "login_option_skip_login": {
1027
+ "en": "Skip login",
1028
+ "zh_CN": "跳过登录"
937
1029
  }
938
1030
  }
package/dist/index.js CHANGED
@@ -38,7 +38,7 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
38
38
  .locale((cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.lang) || 'en')
39
39
  .version(false)
40
40
  .wrap(null)
41
- .help(false)
41
+ .help()
42
42
  .epilogue(`${t('main_epilogue').d('For more information, visit ESA')}: ${chalk.underline.blue('https://www.aliyun.com/product/esa')}`)
43
43
  .options('version', {
44
44
  describe: t('main_version_describe').d('Show version'),
@@ -50,11 +50,16 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
50
50
  });
51
51
  esa.command('*', false, () => { }, (args) => {
52
52
  if (args._.length > 0) {
53
+ // Unknown command
54
+ console.error(t('common_sub_command_fail').d('Use esa <command> -h to see help'));
53
55
  }
54
56
  else {
55
57
  if (args.v) {
56
58
  handleCheckVersion();
57
59
  }
60
+ else if (args.h || args.help) {
61
+ esa.showHelp('log');
62
+ }
58
63
  else {
59
64
  esa.showHelp('log');
60
65
  }
package/dist/libs/api.js CHANGED
@@ -103,16 +103,13 @@ class Client {
103
103
  getMatchSite(params) {
104
104
  return this.callOpenApi('getMatchSite', params);
105
105
  }
106
- listRoutineCanaryAreas() {
107
- return this.callApi(this.client.listRoutineCanaryAreasWithOptions.bind(this.client));
108
- }
109
- getRoutineUserInfo() {
110
- return this.callApi(this.client.getRoutineUserInfoWithOptions.bind(this.client));
111
- }
112
106
  deleteRoutine(params) {
113
107
  const request = new $ESA.DeleteRoutineRequest(params);
114
108
  return this.callApi(this.client.deleteRoutineWithOptions.bind(this.client), request);
115
109
  }
110
+ listUserRoutines(params) {
111
+ return this.callApi(this.client.listUserRoutinesWithOptions.bind(this.client), new $ESA.ListUserRoutinesRequest(params));
112
+ }
116
113
  deleteRoutineCodeVersion(params) {
117
114
  const request = new $ESA.DeleteRoutineCodeVersionRequest(params);
118
115
  return this.callApi(this.client.deleteRoutineCodeVersionWithOptions.bind(this.client), request);
@@ -140,9 +137,6 @@ class Client {
140
137
  const request = new $ESA.CreateRoutineRequest(params);
141
138
  return this.callApi(this.client.createRoutineWithOptions.bind(this.client), request);
142
139
  }
143
- listRoutineOptionalSpecs() {
144
- return this.callApi(this.client.listRoutineOptionalSpecsWithOptions.bind(this.client));
145
- }
146
140
  createRoutineRelatedRecord(params) {
147
141
  const request = new $ESA.CreateRoutineRelatedRecordRequest(params);
148
142
  return this.callApi(this.client.createRoutineRelatedRecordWithOptions.bind(this.client), request);
@@ -151,5 +145,34 @@ class Client {
151
145
  const request = new $ESA.DeleteRoutineRelatedRecordRequest(params);
152
146
  return this.callApi(this.client.deleteRoutineRelatedRecordWithOptions.bind(this.client), request);
153
147
  }
148
+ createRoutineRoute(params) {
149
+ const request = new $ESA.CreateRoutineRouteRequest(params);
150
+ const newRequest = Object.assign(request, { mode: 'simple' });
151
+ return this.callApi(this.client.createRoutineRouteWithOptions.bind(this.client), newRequest);
152
+ }
153
+ deleteRoutineRoute(params) {
154
+ const request = new $ESA.DeleteRoutineRouteRequest(params);
155
+ return this.callApi(this.client.deleteRoutineRouteWithOptions.bind(this.client), request);
156
+ }
157
+ getRoutineRoute(params) {
158
+ const request = new $ESA.GetRoutineRouteRequest(params);
159
+ return this.callApi(this.client.getRoutineRouteWithOptions.bind(this.client), request);
160
+ }
161
+ listSiteRoutes(params) {
162
+ const request = new $ESA.ListSiteRoutesRequest(params);
163
+ return this.callApi(this.client.listSiteRoutes.bind(this.client), request);
164
+ }
165
+ listRoutineRoutes(params) {
166
+ const request = new $ESA.ListRoutineRoutesRequest(params);
167
+ return this.callApi(this.client.listRoutineRoutes.bind(this.client), request);
168
+ }
169
+ updateRoutineRoute(params) {
170
+ const request = new $ESA.UpdateRoutineRouteRequest(params);
171
+ return this.callApi(this.client.updateRoutineRoute.bind(this.client), request);
172
+ }
173
+ listRoutineCodeVersions(params) {
174
+ const request = new $ESA.ListRoutineCodeVersionsRequest(params);
175
+ return this.callApi(this.client.listRoutineCodeVersions.bind(this.client), request);
176
+ }
154
177
  }
155
178
  export default new Client();