fiscalisto 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +40 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1143 -0
- package/dist/core.d.ts +106 -0
- package/dist/core.js +190 -0
- package/dist/error-codes.d.ts +166 -0
- package/dist/error-codes.js +165 -0
- package/dist/generated.d.ts +5438 -0
- package/dist/generated.js +1551 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +25 -0
- package/dist/webhooks.d.ts +28 -0
- package/dist/webhooks.js +63 -0
- package/package.json +47 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fiscalisto
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fiscalisto
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
El SDK de la [API de facturación de Fiscalisto](https://fiscalisto.com/docs/api): timbre CFDI 4.0 (facturas, pagos, notas de crédito, nómina, retenciones y lotes) desde TypeScript o JavaScript.
|
|
4
|
+
|
|
5
|
+
- Tipos para cada campo, con su descripción y su nombre en el XML del SAT.
|
|
6
|
+
- `Idempotency-Key` automática en cada `POST`: un reintento nunca timbra, crea ni manda nada dos veces.
|
|
7
|
+
- Reintentos solo de lo que es seguro repetir.
|
|
8
|
+
- Listas que se recorren solas con `for await`.
|
|
9
|
+
- Webhooks verificados en una línea.
|
|
10
|
+
- Sin dependencias: Node 20+, Bun, Deno y Cloudflare Workers.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install fiscalisto
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { Fiscalisto } from "fiscalisto";
|
|
18
|
+
|
|
19
|
+
const fiscalisto = new Fiscalisto(process.env.FISCALISTO_API_KEY);
|
|
20
|
+
|
|
21
|
+
const invoice = await fiscalisto.invoices.create(
|
|
22
|
+
{
|
|
23
|
+
customer: { tax_id: "ICV060329BY0", legal_name: "INMOBILIARIA CVA", tax_system: "601", zip: "33826" },
|
|
24
|
+
payment_form: "03",
|
|
25
|
+
items: [{ description: "Mensualidad", product_key: "86121700", quantity: 2, unit_price: 2500 }],
|
|
26
|
+
},
|
|
27
|
+
{ idempotencyKey: "pedido-A-1042" },
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
console.log(invoice.uuid, invoice.total);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## CLI
|
|
34
|
+
|
|
35
|
+
El mismo paquete trae el CLI: `npx fiscalisto login` inicia sesión por el navegador, `npx fiscalisto init` deja el SDK y su llave en su proyecto, y `npx fiscalisto listen --forward-to http://localhost:3000/webhooks` le manda los webhooks de pruebas a su computadora. Con `--json`, para agentes y scripts. Vea [fiscalisto.com/docs/api/cli](https://fiscalisto.com/docs/api/cli).
|
|
36
|
+
|
|
37
|
+
La guía completa está en [fiscalisto.com/docs/api/sdk](https://fiscalisto.com/docs/api/sdk) y cada página de la [referencia](https://fiscalisto.com/docs/api) trae su ejemplo con el SDK.
|
|
38
|
+
|
|
39
|
+
## Desarrollo
|
|
40
|
+
|
|
41
|
+
`src/generated.ts` (tipos y métodos) se genera desde la especificación OpenAPI con `bun run openapi` en la raíz del repositorio; no lo edite. `src/core.ts` y `src/webhooks.ts` se escriben a mano. `npm run build` compila a `dist/`.
|
package/dist/cli.d.ts
ADDED