night-api
Version:
Ce paquet Npm fourni une interface pour intéragir avec [Night-API](https://night-api.com)
26 lines • 968 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const functions_1 = __importDefault(require("../../functions"));
const constants_1 = require("../constants");
class Captcha {
token;
constructor(token) {
this.token = token;
this.functions = new functions_1.default(this.token);
}
;
async generate(codeSize = 6) {
if (codeSize > 10 || codeSize < 4)
throw new Error('The "codeSize" option must be between 4 and 10');
if (isNaN(codeSize))
throw new Error('"codeSize" must be a Number');
return await this.functions.get(`${constants_1.Endpoints.Images._}${constants_1.Endpoints.Images.Captcha._}`, { body: { codeSize } });
}
}
;
;
exports.default = Captcha;
//# sourceMappingURL=Captcha.js.map