UNPKG

@nestlab/google-recaptcha

Version:
35 lines (34 loc) 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RecaptchaVerificationResult = void 0; class RecaptchaVerificationResult { constructor(options) { this.options = options; this.success = options.success; this.hostname = options.hostname; this.action = options.action; this.remoteIp = options.remoteIp; this.score = options.score; this.errors = options.errors; this.nativeResponse = options.nativeResponse; } toObject() { return { success: this.success, hostname: this.hostname, action: this.action, score: this.score, remoteIp: this.remoteIp, errors: this.errors, nativeResponse: this.nativeResponse, }; } getResponse() { return this.nativeResponse; } getEnterpriseRiskAnalytics() { const res = this.getResponse(); return res['riskAnalysis'] || null; } } exports.RecaptchaVerificationResult = RecaptchaVerificationResult;