Comparing version 1.2.2 to 1.3.0
@@ -1,5 +0,5 @@ | ||
const { processImage } = require('./src/Image'); | ||
const { Img } = require('./src/Image'); | ||
module.exports = { | ||
processImage, | ||
Img, | ||
}; |
{ | ||
"name": "spoondev", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Modulo npm para manipular imagenes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,19 +0,10 @@ | ||
// my-fastapi-client.js | ||
import { SpoonError } from "./utils/ZeewError"; | ||
import { Card } from "./cards"; | ||
const axios = require('axios'); | ||
async function processImage(token, params) { | ||
try { | ||
const response = await axios.post('https://spoonapi.vercel.app/process_image', params, { | ||
headers: { | ||
Authorization: `Bearer ${token}`, // Autenticación usando el token | ||
}, | ||
}); | ||
return response.data.imageBase64; // Suponiendo que la imagen procesada es devuelta como base64 | ||
} catch (error) { | ||
console.error('Error al procesar la imagen:', error); | ||
throw new Error('Error al procesar la imagen'); | ||
export default class Img { | ||
constructor(token) { | ||
if (!token) throw new SpoonError("Debes colocar el token"); | ||
this.token = token; | ||
this.card = new Card(token); | ||
} | ||
} | ||
module.exports = { processImage }; | ||
} |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
6445
8
163
1