mailinator-client
Version:
Mailinator REST API client for JavaScript applications.
23 lines (22 loc) • 826 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstantTOTP2FACodeRequest = void 0;
const MailinatorRestClient_1 = require("../MailinatorRestClient");
const Constants_1 = require("../Constants");
const _resolveTemplateUrl = (totpSecretKey) => {
return `https://api.mailinator.com/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;
;