esa-cli 0.0.2-beta.10 → 0.0.2-beta.13
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/dist/commands/commit/index.js +26 -115
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/routineUtils.js +276 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy/helper.js +40 -61
- package/dist/commands/deploy/index.js +90 -188
- package/dist/commands/deployments/delete.js +32 -22
- package/dist/commands/deployments/index.js +2 -2
- package/dist/commands/deployments/list.js +22 -38
- package/dist/commands/dev/build.js +3 -3
- package/dist/commands/dev/doProcess.js +5 -5
- package/dist/commands/dev/ew2/cacheService.js +33 -0
- package/dist/commands/dev/ew2/devEntry.js +2 -1
- package/dist/commands/dev/ew2/devPack.js +22 -11
- package/dist/commands/dev/ew2/kvService.js +27 -0
- package/dist/commands/dev/ew2/mock/cache.js +99 -15
- package/dist/commands/dev/ew2/mock/kv.js +142 -21
- package/dist/commands/dev/ew2/server.js +162 -27
- package/dist/commands/dev/index.js +14 -15
- package/dist/commands/dev/mockWorker/devPack.js +16 -7
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +2 -2
- package/dist/commands/domain/delete.js +7 -7
- package/dist/commands/domain/index.js +2 -2
- package/dist/commands/domain/list.js +10 -10
- package/dist/commands/init/helper.js +87 -13
- package/dist/commands/init/index.js +461 -57
- package/dist/commands/init/template.jsonc +34 -0
- package/dist/commands/lang.js +2 -2
- package/dist/commands/login/index.js +57 -7
- package/dist/commands/logout.js +5 -5
- package/dist/commands/route/add.js +138 -49
- package/dist/commands/route/delete.js +33 -27
- package/dist/commands/route/helper.js +124 -0
- package/dist/commands/route/index.js +2 -2
- package/dist/commands/route/list.js +56 -17
- package/dist/commands/routine/delete.js +2 -2
- package/dist/commands/routine/index.js +2 -2
- package/dist/commands/routine/list.js +9 -21
- package/dist/commands/site/index.js +1 -1
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +55 -19
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/mutiSelectTable.js +1 -1
- package/dist/components/selectInput.js +2 -3
- package/dist/components/selectItem.js +1 -1
- package/dist/docs/Commands_en.md +25 -15
- package/dist/docs/Commands_zh_CN.md +12 -2
- package/dist/docs/eslint-config-en.md +1 -0
- package/dist/docs/eslint-config.md +73 -0
- package/dist/docs/init-command-quick-test.md +208 -0
- package/dist/docs/init-command-test-guide.md +598 -0
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +261 -17
- package/dist/index.js +17 -12
- package/dist/libs/api.js +32 -9
- package/dist/libs/apiService.js +258 -85
- package/dist/libs/git/index.js +8 -4
- package/dist/libs/interface.js +0 -1
- package/dist/libs/logger.js +63 -7
- package/dist/libs/service.js +2 -2
- package/dist/libs/templates/index.js +1 -1
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +3 -17
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +16 -31
- package/dist/utils/checkVersion.js +1 -1
- package/dist/utils/compress.js +80 -0
- package/dist/utils/download.js +5 -5
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/index.js +71 -22
- package/dist/utils/installDeno.js +3 -3
- package/dist/utils/installEw2.js +7 -7
- package/dist/utils/openInBrowser.js +1 -1
- package/package.json +11 -6
package/dist/i18n/locales.json
CHANGED
|
@@ -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": "您的代码已成功部署"
|
|
@@ -289,7 +281,7 @@
|
|
|
289
281
|
},
|
|
290
282
|
"init_input_name": {
|
|
291
283
|
"en": "Enter the name of edgeRoutine:",
|
|
292
|
-
"zh_CN": "输入 edgeRoutine
|
|
284
|
+
"zh_CN": "输入 edgeRoutine 的名称"
|
|
293
285
|
},
|
|
294
286
|
"init_skip_git": {
|
|
295
287
|
"en": "Git installation was skipped.",
|
|
@@ -367,6 +359,18 @@
|
|
|
367
359
|
"en": "The name of route to add",
|
|
368
360
|
"zh_CN": "要添加的路由名称"
|
|
369
361
|
},
|
|
362
|
+
"route_add_site_describe": {
|
|
363
|
+
"en": "The site to bind the route to. For example: example.com",
|
|
364
|
+
"zh_CN": "要绑定路由的站点"
|
|
365
|
+
},
|
|
366
|
+
"route_add_route_name_option": {
|
|
367
|
+
"en": "Route name (aliases)",
|
|
368
|
+
"zh_CN": "路由名称(别名)"
|
|
369
|
+
},
|
|
370
|
+
"route_add_route_value_option": {
|
|
371
|
+
"en": "The route value. For example: example.com/*",
|
|
372
|
+
"zh_CN": "路由值"
|
|
373
|
+
},
|
|
370
374
|
"route_add_invalid": {
|
|
371
375
|
"en": "The route does not correspond to the domain.",
|
|
372
376
|
"zh_CN": "该路由与域名不对应。"
|
|
@@ -489,7 +493,7 @@
|
|
|
489
493
|
},
|
|
490
494
|
"route_validate": {
|
|
491
495
|
"en": "You can add an asterisk (*) as the prefix or suffix to match more URLs, such as \"*.example.com/*\".",
|
|
492
|
-
"zh_CN": "您可以通过添加前缀或后缀通配符(*)来匹配更多的URL,例如:
|
|
496
|
+
"zh_CN": "您可以通过添加前缀或后缀通配符(*)来匹配更多的URL,例如: \"*.example.com/*\"."
|
|
493
497
|
},
|
|
494
498
|
"domain_input": {
|
|
495
499
|
"en": "Enter the name of domain (Support fuzzy matching on tab press):",
|
|
@@ -513,20 +517,64 @@
|
|
|
513
517
|
},
|
|
514
518
|
"init_config_file": {
|
|
515
519
|
"en": "Generate a config file for your project",
|
|
516
|
-
"zh_CN": "
|
|
520
|
+
"zh_CN": "在您的项目中生成一个配置文件"
|
|
521
|
+
},
|
|
522
|
+
"init_config_format_select": {
|
|
523
|
+
"en": "Select configuration file format:",
|
|
524
|
+
"zh_CN": "选择配置文件格式:"
|
|
525
|
+
},
|
|
526
|
+
"init_config_format_jsonc": {
|
|
527
|
+
"en": "JSONC (.jsonc) - JSON with comments, recommended",
|
|
528
|
+
"zh_CN": "JSONC (.jsonc) - 带注释的JSON,推荐"
|
|
529
|
+
},
|
|
530
|
+
"init_config_format_toml": {
|
|
531
|
+
"en": "TOML (.toml) - Traditional format",
|
|
532
|
+
"zh_CN": "TOML (.toml) - 传统格式"
|
|
533
|
+
},
|
|
534
|
+
"init_language_select": {
|
|
535
|
+
"en": "Select programming language:",
|
|
536
|
+
"zh_CN": "选择编程语言:"
|
|
537
|
+
},
|
|
538
|
+
"init_language_typescript": {
|
|
539
|
+
"en": "TypeScript (.ts) - Type-safe JavaScript, recommended",
|
|
540
|
+
"zh_CN": "TypeScript (.ts) - 类型安全的JavaScript,推荐"
|
|
541
|
+
},
|
|
542
|
+
"init_language_javascript": {
|
|
543
|
+
"en": "JavaScript (.js) - Traditional JavaScript",
|
|
544
|
+
"zh_CN": "JavaScript (.js) - 传统JavaScript"
|
|
545
|
+
},
|
|
546
|
+
"init_language_selected": {
|
|
547
|
+
"en": "Language",
|
|
548
|
+
"zh_CN": "语言"
|
|
549
|
+
},
|
|
550
|
+
"init_project_name": {
|
|
551
|
+
"en": "Project name",
|
|
552
|
+
"zh_CN": "项目名称"
|
|
553
|
+
},
|
|
554
|
+
"init_template_name": {
|
|
555
|
+
"en": "Template name to use",
|
|
556
|
+
"zh_CN": "要使用的模板名称"
|
|
557
|
+
},
|
|
558
|
+
"init_template_not_found": {
|
|
559
|
+
"en": "Template \"${templateName}\" not found. Please check the template name and try again.",
|
|
560
|
+
"zh_CN": "未找到模板 \"${templateName}\"。请检查模板名称并重试。"
|
|
517
561
|
},
|
|
518
562
|
"generate_config_error": {
|
|
519
|
-
"en": "
|
|
520
|
-
"zh_CN": "
|
|
563
|
+
"en": "${path.basename(newFilePath)} already exists",
|
|
564
|
+
"zh_CN": "配置文件已经存在"
|
|
521
565
|
},
|
|
522
566
|
"generate_config_success": {
|
|
523
|
-
"en": "Generated
|
|
524
|
-
"zh_CN": "
|
|
567
|
+
"en": "Generated ${path.basename(newFilePath)}",
|
|
568
|
+
"zh_CN": "配置文件生成成功"
|
|
525
569
|
},
|
|
526
570
|
"commit_option_minify": {
|
|
527
571
|
"en": "Minify code before committing",
|
|
528
572
|
"zh_CN": "上传前压缩代码"
|
|
529
573
|
},
|
|
574
|
+
"commit_option_description": {
|
|
575
|
+
"en": "Description for the routine/version (skip interactive input)",
|
|
576
|
+
"zh_CN": "函数/版本的描述(跳过交互式输入)"
|
|
577
|
+
},
|
|
530
578
|
"dev_entry_describe": {
|
|
531
579
|
"en": "Entry file of the Routine",
|
|
532
580
|
"zh_CN": "入口文件路径"
|
|
@@ -712,8 +760,8 @@
|
|
|
712
760
|
"zh_CN": "无权限:Access Key 或 Secret 错误,或没有必要的权限。"
|
|
713
761
|
},
|
|
714
762
|
"init_skip": {
|
|
715
|
-
"en": "
|
|
716
|
-
"zh_CN": "
|
|
763
|
+
"en": "Answer \"No\" to any prompts for new projects.",
|
|
764
|
+
"zh_CN": "回答 \"否\" 到所有提示。"
|
|
717
765
|
},
|
|
718
766
|
"quick_deploy_success": {
|
|
719
767
|
"en": "Your code has been successfully deployed",
|
|
@@ -727,6 +775,18 @@
|
|
|
727
775
|
"en": "Quick deploy failed",
|
|
728
776
|
"zh_CN": "快速部署失败。"
|
|
729
777
|
},
|
|
778
|
+
"quick_deploy_assets_detected": {
|
|
779
|
+
"en": "Static assets detected, deploying with assets support",
|
|
780
|
+
"zh_CN": "检测到静态资源,正在使用资源支持进行部署"
|
|
781
|
+
},
|
|
782
|
+
"quick_deploy_assets_success": {
|
|
783
|
+
"en": "A new version has been successfully generated",
|
|
784
|
+
"zh_CN": "您的代码和静态资源已成功部署"
|
|
785
|
+
},
|
|
786
|
+
"quick_deploy_assets_failed": {
|
|
787
|
+
"en": "Quick deploy with assets failed",
|
|
788
|
+
"zh_CN": "带静态资源的快速部署失败"
|
|
789
|
+
},
|
|
730
790
|
"auto_deploy": {
|
|
731
791
|
"en": "Do you want to deploy your project?",
|
|
732
792
|
"zh_CN": "您想要部署您的项目吗?"
|
|
@@ -763,6 +823,30 @@
|
|
|
763
823
|
"en": "The domain may take some time to take effect, please try again later.",
|
|
764
824
|
"zh_CN": "域名生效可能需要一段时间,请稍后再试。"
|
|
765
825
|
},
|
|
826
|
+
"deploy_quick_describe": {
|
|
827
|
+
"en": "Quick deploy the routine to production environment",
|
|
828
|
+
"zh_CN": "快速部署到生产环境"
|
|
829
|
+
},
|
|
830
|
+
"deploy_option_version": {
|
|
831
|
+
"en": "Version to deploy (skip interactive selection)",
|
|
832
|
+
"zh_CN": "要部署的版本(跳过交互式选择)"
|
|
833
|
+
},
|
|
834
|
+
"deploy_option_environment": {
|
|
835
|
+
"en": "Environment to deploy to: staging or production (skip interactive selection)",
|
|
836
|
+
"zh_CN": "部署环境:staging 或 production(跳过交互式选择)"
|
|
837
|
+
},
|
|
838
|
+
"deploy_version_not_found": {
|
|
839
|
+
"en": "Version '${argv.version}' not found",
|
|
840
|
+
"zh_CN": "版本 '${version}' 未找到"
|
|
841
|
+
},
|
|
842
|
+
"deploy_using_version": {
|
|
843
|
+
"en": "Using version",
|
|
844
|
+
"zh_CN": "使用版本"
|
|
845
|
+
},
|
|
846
|
+
"deploy_using_environment": {
|
|
847
|
+
"en": "Using environment",
|
|
848
|
+
"zh_CN": "使用环境"
|
|
849
|
+
},
|
|
766
850
|
"init_install_dependence": {
|
|
767
851
|
"en": "⌛️ Installing dependencies...",
|
|
768
852
|
"zh_CN": "⌛️ 正在安装依赖..."
|
|
@@ -934,5 +1018,165 @@
|
|
|
934
1018
|
"routine_create_fail": {
|
|
935
1019
|
"en": "Routine created failed.",
|
|
936
1020
|
"zh_CN": "边缘函数创建失败"
|
|
1021
|
+
},
|
|
1022
|
+
"create_route_route": {
|
|
1023
|
+
"en": "Enter a Route (e.g., example.com/*):",
|
|
1024
|
+
"zh_CN": "输入路由:"
|
|
1025
|
+
},
|
|
1026
|
+
"route_name_input_required": {
|
|
1027
|
+
"en": "Route name is required",
|
|
1028
|
+
"zh_CN": "路由名称是必需的"
|
|
1029
|
+
},
|
|
1030
|
+
"create_route_mode": {
|
|
1031
|
+
"en": "Which mode of route do you want to use?",
|
|
1032
|
+
"zh_CN": "您想要使用哪种路由模式?"
|
|
1033
|
+
},
|
|
1034
|
+
"create_route_site": {
|
|
1035
|
+
"en": "Select a site that is active in your account:",
|
|
1036
|
+
"zh_CN": "选择您账户中已激活的站点:"
|
|
1037
|
+
},
|
|
1038
|
+
"route_input_required": {
|
|
1039
|
+
"en": "Route is required",
|
|
1040
|
+
"zh_CN": "路由是必需的"
|
|
1041
|
+
},
|
|
1042
|
+
"create_route_rule": {
|
|
1043
|
+
"en": "Enter a Rule Expression:",
|
|
1044
|
+
"zh_CN": "输入规则表达式:"
|
|
1045
|
+
},
|
|
1046
|
+
"rule_input_required": {
|
|
1047
|
+
"en": "Rule is required",
|
|
1048
|
+
"zh_CN": "规则是必需的"
|
|
1049
|
+
},
|
|
1050
|
+
"route_list_simple_title": {
|
|
1051
|
+
"en": "Related simple mode routes",
|
|
1052
|
+
"zh_CN": "相关简单模式路由"
|
|
1053
|
+
},
|
|
1054
|
+
"route_list_custom_title": {
|
|
1055
|
+
"en": "Related custom mode routes",
|
|
1056
|
+
"zh_CN": "相关自定义模式路由"
|
|
1057
|
+
},
|
|
1058
|
+
"create_route_route_name": {
|
|
1059
|
+
"en": "Enter a Route Name (Aliases):",
|
|
1060
|
+
"zh_CN": "输入路由名称(别名):"
|
|
1061
|
+
},
|
|
1062
|
+
"no_route_found": {
|
|
1063
|
+
"en": "No route found! Please check the route name.",
|
|
1064
|
+
"zh_CN": "未找到路由!请检查路由名称。"
|
|
1065
|
+
},
|
|
1066
|
+
"init_template_not_ready": {
|
|
1067
|
+
"en": "Template is not ready. We will install it for you now.",
|
|
1068
|
+
"zh_CN": "模版未准备好,我们为您安装模版。"
|
|
1069
|
+
},
|
|
1070
|
+
"login_option_access_key_id": {
|
|
1071
|
+
"en": "AccessKey ID (AK)",
|
|
1072
|
+
"zh_CN": "AccessKey ID (AK)"
|
|
1073
|
+
},
|
|
1074
|
+
"login_option_access_key_secret": {
|
|
1075
|
+
"en": "AccessKey Secret (SK)",
|
|
1076
|
+
"zh_CN": "AccessKey Secret (SK)"
|
|
1077
|
+
},
|
|
1078
|
+
"login_option_skip_login": {
|
|
1079
|
+
"en": "Skip login",
|
|
1080
|
+
"zh_CN": "跳过登录"
|
|
1081
|
+
},
|
|
1082
|
+
"check_and_update_package_error": {
|
|
1083
|
+
"en": "Error: An error occurred while checking and updating the package, skipping template update",
|
|
1084
|
+
"zh_CN": "检测和更新包时发生错误,跳过更新模版"
|
|
1085
|
+
},
|
|
1086
|
+
"init_yes": {
|
|
1087
|
+
"en": "Answer \"Yes\" to all prompts.",
|
|
1088
|
+
"zh_CN": "回答 \"是\" 到所有提示。"
|
|
1089
|
+
},
|
|
1090
|
+
"init_no_templates": {
|
|
1091
|
+
"en": "No templates available.",
|
|
1092
|
+
"zh_CN": "没有可用的模版。"
|
|
1093
|
+
},
|
|
1094
|
+
"no_active_sites": {
|
|
1095
|
+
"en": "No active sites found in your account",
|
|
1096
|
+
"zh_CN": "没有找到已激活的站点"
|
|
1097
|
+
},
|
|
1098
|
+
"route_format_invalid": {
|
|
1099
|
+
"en": "Invalid route format",
|
|
1100
|
+
"zh_CN": "无效的路由格式"
|
|
1101
|
+
},
|
|
1102
|
+
"creating_route": {
|
|
1103
|
+
"en": "Creating route...",
|
|
1104
|
+
"zh_CN": "创建路由..."
|
|
1105
|
+
},
|
|
1106
|
+
"site_not_found": {
|
|
1107
|
+
"en": "Site \"${siteName}\" not found in your account",
|
|
1108
|
+
"zh_CN": "站点 \"${siteName}\" 未找到"
|
|
1109
|
+
},
|
|
1110
|
+
"commit_assets_exist": {
|
|
1111
|
+
"en": "This is a routine with assets project",
|
|
1112
|
+
"zh_CN": ""
|
|
1113
|
+
},
|
|
1114
|
+
"commit_routine_with_assets_success": {
|
|
1115
|
+
"en": "Routine with assets code version committed successfully.",
|
|
1116
|
+
"zh_CN": ""
|
|
1117
|
+
},
|
|
1118
|
+
"commit_routine_with_assets_fail": {
|
|
1119
|
+
"en": "An error occurred while trying to commit your routine with assets.",
|
|
1120
|
+
"zh_CN": ""
|
|
1121
|
+
},
|
|
1122
|
+
"commit_option_assets": {
|
|
1123
|
+
"en": "Assets directory",
|
|
1124
|
+
"zh_CN": ""
|
|
1125
|
+
},
|
|
1126
|
+
"commit_option_name": {
|
|
1127
|
+
"en": "Edge Routine name",
|
|
1128
|
+
"zh_CN": ""
|
|
1129
|
+
},
|
|
1130
|
+
"deploy_option_name": {
|
|
1131
|
+
"en": "Name of the routine",
|
|
1132
|
+
"zh_CN": ""
|
|
1133
|
+
},
|
|
1134
|
+
"deploy_option_assets": {
|
|
1135
|
+
"en": "Deploy assets",
|
|
1136
|
+
"zh_CN": ""
|
|
1137
|
+
},
|
|
1138
|
+
"deploy_invalid_environment": {
|
|
1139
|
+
"en": "Invalid environment",
|
|
1140
|
+
"zh_CN": ""
|
|
1141
|
+
},
|
|
1142
|
+
"deploy_success_guide_2": {
|
|
1143
|
+
"en": "Run this command to add routes",
|
|
1144
|
+
"zh_CN": ""
|
|
1145
|
+
},
|
|
1146
|
+
"login_get_from_env": {
|
|
1147
|
+
"en": "Get AccessKey ID and AccessKey Secret from environment variables.",
|
|
1148
|
+
"zh_CN": ""
|
|
1149
|
+
},
|
|
1150
|
+
"deploy_option_description": {
|
|
1151
|
+
"en": "Description of the version",
|
|
1152
|
+
"zh_CN": ""
|
|
1153
|
+
},
|
|
1154
|
+
"deploy_option_minify": {
|
|
1155
|
+
"en": "Minify the code",
|
|
1156
|
+
"zh_CN": ""
|
|
1157
|
+
},
|
|
1158
|
+
"error_reading_project_config_file": {
|
|
1159
|
+
"en": "Error reading project configuration file.",
|
|
1160
|
+
"zh_CN": "读取项目配置文件错误"
|
|
1161
|
+
},
|
|
1162
|
+
"checking_template_update": {
|
|
1163
|
+
"en": "Checking esa-template updates...",
|
|
1164
|
+
"zh_CN": ""
|
|
1165
|
+
},
|
|
1166
|
+
"template_updating": {
|
|
1167
|
+
"en": "Updating templates to latest...",
|
|
1168
|
+
"zh_CN": ""
|
|
1169
|
+
},
|
|
1170
|
+
"template_updated_to_latest": {
|
|
1171
|
+
"en": "Templates updated to latest.",
|
|
1172
|
+
"zh_CN": ""
|
|
1173
|
+
},
|
|
1174
|
+
"checking_esa_template_finished": {
|
|
1175
|
+
"en": "Checking esa-template finished.",
|
|
1176
|
+
"zh_CN": ""
|
|
1177
|
+
},
|
|
1178
|
+
"git_installed_success": {
|
|
1179
|
+
"en": "Git has been installed successfully.",
|
|
1180
|
+
"zh_CN": ""
|
|
937
1181
|
}
|
|
938
1182
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,25 +7,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import chalk from 'chalk';
|
|
10
11
|
import yargs from 'yargs';
|
|
11
12
|
import { hideBin } from 'yargs/helpers';
|
|
12
|
-
import
|
|
13
|
-
import login from './commands/login/index.js';
|
|
13
|
+
import commit from './commands/commit/index.js';
|
|
14
14
|
import config from './commands/config.js';
|
|
15
|
-
import dev from './commands/dev/index.js';
|
|
16
|
-
import init from './commands/init/index.js';
|
|
17
|
-
import routine from './commands/routine/index.js';
|
|
18
15
|
import deploy from './commands/deploy/index.js';
|
|
19
|
-
import commit from './commands/commit/index.js';
|
|
20
16
|
import deployments from './commands/deployments/index.js';
|
|
17
|
+
import dev from './commands/dev/index.js';
|
|
21
18
|
import domainCommand from './commands/domain/index.js';
|
|
22
|
-
import
|
|
23
|
-
import logout from './commands/logout.js';
|
|
19
|
+
import init from './commands/init/index.js';
|
|
24
20
|
import lang from './commands/lang.js';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
21
|
+
import login from './commands/login/index.js';
|
|
22
|
+
import logout from './commands/logout.js';
|
|
23
|
+
import routeCommand from './commands/route/index.js';
|
|
24
|
+
import routine from './commands/routine/index.js';
|
|
28
25
|
import site from './commands/site/index.js';
|
|
26
|
+
import t from './i18n/index.js';
|
|
27
|
+
import { handleCheckVersion } from './utils/checkVersion.js';
|
|
28
|
+
import { getCliConfig } from './utils/fileUtils/index.js';
|
|
29
29
|
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
30
|
const argv = hideBin(process.argv);
|
|
31
31
|
const cliConfig = getCliConfig();
|
|
@@ -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(
|
|
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();
|