@trustcomponent/trustcaptcha-nodejs
Version:
TrustCaptcha – Privacy-first CAPTCHA solution for Node.js and TypeScript. GDPR-compliant, bot protection made in Europe.
37 lines (36 loc) • 1.63 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerificationResult = void 0;
var uuid_1 = require("uuid");
var VerificationResult = /** @class */ (function () {
function VerificationResult(data) {
if (!(0, uuid_1.validate)(data.captchaId) || !(0, uuid_1.validate)(data.verificationId)) {
throw new Error('Invalid UUID');
}
this.captchaId = data.captchaId;
this.verificationId = data.verificationId;
this.verificationPassed = data.verificationPassed;
this.score = data.score;
this.decisionType = data.decisionType;
this.decisionAction = data.decisionAction;
this.gatewayFailoverActive = data.gatewayFailoverActive;
this.riskScoringEnabled = data.riskScoringEnabled;
this.minimalDataModeEnabled = data.minimalDataModeEnabled;
this.origin = data.origin;
this.ipAddress = data.ipAddress;
this.countryCode = data.countryCode;
this.deviceFamily = data.deviceFamily;
this.operatingSystem = data.operatingSystem;
this.browser = data.browser;
this.verificationStartedAt = data.verificationStartedAt;
this.verificationFinishedAt = data.verificationFinishedAt;
this.resultExpiresAt = data.resultExpiresAt;
this.resultFirstFetchedAt = data.resultFirstFetchedAt;
this.resultLastFetchedAt = data.resultLastFetchedAt;
}
VerificationResult.fromObject = function (data) {
return new VerificationResult(data);
};
return VerificationResult;
}());
exports.VerificationResult = VerificationResult;