@iletimerkezi/iletimerkezi-node
Version:
İleti Merkezi Node.js SDK
52 lines • 2.07 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IletiMerkeziClient = void 0;
const AxiosHttpClient_1 = require("./AxiosHttpClient");
const SmsService_1 = require("./services/SmsService");
const ReportService_1 = require("./services/ReportService");
const SummaryService_1 = require("./services/SummaryService");
const SenderService_1 = require("./services/SenderService");
const BlacklistService_1 = require("./services/BlacklistService");
const AccountService_1 = require("./services/AccountService");
const WebhookService_1 = require("./services/WebhookService");
class IletiMerkeziClient {
constructor(apiKey, apiHash, defaultSender) {
this.apiKey = apiKey;
this.apiHash = apiHash;
this.defaultSender = defaultSender;
this.httpClient = new AxiosHttpClient_1.AxiosHttpClient();
}
sms() {
return new SmsService_1.SmsService(this.httpClient, this.apiKey, this.apiHash, this.defaultSender);
}
reports() {
return new ReportService_1.ReportService(this.httpClient, this.apiKey, this.apiHash);
}
summary() {
return new SummaryService_1.SummaryService(this.httpClient, this.apiKey, this.apiHash);
}
senders() {
return new SenderService_1.SenderService(this.httpClient, this.apiKey, this.apiHash);
}
blacklist() {
return new BlacklistService_1.BlacklistService(this.httpClient, this.apiKey, this.apiHash);
}
account() {
return new AccountService_1.AccountService(this.httpClient, this.apiKey, this.apiHash);
}
webhook() {
return new WebhookService_1.WebhookService();
}
/**
* Get debug information about the last request and response
*/
debug() {
return JSON.stringify({
payload: JSON.parse(this.httpClient.getPayload()),
response: this.httpClient.getBody(),
status: this.httpClient.getStatusCode()
}, null, 2);
}
}
exports.IletiMerkeziClient = IletiMerkeziClient;
//# sourceMappingURL=IletiMerkeziClient.js.map