@brvhprince/termii-js
Version:
JavaScript SDK for Termii Provider
52 lines (51 loc) • 2.09 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Project: termii-js
* File: Termii
* Created by pennycodes on 25/04/2023.
* Copyright termii-js
*/
var client_1 = require("../service/client");
var Messaging_1 = require("../apps/Messaging");
var Token_1 = require("../apps/Token");
var Insights_1 = require("../apps/Insights");
var Termii = /** @class */ (function (_super) {
__extends(Termii, _super);
function Termii(api_key, sender_id) {
var _this = _super.call(this, {
baseURL: Termii.base_url,
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
}) || this;
_this.api_key = api_key;
_this.sender_id = sender_id.trim();
_this.messaging = new Messaging_1.default(_this, _this.api_key, _this.sender_id);
_this.token = new Token_1.default(_this, _this.api_key, _this.sender_id);
_this.insights = new Insights_1.default(_this, _this.api_key, _this.sender_id);
return _this;
}
Termii.prototype.set_sender_id = function (sender_id) {
this.sender_id = sender_id.trim();
};
Termii.base_url = "https://api.ng.termii.com/api/";
return Termii;
}(client_1.default));
exports.default = Termii;