@dodgeball/trust-sdk-client
Version:
Dodgeball Client SDK
92 lines (91 loc) • 4.23 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 __());
};
})();
export var DodgeballApiVersion;
(function (DodgeballApiVersion) {
DodgeballApiVersion["v1"] = "v1";
})(DodgeballApiVersion || (DodgeballApiVersion = {}));
export var VerificationStatus;
(function (VerificationStatus) {
VerificationStatus["PENDING"] = "PENDING";
VerificationStatus["BLOCKED"] = "BLOCKED";
VerificationStatus["COMPLETE"] = "COMPLETE";
VerificationStatus["FAILED"] = "FAILED";
})(VerificationStatus || (VerificationStatus = {}));
export var VerificationOutcome;
(function (VerificationOutcome) {
VerificationOutcome["APPROVED"] = "APPROVED";
VerificationOutcome["DENIED"] = "DENIED";
VerificationOutcome["PENDING"] = "PENDING";
VerificationOutcome["ERROR"] = "ERROR";
})(VerificationOutcome || (VerificationOutcome = {}));
export var VerificationErrorType;
(function (VerificationErrorType) {
VerificationErrorType["SYSTEM"] = "SYSTEM";
VerificationErrorType["TIMEOUT"] = "TIMEOUT";
VerificationErrorType["CANCELLED"] = "CANCELLED";
})(VerificationErrorType || (VerificationErrorType = {}));
export var systemError = function (errorText) {
return {
errorType: VerificationErrorType.SYSTEM,
details: errorText,
};
};
export var cancelError = function () {
return {
errorType: VerificationErrorType.CANCELLED,
details: "The user cancelled their request.",
};
};
export var IntegrationPurpose;
(function (IntegrationPurpose) {
IntegrationPurpose["IDENTIFY"] = "IDENTIFY";
IntegrationPurpose["OBSERVE"] = "OBSERVE";
IntegrationPurpose["QUALIFY"] = "QUALIFY";
IntegrationPurpose["EXECUTE"] = "EXECUTE";
})(IntegrationPurpose || (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));
export { 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));
export { 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));
export { DodgeballMissingParameterError };