@adobe/ccweb-add-on-core 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.
- package/.c8rc.json +14 -0
- package/.mocharc.json +5 -0
- package/CODE_OF_CONDUCT.md +79 -0
- package/CONTRIBUTING.md +47 -0
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/config/index.d.ts +26 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +26 -0
- package/dist/config/inversify.config.d.ts +28 -0
- package/dist/config/inversify.config.d.ts.map +1 -0
- package/dist/config/inversify.config.js +33 -0
- package/dist/config/inversify.types.d.ts +30 -0
- package/dist/config/inversify.types.d.ts.map +1 -0
- package/dist/config/inversify.types.js +30 -0
- package/dist/constants.d.ts +37 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +38 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/models/PackageJson.d.ts +61 -0
- package/dist/models/PackageJson.d.ts.map +1 -0
- package/dist/models/PackageJson.js +76 -0
- package/dist/models/PreferenceJson.d.ts +79 -0
- package/dist/models/PreferenceJson.d.ts.map +1 -0
- package/dist/models/PreferenceJson.js +88 -0
- package/dist/models/TemplateJson.d.ts +53 -0
- package/dist/models/TemplateJson.d.ts.map +1 -0
- package/dist/models/TemplateJson.js +112 -0
- package/dist/models/Types.d.ts +72 -0
- package/dist/models/Types.d.ts.map +1 -0
- package/dist/models/Types.js +25 -0
- package/dist/models/index.d.ts +28 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +28 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utilities/CLIPreferences.d.ts +45 -0
- package/dist/utilities/CLIPreferences.d.ts.map +1 -0
- package/dist/utilities/CLIPreferences.js +80 -0
- package/dist/utilities/CLIProcess.d.ts +74 -0
- package/dist/utilities/CLIProcess.d.ts.map +1 -0
- package/dist/utilities/CLIProcess.js +190 -0
- package/dist/utilities/ConsoleLogger.d.ts +64 -0
- package/dist/utilities/ConsoleLogger.d.ts.map +1 -0
- package/dist/utilities/ConsoleLogger.js +103 -0
- package/dist/utilities/Extensions.d.ts +67 -0
- package/dist/utilities/Extensions.d.ts.map +1 -0
- package/dist/utilities/Extensions.js +92 -0
- package/dist/utilities/Logger.d.ts +65 -0
- package/dist/utilities/Logger.d.ts.map +1 -0
- package/dist/utilities/Logger.js +25 -0
- package/dist/utilities/Preferences.d.ts +41 -0
- package/dist/utilities/Preferences.d.ts.map +1 -0
- package/dist/utilities/Preferences.js +25 -0
- package/dist/utilities/Process.d.ts +63 -0
- package/dist/utilities/Process.d.ts.map +1 -0
- package/dist/utilities/Process.js +25 -0
- package/dist/utilities/UncaughtExceptionHandler.d.ts +40 -0
- package/dist/utilities/UncaughtExceptionHandler.d.ts.map +1 -0
- package/dist/utilities/UncaughtExceptionHandler.js +51 -0
- package/dist/utilities/index.d.ts +32 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/index.js +32 -0
- package/package.json +51 -0
- package/src/config/index.ts +26 -0
- package/src/config/inversify.config.ts +39 -0
- package/src/config/inversify.types.ts +30 -0
- package/src/constants.ts +41 -0
- package/src/index.ts +28 -0
- package/src/models/PackageJson.ts +83 -0
- package/src/models/PreferenceJson.ts +112 -0
- package/src/models/TemplateJson.ts +121 -0
- package/src/models/Types.ts +80 -0
- package/src/models/index.ts +28 -0
- package/src/test/models/PackageJson.spec.ts +198 -0
- package/src/test/models/PreferenceJson.spec.ts +184 -0
- package/src/test/models/TemplateJson.spec.ts +179 -0
- package/src/test/utilities/CLIPreferences.spec.ts +208 -0
- package/src/test/utilities/CLIProcess.spec.ts +363 -0
- package/src/test/utilities/ConsoleLogger.spec.ts +165 -0
- package/src/test/utilities/Extensions.spec.ts +240 -0
- package/src/test/utilities/UncaughtExceptionHandler.spec.ts +83 -0
- package/src/types/applicationConfigPath.d.ts +1 -0
- package/src/utilities/CLIPreferences.ts +84 -0
- package/src/utilities/CLIProcess.ts +200 -0
- package/src/utilities/ConsoleLogger.ts +111 -0
- package/src/utilities/Extensions.ts +98 -0
- package/src/utilities/Logger.ts +70 -0
- package/src/utilities/Preferences.ts +43 -0
- package/src/utilities/Process.ts +66 -0
- package/src/utilities/UncaughtExceptionHandler.ts +55 -0
- package/src/utilities/index.ts +32 -0
- package/tsconfig.json +31 -0
|
@@ -0,0 +1,76 @@
|
|
|
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 { getJSONString } from "../utilities/index.js";
|
|
25
|
+
import { TemplateJson } from "./TemplateJson.js";
|
|
26
|
+
/**
|
|
27
|
+
* Class representing package.json.
|
|
28
|
+
*/
|
|
29
|
+
export class PackageJson extends TemplateJson {
|
|
30
|
+
/**
|
|
31
|
+
* name property.
|
|
32
|
+
*/
|
|
33
|
+
name;
|
|
34
|
+
/**
|
|
35
|
+
* version property.
|
|
36
|
+
*/
|
|
37
|
+
version;
|
|
38
|
+
/**
|
|
39
|
+
* description property.
|
|
40
|
+
*/
|
|
41
|
+
description;
|
|
42
|
+
/**
|
|
43
|
+
* keywords property.
|
|
44
|
+
*/
|
|
45
|
+
keywords;
|
|
46
|
+
/**
|
|
47
|
+
* Instantiate {@link PackageJson}.
|
|
48
|
+
*
|
|
49
|
+
* @param content - package.json content.
|
|
50
|
+
* @returns Reference to a new {@link PackageJson} instance.
|
|
51
|
+
*/
|
|
52
|
+
constructor(content) {
|
|
53
|
+
super(content);
|
|
54
|
+
this.name = content.name;
|
|
55
|
+
this.version = content.version;
|
|
56
|
+
this.description = content.description;
|
|
57
|
+
this.keywords = content.keywords;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get JSON representation of this {@link PackageJson} reference.
|
|
61
|
+
*
|
|
62
|
+
* @returns JSON representation as string.
|
|
63
|
+
*/
|
|
64
|
+
toJSON() {
|
|
65
|
+
return getJSONString({
|
|
66
|
+
name: this.name,
|
|
67
|
+
version: this.version,
|
|
68
|
+
description: this.description,
|
|
69
|
+
scripts: this.scripts ? Object.fromEntries(this.scripts) : undefined,
|
|
70
|
+
keywords: this.keywords,
|
|
71
|
+
dependencies: this.dependencies ? Object.fromEntries(this.dependencies) : undefined,
|
|
72
|
+
devDependencies: this.devDependencies ? Object.fromEntries(this.devDependencies) : undefined
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=PackageJson.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
/**
|
|
25
|
+
* SSL related settings.
|
|
26
|
+
*/
|
|
27
|
+
export interface SSLSettings {
|
|
28
|
+
/**
|
|
29
|
+
* Path of the SSL certificate file.
|
|
30
|
+
*/
|
|
31
|
+
certificatePath: string;
|
|
32
|
+
/**
|
|
33
|
+
* Path of the SSL key file.
|
|
34
|
+
*/
|
|
35
|
+
keyPath: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Class representing CCWeb Add-on CLI related preferences.
|
|
39
|
+
*/
|
|
40
|
+
export declare class PreferenceJson {
|
|
41
|
+
/**
|
|
42
|
+
* stores user consent to collect telemetry data
|
|
43
|
+
*/
|
|
44
|
+
hasTelemetryConsent?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* stores the auth_token and refresh_token
|
|
47
|
+
*/
|
|
48
|
+
ims?: {
|
|
49
|
+
[k: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* stores the clientId used to identify client while sending analytics
|
|
53
|
+
*/
|
|
54
|
+
clientId?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Map of SSL settings corresponding to a unique hostname.
|
|
57
|
+
*/
|
|
58
|
+
ssl?: Map<string, SSLSettings>;
|
|
59
|
+
/**
|
|
60
|
+
* Instantiate {@link PreferenceJson}.
|
|
61
|
+
* @param content - JSON file content.
|
|
62
|
+
* @returns Reference to a new {@link PreferenceJson} instance.
|
|
63
|
+
*/
|
|
64
|
+
constructor(content: {
|
|
65
|
+
[k: string]: unknown;
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Get JSON representation of this {@link PreferenceJson} reference.
|
|
69
|
+
* @returns JSON representation as string.
|
|
70
|
+
*/
|
|
71
|
+
toJSON(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Support V1 and V2 of SSL contract.
|
|
74
|
+
* @param content - JSON file content.
|
|
75
|
+
* @returns Map of SSL settings corresponding to a unique hostname.
|
|
76
|
+
*/
|
|
77
|
+
private _getSSL;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=PreferenceJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreferenceJson.d.ts","sourceRoot":"","sources":["../../src/models/PreferenceJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAKlF;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,cAAc;IACvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,GAAG,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAE/B;;;;OAIG;gBACS,OAAO,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE;IAO7C;;;OAGG;IACH,MAAM,IAAI,MAAM;IAShB;;;;OAIG;IACH,OAAO,CAAC,OAAO;CAelB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 { DEFAULT_HOST_NAME } from "../constants.js";
|
|
25
|
+
import { getJSONString, isNullOrWhiteSpace, isObject } from "../utilities/index.js";
|
|
26
|
+
/**
|
|
27
|
+
* Class representing CCWeb Add-on CLI related preferences.
|
|
28
|
+
*/
|
|
29
|
+
export class PreferenceJson {
|
|
30
|
+
/**
|
|
31
|
+
* stores user consent to collect telemetry data
|
|
32
|
+
*/
|
|
33
|
+
hasTelemetryConsent;
|
|
34
|
+
/**
|
|
35
|
+
* stores the auth_token and refresh_token
|
|
36
|
+
*/
|
|
37
|
+
ims;
|
|
38
|
+
/**
|
|
39
|
+
* stores the clientId used to identify client while sending analytics
|
|
40
|
+
*/
|
|
41
|
+
clientId;
|
|
42
|
+
/**
|
|
43
|
+
* Map of SSL settings corresponding to a unique hostname.
|
|
44
|
+
*/
|
|
45
|
+
ssl;
|
|
46
|
+
/**
|
|
47
|
+
* Instantiate {@link PreferenceJson}.
|
|
48
|
+
* @param content - JSON file content.
|
|
49
|
+
* @returns Reference to a new {@link PreferenceJson} instance.
|
|
50
|
+
*/
|
|
51
|
+
constructor(content) {
|
|
52
|
+
this.ssl = this._getSSL(content);
|
|
53
|
+
this.hasTelemetryConsent = content.hasTelemetryConsent;
|
|
54
|
+
this.ims = content.ims;
|
|
55
|
+
this.clientId = content.clientId;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get JSON representation of this {@link PreferenceJson} reference.
|
|
59
|
+
* @returns JSON representation as string.
|
|
60
|
+
*/
|
|
61
|
+
toJSON() {
|
|
62
|
+
return getJSONString({
|
|
63
|
+
hasTelemetryConsent: this.hasTelemetryConsent,
|
|
64
|
+
ims: this.ims,
|
|
65
|
+
clientId: this.clientId,
|
|
66
|
+
ssl: this.ssl ? Object.fromEntries(this.ssl) : undefined
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Support V1 and V2 of SSL contract.
|
|
71
|
+
* @param content - JSON file content.
|
|
72
|
+
* @returns Map of SSL settings corresponding to a unique hostname.
|
|
73
|
+
*/
|
|
74
|
+
_getSSL(content) {
|
|
75
|
+
if (isObject(content.ssl)) {
|
|
76
|
+
return new Map(Object.entries(content.ssl));
|
|
77
|
+
}
|
|
78
|
+
// Backward compatibility for `sslCertPath` and `sslKeyPath`
|
|
79
|
+
// which mapped to `localhost` hostname in manually configured SSL.
|
|
80
|
+
const certificatePath = content.sslCertPath;
|
|
81
|
+
const keyPath = content.sslKeyPath;
|
|
82
|
+
if (!isNullOrWhiteSpace(certificatePath) && !isNullOrWhiteSpace(keyPath)) {
|
|
83
|
+
return new Map([[DEFAULT_HOST_NAME, { certificatePath, keyPath }]]);
|
|
84
|
+
}
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=PreferenceJson.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
/**
|
|
25
|
+
* Class representing template.json.
|
|
26
|
+
*/
|
|
27
|
+
export declare class TemplateJson {
|
|
28
|
+
/**
|
|
29
|
+
* dependencies property.
|
|
30
|
+
*/
|
|
31
|
+
dependencies?: Map<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* devDependencies property.
|
|
34
|
+
*/
|
|
35
|
+
devDependencies?: Map<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* scripts property.
|
|
38
|
+
*/
|
|
39
|
+
scripts?: Map<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Instantiate {@link TemplateJson}.
|
|
42
|
+
*
|
|
43
|
+
* @param content - template.json content.
|
|
44
|
+
* @returns Reference to a new {@link TemplateJson} instance.
|
|
45
|
+
*/
|
|
46
|
+
constructor(content: {
|
|
47
|
+
[k: string]: unknown;
|
|
48
|
+
});
|
|
49
|
+
private _setDependencies;
|
|
50
|
+
private _setDevDependencies;
|
|
51
|
+
private _setScripts;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=TemplateJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateJson.d.ts","sourceRoot":"","sources":["../../src/models/TemplateJson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF;;GAEG;AACH,qBAAa,YAAY;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnC;;OAEG;IACH,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;gBACS,OAAO,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE;IAM7C,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,WAAW;CAqBtB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
/**
|
|
25
|
+
* Class representing template.json.
|
|
26
|
+
*/
|
|
27
|
+
export class TemplateJson {
|
|
28
|
+
/**
|
|
29
|
+
* dependencies property.
|
|
30
|
+
*/
|
|
31
|
+
dependencies;
|
|
32
|
+
/**
|
|
33
|
+
* devDependencies property.
|
|
34
|
+
*/
|
|
35
|
+
devDependencies;
|
|
36
|
+
/**
|
|
37
|
+
* scripts property.
|
|
38
|
+
*/
|
|
39
|
+
scripts;
|
|
40
|
+
/**
|
|
41
|
+
* Instantiate {@link TemplateJson}.
|
|
42
|
+
*
|
|
43
|
+
* @param content - template.json content.
|
|
44
|
+
* @returns Reference to a new {@link TemplateJson} instance.
|
|
45
|
+
*/
|
|
46
|
+
constructor(content) {
|
|
47
|
+
this._setDependencies(content);
|
|
48
|
+
this._setDevDependencies(content);
|
|
49
|
+
this._setScripts(content);
|
|
50
|
+
}
|
|
51
|
+
_setDependencies(content) {
|
|
52
|
+
if (content.dependencies) {
|
|
53
|
+
if (content.dependencies instanceof Map) {
|
|
54
|
+
content.dependencies.forEach((value, key) => {
|
|
55
|
+
if (!this.dependencies) {
|
|
56
|
+
this.dependencies = new Map();
|
|
57
|
+
}
|
|
58
|
+
this.dependencies.set(key, value);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else if (content.dependencies instanceof Object) {
|
|
62
|
+
for (const [key, value] of Object.entries(content.dependencies)) {
|
|
63
|
+
if (!this.dependencies) {
|
|
64
|
+
this.dependencies = new Map();
|
|
65
|
+
}
|
|
66
|
+
this.dependencies.set(key, value.toString());
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
_setDevDependencies(content) {
|
|
72
|
+
if (content.devDependencies) {
|
|
73
|
+
if (content.devDependencies instanceof Map) {
|
|
74
|
+
content.devDependencies.forEach((value, key) => {
|
|
75
|
+
if (!this.devDependencies) {
|
|
76
|
+
this.devDependencies = new Map();
|
|
77
|
+
}
|
|
78
|
+
this.devDependencies.set(key, value);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else if (content.devDependencies instanceof Object) {
|
|
82
|
+
for (const [key, value] of Object.entries(content.devDependencies)) {
|
|
83
|
+
if (!this.devDependencies) {
|
|
84
|
+
this.devDependencies = new Map();
|
|
85
|
+
}
|
|
86
|
+
this.devDependencies.set(key, value.toString());
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
_setScripts(content) {
|
|
92
|
+
if (content.scripts) {
|
|
93
|
+
if (content.scripts instanceof Map) {
|
|
94
|
+
content.scripts.forEach((value, key) => {
|
|
95
|
+
if (!this.scripts) {
|
|
96
|
+
this.scripts = new Map();
|
|
97
|
+
}
|
|
98
|
+
this.scripts.set(key, value);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
else if (content.scripts instanceof Object) {
|
|
102
|
+
for (const [key, value] of Object.entries(content.scripts)) {
|
|
103
|
+
if (!this.scripts) {
|
|
104
|
+
this.scripts = new Map();
|
|
105
|
+
}
|
|
106
|
+
this.scripts.set(key, value.toString());
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=TemplateJson.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
/**
|
|
25
|
+
* Execution result.
|
|
26
|
+
*/
|
|
27
|
+
export declare type ExecutionResult = {
|
|
28
|
+
/**
|
|
29
|
+
* Command which was executed.
|
|
30
|
+
*/
|
|
31
|
+
command: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the execution is successful.
|
|
34
|
+
*/
|
|
35
|
+
isSuccessful: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Data returned from the execution, if any.
|
|
38
|
+
*/
|
|
39
|
+
data?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Error thrown during the execution, if any.
|
|
42
|
+
*/
|
|
43
|
+
error?: unknown;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Logger options.
|
|
47
|
+
*/
|
|
48
|
+
export declare type LoggerOptions = {
|
|
49
|
+
/**
|
|
50
|
+
* Prefix string.
|
|
51
|
+
*/
|
|
52
|
+
prefix?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Postfix string.
|
|
55
|
+
*/
|
|
56
|
+
postfix?: string;
|
|
57
|
+
};
|
|
58
|
+
export declare type AddOnMetaData = {
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
61
|
+
export declare type AddOn = {
|
|
62
|
+
localizedMetadata: AddOnMetaData;
|
|
63
|
+
};
|
|
64
|
+
export declare type Schema = {
|
|
65
|
+
addonId: string;
|
|
66
|
+
versionString: string;
|
|
67
|
+
supportedLanguages: string[];
|
|
68
|
+
supportedApps: string[];
|
|
69
|
+
downloadUrl: string;
|
|
70
|
+
addon: AddOn;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../src/models/Types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF;;GAEG;AACH,oBAAY,eAAe,GAAG;IAC1B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,aAAa,GAAG;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAChB,iBAAiB,EAAE,aAAa,CAAC;CACpC,CAAC;AAEF,oBAAY,MAAM,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;CAChB,CAAC"}
|
|
@@ -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=Types.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
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 * from "./PackageJson.js";
|
|
25
|
+
export * from "./PreferenceJson.js";
|
|
26
|
+
export * from "./TemplateJson.js";
|
|
27
|
+
export * from "./Types.js";
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 * from "./PackageJson.js";
|
|
25
|
+
export * from "./PreferenceJson.js";
|
|
26
|
+
export * from "./TemplateJson.js";
|
|
27
|
+
export * from "./Types.js";
|
|
28
|
+
//# sourceMappingURL=index.js.map
|