mailinator-client
Version:
Mailinator REST API client for JavaScript applications.
26 lines (25 loc) • 964 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstantTOTP2FACodeRequest = void 0;
const MailinatorRestClient_1 = __importDefault(require("../MailinatorRestClient"));
const Constants_1 = require("../Constants");
const _resolveTemplateUrl = (totpSecretKey) => {
return `https://api.mailinator.com/api/v2/totp/${totpSecretKey}`;
};
class InstantTOTP2FACodeRequest {
constructor(totpSecretKey) {
this.totpSecretKey = totpSecretKey;
}
execute(apiToken) {
const _options = {
additionalHeaders: {
[Constants_1.AUTHORIZATION]: apiToken
}
};
return MailinatorRestClient_1.default.get(_resolveTemplateUrl(this.totpSecretKey), _options);
}
}
exports.InstantTOTP2FACodeRequest = InstantTOTP2FACodeRequest;