@serverless-devs/s 2.0.95 → 2.0.97-beta.5

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 (147) hide show
  1. package/Makefile +26 -0
  2. package/lib/clean/index.js +34 -31
  3. package/lib/cli/cli-manager.js +10 -10
  4. package/lib/cli/index.js +52 -52
  5. package/lib/component/index.js +51 -144
  6. package/lib/config/add/index.js +36 -33
  7. package/lib/config/delete/index.js +47 -47
  8. package/lib/config/get/index.js +40 -37
  9. package/lib/config/index.js +35 -32
  10. package/lib/core/command/command-manager.js +5 -5
  11. package/lib/core/component/hook.js +4 -4
  12. package/lib/core/component/index.js +9 -9
  13. package/lib/error/human-error.js +5 -5
  14. package/lib/error/human-warning.js +4 -4
  15. package/lib/error/index.js +19 -14
  16. package/lib/index.js +109 -120
  17. package/lib/init/index.js +97 -97
  18. package/lib/init/init-manager.js +11 -11
  19. package/lib/onboarding/index.js +5 -5
  20. package/lib/set/analysis/index.js +37 -34
  21. package/lib/set/index.js +35 -32
  22. package/lib/set/locale/index.js +49 -49
  23. package/lib/set/registry/index.js +49 -49
  24. package/lib/set/workspace/index.js +38 -35
  25. package/lib/specification/parse.js +10 -10
  26. package/lib/update-notifier/index.js +17 -17
  27. package/lib/utils/command-util.js +74 -57
  28. package/lib/utils/common.js +40 -13
  29. package/lib/utils/index.js +3 -3
  30. package/package.json +4 -3
  31. package/readme.md +8 -3
  32. package/.eslintrc.json +0 -112
  33. package/.prettierrc.json +0 -11
  34. package/CODE_OF_CONDUCT.md +0 -5
  35. package/CONTRIBUTING.md +0 -189
  36. package/CONTRIBUTORS.md +0 -148
  37. package/docs/readme.md +0 -94
  38. package/docs/zh/awesome.md +0 -20
  39. package/docs/zh/cicd.md +0 -231
  40. package/docs/zh/cli_design.md +0 -100
  41. package/docs/zh/command/clean.md +0 -63
  42. package/docs/zh/command/cli.md +0 -92
  43. package/docs/zh/command/component.md +0 -76
  44. package/docs/zh/command/config.md +0 -278
  45. package/docs/zh/command/custom.md +0 -73
  46. package/docs/zh/command/init.md +0 -148
  47. package/docs/zh/command/readme.md +0 -76
  48. package/docs/zh/command/set.md +0 -195
  49. package/docs/zh/default_provider_config/alibabacloud.md +0 -82
  50. package/docs/zh/default_provider_config/aws.md +0 -12
  51. package/docs/zh/default_provider_config/azure.md +0 -9
  52. package/docs/zh/default_provider_config/baiducloud.md +0 -8
  53. package/docs/zh/default_provider_config/gcp.md +0 -21
  54. package/docs/zh/default_provider_config/huaweicloud.md +0 -52
  55. package/docs/zh/default_provider_config/readme.md +0 -9
  56. package/docs/zh/default_provider_config/tencentcloud.md +0 -41
  57. package/docs/zh/install.md +0 -52
  58. package/docs/zh/package_dev.md +0 -142
  59. package/docs/zh/quick_start.md +0 -297
  60. package/docs/zh/readme.md +0 -90
  61. package/docs/zh/tool.md +0 -80
  62. package/docs/zh/yaml.md +0 -207
  63. package/docs/zh/yaml_and_cli.md +0 -67
  64. package/jest.setup.ts +0 -37
  65. package/lib/clean/index.d.ts +0 -1
  66. package/lib/cli/cli-manager.d.ts +0 -13
  67. package/lib/cli/index.d.ts +0 -2
  68. package/lib/component/index.d.ts +0 -1
  69. package/lib/config/add/index.d.ts +0 -1
  70. package/lib/config/common/common.d.ts +0 -46
  71. package/lib/config/delete/index.d.ts +0 -2
  72. package/lib/config/get/index.d.ts +0 -1
  73. package/lib/config/index.d.ts +0 -2
  74. package/lib/constants/index.d.ts +0 -0
  75. package/lib/constants/static-variable.d.ts +0 -4
  76. package/lib/core/command/command-manager.d.ts +0 -12
  77. package/lib/core/component/hook.d.ts +0 -17
  78. package/lib/core/component/index.d.ts +0 -53
  79. package/lib/core/index.d.ts +0 -2
  80. package/lib/core/plugin/index.d.ts +0 -13
  81. package/lib/entiry/cli.d.ts +0 -27
  82. package/lib/entiry/index.d.ts +0 -2
  83. package/lib/error/command-error.d.ts +0 -5
  84. package/lib/error/config-delete-error.d.ts +0 -5
  85. package/lib/error/config-error.d.ts +0 -5
  86. package/lib/error/config-get-error.d.ts +0 -5
  87. package/lib/error/human-error.d.ts +0 -13
  88. package/lib/error/human-warning.d.ts +0 -8
  89. package/lib/error/index.d.ts +0 -17
  90. package/lib/error/init-error.d.ts +0 -5
  91. package/lib/error/serverless-error.d.ts +0 -4
  92. package/lib/execDaemon.d.ts +0 -6
  93. package/lib/index.d.ts +0 -2
  94. package/lib/init/index.d.ts +0 -2
  95. package/lib/init/init-config.d.ts +0 -43
  96. package/lib/init/init-manager.d.ts +0 -17
  97. package/lib/onboarding/index.d.ts +0 -2
  98. package/lib/set/analysis/index.d.ts +0 -1
  99. package/lib/set/index.d.ts +0 -1
  100. package/lib/set/locale/index.d.ts +0 -1
  101. package/lib/set/registry/index.d.ts +0 -10
  102. package/lib/set/workspace/index.d.ts +0 -1
  103. package/lib/specification/analysis.d.ts +0 -12
  104. package/lib/specification/index.d.ts +0 -4
  105. package/lib/specification/parse.d.ts +0 -24
  106. package/lib/specification/version.d.ts +0 -35
  107. package/lib/update-notifier/index.d.ts +0 -10
  108. package/lib/utils/command-util.d.ts +0 -18
  109. package/lib/utils/common.d.ts +0 -28
  110. package/lib/utils/core.d.ts +0 -3
  111. package/lib/utils/handler-set-config.d.ts +0 -19
  112. package/lib/utils/i18n/en.d.ts +0 -44
  113. package/lib/utils/i18n/index.d.ts +0 -2
  114. package/lib/utils/i18n/zh.d.ts +0 -44
  115. package/lib/utils/index.d.ts +0 -9
  116. package/lib/utils/logger.d.ts +0 -11
  117. package/lib/utils/storage.d.ts +0 -8
  118. package/lib/utils/url-parser.d.ts +0 -15
  119. package/spec/readme.md +0 -59
  120. package/spec/zh/0.0.1/readme.md +0 -47
  121. package/spec/zh/0.0.1/serverless_package_model/1.purpose_and_goals.md +0 -3
  122. package/spec/zh/0.0.1/serverless_package_model/2.overview_and_terminology.md +0 -14
  123. package/spec/zh/0.0.1/serverless_package_model/3.package_model.md +0 -434
  124. package/spec/zh/0.0.1/serverless_package_model/4.application_scopes.md +0 -3
  125. package/spec/zh/0.0.1/serverless_package_model/5.design_principles.md +0 -3
  126. package/spec/zh/0.0.1/serverless_package_model/readme.md +0 -12
  127. package/spec/zh/0.0.1/serverless_registry_model/1.purpose_and_goals.md +0 -18
  128. package/spec/zh/0.0.1/serverless_registry_model/2.overview_and_terminology.md +0 -18
  129. package/spec/zh/0.0.1/serverless_registry_model/3.registry_model.md +0 -61
  130. package/spec/zh/0.0.1/serverless_registry_model/4.application_scopes.md +0 -6
  131. package/spec/zh/0.0.1/serverless_registry_model/5.design_principles.md +0 -3
  132. package/spec/zh/0.0.1/serverless_registry_model/readme.md +0 -12
  133. package/spec/zh/0.0.1/serverless_user_model/1.purpose_and_goals.md +0 -3
  134. package/spec/zh/0.0.1/serverless_user_model/2.overview_and_terminology.md +0 -16
  135. package/spec/zh/0.0.1/serverless_user_model/3.user_model.md +0 -218
  136. package/spec/zh/0.0.1/serverless_user_model/4.application_scopes.md +0 -4
  137. package/spec/zh/0.0.1/serverless_user_model/5.design_principles.md +0 -3
  138. package/spec/zh/0.0.1/serverless_user_model/readme.md +0 -12
  139. package/test/ci.sh +0 -33
  140. package/test/cli/cli-manager.test.ts +0 -64
  141. package/test/config/get.test.ts +0 -12
  142. package/test/helloworld.test.ts +0 -7
  143. package/test/start-fc-http-nodejs12/code/index.js +0 -47
  144. package/test/start-fc-http-nodejs12/s.yaml +0 -38
  145. package/test/utils/index.test.ts +0 -8
  146. package/test/utils/storage.test.ts +0 -19
  147. package/tsconfig.json +0 -37
@@ -1,67 +0,0 @@
1
- # Yaml 模式 Cli 模式对比
2
-
3
- Serverless Devs 开发者工具从根本上提供了两种使用方法。
4
- - Yaml模式:需要依赖资源描述文档进行操作的模式
5
- - Cli模式:可以在任何目录下直接执行,而不需要依赖资源描述文档;
6
-
7
- 这两者的核心区别是:
8
-
9
- 1. 如果想要使用 Yaml 模式,在当前目录下,必须要有`s.yaml`/`s.yml`文件,或通过`-t`/`--template`指定的资源部描述文件;
10
- 2. 如果想要试用 Cli 模式,则必须是 `s cli 组件名 方法 参数`的格式进行,此时不需要 Yaml 文件;
11
-
12
- 举一个非常简单的例子,如果有一个应用的资源描述文件`s.yaml`如下:
13
-
14
- ```yaml
15
- name: myApp
16
- edition: 1.0.0
17
- access: "myaccess"
18
-
19
- services:
20
- website-starter:
21
- component: devsapp/website
22
- props:
23
- bucket: testbucket
24
- backend-starter:
25
- component: devsapp/demo
26
- props:
27
- service:
28
- name: serviceName
29
- function:
30
- name: functionName
31
- region: cn-hangzhou
32
- ```
33
-
34
- 此时,可以执行`s deploy`进行`myApp`应用部署,如果执行`s backend-starter deploy`则可以进行`myApp`应用下的`backend-starter`项目/服务部署。
35
-
36
- 此时,部署过程中,所需要的相关参数,可以通过该 Yaml 文件进行读取。
37
-
38
- 但是,在某些情况下,并不方便直接使用 Serverless Devs 规范的 Yaml 文件(例如,将线上资源同步到本地,或者要将 Funcraft 的 Yaml 转换成为 Serverless Devs 的 Yaml),此时可以选择纯命令行形式,即`s cli`模式。
39
-
40
- 在 `s cli` 模式下,由于不会读取 Yaml 等资源描述文件,所以很多参数都需要自行填写,这时的填写方法有两种:
41
-
42
- 1. 通过 `s cli` 天然支持的 `-p`/`--prop` 参数,进行相关 Yaml 参数的赋值,例如上述案例的`s backend-starter deploy`,此时可以改写成:
43
- ```shell script
44
- s cli devsapp/demo -p "{\"service\":{\"name\":\"serviceName\"},\"function\":{\"name\":\"functionName\"},\"region\":\"cn-hangzhou\"}"
45
- ```
46
- 2. 通过 demo 组件本身所支持的一些参数,例如通过`s cli devsapp/demo -h`,可以得到帮助信息,部分内容如下:
47
- ```shell script
48
- --region [region] [C-Required] Specify the fc region, value: cn-hangzhou/cn-beijing/cn-beijing/cn-hangzhou/cn-shanghai/cn-qingdao/cn-zhangjiakou/cn-huhehaote/cn-shenzhen/cn-chengdu/cn-hongkong/ap-southeast-1/ap-southeast-2/ap-southeast-3/ap-southeast-5/ap-northeast-1/eu-central-1/eu-west-1/us-west-1/us-east-1/ap-south-1
49
- --service-name [serviceName] [C-Required] Specify the fc service name
50
- --function-name [functionName] [Optional] Specify the fc function name
51
- ```
52
- 此时,就可与通过下面的命令实现上述功能:
53
- ```shell script
54
- s cli devsapp/demo --region cn-hangzhou --service-name serviceName --function-name functionName
55
- ```
56
-
57
- ## 特点对比
58
-
59
- | 模式 | 使用方法 | 优势 | 劣势 | 适用场景 |
60
- | --- | --- | --- | --- | --- |
61
- | Yaml模式 | 在具有符合Serverless Devs规范,且存在资源/行为描述的Yaml文件的应用目录下,执行组件对应的命令,即可直接使用,例如`s deploy`,`s servicename build`等 | 可以一键部署一个完整的应用(例如,某个应用中规定了多个Service,可以通过该命令一键部署);同时,通过资源/行为描述文档,可以更佳简单,清晰的对应用进行描述; | 需要学习Yaml的规范,且在某些时候与一些自动化流程进行结合,会比较复杂; | 部署、运维等操作,尤其是批量操作时更为合适; |
62
- | 纯Cli模式 | 在任何目录下,通过子命令`cli`进行触发,同样适用全部组件,例如`s cli deploy -p "{/"function/": /"function-name/"}"`,`s cli fc-api listFunctions --service-name my-service` | 相对来说可以更加简单,快速上手工具,并且可以非常简单的与自动化流程进行结合,降低了Yaml格式/规范的学习难度 | 对于一些复杂项目而言,需要在命令行中写过多的参数,出错的概率会比较高; | 更适合项目的管理,源自化操作 |
63
-
64
- ## 设计思路
65
-
66
- > ❓ 为什么要同时存在 Yaml 模式和 Cli 模式?
67
- > 💬 因为在长期的实践过程中,我们发现通过 Yaml 进行资源描述会相对来说更简单和方便,例如 K8S 等也都是通过 Yaml 进行资源描述的;但是,在某些情况下,Yaml 文件也可能成为一种负担,例如想要查看某个服务下的函数列表,查看某个地区下的服务列表,因为这样一个简单的事情要额外的去完成一个 Yaml 文件,就显得过于臃肿,所以,在 Serverless Devs 项目中,同时保留了两种使用方法。
package/jest.setup.ts DELETED
@@ -1,37 +0,0 @@
1
- /** @format */
2
- import path from 'path';
3
- import os from 'os';
4
- import core from './src/utils/core';
5
- const { fse: fs, jsyaml: yaml } = core;
6
- import logger from './src/utils/logger';
7
-
8
- jestBeforeDetection();
9
-
10
- function jestBeforeDetection() {
11
- if (!detectioIsExist('.s/access.yaml')) {
12
- logger.error(`Failed to execute:\n
13
- ❌ Message: Please install S component
14
- 😈 If you have questions, please tell us: https://github.com/Serverless-Devs/Serverless-Devs/issues\n`);
15
- process.exit(1);
16
- }
17
- if (Object.keys(getAccessFile()).length === 0) {
18
- logger.error(`Failed to execute:\n
19
- ❌ Message: Please configure your Secret
20
- 😈 If you have questions, please tell us: https://github.com/Serverless-Devs/Serverless-Devs/issues\n`);
21
- process.exit(1);
22
- }
23
- }
24
-
25
- function detectioIsExist(road) {
26
- return fs.existsSync(getPath(road));
27
- }
28
-
29
- function getAccessFile() {
30
- const accessFile = getPath('.s/access.yaml');
31
- const accessFileInfo = yaml.load(fs.readFileSync(accessFile, 'utf-8') || '{}');
32
- return accessFileInfo;
33
- }
34
-
35
- function getPath(road) {
36
- return path.join(os.homedir(), road);
37
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- /** @format */
2
- export interface CliParams {
3
- component: string;
4
- command: string;
5
- access: string;
6
- props: string;
7
- }
8
- export default class CliManager {
9
- protected inputs: CliParams;
10
- constructor(inputs: CliParams);
11
- getTempCommandStr(commands: string, length: number): string;
12
- init(): Promise<any>;
13
- }
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,46 +0,0 @@
1
- /** @format */
2
- export declare type ProviderName = 'alibaba' | 'baidu' | 'huawei' | 'aws' | 'azure' | 'google' | 'tencent';
3
- export declare enum ProviderObject {
4
- alibaba = "Alibaba Cloud (alibaba)",
5
- baidu = "Baidu Cloud (baidu)",
6
- huawei = "Huawei Cloud (huawei)",
7
- aws = "AWS (aws)",
8
- azure = "Azure (azure)",
9
- google = "Google Cloud (google)",
10
- tencent = "Tencent Cloud (tencent)"
11
- }
12
- export declare const providerArray: ProviderName[];
13
- export declare type ProviderCollectionConfig = {
14
- [k in ProviderName]: {
15
- type: string;
16
- message: string;
17
- name: string;
18
- default: string;
19
- }[];
20
- };
21
- export declare const providerCollection: ProviderCollectionConfig;
22
- export interface AccessFormat {
23
- AccountID?: string;
24
- AccessKeyID?: string;
25
- AccessKeySecret?: string;
26
- SecretAccessKey?: string;
27
- KeyVaultName?: string;
28
- TenantID?: string;
29
- ClientID?: string;
30
- ClientSecret?: string;
31
- SecretID?: string;
32
- PrivateKeyData?: string;
33
- }
34
- export declare const providerAccessFormat: {
35
- [k in ProviderName]: (keyof AccessFormat)[];
36
- };
37
- export declare const checkProviderList: {
38
- type: string;
39
- name: string;
40
- message: string;
41
- choices: {
42
- name: ProviderObject;
43
- value: ProviderName;
44
- }[];
45
- }[];
46
- export declare function getInputData(program: AccessFormat): AccessFormat;
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export {};
File without changes
@@ -1,4 +0,0 @@
1
- /** @format */
2
- export declare const PROCESS_ENV_TEMPLATE_NAME = "templateFile";
3
- export declare const DEFAULT_REGIRSTRY = "http://registry.devsapp.cn/simple";
4
- export declare const UPDATE_CHECK_INTERVAL: number;
@@ -1,12 +0,0 @@
1
- import { Parse } from '../../specification';
2
- import { ComponentConfig } from '../component';
3
- export declare class CommandManager {
4
- protected templateFile: string;
5
- protected method: string;
6
- protected customerCommandName?: string;
7
- protected deployParams: any;
8
- constructor(templateFile: string, method: string, customerCommandName?: string, params?: any);
9
- assemblyProjectConfig(parse: Parse, projectName: string, parsedObj: any): Promise<ComponentConfig>;
10
- warnEnvironmentVariables(realVariables: any): Promise<void>;
11
- init(): Promise<void>;
12
- }
@@ -1,17 +0,0 @@
1
- /** @format */
2
- export interface HookConfig {
3
- Pre: boolean;
4
- Plugin?: string;
5
- Hook?: string;
6
- Path?: string;
7
- }
8
- export declare class Hook {
9
- preHooks: HookConfig[];
10
- afterHooks: HookConfig[];
11
- constructor(extendsParams?: HookConfig[]);
12
- executePreHook(): Promise<void>;
13
- executeAfterHook(): Promise<void>;
14
- commandExecute(command: string, executePath: string | undefined): Promise<void>;
15
- pluginExecute(name: string): Promise<void>;
16
- executeByConfig(hookConfig: HookConfig): Promise<void>;
17
- }
@@ -1,53 +0,0 @@
1
- /** @format */
2
- import { PackageType } from '../../entiry';
3
- import { Parse } from '../../specification';
4
- import { Hook } from './hook';
5
- export interface ComponentConfig {
6
- component: string;
7
- provider: string;
8
- Access?: string;
9
- access?: string;
10
- Extends: any;
11
- props: {
12
- [key: string]: any;
13
- };
14
- Params: any;
15
- ProjectName: string;
16
- }
17
- export interface VersionCheckParams {
18
- name: string;
19
- type: PackageType;
20
- provider: string;
21
- }
22
- export interface GenerateComponentExeParams {
23
- list: string[];
24
- parse: Parse;
25
- parsedObj: any;
26
- method: string;
27
- params: string;
28
- }
29
- export declare function synchronizeExecuteComponentList(list?: any, index?: any, initData?: any): Promise<any>;
30
- export declare function generateSynchronizeComponentExeList({ list, parse, parsedObj, method, params }: GenerateComponentExeParams, equipment: (parse: Parse, projectName: string, parsedObj: any) => Promise<ComponentConfig>): any[];
31
- interface IComponentExeCute {
32
- componentConfig: ComponentConfig;
33
- method: string;
34
- version: string;
35
- customerCommandName?: string;
36
- }
37
- export declare class ComponentExeCute {
38
- private credentials;
39
- private componentConfig;
40
- private method;
41
- private version;
42
- private customerCommandName;
43
- constructor(config: IComponentExeCute);
44
- init(): Promise<any>;
45
- getCredentials(): Promise<any>;
46
- private loadExtends;
47
- loadPreExtends(extend: Hook | null): Promise<void>;
48
- loadAfterExtend(extend: Hook | null): Promise<void>;
49
- invokeMethod(componentInstance: any, method: string, data: any): Promise<any>;
50
- executeCommand(): Promise<any>;
51
- startExecute(): Promise<any>;
52
- }
53
- export {};
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export { CommandManager } from './command/command-manager';
@@ -1,13 +0,0 @@
1
- /** @format */
2
- export interface PluginConifg {
3
- name: string;
4
- }
5
- export declare class PluginExeCute {
6
- protected pluginConfig: PluginConifg;
7
- protected pluginPath: string;
8
- constructor(pluginConfig: PluginConifg);
9
- init(): Promise<void>;
10
- pluginExist(): boolean;
11
- downLoadPlugin(name: string): Promise<void>;
12
- loadPlugin(): Promise<any>;
13
- }
@@ -1,27 +0,0 @@
1
- /** @format */
2
- export declare enum PackageType {
3
- application = 0,
4
- component = 1,
5
- plugin = 2
6
- }
7
- export interface CommandType {
8
- type: string;
9
- message: string;
10
- name: string;
11
- default?: string;
12
- choices?: any;
13
- }
14
- export interface InquirerCommand {
15
- [key: string]: CommandType;
16
- }
17
- export interface RepoTemplate {
18
- zipFile: string;
19
- subPath?: string;
20
- hasSubPath: boolean;
21
- }
22
- export interface GitRepoTemplate extends RepoTemplate {
23
- host: string | null;
24
- ownerName: string;
25
- branch: string;
26
- repoName: string;
27
- }
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export { PackageType, CommandType, InquirerCommand, RepoTemplate, GitRepoTemplate } from './cli';
@@ -1,5 +0,0 @@
1
- /** @format */
2
- import { ServerlessError } from './serverless-error';
3
- export declare class CommandError extends ServerlessError {
4
- constructor(message: string, params?: any);
5
- }
@@ -1,5 +0,0 @@
1
- /** @format */
2
- import { ServerlessError } from './serverless-error';
3
- export declare class ConfigDeleteError extends ServerlessError {
4
- constructor(message: string, params?: any);
5
- }
@@ -1,5 +0,0 @@
1
- /** @format */
2
- import { ServerlessError } from './serverless-error';
3
- export declare class ConfigError extends ServerlessError {
4
- constructor(message: string, params?: any);
5
- }
@@ -1,5 +0,0 @@
1
- /** @format */
2
- import { ServerlessError } from './serverless-error';
3
- export declare class ConfigGetError extends ServerlessError {
4
- constructor(message: string, params?: any);
5
- }
@@ -1,13 +0,0 @@
1
- interface IConfigs {
2
- errorMessage: string;
3
- tips?: string;
4
- }
5
- interface IReport {
6
- error: Error;
7
- }
8
- export declare class HumanError {
9
- private errorMessage;
10
- constructor(configs: IConfigs);
11
- report(configs: IReport): Promise<void>;
12
- }
13
- export {};
@@ -1,8 +0,0 @@
1
- interface IConfigs {
2
- warningMessage: string;
3
- tips?: string;
4
- }
5
- export declare class HumanWarning {
6
- constructor(configs: IConfigs);
7
- }
8
- export {};
@@ -1,17 +0,0 @@
1
- export { CommandError } from './command-error';
2
- export { ConfigDeleteError } from './config-delete-error';
3
- export { ConfigError } from './config-error';
4
- export { ConfigGetError } from './config-get-error';
5
- export { InitError } from './init-error';
6
- export { ServerlessError } from './serverless-error';
7
- export { HumanError } from './human-error';
8
- export { HumanWarning } from './human-warning';
9
- interface IConfigs {
10
- error: Error;
11
- prefix?: string;
12
- }
13
- export declare class HandleError {
14
- private traceId;
15
- constructor(configs: IConfigs);
16
- report(error: Error): Promise<void>;
17
- }
@@ -1,5 +0,0 @@
1
- /** @format */
2
- import { ServerlessError } from './serverless-error';
3
- export declare class InitError extends ServerlessError {
4
- constructor(message: string, params?: any);
5
- }
@@ -1,4 +0,0 @@
1
- /** @format */
2
- export declare class ServerlessError {
3
- constructor(phase: string, message: string, params?: any);
4
- }
@@ -1,6 +0,0 @@
1
- /** @format */
2
- interface IConfig {
3
- [key: string]: any;
4
- }
5
- export declare function execDaemon(filename: string, config?: IConfig): void;
6
- export {};
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export {};
@@ -1,2 +0,0 @@
1
- /** @format */
2
- export {};
@@ -1,43 +0,0 @@
1
- export declare const ALL_TEMPLATE: {
2
- name: string;
3
- value: string;
4
- }[];
5
- export declare const APPLICATION_TEMPLATE: ({
6
- type: string;
7
- name: string;
8
- loop: boolean;
9
- message: string;
10
- default: string;
11
- source: (answersSoFar: any, input: any) => Promise<{
12
- name: string;
13
- value: string;
14
- }[]>;
15
- } | {
16
- type: string;
17
- name: string;
18
- message: any;
19
- default: string;
20
- loop: boolean;
21
- when(answers: any): boolean;
22
- source: (answersSoFar: any, input: any) => Promise<{
23
- name: string;
24
- value: string;
25
- }[]>;
26
- } | {
27
- type: string;
28
- name: string;
29
- when(answers: any): boolean;
30
- default: string;
31
- message: any;
32
- source: (answersSoFar: any, input: any) => Promise<{
33
- name: string;
34
- value: string;
35
- }[]>;
36
- loop?: undefined;
37
- })[];
38
- export declare const PROJECT_NAME_INPUT: {
39
- type: string;
40
- name: string;
41
- message: string;
42
- validate(input: any): true | "You must provide a project name";
43
- };
@@ -1,17 +0,0 @@
1
- /** @format */
2
- export declare class InitManager {
3
- protected promps: any;
4
- constructor();
5
- initSconfig(appPath: string): Promise<string>;
6
- initEnvConfig(appPath: string): Promise<void>;
7
- assemblySpecialApp(appName: any, { projectName, appPath }: {
8
- projectName: any;
9
- appPath: any;
10
- }): Promise<void>;
11
- executeInit(name: string, dir?: string, downloadurl?: boolean): Promise<{
12
- appPath: any;
13
- }>;
14
- gitCloneProject(name: string, dir?: string): Promise<unknown>;
15
- deploy(appPath: string): Promise<void>;
16
- init(name?: string, dir?: string): Promise<void>;
17
- }
@@ -1,2 +0,0 @@
1
- declare function onboarding(): Promise<void>;
2
- export default onboarding;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export declare const registryInquire: {
2
- type: string;
3
- name: string;
4
- message: string;
5
- choices: {
6
- key: string;
7
- name: string;
8
- value: string;
9
- }[];
10
- }[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- /** @format */
2
- export declare class Analysis {
3
- protected readonly parsedObj: any;
4
- protected readonly dependenciesMap: any;
5
- protected componentOrderKeyMap: {
6
- [key: string]: any;
7
- };
8
- constructor(parsedObj: any, dependenciesMap: any);
9
- private getComponentOrderKeyMap;
10
- private calculateOrderNumber;
11
- getProjectOrder(): string[];
12
- }
@@ -1,4 +0,0 @@
1
- /** @format */
2
- export { Parse } from './parse';
3
- export { Analysis } from './analysis';
4
- export { default as version } from './version';
@@ -1,24 +0,0 @@
1
- interface MAP_OBJECT {
2
- [key: string]: any;
3
- }
4
- export declare class Parse {
5
- protected path: string;
6
- protected parsedObj: any;
7
- dependenciesMap: {
8
- [key: string]: any;
9
- };
10
- protected globalJsonKeyMap: any;
11
- protected globalKeyArr: any[];
12
- protected magicVariablesArray: any[];
13
- constructor(path: string);
14
- getFileObj(filePath: string): {};
15
- init(filePath: string): Promise<void>;
16
- getOriginalParsedObj(): any;
17
- private findVariableValue;
18
- generateMagicVariables(value: any, arr?: any[], parentStr?: string): any[];
19
- isProjectProperties(topKey: string, parentKey: any): boolean;
20
- iteratorToSetValue(objValue: any, topKey: string, parentKey?: any): any;
21
- replaceVariable(variable: any | MAP_OBJECT): any;
22
- getRealVariables(parsedObj: any): Promise<any>;
23
- }
24
- export {};
@@ -1,35 +0,0 @@
1
- /** @format */
2
- export declare function getSubcommand(configData: any): string[];
3
- export declare function getServiceConfig(configData: any, serviceName: string): string[];
4
- export declare function getServiceConfigDetail(configData: any): {
5
- name: any;
6
- provider: any;
7
- access: any;
8
- autoCredential: any;
9
- };
10
- export declare function getServiceInputs(configData: any, version: string, options: any): {
11
- Properties: any;
12
- Credentials: any;
13
- Project: {
14
- ProjectName: any;
15
- Component: any;
16
- Provider: any;
17
- AccessAlias: any;
18
- };
19
- Command: any;
20
- Args: any;
21
- Path: {
22
- ConfigPath: string;
23
- };
24
- };
25
- export declare function getServiceActions(configData: any, version: string, options: any): any;
26
- export declare function getServiceList(configData: any): any;
27
- declare const _default: {
28
- getSubcommand: typeof getSubcommand;
29
- getServiceConfig: typeof getServiceConfig;
30
- getServiceConfigDetail: typeof getServiceConfigDetail;
31
- getServiceInputs: typeof getServiceInputs;
32
- getServiceActions: typeof getServiceActions;
33
- getServiceList: typeof getServiceList;
34
- };
35
- export default _default;
@@ -1,10 +0,0 @@
1
- declare class UpdateNotifier {
2
- constructor();
3
- config(key?: string): any;
4
- check(): boolean;
5
- init(): this;
6
- update(): Promise<void>;
7
- install(): void;
8
- notify(): void;
9
- }
10
- export = UpdateNotifier;
@@ -1,18 +0,0 @@
1
- export declare function setEnvbyDotenv(templateFile: string): Promise<void>;
2
- export declare function createUniversalCommand(command: string, customerCommandName?: string, description?: string): import("commander").Command;
3
- export declare function getCommandDetail(name: any, provider: any, version: any): Promise<any[]>;
4
- export declare function getParsedTemplateObj(templateFile: any): Promise<any>;
5
- export declare function getCustomerCommandInfo(parsedTemplateObj: any): string[];
6
- export declare function createCustomerCommand(templateFile: string): Promise<any[]>;
7
- export declare function registerCommandChecker(program: any): void;
8
- export declare function registerCustomerCommand(system_command: any, templateFile: string): Promise<void>;
9
- export declare function registerUniversalCommand(system_command: any, templateFile: string): Promise<void>;
10
- export declare function registerVerbose(program: any): void;
11
- export declare function recordCommandHistory(argv: string[]): void;
12
- declare const _default: {
13
- registerCommandChecker: typeof registerCommandChecker;
14
- recordCommandHistory: typeof recordCommandHistory;
15
- registerCustomerCommand: typeof registerCustomerCommand;
16
- registerUniversalCommand: typeof registerUniversalCommand;
17
- };
18
- export default _default;