@dodgeball/trust-sdk-client
Version:
Dodgeball Client SDK
97 lines (96 loc) • 4.93 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.DodgeballMissingParameterError = exports.DodgeballInvalidConfigError = exports.DodgeballMissingConfigError = exports.IntegrationPurpose = exports.cancelError = exports.systemError = exports.VerificationErrorType = exports.VerificationOutcome = exports.VerificationStatus = exports.DodgeballApiVersion = void 0;
var DodgeballApiVersion;
(function (DodgeballApiVersion) {
DodgeballApiVersion["v1"] = "v1";
})(DodgeballApiVersion = exports.DodgeballApiVersion || (exports.DodgeballApiVersion = {}));
var VerificationStatus;
(function (VerificationStatus) {
VerificationStatus["PENDING"] = "PENDING";
VerificationStatus["BLOCKED"] = "BLOCKED";
VerificationStatus["COMPLETE"] = "COMPLETE";
VerificationStatus["FAILED"] = "FAILED";
})(VerificationStatus = exports.VerificationStatus || (exports.VerificationStatus = {}));
var VerificationOutcome;
(function (VerificationOutcome) {
VerificationOutcome["APPROVED"] = "APPROVED";
VerificationOutcome["DENIED"] = "DENIED";
VerificationOutcome["PENDING"] = "PENDING";
VerificationOutcome["ERROR"] = "ERROR";
})(VerificationOutcome = exports.VerificationOutcome || (exports.VerificationOutcome = {}));
var VerificationErrorType;
(function (VerificationErrorType) {
VerificationErrorType["SYSTEM"] = "SYSTEM";
VerificationErrorType["TIMEOUT"] = "TIMEOUT";
VerificationErrorType["CANCELLED"] = "CANCELLED";
})(VerificationErrorType = exports.VerificationErrorType || (exports.VerificationErrorType = {}));
var systemError = function (errorText) {
return {
errorType: VerificationErrorType.SYSTEM,
details: errorText,
};
};
exports.systemError = systemError;
var cancelError = function () {
return {
errorType: VerificationErrorType.CANCELLED,
details: "The user cancelled their request.",
};
};
exports.cancelError = cancelError;
var IntegrationPurpose;
(function (IntegrationPurpose) {
IntegrationPurpose["IDENTIFY"] = "IDENTIFY";
IntegrationPurpose["OBSERVE"] = "OBSERVE";
IntegrationPurpose["QUALIFY"] = "QUALIFY";
IntegrationPurpose["EXECUTE"] = "EXECUTE";
})(IntegrationPurpose = exports.IntegrationPurpose || (exports.IntegrationPurpose = {}));
var DodgeballMissingConfigError = (function (_super) {
__extends(DodgeballMissingConfigError, _super);
function DodgeballMissingConfigError(configName, value) {
var _newTarget = this.constructor;
var _this = _super.call(this, "Dodgeball SDK Error\nMissing configuration: ".concat(configName, "\nProvided Value: ").concat(value)) || this;
Object.setPrototypeOf(_this, _newTarget.prototype);
return _this;
}
return DodgeballMissingConfigError;
}(Error));
exports.DodgeballMissingConfigError = DodgeballMissingConfigError;
var DodgeballInvalidConfigError = (function (_super) {
__extends(DodgeballInvalidConfigError, _super);
function DodgeballInvalidConfigError(configName, value, allowedValues) {
var _newTarget = this.constructor;
var _this = _super.call(this, "Dodgeball SDK Error\nInvalid configuration: ".concat(configName, "\nProvided value: ").concat(value, "\nAllowed values: ").concat(allowedValues.join(", "))) || this;
Object.setPrototypeOf(_this, _newTarget.prototype);
return _this;
}
return DodgeballInvalidConfigError;
}(Error));
exports.DodgeballInvalidConfigError = DodgeballInvalidConfigError;
var DodgeballMissingParameterError = (function (_super) {
__extends(DodgeballMissingParameterError, _super);
function DodgeballMissingParameterError(parameter, value) {
var _newTarget = this.constructor;
var _this = _super.call(this, "Dodgeball SDK Error\nMissing parameter: ".concat(parameter, "\nProvided value: ").concat(value)) || this;
Object.setPrototypeOf(_this, _newTarget.prototype);
return _this;
}
return DodgeballMissingParameterError;
}(Error));
exports.DodgeballMissingParameterError = DodgeballMissingParameterError;