@adobe/ccweb-add-on-ssl 3.0.1 → 3.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.
- package/.c8rc.json +12 -1
- package/dist/app/CommandExecutor.d.ts +6 -7
- package/dist/app/CommandExecutor.d.ts.map +1 -1
- package/dist/app/PurgeCommandExecutor.d.ts +4 -3
- package/dist/app/PurgeCommandExecutor.d.ts.map +1 -1
- package/dist/app/PurgeCommandExecutor.js +8 -8
- package/dist/app/SSLReader.d.ts +22 -3
- package/dist/app/SSLReader.d.ts.map +1 -1
- package/dist/app/SSLReader.js +143 -1
- package/dist/app/SetupCommandExecutor.d.ts +5 -4
- package/dist/app/SetupCommandExecutor.d.ts.map +1 -1
- package/dist/app/SetupCommandExecutor.js +12 -12
- package/dist/app/index.d.ts +1 -2
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +0 -2
- package/dist/commands/purge.js +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/config/inversify.config.d.ts +1 -1
- package/dist/config/inversify.config.d.ts.map +1 -1
- package/dist/config/inversify.config.js +5 -3
- package/dist/models/{Types.d.ts → SSLTypes.d.ts} +1 -6
- package/dist/models/SSLTypes.d.ts.map +1 -0
- package/dist/models/{Types.js → SSLTypes.js} +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/validators/CommandValidator.d.ts +5 -6
- package/dist/validators/CommandValidator.d.ts.map +1 -1
- package/dist/validators/SetupCommandValidator.d.ts +2 -3
- package/dist/validators/SetupCommandValidator.d.ts.map +1 -1
- package/dist/validators/SetupCommandValidator.js +1 -2
- package/dist/validators/index.d.ts +1 -1
- package/dist/validators/index.d.ts.map +1 -1
- package/dist/validators/index.js +0 -1
- package/package.json +6 -6
- package/src/app/CommandExecutor.ts +6 -8
- package/src/app/PurgeCommandExecutor.ts +9 -9
- package/src/app/SSLReader.ts +144 -6
- package/src/app/SetupCommandExecutor.ts +14 -14
- package/src/app/index.ts +1 -2
- package/src/commands/purge.ts +1 -1
- package/src/commands/setup.ts +11 -5
- package/src/config/inversify.config.ts +11 -8
- package/src/models/{Types.ts → SSLTypes.ts} +0 -7
- package/src/models/index.ts +1 -1
- package/src/test/app/PurgeCommandExecutor.spec.ts +6 -5
- package/src/test/app/{WxpSSLReader.spec.ts → SSLReader.spec.ts} +5 -6
- package/src/test/app/SetupCommandExecutor.spec.ts +8 -6
- package/src/test/commands/command.spec.ts +2 -1
- package/src/test/commands/purge.spec.ts +1 -1
- package/src/test/commands/setup.spec.ts +1 -1
- package/src/test/models/SetupCommandOptions.spec.ts +1 -1
- package/src/test/validators/SetupCommandValidator.spec.ts +3 -3
- package/src/validators/CommandValidator.ts +5 -7
- package/src/validators/SetupCommandValidator.ts +2 -3
- package/src/validators/index.ts +1 -1
- package/dist/app/WxpSSLReader.d.ts +0 -67
- package/dist/app/WxpSSLReader.d.ts.map +0 -1
- package/dist/app/WxpSSLReader.js +0 -167
- package/dist/models/Types.d.ts.map +0 -1
- package/src/app/WxpSSLReader.ts +0 -187
package/.c8rc.json
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"all": true,
|
|
3
3
|
"include": ["src/**/*.ts"],
|
|
4
|
-
"exclude": [
|
|
4
|
+
"exclude": [
|
|
5
|
+
"src/**/*.spec.ts",
|
|
6
|
+
"src/models/SSLTypes.ts",
|
|
7
|
+
"src/app/CommandExecutor.ts",
|
|
8
|
+
"src/validators/CommandValidator.ts",
|
|
9
|
+
"src/**/index.ts",
|
|
10
|
+
"src/config/*"
|
|
11
|
+
],
|
|
12
|
+
"lines": 100,
|
|
13
|
+
"functions": 100,
|
|
14
|
+
"branches": 100,
|
|
15
|
+
"statements": 100,
|
|
5
16
|
"reporter": ["html", "text", "text-summary"],
|
|
6
17
|
"report-dir": "coverage"
|
|
7
18
|
}
|
|
@@ -21,16 +21,15 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import type { CommandOptions } from "../models/index.js";
|
|
25
24
|
/**
|
|
26
|
-
* Command
|
|
25
|
+
* Command Executor interface for handling CLI commands.
|
|
27
26
|
*/
|
|
28
|
-
export interface CommandExecutor {
|
|
27
|
+
export interface CommandExecutor<TOptions = void> {
|
|
29
28
|
/**
|
|
30
|
-
* Execute command.
|
|
31
|
-
* @param options - Command
|
|
32
|
-
* @returns Promise.
|
|
29
|
+
* Execute the command.
|
|
30
|
+
* @param options - Command execution options.
|
|
31
|
+
* @returns Promise that resolves indicating the command was executed successfully.
|
|
33
32
|
*/
|
|
34
|
-
execute(options?:
|
|
33
|
+
execute(options?: TOptions): Promise<void>;
|
|
35
34
|
}
|
|
36
35
|
//# sourceMappingURL=CommandExecutor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandExecutor.d.ts","sourceRoot":"","sources":["../../src/app/CommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF
|
|
1
|
+
{"version":3,"file":"CommandExecutor.d.ts","sourceRoot":"","sources":["../../src/app/CommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,QAAQ,GAAG,IAAI;IAC5C;;;;OAIG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C"}
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import type { AnalyticsService } from "@adobe/ccweb-add-on-analytics";
|
|
25
|
-
import type { Logger
|
|
25
|
+
import type { Logger } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import { UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
27
|
import "reflect-metadata";
|
|
27
28
|
import type { CommandExecutor } from "./CommandExecutor.js";
|
|
28
29
|
/**
|
|
@@ -34,12 +35,12 @@ export declare class PurgeCommandExecutor implements CommandExecutor {
|
|
|
34
35
|
private readonly _logger;
|
|
35
36
|
/**
|
|
36
37
|
* Instantiate {@link PurgeCommandExecutor}.
|
|
37
|
-
* @param preferences - {@link
|
|
38
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
38
39
|
* @param analyticsService - {@link AnalyticsService} reference.
|
|
39
40
|
* @param logger - {@link Logger} reference.
|
|
40
41
|
* @returns Reference to a new {@link PurgeCommandExecutor} instance.
|
|
41
42
|
*/
|
|
42
|
-
constructor(preferences:
|
|
43
|
+
constructor(preferences: UserPreferences, analyticsService: AnalyticsService, logger: Logger);
|
|
43
44
|
/**
|
|
44
45
|
* Purge all SSL artifacts and invalidate the certificate authority from the trusted source.
|
|
45
46
|
* @returns Promise.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PurgeCommandExecutor.d.ts","sourceRoot":"","sources":["../../src/app/PurgeCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"PurgeCommandExecutor.d.ts","sourceRoot":"","sources":["../../src/app/PurgeCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAwB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAMjF,OAAO,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,qBACa,oBAAqB,YAAW,eAAe;IACxD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAC/C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;;OAMG;gBAEqC,WAAW,EAAE,eAAe,EACtB,gBAAgB,EAAE,gBAAgB,EACjD,MAAM,EAAE,MAAM;IAO7C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAqC9B,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,oBAAoB;CAG/B"}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import { __decorate, __metadata, __param } from "tslib";
|
|
25
25
|
import { ITypes as IAnalyticsTypes } from "@adobe/ccweb-add-on-analytics";
|
|
26
|
-
import { ITypes as ICoreTypes } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import { ITypes as ICoreTypes, UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
27
27
|
import devcert from "@adobe/ccweb-add-on-devcert";
|
|
28
28
|
import chalk from "chalk";
|
|
29
29
|
import fs from "fs-extra";
|
|
@@ -31,7 +31,7 @@ import { inject, injectable } from "inversify";
|
|
|
31
31
|
import prompts from "prompts";
|
|
32
32
|
import "reflect-metadata";
|
|
33
33
|
import { AnalyticsErrorMarkers, AnalyticsSuccessMarkers } from "../AnalyticsMarkers.js";
|
|
34
|
-
import { SSLRemoveOption } from "../models/
|
|
34
|
+
import { SSLRemoveOption } from "../models/SSLTypes.js";
|
|
35
35
|
/**
|
|
36
36
|
* Purge command execution implementation class.
|
|
37
37
|
*/
|
|
@@ -41,7 +41,7 @@ let PurgeCommandExecutor = class PurgeCommandExecutor {
|
|
|
41
41
|
_logger;
|
|
42
42
|
/**
|
|
43
43
|
* Instantiate {@link PurgeCommandExecutor}.
|
|
44
|
-
* @param preferences - {@link
|
|
44
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
45
45
|
* @param analyticsService - {@link AnalyticsService} reference.
|
|
46
46
|
* @param logger - {@link Logger} reference.
|
|
47
47
|
* @returns Reference to a new {@link PurgeCommandExecutor} instance.
|
|
@@ -67,7 +67,7 @@ let PurgeCommandExecutor = class PurgeCommandExecutor {
|
|
|
67
67
|
initial: 0
|
|
68
68
|
});
|
|
69
69
|
if (!response || !response.purgeConfirmation) {
|
|
70
|
-
this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_PURGE, LOGS.sslPurgeOptionNotSpecified, false);
|
|
70
|
+
void this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_PURGE, LOGS.sslPurgeOptionNotSpecified, false);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
if (response.purgeConfirmation === SSLRemoveOption.Keep) {
|
|
@@ -86,13 +86,13 @@ let PurgeCommandExecutor = class PurgeCommandExecutor {
|
|
|
86
86
|
if (userPreference.ssl !== undefined) {
|
|
87
87
|
userPreference.ssl = undefined;
|
|
88
88
|
this._preferences.set(userPreference);
|
|
89
|
-
this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_MANUAL_PURGE, "", true);
|
|
89
|
+
void this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_MANUAL_PURGE, "", true);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
_purgeWxpSSL() {
|
|
93
93
|
if (fs.existsSync(devcert.location())) {
|
|
94
94
|
devcert.removeAll();
|
|
95
|
-
this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_AUTOMATIC_PURGE, "", true);
|
|
95
|
+
void this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_AUTOMATIC_PURGE, "", true);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
_promptMessage(message) {
|
|
@@ -104,10 +104,10 @@ let PurgeCommandExecutor = class PurgeCommandExecutor {
|
|
|
104
104
|
};
|
|
105
105
|
PurgeCommandExecutor = __decorate([
|
|
106
106
|
injectable(),
|
|
107
|
-
__param(0, inject(ICoreTypes.
|
|
107
|
+
__param(0, inject(ICoreTypes.UserPreferences)),
|
|
108
108
|
__param(1, inject(IAnalyticsTypes.AnalyticsService)),
|
|
109
109
|
__param(2, inject(ICoreTypes.Logger)),
|
|
110
|
-
__metadata("design:paramtypes", [
|
|
110
|
+
__metadata("design:paramtypes", [UserPreferences, Function, Object])
|
|
111
111
|
], PurgeCommandExecutor);
|
|
112
112
|
export { PurgeCommandExecutor };
|
|
113
113
|
const LOGS = {
|
package/dist/app/SSLReader.d.ts
CHANGED
|
@@ -21,11 +21,23 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import type {
|
|
24
|
+
import type { Logger } from "@adobe/ccweb-add-on-core";
|
|
25
|
+
import { UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import "reflect-metadata";
|
|
27
|
+
import type { SSLData } from "../models/SSLTypes.js";
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
29
|
+
* Implementation class for reading the SSL artifacts.
|
|
27
30
|
*/
|
|
28
|
-
export
|
|
31
|
+
export declare class SSLReader {
|
|
32
|
+
private readonly _preferences;
|
|
33
|
+
private readonly _logger;
|
|
34
|
+
/**
|
|
35
|
+
* Instantiate {@link SSLReader}.
|
|
36
|
+
* @param Preferences - {@link UserPreferences} reference.
|
|
37
|
+
* @param logger - {@link Logger} reference.
|
|
38
|
+
* @returns Reference to a new {@link SSLReader} instance.
|
|
39
|
+
*/
|
|
40
|
+
constructor(preferences: UserPreferences, logger: Logger);
|
|
29
41
|
/**
|
|
30
42
|
* Is SSL set up manually by the user.
|
|
31
43
|
* @param hostname - Hostname in the SSL certificate.
|
|
@@ -45,5 +57,12 @@ export interface SSLReader {
|
|
|
45
57
|
* @returns Promise of {@link SSLData}.
|
|
46
58
|
*/
|
|
47
59
|
read(hostname: string, port: number): Promise<SSLData>;
|
|
60
|
+
private _getUserDefinedSSL;
|
|
61
|
+
private _handleExpiredSSLCertificate;
|
|
62
|
+
private _handleNearingExpirySSLCertificate;
|
|
63
|
+
private _handleNoSSLCertificateFound;
|
|
64
|
+
private _handleInvalidUserSSLCertificate;
|
|
65
|
+
private _handleUnknownExpirySSLCertificate;
|
|
66
|
+
private _recreateSSLCertificate;
|
|
48
67
|
}
|
|
49
68
|
//# sourceMappingURL=SSLReader.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"SSLReader.d.ts","sourceRoot":"","sources":["../../src/app/SSLReader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAgC,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIzF,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;GAEG;AACH,qBACa,SAAS;IAClB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;OAKG;gBAEqC,WAAW,EAAE,eAAe,EACrC,MAAM,EAAE,MAAM;IAM7C;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAItC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAInC;;;;;OAKG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA8C5D,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,4BAA4B;IAMpC,OAAO,CAAC,kCAAkC;IAK1C,OAAO,CAAC,4BAA4B;IAMpC,OAAO,CAAC,gCAAgC;IAKxC,OAAO,CAAC,kCAAkC;IAO1C,OAAO,CAAC,uBAAuB;CAOlC"}
|
package/dist/app/SSLReader.js
CHANGED
|
@@ -21,5 +21,147 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
|
|
24
|
+
import { __decorate, __metadata, __param } from "tslib";
|
|
25
|
+
import { ITypes as ICoreTypes, isFile, UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import devcert from "@adobe/ccweb-add-on-devcert";
|
|
27
|
+
import fs from "fs-extra";
|
|
28
|
+
import { inject, injectable } from "inversify";
|
|
29
|
+
import "reflect-metadata";
|
|
30
|
+
import format from "string-template";
|
|
31
|
+
/**
|
|
32
|
+
* Implementation class for reading the SSL artifacts.
|
|
33
|
+
*/
|
|
34
|
+
let SSLReader = class SSLReader {
|
|
35
|
+
_preferences;
|
|
36
|
+
_logger;
|
|
37
|
+
/**
|
|
38
|
+
* Instantiate {@link SSLReader}.
|
|
39
|
+
* @param Preferences - {@link UserPreferences} reference.
|
|
40
|
+
* @param logger - {@link Logger} reference.
|
|
41
|
+
* @returns Reference to a new {@link SSLReader} instance.
|
|
42
|
+
*/
|
|
43
|
+
constructor(preferences, logger) {
|
|
44
|
+
this._preferences = preferences;
|
|
45
|
+
this._logger = logger;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Is SSL set up manually by the user.
|
|
49
|
+
* @param hostname - Hostname in the SSL certificate.
|
|
50
|
+
* @returns Boolean value representing whether SSL is set up manually.
|
|
51
|
+
*/
|
|
52
|
+
isCustomSSL(hostname) {
|
|
53
|
+
return this._getUserDefinedSSL(hostname) !== undefined;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Is SSL set up automatically by the tool.
|
|
57
|
+
* @param hostname - Hostname in the SSL certificate.
|
|
58
|
+
* @returns Boolean value representing whether SSL is set up automatically.
|
|
59
|
+
*/
|
|
60
|
+
isWxpSSL(hostname) {
|
|
61
|
+
return devcert.hasCertificateFor(hostname);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Read the SSL artifacts.
|
|
65
|
+
* @param hostname - Hostname in the SSL certificate.
|
|
66
|
+
* @param port - Port where the add-on is being hosted.
|
|
67
|
+
* @returns Promise of {@link SSLData}.
|
|
68
|
+
*/
|
|
69
|
+
async read(hostname, port) {
|
|
70
|
+
const sslSettings = this._getUserDefinedSSL(hostname);
|
|
71
|
+
// When SSL is set up manuually by the `user`.
|
|
72
|
+
if (sslSettings !== undefined) {
|
|
73
|
+
const { certificatePath, keyPath } = sslSettings;
|
|
74
|
+
if (!certificatePath || !isFile(certificatePath)) {
|
|
75
|
+
this._handleInvalidUserSSLCertificate(LOGS.invalidCertificatePath);
|
|
76
|
+
return process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
if (!keyPath || !isFile(keyPath)) {
|
|
79
|
+
this._handleInvalidUserSSLCertificate(LOGS.invalidKeyPath);
|
|
80
|
+
return process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
this._handleUnknownExpirySSLCertificate(hostname, port);
|
|
83
|
+
return {
|
|
84
|
+
cert: fs.readFileSync(certificatePath),
|
|
85
|
+
key: fs.readFileSync(keyPath)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// When SSL is set up automatically by `devcert`.
|
|
89
|
+
if (this.isWxpSSL(hostname)) {
|
|
90
|
+
const caExpiry = devcert.caExpiryInDays();
|
|
91
|
+
const certificateExpiry = devcert.certificateExpiryInDays(hostname);
|
|
92
|
+
const expiry = Math.min(certificateExpiry, caExpiry);
|
|
93
|
+
if (expiry <= 0) {
|
|
94
|
+
this._handleExpiredSSLCertificate();
|
|
95
|
+
return process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
if (expiry <= 7) {
|
|
98
|
+
this._handleNearingExpirySSLCertificate(expiry);
|
|
99
|
+
}
|
|
100
|
+
return await devcert.certificateFor(hostname);
|
|
101
|
+
}
|
|
102
|
+
this._handleNoSSLCertificateFound();
|
|
103
|
+
return process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
_getUserDefinedSSL(hostname) {
|
|
106
|
+
const { ssl } = this._preferences.get();
|
|
107
|
+
if (ssl === undefined) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
return ssl.get(hostname);
|
|
111
|
+
}
|
|
112
|
+
_handleExpiredSSLCertificate() {
|
|
113
|
+
this._logger.error(LOGS.noValidSSLCertificateFound);
|
|
114
|
+
this._logger.error(LOGS.expiredSSLCertificate);
|
|
115
|
+
this._recreateSSLCertificate();
|
|
116
|
+
}
|
|
117
|
+
_handleNearingExpirySSLCertificate(expiry) {
|
|
118
|
+
this._logger.warning(format(LOGS.nearingExpirySSLCertificate, { expiry }));
|
|
119
|
+
this._recreateSSLCertificate();
|
|
120
|
+
}
|
|
121
|
+
_handleNoSSLCertificateFound() {
|
|
122
|
+
this._logger.error(LOGS.noValidSSLCertificateFound);
|
|
123
|
+
this._logger.error(LOGS.invalidatedSSLCertificate);
|
|
124
|
+
this._recreateSSLCertificate();
|
|
125
|
+
}
|
|
126
|
+
_handleInvalidUserSSLCertificate(errorMessage) {
|
|
127
|
+
this._logger.error(errorMessage);
|
|
128
|
+
this._recreateSSLCertificate();
|
|
129
|
+
}
|
|
130
|
+
_handleUnknownExpirySSLCertificate(hostname, port) {
|
|
131
|
+
this._logger.warning(LOGS.undeterminedExpirySSLCertificate);
|
|
132
|
+
this._logger.warning(LOGS.unableToSideloadAddOn);
|
|
133
|
+
this._logger.warning(format(LOGS.checkCertificateValidity, { hostname, port }));
|
|
134
|
+
this._recreateSSLCertificate();
|
|
135
|
+
}
|
|
136
|
+
_recreateSSLCertificate() {
|
|
137
|
+
this._logger.warning(LOGS.recreateSSLCertificate, { prefix: LOGS.newLine });
|
|
138
|
+
this._logger.information(LOGS.setupSSLCommand, { prefix: LOGS.tab });
|
|
139
|
+
this._logger.warning(LOGS.example, { prefix: LOGS.newLine });
|
|
140
|
+
this._logger.information(LOGS.setupSSLCommandExample, { prefix: LOGS.tab, postfix: LOGS.newLine });
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
SSLReader = __decorate([
|
|
144
|
+
injectable(),
|
|
145
|
+
__param(0, inject(ICoreTypes.UserPreferences)),
|
|
146
|
+
__param(1, inject(ICoreTypes.Logger)),
|
|
147
|
+
__metadata("design:paramtypes", [UserPreferences, Object])
|
|
148
|
+
], SSLReader);
|
|
149
|
+
export { SSLReader };
|
|
150
|
+
const LOGS = {
|
|
151
|
+
newLine: "\n",
|
|
152
|
+
tab: " ",
|
|
153
|
+
invalidCertificatePath: "Invalid SSL certificate file path.",
|
|
154
|
+
invalidKeyPath: "Invalid SSL key file path.",
|
|
155
|
+
noValidSSLCertificateFound: "Could not locate a valid SSL certificate to host the add-on.",
|
|
156
|
+
expiredSSLCertificate: "The SSL certificate has expired.",
|
|
157
|
+
nearingExpirySSLCertificate: "Your SSL certificate will expire in {expiry} days.",
|
|
158
|
+
invalidatedSSLCertificate: "If you had previously set it up, it may have been invalidated due to a version upgrade.",
|
|
159
|
+
undeterminedExpirySSLCertificate: "Could not determine the expiry of your SSL certificate.",
|
|
160
|
+
unableToSideloadAddOn: "If you are unable to sideload your add-on, please check the validity of:",
|
|
161
|
+
checkCertificateValidity: "https://{hostname}:{port} certificate in your browser.",
|
|
162
|
+
recreateSSLCertificate: "To re-create the SSL certificate, you may run:",
|
|
163
|
+
setupSSLCommand: "npx @adobe/ccweb-add-on-ssl setup --hostname [hostname]",
|
|
164
|
+
example: "Example:",
|
|
165
|
+
setupSSLCommandExample: "npx @adobe/ccweb-add-on-ssl setup --hostname localhost"
|
|
166
|
+
};
|
|
25
167
|
//# sourceMappingURL=SSLReader.js.map
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import type { AnalyticsService } from "@adobe/ccweb-add-on-analytics";
|
|
25
|
-
import type { Logger
|
|
25
|
+
import type { Logger } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import { UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
26
27
|
import "reflect-metadata";
|
|
27
28
|
import type { SetupCommandOptions } from "../models/SetupCommandOptions.js";
|
|
28
29
|
import type { CommandExecutor } from "./CommandExecutor.js";
|
|
@@ -30,20 +31,20 @@ import type { SSLReader } from "./SSLReader.js";
|
|
|
30
31
|
/**
|
|
31
32
|
* Setup command execution implementation class.
|
|
32
33
|
*/
|
|
33
|
-
export declare class SetupCommandExecutor implements CommandExecutor {
|
|
34
|
+
export declare class SetupCommandExecutor implements CommandExecutor<SetupCommandOptions> {
|
|
34
35
|
private readonly _preferences;
|
|
35
36
|
private readonly _sslReader;
|
|
36
37
|
private readonly _analyticsService;
|
|
37
38
|
private readonly _logger;
|
|
38
39
|
/**
|
|
39
40
|
* Instantiate {@link SetupCommandExecutor}.
|
|
40
|
-
* @param preferences - {@link
|
|
41
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
41
42
|
* @param sslReader - {@link SSLReader} reference.
|
|
42
43
|
* @param analyticsService - {@link AnalyticsService} reference.
|
|
43
44
|
* @param logger - {@link Logger} reference.
|
|
44
45
|
* @returns Reference to a new {@link SetupCommandExecutor} instance.
|
|
45
46
|
*/
|
|
46
|
-
constructor(preferences:
|
|
47
|
+
constructor(preferences: UserPreferences, sslReader: SSLReader, analyticsService: AnalyticsService, logger: Logger);
|
|
47
48
|
/**
|
|
48
49
|
* Setup self-signed SSL certificate and key by checking if user defined preferences
|
|
49
50
|
* have SSL config data or if the user has already setup the certificates last time.
|
|
@@ -1 +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,
|
|
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,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAgC,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAOzF,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,CAAC,mBAAmB,CAAC;IAC7E,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAC/C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;;;;;;OAOG;gBAEqC,WAAW,EAAE,eAAe,EACtC,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;YA0BlB,iBAAiB;YAejB,sBAAsB;YAgBtB,kBAAkB;YA+DlB,kBAAkB;IAkChC,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,oBAAoB;CAG/B"}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import { __decorate, __metadata, __param } from "tslib";
|
|
25
25
|
import { ITypes as IAnalyticsTypes } from "@adobe/ccweb-add-on-analytics";
|
|
26
|
-
import { ITypes as ICoreTypes, isFile } from "@adobe/ccweb-add-on-core";
|
|
26
|
+
import { ITypes as ICoreTypes, isFile, UserPreferences } from "@adobe/ccweb-add-on-core";
|
|
27
27
|
import devcert from "@adobe/ccweb-add-on-devcert";
|
|
28
28
|
import chalk from "chalk";
|
|
29
29
|
import { inject, injectable } from "inversify";
|
|
@@ -34,7 +34,7 @@ import "reflect-metadata";
|
|
|
34
34
|
import format from "string-template";
|
|
35
35
|
import { AnalyticsErrorMarkers, AnalyticsSuccessMarkers } from "../AnalyticsMarkers.js";
|
|
36
36
|
import { ITypes } from "../config/inversify.types.js";
|
|
37
|
-
import { SSLRemoveOption, SSLSetupOption } from "../models/
|
|
37
|
+
import { SSLRemoveOption, SSLSetupOption } from "../models/SSLTypes.js";
|
|
38
38
|
const MAX_PROMPT_RETRIES = 3;
|
|
39
39
|
/**
|
|
40
40
|
* Setup command execution implementation class.
|
|
@@ -46,7 +46,7 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
46
46
|
_logger;
|
|
47
47
|
/**
|
|
48
48
|
* Instantiate {@link SetupCommandExecutor}.
|
|
49
|
-
* @param preferences - {@link
|
|
49
|
+
* @param preferences - {@link UserPreferences} reference.
|
|
50
50
|
* @param sslReader - {@link SSLReader} reference.
|
|
51
51
|
* @param analyticsService - {@link AnalyticsService} reference.
|
|
52
52
|
* @param logger - {@link Logger} reference.
|
|
@@ -81,16 +81,16 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
81
81
|
initial: 0
|
|
82
82
|
});
|
|
83
83
|
if (!response || !response.sslSetupType) {
|
|
84
|
-
this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_SETUP, LOGS.sslSetupOptionNotSpecified, false);
|
|
84
|
+
void this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_SETUP, LOGS.sslSetupOptionNotSpecified, false);
|
|
85
85
|
return process.exit(1);
|
|
86
86
|
}
|
|
87
87
|
if (response.sslSetupType === SSLSetupOption.Manually) {
|
|
88
88
|
await this._setupSSLManually(options.hostname);
|
|
89
|
-
this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_MANUAL_SETUP, options.hostname, true);
|
|
89
|
+
void this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_MANUAL_SETUP, options.hostname, true);
|
|
90
90
|
}
|
|
91
91
|
else {
|
|
92
92
|
await this._setupSSLAutomatically(options.hostname);
|
|
93
|
-
this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_AUTOMATIC_SETUP, options.hostname, true);
|
|
93
|
+
void this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_AUTOMATIC_SETUP, options.hostname, true);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
async _shouldSetupNewSSL(options) {
|
|
@@ -150,7 +150,7 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
150
150
|
});
|
|
151
151
|
// If no response is obtained, which indicates something has gone wrong, then exit.
|
|
152
152
|
if (!response || !response.shouldRemove) {
|
|
153
|
-
this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_REMOVE, LOGS.sslRemoveOptionNotSpecified, false);
|
|
153
|
+
void this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_REMOVE, LOGS.sslRemoveOptionNotSpecified, false);
|
|
154
154
|
return process.exit(1);
|
|
155
155
|
}
|
|
156
156
|
// If the user chooses to keep the existing SSL, do not set up a new SSL.
|
|
@@ -163,7 +163,7 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
163
163
|
const userPreference = this._preferences.get();
|
|
164
164
|
userPreference.ssl.delete(options.hostname);
|
|
165
165
|
this._preferences.set(userPreference);
|
|
166
|
-
this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_MANUAL_REMOVE, options.hostname, true);
|
|
166
|
+
void this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_MANUAL_REMOVE, options.hostname, true);
|
|
167
167
|
}
|
|
168
168
|
if (isWxpSSL) {
|
|
169
169
|
if (devcert.caExpiryInDays() <= 0) {
|
|
@@ -172,7 +172,7 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
172
172
|
else {
|
|
173
173
|
await devcert.removeDomain(options.hostname);
|
|
174
174
|
}
|
|
175
|
-
this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_AUTOMATIC_REMOVE, options.hostname, true);
|
|
175
|
+
void this._analyticsService.postEvent(AnalyticsSuccessMarkers.SUCCESSFUL_SSL_AUTOMATIC_REMOVE, options.hostname, true);
|
|
176
176
|
}
|
|
177
177
|
this._logger.success(LOGS.removedExistingSSL, { prefix: LOGS.newLine, postfix: LOGS.newLine });
|
|
178
178
|
return true;
|
|
@@ -200,7 +200,7 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
200
200
|
maxTries--;
|
|
201
201
|
this._logger.error(format(LOGS.invalidPathSpecified, { asset }));
|
|
202
202
|
}
|
|
203
|
-
this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_SETUP, format(LOGS.invalidPathSpecified, { asset }), false);
|
|
203
|
+
void this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_SETUP, format(LOGS.invalidPathSpecified, { asset }), false);
|
|
204
204
|
return process.exit(1);
|
|
205
205
|
}
|
|
206
206
|
_promptMessage(message) {
|
|
@@ -212,11 +212,11 @@ let SetupCommandExecutor = class SetupCommandExecutor {
|
|
|
212
212
|
};
|
|
213
213
|
SetupCommandExecutor = __decorate([
|
|
214
214
|
injectable(),
|
|
215
|
-
__param(0, inject(ICoreTypes.
|
|
215
|
+
__param(0, inject(ICoreTypes.UserPreferences)),
|
|
216
216
|
__param(1, inject(ITypes.SSLReader)),
|
|
217
217
|
__param(2, inject(IAnalyticsTypes.AnalyticsService)),
|
|
218
218
|
__param(3, inject(ICoreTypes.Logger)),
|
|
219
|
-
__metadata("design:paramtypes", [
|
|
219
|
+
__metadata("design:paramtypes", [UserPreferences, Function, Function, Object])
|
|
220
220
|
], SetupCommandExecutor);
|
|
221
221
|
export { SetupCommandExecutor };
|
|
222
222
|
const LOGS = {
|
package/dist/app/index.d.ts
CHANGED
|
@@ -21,9 +21,8 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
export * from "./CommandExecutor.js";
|
|
24
|
+
export type * from "./CommandExecutor.js";
|
|
25
25
|
export * from "./PurgeCommandExecutor.js";
|
|
26
26
|
export * from "./SetupCommandExecutor.js";
|
|
27
27
|
export * from "./SSLReader.js";
|
|
28
|
-
export * from "./WxpSSLReader.js";
|
|
29
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/app/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,mBAAmB,sBAAsB,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC"}
|
package/dist/app/index.js
CHANGED
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
export * from "./CommandExecutor.js";
|
|
25
24
|
export * from "./PurgeCommandExecutor.js";
|
|
26
25
|
export * from "./SetupCommandExecutor.js";
|
|
27
26
|
export * from "./SSLReader.js";
|
|
28
|
-
export * from "./WxpSSLReader.js";
|
|
29
27
|
//# sourceMappingURL=index.js.map
|
package/dist/commands/purge.js
CHANGED
|
@@ -49,7 +49,7 @@ export class Purge extends BaseCommand {
|
|
|
49
49
|
await this._commandExecutor.execute();
|
|
50
50
|
}
|
|
51
51
|
async catch(error) {
|
|
52
|
-
this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_PURGE, error.message, false);
|
|
52
|
+
void this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_PURGE, error.message, false);
|
|
53
53
|
throw error;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,WAAW,EAAc,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEnG,OAAO,kBAAkB,CAAC;AAQ1B;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,WAAW,EAAc,MAAM,+BAA+B,CAAC;AAExE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEnG,OAAO,kBAAkB,CAAC;AAQ1B;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwC;IAC1E,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuC;IAExE,MAAM,CAAC,WAAW,SAAoE;IAEtF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK,EAAE;QACV,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC5C,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;KACrC,CAaC;gBAEU,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM;IAapC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBpB,KAAK,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
|
package/dist/commands/setup.js
CHANGED
|
@@ -68,7 +68,7 @@ export class Setup extends BaseCommand {
|
|
|
68
68
|
await this._commandExecutor.execute(options);
|
|
69
69
|
}
|
|
70
70
|
async catch(error) {
|
|
71
|
-
this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_SETUP, error.message, false);
|
|
71
|
+
void this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_SSL_SETUP, error.message, false);
|
|
72
72
|
throw error;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import { Container } from "inversify";
|
|
24
|
+
import type { Container } from "inversify";
|
|
25
25
|
import "reflect-metadata";
|
|
26
26
|
declare const container: Container;
|
|
27
27
|
export { container as IContainer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inversify.config.d.ts","sourceRoot":"","sources":["../../src/config/inversify.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAGlF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"inversify.config.d.ts","sourceRoot":"","sources":["../../src/config/inversify.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAGlF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,kBAAkB,CAAC;AAU1B,QAAA,MAAM,SAAS,EAAE,SAA0B,CAAC;AAsB5C,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -23,8 +23,10 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import { IContainer as ICoreContainer } from "@adobe/ccweb-add-on-core";
|
|
25
25
|
import "reflect-metadata";
|
|
26
|
-
import { PurgeCommandExecutor
|
|
27
|
-
import {
|
|
26
|
+
import { PurgeCommandExecutor } from "../app/PurgeCommandExecutor.js";
|
|
27
|
+
import { SetupCommandExecutor } from "../app/SetupCommandExecutor.js";
|
|
28
|
+
import { SSLReader } from "../app/SSLReader.js";
|
|
29
|
+
import { SetupCommandValidator } from "../validators/SetupCommandValidator.js";
|
|
28
30
|
import { ITypes } from "./inversify.types.js";
|
|
29
31
|
const container = ICoreContainer;
|
|
30
32
|
container
|
|
@@ -42,6 +44,6 @@ container
|
|
|
42
44
|
.to(SetupCommandValidator)
|
|
43
45
|
.inSingletonScope()
|
|
44
46
|
.whenTargetNamed("setup");
|
|
45
|
-
container.bind(ITypes.SSLReader).to(
|
|
47
|
+
container.bind(ITypes.SSLReader).to(SSLReader).inSingletonScope();
|
|
46
48
|
export { container as IContainer };
|
|
47
49
|
//# sourceMappingURL=inversify.config.js.map
|
|
@@ -21,11 +21,6 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import type { SetupCommandOptions } from "./SetupCommandOptions.js";
|
|
25
|
-
/**
|
|
26
|
-
* Union of supported command options.
|
|
27
|
-
*/
|
|
28
|
-
export type CommandOptions = SetupCommandOptions;
|
|
29
24
|
/**
|
|
30
25
|
* SSL setup option.
|
|
31
26
|
*/
|
|
@@ -53,4 +48,4 @@ export type SSLData = {
|
|
|
53
48
|
*/
|
|
54
49
|
key: string | Buffer;
|
|
55
50
|
};
|
|
56
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=SSLTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SSLTypes.d.ts","sourceRoot":"","sources":["../../src/models/SSLTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF;;GAEG;AACH,oBAAY,cAAc;IACtB,aAAa,kBAAkB;IAC/B,QAAQ,aAAa;CACxB;AAED;;GAEG;AACH,oBAAY,eAAe;IACvB,MAAM,WAAW;IACjB,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC"}
|
package/dist/models/index.js
CHANGED