UNPKG

ci-validation

Version:

🇺🇾 Complete TypeScript/JavaScript library for validating Uruguayan CI (Cédula de Identidad) with official algorithm and government service integration

47 lines • 1.74 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const axios_1 = __importDefault(require("axios")); class Farmashop { constructor(ci) { this.ci = ci; this.endpoint = "https://api-app.farmashop.com.uy/api/v3/User/GetPasswordRecoveryOptions"; this.headers = { "Accept-Encoding": "gzip", AppRequestStackTrace: "-", AppVersion: "7.1.3", Authorization: "K3wCIM5EsvyxVcuQUOiYuoGqFuKhv/wuyqY+BMNnsu4=", BuildConfiguration: "RELEASE", ChannelName: "PRODUCTION", Connection: "Keep-Alive", DeviceManufacturer: "un celular chafa", DeviceModel: "SM :(", DeviceOS: "Android", DeviceOSVersion: "12", Host: "api-app.farmashop.com.uy", SessionId: "hola n-n", "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 12; SM-G988N Build/NRD90M)", }; } async getPoints() { try { const response = await axios_1.default.get(`${this.endpoint}/${this.ci}`, { headers: this.headers }).catch((e) => { console.error("Error fetching Farmashop points:", e); return { data: { error: e.message, }, }; }); return response.data; } catch (error) { console.error("Error fetching Farmashop points:", error); throw error; } } } exports.default = Farmashop; //# sourceMappingURL=Farmashop.js.map