UNPKG

@slack/oauth

Version:

Official library for interacting with Slack's Oauth endpoints

69 lines 2.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthorizationError = exports.UnknownError = exports.MissingCodeError = exports.InvalidStateError = exports.MissingStateError = exports.GenerateInstallUrlError = exports.InstallerInitializationError = exports.ErrorCode = void 0; /** * A dictionary of codes for errors produced by this package. */ var ErrorCode; (function (ErrorCode) { ErrorCode["InstallerInitializationError"] = "slack_oauth_installer_initialization_error"; ErrorCode["AuthorizationError"] = "slack_oauth_installer_authorization_error"; ErrorCode["GenerateInstallUrlError"] = "slack_oauth_generate_url_error"; ErrorCode["MissingStateError"] = "slack_oauth_missing_state"; ErrorCode["InvalidStateError"] = "slack_oauth_invalid_state"; ErrorCode["MissingCodeError"] = "slack_oauth_missing_code"; ErrorCode["UnknownError"] = "slack_oauth_unknown_error"; })(ErrorCode || (exports.ErrorCode = ErrorCode = {})); class InstallerInitializationError extends Error { constructor() { super(...arguments); this.code = ErrorCode.InstallerInitializationError; } } exports.InstallerInitializationError = InstallerInitializationError; class GenerateInstallUrlError extends Error { constructor() { super(...arguments); this.code = ErrorCode.GenerateInstallUrlError; } } exports.GenerateInstallUrlError = GenerateInstallUrlError; class MissingStateError extends Error { constructor() { super(...arguments); this.code = ErrorCode.MissingStateError; } } exports.MissingStateError = MissingStateError; class InvalidStateError extends Error { constructor() { super(...arguments); this.code = ErrorCode.InvalidStateError; } } exports.InvalidStateError = InvalidStateError; class MissingCodeError extends Error { constructor() { super(...arguments); this.code = ErrorCode.MissingCodeError; } } exports.MissingCodeError = MissingCodeError; class UnknownError extends Error { constructor() { super(...arguments); this.code = ErrorCode.UnknownError; } } exports.UnknownError = UnknownError; class AuthorizationError extends Error { constructor(message, original) { super(message); this.code = ErrorCode.AuthorizationError; if (original !== undefined) { this.original = original; } } } exports.AuthorizationError = AuthorizationError; //# sourceMappingURL=errors.js.map