@forge/cli-shared 10.0.0-next.13 → 10.0.0-next.14
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 +6 -0
- package/out/app-logs/graphql-client.d.ts +2 -2
- package/out/app-logs/graphql-client.d.ts.map +1 -1
- package/out/app-logs/graphql-client.js +9 -17
- package/out/app-logs/index.d.ts +2 -2
- package/out/app-logs/index.d.ts.map +1 -1
- package/out/app-logs/index.js +2 -5
- package/out/app-logs/view-logs.d.ts +4 -4
- package/out/app-logs/view-logs.d.ts.map +1 -1
- package/out/app-logs/view-logs.js +8 -12
- package/out/apps/app-config.d.ts +2 -2
- package/out/apps/app-config.d.ts.map +1 -1
- package/out/apps/app-config.js +13 -20
- package/out/apps/create-an-app.d.ts +4 -4
- package/out/apps/create-an-app.d.ts.map +1 -1
- package/out/apps/create-an-app.js +6 -11
- package/out/apps/create-app-graphql-client.d.ts +2 -2
- package/out/apps/create-app-graphql-client.d.ts.map +1 -1
- package/out/apps/create-app-graphql-client.js +9 -14
- package/out/apps/get-app-owner.d.ts +4 -4
- package/out/apps/get-app-owner.d.ts.map +1 -1
- package/out/apps/get-app-owner.js +8 -13
- package/out/apps/index.d.ts +9 -9
- package/out/apps/index.d.ts.map +1 -1
- package/out/apps/index.js +9 -12
- package/out/apps/package-installer.d.ts +1 -1
- package/out/apps/package-installer.d.ts.map +1 -1
- package/out/apps/package-installer.js +9 -14
- package/out/apps/register-app.d.ts +4 -4
- package/out/apps/register-app.d.ts.map +1 -1
- package/out/apps/register-app.js +9 -13
- package/out/apps/sites.js +1 -4
- package/out/apps/template-module.js +27 -33
- package/out/apps/template.d.ts +3 -3
- package/out/apps/template.d.ts.map +1 -1
- package/out/apps/template.js +36 -47
- package/out/ari/ari.js +48 -63
- package/out/ari/index.d.ts +1 -1
- package/out/ari/index.d.ts.map +1 -1
- package/out/ari/index.js +1 -4
- package/out/auth/authenticator.js +2 -6
- package/out/auth/index.d.ts +3 -3
- package/out/auth/index.d.ts.map +1 -1
- package/out/auth/index.js +3 -6
- package/out/auth/instruction.js +3 -6
- package/out/auth/personal/credential-store.d.ts +2 -2
- package/out/auth/personal/credential-store.d.ts.map +1 -1
- package/out/auth/personal/credential-store.js +48 -57
- package/out/auth/personal/index.d.ts +6 -6
- package/out/auth/personal/index.d.ts.map +1 -1
- package/out/auth/personal/index.js +6 -9
- package/out/auth/personal/login.d.ts +3 -3
- package/out/auth/personal/login.d.ts.map +1 -1
- package/out/auth/personal/login.js +1 -5
- package/out/auth/personal/logout.d.ts +1 -1
- package/out/auth/personal/logout.d.ts.map +1 -1
- package/out/auth/personal/logout.js +1 -5
- package/out/auth/personal/me-graphql-client.d.ts +3 -3
- package/out/auth/personal/me-graphql-client.d.ts.map +1 -1
- package/out/auth/personal/me-graphql-client.js +7 -12
- package/out/auth/personal/token-authenticator.d.ts +3 -3
- package/out/auth/personal/token-authenticator.d.ts.map +1 -1
- package/out/auth/personal/token-authenticator.js +10 -14
- package/out/auth/personal/user-repository.d.ts +4 -4
- package/out/auth/personal/user-repository.d.ts.map +1 -1
- package/out/auth/personal/user-repository.js +5 -9
- package/out/cache/cached-conf.d.ts.map +1 -1
- package/out/cache/cached-conf.js +5 -10
- package/out/cache/index.d.ts +1 -1
- package/out/cache/index.d.ts.map +1 -1
- package/out/cache/index.js +1 -4
- package/out/config/config-codec-types.js +1 -2
- package/out/config/config-file-section-reader.d.ts +3 -3
- package/out/config/config-file-section-reader.d.ts.map +1 -1
- package/out/config/config-file-section-reader.js +4 -10
- package/out/config/config-file-section-writer.d.ts +3 -3
- package/out/config/config-file-section-writer.d.ts.map +1 -1
- package/out/config/config-file-section-writer.js +2 -7
- package/out/config/config-file.d.ts +3 -3
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +40 -49
- package/out/config/config-section.js +4 -11
- package/out/config/config.d.ts +1 -1
- package/out/config/config.d.ts.map +1 -1
- package/out/config/config.js +7 -13
- package/out/config/index.d.ts +6 -6
- package/out/config/index.d.ts.map +1 -1
- package/out/config/index.js +6 -9
- package/out/file-system/archiver.d.ts +2 -2
- package/out/file-system/archiver.d.ts.map +1 -1
- package/out/file-system/archiver.js +20 -29
- package/out/file-system/file-system-reader.d.ts.map +1 -1
- package/out/file-system/file-system-reader.js +21 -26
- package/out/file-system/file-system-writer.js +5 -10
- package/out/file-system/index.d.ts +5 -5
- package/out/file-system/index.d.ts.map +1 -1
- package/out/file-system/index.js +5 -8
- package/out/file-system/util.js +1 -4
- package/out/file-system/zip-accessor.js +3 -8
- package/out/graphql/app-environment-graphql-client.d.ts +2 -2
- package/out/graphql/app-environment-graphql-client.d.ts.map +1 -1
- package/out/graphql/app-environment-graphql-client.js +10 -16
- package/out/graphql/app-oauth-client-id-graphql-client.d.ts +1 -1
- package/out/graphql/app-oauth-client-id-graphql-client.d.ts.map +1 -1
- package/out/graphql/app-oauth-client-id-graphql-client.js +6 -10
- package/out/graphql/debugging-graphql-runner.d.ts +2 -2
- package/out/graphql/debugging-graphql-runner.d.ts.map +1 -1
- package/out/graphql/debugging-graphql-runner.js +5 -10
- package/out/graphql/gateway.js +15 -23
- package/out/graphql/get-mutation-error.js +4 -8
- package/out/graphql/gql/gql.d.ts +82 -82
- package/out/graphql/gql/gql.d.ts.map +1 -1
- package/out/graphql/gql/gql.js +2 -6
- package/out/graphql/gql/graphql.d.ts +4 -0
- package/out/graphql/gql/graphql.d.ts.map +1 -1
- package/out/graphql/gql/graphql.js +83 -88
- package/out/graphql/gql/index.d.ts +1 -1
- package/out/graphql/gql/index.d.ts.map +1 -1
- package/out/graphql/gql/index.js +1 -4
- package/out/graphql/graphql-client.js +1 -2
- package/out/graphql/graphql-domain-types.d.ts +1 -1
- package/out/graphql/graphql-domain-types.d.ts.map +1 -1
- package/out/graphql/graphql-domain-types.js +1 -2
- package/out/graphql/graphql-runtime-enums.js +16 -19
- package/out/graphql/index.d.ts +12 -12
- package/out/graphql/index.d.ts.map +1 -1
- package/out/graphql/index.js +12 -17
- package/out/graphql/minimal-graphql-runner.d.ts +4 -4
- package/out/graphql/minimal-graphql-runner.d.ts.map +1 -1
- package/out/graphql/minimal-graphql-runner.js +31 -40
- 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/graphql/mutation-aware-graphql-client.js +4 -10
- package/out/graphql/path-based-graphql-client-resolver.d.ts +1 -1
- package/out/graphql/path-based-graphql-client-resolver.d.ts.map +1 -1
- package/out/graphql/path-based-graphql-client-resolver.js +3 -7
- package/out/http-client/feedback-post-client.js +1 -5
- package/out/http-client/file-uploader.d.ts +1 -1
- package/out/http-client/file-uploader.d.ts.map +1 -1
- package/out/http-client/file-uploader.js +11 -18
- package/out/http-client/global-edge-http-client.js +8 -14
- package/out/http-client/index.d.ts +5 -5
- package/out/http-client/index.d.ts.map +1 -1
- package/out/http-client/index.js +5 -8
- package/out/http-client/node-request.js +10 -16
- package/out/http-client/trace.js +1 -4
- package/out/index.d.ts +13 -13
- package/out/index.d.ts.map +1 -1
- package/out/index.js +13 -16
- package/out/service/bridge-script-service.js +5 -9
- package/out/service/i18n-resource-bundling-service.js +24 -30
- package/out/service/iframe-resizer-script-service.js +5 -9
- package/out/service/index.d.ts +5 -5
- package/out/service/index.d.ts.map +1 -1
- package/out/service/index.js +5 -8
- package/out/service/statsig-service.d.ts +1 -1
- package/out/service/statsig-service.d.ts.map +1 -1
- package/out/service/statsig-service.js +9 -15
- package/out/service/supported-products-service.d.ts +2 -2
- package/out/service/supported-products-service.d.ts.map +1 -1
- package/out/service/supported-products-service.js +13 -18
- package/out/shared/assertUnreachable.js +1 -4
- package/out/shared/assistant-cli.d.ts +1 -1
- package/out/shared/assistant-cli.d.ts.map +1 -1
- package/out/shared/assistant-cli.js +15 -24
- package/out/shared/cli-details.js +6 -11
- package/out/shared/developer-console.js +12 -18
- package/out/shared/directories.js +4 -8
- package/out/shared/environment.d.ts +1 -1
- package/out/shared/environment.d.ts.map +1 -1
- package/out/shared/environment.js +19 -25
- 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 +24 -44
- package/out/shared/forge-cli-attribution.js +6 -11
- package/out/shared/index.d.ts +13 -13
- package/out/shared/index.d.ts.map +1 -1
- package/out/shared/index.js +13 -16
- package/out/shared/installations.js +1 -4
- package/out/shared/pause.js +1 -5
- package/out/shared/product.d.ts.map +1 -1
- package/out/shared/product.js +5 -10
- package/out/shared/read-app-config-files.d.ts +1 -1
- package/out/shared/read-app-config-files.d.ts.map +1 -1
- package/out/shared/read-app-config-files.js +6 -12
- package/out/shared/runner-signals.js +1 -5
- package/out/shared/test.d.ts +1 -1
- package/out/shared/test.d.ts.map +1 -1
- package/out/shared/test.js +24 -29
- package/out/tunnel/docker-compose-lifecycle.d.ts +3 -3
- package/out/tunnel/docker-compose-lifecycle.d.ts.map +1 -1
- package/out/tunnel/docker-compose-lifecycle.js +53 -70
- package/out/tunnel/index.d.ts +2 -2
- package/out/tunnel/index.d.ts.map +1 -1
- package/out/tunnel/index.js +2 -5
- package/out/tunnel/tunnel-options.js +13 -18
- package/out/ui/command-line-ui.d.ts +2 -2
- package/out/ui/command-line-ui.d.ts.map +1 -1
- package/out/ui/command-line-ui.js +53 -58
- package/out/ui/hint-rotation.d.ts +2 -2
- package/out/ui/hint-rotation.d.ts.map +1 -1
- package/out/ui/hint-rotation.js +2 -6
- package/out/ui/index.d.ts +8 -8
- package/out/ui/index.d.ts.map +1 -1
- package/out/ui/index.js +8 -11
- package/out/ui/log-color.js +16 -20
- package/out/ui/log-symbols.js +10 -13
- package/out/ui/logger.js +2 -6
- package/out/ui/multiple-table-prompt.d.ts +1 -1
- package/out/ui/multiple-table-prompt.d.ts.map +1 -1
- package/out/ui/multiple-table-prompt.js +13 -20
- package/out/ui/runtime-log.js +12 -16
- package/out/ui/single-table-prompt.d.ts +1 -1
- package/out/ui/single-table-prompt.d.ts.map +1 -1
- package/out/ui/single-table-prompt.js +12 -19
- package/out/ui/table-prompt.d.ts +1 -1
- package/out/ui/table-prompt.d.ts.map +1 -1
- package/out/ui/table-prompt.js +11 -16
- package/out/ui/table.d.ts.map +1 -1
- package/out/ui/table.js +4 -7
- package/out/ui/text.d.ts +1 -1
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +208 -214
- package/out/ui/ui.d.ts +2 -2
- package/out/ui/ui.d.ts.map +1 -1
- package/out/ui/ui.js +1 -2
- package/package.json +2 -1
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const os_1 = require("os");
|
|
8
|
-
const path_1 = tslib_1.__importStar(require("path"));
|
|
9
|
-
const util_1 = require("util");
|
|
10
|
-
const recursive_readdir_1 = tslib_1.__importDefault(require("recursive-readdir"));
|
|
1
|
+
import fs, { existsSync, statSync } from 'fs';
|
|
2
|
+
import { glob, hasMagic } from 'glob';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
import path, { resolve } from 'path';
|
|
5
|
+
import { promisify } from 'util';
|
|
6
|
+
import recursive from 'recursive-readdir';
|
|
11
7
|
const FILE_NOT_FOUND_CODE = 'ENOENT';
|
|
12
|
-
class FileSystemReader {
|
|
8
|
+
export class FileSystemReader {
|
|
13
9
|
fileExists(filePath) {
|
|
14
|
-
return
|
|
10
|
+
return fs.existsSync(filePath);
|
|
15
11
|
}
|
|
16
12
|
readFile(filePath) {
|
|
17
13
|
try {
|
|
18
|
-
return
|
|
14
|
+
return fs.readFileSync(filePath, 'utf8');
|
|
19
15
|
}
|
|
20
16
|
catch (error) {
|
|
21
17
|
return this.handleFileError(error);
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
async readFileAsync(filePath) {
|
|
25
|
-
const read =
|
|
21
|
+
const read = promisify(fs.readFile);
|
|
26
22
|
try {
|
|
27
23
|
return await read(filePath, 'utf8');
|
|
28
24
|
}
|
|
@@ -32,21 +28,21 @@ class FileSystemReader {
|
|
|
32
28
|
}
|
|
33
29
|
async recursiveReadDir(rootDir, ignores) {
|
|
34
30
|
const ignoreDirs = ignores?.map((ignore) => {
|
|
35
|
-
if (typeof ignore === 'string' && !
|
|
36
|
-
return (dir, stats) => stats.isDirectory() &&
|
|
31
|
+
if (typeof ignore === 'string' && !path.extname(ignore)) {
|
|
32
|
+
return (dir, stats) => stats.isDirectory() && path.basename(dir) === path.basename(ignore);
|
|
37
33
|
}
|
|
38
34
|
return ignore;
|
|
39
35
|
});
|
|
40
|
-
if (!
|
|
36
|
+
if (!existsSync(resolve(rootDir)) || !statSync(resolve(rootDir)).isDirectory()) {
|
|
41
37
|
return [];
|
|
42
38
|
}
|
|
43
|
-
return (
|
|
39
|
+
return recursive(rootDir, ignoreDirs);
|
|
44
40
|
}
|
|
45
41
|
async readGlob({ pattern, filesOnly = false }) {
|
|
46
|
-
let results = await
|
|
42
|
+
let results = await glob(pattern, {});
|
|
47
43
|
if (filesOnly) {
|
|
48
44
|
results = (await Promise.all(results.map(async (result) => {
|
|
49
|
-
if ((await
|
|
45
|
+
if ((await fs.promises.lstat(result)).isFile()) {
|
|
50
46
|
return [result];
|
|
51
47
|
}
|
|
52
48
|
else {
|
|
@@ -58,18 +54,18 @@ class FileSystemReader {
|
|
|
58
54
|
return results;
|
|
59
55
|
}
|
|
60
56
|
hasGlobSpecialChars(pattern) {
|
|
61
|
-
return
|
|
57
|
+
return hasMagic(pattern);
|
|
62
58
|
}
|
|
63
59
|
readBinaryFile(filePath) {
|
|
64
60
|
try {
|
|
65
|
-
return
|
|
61
|
+
return fs.readFileSync(filePath);
|
|
66
62
|
}
|
|
67
63
|
catch (error) {
|
|
68
64
|
return this.handleFileError(error);
|
|
69
65
|
}
|
|
70
66
|
}
|
|
71
67
|
async readBinaryFileAsync(filePath) {
|
|
72
|
-
const read =
|
|
68
|
+
const read = promisify(fs.readFile);
|
|
73
69
|
try {
|
|
74
70
|
return await read(filePath);
|
|
75
71
|
}
|
|
@@ -78,7 +74,7 @@ class FileSystemReader {
|
|
|
78
74
|
}
|
|
79
75
|
}
|
|
80
76
|
getHomeDirectory() {
|
|
81
|
-
return
|
|
77
|
+
return homedir();
|
|
82
78
|
}
|
|
83
79
|
bytesToMb(size) {
|
|
84
80
|
if (!size) {
|
|
@@ -88,7 +84,7 @@ class FileSystemReader {
|
|
|
88
84
|
}
|
|
89
85
|
getSize(filePath) {
|
|
90
86
|
try {
|
|
91
|
-
return
|
|
87
|
+
return fs.statSync(filePath).size;
|
|
92
88
|
}
|
|
93
89
|
catch {
|
|
94
90
|
return undefined;
|
|
@@ -115,4 +111,3 @@ class FileSystemReader {
|
|
|
115
111
|
return files.flat();
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
|
-
exports.FileSystemReader = FileSystemReader;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.FileSystemWriter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
|
-
const yaml_1 = require("yaml");
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { stringify } from 'yaml';
|
|
7
3
|
const yamlWriterConfig = { indent: 2, skipInvalid: true };
|
|
8
|
-
class FileSystemWriter {
|
|
4
|
+
export class FileSystemWriter {
|
|
9
5
|
writeObjectToYamlFile(objectToWrite, filename) {
|
|
10
|
-
|
|
6
|
+
fs.writeFileSync(filename, stringify(objectToWrite, yamlWriterConfig), 'utf-8');
|
|
11
7
|
}
|
|
12
8
|
writeStringToFile(stringToWrite, filename) {
|
|
13
|
-
|
|
9
|
+
fs.writeFileSync(filename, stringToWrite, 'utf-8');
|
|
14
10
|
}
|
|
15
11
|
}
|
|
16
|
-
exports.FileSystemWriter = FileSystemWriter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './file-system-reader';
|
|
2
|
-
export * from './file-system-writer';
|
|
3
|
-
export * from './archiver';
|
|
4
|
-
export * from './util';
|
|
5
|
-
export * from './zip-accessor';
|
|
1
|
+
export * from './file-system-reader.js';
|
|
2
|
+
export * from './file-system-writer.js';
|
|
3
|
+
export * from './archiver.js';
|
|
4
|
+
export * from './util.js';
|
|
5
|
+
export * from './zip-accessor.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file-system/index.ts"],"names":[],"mappings":"AAEA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file-system/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
|
package/out/file-system/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
tslib_1.__exportStar(require("./archiver"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./util"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./zip-accessor"), exports);
|
|
1
|
+
export * from './file-system-reader.js';
|
|
2
|
+
export * from './file-system-writer.js';
|
|
3
|
+
export * from './archiver.js';
|
|
4
|
+
export * from './util.js';
|
|
5
|
+
export * from './zip-accessor.js';
|
package/out/file-system/util.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inDirectory = inDirectory;
|
|
4
|
-
async function inDirectory(path, action) {
|
|
1
|
+
export async function inDirectory(path, action) {
|
|
5
2
|
const originalPath = process.cwd();
|
|
6
3
|
try {
|
|
7
4
|
process.chdir(path);
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AdmZipAccessor = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
6
|
-
class AdmZipAccessor {
|
|
1
|
+
import AdmZip from 'adm-zip';
|
|
2
|
+
export class AdmZipAccessor {
|
|
7
3
|
async extract(zipFile, extractDirectory) {
|
|
8
|
-
const zip = new
|
|
4
|
+
const zip = new AdmZip(zipFile);
|
|
9
5
|
await new Promise((resolve, reject) => zip.extractAllToAsync(extractDirectory, true, false, (err) => (err ? reject(err) : resolve())));
|
|
10
6
|
}
|
|
11
7
|
}
|
|
12
|
-
exports.AdmZipAccessor = AdmZipAccessor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppEnvironmentType, GraphQLClient } from './index';
|
|
2
|
-
import { UserError } from '../shared/error-handling';
|
|
1
|
+
import { AppEnvironmentType, GraphQLClient } from './index.js';
|
|
2
|
+
import { UserError } from '../shared/error-handling.js';
|
|
3
3
|
export declare class MissingAppError extends UserError {
|
|
4
4
|
constructor();
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-environment-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-environment-graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"app-environment-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-environment-graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,qBAAa,eAAgB,SAAQ,SAAS;;CAI7C;AAED,qBAAa,0BAA2B,SAAQ,SAAS;gBAC3C,MAAM,EAAE,MAAM;CAG3B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,wBAAwB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrG;AAED,qBAAa,4BAA6B,YAAW,oBAAoB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA2B3E,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiC9G"}
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const ui_1 = require("../ui");
|
|
6
|
-
const error_handling_1 = require("../shared/error-handling");
|
|
7
|
-
class MissingAppError extends error_handling_1.UserError {
|
|
1
|
+
import { graphql } from './gql/gql.js';
|
|
2
|
+
import { Text } from '../ui/index.js';
|
|
3
|
+
import { UserError } from '../shared/error-handling.js';
|
|
4
|
+
export class MissingAppError extends UserError {
|
|
8
5
|
constructor() {
|
|
9
|
-
super(
|
|
6
|
+
super(Text.env.error.appNotExist);
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
class MissingAppEnvironmentError extends error_handling_1.UserError {
|
|
9
|
+
export class MissingAppEnvironmentError extends UserError {
|
|
14
10
|
constructor(envKey) {
|
|
15
|
-
super(
|
|
11
|
+
super(Text.env.error.envNotExist(envKey));
|
|
16
12
|
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
class AppEnvironmentsGraphqlClient {
|
|
14
|
+
export class AppEnvironmentsGraphqlClient {
|
|
20
15
|
graphqlClient;
|
|
21
16
|
constructor(graphqlClient) {
|
|
22
17
|
this.graphqlClient = graphqlClient;
|
|
23
18
|
}
|
|
24
19
|
async getAppEnvironmentId(appId, environmentKey) {
|
|
25
|
-
const query =
|
|
20
|
+
const query = graphql(`
|
|
26
21
|
query forge_cli_getApplicationEnvironmentId($id: ID!, $key: String!) {
|
|
27
22
|
app(id: $id) {
|
|
28
23
|
environmentByKey(key: $key) {
|
|
@@ -44,7 +39,7 @@ class AppEnvironmentsGraphqlClient {
|
|
|
44
39
|
return result.app.environmentByKey.id;
|
|
45
40
|
}
|
|
46
41
|
async getAppEnvironmentDetails(appAri, environmentKey) {
|
|
47
|
-
const query =
|
|
42
|
+
const query = graphql(`
|
|
48
43
|
query forge_cli_getApplicationEnvironmentDetails($id: ID!, $key: String!) {
|
|
49
44
|
app(id: $id) {
|
|
50
45
|
name
|
|
@@ -73,4 +68,3 @@ class AppEnvironmentsGraphqlClient {
|
|
|
73
68
|
};
|
|
74
69
|
}
|
|
75
70
|
}
|
|
76
|
-
exports.AppEnvironmentsGraphqlClient = AppEnvironmentsGraphqlClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-oauth-client-id-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-oauth-client-id-graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAA+C,MAAM,
|
|
1
|
+
{"version":3,"file":"app-oauth-client-id-graphql-client.d.ts","sourceRoot":"","sources":["../../src/graphql/app-oauth-client-id-graphql-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAA+C,MAAM,YAAY,CAAC;AAE5G,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,kBAAkB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,0BAA0B,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACvG;AAED,qBAAa,2BAA4B,YAAW,sBAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAsChH"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const gql_1 = require("./gql/gql");
|
|
5
|
-
const index_1 = require("./index");
|
|
6
|
-
class AppOauthClientGraphqlClient {
|
|
1
|
+
import { graphql } from './gql/gql.js';
|
|
2
|
+
import { MissingAppError, MissingAppEnvironmentError } from './index.js';
|
|
3
|
+
export class AppOauthClientGraphqlClient {
|
|
7
4
|
graphqlClient;
|
|
8
5
|
constructor(graphqlClient) {
|
|
9
6
|
this.graphqlClient = graphqlClient;
|
|
10
7
|
}
|
|
11
8
|
async getAppOauthClientIdDetails(appAri, environmentKey) {
|
|
12
|
-
const query =
|
|
9
|
+
const query = graphql(`
|
|
13
10
|
query forge_cli_getAppOauthClientIdDetails($id: ID!, $key: String!) {
|
|
14
11
|
app(id: $id) {
|
|
15
12
|
name
|
|
@@ -28,10 +25,10 @@ class AppOauthClientGraphqlClient {
|
|
|
28
25
|
key: environmentKey
|
|
29
26
|
});
|
|
30
27
|
if (!result.app) {
|
|
31
|
-
throw new
|
|
28
|
+
throw new MissingAppError();
|
|
32
29
|
}
|
|
33
30
|
if (!result.app.environmentByKey) {
|
|
34
|
-
throw new
|
|
31
|
+
throw new MissingAppEnvironmentError(environmentKey);
|
|
35
32
|
}
|
|
36
33
|
return {
|
|
37
34
|
name: result.app.name,
|
|
@@ -43,4 +40,3 @@ class AppOauthClientGraphqlClient {
|
|
|
43
40
|
};
|
|
44
41
|
}
|
|
45
42
|
}
|
|
46
|
-
exports.AppOauthClientGraphqlClient = AppOauthClientGraphqlClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Logger } from '../ui';
|
|
2
|
-
import { GraphQLRunner, Variables } from './graphql-client';
|
|
1
|
+
import { Logger } from '../ui/index.js';
|
|
2
|
+
import { GraphQLRunner, Variables } from './graphql-client.js';
|
|
3
3
|
export declare function stringify(variables: any): string;
|
|
4
4
|
export declare class DebuggingGraphqlRunner implements GraphQLRunner {
|
|
5
5
|
private readonly innerClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debugging-graphql-runner.d.ts","sourceRoot":"","sources":["../../src/graphql/debugging-graphql-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"debugging-graphql-runner.d.ts","sourceRoot":"","sources":["../../src/graphql/debugging-graphql-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG/D,wBAAgB,SAAS,CAAC,SAAS,EAAE,GAAG,UAEvC;AAED,qBAAa,sBAAuB,YAAW,aAAa;IAKxD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6B;gBAG5C,WAAW,EAAE,aAAa,EAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM;IAGjC,OAAO,CAAC,mBAAmB;IAsBd,GAAG,CAAC,UAAU,SAAS,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU;;;;;CAe5G"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.DebuggingGraphqlRunner = void 0;
|
|
4
|
-
exports.stringify = stringify;
|
|
5
|
-
const ui_1 = require("../ui");
|
|
6
|
-
function stringify(variables) {
|
|
1
|
+
import { Text } from '../ui/index.js';
|
|
2
|
+
export function stringify(variables) {
|
|
7
3
|
return JSON.stringify(variables, null, 2);
|
|
8
4
|
}
|
|
9
|
-
class DebuggingGraphqlRunner {
|
|
5
|
+
export class DebuggingGraphqlRunner {
|
|
10
6
|
innerClient;
|
|
11
7
|
endpoint;
|
|
12
8
|
logger;
|
|
@@ -38,11 +34,10 @@ class DebuggingGraphqlRunner {
|
|
|
38
34
|
}
|
|
39
35
|
async run(query, variables) {
|
|
40
36
|
const filteredVariables = this.filterSensitiveData(variables);
|
|
41
|
-
this.logger.trace(
|
|
37
|
+
this.logger.trace(Text.graphQL.request(this.endpoint, query, stringify(filteredVariables)));
|
|
42
38
|
const { requestId, response, extensions } = await this.innerClient.run(query, variables);
|
|
43
39
|
const filteredResponse = this.filterSensitiveData(response);
|
|
44
|
-
this.logger.trace(
|
|
40
|
+
this.logger.trace(Text.graphQL.response(stringify(filteredResponse), requestId));
|
|
45
41
|
return { requestId, response, extensions };
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
|
-
exports.DebuggingGraphqlRunner = DebuggingGraphqlRunner;
|
package/out/graphql/gateway.js
CHANGED
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.DEFAULT_GRAPHQL_GATEWAY = 'https://api.atlassian.com/graphql';
|
|
5
|
-
const getGraphqlGateway = () => {
|
|
6
|
-
return process.env.FORGE_GRAPHQL_GATEWAY || exports.DEFAULT_GRAPHQL_GATEWAY;
|
|
1
|
+
export const DEFAULT_GRAPHQL_GATEWAY = 'https://api.atlassian.com/graphql';
|
|
2
|
+
export const getGraphqlGateway = () => {
|
|
3
|
+
return process.env.FORGE_GRAPHQL_GATEWAY || DEFAULT_GRAPHQL_GATEWAY;
|
|
7
4
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const isBluebirdEnabled = () => {
|
|
5
|
+
export const STAGING_PRIVATE_GRAPHQL_GATEWAY = 'https://api-private.stg.atlassian.com/graphql';
|
|
6
|
+
export const isBluebirdEnabled = () => {
|
|
11
7
|
return (process.env.FORGE_BLUEBIRD_ENABLED ?? '').trim().toLowerCase() === 'true';
|
|
12
8
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return (0, exports.getGraphqlGateway)().trim() === exports.STAGING_PRIVATE_GRAPHQL_GATEWAY && (0, exports.isBluebirdEnabled)();
|
|
9
|
+
export const isPathBasedRoutingEnabled = () => {
|
|
10
|
+
return getGraphqlGateway().trim() === STAGING_PRIVATE_GRAPHQL_GATEWAY && isBluebirdEnabled();
|
|
16
11
|
};
|
|
17
|
-
|
|
18
|
-
var Environments;
|
|
12
|
+
export var Environments;
|
|
19
13
|
(function (Environments) {
|
|
20
14
|
Environments["DEV"] = "dev";
|
|
21
15
|
Environments["STG"] = "staging";
|
|
22
16
|
Environments["PROD"] = "prod";
|
|
23
17
|
Environments["FEDRAMP_MODERATE_STAGING"] = "fedm_staging";
|
|
24
18
|
Environments["FEDRAMP_MODERATE_PROD"] = "fedm_prod";
|
|
25
|
-
})(Environments || (
|
|
26
|
-
var CDNEnvironments;
|
|
19
|
+
})(Environments || (Environments = {}));
|
|
20
|
+
export var CDNEnvironments;
|
|
27
21
|
(function (CDNEnvironments) {
|
|
28
22
|
CDNEnvironments["DEV"] = "dev";
|
|
29
23
|
CDNEnvironments["STG"] = "stg";
|
|
30
24
|
CDNEnvironments["PROD"] = "prod";
|
|
31
25
|
CDNEnvironments["FEDRAMP_MODERATE_STAGING"] = "fedm_staging";
|
|
32
26
|
CDNEnvironments["FEDRAMP_MODERATE_PROD"] = "fedm_prod";
|
|
33
|
-
})(CDNEnvironments || (
|
|
34
|
-
const getEnvironmentConfig = (envOptions = Environments) => {
|
|
35
|
-
const graphqlGateway =
|
|
27
|
+
})(CDNEnvironments || (CDNEnvironments = {}));
|
|
28
|
+
export const getEnvironmentConfig = (envOptions = Environments) => {
|
|
29
|
+
const graphqlGateway = getGraphqlGateway();
|
|
36
30
|
if (graphqlGateway.includes('.dev.')) {
|
|
37
31
|
return envOptions.DEV;
|
|
38
32
|
}
|
|
@@ -47,10 +41,8 @@ const getEnvironmentConfig = (envOptions = Environments) => {
|
|
|
47
41
|
}
|
|
48
42
|
return envOptions.PROD;
|
|
49
43
|
};
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const currentEnvironment = (0, exports.getEnvironmentConfig)();
|
|
44
|
+
export const isFedrampEnv = () => {
|
|
45
|
+
const currentEnvironment = getEnvironmentConfig();
|
|
53
46
|
return (currentEnvironment === Environments.FEDRAMP_MODERATE_STAGING ||
|
|
54
47
|
currentEnvironment === Environments.FEDRAMP_MODERATE_PROD);
|
|
55
48
|
};
|
|
56
|
-
exports.isFedrampEnv = isFedrampEnv;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.requireMutationPayload = requireMutationPayload;
|
|
4
|
-
exports.getError = getError;
|
|
5
|
-
const mutation_aware_graphql_client_1 = require("./mutation-aware-graphql-client");
|
|
6
|
-
function requireMutationPayload(value, requestId) {
|
|
1
|
+
import { GraphQlMutationError } from './mutation-aware-graphql-client.js';
|
|
2
|
+
export function requireMutationPayload(value, requestId) {
|
|
7
3
|
if (value == null) {
|
|
8
|
-
throw new
|
|
4
|
+
throw new GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
|
|
9
5
|
}
|
|
10
6
|
return value;
|
|
11
7
|
}
|
|
12
|
-
function getError(errors) {
|
|
8
|
+
export function getError(errors) {
|
|
13
9
|
const error = errors?.[0];
|
|
14
10
|
return {
|
|
15
11
|
code: error?.extensions?.errorType || undefined,
|