@forge/cli
12.17.012.18.0-next.8
out/installations/graphql-client.js~
out/installations/graphql-client.jsModified+15−1
Index: package/out/installations/graphql-client.js
===================================================================
--- package/out/installations/graphql-client.js
+++ package/out/installations/graphql-client.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.InstallationsGraphqlClient = exports.InstallationNotFoundError = exports.MissingAppUninstallTask = exports.MissingAppEnvironmentError = exports.MissingAppError = exports.InstallationRequestFailedError = exports.MissingTaskIdError = exports.EnvironmentNotFoundError = exports.UpgradeError = exports.MissingAppManagedPermsError = exports.HasVersionDecreaseError = exports.DecoupledStateNotEnabledError = exports.RollingReleaseValidationFailedError = exports.InstallationError = exports.AlreadyInstalledError = exports.PermissionDeniedError = exports.ALREADY_UPGRADED_CODE = exports.UNINSTALLATION_EVENT_POLL_INTERVAL = void 0;
+exports.InstallationsGraphqlClient = exports.InstallationNotFoundError = exports.MissingAppUninstallTask = exports.MissingAppEnvironmentError = exports.MissingAppError = exports.InstallationRequestFailedError = exports.MissingTaskIdError = exports.EnvironmentNotFoundError = exports.UpgradeError = exports.MissingAppManagedPermsError = exports.HasVersionDecreaseError = exports.DecoupledStateNotEnabledError = exports.RollingReleaseValidationFailedError = exports.InstallationError = exports.InstallationLimitReachedError = exports.AlreadyInstalledError = exports.PermissionDeniedError = exports.ALREADY_UPGRADED_CODE = exports.UNINSTALLATION_EVENT_POLL_INTERVAL = void 0;
const exponential_backoff_1 = require("exponential-backoff");
const ari_1 = require("@forge/util/packages/ari");
const cli_shared_1 = require("@forge/cli-shared");
const egress_1 = require("@forge/egress");
@@ -20,8 +20,9 @@
ADDED_STORAGE_SCOPE_ROLLING_RELEASE_CODE: 'ADDED_STORAGE_SCOPE_ROLLING_RELEASE'
};
exports.ALREADY_UPGRADED_CODE = 'INSTALLATION_ALREADY_UPGRADED';
const ALREADY_INSTALLED_CODE = 'APP_ALREADY_INSTALLED';
+const INSTALLATION_LIMIT_REACHED_CODE = 'INSTALLATION_LIMIT_REACHED';
const PERMISSION_DENIED = 'PERMISSION_DENIED';
class PermissionDeniedError extends cli_shared_1.GraphQlMutationError {
constructor(requestId = 'unknown', appId = 'unknown', statusCode) {
super(cli_shared_1.Text.install.error.permissionsDeniedInstructions(requestId, appId), {
@@ -46,8 +47,18 @@
this.environmentType = environmentType;
}
}
exports.AlreadyInstalledError = AlreadyInstalledError;
+class InstallationLimitReachedError extends cli_shared_1.GraphQlMutationError {
+ constructor(requestId, statusCode) {
+ super(cli_shared_1.Text.install.error.installationLimitReached, {
+ requestId,
+ code: INSTALLATION_LIMIT_REACHED_CODE,
+ statusCode
+ });
+ }
+}
+exports.InstallationLimitReachedError = InstallationLimitReachedError;
class InstallationError extends cli_shared_1.GraphQlMutationError {
constructor(message, { requestId, code, statusCode }) {
super(cli_shared_1.Text.install.error.serverSideInstallationError(message), { requestId, code, statusCode });
}
@@ -328,8 +339,11 @@
const code = error?.extensions?.errorType ?? undefined;
if (code === ALREADY_INSTALLED_CODE) {
throw new AlreadyInstalledError(requestId, statusCode ?? undefined, hasMajorVersion, environment, environmentType);
}
+ if (code === INSTALLATION_LIMIT_REACHED_CODE) {
+ throw new InstallationLimitReachedError(requestId, statusCode ?? undefined);
+ }
if (error && requestId) {
error.message = cli_shared_1.Text.install.error.appendRequestIdToErrorMessage(error.message ?? undefined, requestId);
}
throw new InstallationRequestFailedError(isUserError, code, (0, harmonized_app_installation_errors_1.expandHarmonizedAppInstallationError)(code, error?.message ?? undefined), requestId);