emailengine-client
Version:
A TypeScript client for the EmailEngine API
36 lines • 1.98 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeliveryTestApi = void 0;
const helpers_1 = require("../../../misc/helpers");
const CreateDeliveryTestOptions_1 = require("./models/CreateDeliveryTestOptions");
const CheckTestStatusOptions_1 = require("./models/CheckTestStatusOptions");
class DeliveryTestApi {
constructor(client) {
this.axiosInstance = client.axios;
}
createDeliveryTest(options) {
return __awaiter(this, void 0, void 0, function* () {
options = new CreateDeliveryTestOptions_1.CreateDeliveryTestOptions(options);
const response = yield this.axiosInstance.post(`/v1/delivery-test/account/${options.account}`, options.body, (0, helpers_1.setupAxiosRequestConfig)(options));
return response.data;
});
}
checkTestStatus(options) {
return __awaiter(this, void 0, void 0, function* () {
options = new CheckTestStatusOptions_1.CheckTestStatusOptions(options);
const response = yield this.axiosInstance.get(`/v1/delivery-test/check/${options.deliveryTest}`, (0, helpers_1.setupAxiosRequestConfig)(options));
return response.data;
});
}
}
exports.DeliveryTestApi = DeliveryTestApi;
//# sourceMappingURL=api.js.map