@useinvio/nfse-sdk 3.0.0 → 3.2.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/CHANGELOG.md +176 -0
- package/README.en.md +146 -0
- package/README.md +77 -518
- package/dist/agent.d.ts +131 -0
- package/dist/agent.js +551 -0
- package/dist/agent.js.map +1 -0
- package/dist/certificate.d.ts +96 -0
- package/dist/certificate.js +218 -0
- package/dist/certificate.js.map +1 -0
- package/dist/certificateValidation.d.ts +11 -6
- package/dist/certificateValidation.js +23 -12
- package/dist/certificateValidation.js.map +1 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +520 -0
- package/dist/cli.js.map +1 -0
- package/dist/cliBin.d.ts +2 -0
- package/dist/cliBin.js +6 -0
- package/dist/cliBin.js.map +1 -0
- package/dist/cliExample.d.ts +6 -0
- package/dist/cliExample.js +29 -0
- package/dist/cliExample.js.map +1 -0
- package/dist/client.d.ts +51 -4
- package/dist/client.js +41 -10
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/consultas.d.ts +34 -0
- package/dist/consultas.js +61 -0
- package/dist/consultas.js.map +1 -0
- package/dist/dpsJson.js +1 -41
- package/dist/dpsJson.js.map +1 -1
- package/dist/dpsJsonSchema.d.ts +17 -0
- package/dist/dpsJsonSchema.js +184 -0
- package/dist/dpsJsonSchema.js.map +1 -0
- package/dist/emissaoNota.d.ts +11 -6
- package/dist/emissaoNota.js +10 -6
- package/dist/emissaoNota.js.map +1 -1
- package/dist/eventoJson.d.ts +76 -0
- package/dist/eventoJson.js +128 -0
- package/dist/eventoJson.js.map +1 -0
- package/dist/eventosNfse.d.ts +38 -0
- package/dist/eventosNfse.js +73 -0
- package/dist/eventosNfse.js.map +1 -0
- package/dist/fiscalDomains.d.ts +22 -0
- package/dist/fiscalDomains.js +99 -0
- package/dist/fiscalDomains.js.map +1 -0
- package/dist/fiscalValidation.js +21 -53
- package/dist/fiscalValidation.js.map +1 -1
- package/dist/gzipB64.d.ts +5 -0
- package/dist/gzipB64.js +12 -0
- package/dist/gzipB64.js.map +1 -1
- package/dist/index.d.ts +22 -7
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/jsonSchemaCheck.d.ts +12 -0
- package/dist/jsonSchemaCheck.js +70 -0
- package/dist/jsonSchemaCheck.js.map +1 -0
- package/dist/loadPfx.d.ts +2 -0
- package/dist/loadPfx.js +2 -1
- package/dist/loadPfx.js.map +1 -1
- package/dist/mcpCli.d.ts +2 -0
- package/dist/mcpCli.js +7 -0
- package/dist/mcpCli.js.map +1 -0
- package/dist/mcpServer.d.ts +49 -0
- package/dist/mcpServer.js +159 -0
- package/dist/mcpServer.js.map +1 -0
- package/dist/nfseXml.d.ts +48 -0
- package/dist/nfseXml.js +86 -0
- package/dist/nfseXml.js.map +1 -0
- package/dist/rejeicoes.d.ts +50 -0
- package/dist/rejeicoes.js +62 -0
- package/dist/rejeicoes.js.map +1 -0
- package/dist/rejeicoesCatalog.d.ts +10 -0
- package/dist/rejeicoesCatalog.js +4449 -0
- package/dist/rejeicoesCatalog.js.map +1 -0
- package/dist/sefinClient.d.ts +107 -7
- package/dist/sefinClient.js +232 -22
- package/dist/sefinClient.js.map +1 -1
- package/dist/signXml.d.ts +3 -3
- package/dist/signXml.js +17 -7
- package/dist/signXml.js.map +1 -1
- package/dist/testing.d.ts +80 -0
- package/dist/testing.js +285 -0
- package/dist/testing.js.map +1 -0
- package/dist/xmlBuild.d.ts +11 -0
- package/dist/xmlBuild.js +44 -0
- package/dist/xmlBuild.js.map +1 -0
- package/dist/xmlInspection.d.ts +1 -1
- package/dist/xmlInspection.js +10 -9
- package/dist/xmlInspection.js.map +1 -1
- package/dist/xsdValidation.d.ts +24 -5
- package/dist/xsdValidation.js +97 -67
- package/dist/xsdValidation.js.map +1 -1
- package/docs/README.md +47 -0
- package/docs/REGRAS_NEGOCIO_EMISSAO.md +8 -8
- package/docs/conceitos/como-funciona.md +87 -0
- package/docs/guias/adn.md +51 -0
- package/docs/guias/agentes-ia.md +111 -0
- package/docs/guias/cancelar.md +70 -0
- package/docs/guias/certificado.md +88 -0
- package/docs/guias/cli.md +68 -0
- package/docs/guias/consultar.md +54 -0
- package/docs/guias/emitir.md +172 -0
- package/docs/guias/recuperar-emissao.md +33 -0
- package/docs/guias/rejeicoes.md +70 -0
- package/docs/guias/testes.md +79 -0
- package/docs/guias/timeouts.md +33 -0
- package/docs/referencia/ambientes.md +35 -0
- package/docs/referencia/api.md +137 -0
- package/docs/referencia/erros.md +55 -0
- package/docs/tutoriais/primeira-nfse.md +130 -0
- package/examples/README.md +3 -1
- package/examples/cancel-nfse.ts +29 -0
- package/examples/client-resource.ts +3 -5
- package/examples/emit-homologation.ts +3 -4
- package/examples/handle-errors.ts +3 -3
- package/examples/recover-emission.ts +29 -0
- package/llms.txt +97 -82
- package/package.json +31 -6
package/llms.txt
CHANGED
|
@@ -1,85 +1,100 @@
|
|
|
1
|
-
# @useinvio/nfse-sdk
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
- `README.md`: primary Portuguese documentation and examples.
|
|
10
|
-
- `ENGLISH.md`: English documentation with the same conceptual flow.
|
|
11
|
-
- `docs/METRICS.md`: detailed SEFIN latency metrics guide, including the `NFSE_SEFIN_LATENCY_METRICS` env switch, observer setup, optional P99 snapshots, and export guidance.
|
|
12
|
-
- `index.ts`: public exports. Treat this as the supported API surface.
|
|
13
|
-
- `examples/`: runnable usage examples.
|
|
14
|
-
- `JSON_MAPPING.md`: mapping notes for the declarative JSON input.
|
|
15
|
-
- `test/`: behavior examples and regression coverage.
|
|
16
|
-
|
|
17
|
-
## Public Entry Points
|
|
18
|
-
|
|
19
|
-
- `NfseClient`: resource-oriented client. Configure certificate, environment, and defaults once, then use `client.invoices.create(...)`, `client.invoices.buildDpsJson(...)`, and `client.invoices.get(...)`.
|
|
20
|
-
- `emitirNfse(input, pfx, options?)`: issue an invoice from a DPS XML string or `DpsJsonRequest`.
|
|
21
|
-
- `buildDpsFromJson(input)`: build unsigned DPS XML from declarative JSON.
|
|
22
|
-
- `buildDpsId(prestador, nDPS, serie?)`: derive the 45-character DPS Id.
|
|
23
|
-
- `loadPfx(...)` and `loadPfxFromBuffer(...)`: extract key/certificate material from an A1/PFX certificate.
|
|
24
|
-
- `consultarNfse(...)`, `enviarEvento(...)`, `extrairErros(...)`: lower-level SEFIN helpers.
|
|
25
|
-
- `setSefinRequestObserver(...)` and `createSefinLatencyTracker(...)`: observe SEFIN round-trip latency when `NFSE_SEFIN_LATENCY_METRICS` is enabled; percentiles require `includePercentiles: true`.
|
|
26
|
-
- `gzipBase64(...)`, `gunzipBase64(...)`, `signDps(...)`, `verifyDps(...)`: protocol utilities for custom flows.
|
|
27
|
-
|
|
28
|
-
## File Map
|
|
29
|
-
|
|
30
|
-
- `client.ts`: friendly client API and default merging.
|
|
31
|
-
- `emissaoNota.ts`: central issue flow: prepare input, sign DPS, gzip/base64, transmit, unzip authorized XML, normalize errors.
|
|
32
|
-
- `dpsJson.ts`: JSON-to-DPS XML builder, XML escaping, DPS Id generation, value formatting, and XML block assembly.
|
|
33
|
-
- `fiscalValidation.ts`: structural and layout-oriented validation for the JSON input. This intentionally rejects unsupported or ambiguous fiscal shapes.
|
|
34
|
-
- `sefinClient.ts`: HTTPS mTLS requests to SEFIN, latency observation, response parsing, error normalization, invoice query, issue transport, and event transport.
|
|
35
|
-
- `config.ts`: SEFIN base URLs, environment names, and `tpAmb` mapping.
|
|
36
|
-
- `loadPfx.ts`: PFX/A1 certificate decoding with `node-forge`.
|
|
37
|
-
- `signXml.ts`: XMLDSIG signing and verification helpers.
|
|
38
|
-
- `gzipB64.ts`: GZip/Base64 helpers.
|
|
39
|
-
|
|
40
|
-
## Core Data Shape
|
|
41
|
-
|
|
42
|
-
Declarative issuing uses `DpsJsonRequest`:
|
|
43
|
-
|
|
44
|
-
- `ambiente`: optional, `restrita` or `producao`; defaults to `restrita`.
|
|
45
|
-
- `prestador`: issuer profile such as `cnpj`, `cLocEmi`, `serie`, `opSimpNac`, and `regEspTrib`.
|
|
46
|
-
- `servico`: service defaults such as `cTribNac`, `xDescServ`, `cLocPrestacao`, and optional `cNBS`.
|
|
47
|
-
- `emissao`: invoice-specific data such as `nDPS`, dates, `valores`, optional parties, municipal/federal taxation blocks, and `totTrib`.
|
|
48
|
-
|
|
49
|
-
Keep values as strings when they represent fiscal codes, identifiers, decimals, or exact XML values. Many fields are numeric-looking but must preserve leading zeroes.
|
|
50
|
-
|
|
51
|
-
## Important Invariants
|
|
52
|
-
|
|
53
|
-
- Node.js >= 20 and ESM are expected.
|
|
54
|
-
- Public imports should come from the package root (`index.ts` exports), not internal files, unless you are editing the SDK itself.
|
|
55
|
-
- `DEFAULT_AMBIENTE` is `restrita`; `NfseClient` also accepts `sandbox` and `production` aliases.
|
|
56
|
-
- `buildDpsFromJson` validates first via `validateDpsJsonRequest`.
|
|
57
|
-
- The SDK intentionally avoids silent fiscal defaults for required tax fields such as `tributacaoMunicipal` and `totTrib`.
|
|
58
|
-
- The JSON validator restricts `totTrib` by regime: non-Simples requires all three percentage totals; MEI requires `indTotTrib="0"`; ME/EPP requires `pTotTribSN`. Value totals remain typed but are rejected by the current regime matrix.
|
|
59
|
-
- `buildDpsId` must return a 45-character Id beginning with `DPS`.
|
|
60
|
-
- `emitirNfse` checks certificate validity before signing and again before transmission. Holder matching is an explicit `assertCertificateForProvider` call, not an automatic requirement.
|
|
61
|
-
- JSON environment precedence is options > request > restricted; external XML derives its environment from `tpAmb` and rejects explicit conflicts.
|
|
62
|
-
- `client.invoices.get(key, { ambiente })` supports an explicit environment; otherwise defaults.ambiente > constructor. It does not remember the last emission.
|
|
63
|
-
- Currency discrepancies are warnings; explicit values retain priority. Service amounts must remain positive after rounding; all foreign amounts are serialized with two decimals.
|
|
64
|
-
- `validateDpsJsonRequest` returns independent normalized data, errors in `issues`, and non-blocking `warnings`.
|
|
65
|
-
- `EmitirNotaError` covers SEFIN rejection and incomplete/invalid HTTP 2xx authorization responses, including missing/invalid/conflicting 50-digit access keys. Reconcile before retrying; the SDK never retries automatically.
|
|
66
|
-
- `sefinClient.ts` uses PEM key/cert material for mTLS, not the raw PFX in the Node TLS handshake.
|
|
67
|
-
- SEFIN latency metrics are off by default, enabled through `NFSE_SEFIN_LATENCY_METRICS`, and emitted for the external request only; keep them separate from API route latency when integrating observability.
|
|
68
|
-
|
|
69
|
-
## Change Guidance for LLMs
|
|
70
|
-
|
|
71
|
-
- Preserve the public API names exported by `index.ts` unless the task explicitly asks for a breaking change.
|
|
72
|
-
- Prefer adding or adjusting focused tests in `test/` when changing XML generation, validation, signing, transport parsing, or client defaults.
|
|
73
|
-
- When adding support for a new NFS-e layout field, update the TypeScript interface, validation rules, builder output, docs/examples, and tests together.
|
|
74
|
-
- Do not add fiscal assumptions to make examples pass. Required fiscal choices should stay explicit in user input.
|
|
75
|
-
- Be careful with XML ordering. The generated order should follow the SEFIN schema, and tests may compare XML snippets.
|
|
76
|
-
- Do not hand-wave certificate handling. PFX content may arrive as a `Buffer` or base64 string.
|
|
77
|
-
- Network calls to SEFIN should stay isolated in `sefinClient.ts` so tests can mock transport boundaries.
|
|
78
|
-
|
|
79
|
-
## Useful Commands
|
|
1
|
+
# @useinvio/nfse-sdk
|
|
2
|
+
|
|
3
|
+
> TypeScript SDK for Brazil's NFS-e Nacional (SEFIN/ADN). It issues, queries and cancels national service invoices: builds the DPS from JSON, validates it against the official XSD, signs it (XMLDSIG), sends it over mTLS with an ICP-Brasil A1 certificate, and returns SEFIN's answer as typed results and typed errors. It is not a tax engine: service codes, regime, tax blocks and DPS numbering always come from the user.
|
|
4
|
+
|
|
5
|
+
This file is for AI assistants writing code that uses the package. To change the SDK itself, read `AGENTS.md` in the repository.
|
|
6
|
+
|
|
7
|
+
## Install and certificate
|
|
80
8
|
|
|
81
9
|
```bash
|
|
82
|
-
npm
|
|
83
|
-
|
|
84
|
-
|
|
10
|
+
npm install @useinvio/nfse-sdk # Node.js >= 20, ESM, no native binaries
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { NfseCertificate } from '@useinvio/nfse-sdk';
|
|
15
|
+
const certificado = NfseCertificate.fromEnv(); // NFSE_CERT_PATH or NFSE_CERT_BASE64, plus NFSE_CERT_PASSWORD or NFSE_CERT_PASSWORD_FILE
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`NfseCertificate` keeps the private key out of the object; `console.log` and `JSON.stringify` show only CNPJ/CPF, validity and fingerprint. Never log, commit or ask for the `.pfx` or its password. Other loaders: `fromFile(path, pwd)`, `fromBase64(b64, pwd)`, `fromPfx(buffer, pwd)`, `fromPem({ key, cert })`. Errors: `CertificateValidationError` with `code` (`CERTIFICATE_INVALID_PASSWORD`, `CERTIFICATE_EXPIRED`, ...).
|
|
19
|
+
|
|
20
|
+
## Issue
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { emitirNfse, EmitirNotaError, explicarErros, type DpsJsonRequest } from '@useinvio/nfse-sdk';
|
|
24
|
+
|
|
25
|
+
const nota: DpsJsonRequest = {
|
|
26
|
+
ambiente: 'restrita', // official sandbox; 'producao' is legally valid
|
|
27
|
+
prestador: { cnpj, cLocEmi, serie, opSimpNac, regEspTrib },
|
|
28
|
+
servico: { cTribNac, xDescServ, cLocPrestacao },
|
|
29
|
+
emissao: { nDPS, valores: { vServ: '1500.00' }, tributacaoMunicipal, tributacaoFederal, totTrib },
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
const { chaveAcesso, dpsId, nfseXml } = await emitirNfse(nota, certificado);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (error instanceof EmitirNotaError) console.table(explicarErros(error.erros)); // official rule per code
|
|
35
|
+
else throw error; // network/timeout: the outcome is unknown, see "Recover"
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Keep fiscal codes and amounts as strings (leading zeros matter). Do not invent `cTribNac`, IBGE codes, regime or tax blocks; ask the user. Field reference: `JSON_MAPPING.md`.
|
|
40
|
+
- Validate without sending: `validateDpsJsonRequest(nota)` returns `{ valid, issues, warnings }`; `buildDpsFromJson(nota)` returns `{ id, xml }`.
|
|
41
|
+
- Persist before sending: `const p = prepararNota(nota, cert)` then `transmitirNotaPreparada(p, cert)`.
|
|
42
|
+
- Each `nDPS` (with `serie`) produces one invoice; increment it after a successful emission.
|
|
43
|
+
|
|
44
|
+
## Recover after a timeout (never resend blindly)
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
const existing = await recuperarNfsePorDps(p.dpsId, certificado, p.ambiente, { retries: 3 });
|
|
48
|
+
// existing !== null: it was issued. null: SEFIN never got it; resend the SAME prepared DPS.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
POST requests (emission, events) are never retried by the SDK. `{ timeoutMs, retries, signal }` works on every call; `retries` applies to GETs only.
|
|
52
|
+
|
|
53
|
+
## Query, PDF, cancel
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const { nfseXml, resumo } = await obterNfse(chaveAcesso, certificado); // ConsultaNfseError, .notFound on 404
|
|
57
|
+
const { pdf } = await baixarDanfse(chaveAcesso, certificado);
|
|
58
|
+
await cancelarNfse({ chaveAcesso, cMotivo: '1', xMotivo: 'Nota emitida com valor incorreto' }, certificado); // RegistrarEventoError
|
|
59
|
+
await cancelarNfsePorSubstituicao({ chaveAcesso, chaveSubstituta, cMotivo: '01' }, certificado);
|
|
85
60
|
```
|
|
61
|
+
|
|
62
|
+
`cMotivo` for cancellation: `1` issuing error, `2` service not provided, `9` other; `xMotivo` 15 to 255 characters. `lerNfse(xml)` reads an NFS-e XML you already have. ADN: `distribuirDfePorNsu`, `consultarConvenio`, `consultarAliquota`, `consultarRetencoes`.
|
|
63
|
+
|
|
64
|
+
## Client
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
const client = new NfseClient({ environment: 'sandbox', certificate: certificado, defaults: { prestador, servico }, request: { timeoutMs: 30_000, retries: 2 } });
|
|
68
|
+
await client.invoices.create({ emissao }); // also retrieve, recover, cancel, cancelBySubstitution, danfse
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Rejection codes
|
|
72
|
+
|
|
73
|
+
`explicarRejeicao('E0014')` returns the official message, rule and XML field from the gov.br annexes (Anexo I v1.01, Anexo II v1.01), `conhecida: false` for codes not in the catalog. `explicarErros(error.erros)` explains a whole rejection.
|
|
74
|
+
|
|
75
|
+
## Tests without a certificate or network
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
import { createTestCertificate, installMockSefin } from '@useinvio/nfse-sdk/testing';
|
|
79
|
+
const mock = installMockSefin(); // in-process SEFIN + ADN; validates XSD and signatures
|
|
80
|
+
const { certificate } = createTestCertificate({ cnpj: '12345678000195' });
|
|
81
|
+
// ... emitirNfse / obterNfse / cancelarNfse work as usual ...
|
|
82
|
+
mock.rejectNext('E0312'); mock.dropResponseNext(); // script rejections and dropped connections
|
|
83
|
+
mock.restore();
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Command line
|
|
87
|
+
|
|
88
|
+
`npx nfse init` (sample nota.json), `nfse doctor`, `nfse validate nota.json`, `nfse emit nota.json [--mock] [--producao] [--yes] [--json]`, `nfse get <chave>`, `nfse danfse <chave>`, `nfse cancel <chave> --motivo 1 --justificativa "..."`, `nfse recover <dpsId>`, `nfse explain E0014`. Exit codes: 0 ok, 1 error, 2 SEFIN rejection.
|
|
89
|
+
|
|
90
|
+
## AI agents and MCP
|
|
91
|
+
|
|
92
|
+
- `npx -y @useinvio/nfse-mcp`: MCP stdio server. Env: certificate vars above, `NFSE_AMBIENTE`, `NFSE_MCP_ALLOW_WRITE=1` (emit/cancel), `NFSE_MCP_MOCK=1` (mock SEFIN).
|
|
93
|
+
- `@useinvio/nfse-sdk/agent`: `nfseAgentTools` (read-only: `validate_dps`, `build_dps_xml`, `get_nfse`, `recover_nfse_by_dps`, `explain_rejection`) and `createNfseAgentToolkit({ allowWrite })`, which adds `prepare_*`/`confirm_*` emission and cancellation. Certificate and environment are host context, never tool input. Only call `confirm_*` after the user approves the summary from `prepare_*`.
|
|
94
|
+
- Claude Code plugin: `/plugin install nfse-nacional --marketplace useinvio/nfse-sdk`.
|
|
95
|
+
|
|
96
|
+
## Docs
|
|
97
|
+
|
|
98
|
+
- `docs/README.md` (pt-BR): tutorial, guides, API and error reference.
|
|
99
|
+
- `docs/referencia/erros.md`: every error class and code.
|
|
100
|
+
- `docs/referencia/ambientes.md`: SEFIN and ADN URLs and endpoints.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinvio/nfse-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "TypeScript SDK for Brazil's national NFS-e: JSON to DPS/XML, XMLDSIG, GZip/Base64, mTLS and SEFIN errors.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./agent": {
|
|
14
|
+
"types": "./dist/agent.d.ts",
|
|
15
|
+
"import": "./dist/agent.js"
|
|
16
|
+
},
|
|
17
|
+
"./testing": {
|
|
18
|
+
"types": "./dist/testing.d.ts",
|
|
19
|
+
"import": "./dist/testing.js"
|
|
20
|
+
},
|
|
21
|
+
"./mcp": {
|
|
22
|
+
"types": "./dist/mcpServer.d.ts",
|
|
23
|
+
"import": "./dist/mcpServer.js"
|
|
24
|
+
},
|
|
13
25
|
"./package.json": "./package.json"
|
|
14
26
|
},
|
|
15
27
|
"files": [
|
|
@@ -17,10 +29,13 @@
|
|
|
17
29
|
"dist/*.js",
|
|
18
30
|
"dist/*.js.map",
|
|
19
31
|
"dist/schemas/**/*.xsd",
|
|
20
|
-
"docs
|
|
32
|
+
"docs/**/*.md",
|
|
33
|
+
"!docs/rejeicoes/**",
|
|
21
34
|
"examples/*.ts",
|
|
22
35
|
"examples/README.md",
|
|
23
36
|
"README.md",
|
|
37
|
+
"README.en.md",
|
|
38
|
+
"CHANGELOG.md",
|
|
24
39
|
"JSON_MAPPING.md",
|
|
25
40
|
"llms.txt",
|
|
26
41
|
"LICENSE",
|
|
@@ -30,7 +45,10 @@
|
|
|
30
45
|
"build": "tsc -p tsconfig.json",
|
|
31
46
|
"prepare": "npm run build",
|
|
32
47
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
33
|
-
"test": "npm run build && tsc -p tsconfig.test.json && node --test dist-test/test/*.test.js"
|
|
48
|
+
"test": "npm run build && tsc -p tsconfig.test.json && node --test dist-test/test/*.test.js",
|
|
49
|
+
"typecheck:examples": "tsc -p tsconfig.examples.json",
|
|
50
|
+
"build:rejection-pages": "npm run build && node scripts/build-rejection-pages.mjs",
|
|
51
|
+
"build:playground": "node scripts/build-playground.mjs"
|
|
34
52
|
},
|
|
35
53
|
"keywords": [
|
|
36
54
|
"nfse",
|
|
@@ -62,16 +80,23 @@
|
|
|
62
80
|
"access": "public"
|
|
63
81
|
},
|
|
64
82
|
"dependencies": {
|
|
65
|
-
"@xmldom/xmldom": "^0.8.
|
|
66
|
-
"
|
|
67
|
-
"
|
|
83
|
+
"@xmldom/xmldom": "^0.8.15",
|
|
84
|
+
"libxml2-wasm": "^0.7.2",
|
|
85
|
+
"node-forge": "^1.4.3",
|
|
86
|
+
"xml-crypto": "^6.4.0"
|
|
68
87
|
},
|
|
69
88
|
"devDependencies": {
|
|
89
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
70
90
|
"@types/node": "^22.13.14",
|
|
71
91
|
"@types/node-forge": "^1.3.11",
|
|
92
|
+
"esbuild": "^0.28.2",
|
|
72
93
|
"typescript": "^5.6.2"
|
|
73
94
|
},
|
|
74
95
|
"engines": {
|
|
75
96
|
"node": ">=20"
|
|
97
|
+
},
|
|
98
|
+
"bin": {
|
|
99
|
+
"nfse": "dist/cliBin.js",
|
|
100
|
+
"nfse-mcp": "dist/mcpCli.js"
|
|
76
101
|
}
|
|
77
102
|
}
|