emailengine-client
Version:
A TypeScript client for the EmailEngine API
36 lines • 1.96 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.WebhooksApi = void 0;
const helpers_1 = require("../../../misc/helpers");
const GetWebhooksOptions_1 = require("./models/GetWebhooksOptions");
const GetWebhookRouteInformationOptions_1 = require("./models/GetWebhookRouteInformationOptions");
class WebhooksApi {
constructor(client) {
this.axiosInstance = client.axios;
}
getWebhookRoutes(options) {
return __awaiter(this, void 0, void 0, function* () {
options = new GetWebhooksOptions_1.GetWebhookRoutesOptions(options);
const response = yield this.axiosInstance.get(`/v1/webhookRoutes`, (0, helpers_1.setupAxiosRequestConfig)(options));
return response.data;
});
}
getWebhookRouteInformation(options) {
return __awaiter(this, void 0, void 0, function* () {
options = new GetWebhookRouteInformationOptions_1.GetWebhookRouteInformationOptions(options);
const response = yield this.axiosInstance.get(`/v1/webhookRoutes/webhookRoute/${options.webhookRoute}`, (0, helpers_1.setupAxiosRequestConfig)(options));
return response.data;
});
}
}
exports.WebhooksApi = WebhooksApi;
//# sourceMappingURL=api.js.map