@forge/cli-shared 10.0.0-next.13 → 10.0.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/out/app-logs/graphql-client.d.ts +2 -2
  3. package/out/app-logs/graphql-client.d.ts.map +1 -1
  4. package/out/app-logs/graphql-client.js +9 -17
  5. package/out/app-logs/index.d.ts +2 -2
  6. package/out/app-logs/index.d.ts.map +1 -1
  7. package/out/app-logs/index.js +2 -5
  8. package/out/app-logs/view-logs.d.ts +4 -4
  9. package/out/app-logs/view-logs.d.ts.map +1 -1
  10. package/out/app-logs/view-logs.js +8 -12
  11. package/out/apps/app-config.d.ts +2 -2
  12. package/out/apps/app-config.d.ts.map +1 -1
  13. package/out/apps/app-config.js +13 -20
  14. package/out/apps/create-an-app.d.ts +4 -4
  15. package/out/apps/create-an-app.d.ts.map +1 -1
  16. package/out/apps/create-an-app.js +6 -11
  17. package/out/apps/create-app-graphql-client.d.ts +2 -2
  18. package/out/apps/create-app-graphql-client.d.ts.map +1 -1
  19. package/out/apps/create-app-graphql-client.js +9 -14
  20. package/out/apps/get-app-owner.d.ts +4 -4
  21. package/out/apps/get-app-owner.d.ts.map +1 -1
  22. package/out/apps/get-app-owner.js +8 -13
  23. package/out/apps/index.d.ts +9 -9
  24. package/out/apps/index.d.ts.map +1 -1
  25. package/out/apps/index.js +9 -12
  26. package/out/apps/package-installer.d.ts +1 -1
  27. package/out/apps/package-installer.d.ts.map +1 -1
  28. package/out/apps/package-installer.js +9 -14
  29. package/out/apps/register-app.d.ts +4 -4
  30. package/out/apps/register-app.d.ts.map +1 -1
  31. package/out/apps/register-app.js +9 -13
  32. package/out/apps/sites.js +1 -4
  33. package/out/apps/template-module.js +27 -33
  34. package/out/apps/template.d.ts +3 -3
  35. package/out/apps/template.d.ts.map +1 -1
  36. package/out/apps/template.js +36 -47
  37. package/out/ari/ari.js +48 -63
  38. package/out/ari/index.d.ts +1 -1
  39. package/out/ari/index.d.ts.map +1 -1
  40. package/out/ari/index.js +1 -4
  41. package/out/auth/authenticator.js +2 -6
  42. package/out/auth/index.d.ts +3 -3
  43. package/out/auth/index.d.ts.map +1 -1
  44. package/out/auth/index.js +3 -6
  45. package/out/auth/instruction.js +3 -6
  46. package/out/auth/personal/credential-store.d.ts +2 -2
  47. package/out/auth/personal/credential-store.d.ts.map +1 -1
  48. package/out/auth/personal/credential-store.js +48 -57
  49. package/out/auth/personal/index.d.ts +6 -6
  50. package/out/auth/personal/index.d.ts.map +1 -1
  51. package/out/auth/personal/index.js +6 -9
  52. package/out/auth/personal/login.d.ts +3 -3
  53. package/out/auth/personal/login.d.ts.map +1 -1
  54. package/out/auth/personal/login.js +1 -5
  55. package/out/auth/personal/logout.d.ts +1 -1
  56. package/out/auth/personal/logout.d.ts.map +1 -1
  57. package/out/auth/personal/logout.js +1 -5
  58. package/out/auth/personal/me-graphql-client.d.ts +3 -3
  59. package/out/auth/personal/me-graphql-client.d.ts.map +1 -1
  60. package/out/auth/personal/me-graphql-client.js +7 -12
  61. package/out/auth/personal/token-authenticator.d.ts +3 -3
  62. package/out/auth/personal/token-authenticator.d.ts.map +1 -1
  63. package/out/auth/personal/token-authenticator.js +10 -14
  64. package/out/auth/personal/user-repository.d.ts +4 -4
  65. package/out/auth/personal/user-repository.d.ts.map +1 -1
  66. package/out/auth/personal/user-repository.js +5 -9
  67. package/out/cache/cached-conf.d.ts.map +1 -1
  68. package/out/cache/cached-conf.js +5 -10
  69. package/out/cache/index.d.ts +1 -1
  70. package/out/cache/index.d.ts.map +1 -1
  71. package/out/cache/index.js +1 -4
  72. package/out/config/config-codec-types.js +1 -2
  73. package/out/config/config-file-section-reader.d.ts +3 -3
  74. package/out/config/config-file-section-reader.d.ts.map +1 -1
  75. package/out/config/config-file-section-reader.js +4 -10
  76. package/out/config/config-file-section-writer.d.ts +3 -3
  77. package/out/config/config-file-section-writer.d.ts.map +1 -1
  78. package/out/config/config-file-section-writer.js +2 -7
  79. package/out/config/config-file.d.ts +3 -3
  80. package/out/config/config-file.d.ts.map +1 -1
  81. package/out/config/config-file.js +40 -49
  82. package/out/config/config-section.js +4 -11
  83. package/out/config/config.d.ts +1 -1
  84. package/out/config/config.d.ts.map +1 -1
  85. package/out/config/config.js +7 -13
  86. package/out/config/index.d.ts +6 -6
  87. package/out/config/index.d.ts.map +1 -1
  88. package/out/config/index.js +6 -9
  89. package/out/file-system/archiver.d.ts +2 -2
  90. package/out/file-system/archiver.d.ts.map +1 -1
  91. package/out/file-system/archiver.js +20 -29
  92. package/out/file-system/file-system-reader.d.ts.map +1 -1
  93. package/out/file-system/file-system-reader.js +21 -26
  94. package/out/file-system/file-system-writer.js +5 -10
  95. package/out/file-system/index.d.ts +5 -5
  96. package/out/file-system/index.d.ts.map +1 -1
  97. package/out/file-system/index.js +5 -8
  98. package/out/file-system/util.js +1 -4
  99. package/out/file-system/zip-accessor.js +3 -8
  100. package/out/graphql/app-environment-graphql-client.d.ts +2 -2
  101. package/out/graphql/app-environment-graphql-client.d.ts.map +1 -1
  102. package/out/graphql/app-environment-graphql-client.js +10 -16
  103. package/out/graphql/app-oauth-client-id-graphql-client.d.ts +1 -1
  104. package/out/graphql/app-oauth-client-id-graphql-client.d.ts.map +1 -1
  105. package/out/graphql/app-oauth-client-id-graphql-client.js +6 -10
  106. package/out/graphql/debugging-graphql-runner.d.ts +2 -2
  107. package/out/graphql/debugging-graphql-runner.d.ts.map +1 -1
  108. package/out/graphql/debugging-graphql-runner.js +5 -10
  109. package/out/graphql/gateway.js +15 -23
  110. package/out/graphql/get-mutation-error.js +4 -8
  111. package/out/graphql/gql/gql.d.ts +82 -82
  112. package/out/graphql/gql/gql.d.ts.map +1 -1
  113. package/out/graphql/gql/gql.js +2 -6
  114. package/out/graphql/gql/graphql.d.ts +214 -12
  115. package/out/graphql/gql/graphql.d.ts.map +1 -1
  116. package/out/graphql/gql/graphql.js +83 -88
  117. package/out/graphql/gql/index.d.ts +1 -1
  118. package/out/graphql/gql/index.d.ts.map +1 -1
  119. package/out/graphql/gql/index.js +1 -4
  120. package/out/graphql/graphql-client.js +1 -2
  121. package/out/graphql/graphql-domain-types.d.ts +1 -1
  122. package/out/graphql/graphql-domain-types.d.ts.map +1 -1
  123. package/out/graphql/graphql-domain-types.js +1 -2
  124. package/out/graphql/graphql-runtime-enums.js +16 -19
  125. package/out/graphql/index.d.ts +12 -12
  126. package/out/graphql/index.d.ts.map +1 -1
  127. package/out/graphql/index.js +12 -17
  128. package/out/graphql/minimal-graphql-runner.d.ts +4 -4
  129. package/out/graphql/minimal-graphql-runner.d.ts.map +1 -1
  130. package/out/graphql/minimal-graphql-runner.js +31 -40
  131. package/out/graphql/mutation-aware-graphql-client.d.ts +2 -2
  132. package/out/graphql/mutation-aware-graphql-client.d.ts.map +1 -1
  133. package/out/graphql/mutation-aware-graphql-client.js +4 -10
  134. package/out/graphql/path-based-graphql-client-resolver.d.ts +1 -1
  135. package/out/graphql/path-based-graphql-client-resolver.d.ts.map +1 -1
  136. package/out/graphql/path-based-graphql-client-resolver.js +3 -7
  137. package/out/http-client/feedback-post-client.js +1 -5
  138. package/out/http-client/file-uploader.d.ts +1 -1
  139. package/out/http-client/file-uploader.d.ts.map +1 -1
  140. package/out/http-client/file-uploader.js +11 -18
  141. package/out/http-client/global-edge-http-client.js +8 -14
  142. package/out/http-client/index.d.ts +5 -5
  143. package/out/http-client/index.d.ts.map +1 -1
  144. package/out/http-client/index.js +5 -8
  145. package/out/http-client/node-request.js +10 -16
  146. package/out/http-client/trace.js +1 -4
  147. package/out/index.d.ts +13 -13
  148. package/out/index.d.ts.map +1 -1
  149. package/out/index.js +13 -16
  150. package/out/service/bridge-script-service.js +5 -9
  151. package/out/service/i18n-resource-bundling-service.js +24 -30
  152. package/out/service/iframe-resizer-script-service.js +5 -9
  153. package/out/service/index.d.ts +5 -5
  154. package/out/service/index.d.ts.map +1 -1
  155. package/out/service/index.js +5 -8
  156. package/out/service/statsig-service.d.ts +1 -1
  157. package/out/service/statsig-service.d.ts.map +1 -1
  158. package/out/service/statsig-service.js +9 -15
  159. package/out/service/supported-products-service.d.ts +2 -2
  160. package/out/service/supported-products-service.d.ts.map +1 -1
  161. package/out/service/supported-products-service.js +13 -18
  162. package/out/shared/assertUnreachable.js +1 -4
  163. package/out/shared/assistant-cli.d.ts +1 -1
  164. package/out/shared/assistant-cli.d.ts.map +1 -1
  165. package/out/shared/assistant-cli.js +15 -24
  166. package/out/shared/cli-details.js +6 -11
  167. package/out/shared/developer-console.js +12 -18
  168. package/out/shared/directories.js +4 -8
  169. package/out/shared/environment.d.ts +1 -1
  170. package/out/shared/environment.d.ts.map +1 -1
  171. package/out/shared/environment.js +19 -25
  172. package/out/shared/error-handling.d.ts +1 -1
  173. package/out/shared/error-handling.d.ts.map +1 -1
  174. package/out/shared/error-handling.js +24 -44
  175. package/out/shared/forge-cli-attribution.js +6 -11
  176. package/out/shared/index.d.ts +13 -13
  177. package/out/shared/index.d.ts.map +1 -1
  178. package/out/shared/index.js +13 -16
  179. package/out/shared/installations.js +1 -4
  180. package/out/shared/pause.js +1 -5
  181. package/out/shared/product.d.ts.map +1 -1
  182. package/out/shared/product.js +5 -10
  183. package/out/shared/read-app-config-files.d.ts +1 -1
  184. package/out/shared/read-app-config-files.d.ts.map +1 -1
  185. package/out/shared/read-app-config-files.js +6 -12
  186. package/out/shared/runner-signals.js +1 -5
  187. package/out/shared/test.d.ts +1 -1
  188. package/out/shared/test.d.ts.map +1 -1
  189. package/out/shared/test.js +24 -29
  190. package/out/tunnel/docker-compose-lifecycle.d.ts +3 -3
  191. package/out/tunnel/docker-compose-lifecycle.d.ts.map +1 -1
  192. package/out/tunnel/docker-compose-lifecycle.js +53 -70
  193. package/out/tunnel/index.d.ts +2 -2
  194. package/out/tunnel/index.d.ts.map +1 -1
  195. package/out/tunnel/index.js +2 -5
  196. package/out/tunnel/tunnel-options.js +13 -18
  197. package/out/ui/command-line-ui.d.ts +2 -2
  198. package/out/ui/command-line-ui.d.ts.map +1 -1
  199. package/out/ui/command-line-ui.js +53 -58
  200. package/out/ui/hint-rotation.d.ts +2 -2
  201. package/out/ui/hint-rotation.d.ts.map +1 -1
  202. package/out/ui/hint-rotation.js +2 -6
  203. package/out/ui/index.d.ts +8 -8
  204. package/out/ui/index.d.ts.map +1 -1
  205. package/out/ui/index.js +8 -11
  206. package/out/ui/log-color.js +16 -20
  207. package/out/ui/log-symbols.js +10 -13
  208. package/out/ui/logger.js +2 -6
  209. package/out/ui/multiple-table-prompt.d.ts +1 -1
  210. package/out/ui/multiple-table-prompt.d.ts.map +1 -1
  211. package/out/ui/multiple-table-prompt.js +13 -20
  212. package/out/ui/runtime-log.js +12 -16
  213. package/out/ui/single-table-prompt.d.ts +1 -1
  214. package/out/ui/single-table-prompt.d.ts.map +1 -1
  215. package/out/ui/single-table-prompt.js +12 -19
  216. package/out/ui/table-prompt.d.ts +1 -1
  217. package/out/ui/table-prompt.d.ts.map +1 -1
  218. package/out/ui/table-prompt.js +11 -16
  219. package/out/ui/table.d.ts.map +1 -1
  220. package/out/ui/table.js +4 -7
  221. package/out/ui/text.d.ts +1 -1
  222. package/out/ui/text.d.ts.map +1 -1
  223. package/out/ui/text.js +208 -214
  224. package/out/ui/ui.d.ts +2 -2
  225. package/out/ui/ui.d.ts.map +1 -1
  226. package/out/ui/ui.js +1 -2
  227. package/package.json +3 -2
@@ -1,28 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileSystemReader = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importStar(require("fs"));
6
- const glob_1 = require("glob");
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 fs_1.default.existsSync(filePath);
10
+ return fs.existsSync(filePath);
15
11
  }
16
12
  readFile(filePath) {
17
13
  try {
18
- return fs_1.default.readFileSync(filePath, 'utf8');
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 = (0, util_1.promisify)(fs_1.default.readFile);
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' && !path_1.default.extname(ignore)) {
36
- return (dir, stats) => stats.isDirectory() && path_1.default.basename(dir) === path_1.default.basename(ignore);
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 (!(0, fs_1.existsSync)((0, path_1.resolve)(rootDir)) || !(0, fs_1.statSync)((0, path_1.resolve)(rootDir)).isDirectory()) {
36
+ if (!existsSync(resolve(rootDir)) || !statSync(resolve(rootDir)).isDirectory()) {
41
37
  return [];
42
38
  }
43
- return (0, recursive_readdir_1.default)(rootDir, ignoreDirs);
39
+ return recursive(rootDir, ignoreDirs);
44
40
  }
45
41
  async readGlob({ pattern, filesOnly = false }) {
46
- let results = await (0, glob_1.glob)(pattern, {});
42
+ let results = await glob(pattern, {});
47
43
  if (filesOnly) {
48
44
  results = (await Promise.all(results.map(async (result) => {
49
- if ((await fs_1.default.promises.lstat(result)).isFile()) {
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 (0, glob_1.hasMagic)(pattern);
57
+ return hasMagic(pattern);
62
58
  }
63
59
  readBinaryFile(filePath) {
64
60
  try {
65
- return fs_1.default.readFileSync(filePath);
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 = (0, util_1.promisify)(fs_1.default.readFile);
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 (0, os_1.homedir)();
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 fs_1.default.statSync(filePath).size;
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- fs_1.default.writeFileSync(filename, (0, yaml_1.stringify)(objectToWrite, yamlWriterConfig), 'utf-8');
6
+ fs.writeFileSync(filename, stringify(objectToWrite, yamlWriterConfig), 'utf-8');
11
7
  }
12
8
  writeStringToFile(stringToWrite, filename) {
13
- fs_1.default.writeFileSync(filename, stringToWrite, 'utf-8');
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,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,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"}
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./file-system-reader"), exports);
5
- tslib_1.__exportStar(require("./file-system-writer"), exports);
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';
@@ -1,7 +1,4 @@
1
- "use strict";
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 adm_zip_1.default(zipFile);
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,SAAS,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppEnvironmentsGraphqlClient = exports.MissingAppEnvironmentError = exports.MissingAppError = void 0;
4
- const gql_1 = require("./gql/gql");
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(ui_1.Text.env.error.appNotExist);
6
+ super(Text.env.error.appNotExist);
10
7
  }
11
8
  }
12
- exports.MissingAppError = MissingAppError;
13
- class MissingAppEnvironmentError extends error_handling_1.UserError {
9
+ export class MissingAppEnvironmentError extends UserError {
14
10
  constructor(envKey) {
15
- super(ui_1.Text.env.error.envNotExist(envKey));
11
+ super(Text.env.error.envNotExist(envKey));
16
12
  }
17
13
  }
18
- exports.MissingAppEnvironmentError = MissingAppEnvironmentError;
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 = (0, gql_1.graphql)(`
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 = (0, gql_1.graphql)(`
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,4 +1,4 @@
1
- import { AppEnvironmentType, GraphQLClient } from './index';
1
+ import { AppEnvironmentType, GraphQLClient } from './index.js';
2
2
  export interface AppOauthClientDetails {
3
3
  appAri: string;
4
4
  name: string;
@@ -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,SAAS,CAAC;AAEzG,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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppOauthClientGraphqlClient = void 0;
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 = (0, gql_1.graphql)(`
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 index_1.MissingAppError();
28
+ throw new MissingAppError();
32
29
  }
33
30
  if (!result.app.environmentByKey) {
34
- throw new index_1.MissingAppEnvironmentError(environmentKey);
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,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG5D,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
+ {"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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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(ui_1.Text.graphQL.request(this.endpoint, query, stringify(filteredVariables)));
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(ui_1.Text.graphQL.response(stringify(filteredResponse), requestId));
40
+ this.logger.trace(Text.graphQL.response(stringify(filteredResponse), requestId));
45
41
  return { requestId, response, extensions };
46
42
  }
47
43
  }
48
- exports.DebuggingGraphqlRunner = DebuggingGraphqlRunner;
@@ -1,38 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isFedrampEnv = exports.getEnvironmentConfig = exports.CDNEnvironments = exports.Environments = exports.isPathBasedRoutingEnabled = exports.isBluebirdEnabled = exports.STAGING_PRIVATE_GRAPHQL_GATEWAY = exports.getGraphqlGateway = exports.DEFAULT_GRAPHQL_GATEWAY = void 0;
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
- exports.getGraphqlGateway = getGraphqlGateway;
9
- exports.STAGING_PRIVATE_GRAPHQL_GATEWAY = 'https://api-private.stg.atlassian.com/graphql';
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
- exports.isBluebirdEnabled = isBluebirdEnabled;
14
- const isPathBasedRoutingEnabled = () => {
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
- exports.isPathBasedRoutingEnabled = isPathBasedRoutingEnabled;
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 || (exports.Environments = 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 || (exports.CDNEnvironments = CDNEnvironments = {}));
34
- const getEnvironmentConfig = (envOptions = Environments) => {
35
- const graphqlGateway = (0, exports.getGraphqlGateway)();
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
- exports.getEnvironmentConfig = getEnvironmentConfig;
51
- const isFedrampEnv = () => {
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 mutation_aware_graphql_client_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
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,