kutt
Version:
Node.js & browser (TypeScript) client for Kutt url shortener
45 lines • 1.05 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const API_1 = __importDefault(require("#src/API"));
/**
*
* @see {@link https://docs.kutt.it/#tag/domains}
* @example
* const domains = new Domain(config);
*/
class Domain extends API_1.default {
/**
*
* @protected
*/
prefix = "/domains";
/**
* Creates a domain.
*
* @param domain
* @example
* const domain = await domains.create({
* address: "string",
* homepage: "string",
* });
*/
async create(domain) {
return this.post(domain);
}
/**
* Deletes a domain.
*
* @param id
* @example
* const message = await domains.remove(domain.id);
*/
async remove(id) {
return this.delete(`/${id}`)
.then(data => data.message);
}
}
exports.default = Domain;
//# sourceMappingURL=Domain.js.map