@planq-network/encrypted-backup
Version:
Libraries for implemented password encrypted account backups
159 lines • 6.76 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UsageError = exports.ScryptError = exports.PbkdfError = exports.OdisVerificationError = exports.OdisRateLimitingError = exports.OdisServiceError = exports.InvalidBackupError = exports.FetchError = exports.EncryptionError = exports.DecryptionError = exports.DecodeError = exports.AuthorizationError = exports.BackupErrorTypes = void 0;
var result_1 = require("@planq-network/base/lib/result");
var BackupErrorTypes;
(function (BackupErrorTypes) {
BackupErrorTypes["AUTHORIZATION_ERROR"] = "AUTHORIZATION_ERROR";
BackupErrorTypes["DECODE_ERROR"] = "DECODE_ERROR";
BackupErrorTypes["DECRYPTION_ERROR"] = "DECRYPTION_ERROR";
BackupErrorTypes["ENCRYPTION_ERROR"] = "ENCRYPTION_ERROR";
BackupErrorTypes["FETCH_ERROR"] = "FETCH_ERROR";
BackupErrorTypes["INVALID_BACKUP_ERROR"] = "INVALID_BACKUP_ERROR";
BackupErrorTypes["ODIS_SERVICE_ERROR"] = "ODIS_SERVICE_ERROR";
BackupErrorTypes["ODIS_RATE_LIMITING_ERROR"] = "ODIS_RATE_LIMITING_ERROR";
BackupErrorTypes["ODIS_VERIFICATION_ERROR"] = "ODIS_VERIFICATION_ERROR";
BackupErrorTypes["PBKDF_ERROR"] = "PBKDF_ERROR";
BackupErrorTypes["SCRYPT_ERROR"] = "SCRYPT_ERROR";
BackupErrorTypes["USAGE_ERROR"] = "USAGE_ERROR";
})(BackupErrorTypes = exports.BackupErrorTypes || (exports.BackupErrorTypes = {}));
var AuthorizationError = /** @class */ (function (_super) {
__extends(AuthorizationError, _super);
function AuthorizationError(error) {
var _this = _super.call(this, BackupErrorTypes.AUTHORIZATION_ERROR) || this;
_this.error = error;
return _this;
}
return AuthorizationError;
}(result_1.RootError));
exports.AuthorizationError = AuthorizationError;
var DecodeError = /** @class */ (function (_super) {
__extends(DecodeError, _super);
function DecodeError(error) {
var _this = _super.call(this, BackupErrorTypes.DECODE_ERROR) || this;
_this.error = error;
return _this;
}
return DecodeError;
}(result_1.RootError));
exports.DecodeError = DecodeError;
var DecryptionError = /** @class */ (function (_super) {
__extends(DecryptionError, _super);
function DecryptionError(error) {
var _this = _super.call(this, BackupErrorTypes.DECRYPTION_ERROR) || this;
_this.error = error;
return _this;
}
return DecryptionError;
}(result_1.RootError));
exports.DecryptionError = DecryptionError;
var EncryptionError = /** @class */ (function (_super) {
__extends(EncryptionError, _super);
function EncryptionError(error) {
var _this = _super.call(this, BackupErrorTypes.ENCRYPTION_ERROR) || this;
_this.error = error;
return _this;
}
return EncryptionError;
}(result_1.RootError));
exports.EncryptionError = EncryptionError;
var FetchError = /** @class */ (function (_super) {
__extends(FetchError, _super);
function FetchError(error) {
var _this = _super.call(this, BackupErrorTypes.FETCH_ERROR) || this;
_this.error = error;
return _this;
}
return FetchError;
}(result_1.RootError));
exports.FetchError = FetchError;
var InvalidBackupError = /** @class */ (function (_super) {
__extends(InvalidBackupError, _super);
function InvalidBackupError(error) {
var _this = _super.call(this, BackupErrorTypes.INVALID_BACKUP_ERROR) || this;
_this.error = error;
return _this;
}
return InvalidBackupError;
}(result_1.RootError));
exports.InvalidBackupError = InvalidBackupError;
var OdisServiceError = /** @class */ (function (_super) {
__extends(OdisServiceError, _super);
function OdisServiceError(error, version) {
var _this = _super.call(this, BackupErrorTypes.ODIS_SERVICE_ERROR) || this;
_this.error = error;
_this.version = version;
return _this;
}
return OdisServiceError;
}(result_1.RootError));
exports.OdisServiceError = OdisServiceError;
var OdisRateLimitingError = /** @class */ (function (_super) {
__extends(OdisRateLimitingError, _super);
function OdisRateLimitingError(notBefore, error) {
var _this = _super.call(this, BackupErrorTypes.ODIS_RATE_LIMITING_ERROR) || this;
_this.notBefore = notBefore;
_this.error = error;
return _this;
}
return OdisRateLimitingError;
}(result_1.RootError));
exports.OdisRateLimitingError = OdisRateLimitingError;
var OdisVerificationError = /** @class */ (function (_super) {
__extends(OdisVerificationError, _super);
function OdisVerificationError(error) {
var _this = _super.call(this, BackupErrorTypes.ODIS_VERIFICATION_ERROR) || this;
_this.error = error;
return _this;
}
return OdisVerificationError;
}(result_1.RootError));
exports.OdisVerificationError = OdisVerificationError;
var PbkdfError = /** @class */ (function (_super) {
__extends(PbkdfError, _super);
function PbkdfError(iterations, error) {
var _this = _super.call(this, BackupErrorTypes.PBKDF_ERROR) || this;
_this.iterations = iterations;
_this.error = error;
return _this;
}
return PbkdfError;
}(result_1.RootError));
exports.PbkdfError = PbkdfError;
var ScryptError = /** @class */ (function (_super) {
__extends(ScryptError, _super);
function ScryptError(options, error) {
var _this = _super.call(this, BackupErrorTypes.SCRYPT_ERROR) || this;
_this.options = options;
_this.error = error;
return _this;
}
return ScryptError;
}(result_1.RootError));
exports.ScryptError = ScryptError;
var UsageError = /** @class */ (function (_super) {
__extends(UsageError, _super);
function UsageError(error) {
var _this = _super.call(this, BackupErrorTypes.USAGE_ERROR) || this;
_this.error = error;
return _this;
}
return UsageError;
}(result_1.RootError));
exports.UsageError = UsageError;
//# sourceMappingURL=errors.js.map