@forge/cli-shared 3.2.1 → 3.2.2-next.1
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/CHANGELOG.md +13 -0
- package/out/app-logs/view-logs.js +3 -3
- package/out/apps/app-config.d.ts.map +1 -1
- package/out/apps/app-config.js +3 -2
- package/out/apps/create-app-graphql-client.js +1 -1
- package/out/apps/package-installer.js +1 -1
- package/out/apps/register-app.js +1 -1
- package/out/apps/template.js +12 -12
- package/out/auth/personal/credential-store.js +5 -5
- package/out/auth/personal/me-graphql-client.js +1 -1
- package/out/auth/personal/token-authenticator.js +1 -1
- package/out/config/config-file-section-reader.js +2 -1
- package/out/config/config-file-section-writer.js +2 -1
- package/out/config/config-file.d.ts +1 -1
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +6 -7
- package/out/config/config-section.js +2 -1
- package/out/config/config.js +4 -2
- package/out/file-system/file-system-reader.d.ts +1 -0
- package/out/file-system/file-system-reader.d.ts.map +1 -1
- package/out/file-system/file-system-reader.js +7 -7
- package/out/file-system/file-system-writer.js +1 -1
- package/out/file-system/zip-accessor.js +1 -1
- package/out/graphql/gateway.js +5 -3
- package/out/graphql/graphql-types.d.ts +63 -70
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +27 -1
- package/out/graphql/mutation-aware-graphql-client.d.ts +2 -2
- package/out/graphql/mutation-aware-graphql-client.d.ts.map +1 -1
- package/out/http-client/feedback-post-client.js +1 -1
- package/out/http-client/file-uploader.js +1 -1
- package/out/service/bridge-script-service.d.ts +2 -0
- package/out/service/bridge-script-service.d.ts.map +1 -1
- package/out/service/bridge-script-service.js +4 -2
- package/out/service/feature-flag-service.js +3 -3
- package/out/service/iframe-resizer-script-service.d.ts +2 -0
- package/out/service/iframe-resizer-script-service.d.ts.map +1 -1
- package/out/service/iframe-resizer-script-service.js +4 -2
- package/out/shared/error-handling.d.ts +1 -1
- package/out/shared/error-handling.d.ts.map +1 -1
- package/out/shared/error-handling.js +6 -3
- package/out/shared/index.js +1 -1
- package/out/shared/pause.js +2 -1
- package/out/shared/product.js +8 -5
- package/out/shared/read-app-config-files.d.ts.map +1 -1
- package/out/shared/read-app-config-files.js +7 -5
- package/out/shared/validate.js +3 -2
- package/out/ui/command-line-ui.js +3 -3
- package/out/ui/multiple-table-prompt.js +4 -2
- package/out/ui/runtime-log.js +1 -1
- package/out/ui/single-table-prompt.js +4 -2
- package/out/ui/table-prompt.js +1 -1
- package/out/ui/text.d.ts +1 -1
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +5 -4
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 3.2.2-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 652e9f23: Bump Typescript and ESlint to latest
|
|
8
|
+
|
|
9
|
+
## 3.2.2-next.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [138bb0a]
|
|
14
|
+
- @forge/manifest@4.4.1-next.0
|
|
15
|
+
|
|
3
16
|
## 3.2.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -16,9 +16,9 @@ class ViewAppLogsCommand {
|
|
|
16
16
|
this.appEnvironmentClient.getAppEnvironmentId(appId, environmentKey),
|
|
17
17
|
context ? this.globalEdgeClient.getCloudId(context.site) : undefined
|
|
18
18
|
]);
|
|
19
|
-
const contextAri = cloudId ? ari_1.buildContextAri(cloudId, context.product) : undefined;
|
|
20
|
-
const ari = cs_ari_1.parse(appId);
|
|
21
|
-
const appAri = cs_ari_1.parseAppAri(ari);
|
|
19
|
+
const contextAri = cloudId ? (0, ari_1.buildContextAri)(cloudId, context.product) : undefined;
|
|
20
|
+
const ari = (0, cs_ari_1.parse)(appId);
|
|
21
|
+
const appAri = (0, cs_ari_1.parseAppAri)(ari);
|
|
22
22
|
return this.logsClient.viewAppLogs({
|
|
23
23
|
appId: appAri.appId,
|
|
24
24
|
environmentId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/apps/app-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAG3B,OAAO,EAAa,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAG3D,eAAO,MAAM,cAAc;;EAEzB,CAAC;AAEH,oBAAY,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,oBAAY,iBAAiB,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,UAAU;;EAQ7D;AAED,eAAO,MAAM,0BAA0B,oBAAqB,
|
|
1
|
+
{"version":3,"file":"app-config.d.ts","sourceRoot":"","sources":["../../src/apps/app-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAG3B,OAAO,EAAa,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAG3D,eAAO,MAAM,cAAc;;EAEzB,CAAC;AAEH,oBAAY,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACzD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,oBAAY,iBAAiB,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,UAAU;;EAQ7D;AAED,eAAO,MAAM,0BAA0B,oBAAqB,oBAAoB,UAAU,CAAC,KAAG,iBAEyB,CAAC"}
|
package/out/apps/app-config.js
CHANGED
|
@@ -14,7 +14,8 @@ function adjustLegacyAppId(legacyAppDetails) {
|
|
|
14
14
|
if (legacyAppDetails.id.startsWith('ari:')) {
|
|
15
15
|
return legacyAppDetails;
|
|
16
16
|
}
|
|
17
|
-
return Object.assign(Object.assign({}, legacyAppDetails), { id: ari_1.appIdToAriString(legacyAppDetails.id) });
|
|
17
|
+
return Object.assign(Object.assign({}, legacyAppDetails), { id: (0, ari_1.appIdToAriString)(legacyAppDetails.id) });
|
|
18
18
|
}
|
|
19
19
|
exports.adjustLegacyAppId = adjustLegacyAppId;
|
|
20
|
-
|
|
20
|
+
const assertiveAppConfigProvider = (appConfigReader) => () => (0, config_1.assertive)(appConfigReader).readConfigSectionOrThrow(ui_1.Text.config.missing, ui_1.Text.config.invalid).then(adjustLegacyAppId);
|
|
21
|
+
exports.assertiveAppConfigProvider = assertiveAppConfigProvider;
|
|
@@ -30,7 +30,7 @@ class CreateAppGraphQLClient {
|
|
|
30
30
|
const { response: { createApp: { success, errors, app } }, requestId } = await this.graphqlClient.mutate(createAppQuery, {
|
|
31
31
|
input
|
|
32
32
|
});
|
|
33
|
-
const error = graphql_1.getError(errors);
|
|
33
|
+
const error = (0, graphql_1.getError)(errors);
|
|
34
34
|
if (!success) {
|
|
35
35
|
throw new graphql_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code);
|
|
36
36
|
}
|
|
@@ -18,7 +18,7 @@ class NpmInstaller {
|
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
19
|
if (NpmInstaller.dependenciesFileExists(directory)) {
|
|
20
20
|
this.logger.info(ui_1.Text.create.taskPackages);
|
|
21
|
-
const process = cross_spawn_1.spawn('npm', ['install', '--no-package-lock'], { cwd: directory });
|
|
21
|
+
const process = (0, cross_spawn_1.spawn)('npm', ['install', '--no-package-lock'], { cwd: directory });
|
|
22
22
|
process.on('exit', resolve);
|
|
23
23
|
process.on('error', () => {
|
|
24
24
|
this.logger.warn(ui_1.Text.create.error.packages.installFail);
|
package/out/apps/register-app.js
CHANGED
|
@@ -17,7 +17,7 @@ class RegisterAppCommand {
|
|
|
17
17
|
this.logger.info(ui_1.Text.create.taskRegister);
|
|
18
18
|
const id = await this.appClient.createApp(input);
|
|
19
19
|
const cwd = process.cwd();
|
|
20
|
-
process.chdir(path_1.resolve(cwd, directory));
|
|
20
|
+
process.chdir((0, path_1.resolve)(cwd, directory));
|
|
21
21
|
try {
|
|
22
22
|
await this.appConfigWriter.writeConfigSection({ id });
|
|
23
23
|
if (shouldPrependAppName) {
|
package/out/apps/template.js
CHANGED
|
@@ -25,7 +25,7 @@ class TemplateServiceDownloader {
|
|
|
25
25
|
async download(template, zipFile) {
|
|
26
26
|
const zipUrl = this.buildZipUrl(template);
|
|
27
27
|
const fileStream = fs_1.default.createWriteStream(zipFile);
|
|
28
|
-
const response = await node_fetch_1.default(zipUrl);
|
|
28
|
+
const response = await (0, node_fetch_1.default)(zipUrl);
|
|
29
29
|
if (!response.ok) {
|
|
30
30
|
throw new NoTemplateError(template);
|
|
31
31
|
}
|
|
@@ -50,7 +50,7 @@ class ZipTemplateExtractor {
|
|
|
50
50
|
await this.moveArchiveFilesToDirectory(extractDirectory, destDirectory);
|
|
51
51
|
}
|
|
52
52
|
finally {
|
|
53
|
-
fs_extra_1.removeSync(extractDirectory);
|
|
53
|
+
(0, fs_extra_1.removeSync)(extractDirectory);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
async moveArchiveFilesToDirectory(extractDirectory, destDirectory) {
|
|
@@ -58,16 +58,16 @@ class ZipTemplateExtractor {
|
|
|
58
58
|
if (archiveChildren.length !== 1) {
|
|
59
59
|
throw new InvalidTemplateArchiveError(ui_1.Text.create.error.template.unexpectedArchiveFormat);
|
|
60
60
|
}
|
|
61
|
-
const templateRepoDirectory = path_1.resolve(extractDirectory, archiveChildren[0]);
|
|
62
|
-
const templateEntries = await ignore_walk_1.default({
|
|
61
|
+
const templateRepoDirectory = (0, path_1.resolve)(extractDirectory, archiveChildren[0]);
|
|
62
|
+
const templateEntries = await (0, ignore_walk_1.default)({
|
|
63
63
|
path: templateRepoDirectory,
|
|
64
64
|
ignoreFiles: ['.forgeignore']
|
|
65
65
|
});
|
|
66
|
-
const filteredEntries = templateEntries.filter((path) => path_1.basename(path) !== '.forgeignore');
|
|
66
|
+
const filteredEntries = templateEntries.filter((path) => (0, path_1.basename)(path) !== '.forgeignore');
|
|
67
67
|
for (const entry of filteredEntries) {
|
|
68
|
-
const entrySourceFullPath = path_1.resolve(templateRepoDirectory, entry);
|
|
69
|
-
const entryDestFullPath = path_1.resolve(destDirectory, entry);
|
|
70
|
-
fs_extra_1.moveSync(entrySourceFullPath, entryDestFullPath);
|
|
68
|
+
const entrySourceFullPath = (0, path_1.resolve)(templateRepoDirectory, entry);
|
|
69
|
+
const entryDestFullPath = (0, path_1.resolve)(destDirectory, entry);
|
|
70
|
+
(0, fs_extra_1.moveSync)(entrySourceFullPath, entryDestFullPath);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -90,7 +90,7 @@ class TemplateServiceLister {
|
|
|
90
90
|
}
|
|
91
91
|
async getAvailableTemplates() {
|
|
92
92
|
try {
|
|
93
|
-
const res = await node_fetch_1.default(new url_1.URL(TEMPLATE_MAP, TEMPLATE_SERVICE_URL));
|
|
93
|
+
const res = await (0, node_fetch_1.default)(new url_1.URL(TEMPLATE_MAP, TEMPLATE_SERVICE_URL));
|
|
94
94
|
if (!res.ok) {
|
|
95
95
|
throw new TemplateFetchError();
|
|
96
96
|
}
|
|
@@ -118,16 +118,16 @@ class ComposableTemplater {
|
|
|
118
118
|
async downloadAndExtract(template, directory) {
|
|
119
119
|
this.logger.info(ui_1.Text.create.taskTemplate.title);
|
|
120
120
|
const zipFile = tmp_1.default.fileSync({ postfix: '.zip' }).name;
|
|
121
|
-
const destDirectory = path_1.resolve(process.cwd(), directory);
|
|
121
|
+
const destDirectory = (0, path_1.resolve)(process.cwd(), directory);
|
|
122
122
|
try {
|
|
123
|
-
fs_extra_1.mkdirpSync(destDirectory);
|
|
123
|
+
(0, fs_extra_1.mkdirpSync)(destDirectory);
|
|
124
124
|
this.logger.debug(ui_1.Text.create.taskTemplate.downloading(template));
|
|
125
125
|
await this.downloader.download(template, zipFile);
|
|
126
126
|
this.logger.debug(ui_1.Text.create.taskTemplate.extracting);
|
|
127
127
|
await this.extractor.extract(zipFile, destDirectory);
|
|
128
128
|
}
|
|
129
129
|
catch (err) {
|
|
130
|
-
fs_extra_1.removeSync(destDirectory);
|
|
130
|
+
(0, fs_extra_1.removeSync)(destDirectory);
|
|
131
131
|
throw err;
|
|
132
132
|
}
|
|
133
133
|
finally {
|
|
@@ -51,12 +51,12 @@ class CredentialStoreImpl {
|
|
|
51
51
|
this.instructionsURL = instructionsURL;
|
|
52
52
|
this.keytar = keytar;
|
|
53
53
|
this.cachedConfig = cachedConfig;
|
|
54
|
-
this.keytarAccount = graphql_1.getEnvironment(KeytarAccount);
|
|
54
|
+
this.keytarAccount = (0, graphql_1.getEnvironment)(KeytarAccount);
|
|
55
55
|
}
|
|
56
56
|
wrapKeytarError(e) {
|
|
57
|
-
const message = shared_1.wrapError(e).message;
|
|
57
|
+
const message = (0, shared_1.wrapError)(e).message;
|
|
58
58
|
let error;
|
|
59
|
-
const currentPlatform = os_1.platform();
|
|
59
|
+
const currentPlatform = (0, os_1.platform)();
|
|
60
60
|
switch (currentPlatform) {
|
|
61
61
|
case 'darwin':
|
|
62
62
|
error = ui_1.Text.error.keytarAccessError.mac(message);
|
|
@@ -84,7 +84,7 @@ class CredentialStoreImpl {
|
|
|
84
84
|
throw new NoTokenInStoreError();
|
|
85
85
|
}
|
|
86
86
|
const decodeResult = exports.personalApiCredentialsValidatedShape.decode(credentials);
|
|
87
|
-
if (Either_1.isLeft(decodeResult)) {
|
|
87
|
+
if ((0, Either_1.isLeft)(decodeResult)) {
|
|
88
88
|
throw new NoTokenInStoreError();
|
|
89
89
|
}
|
|
90
90
|
return decodeResult.right;
|
|
@@ -173,7 +173,7 @@ exports.CredentialStoreImpl = CredentialStoreImpl;
|
|
|
173
173
|
function getCredentialStore(logger) {
|
|
174
174
|
const keytar = getKeytar();
|
|
175
175
|
const cachedConfig = cache_1.CachedConf.getCache(FORGE_CLI_PACKAGE);
|
|
176
|
-
const instructionsUrl = instruction_1.getInstructionsUrl(graphql_1.getGraphqlGateway());
|
|
176
|
+
const instructionsUrl = (0, instruction_1.getInstructionsUrl)((0, graphql_1.getGraphqlGateway)());
|
|
177
177
|
return new CredentialStoreImpl(logger, instructionsUrl, keytar, cachedConfig);
|
|
178
178
|
}
|
|
179
179
|
exports.getCredentialStore = getCredentialStore;
|
|
@@ -8,7 +8,7 @@ class PersonalTokenAuthenticator {
|
|
|
8
8
|
}
|
|
9
9
|
async getAuthorizationHeader() {
|
|
10
10
|
const { email, token } = await this.credentialStore.getCredentials();
|
|
11
|
-
return authenticator_1.getBasicAuthorizationHeader(email, token);
|
|
11
|
+
return (0, authenticator_1.getBasicAuthorizationHeader)(email, token);
|
|
12
12
|
}
|
|
13
13
|
getInstructionsWhenInvalid() {
|
|
14
14
|
return this.credentialStore.getInstructionsWhenInvalid();
|
|
@@ -32,6 +32,7 @@ class ShapedConfigFileSectionReader {
|
|
|
32
32
|
return this.configSectionReader.readConfigSection(this.key, this.schema);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
const configFileReaderForSection = (key, schema, configReader) => {
|
|
36
36
|
return new ShapedConfigFileSectionReader(new ConfigFileSectionReader(configReader), key, schema);
|
|
37
37
|
};
|
|
38
|
+
exports.configFileReaderForSection = configFileReaderForSection;
|
|
@@ -14,6 +14,7 @@ class ConfigFileSectionWriter {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.ConfigFileSectionWriter = ConfigFileSectionWriter;
|
|
17
|
-
|
|
17
|
+
const configFileWriterForSection = (key, schema, configWriter) => {
|
|
18
18
|
return new ConfigFileSectionWriter(key, configWriter);
|
|
19
19
|
};
|
|
20
|
+
exports.configFileWriterForSection = configFileWriterForSection;
|
|
@@ -24,7 +24,7 @@ export declare class ConfigFile implements ConfigReader, ConfigWriter, ConfigInt
|
|
|
24
24
|
snapshotsEnabled(): Promise<boolean>;
|
|
25
25
|
private makeManifestUnique;
|
|
26
26
|
prependAppNameToModules(name: string): Promise<void>;
|
|
27
|
-
writeToConfigFile<K extends string, V>(configKey: K, config: V): Promise<void>;
|
|
27
|
+
writeToConfigFile<K extends string, V extends object>(configKey: K, config: V): Promise<void>;
|
|
28
28
|
private getHostedResourceModules;
|
|
29
29
|
private assertNoMissingResources;
|
|
30
30
|
private getRemoteFromEgressPermission;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAAA,OAAa,EAAwB,QAAQ,EAAE,MAAM,MAAM,CAAC;AAI5D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EAEL,cAAc,EACd,SAAS,EAOV,MAAM,qCAAqC,CAAC;AAE7C,qBAAa,8BAA+B,SAAQ,KAAK;gBAC3C,SAAS,EAAE,MAAM,EAAE;CAGhC;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC;AAED,oBAAY,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AACpC,oBAAY,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAC/D,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,qBAAa,UAAW,YAAW,YAAY,EAAE,YAAY,EAAE,gBAAgB;IACjE,OAAO,CAAC,QAAQ,CAAC,UAAU;IAAoB,OAAO,CAAC,QAAQ,CAAC,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
|
const manifestFileContents = this.fileReader.readFile(_1.manifestFileName);
|
|
34
34
|
try {
|
|
35
35
|
yaml_1.default.scalarOptions.null.nullStr = '';
|
|
36
|
-
return yaml_1.parse(manifestFileContents);
|
|
36
|
+
return (0, yaml_1.parse)(manifestFileContents);
|
|
37
37
|
}
|
|
38
38
|
catch (_a) {
|
|
39
39
|
throw new ui_1.ValidationError(ui_1.Text.artifact.error.invalidYaml(_1.manifestFileName));
|
|
@@ -43,7 +43,7 @@ class ConfigFile {
|
|
|
43
43
|
const manifestFileContents = this.fileReader.readFile(_1.manifestFileName);
|
|
44
44
|
if (manifestFileContents) {
|
|
45
45
|
try {
|
|
46
|
-
return yaml_1.parseDocument(manifestFileContents);
|
|
46
|
+
return (0, yaml_1.parseDocument)(manifestFileContents);
|
|
47
47
|
}
|
|
48
48
|
catch (_a) {
|
|
49
49
|
throw new ui_1.ValidationError(ui_1.Text.artifact.error.invalidYaml(_1.manifestFileName));
|
|
@@ -57,10 +57,9 @@ class ConfigFile {
|
|
|
57
57
|
return entry || entry === undefined;
|
|
58
58
|
}
|
|
59
59
|
makeManifestUnique(modules, appName) {
|
|
60
|
-
var _a;
|
|
61
60
|
const actualModules = {};
|
|
62
61
|
for (const [moduleKey, moduleArray] of Object.entries(modules)) {
|
|
63
|
-
actualModules[moduleKey] =
|
|
62
|
+
actualModules[moduleKey] = moduleArray === null || moduleArray === void 0 ? void 0 : moduleArray.map((module) => {
|
|
64
63
|
if (moduleKey !== 'function' && !moduleKey.startsWith(case_1.default.kebab(appName))) {
|
|
65
64
|
module['key'] = case_1.default.kebab([appName, module.key].join(' '));
|
|
66
65
|
if ('title' in module) {
|
|
@@ -77,7 +76,7 @@ class ConfigFile {
|
|
|
77
76
|
}
|
|
78
77
|
async prependAppNameToModules(name) {
|
|
79
78
|
const manifestFileContents = this.fileReader.readFile(_1.manifestFileName);
|
|
80
|
-
const currentConfigDoc = yaml_1.parseDocument(manifestFileContents || '');
|
|
79
|
+
const currentConfigDoc = (0, yaml_1.parseDocument)(manifestFileContents || '');
|
|
81
80
|
const modules = currentConfigDoc.get('modules');
|
|
82
81
|
if (modules && modules.type === util_1.Type.MAP) {
|
|
83
82
|
const modulesObject = modules.toJSON();
|
|
@@ -88,7 +87,7 @@ class ConfigFile {
|
|
|
88
87
|
}
|
|
89
88
|
async writeToConfigFile(configKey, config) {
|
|
90
89
|
const manifestFileContents = this.fileReader.readFile(_1.manifestFileName);
|
|
91
|
-
const currentConfigDoc = yaml_1.parseDocument(manifestFileContents || '');
|
|
90
|
+
const currentConfigDoc = (0, yaml_1.parseDocument)(manifestFileContents || '');
|
|
92
91
|
Object.keys(config).forEach((key) => {
|
|
93
92
|
if (config[key] === undefined) {
|
|
94
93
|
delete config[key];
|
|
@@ -99,7 +98,7 @@ class ConfigFile {
|
|
|
99
98
|
}
|
|
100
99
|
getHostedResourceModules(modules) {
|
|
101
100
|
const modulesArray = Object.values(modules).flat();
|
|
102
|
-
return modulesArray.filter((module) => config_1.isHostedResourceModule(module));
|
|
101
|
+
return modulesArray.filter((module) => (0, config_1.isHostedResourceModule)(module));
|
|
103
102
|
}
|
|
104
103
|
assertNoMissingResources(modules, resources) {
|
|
105
104
|
const missingResources = modules.filter(({ resource }) => !resources.some(({ key }) => resource === key));
|
|
@@ -25,4 +25,5 @@ class AssertiveConfigSectionReader {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.AssertiveConfigSectionReader = AssertiveConfigSectionReader;
|
|
28
|
-
|
|
28
|
+
const assertive = (configSectionReader) => new AssertiveConfigSectionReader(configSectionReader);
|
|
29
|
+
exports.assertive = assertive;
|
package/out/config/config.js
CHANGED
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isHostedResourceModule = exports.validateResource = exports.dependencyFileNames = exports.manifestFileName = void 0;
|
|
4
4
|
exports.manifestFileName = 'manifest.yml';
|
|
5
5
|
exports.dependencyFileNames = [exports.manifestFileName, 'package.json', 'package-lock.json', 'yarn.lock'];
|
|
6
|
-
|
|
6
|
+
const validateResource = (resource) => {
|
|
7
7
|
const { key, path } = resource;
|
|
8
8
|
return typeof key === 'string' && typeof path === 'string';
|
|
9
9
|
};
|
|
10
|
-
exports.
|
|
10
|
+
exports.validateResource = validateResource;
|
|
11
|
+
const isHostedResourceModule = (module) => {
|
|
11
12
|
const resource = module.resource;
|
|
12
13
|
return resource !== undefined;
|
|
13
14
|
};
|
|
15
|
+
exports.isHostedResourceModule = isHostedResourceModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system-reader.d.ts","sourceRoot":"","sources":["../../src/file-system/file-system-reader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-system-reader.d.ts","sourceRoot":"","sources":["../../src/file-system/file-system-reader.ts"],"names":[],"mappings":";;AAAA,OAAO,EAA4B,MAAM,IAAI,CAAC;AAU9C,aAAK,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC;AAEjE,qBAAa,gBAAgB;IACpB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQxC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAS5D,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,cAAc,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAgBtG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAY/C,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI7C,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQ9C,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IASxE,gBAAgB,IAAI,MAAM;IAI1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAO3C,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQvC,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAW/E,OAAO,CAAC,eAAe;CAOxB"}
|
|
@@ -23,7 +23,7 @@ class FileSystemReader {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
async readFileAsync(filePath) {
|
|
26
|
-
const read = util_1.promisify(fs_1.default.readFile);
|
|
26
|
+
const read = (0, util_1.promisify)(fs_1.default.readFile);
|
|
27
27
|
try {
|
|
28
28
|
return await read(filePath, 'utf8');
|
|
29
29
|
}
|
|
@@ -38,10 +38,10 @@ class FileSystemReader {
|
|
|
38
38
|
}
|
|
39
39
|
return ignore;
|
|
40
40
|
});
|
|
41
|
-
if (!fs_1.existsSync(path_1.resolve(rootDir)) || !fs_1.statSync(path_1.resolve(rootDir)).isDirectory()) {
|
|
41
|
+
if (!(0, fs_1.existsSync)((0, path_1.resolve)(rootDir)) || !(0, fs_1.statSync)((0, path_1.resolve)(rootDir)).isDirectory()) {
|
|
42
42
|
return [];
|
|
43
43
|
}
|
|
44
|
-
return recursive_readdir_1.default(rootDir, ignoreDirs);
|
|
44
|
+
return (0, recursive_readdir_1.default)(rootDir, ignoreDirs);
|
|
45
45
|
}
|
|
46
46
|
async readGlob(glob) {
|
|
47
47
|
return new Promise((resolve, reject) => {
|
|
@@ -56,7 +56,7 @@ class FileSystemReader {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
hasGlobSpecialChars(pattern) {
|
|
59
|
-
return glob_1.hasMagic(pattern);
|
|
59
|
+
return (0, glob_1.hasMagic)(pattern);
|
|
60
60
|
}
|
|
61
61
|
readBinaryFile(filePath) {
|
|
62
62
|
try {
|
|
@@ -67,7 +67,7 @@ class FileSystemReader {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
async readBinaryFileAsync(filePath) {
|
|
70
|
-
const read = util_1.promisify(fs_1.default.readFile);
|
|
70
|
+
const read = (0, util_1.promisify)(fs_1.default.readFile);
|
|
71
71
|
try {
|
|
72
72
|
return await read(filePath);
|
|
73
73
|
}
|
|
@@ -76,7 +76,7 @@ class FileSystemReader {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
getHomeDirectory() {
|
|
79
|
-
return os_1.homedir();
|
|
79
|
+
return (0, os_1.homedir)();
|
|
80
80
|
}
|
|
81
81
|
bytesToMb(size) {
|
|
82
82
|
if (!size) {
|
|
@@ -94,7 +94,7 @@ class FileSystemReader {
|
|
|
94
94
|
}
|
|
95
95
|
async getFolderSizeAsync(directory) {
|
|
96
96
|
return new Promise((resolve) => {
|
|
97
|
-
get_folder_size_1.default(directory, (err, size) => {
|
|
97
|
+
(0, get_folder_size_1.default)(directory, (err, size) => {
|
|
98
98
|
if (err) {
|
|
99
99
|
resolve(undefined);
|
|
100
100
|
}
|
|
@@ -7,7 +7,7 @@ const yaml_1 = require("yaml");
|
|
|
7
7
|
const yamlWriterConfig = { indent: 2, skipInvalid: true };
|
|
8
8
|
class FileSystemWriter {
|
|
9
9
|
writeObjectToYamlFile(objectToWrite, filename) {
|
|
10
|
-
fs_1.default.writeFileSync(filename, yaml_1.stringify(objectToWrite, yamlWriterConfig), 'utf-8');
|
|
10
|
+
fs_1.default.writeFileSync(filename, (0, yaml_1.stringify)(objectToWrite, yamlWriterConfig), 'utf-8');
|
|
11
11
|
}
|
|
12
12
|
writeStringToFile(stringToWrite, filename) {
|
|
13
13
|
fs_1.default.writeFileSync(filename, stringToWrite, 'utf-8');
|
|
@@ -14,7 +14,7 @@ class UnzipperZipAccessor {
|
|
|
14
14
|
}
|
|
15
15
|
extract(zipFile, extractDirectory) {
|
|
16
16
|
const zipStream = fs_1.default.createReadStream(zipFile);
|
|
17
|
-
const extractStream = unzipper_1.Extract({ path: extractDirectory });
|
|
17
|
+
const extractStream = (0, unzipper_1.Extract)({ path: extractDirectory });
|
|
18
18
|
return new Promise((resolve, reject) => {
|
|
19
19
|
zipStream.pipe(extractStream);
|
|
20
20
|
zipStream.on('error', reject);
|
package/out/graphql/gateway.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getEnvironment = exports.CDNEnvironments = exports.getGraphqlGateway = exports.DEFAULT_GRAPHQL_GATEWAY = void 0;
|
|
4
4
|
exports.DEFAULT_GRAPHQL_GATEWAY = 'https://api.atlassian.com/graphql';
|
|
5
|
-
|
|
5
|
+
const getGraphqlGateway = () => {
|
|
6
6
|
return process.env.FORGE_GRAPHQL_GATEWAY || exports.DEFAULT_GRAPHQL_GATEWAY;
|
|
7
7
|
};
|
|
8
|
+
exports.getGraphqlGateway = getGraphqlGateway;
|
|
8
9
|
var Environments;
|
|
9
10
|
(function (Environments) {
|
|
10
11
|
Environments["DEV"] = "dev";
|
|
@@ -17,8 +18,8 @@ var CDNEnvironments;
|
|
|
17
18
|
CDNEnvironments["STG"] = "stg";
|
|
18
19
|
CDNEnvironments["PROD"] = "prod";
|
|
19
20
|
})(CDNEnvironments = exports.CDNEnvironments || (exports.CDNEnvironments = {}));
|
|
20
|
-
|
|
21
|
-
const graphqlGateway = exports.getGraphqlGateway();
|
|
21
|
+
const getEnvironment = (envOptions = Environments) => {
|
|
22
|
+
const graphqlGateway = (0, exports.getGraphqlGateway)();
|
|
22
23
|
if (graphqlGateway.includes('.dev.')) {
|
|
23
24
|
return envOptions.DEV;
|
|
24
25
|
}
|
|
@@ -27,3 +28,4 @@ exports.getEnvironment = (envOptions = Environments) => {
|
|
|
27
28
|
}
|
|
28
29
|
return envOptions.PROD;
|
|
29
30
|
};
|
|
31
|
+
exports.getEnvironment = getEnvironment;
|