import { StatusError } from './utils/errors.js'; import { Json } from './utils/json.js'; import './utils/results.js'; type KnownErrorJson = { code: string; message: string; details?: Json; }; type AbstractKnownErrorConstructor = (abstract new (...args: Args) => KnownError) & { constructorArgsFromJson: (json: KnownErrorJson) => Args; }; type KnownErrorConstructor = { new (...args: Args): SuperInstance & { constructorArgs: Args; }; errorCode: string; constructorArgsFromJson: (json: KnownErrorJson) => Args; isInstance: (error: unknown) => error is SuperInstance & { constructorArgs: Args; }; }; declare abstract class KnownError extends StatusError { readonly statusCode: number; readonly humanReadableMessage: string; readonly details?: Json | undefined; private readonly __stackKnownErrorBrand; name: string; constructor(statusCode: number, humanReadableMessage: string, details?: Json | undefined); static isKnownError(error: unknown): error is KnownError; getBody(): Uint8Array; getHeaders(): Record; toDescriptiveJson(): Json; get errorCode(): string; static constructorArgsFromJson(json: KnownErrorJson): ConstructorParameters; static fromJson(json: KnownErrorJson): KnownError; } declare const knownErrorConstructorErrorCodeSentinel: unique symbol; /** * Exists solely so that known errors are nominative types (ie. two KnownErrors with the same interface are not the same type) */ type KnownErrorBrand = { /** * Does not exist at runtime * * Must be an object because it may be true for multiple error codes (it's true for all parents) */ [knownErrorConstructorErrorCodeSentinel]: { [K in ErrorCode]: true; }; }; type KnownErrors = { [K in keyof typeof KnownErrors]: InstanceType; }; declare const KnownErrors: { CannotDeleteCurrentSession: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"CANNOT_DELETE_CURRENT_SESSION">, []> & { errorCode: "CANNOT_DELETE_CURRENT_SESSION"; }; UnsupportedError: KnownErrorConstructor, [originalErrorCode: string]> & { errorCode: "UNSUPPORTED_ERROR"; }; BodyParsingError: KnownErrorConstructor, [message: string]> & { errorCode: "BODY_PARSING_ERROR"; }; SchemaError: KnownErrorConstructor, [message: string]> & { errorCode: "SCHEMA_ERROR"; }; AllOverloadsFailed: KnownErrorConstructor, [overloadErrors: Json[]]> & { errorCode: "ALL_OVERLOADS_FAILED"; }; ProjectAuthenticationError: KnownErrorConstructor, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "PROJECT_AUTHENTICATION_ERROR"; }; PermissionIdAlreadyExists: KnownErrorConstructor, [permissionId: string]> & { errorCode: "PERMISSION_ID_ALREADY_EXISTS"; }; CliAuthError: KnownErrorConstructor, [message: string]> & { errorCode: "CLI_AUTH_ERROR"; }; CliAuthExpiredError: KnownErrorConstructor, [message?: string | undefined]> & { errorCode: "CLI_AUTH_EXPIRED_ERROR"; }; CliAuthUsedError: KnownErrorConstructor, [message?: string | undefined]> & { errorCode: "CLI_AUTH_USED_ERROR"; }; InvalidProjectAuthentication: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "INVALID_PROJECT_AUTHENTICATION"; }; ProjectKeyWithoutAccessType: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"PROJECT_KEY_WITHOUT_ACCESS_TYPE">, []> & { errorCode: "PROJECT_KEY_WITHOUT_ACCESS_TYPE"; }; InvalidAccessType: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TYPE">, [accessType: string]> & { errorCode: "INVALID_ACCESS_TYPE"; }; AccessTypeWithoutProjectId: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_WITHOUT_PROJECT_ID">, [accessType: "client" | "server" | "admin"]> & { errorCode: "ACCESS_TYPE_WITHOUT_PROJECT_ID"; }; AccessTypeRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_REQUIRED">, []> & { errorCode: "ACCESS_TYPE_REQUIRED"; }; CannotGetOwnUserWithoutUser: KnownErrorConstructor, []> & { errorCode: "CANNOT_GET_OWN_USER_WITHOUT_USER"; }; InsufficientAccessType: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INSUFFICIENT_ACCESS_TYPE">, [actualAccessType: "client" | "server" | "admin", allowedAccessTypes: ("client" | "server" | "admin")[]]> & { errorCode: "INSUFFICIENT_ACCESS_TYPE"; }; InvalidPublishableClientKey: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_PUBLISHABLE_CLIENT_KEY">, [projectId: string]> & { errorCode: "INVALID_PUBLISHABLE_CLIENT_KEY"; }; InvalidSecretServerKey: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_SECRET_SERVER_KEY">, [projectId: string]> & { errorCode: "INVALID_SECRET_SERVER_KEY"; }; InvalidSuperSecretAdminKey: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_SUPER_SECRET_ADMIN_KEY">, [projectId: string]> & { errorCode: "INVALID_SUPER_SECRET_ADMIN_KEY"; }; InvalidAdminAccessToken: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "INVALID_ADMIN_ACCESS_TOKEN"; }; UnparsableAdminAccessToken: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"UNPARSABLE_ADMIN_ACCESS_TOKEN">, []> & { errorCode: "UNPARSABLE_ADMIN_ACCESS_TOKEN"; }; AdminAccessTokenExpired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"ADMIN_ACCESS_TOKEN_EXPIRED">, [expiredAt: Date | undefined]> & { errorCode: "ADMIN_ACCESS_TOKEN_EXPIRED"; }; InvalidProjectForAdminAccessToken: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN">, []> & { errorCode: "INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN"; }; AdminAccessTokenIsNotAdmin: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ADMIN_ACCESS_TOKEN"> & KnownErrorBrand<"ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN">, []> & { errorCode: "ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN"; }; ProjectAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "PROJECT_AUTHENTICATION_REQUIRED"; }; ClientAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_AUTHENTICATION_REQUIRED">, []> & { errorCode: "CLIENT_AUTHENTICATION_REQUIRED"; }; ServerAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"SERVER_AUTHENTICATION_REQUIRED">, []> & { errorCode: "SERVER_AUTHENTICATION_REQUIRED"; }; ClientOrServerAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED">, []> & { errorCode: "CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED"; }; ClientOrAdminAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED">, []> & { errorCode: "CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED"; }; ClientOrServerOrAdminAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED">, []> & { errorCode: "CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED"; }; AdminAuthenticationRequired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROJECT_AUTHENTICATION_REQUIRED"> & KnownErrorBrand<"ADMIN_AUTHENTICATION_REQUIRED">, []> & { errorCode: "ADMIN_AUTHENTICATION_REQUIRED"; }; ExpectedInternalProject: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"EXPECTED_INTERNAL_PROJECT">, []> & { errorCode: "EXPECTED_INTERNAL_PROJECT"; }; SessionAuthenticationError: KnownErrorConstructor, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "SESSION_AUTHENTICATION_ERROR"; }; InvalidSessionAuthentication: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "INVALID_SESSION_AUTHENTICATION"; }; InvalidAccessToken: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN">, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "INVALID_ACCESS_TOKEN"; }; UnparsableAccessToken: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN"> & KnownErrorBrand<"UNPARSABLE_ACCESS_TOKEN">, []> & { errorCode: "UNPARSABLE_ACCESS_TOKEN"; }; AccessTokenExpired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN"> & KnownErrorBrand<"ACCESS_TOKEN_EXPIRED">, [Date | undefined]> & { errorCode: "ACCESS_TOKEN_EXPIRED"; }; InvalidProjectForAccessToken: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"INVALID_SESSION_AUTHENTICATION"> & KnownErrorBrand<"INVALID_ACCESS_TOKEN"> & KnownErrorBrand<"INVALID_PROJECT_FOR_ACCESS_TOKEN">, [expectedProjectId: string, actualProjectId: string]> & { errorCode: "INVALID_PROJECT_FOR_ACCESS_TOKEN"; }; RefreshTokenError: KnownErrorConstructor, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "REFRESH_TOKEN_ERROR"; }; ProviderRejected: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PROVIDER_REJECTED">, []> & { errorCode: "PROVIDER_REJECTED"; }; RefreshTokenNotFoundOrExpired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"REFRESH_TOKEN_NOT_FOUND_OR_EXPIRED">, []> & { errorCode: "REFRESH_TOKEN_NOT_FOUND_OR_EXPIRED"; }; UserWithEmailAlreadyExists: KnownErrorConstructor, [email: string]> & { errorCode: "USER_EMAIL_ALREADY_EXISTS"; }; EmailNotVerified: KnownErrorConstructor, []> & { errorCode: "EMAIL_NOT_VERIFIED"; }; UserIdDoesNotExist: KnownErrorConstructor, [userId: string]> & { errorCode: "USER_ID_DOES_NOT_EXIST"; }; UserNotFound: KnownErrorConstructor, []> & { errorCode: "USER_NOT_FOUND"; }; ApiKeyNotFound: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"API_KEY_NOT_FOUND">, []> & { errorCode: "API_KEY_NOT_FOUND"; }; PublicApiKeyCannotBeRevoked: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PUBLIC_API_KEY_CANNOT_BE_REVOKED">, []> & { errorCode: "PUBLIC_API_KEY_CANNOT_BE_REVOKED"; }; ProjectNotFound: KnownErrorConstructor, [projectId: string]> & { errorCode: "PROJECT_NOT_FOUND"; }; BranchDoesNotExist: KnownErrorConstructor, [branchId: string]> & { errorCode: "BRANCH_DOES_NOT_EXIST"; }; SignUpNotEnabled: KnownErrorConstructor, []> & { errorCode: "SIGN_UP_NOT_ENABLED"; }; PasswordAuthenticationNotEnabled: KnownErrorConstructor, []> & { errorCode: "PASSWORD_AUTHENTICATION_NOT_ENABLED"; }; PasskeyAuthenticationNotEnabled: KnownErrorConstructor, []> & { errorCode: "PASSKEY_AUTHENTICATION_NOT_ENABLED"; }; AnonymousAccountsNotEnabled: KnownErrorConstructor, []> & { errorCode: "ANONYMOUS_ACCOUNTS_NOT_ENABLED"; }; EmailPasswordMismatch: KnownErrorConstructor, []> & { errorCode: "EMAIL_PASSWORD_MISMATCH"; }; RedirectUrlNotWhitelisted: KnownErrorConstructor, []> & { errorCode: "REDIRECT_URL_NOT_WHITELISTED"; }; PasswordRequirementsNotMet: KnownErrorConstructor, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "PASSWORD_REQUIREMENTS_NOT_MET"; }; PasswordTooShort: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PASSWORD_TOO_SHORT">, [minLength: number]> & { errorCode: "PASSWORD_TOO_SHORT"; }; PasswordTooLong: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"PASSWORD_TOO_LONG">, [maxLength: number]> & { errorCode: "PASSWORD_TOO_LONG"; }; UserDoesNotHavePassword: KnownErrorConstructor, []> & { errorCode: "USER_DOES_NOT_HAVE_PASSWORD"; }; VerificationCodeError: KnownErrorConstructor, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "VERIFICATION_ERROR"; }; VerificationCodeNotFound: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"VERIFICATION_CODE_NOT_FOUND">, []> & { errorCode: "VERIFICATION_CODE_NOT_FOUND"; }; VerificationCodeExpired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"VERIFICATION_CODE_EXPIRED">, []> & { errorCode: "VERIFICATION_CODE_EXPIRED"; }; VerificationCodeAlreadyUsed: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"VERIFICATION_CODE_ALREADY_USED">, []> & { errorCode: "VERIFICATION_CODE_ALREADY_USED"; }; VerificationCodeMaxAttemptsReached: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"VERIFICATION_CODE_MAX_ATTEMPTS_REACHED">, []> & { errorCode: "VERIFICATION_CODE_MAX_ATTEMPTS_REACHED"; }; PasswordConfirmationMismatch: KnownErrorConstructor, []> & { errorCode: "PASSWORD_CONFIRMATION_MISMATCH"; }; EmailAlreadyVerified: KnownErrorConstructor, []> & { errorCode: "EMAIL_ALREADY_VERIFIED"; }; EmailNotAssociatedWithUser: KnownErrorConstructor, []> & { errorCode: "EMAIL_NOT_ASSOCIATED_WITH_USER"; }; EmailIsNotPrimaryEmail: KnownErrorConstructor, [email: string, primaryEmail: string | null]> & { errorCode: "EMAIL_IS_NOT_PRIMARY_EMAIL"; }; PasskeyRegistrationFailed: KnownErrorConstructor, [message: string]> & { errorCode: "PASSKEY_REGISTRATION_FAILED"; }; PasskeyWebAuthnError: KnownErrorConstructor, [message: string, code: string]> & { errorCode: "PASSKEY_WEBAUTHN_ERROR"; }; PasskeyAuthenticationFailed: KnownErrorConstructor, [message: string]> & { errorCode: "PASSKEY_AUTHENTICATION_FAILED"; }; PermissionNotFound: KnownErrorConstructor, [permissionId: string]> & { errorCode: "PERMISSION_NOT_FOUND"; }; PermissionScopeMismatch: KnownErrorConstructor, [permissionId: string, expectedScope: "project" | "team", actualScope: "project" | "team" | null]> & { errorCode: "WRONG_PERMISSION_SCOPE"; }; ContainedPermissionNotFound: KnownErrorConstructor, [permissionId: string]> & { errorCode: "CONTAINED_PERMISSION_NOT_FOUND"; }; TeamNotFound: KnownErrorConstructor, [teamId: string]> & { errorCode: "TEAM_NOT_FOUND"; }; TeamMembershipNotFound: KnownErrorConstructor, [teamId: string, userId: string]> & { errorCode: "TEAM_MEMBERSHIP_NOT_FOUND"; }; EmailTemplateAlreadyExists: KnownErrorConstructor, []> & { errorCode: "EMAIL_TEMPLATE_ALREADY_EXISTS"; }; OAuthConnectionNotConnectedToUser: KnownErrorConstructor, []> & { errorCode: "OAUTH_CONNECTION_NOT_CONNECTED_TO_USER"; }; OAuthConnectionAlreadyConnectedToAnotherUser: KnownErrorConstructor, []> & { errorCode: "OAUTH_CONNECTION_ALREADY_CONNECTED_TO_ANOTHER_USER"; }; OAuthConnectionDoesNotHaveRequiredScope: KnownErrorConstructor, []> & { errorCode: "OAUTH_CONNECTION_DOES_NOT_HAVE_REQUIRED_SCOPE"; }; OAuthExtraScopeNotAvailableWithSharedOAuthKeys: KnownErrorConstructor, []> & { errorCode: "OAUTH_EXTRA_SCOPE_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS"; }; OAuthAccessTokenNotAvailableWithSharedOAuthKeys: KnownErrorConstructor, []> & { errorCode: "OAUTH_ACCESS_TOKEN_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS"; }; InvalidOAuthClientIdOrSecret: KnownErrorConstructor, [clientId?: string | undefined]> & { errorCode: "INVALID_OAUTH_CLIENT_ID_OR_SECRET"; }; InvalidScope: KnownErrorConstructor, [scope: string]> & { errorCode: "INVALID_SCOPE"; }; UserAlreadyConnectedToAnotherOAuthConnection: KnownErrorConstructor, []> & { errorCode: "USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION"; }; OuterOAuthTimeout: KnownErrorConstructor, []> & { errorCode: "OUTER_OAUTH_TIMEOUT"; }; OAuthProviderNotFoundOrNotEnabled: KnownErrorConstructor, []> & { errorCode: "OAUTH_PROVIDER_NOT_FOUND_OR_NOT_ENABLED"; }; MultiFactorAuthenticationRequired: KnownErrorConstructor, [attemptCode: string]> & { errorCode: "MULTI_FACTOR_AUTHENTICATION_REQUIRED"; }; InvalidTotpCode: KnownErrorConstructor, []> & { errorCode: "INVALID_TOTP_CODE"; }; UserAuthenticationRequired: KnownErrorConstructor, []> & { errorCode: "USER_AUTHENTICATION_REQUIRED"; }; TeamMembershipAlreadyExists: KnownErrorConstructor, []> & { errorCode: "TEAM_MEMBERSHIP_ALREADY_EXISTS"; }; ProjectPermissionRequired: KnownErrorConstructor, [any, any]> & { errorCode: "PROJECT_PERMISSION_REQUIRED"; }; TeamPermissionRequired: KnownErrorConstructor, [any, any, any]> & { errorCode: "TEAM_PERMISSION_REQUIRED"; }; InvalidSharedOAuthProviderId: KnownErrorConstructor, [any]> & { errorCode: "INVALID_SHARED_OAUTH_PROVIDER_ID"; }; InvalidStandardOAuthProviderId: KnownErrorConstructor, [any]> & { errorCode: "INVALID_STANDARD_OAUTH_PROVIDER_ID"; }; InvalidAuthorizationCode: KnownErrorConstructor, []> & { errorCode: "INVALID_AUTHORIZATION_CODE"; }; TeamPermissionNotFound: KnownErrorConstructor, [any, any, any]> & { errorCode: "TEAM_PERMISSION_NOT_FOUND"; }; OAuthProviderAccessDenied: KnownErrorConstructor, []> & { errorCode: "OAUTH_PROVIDER_ACCESS_DENIED"; }; ContactChannelAlreadyUsedForAuthBySomeoneElse: KnownErrorConstructor, [type: "email", contactChannelValue?: string | undefined]> & { errorCode: "CONTACT_CHANNEL_ALREADY_USED_FOR_AUTH_BY_SOMEONE_ELSE"; }; InvalidPollingCodeError: KnownErrorConstructor, [details?: Json | undefined]> & { errorCode: "INVALID_POLLING_CODE"; }; ApiKeyNotValid: KnownErrorConstructor, [statusCode: number, humanReadableMessage: string, details?: Json | undefined]> & { errorCode: "API_KEY_NOT_VALID"; }; ApiKeyExpired: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"API_KEY_EXPIRED">, []> & { errorCode: "API_KEY_EXPIRED"; }; ApiKeyRevoked: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"API_KEY_REVOKED">, []> & { errorCode: "API_KEY_REVOKED"; }; WrongApiKeyType: KnownErrorConstructor & { constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined]; } & KnownErrorBrand<"WRONG_API_KEY_TYPE">, [expectedType: string, actualType: string]> & { errorCode: "WRONG_API_KEY_TYPE"; }; }; export { type AbstractKnownErrorConstructor, KnownError, type KnownErrorConstructor, type KnownErrorJson, KnownErrors };