@adobe/ccweb-add-on-ssl 0.1.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 (90) hide show
  1. package/.c8rc.json +7 -0
  2. package/.mocharc.json +5 -0
  3. package/CODE_OF_CONDUCT.md +79 -0
  4. package/CONTRIBUTING.md +47 -0
  5. package/LICENSE +21 -0
  6. package/README.md +21 -0
  7. package/bin/run.cmd +3 -0
  8. package/bin/run.js +8 -0
  9. package/dist/AnalyticsMarkers.d.ts +35 -0
  10. package/dist/AnalyticsMarkers.d.ts.map +1 -0
  11. package/dist/AnalyticsMarkers.js +37 -0
  12. package/dist/app/CommandExecutor.d.ts +36 -0
  13. package/dist/app/CommandExecutor.d.ts.map +1 -0
  14. package/dist/app/CommandExecutor.js +25 -0
  15. package/dist/app/SSLReader.d.ts +48 -0
  16. package/dist/app/SSLReader.d.ts.map +1 -0
  17. package/dist/app/SSLReader.js +25 -0
  18. package/dist/app/SetupCommandExecutor.d.ts +64 -0
  19. package/dist/app/SetupCommandExecutor.d.ts.map +1 -0
  20. package/dist/app/SetupCommandExecutor.js +243 -0
  21. package/dist/app/WxpSSLReader.d.ts +60 -0
  22. package/dist/app/WxpSSLReader.d.ts.map +1 -0
  23. package/dist/app/WxpSSLReader.js +113 -0
  24. package/dist/app/index.d.ts +28 -0
  25. package/dist/app/index.d.ts.map +1 -0
  26. package/dist/app/index.js +28 -0
  27. package/dist/commands/setup.d.ts +54 -0
  28. package/dist/commands/setup.d.ts.map +1 -0
  29. package/dist/commands/setup.js +118 -0
  30. package/dist/config/index.d.ts +26 -0
  31. package/dist/config/index.d.ts.map +1 -0
  32. package/dist/config/index.js +26 -0
  33. package/dist/config/inversify.config.d.ts +27 -0
  34. package/dist/config/inversify.config.d.ts.map +1 -0
  35. package/dist/config/inversify.config.js +42 -0
  36. package/dist/config/inversify.types.d.ts +29 -0
  37. package/dist/config/inversify.types.d.ts.map +1 -0
  38. package/dist/config/inversify.types.js +29 -0
  39. package/dist/constants.d.ts +25 -0
  40. package/dist/constants.d.ts.map +1 -0
  41. package/dist/constants.js +25 -0
  42. package/dist/index.d.ts +28 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +28 -0
  45. package/dist/models/SetupCommandOptions.d.ts +49 -0
  46. package/dist/models/SetupCommandOptions.d.ts.map +1 -0
  47. package/dist/models/SetupCommandOptions.js +53 -0
  48. package/dist/models/Types.d.ts +57 -0
  49. package/dist/models/Types.d.ts.map +1 -0
  50. package/dist/models/Types.js +40 -0
  51. package/dist/models/index.d.ts +26 -0
  52. package/dist/models/index.d.ts.map +1 -0
  53. package/dist/models/index.js +26 -0
  54. package/dist/tsconfig.tsbuildinfo +1 -0
  55. package/dist/validators/CommandValidator.d.ts +36 -0
  56. package/dist/validators/CommandValidator.d.ts.map +1 -0
  57. package/dist/validators/CommandValidator.js +25 -0
  58. package/dist/validators/SetupCommandValidator.d.ts +52 -0
  59. package/dist/validators/SetupCommandValidator.d.ts.map +1 -0
  60. package/dist/validators/SetupCommandValidator.js +94 -0
  61. package/dist/validators/index.d.ts +26 -0
  62. package/dist/validators/index.d.ts.map +1 -0
  63. package/dist/validators/index.js +26 -0
  64. package/package.json +65 -0
  65. package/src/AnalyticsMarkers.ts +36 -0
  66. package/src/app/CommandExecutor.ts +37 -0
  67. package/src/app/SSLReader.ts +51 -0
  68. package/src/app/SetupCommandExecutor.ts +310 -0
  69. package/src/app/WxpSSLReader.ts +121 -0
  70. package/src/app/index.ts +28 -0
  71. package/src/commands/setup.ts +146 -0
  72. package/src/config/index.ts +26 -0
  73. package/src/config/inversify.config.ts +49 -0
  74. package/src/config/inversify.types.ts +29 -0
  75. package/src/constants.ts +25 -0
  76. package/src/index.ts +28 -0
  77. package/src/models/SetupCommandOptions.ts +56 -0
  78. package/src/models/Types.ts +61 -0
  79. package/src/models/index.ts +26 -0
  80. package/src/test/app/SetupCommandExecutor.spec.ts +800 -0
  81. package/src/test/app/WxpSSLReader.spec.ts +244 -0
  82. package/src/test/commands/setup.spec.ts +161 -0
  83. package/src/test/data/cert/cert.pem +19 -0
  84. package/src/test/data/cert/key.pem +27 -0
  85. package/src/test/models/SetupCommandOptions.spec.ts +53 -0
  86. package/src/test/validators/SetupCommandValidator.spec.ts +168 -0
  87. package/src/validators/CommandValidator.ts +37 -0
  88. package/src/validators/SetupCommandValidator.ts +116 -0
  89. package/src/validators/index.ts +26 -0
  90. package/tsconfig.json +31 -0
package/.c8rc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "all": true,
3
+ "include": ["src/**/*.ts"],
4
+ "exclude": ["src/**/*.spec.ts", "src/**/*Types.ts", "src/**/index.ts", "src/config/*"],
5
+ "reporter": ["html", "text", "text-summary"],
6
+ "report-dir": "coverage"
7
+ }
package/.mocharc.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "extension": ["ts"],
3
+ "node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm", "no-warnings"],
4
+ "spec": ["src/test/**/*.spec.ts"]
5
+ }
@@ -0,0 +1,79 @@
1
+ # Adobe Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our project and community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contribute to a positive environment for our project and community include:
12
+
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best, not just for us as individuals but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ - Trolling, insulting or derogatory comments, and personal or political attacks
23
+ - Public or private harassment
24
+ - Publishing others’ private information, such as a physical or email address, without their explicit permission
25
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Our Responsibilities
28
+
29
+ Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any instances of unacceptable behavior.
30
+
31
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies when an individual is representing the project or its community both within project spaces and in public spaces. Examples of representing a project or community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by first contacting the project team. Oversight of Adobe projects is handled by the Adobe Open Source Office, which has final say in any violations and enforcement of this Code of Conduct and can be reached at Grp-opensourceoffice@adobe.com. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ The project team must respect the privacy and security of the reporter of any incident.
42
+
43
+ Project maintainers who do not follow or enforce the Code of Conduct may face temporary or permanent repercussions as determined by other members of the project's leadership or the Adobe Open Source Office.
44
+
45
+ ## Enforcement Guidelines
46
+
47
+ Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem to be in violation of this Code of Conduct:
48
+
49
+ **1. Correction**
50
+
51
+ Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
52
+
53
+ Consequence: A private, written warning from project maintainers describing the violation and why the behavior was unacceptable. A public apology may be requested from the violator before any further involvement in the project by violator.
54
+
55
+ **2. Warning**
56
+
57
+ Community Impact: A relatively minor violation through a single incident or series of actions.
58
+
59
+ Consequence: A written warning from project maintainers that includes stated consequences for continued unacceptable behavior. Violator must refrain from interacting with the people involved for a specified period of time as determined by the project maintainers, including, but not limited to, unsolicited interaction with those enforcing the Code of Conduct through channels such as community spaces and social media. Continued violations may lead to a temporary or permanent ban.
60
+
61
+ **3. Temporary Ban**
62
+
63
+ Community Impact: A more serious violation of community standards, including sustained unacceptable behavior.
64
+
65
+ Consequence: A temporary ban from any interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Failure to comply with the temporary ban may lead to a permanent ban.
66
+
67
+ **4. Permanent Ban**
68
+
69
+ Community Impact: Demonstrating a consistent pattern of violation of community standards or an egregious violation of community standards, including, but not limited to, sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
70
+
71
+ Consequence: A permanent ban from any interaction with the community.
72
+
73
+ ## Attribution
74
+
75
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
76
+ available at [http://contributor-covenant.org/version/2/1][version]
77
+
78
+ [homepage]: http://contributor-covenant.org
79
+ [version]: http://contributor-covenant.org/version/2/1
@@ -0,0 +1,47 @@
1
+ # Contributing
2
+
3
+ Thanks for choosing to contribute!
4
+
5
+ The following are a set of guidelines to follow when contributing to this project.
6
+
7
+ ## Code Of Conduct
8
+
9
+ This project adheres to the Adobe [code of conduct](../CODE_OF_CONDUCT.md). By participating,
10
+ you are expected to uphold this code. Please report unacceptable behavior to
11
+ [Grp-opensourceoffice@adobe.com](mailto:Grp-opensourceoffice@adobe.com).
12
+
13
+ ## Have A Question?
14
+
15
+ Start by filing an issue. The existing committers on this project work to reach
16
+ consensus around project direction and issue solutions within issue threads
17
+ (when appropriate).
18
+
19
+ ## Contributor License Agreement
20
+
21
+ All third-party contributions to this project must be accompanied by a signed contributor
22
+ license agreement. This gives Adobe permission to redistribute your contributions
23
+ as part of the project. [Sign our CLA](https://opensource.adobe.com/cla.html). You
24
+ only need to submit an Adobe CLA one time, so if you have submitted one previously,
25
+ you are good to go!
26
+
27
+ ## Code Reviews
28
+
29
+ All submissions should come in the form of pull requests and need to be reviewed
30
+ by project committers. Read [GitHub's pull request documentation](https://help.github.com/articles/about-pull-requests/)
31
+ for more information on sending pull requests.
32
+
33
+ Lastly, please follow the [pull request template](PULL_REQUEST_TEMPLATE.md) when
34
+ submitting a pull request!
35
+
36
+ ## From Contributor To Committer
37
+
38
+ We love contributions from our community! If you'd like to go a step beyond contributor
39
+ and become a committer with full write access and a say in the project, you must
40
+ be invited to the project. The existing committers employ an internal nomination
41
+ process that must reach lazy consensus (silence is approval) before invitations
42
+ are issued. If you feel you are qualified and want to get more deeply involved,
43
+ feel free to reach out to existing committers to have a conversation about that.
44
+
45
+ ## Security Issues
46
+
47
+ Security issues shouldn't be reported on this issue tracker. Instead, [file an issue to our security experts](https://helpx.adobe.com/security/alertus.html).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ © Copyright 2023 Adobe. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # @adobe/ccweb-add-on-ssl
2
+
3
+ [![Version](https://img.shields.io/npm/v/@adobe/ccweb-add-on-ssl.svg)](https://npmjs.org/package/@adobe/ccweb-add-on-ssl)
4
+ [![Downloads/week](https://img.shields.io/npm/dw/@adobe/ccweb-add-on-ssl.svg)](https://npmjs.org/package/@adobe/ccweb-add-on-ssl)
5
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)
6
+
7
+ ## Description
8
+
9
+ This package provides commands which can be used to set up your self-signed SSL certificate. This SSL certificate is used to locally host the add-on on your browser trusted HTTPS.
10
+
11
+ These commands are used by [@adobe/create-ccweb-add-on](https://www.npmjs.com/package/@adobe/create-ccweb-add-on) to set up your one-time SSL certificate during its first run on your system.
12
+
13
+ ## Commands
14
+
15
+ | Command | Description | Basic Usage |
16
+ | ------- | ---------------------------------------------------- | ------------------------------------------- |
17
+ | setup | Automatically set up self-signed SSL in your system. | ccweb-add-on-ssl setup --hostname localhost |
18
+
19
+ For detailed usage guides, you may check `npx @adobe/ccweb-add-on-ssl --help`.
20
+
21
+ For more information about developing Adobe Express add-ons, check out the [documentation](https://developer.adobe.com/express/add-ons/).
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import oclif from "@oclif/core";
4
+
5
+ oclif
6
+ .run(process.argv.slice(2), import.meta.url)
7
+ .then(oclif.flush)
8
+ .catch(oclif.Errors.handle);
@@ -0,0 +1,35 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ export declare enum AnalyticsErrorMarkers {
25
+ ERROR_SSL_INVALID_HOSTNAME = "ERROR_SSL_INVALID_HOSTNAME",
26
+ ERROR_SSL_SETUP = "ERROR_SSL_SETUP",
27
+ ERROR_SSL_REMOVE = "ERROR_SSL_REMOVE"
28
+ }
29
+ export declare enum AnalyticsSuccessMarkers {
30
+ SUCCESSFUL_SSL_MANUAL_SETUP = "SUCCESSFUL_SSL_MANUAL_SETUP",
31
+ SUCCESSFUL_SSL_AUTOMATIC_SETUP = "SUCCESSFUL_SSL_AUTOMATIC_SETUP",
32
+ SUCCESSFUL_SSL_MANUAL_REMOVE = "SUCCESSFUL_SSL_MANUAL_REMOVE",
33
+ SUCCESSFUL_SSL_AUTOMATIC_REMOVE = "SUCCESSFUL_SSL_AUTOMATIC_REMOVE"
34
+ }
35
+ //# sourceMappingURL=AnalyticsMarkers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnalyticsMarkers.d.ts","sourceRoot":"","sources":["../src/AnalyticsMarkers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,oBAAY,qBAAqB;IAC7B,0BAA0B,+BAA+B;IACzD,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;CACxC;AAED,oBAAY,uBAAuB;IAC/B,2BAA2B,gCAAgC;IAC3D,8BAA8B,mCAAmC;IACjE,4BAA4B,iCAAiC;IAC7D,+BAA+B,oCAAoC;CACtE"}
@@ -0,0 +1,37 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ export var AnalyticsErrorMarkers;
25
+ (function (AnalyticsErrorMarkers) {
26
+ AnalyticsErrorMarkers["ERROR_SSL_INVALID_HOSTNAME"] = "ERROR_SSL_INVALID_HOSTNAME";
27
+ AnalyticsErrorMarkers["ERROR_SSL_SETUP"] = "ERROR_SSL_SETUP";
28
+ AnalyticsErrorMarkers["ERROR_SSL_REMOVE"] = "ERROR_SSL_REMOVE";
29
+ })(AnalyticsErrorMarkers || (AnalyticsErrorMarkers = {}));
30
+ export var AnalyticsSuccessMarkers;
31
+ (function (AnalyticsSuccessMarkers) {
32
+ AnalyticsSuccessMarkers["SUCCESSFUL_SSL_MANUAL_SETUP"] = "SUCCESSFUL_SSL_MANUAL_SETUP";
33
+ AnalyticsSuccessMarkers["SUCCESSFUL_SSL_AUTOMATIC_SETUP"] = "SUCCESSFUL_SSL_AUTOMATIC_SETUP";
34
+ AnalyticsSuccessMarkers["SUCCESSFUL_SSL_MANUAL_REMOVE"] = "SUCCESSFUL_SSL_MANUAL_REMOVE";
35
+ AnalyticsSuccessMarkers["SUCCESSFUL_SSL_AUTOMATIC_REMOVE"] = "SUCCESSFUL_SSL_AUTOMATIC_REMOVE";
36
+ })(AnalyticsSuccessMarkers || (AnalyticsSuccessMarkers = {}));
37
+ //# sourceMappingURL=AnalyticsMarkers.js.map
@@ -0,0 +1,36 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ import type { CommandOptions } from "../models/index.js";
25
+ /**
26
+ * Command execution contracts.
27
+ */
28
+ export interface CommandExecutor {
29
+ /**
30
+ * Execute command.
31
+ * @param options - Command arguments entered by user represented as {@link CommandOptions}.
32
+ * @returns Promise.
33
+ */
34
+ execute(options: CommandOptions): Promise<void>;
35
+ }
36
+ //# sourceMappingURL=CommandExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandExecutor.d.ts","sourceRoot":"","sources":["../../src/app/CommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
@@ -0,0 +1,25 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ export {};
25
+ //# sourceMappingURL=CommandExecutor.js.map
@@ -0,0 +1,48 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ import type { SSLData } from "../models/index.js";
25
+ /**
26
+ * Contracts for reading the SSL artifacts.
27
+ */
28
+ export interface SSLReader {
29
+ /**
30
+ * Is SSL set up manually by the user.
31
+ * @param hostname - Hostname in the SSL certificate.
32
+ * @returns Boolean value representing whether SSL is set up manually.
33
+ */
34
+ isCustomSSL(hostname: string): boolean;
35
+ /**
36
+ * Is SSL set up automatically by the tool.
37
+ * @param hostname - Hostname in the SSL certificate.
38
+ * @returns Boolean value representing whether SSL is set up automatically.
39
+ */
40
+ isWxpSSL(hostname: string): boolean;
41
+ /**
42
+ * Read the SSL artifacts.
43
+ * @param hostname - Hostname in the SSL certificate.
44
+ * @returns Promise of {@link SSLData}.
45
+ */
46
+ read(hostname: string): Promise<SSLData>;
47
+ }
48
+ //# sourceMappingURL=SSLReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SSLReader.d.ts","sourceRoot":"","sources":["../../src/app/SSLReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAEpC;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C"}
@@ -0,0 +1,25 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ export {};
25
+ //# sourceMappingURL=SSLReader.js.map
@@ -0,0 +1,64 @@
1
+ /********************************************************************************
2
+ * MIT License
3
+
4
+ * © Copyright 2023 Adobe. All rights reserved.
5
+
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ ********************************************************************************/
24
+ import type { AnalyticsService } from "@adobe/ccweb-add-on-analytics";
25
+ import type { Logger, Preferences } from "@adobe/ccweb-add-on-core";
26
+ import "reflect-metadata";
27
+ import type { SetupCommandOptions } from "../models/SetupCommandOptions.js";
28
+ import type { CommandExecutor } from "./CommandExecutor.js";
29
+ import type { SSLReader } from "./SSLReader.js";
30
+ /**
31
+ * Setup command execution implementation class.
32
+ */
33
+ export declare class SetupCommandExecutor implements CommandExecutor {
34
+ private readonly _preferences;
35
+ private readonly _sslReader;
36
+ private readonly _analyticsService;
37
+ private readonly _logger;
38
+ /**
39
+ * Instantiate {@link SetupCommandExecutor}.
40
+ * @param preferences - {@link Preferences} reference.
41
+ * @param sslReader - {@link SSLReader} reference.
42
+ * @param analyticsService - {@link AnalyticsService} reference.
43
+ * @param logger - {@link Logger} reference.
44
+ * @returns Reference to a new {@link SetupCommandExecutor} instance.
45
+ */
46
+ constructor(preferences: Preferences, sslReader: SSLReader, analyticsService: AnalyticsService, logger: Logger);
47
+ /**
48
+ * Setup self-signed SSL certificate and key by checking if user defined preferences
49
+ * have SSL config data or if the user has already setup the certificates last time.
50
+ * Otherwise prompt the user to setup the SSL themselves by providing paths as the input or
51
+ * by allowing the CLI to setup the certificates on user's behalf.
52
+ * @param options - Command arguments provided by user represented as {@link SetupCommandOptions}.
53
+ * @returns Promise.
54
+ */
55
+ execute(options: SetupCommandOptions): Promise<void>;
56
+ private _shouldSetupNewSSL;
57
+ private _setupSSLManually;
58
+ private _setupSSLAutomatically;
59
+ private _removeExistingSSL;
60
+ private _promptUserForPath;
61
+ private _promptMessage;
62
+ private _promptMessageOption;
63
+ }
64
+ //# sourceMappingURL=SetupCommandExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetupCommandExecutor.d.ts","sourceRoot":"","sources":["../../src/app/SetupCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAQpE,OAAO,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD;;GAEG;AACH,qBACa,oBAAqB,YAAW,eAAe;IACxD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;;;OAOG;gBAEiC,WAAW,EAAE,WAAW,EAC9B,SAAS,EAAE,SAAS,EACJ,gBAAgB,EAAE,gBAAgB,EACjD,MAAM,EAAE,MAAM;IAQ7C;;;;;;;OAOG;IACG,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;YA2C5C,kBAAkB;YA4BlB,iBAAiB;YAejB,sBAAsB;YAgBtB,kBAAkB;YA0DlB,kBAAkB;IAkChC,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,oBAAoB;CAG/B"}