@cto.ai/ops
Version:
π» CTO.ai - The CLI built for Teams π
505 lines (504 loc) β’ 27.4 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpAlreadyBelongsToTeam = exports.InvalidRemoveOpFormat = exports.IncompleteOpsYml = exports.UnauthorizedtoAccessOp = exports.InvalidPipelineJobNameOpsYml = exports.InvalidOpName = exports.CannotDeleteNotFoundOp = exports.CannotDeleteOp = exports.TokenExpiredError = exports.SSOError = exports.YamlPortError = exports.SignOutError = exports.AlreadySignedOut = exports.ImagePullError = exports.ImagePushError = exports.ImageTagError = exports.SignUpError = exports.ResetTokenError = exports.NoEmailForReset = exports.SignInError = exports.ImageNotFoundError = exports.InvalidStepsFound = exports.RunningJobException = exports.NoOpsFound = exports.NoLocalOpsOrPipelinesFound = exports.NoLocalOpsOrWorkflowsFound = exports.DockerPublishNoImageFound = exports.NoResultsFoundForDeletion = exports.MissingRequiredArgument = exports.InvalidOpVersionFormat = exports.InvalidInputCharacter = exports.InviteCodeInvalid = exports.InviteSendingInvite = exports.PermissionsError = exports.AnalyticsError = exports.APIError = exports.CouldNotGetLatestVersion = exports.InvalidTeamNameFormat = exports.CouldNotMakeDir = exports.CouldNotGetRegistryToken = exports.CouldNotInitializeOp = exports.InvalidWorkflowStep = exports.CouldNotCreateWorkflow = exports.CouldNotCreateOp = exports.UserUnauthorized = exports.CopyTemplateFilesError = exports.EnumeratingLangsError = exports.ConfigError = exports.DockerBuildImageError = exports.FileNotFoundError = void 0;
exports.ServiceRequired = exports.NoDomainConfigured = exports.NoOpsToBuildFound = exports.EmptyListError = exports.GenerateTokenFailed = exports.DuplicateYamlPortError = exports.AllocatedYamlPortError = exports.MissingYamlPortError = exports.UnableToLeaveTeamError = exports.FailedToRemoveMemberFromTeam = exports.NoMembersFound = exports.NoMemberFound = exports.NoSecretFound = exports.SetSecretsProvider = exports.ValueFileError = exports.NoSecretsOnTeam = exports.NoSecretsProviderFound = exports.SecretsProviderFound = exports.SecretNotFound = exports.InvalidSecretVault = exports.InvalidSecretToken = exports.RegisterSecretsProvider = exports.TeamUnauthorized = exports.NoTeamFound = exports.NeedsPaymentMethod = exports.VersionIsTaken = exports.OpAlreadyAdded = exports.OpNotFoundOpsAdd = void 0;
const tslib_1 = require("tslib");
const cli_sdk_1 = require("@cto.ai/cli-sdk");
const errorSource_1 = require("./../constants/errorSource");
const env_1 = require("./../constants/env");
const ErrorTemplate_1 = require("./../errors/ErrorTemplate");
const utils_1 = require("./../utils");
const debug_1 = tslib_1.__importDefault(require("debug"));
const debug = (0, debug_1.default)('ops:CustomErrors');
const expectedSource = {
source: errorSource_1.errorSource.EXPECTED,
};
const { actionBlue, white, multiOrange, dim } = cli_sdk_1.ux.colors;
const problemContinues = `If the problem continues please contact us at: ${actionBlue(env_1.INTERCOM_EMAIL)}`;
const tryAgainOrContact = `Please try again or contact ${actionBlue(env_1.INTERCOM_EMAIL)} and we'll do our best to help.`;
class FileNotFoundError extends ErrorTemplate_1.ErrorTemplate {
constructor(err, path, file) {
super(white(`π€ Looks like the file ${actionBlue(file)} wasn't found in path:\n ${actionBlue(path)}\n Please verify it exists and try again.`), err, expectedSource);
}
}
exports.FileNotFoundError = FileNotFoundError;
class DockerBuildImageError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π€ Looks like there was an error when building your image.\n Please check your Dockerfile and try again.'), err, expectedSource);
}
}
exports.DockerBuildImageError = DockerBuildImageError;
class ConfigError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`βοΈUh-oh, we experienced a problem.\n Please try signing out and back in again.\n ${problemContinues}`), err, expectedSource);
}
}
exports.ConfigError = ConfigError;
class EnumeratingLangsError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`βWe couldn't enumerate the available templates.\n Your Ops CLI installation may have been corrupted.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.EnumeratingLangsError = EnumeratingLangsError;
class CopyTemplateFilesError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`βWe couldn't copy the required files.\n Please check your directory permissions.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.CopyTemplateFilesError = CopyTemplateFilesError;
class UserUnauthorized extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white("π€ You don't have permissions for that action. Please try again."), err, expectedSource);
}
}
exports.UserUnauthorized = UserUnauthorized;
class CouldNotCreateOp extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Uh-oh, this version of the workflow was already published, please try again with a new version.'), err, expectedSource);
}
}
exports.CouldNotCreateOp = CouldNotCreateOp;
class CouldNotCreateWorkflow extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Uh-oh, this version of the workflow was already published, please try again with a new version.'), err, expectedSource);
}
}
exports.CouldNotCreateWorkflow = CouldNotCreateWorkflow;
class InvalidWorkflowStep extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Uh-oh, one of the steps in your workflow is referencing an invalid workflow.\n Please make sure all steps are referencing workflows you have access to.'), err, expectedSource);
}
}
exports.InvalidWorkflowStep = InvalidWorkflowStep;
class CouldNotInitializeOp extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`βοΈLooks like a problem occurred initializing your workflow.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.CouldNotInitializeOp = CouldNotInitializeOp;
class CouldNotGetRegistryToken extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Call to registry/token failed, most likely due to invalid access token.'), err, expectedSource);
}
}
exports.CouldNotGetRegistryToken = CouldNotGetRegistryToken;
class CouldNotMakeDir extends ErrorTemplate_1.ErrorTemplate {
constructor(err, path = '') {
super(white(`π
Looks like we weren't able to create a config directory at:\n ${actionBlue(path)}\n Please check your permissions and try again.`), err, expectedSource);
}
}
exports.CouldNotMakeDir = CouldNotMakeDir;
class InvalidTeamNameFormat extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`β Sorry, that's an invalid team name. \n β Team names may contain only letters (case-sensitive), numbers, dashes (-), and underscores (_).`), err, {
source: errorSource_1.errorSource.EXPECTED,
exit: false,
});
}
}
exports.InvalidTeamNameFormat = InvalidTeamNameFormat;
class CouldNotGetLatestVersion extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super('Call to check version failed, most likely due to internet connection.', err, {
source: errorSource_1.errorSource.EXPECTED,
exit: false,
});
}
}
exports.CouldNotGetLatestVersion = CouldNotGetLatestVersion;
class APIError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`βοΈ Looks like an API error occurred.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.APIError = APIError;
class AnalyticsError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super('Analytics error occurred', err, { exit: false });
}
}
exports.AnalyticsError = AnalyticsError;
class PermissionsError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π€ Uh-oh! You don't have permission to perform this action.\n Please review your system user permissions and try again.`), err, expectedSource);
}
}
exports.PermissionsError = PermissionsError;
class InviteSendingInvite extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Uh-oh, the invite failed to send. Please try again.'), err, expectedSource);
}
}
exports.InviteSendingInvite = InviteSendingInvite;
class InviteCodeInvalid extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white("π
Uh-oh, the invite code doesn't seem to be valid. Please check the code and try again."), err, expectedSource);
}
}
exports.InviteCodeInvalid = InviteCodeInvalid;
class InvalidInputCharacter extends ErrorTemplate_1.ErrorTemplate {
constructor(fieldName) {
super(white(`β The ${fieldName} can only contain numbers, letters, -, or _'.`), undefined, expectedSource);
}
}
exports.InvalidInputCharacter = InvalidInputCharacter;
class InvalidOpVersionFormat extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('β Sorry, version is required and can only contain letters, digits, underscores, \n periods and dashes and must start and end with a letter or a digit'), undefined, expectedSource);
}
}
exports.InvalidOpVersionFormat = InvalidOpVersionFormat;
class MissingRequiredArgument extends ErrorTemplate_1.ErrorTemplate {
constructor(command) {
super(white(`β This command requires an argument. Run ${(0, utils_1.terminalText)(`${command} --help`)} to learn more.`), undefined, expectedSource);
}
}
exports.MissingRequiredArgument = MissingRequiredArgument;
class NoResultsFoundForDeletion extends ErrorTemplate_1.ErrorTemplate {
constructor(opOrWorkflow) {
super(white(`π€ We couldn't find any matches for ${actionBlue(opOrWorkflow)}.\n Please check the name and try again.`), undefined, expectedSource);
}
}
exports.NoResultsFoundForDeletion = NoResultsFoundForDeletion;
class DockerPublishNoImageFound extends ErrorTemplate_1.ErrorTemplate {
constructor(opName, teamName) {
super(white(`β We couldn't find an image for ${actionBlue(opName)}.\n βοΈ Please build this workflow for ${actionBlue(`${teamName}`)}: ${(0, utils_1.terminalText)(`ops build ${opName}`)}`), undefined, expectedSource);
}
}
exports.DockerPublishNoImageFound = DockerPublishNoImageFound;
class NoLocalOpsOrWorkflowsFound extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π© We couldn't find any workflows in the ops.yml!`), undefined, expectedSource);
}
}
exports.NoLocalOpsOrWorkflowsFound = NoLocalOpsOrWorkflowsFound;
class NoLocalOpsOrPipelinesFound extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π© We couldn't find any pipelines in the ops.yml!`), undefined, expectedSource);
}
}
exports.NoLocalOpsOrPipelinesFound = NoLocalOpsOrPipelinesFound;
class NoOpsFound extends ErrorTemplate_1.ErrorTemplate {
constructor(opName, teamName) {
let message = `π© We couldn't find any workflows with the name ${cli_sdk_1.ux.colors.blueBright(opName)}`;
if (teamName) {
message += ` in the team ${cli_sdk_1.ux.colors.cyan(teamName)}.`;
}
super(white(message), undefined, expectedSource);
}
}
exports.NoOpsFound = NoOpsFound;
class RunningJobException extends ErrorTemplate_1.ErrorTemplate {
constructor(opName) {
const message = `β Sorry, ${opName} cannot run outside of its parent pipeline.`;
super(white(message), undefined, expectedSource);
}
}
exports.RunningJobException = RunningJobException;
class InvalidStepsFound extends ErrorTemplate_1.ErrorTemplate {
constructor(step) {
super(white(`π© Workflow step: ${step} is invalid!`), undefined, expectedSource);
}
}
exports.InvalidStepsFound = InvalidStepsFound;
class ImageNotFoundError extends ErrorTemplate_1.ErrorTemplate {
constructor(imageName) {
super(white(`π€ We couldn't find an image with the name ${actionBlue(imageName)}.\n Please select a different one and try again.`), undefined, expectedSource);
}
}
exports.ImageNotFoundError = ImageNotFoundError;
class SignInError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π€ Sorry, we couldnβt find an account with that email or password.\n Forgot your password? Run ${(0, utils_1.terminalText)('ops account:reset')}`), err, expectedSource);
}
}
exports.SignInError = SignInError;
class NoEmailForReset extends ErrorTemplate_1.ErrorTemplate {
constructor(err, email) {
super(white(`π Uh-oh, we couldn't find any user associated with ${actionBlue(email)}\n Please Check your email and try again.`), err, expectedSource);
}
}
exports.NoEmailForReset = NoEmailForReset;
class ResetTokenError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π
Looks like there's an issue with that token.\n Please request a new token by running ${(0, utils_1.terminalText)('ops account:reset')}`), err, expectedSource);
}
}
exports.ResetTokenError = ResetTokenError;
class SignUpError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π
We couldn't sign you up at this point in time.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.SignUpError = SignUpError;
class ImageTagError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`βοΈ Oops, seems like there was a problem tagging the image.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.ImageTagError = ImageTagError;
class ImagePushError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`β Oops, seems like there was a problem pushing that image to the registry!\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.ImagePushError = ImagePushError;
class ImagePullError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`β Oops, seems like there was a problem pulling that image from the registry!\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.ImagePullError = ImagePullError;
class AlreadySignedOut extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π€·ββοΈ Looks like you are already signed out.\n Run ${(0, utils_1.terminalText)('ops account:signin')} to sign back into your account.`), undefined, expectedSource);
}
}
exports.AlreadySignedOut = AlreadySignedOut;
class SignOutError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π
Uh-oh, we weren't able to sign out up at this point in time.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.SignOutError = SignOutError;
class YamlPortError extends ErrorTemplate_1.ErrorTemplate {
constructor(badPort) {
super(white(`π€ We're having trouble parsing the port: ${badPort}.\n ${dim('Please enter with the format')} ${actionBlue('{HostPort}:{InternalPort}')}${dim('. For example:')} ${actionBlue('3000:3000')}`), undefined, expectedSource);
}
}
exports.YamlPortError = YamlPortError;
class SSOError extends ErrorTemplate_1.ErrorTemplate {
constructor(message) {
message && debug(message);
super(white(`π€ We're having trouble signing you in. Please try running ${actionBlue('$ ops account:signin')} again!`), undefined, expectedSource);
}
}
exports.SSOError = SSOError;
class TokenExpiredError extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`\nβ οΈ Sorry your session has expired. \n\n π¨βπ» You can sign in with ${cli_sdk_1.ux.colors.green('$')} ${cli_sdk_1.ux.colors.callOutCyan('ops account:signin')}`), undefined, expectedSource);
}
}
exports.TokenExpiredError = TokenExpiredError;
class CannotDeleteOp extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`β Sorry, we cannot delete the workflow. \n\n Please verify that it is not being used in some other workflow.\n`), err, expectedSource);
}
}
exports.CannotDeleteOp = CannotDeleteOp;
class CannotDeleteNotFoundOp extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`β Sorry, we cannot delete the workflow.\n`), err, expectedSource);
}
}
exports.CannotDeleteNotFoundOp = CannotDeleteNotFoundOp;
class InvalidOpName extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`β Sorry, we cannot find that workflow. Please enter a workflow with one of the following format:\n- ops run ${cli_sdk_1.ux.colors.bold('@teamName')}/${cli_sdk_1.ux.colors.cyan('opName')}:${cli_sdk_1.ux.colors.reset('version')}\n- ops run ${cli_sdk_1.ux.colors.bold('@teamName')}/${cli_sdk_1.ux.colors.cyan('opName')} ${cli_sdk_1.ux.colors.dim('(for the latest version of the workflow)')}\n- ops run ${cli_sdk_1.ux.colors.cyan('opName')} ${cli_sdk_1.ux.colors.dim('(for workflows you have in your team, or a folder in your current working directory)')}`), undefined, expectedSource);
}
}
exports.InvalidOpName = InvalidOpName;
class InvalidPipelineJobNameOpsYml extends ErrorTemplate_1.ErrorTemplate {
constructor(message) {
super(white(`β Sorry, one or more job names duplicate the pipeline name in your ops.yml. Job names must be distinct from pipeline names. ${message}`), undefined, expectedSource);
}
}
exports.InvalidPipelineJobNameOpsYml = InvalidPipelineJobNameOpsYml;
class UnauthorizedtoAccessOp extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`β Oops, seems like you do not have access to run this workflow!`), err, expectedSource);
}
}
exports.UnauthorizedtoAccessOp = UnauthorizedtoAccessOp;
class IncompleteOpsYml extends ErrorTemplate_1.ErrorTemplate {
constructor(message) {
super(white(`β Sorry, we have difficulty parsing your ops.yml. ${message}`), undefined, expectedSource);
}
}
exports.IncompleteOpsYml = IncompleteOpsYml;
class InvalidRemoveOpFormat extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`β Sorry, please provide workflow you want to remove in a valid format. E.g. \n ${(0, utils_1.terminalText)('ops remove my-workflow:0.1.0')} - for your own workflows \n `), undefined, expectedSource);
}
}
exports.InvalidRemoveOpFormat = InvalidRemoveOpFormat;
class OpAlreadyBelongsToTeam extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`β That's odd. It seems like you are trying to add a workflow that belongs to your team.`), undefined, expectedSource);
}
}
exports.OpAlreadyBelongsToTeam = OpAlreadyBelongsToTeam;
class OpNotFoundOpsAdd extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`β That's odd. It seems like you are trying to add a workflow that does not exist.`), undefined, expectedSource);
}
}
exports.OpNotFoundOpsAdd = OpNotFoundOpsAdd;
class OpAlreadyAdded extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`β That's odd. It seems like you are trying to add a workflow that's already added to your team.`), undefined, expectedSource);
}
}
exports.OpAlreadyAdded = OpAlreadyAdded;
class VersionIsTaken extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π€ It seems like the version of the workflow that you are trying to publish is already taken. Please try again with a different version name.`), undefined, expectedSource);
}
}
exports.VersionIsTaken = VersionIsTaken;
class NeedsPaymentMethod extends ErrorTemplate_1.ErrorTemplate {
constructor(access, wwwHost) {
const msg_new = `β${cli_sdk_1.ux.colors.primary('You have published')}` +
` ${cli_sdk_1.ux.colors.errorRed(`${access.quantity}/${access.maxFreeUnits}`)}` +
` ${cli_sdk_1.ux.colors.primary(`free ${access.workflowType} available for this team.`)}` +
` \n\n Please add a billing method to this team in order to publish more: ` +
` \n ${cli_sdk_1.ux.url(`${wwwHost}/home/teams/${access.teamName}/checkout`, `${wwwHost}/home/teams/${access.teamName}/checkout`)} \n`;
super(msg_new, undefined, expectedSource);
}
}
exports.NeedsPaymentMethod = NeedsPaymentMethod;
class NoTeamFound extends ErrorTemplate_1.ErrorTemplate {
constructor(teamName) {
super(white(`π€ Sorry, we couldn't find a team with name ${cli_sdk_1.ux.colors.cyan(teamName)}.`), undefined, expectedSource);
}
}
exports.NoTeamFound = NoTeamFound;
class TeamUnauthorized extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π€ Your team lacks the permission for that action. Please try again.'), err, expectedSource);
}
}
exports.TeamUnauthorized = TeamUnauthorized;
class RegisterSecretsProvider extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Oops! We were not able to register the secrets provider'), err, expectedSource);
}
}
exports.RegisterSecretsProvider = RegisterSecretsProvider;
class InvalidSecretToken extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π
It looks like this token is not valid with the specified vault`), err, expectedSource);
}
}
exports.InvalidSecretToken = InvalidSecretToken;
class InvalidSecretVault extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π€ It appears the vault URL that was specified is invalid`), err, expectedSource);
}
}
exports.InvalidSecretVault = InvalidSecretVault;
class SecretNotFound extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π€ It appears the secret you are trying to delete cannot be found`), err, expectedSource);
}
}
exports.SecretNotFound = SecretNotFound;
class SecretsProviderFound extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π
It looks like you already got a ${cli_sdk_1.ux.colors.bold('secrets provider')} for this team. You can unregister a secrets provider using ${(0, utils_1.terminalText)('ops secrets:unregister')}.`), undefined, expectedSource);
}
}
exports.SecretsProviderFound = SecretsProviderFound;
class NoSecretsProviderFound extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π
Oops! We are not able to find a secrets provider for this team. You can register a secrets provider using ${(0, utils_1.terminalText)('ops secrets:register')}.`), err, expectedSource);
}
}
exports.NoSecretsProviderFound = NoSecretsProviderFound;
class NoSecretsOnTeam extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π€ There does not appear to be any secrets stored for your current team`), err, expectedSource);
}
}
exports.NoSecretsOnTeam = NoSecretsOnTeam;
class ValueFileError extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white(`π€ There was an error loading the value from the given filename.
Please ensure that the file exists and that you can read it.`), err, expectedSource);
}
}
exports.ValueFileError = ValueFileError;
class SetSecretsProvider extends ErrorTemplate_1.ErrorTemplate {
constructor(err) {
super(white('π
Oops! we were not able to successfully set the secret'), err, expectedSource);
}
}
exports.SetSecretsProvider = SetSecretsProvider;
class NoSecretFound extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π Sorry, we weren't able to select the secret key. ${tryAgainOrContact}`), undefined, expectedSource);
}
}
exports.NoSecretFound = NoSecretFound;
class NoMemberFound extends ErrorTemplate_1.ErrorTemplate {
constructor(username, teamname) {
super(white(`π Sorry, we weren't able to find member ${actionBlue(username)} on team ${actionBlue(teamname)}.\n You can run ${(0, utils_1.terminalText)('ops team:info')} to see members of your team.`), undefined, expectedSource);
}
}
exports.NoMemberFound = NoMemberFound;
class NoMembersFound extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`π Sorry, it looks like you are the only member of this team.`), undefined, expectedSource);
}
}
exports.NoMembersFound = NoMembersFound;
class FailedToRemoveMemberFromTeam extends ErrorTemplate_1.ErrorTemplate {
constructor(err, member, team) {
super(white(`π
Oops! We were not able to successfully remove ${actionBlue(member)} from ${actionBlue(team)}.\n ${tryAgainOrContact}`), err, expectedSource);
}
}
exports.FailedToRemoveMemberFromTeam = FailedToRemoveMemberFromTeam;
class UnableToLeaveTeamError extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white("Sorry, team owners can't leave their team"), undefined, expectedSource);
}
}
exports.UnableToLeaveTeamError = UnableToLeaveTeamError;
class MissingYamlPortError extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('π€ Looks like the port configurations are missing. Please check your ops.yml configuration and try again.'), undefined, expectedSource);
}
}
exports.MissingYamlPortError = MissingYamlPortError;
class AllocatedYamlPortError extends ErrorTemplate_1.ErrorTemplate {
constructor(badPorts) {
super(white(`π€ Looks like port(s) ${cli_sdk_1.ux.colors.bold(badPorts)} are already allocated. Please check your ops.yml configuration and try again.`), undefined, expectedSource);
}
}
exports.AllocatedYamlPortError = AllocatedYamlPortError;
class DuplicateYamlPortError extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('π€ Looks like there are duplicates in the port configuration. Please check your ops.yml configuration and try again.'), undefined, expectedSource);
}
}
exports.DuplicateYamlPortError = DuplicateYamlPortError;
class GenerateTokenFailed extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white(`This feature is currently in Alpha and requires credentials provided by CTO.ai. Please contact us (support@cto.ai) if you would like to join the Alpha test, or if your credentials are not working.`), undefined, expectedSource);
}
}
exports.GenerateTokenFailed = GenerateTokenFailed;
class EmptyListError extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('no options to pick from'), undefined, expectedSource);
}
}
exports.EmptyListError = EmptyListError;
class NoOpsToBuildFound extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('π
Oops! We were not able to find any workflows to build.'), undefined, expectedSource);
}
}
exports.NoOpsToBuildFound = NoOpsToBuildFound;
class NoDomainConfigured extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('Domain has not been configured in ops.yml'), undefined, expectedSource);
}
}
exports.NoDomainConfigured = NoDomainConfigured;
class ServiceRequired extends ErrorTemplate_1.ErrorTemplate {
constructor() {
super(white('This operation requires a service workflow'), undefined, expectedSource);
}
}
exports.ServiceRequired = ServiceRequired;