UNPKG

@vonage/verify

Version:

Verify API provides a choice of routes for sending a code to a user. You can use this to confirm a user's contact information, as a second factor when authenticating users, or for step-up authentication.

99 lines (97 loc) 2.7 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // lib/classes/Verification.ts var Verification_exports = {}; __export(Verification_exports, { Verification: () => Verification }); module.exports = __toCommonJS(Verification_exports); var Verification = class { /** * The phone number to be verified. */ number; /** * The brand or application name associated with the verification request. */ brand; /** * The country code associated with the phone number (optional). */ country; /** * The sender ID or phone number that will be used to send verification * messages (optional). */ senderId; /** * The desired length of the verification code (optional). */ codeLength; /** * @deprecated This property is deprecated. Use `lg` instead. */ language; /** * The language for sending verification messages (optional). */ lg; /** * The duration in seconds for which the verification code will be valid. */ pinExpiry; /** * The duration in seconds to wait before sending the next verification event. */ nextEventWait; /** * The workflow ID for customizing the verification process (optional). */ workflowId; constructor(phoneNumber, brand, country, senderId, codeLength, language, lg, pinExpiry, nextEventWait, workflowId) { this.number = phoneNumber; this.brand = brand; if (country) { this.country = country; } if (senderId) { this.senderId = senderId; } if (codeLength) { this.codeLength = codeLength; } if (language) { this.lg = language; this.language = language; } if (pinExpiry) { this.pinExpiry = pinExpiry; } if (nextEventWait) { this.nextEventWait = nextEventWait; } if (workflowId) { this.workflowId = workflowId; } } }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Verification });