@forge/cli-shared 5.0.0-next.5 → 5.0.0-next.7

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 (49) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/out/app-logs/graphql-client.js +9 -2
  3. package/out/app-logs/view-logs.js +4 -0
  4. package/out/apps/app-config.js +4 -1
  5. package/out/apps/create-an-app.js +3 -0
  6. package/out/apps/create-app-graphql-client.js +1 -0
  7. package/out/apps/get-app-owner.js +2 -0
  8. package/out/apps/package-installer.js +1 -0
  9. package/out/apps/register-app.js +8 -1
  10. package/out/apps/template.js +5 -0
  11. package/out/auth/personal/credential-store.js +7 -2
  12. package/out/auth/personal/login.js +8 -2
  13. package/out/auth/personal/logout.js +1 -0
  14. package/out/auth/personal/me-graphql-client.js +2 -0
  15. package/out/auth/personal/token-authenticator.js +1 -0
  16. package/out/cache/cached-conf.js +1 -0
  17. package/out/config/config-file-section-reader.js +4 -0
  18. package/out/config/config-file-section-writer.js +2 -0
  19. package/out/config/config-file.d.ts +2 -2
  20. package/out/config/config-file.d.ts.map +1 -1
  21. package/out/config/config-file.js +48 -55
  22. package/out/config/config-section.js +1 -0
  23. package/out/file-system/file-system-reader.js +2 -2
  24. package/out/graphql/app-environment-graphql-client.js +1 -0
  25. package/out/graphql/app-oauth-client-id-graphql-client.js +1 -0
  26. package/out/graphql/debugging-graphql-runner.js +3 -0
  27. package/out/graphql/get-mutation-error.js +4 -5
  28. package/out/graphql/graphql-types.d.ts +178 -28
  29. package/out/graphql/graphql-types.d.ts.map +1 -1
  30. package/out/graphql/graphql-types.js +52 -7
  31. package/out/graphql/minimal-graphql-runner.js +30 -22
  32. package/out/graphql/mutation-aware-graphql-client.js +14 -10
  33. package/out/http-client/feedback-post-client.js +1 -3
  34. package/out/http-client/file-uploader.js +1 -0
  35. package/out/http-client/global-edge-http-client.js +1 -0
  36. package/out/http-client/trace.js +1 -2
  37. package/out/runtimes/helper.js +1 -1
  38. package/out/service/bridge-script-service.js +1 -0
  39. package/out/service/feature-flag-service.js +51 -48
  40. package/out/service/iframe-resizer-script-service.js +1 -0
  41. package/out/shared/cli-details.js +2 -2
  42. package/out/shared/error-handling.js +5 -3
  43. package/out/shared/product.js +2 -4
  44. package/out/shared/read-app-config-files.js +7 -5
  45. package/out/shared/validate.js +1 -1
  46. package/out/ui/command-line-ui.js +14 -8
  47. package/out/ui/multiple-table-prompt.js +1 -1
  48. package/out/ui/table-prompt.js +8 -1
  49. package/package.json +2 -2
@@ -20,22 +20,25 @@ var ProgressLogType;
20
20
  ProgressLogType[ProgressLogType["other"] = 2] = "other";
21
21
  })(ProgressLogType || (ProgressLogType = {}));
22
22
  class CommandLineUI {
23
+ verbose;
24
+ logger;
25
+ spinner;
26
+ promptInternal;
27
+ insideProgress = false;
28
+ addedProgressPadding = false;
23
29
  constructor(verbose, spinner, logger) {
24
30
  this.verbose = verbose;
25
- this.insideProgress = false;
26
- this.addedProgressPadding = false;
27
31
  this.spinner = spinner || (0, ora_1.default)({ discardStdin: false });
28
32
  this.logger = logger || console;
29
33
  this.promptInternal = inquirer_1.default.createPromptModule({ skipTTYChecks: false });
30
34
  this.registerCustomUIElements();
31
35
  }
32
36
  async prompt(questions, initialAnswers) {
33
- var _a;
34
37
  try {
35
38
  return await this.promptInternal(questions, initialAnswers);
36
39
  }
37
40
  catch (e) {
38
- throw new shared_1.UIPromptError(e.message, (_a = e.isTtyError) !== null && _a !== void 0 ? _a : false);
41
+ throw new shared_1.UIPromptError(e.message, e.isTtyError ?? false);
39
42
  }
40
43
  }
41
44
  get traceEnabled() {
@@ -159,7 +162,7 @@ class CommandLineUI {
159
162
  return this.promptForString(message, true);
160
163
  }
161
164
  async promptForList(message, choices, config) {
162
- const formattedChoices = (config === null || config === void 0 ? void 0 : config.format) ? choices.map((choice) => { var _a; return (_a = config === null || config === void 0 ? void 0 : config.format) === null || _a === void 0 ? void 0 : _a.call(config, choice); }) : choices;
165
+ const formattedChoices = config?.format ? choices.map((choice) => config?.format?.(choice)) : choices;
163
166
  const { choice } = await this.prompt([
164
167
  {
165
168
  type: 'list',
@@ -168,7 +171,7 @@ class CommandLineUI {
168
171
  message
169
172
  }
170
173
  ]);
171
- const formattedChoice = (config === null || config === void 0 ? void 0 : config.format) ? choices[formattedChoices.indexOf(choice)] : choice;
174
+ const formattedChoice = config?.format ? choices[formattedChoices.indexOf(choice)] : choice;
172
175
  return formattedChoice;
173
176
  }
174
177
  async promptForTable(message, infoMessage, columns, choices) {
@@ -230,13 +233,16 @@ class CommandLineUI {
230
233
  return formattedValue !== prevFormattedValue;
231
234
  }
232
235
  logTable(head, data, { format, groupRows }) {
233
- const table = new cli_table3_1.default(Object.assign(Object.assign({}, log_color_1.TableStyle.default), { head: head.map(([, heading]) => heading) }));
236
+ const table = new cli_table3_1.default({
237
+ ...log_color_1.TableStyle.default,
238
+ head: head.map(([, heading]) => heading)
239
+ });
234
240
  if (data) {
235
241
  const rowSpanByKey = {};
236
242
  for (let i = data.length - 1; i >= 0; i--) {
237
243
  const tableRow = [];
238
244
  head.forEach(([key]) => {
239
- rowSpanByKey[key] || (rowSpanByKey[key] = 1);
245
+ rowSpanByKey[key] ||= 1;
240
246
  const row = data[i];
241
247
  const value = row[key];
242
248
  const formattedValue = this.formatTableValue(key, value, format);
@@ -25,9 +25,9 @@ const getRowFormatFn = (isDone, isHover, isSelected) => {
25
25
  };
26
26
  exports.getRowFormatFn = getRowFormatFn;
27
27
  class MultipleChoiceTablePrompt extends table_prompt_1.TablePrompt {
28
+ selectedIndexes = new Set();
28
29
  constructor(questions, readline, answers) {
29
30
  super(questions, readline, answers);
30
- this.selectedIndexes = new Set();
31
31
  }
32
32
  handleSpaceKey({ pointer, hasMultipleChoices }) {
33
33
  if (hasMultipleChoices) {
@@ -8,9 +8,16 @@ const readline_1 = tslib_1.__importDefault(require("inquirer/lib/utils/readline"
8
8
  const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
9
9
  const text_1 = require("./text");
10
10
  class TablePrompt extends base_1.default {
11
+ done;
12
+ columns;
13
+ rows;
14
+ promptMessage;
15
+ infoMessage;
16
+ pointer = 1;
17
+ options;
18
+ hasMultipleChoices;
11
19
  constructor(questions, readline, answers) {
12
20
  super(questions, readline, answers);
13
- this.pointer = 1;
14
21
  this.options = this.opt;
15
22
  this.promptMessage = text_1.Text.customPrompts.table.promptMessage(this.options.message);
16
23
  this.infoMessage = this.options.infoMessage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/cli-shared",
3
- "version": "5.0.0-next.5",
3
+ "version": "5.0.0-next.7",
4
4
  "description": "Common functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -12,7 +12,7 @@
12
12
  "generate-graphql-types": "graphql-codegen --config src/graphql/codegen.yml"
13
13
  },
14
14
  "dependencies": {
15
- "@forge/manifest": "7.3.0-next.4",
15
+ "@forge/manifest": "7.3.0-next.6",
16
16
  "@forge/util": "1.4.3",
17
17
  "@sentry/node": "7.100.1",
18
18
  "adm-zip": "^0.5.10",