@forge/cli-shared

9.6.0-next.69.6.0-next.7
out/ui/text.js
~out/ui/text.jsModified
+12−4
Index: package/out/ui/text.js
===================================================================
--- package/out/ui/text.js
+++ package/out/ui/text.js
@@ -9,8 +9,9 @@
 const terminal_link_1 = tslib_1.__importDefault(require("terminal-link"));
 const graphql_types_1 = require("../graphql/graphql-types");
 const cli_details_1 = require("../shared/cli-details");
 const environment_1 = require("../shared/environment");
+const developer_console_1 = require("../shared/developer-console");
 const installations_1 = require("../shared/installations");
 const log_color_1 = require("./log-color");
 const log_symbols_1 = tslib_1.__importDefault(require("./log-symbols"));
 const ctrlC = 'Press Ctrl+C to cancel.';
@@ -352,9 +353,9 @@
                 void command;
                 return `${chalk_1.default.bold('Warning:')} Marketplace admin action required: Complete the ${buildTerminalLabeledLink('Developer Space setup', 'https://developer.atlassian.com/platform/forge/developer-space/create-developer-space/#who-can-create-a-developer-space')} to avoid ${buildTerminalLabeledLink('functionality limits', 'https://developer.atlassian.com/platform/forge/developer-space/create-developer-space/#developer-space-setup-and-app-limits')}.\n`;
             },
             developerSpaceSetupIncompleteLink: (developerSpaceId) => chalk_1.default.yellow(`Share this link with a Marketplace admin so they can finish setup:\n` +
-                `    - Developer Space: ${buildTerminalLink(`https://developer.atlassian.com/console/developer-space/${developerSpaceId}`)}`)
+                `    - Developer Space: ${buildTerminalLink((0, developer_console_1.getDevConsoleUrl)('developerSpace', developerSpaceId))}`)
         },
         terms: {
             agreement: 'Please review the following agreement before continuing:\n',
             checkbox: '[ ] By continuing, I agree to the Atlassian Developer Terms and the Privacy Policy. If any Forge app added to this Developer Space exceeds the free usage allowance, I agree to be billed for any excess usage based on the then-current price.',
@@ -419,8 +420,15 @@
                 .join(', ')}.\n\nUse ${forge('deploy')} to deploy your app to an environment.`
         },
         confirmQuestion: 'Are you sure you want to overwrite the existing app details?'
     },
+    console: {
+        cmd: {
+            desc: 'open your app in the developer console',
+            overviewLink: (url) => `Developer Console: ${buildTerminalLink(url)}`,
+            missingAppId: `Couldn't find an app id. Run this command from your app directory, or run ${forge('register')} to register the app first.`
+        }
+    },
     env: {
         option: `specify the environment (see your default environment by running ${forge('settings', 'list')})`,
         invalid: 'Invalid environment name',
         developmentOnly: (envKey) => `${(0, environment_1.environmentToOption)(envKey)} cannot be set as default environment. Only development environments can be used.`,
@@ -915,9 +923,9 @@
                 return `Deployed ${appName}${buildTagText} to the ${exports.Text.env.displayEnvironment(envKey, envType)} environment${approvalsText}.`;
             },
             distributePageLink: (appId) => `To install on a site that you're an admin of, run ${forge('install')}.\n` +
                 'To install on any other site, generate an installation link in the developer console and share it with the site admin: ' +
-                `https://developer.atlassian.com/console/myapps/${appId}/manage/distribution`
+                buildTerminalLink((0, developer_console_1.getDevConsoleUrl)('appDistribution', appId))
         },
         taskLint: {
             lintError: log_color_1.LogColor.error(`Error: The deploy failed due to errors in the app code. Fix the errors before rerunning ${forge('deploy')}, or run ${forge('deploy', '--no-verify')} to skip the linter.\n`),
             lintWarning: (numWarnings) => {
@@ -994,9 +1002,9 @@
                 buildTerminalLink(`https://developer.atlassian.com/platform/forge/developer-space/developer-space-apps/`),
             marketplaceApp: (developerSpaceId) => `Deployment blocked - This app's Developer Space setup is incomplete.\n\n` +
                 `Your Marketplace admin must complete the Developer Space setup to unblock deployment for this app and prevent further app limitations.\n\n` +
                 `What to do: Share this setup link with your Marketplace admin:\n` +
-                buildTerminalLink(`https://developer.atlassian.com/console/developer-space/${developerSpaceId}`)
+                buildTerminalLink((0, developer_console_1.getDevConsoleUrl)('developerSpace', developerSpaceId))
         },
         outdatedInstallations: `We've detected new scopes or egress URLs in your app.\n` +
             `Run ${forge('install', '--upgrade')} and restart your tunnel to put them into effect.`,
         postDeploymentChecksFailed: chalk_1.default.yellow(`We could not run some final checks, however your deployment still succeeded. Contact support if this issue persists.`),
@@ -1085,9 +1093,9 @@
             noDeploymentFound: (environment) => `Forge apps must be deployed before installation. Deploy your app by running ${forge('deploy', '-e', (0, environment_1.environmentToOption)(environment))}.`,
             permissionsDeniedInstructions: (requestId, appId) => `Insufficient permissions to install app (requestId: ${requestId})` +
                 '\n\nTo install the app on this site, generate an installation link ' +
                 'in the developer console and share it with the site admin: ' +
-                `https://developer.atlassian.com/console/myapps/${appId}/distribution`,
+                buildTerminalLink((0, developer_console_1.getDevConsoleUrl)('appDistribution', appId)),
             appendRequestIdToErrorMessage: (message, requestId) => `${message} For more help on this issue, please reach out to support (${buildTerminalLink('https://developer.atlassian.com/support')}) and provide them the following request ID: ${requestId}`,
             majorVersionNotFound: 'The major version you specified does not exist. Check the version number and try again.',
             installationLimitReached: 'Installation error: The target site already has the maximum number of apps installed. To install this app there, uninstall any unused apps first.',
             tooManyRequests: 'Too many requests',