@treeunfe/nfce 1.0.5
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/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/adapters/CTe.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/adapters/CTe.js +40 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/adapters/CTe.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/index.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/index.js +23 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFe.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFe.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFe.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFePorNSU.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFePorNSU.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFePorNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFePorUltNSU.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFePorUltNSU.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/CTEDistribuicaoDFe/CTEDistribuicaoDFePorUltNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/index.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/index.js +20 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/operations/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFePorNSU.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFePorNSU.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFePorNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFePorUltNSU.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFePorUltNSU.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFePorUltNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFeService.d.ts +18 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFeService.js +115 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/CTEDistribuicaoDFeService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/util/DistribuicaoHandler.d.ts +21 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/util/DistribuicaoHandler.js +131 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/CTEDistribuicaoDFe/util/DistribuicaoHandler.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/index.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/index.js +20 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/cte/src/services/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/danfe/src/index.d.ts +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/danfe/src/index.js +19 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/danfe/src/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/adapters/NFe.d.ts +44 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/adapters/NFe.js +114 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/adapters/NFe.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/index.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/index.js +23 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEAutorizacao/NFEAutorizacao.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEAutorizacao/NFEAutorizacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEAutorizacao/NFEAutorizacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEConsultaProtocolo/NFEconsultaProtocolo.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEConsultaProtocolo/NFEconsultaProtocolo.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEConsultaProtocolo/NFEconsultaProtocolo.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFe.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFe.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFe.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorChave.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorChave.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorChave.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorNSU.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorNSU.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorUltNSU.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorUltNSU.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEDistribuicaoDFe/NFEDistribuicaoDFePorUltNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEInutilizacao/NFEInutilizacao.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEInutilizacao/NFEInutilizacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEInutilizacao/NFEInutilizacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECancelamento.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECancelamento.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECancelamento.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECartaDeCorrecao.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECartaDeCorrecao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECartaDeCorrecao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECienciaDaOperacao.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECienciaDaOperacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFECienciaDaOperacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEConfirmacaoDaOperacao.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEConfirmacaoDaOperacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEConfirmacaoDaOperacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEDesconhecimentoDaOperacao.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEDesconhecimentoDaOperacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEDesconhecimentoDaOperacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEEpec.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEEpec.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEEpec.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEOperacaoNaoRealizada.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEOperacaoNaoRealizada.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFEOperacaoNaoRealizada.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFERecepcaoEvento.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFERecepcaoEvento.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERecepcaoEvento/NFERecepcaoEvento.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERetornoAutorizacao/NFERetornoAutorizacao.d.ts +17 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERetornoAutorizacao/NFERetornoAutorizacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFERetornoAutorizacao/NFERetornoAutorizacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEStatusServico/NFEStatusServico.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEStatusServico/NFEStatusServico.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/NFEStatusServico/NFEStatusServico.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/index.d.ts +17 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/index.js +34 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/operations/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEAutorizacao/NFEAutorizacaoService.d.ts +31 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEAutorizacao/NFEAutorizacaoService.js +371 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEAutorizacao/NFEAutorizacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEConsultaProtocolo/NFEconsultaProtocoloService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEConsultaProtocolo/NFEconsultaProtocoloService.js +40 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEConsultaProtocolo/NFEconsultaProtocoloService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorChave.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorChave.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorChave.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorNSU.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorNSU.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorUltNSU.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorUltNSU.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFePorUltNSU.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFeService.d.ts +17 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFeService.js +114 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/NFEDistribuicaoDFeService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/util/DistribuicaoHandler.d.ts +20 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/util/DistribuicaoHandler.js +115 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEDistribuicaoDFe/util/DistribuicaoHandler.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEInutilizacao/NFEInutilizacaoService.d.ts +21 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEInutilizacao/NFEInutilizacaoService.js +87 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEInutilizacao/NFEInutilizacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECancelamentoService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECancelamentoService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECancelamentoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECartaDeCorrecaoService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECartaDeCorrecaoService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECartaDeCorrecaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECienciaDaOperacaoService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECienciaDaOperacaoService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFECienciaDaOperacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEConfirmacaoDaOperacaoService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEConfirmacaoDaOperacaoService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEConfirmacaoDaOperacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEDesconhecimentoDaOperacaoService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEDesconhecimentoDaOperacaoService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEDesconhecimentoDaOperacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEEpecService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEEpecService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEEpecService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEOperacaoNaoRealizadaService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEOperacaoNaoRealizadaService.js +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFEOperacaoNaoRealizadaService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFERecepcaoEventoService.d.ts +39 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFERecepcaoEventoService.js +280 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERecepcaoEvento/NFERecepcaoEventoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERetornoAutorizacao/NFERetornoAutorizacaoService.d.ts +48 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERetornoAutorizacao/NFERetornoAutorizacaoService.js +150 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFERetornoAutorizacao/NFERetornoAutorizacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEStatusServico/NFEStatusServicoService.d.ts +8 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEStatusServico/NFEStatusServicoService.js +41 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/NFEStatusServico/NFEStatusServicoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/TreeunfeDFe/TreeunfeDFeService.d.ts +139 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/TreeunfeDFe/TreeunfeDFeService.js +782 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/TreeunfeDFe/TreeunfeDFeService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/index.d.ts +18 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/index.js +35 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfe/src/services/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/adapters/NFSe.d.ts +65 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/adapters/NFSe.js +123 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/adapters/NFSe.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/index.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/index.js +23 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeAutorizacao/NFSeAutorizacao.d.ts +14 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeAutorizacao/NFSeAutorizacao.js +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeAutorizacao/NFSeAutorizacao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeConsulta/NFSeConsulta.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeConsulta/NFSeConsulta.js +13 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeConsulta/NFSeConsulta.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeDistribuicao/NFSeDistribuicao.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeDistribuicao/NFSeDistribuicao.js +13 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeDistribuicao/NFSeDistribuicao.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeEventos/NFSeEventos.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeEventos/NFSeEventos.js +13 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeEventos/NFSeEventos.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeParametrosMunicipais/NFSeParametrosMunicipais.d.ts +14 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeParametrosMunicipais/NFSeParametrosMunicipais.js +28 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/NFSeParametrosMunicipais/NFSeParametrosMunicipais.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/index.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/index.js +22 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/operations/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeAutorizacao/NFSeAutorizacaoService.d.ts +35 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeAutorizacao/NFSeAutorizacaoService.js +261 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeAutorizacao/NFSeAutorizacaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeConsulta/NFSeConsultaService.d.ts +16 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeConsulta/NFSeConsultaService.js +38 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeConsulta/NFSeConsultaService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeDistribuicao/NFSeDistribuicaoService.d.ts +16 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeDistribuicao/NFSeDistribuicaoService.js +251 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeDistribuicao/NFSeDistribuicaoService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeEventos/NFSeEventosService.d.ts +36 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeEventos/NFSeEventosService.js +374 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeEventos/NFSeEventosService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeParametrosMunicipais/NFSeParametrosMunicipaisService.d.ts +20 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeParametrosMunicipais/NFSeParametrosMunicipaisService.js +104 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/NFSeParametrosMunicipais/NFSeParametrosMunicipaisService.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/index.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/index.js +22 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/nfse/src/services/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/GerarConsultaImpl.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/GerarConsultaImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/GerarConsultaImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/HttpClient.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/HttpClient.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/HttpClient.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/SaveFilesImpl.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/SaveFilesImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/SaveFilesImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/TreeunfeDFeImpl.d.ts +50 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/TreeunfeDFeImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/TreeunfeDFeImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/TreeunfeDFeServiceImpl.d.ts +57 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/TreeunfeDFeServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/TreeunfeDFeServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/index.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/index.js +22 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/common/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/cte/CTEDistribuicaoDFeServiceImpl.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/cte/CTEDistribuicaoDFeServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/cte/CTEDistribuicaoDFeServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/cte/index.d.ts +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/cte/index.js +18 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/cte/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/index.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/index.js +23 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/NFCEAutorizacaoServiceImpl.d.ts +11 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/NFCEAutorizacaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/NFCEAutorizacaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/NFCERetornoAutorizacaoServiceImpl.d.ts +13 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/NFCERetornoAutorizacaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/NFCERetornoAutorizacaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/index.d.ts +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/index.js +19 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfce/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEAutorizacaoServiceImpl.d.ts +11 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEAutorizacaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEAutorizacaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEDistribuicaoDFeServiceImpl.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEDistribuicaoDFeServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEDistribuicaoDFeServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEInutilizacaoServiceImpl.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEInutilizacaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEInutilizacaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFERecepcaoEventoServiceImpl.d.ts +9 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFERecepcaoEventoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFERecepcaoEventoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFERetornoAutorizacaoServiceImpl.d.ts +13 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFERetornoAutorizacaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFERetornoAutorizacaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEStatusServicoServiceImpl.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEStatusServicoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEStatusServicoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEconsultaProtocoloServiceImpl.d.ts +3 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEconsultaProtocoloServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/NFEconsultaProtocoloServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/index.d.ts +7 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/index.js +24 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfe/index.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeAutorizacaoServiceImpl.d.ts +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeAutorizacaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeAutorizacaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeConsultaServiceImpl.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeConsultaServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeConsultaServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeDistribuicaoServiceImpl.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeDistribuicaoServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeDistribuicaoServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeEventosServiceImpl.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeEventosServiceImpl.js +2 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeEventosServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeParametrosMunicipaisServiceImpl.d.ts +10 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeParametrosMunicipaisServiceImpl.js +18 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/NFSeParametrosMunicipaisServiceImpl.js.map +1 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/index.d.ts +5 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/index.js +22 -0
- package/.rollup.cache/home/juniortrojilio/github.com/treeunfe/treeunfe-dfe/packages/treeunfe-dfe/src/interfaces/nfse/index.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/adapters/NFCe.d.ts +22 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/adapters/NFCe.js +85 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/adapters/NFCe.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/adapters/index.d.ts +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/adapters/index.js +18 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/adapters/index.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/index.d.ts +4 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/index.js +25 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/index.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/NFCEAutorizacao/NFCEAutorizacao.d.ts +7 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/NFCEAutorizacao/NFCEAutorizacao.js +10 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/NFCEAutorizacao/NFCEAutorizacao.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/NFCERetornoAutorizacao/NFCERetornoAutorizacao.d.ts +17 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/NFCERetornoAutorizacao/NFCERetornoAutorizacao.js +10 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/NFCERetornoAutorizacao/NFCERetornoAutorizacao.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/index.d.ts +2 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/index.js +19 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/operations/index.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCEAutorizacao/NFCEAutorizacaoService.d.ts +32 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCEAutorizacao/NFCEAutorizacaoService.js +424 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCEAutorizacao/NFCEAutorizacaoService.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCEAutorizacao/util/NFCEQRCode.d.ts +3 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCEAutorizacao/util/NFCEQRCode.js +38 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCEAutorizacao/util/NFCEQRCode.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCERetornoAutorizacao/NFCERetornoAutorizacaoService.d.ts +52 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCERetornoAutorizacao/NFCERetornoAutorizacaoService.js +141 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/NFCERetornoAutorizacao/NFCERetornoAutorizacaoService.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/index.d.ts +2 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/index.js +19 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/src/services/index.js.map +1 -0
- package/.rollup.cache/home/runner/work/treeunfe-dfe/treeunfe-dfe/packages/nfce/dist/tsconfig.tsbuildinfo +1 -0
- package/.turbo/turbo-build.log +15 -0
- package/CHANGELOG.md +36 -0
- package/LICENSE.txt +221 -0
- package/dist/index.cjs +713 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +701 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/adapters/NFCe.d.ts +22 -0
- package/dist/src/adapters/index.d.ts +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/operations/NFCEAutorizacao/NFCEAutorizacao.d.ts +7 -0
- package/dist/src/operations/NFCERetornoAutorizacao/NFCERetornoAutorizacao.d.ts +17 -0
- package/dist/src/operations/index.d.ts +2 -0
- package/dist/src/services/NFCEAutorizacao/NFCEAutorizacaoService.d.ts +32 -0
- package/dist/src/services/NFCEAutorizacao/util/NFCEQRCode.d.ts +3 -0
- package/dist/src/services/NFCERetornoAutorizacao/NFCERetornoAutorizacaoService.d.ts +52 -0
- package/dist/src/services/index.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +61 -0
- package/rollup.config.js +187 -0
- package/src/adapters/NFCe.ts +104 -0
- package/src/adapters/index.ts +18 -0
- package/src/index.ts +28 -0
- package/src/operations/NFCEAutorizacao/NFCEAutorizacao.ts +32 -0
- package/src/operations/NFCERetornoAutorizacao/NFCERetornoAutorizacao.ts +42 -0
- package/src/operations/index.ts +19 -0
- package/src/services/NFCEAutorizacao/NFCEAutorizacaoService.ts +532 -0
- package/src/services/NFCEAutorizacao/util/NFCEQRCode.ts +68 -0
- package/src/services/NFCERetornoAutorizacao/NFCERetornoAutorizacaoService.ts +189 -0
- package/src/services/index.ts +19 -0
- package/tsconfig.json +17 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
export * from '@treeunfe/types';
|
|
2
|
+
import { NFCEGerarDanfe } from '@treeunfe/danfe';
|
|
3
|
+
import { BaseNFe, logger, XmlParser, ValidaCPFCNPJ, mountICMS, mountPIS, mountCOFINS, Environment, Utility, SaveFiles, XmlBuilder, GerarConsulta } from '@treeunfe/shared';
|
|
4
|
+
import { format } from 'date-fns';
|
|
5
|
+
import xml2js, { Builder } from 'xml2js';
|
|
6
|
+
import { createHash } from 'crypto';
|
|
7
|
+
import sha1 from 'sha1';
|
|
8
|
+
|
|
9
|
+
class NFCEAutorizacao {
|
|
10
|
+
constructor(nfceAutorizacaoService) {
|
|
11
|
+
this.nfceAutorizacaoService = nfceAutorizacaoService;
|
|
12
|
+
}
|
|
13
|
+
async Exec(data) {
|
|
14
|
+
return await this.nfceAutorizacaoService.Exec(data);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class NFCERetornoAutorizacao {
|
|
19
|
+
constructor(nfceAutorizacaoRetornoService) {
|
|
20
|
+
this.nfceAutorizacaoRetornoService = nfceAutorizacaoRetornoService;
|
|
21
|
+
}
|
|
22
|
+
async getXmlRetorno(data) {
|
|
23
|
+
return await this.nfceAutorizacaoRetornoService.getXmlRetorno(data);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* This file is part of Treeunfe DFe.
|
|
29
|
+
*
|
|
30
|
+
* Treeunfe DFe is free software: you can redistribute it and/or modify
|
|
31
|
+
* it under the terms of the GNU General Public License as published by
|
|
32
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
33
|
+
* (at your option) any later version.
|
|
34
|
+
*
|
|
35
|
+
* Treeunfe DFe is distributed in the hope that it will be useful,
|
|
36
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
37
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
38
|
+
* GNU General Public License for more details.
|
|
39
|
+
*
|
|
40
|
+
* You should have received a copy of the GNU General Public License
|
|
41
|
+
* along with Treeunfe DFe. If not, see <https://www.gnu.org/licenses/>.
|
|
42
|
+
*/
|
|
43
|
+
class NFCERetornoAutorizacaoService extends BaseNFe {
|
|
44
|
+
constructor(environment, utility, xmlBuilder, axios, saveFiles, gerarConsulta) {
|
|
45
|
+
super(environment, utility, xmlBuilder, 'NFERetAutorizacao', axios, saveFiles, gerarConsulta);
|
|
46
|
+
}
|
|
47
|
+
gerarXml(data) {
|
|
48
|
+
logger.info('Montando estrutuda do XML em JSON', {
|
|
49
|
+
context: 'NFCEAutorizacaoService',
|
|
50
|
+
});
|
|
51
|
+
const { ambiente } = this.environment.getConfig();
|
|
52
|
+
const xmlObject = {
|
|
53
|
+
$: {
|
|
54
|
+
xmlns: 'http://www.portalfiscal.inf.br/nfe',
|
|
55
|
+
versao: "4.00",
|
|
56
|
+
},
|
|
57
|
+
tpAmb: ambiente,
|
|
58
|
+
nRec: data
|
|
59
|
+
};
|
|
60
|
+
return this.xmlBuilder.gerarXml(xmlObject, 'consReciNFe', this.metodo);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Busca o retorno da Autorização pelo número do recibo (nRec)
|
|
64
|
+
*
|
|
65
|
+
* @param {string} nRec - Número do recibo retornado pela SEFAZ ao emitir uma NFe em modo assíncrono.
|
|
66
|
+
* @param {any} xmlNFe - Array contendo as NFe do lote enviado à SEFAZ.
|
|
67
|
+
* @returns {Promise<string>} XML completo da NFe (já com protocolo de autorização).
|
|
68
|
+
*/
|
|
69
|
+
async getRetornoRecibo(nRec, xmlNFe) {
|
|
70
|
+
/**
|
|
71
|
+
* Gera o XML para consulta de acordo com o número do recibo da emissão (nRec)
|
|
72
|
+
*/
|
|
73
|
+
const xmlConsulta = this.gerarXml(nRec);
|
|
74
|
+
const { xmlFormated, agent, webServiceUrl, action } = await this.gerarConsulta.gerarConsulta(xmlConsulta, this.metodo);
|
|
75
|
+
// Salva XML de Consulta
|
|
76
|
+
this.utility.salvaConsulta(xmlConsulta, xmlFormated, this.metodo);
|
|
77
|
+
// Efetua requisição para o webservice NFEStatusServico
|
|
78
|
+
const xmlRetorno = await this.axios.post(webServiceUrl, xmlFormated, {
|
|
79
|
+
headers: {
|
|
80
|
+
'Content-Type': this.setContentType(),
|
|
81
|
+
'SOAPAction': action,
|
|
82
|
+
},
|
|
83
|
+
httpsAgent: agent
|
|
84
|
+
});
|
|
85
|
+
const responseInJson = this.utility.verificaRejeicao(xmlRetorno.data, this.metodo);
|
|
86
|
+
// Salva XML de Retorno
|
|
87
|
+
this.utility.salvaRetorno(xmlRetorno.data, responseInJson, this.metodo);
|
|
88
|
+
const { protNFe } = this.utility.getProtNFe(xmlRetorno.data);
|
|
89
|
+
if (!protNFe) {
|
|
90
|
+
throw new Error(`Não foi possível encontrar a tag 'protNFe'. Talvez a NFe ainda não tenha sido processada.`);
|
|
91
|
+
}
|
|
92
|
+
return this.getXmlRetornoAutorizacao(protNFe, xmlNFe);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Agrega o protNFe ao restante da NFe gerada na emissão.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} protNFe - Tag protNFe do XML em formato JSON.
|
|
98
|
+
* @param {any} xmlNFe - Array contendo as NFe do lote enviado à SEFAZ.
|
|
99
|
+
* @returns {} XML completo da NFe (já com protocolo de autorização).
|
|
100
|
+
*/
|
|
101
|
+
getXmlRetornoAutorizacao(protNFe, xmlNFe) {
|
|
102
|
+
/**
|
|
103
|
+
* Cria o Obj base da NFe já processada (nfeProc)
|
|
104
|
+
*/
|
|
105
|
+
const XMLs = [];
|
|
106
|
+
for (let i = 0; i < protNFe.length; i++) {
|
|
107
|
+
const baseXML = {
|
|
108
|
+
$: {
|
|
109
|
+
versao: "4.00",
|
|
110
|
+
xmlns: 'http://www.portalfiscal.inf.br/nfe'
|
|
111
|
+
},
|
|
112
|
+
_: '[XML]'
|
|
113
|
+
};
|
|
114
|
+
let xml = this.xmlBuilder.gerarXml(baseXML, 'nfeProc', this.metodo);
|
|
115
|
+
/**
|
|
116
|
+
* Converte a tag protNFe do formato JSON para XML e armazena na string protTag.
|
|
117
|
+
* Adiciona a tag protNFe (armazenada na string protTag) ao array contendo os dados das NFe.
|
|
118
|
+
*/
|
|
119
|
+
// Expressão regular para capturar o valor do atributo Id
|
|
120
|
+
const formatedProtNFe = protNFe;
|
|
121
|
+
const xmlCompleto = xmlNFe.find((item) => item.indexOf(formatedProtNFe[i].infProt[0].chNFe[0]) !== -1);
|
|
122
|
+
if (xmlCompleto) {
|
|
123
|
+
const protTag = this.xmlBuilder.gerarXml(protNFe[i], 'protNFe', this.metodo);
|
|
124
|
+
const xmlFinal = [xmlCompleto];
|
|
125
|
+
xmlFinal.push(protTag);
|
|
126
|
+
/**
|
|
127
|
+
* Substitui o "[XML]" com as tags NFe e a tag protNFe
|
|
128
|
+
*/
|
|
129
|
+
xml = xml.replace('[XML]', xmlFinal.join(''));
|
|
130
|
+
xml = `<?xml version="1.0" encoding="UTF-8"?>${xml}`;
|
|
131
|
+
XMLs.push(xml);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
success: true,
|
|
136
|
+
message: 'xMotivo',
|
|
137
|
+
data: XMLs
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Retorna o XML completo da Autorização (já com o protocolo de autorização)
|
|
142
|
+
*
|
|
143
|
+
* @param {number} tipoEmissao - Informa se o tipo emissão foi síncrona ou assíncrona (0- Não / 1 - Sim).
|
|
144
|
+
* @param {string | undefined} nRec - Número do recibo retornado pela SEFAZ ao emitir uma NFe em modo assíncrono.
|
|
145
|
+
* @param {ProtNFe | undefined} protNFe - Tag protNFe do XML em formato JSON.
|
|
146
|
+
* @param {string[]} xmlNFe - Array contendo as NFe do lote enviado à SEFAZ.
|
|
147
|
+
* @returns {Promise<string>} XML completo da NFe (já com protocolo de autorização).
|
|
148
|
+
*/
|
|
149
|
+
async getXmlRetorno({ tipoEmissao, nRec, protNFe, xmlNFe }) {
|
|
150
|
+
/**
|
|
151
|
+
* Trata retorno Síncrono
|
|
152
|
+
*/
|
|
153
|
+
if (tipoEmissao === 1 && protNFe) {
|
|
154
|
+
return this.getXmlRetornoAutorizacao(protNFe, xmlNFe);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Trata retorno Assíncrono
|
|
158
|
+
*/
|
|
159
|
+
if (tipoEmissao === 0 && nRec) {
|
|
160
|
+
return this.getRetornoRecibo(nRec, xmlNFe);
|
|
161
|
+
}
|
|
162
|
+
throw new Error('Não foi possível buscar o retorno da autorização.');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Função para gerar o hash SHA-1 em formato hexadecimal
|
|
167
|
+
function generateSHA1Hash(input) {
|
|
168
|
+
return createHash('sha1').update(input).digest('hex');
|
|
169
|
+
}
|
|
170
|
+
function calcularDigestValueHex(digVal) {
|
|
171
|
+
return Buffer.from(digVal).toString('hex');
|
|
172
|
+
}
|
|
173
|
+
// Função para gerar a URL do QR Code para emissão ONLINE
|
|
174
|
+
function generateQRCodeURLOnline(chaveAcesso, versaoQRCode, tipoAmbiente, identificadorCSC, csc, utility) {
|
|
175
|
+
const urlQRCodeNFCe = utility.getUrlNFCe('URL-QRCode', false, '');
|
|
176
|
+
chaveAcesso = chaveAcesso.replace('NFe', '');
|
|
177
|
+
// Passo 1: Concatenar parâmetros
|
|
178
|
+
const baseString = `${chaveAcesso}|${versaoQRCode}|${tipoAmbiente}|${identificadorCSC}`;
|
|
179
|
+
// Passo 2: Adicionar o CSC
|
|
180
|
+
const stringToHash = `${baseString}${csc}`;
|
|
181
|
+
// Passo 3: Gerar o hash
|
|
182
|
+
const codigoHash = generateSHA1Hash(stringToHash);
|
|
183
|
+
// Montar a URL final
|
|
184
|
+
return `${urlQRCodeNFCe}?p=${baseString}|${codigoHash}`;
|
|
185
|
+
}
|
|
186
|
+
// Função para gerar a URL do QR Code para emissão OFFLINE
|
|
187
|
+
function generateQRCodeURLOffline(chaveAcesso, versaoQRCode, tipoAmbiente, diaDataEmissao, valorTotalNfce, digVal, identificadorCSC, csc, utility) {
|
|
188
|
+
const urlQRCodeNFCe = utility.getUrlNFCe('URL-QRCode', false, '');
|
|
189
|
+
chaveAcesso = chaveAcesso.replace('NFe', '');
|
|
190
|
+
// Passo 1: Converter DigestValue para HEXA
|
|
191
|
+
const digestValueHex = calcularDigestValueHex(digVal);
|
|
192
|
+
// Passo 2: Concatenar parâmetros
|
|
193
|
+
const baseString = `${chaveAcesso}|${versaoQRCode}|${tipoAmbiente}|${diaDataEmissao}|${valorTotalNfce}|${digestValueHex}|${identificadorCSC}`;
|
|
194
|
+
// Passo 3: Adicionar o CSC
|
|
195
|
+
const stringToHash = `${baseString}${csc}`;
|
|
196
|
+
// Passo 4: Gerar o hash
|
|
197
|
+
const hash = sha1(stringToHash).toUpperCase();
|
|
198
|
+
// Montar URL
|
|
199
|
+
return `${urlQRCodeNFCe}?p=${baseString}|${hash}`;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/*
|
|
203
|
+
* This file is part of Treeunfe DFe.
|
|
204
|
+
*
|
|
205
|
+
* Treeunfe DFe is free software: you can redistribute it and/or modify
|
|
206
|
+
* it under the terms of the GNU General Public License as published by
|
|
207
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
208
|
+
* (at your option) any later version.
|
|
209
|
+
*
|
|
210
|
+
* Treeunfe DFe is distributed in the hope that it will be useful,
|
|
211
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
212
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
213
|
+
* GNU General Public License for more details.
|
|
214
|
+
*
|
|
215
|
+
* You should have received a copy of the GNU General Public License
|
|
216
|
+
* along with Treeunfe DFe. If not, see <https://www.gnu.org/licenses/>.
|
|
217
|
+
*/
|
|
218
|
+
class NFCEAutorizacaoService extends BaseNFe {
|
|
219
|
+
constructor(environment, utility, xmlBuilder, axios, saveFiles, gerarConsulta) {
|
|
220
|
+
super(environment, utility, xmlBuilder, 'NFEAutorizacao', axios, saveFiles, gerarConsulta);
|
|
221
|
+
this.xmlNFe = [];
|
|
222
|
+
}
|
|
223
|
+
gerarXml(data) {
|
|
224
|
+
return this.gerarXmlNFCEAutorizacao(data);
|
|
225
|
+
}
|
|
226
|
+
salvaArquivos(_xmlConsulta, responseInJson, _xmlRetorno, options) {
|
|
227
|
+
// Recupera configuração do ambiente para verificar se os arquivos gerados serão gravados em disco
|
|
228
|
+
const config = this.environment.getConfig();
|
|
229
|
+
let dateAndTimeInFileName = config.incluirTimestampNoNomeDosArquivos;
|
|
230
|
+
const createFileName = (prefix, includeMethodName) => {
|
|
231
|
+
const dtaTime = dateAndTimeInFileName ? `-${format(new Date(), 'dd-MM-yyyy-HHmm')}` : '';
|
|
232
|
+
const baseFileName = '';
|
|
233
|
+
const prefixPart = prefix ? `${prefix}` : '';
|
|
234
|
+
const nfePart = responseInJson.chNFe ? `-${responseInJson.chNFe}` : '';
|
|
235
|
+
const dateTimePart = dtaTime;
|
|
236
|
+
return `${baseFileName}${prefixPart}${nfePart}${dateTimePart}`;
|
|
237
|
+
};
|
|
238
|
+
const salvarArquivo = (data, prefix, path, fileType, includeMethodName) => {
|
|
239
|
+
const fileName = createFileName(prefix);
|
|
240
|
+
const method = fileType === 'xml' ? 'salvaXML' : 'salvaJSON';
|
|
241
|
+
this.utility[method]({
|
|
242
|
+
data: data,
|
|
243
|
+
fileName,
|
|
244
|
+
metodo: this.metodo,
|
|
245
|
+
path,
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
let xmlAutorizacaoInJson = {};
|
|
249
|
+
let xMotivoPorXml = [];
|
|
250
|
+
let xmlsInJson = [];
|
|
251
|
+
if (options) {
|
|
252
|
+
const { xmlAutorizacao } = options;
|
|
253
|
+
const json = new XmlParser();
|
|
254
|
+
for (let i = 0; i < xmlAutorizacao.length; i++) {
|
|
255
|
+
xmlAutorizacaoInJson = json.convertXmlToJson(xmlAutorizacao[i], 'NFCEAutorizacaoFinal');
|
|
256
|
+
xmlsInJson.push(xmlAutorizacaoInJson);
|
|
257
|
+
const chNFe = xmlAutorizacaoInJson.protNFe.infProt.chNFe;
|
|
258
|
+
const xMotivo = xmlAutorizacaoInJson.protNFe.infProt.xMotivo;
|
|
259
|
+
const cStat = xmlAutorizacaoInJson.protNFe.infProt.cStat;
|
|
260
|
+
xMotivoPorXml.push({
|
|
261
|
+
chNFe,
|
|
262
|
+
xMotivo,
|
|
263
|
+
cStat,
|
|
264
|
+
});
|
|
265
|
+
if (config.armazenarXMLAutorizacao) {
|
|
266
|
+
salvarArquivo(xmlAutorizacao[i], chNFe, config.pathXMLAutorizacao, 'xml');
|
|
267
|
+
salvarArquivo(xmlAutorizacaoInJson, chNFe, config.pathXMLAutorizacao, 'json');
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
success: true,
|
|
272
|
+
xMotivo: xMotivoPorXml,
|
|
273
|
+
response: xmlsInJson,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
success: true,
|
|
278
|
+
xMotivo: xMotivoPorXml,
|
|
279
|
+
response: xmlsInJson,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
async trataRetorno(xmlRetorno, indSinc, _responseInJson) {
|
|
283
|
+
try {
|
|
284
|
+
/**
|
|
285
|
+
* Captura o valor nRec e protNFe
|
|
286
|
+
*/
|
|
287
|
+
const { nRec, protNFe } = this.utility.getProtNFe(xmlRetorno);
|
|
288
|
+
/**
|
|
289
|
+
* 0 - assíncrona
|
|
290
|
+
* 1 - síncrona
|
|
291
|
+
*/
|
|
292
|
+
let tipoEmissao = 0;
|
|
293
|
+
if (indSinc === 1 && protNFe) {
|
|
294
|
+
tipoEmissao = 1;
|
|
295
|
+
}
|
|
296
|
+
const nfeRetornoAutService = new NFCERetornoAutorizacaoService(this.environment, this.utility, this.xmlBuilder, this.axios, this.saveFiles, this.gerarConsulta);
|
|
297
|
+
const nfeRetornoAut = new NFCERetornoAutorizacao(nfeRetornoAutService);
|
|
298
|
+
const retorno = await nfeRetornoAut.getXmlRetorno({
|
|
299
|
+
tipoEmissao,
|
|
300
|
+
nRec,
|
|
301
|
+
protNFe,
|
|
302
|
+
xmlNFe: this.xmlNFe
|
|
303
|
+
});
|
|
304
|
+
return retorno;
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
throw new Error(error.message);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Método utilitário para criação do XML a partir de um Objeto
|
|
312
|
+
*/
|
|
313
|
+
anoMesEmissao(dhEmi) {
|
|
314
|
+
// Lógica para obter o ano e mês de emissão (AAMM)
|
|
315
|
+
const dataAtual = new Date(dhEmi);
|
|
316
|
+
const ano = dataAtual.getFullYear().toString().slice(-2);
|
|
317
|
+
const mes = (dataAtual.getMonth() + 1).toString().padStart(2, '0');
|
|
318
|
+
return ano + mes;
|
|
319
|
+
}
|
|
320
|
+
diaEmissao(dhEmi) {
|
|
321
|
+
// Converte a string para uma data
|
|
322
|
+
const dataAtual = new Date(dhEmi);
|
|
323
|
+
// Extrai o dia com dois dígitos
|
|
324
|
+
const dia = dataAtual.getDate().toString().padStart(2, '0');
|
|
325
|
+
// Retorna o dia
|
|
326
|
+
return dia;
|
|
327
|
+
}
|
|
328
|
+
calcularModulo11(sequencia) {
|
|
329
|
+
const pesos = [4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
330
|
+
let somatoria = 0;
|
|
331
|
+
for (let i = 0; i < sequencia.length; i++) {
|
|
332
|
+
somatoria += parseInt(sequencia.charAt(i)) * pesos[i];
|
|
333
|
+
}
|
|
334
|
+
const restoDivisao = somatoria % 11;
|
|
335
|
+
const digitoVerificador = restoDivisao === 0 || restoDivisao === 1 ? 0 : 11 - restoDivisao;
|
|
336
|
+
return digitoVerificador;
|
|
337
|
+
}
|
|
338
|
+
calcularDigitoVerificador(data) {
|
|
339
|
+
const { infNFe: { Id, ide: { cUF, mod, serie, nNF, tpEmis, cNF, dhEmi }, emit: { CNPJCPF }, }, } = data;
|
|
340
|
+
if (Id) {
|
|
341
|
+
this.chaveNfe = Id;
|
|
342
|
+
return {
|
|
343
|
+
chaveAcesso: `NFe${Id}`,
|
|
344
|
+
dv: parseInt(Id.charAt(Id.length - 1), 10),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
const anoMes = this.anoMesEmissao(dhEmi);
|
|
348
|
+
// Montando a sequência para o cálculo do dígito verificador
|
|
349
|
+
const sequencia = `${cUF}${anoMes}${CNPJCPF}${mod}${String(serie).padStart(3, '0')}${String(nNF).padStart(9, '0')}${tpEmis}${cNF}`;
|
|
350
|
+
// Calculando o dígito verificador
|
|
351
|
+
const dv = this.calcularModulo11(sequencia);
|
|
352
|
+
// Montando a chave de acesso
|
|
353
|
+
const chaveAcesso = `NFe${sequencia}` + dv;
|
|
354
|
+
this.chaveNfe = `${sequencia}${dv}`;
|
|
355
|
+
return {
|
|
356
|
+
chaveAcesso,
|
|
357
|
+
dv
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
validaDocumento(doc, campo) {
|
|
361
|
+
// Valida se CPF ou CNPJ
|
|
362
|
+
const nfeAutorizacaoHandler = new ValidaCPFCNPJ();
|
|
363
|
+
const { documentoValido, tipoDoDocumento } = nfeAutorizacaoHandler.validarCpfCnpj(doc);
|
|
364
|
+
if (!documentoValido || tipoDoDocumento === 'Desconhecido') {
|
|
365
|
+
const message = tipoDoDocumento === 'Desconhecido'
|
|
366
|
+
? `Documento do ${campo} ausente ou inválido`
|
|
367
|
+
: `${tipoDoDocumento} do ${campo} é inválido`;
|
|
368
|
+
throw new Error(message);
|
|
369
|
+
}
|
|
370
|
+
return tipoDoDocumento;
|
|
371
|
+
}
|
|
372
|
+
extrairDigestValue(xmlAssinado) {
|
|
373
|
+
const match = xmlAssinado.match(/<DigestValue>([^<]+)<\/DigestValue>/);
|
|
374
|
+
if (match && match[1]) {
|
|
375
|
+
return match[1];
|
|
376
|
+
}
|
|
377
|
+
throw new Error('DigestValue não encontrado no XML assinado.');
|
|
378
|
+
}
|
|
379
|
+
gerarXmlNFCEAutorizacao(data) {
|
|
380
|
+
logger.info('Montando estrutuda do XML em JSON', {
|
|
381
|
+
context: 'NFCEAutorizacaoService',
|
|
382
|
+
});
|
|
383
|
+
const createXML = (NFe) => {
|
|
384
|
+
// Verificando se existe mais de um produto
|
|
385
|
+
if (NFe?.infNFe?.det instanceof Array) {
|
|
386
|
+
// Adicionando indice ao item
|
|
387
|
+
const formatedItens = NFe.infNFe.det.map((det, index) => {
|
|
388
|
+
if (det.imposto.ICMS?.dadosICMS) {
|
|
389
|
+
const icms = mountICMS(det.imposto.ICMS.dadosICMS);
|
|
390
|
+
det.imposto.ICMS = icms;
|
|
391
|
+
}
|
|
392
|
+
if (det.imposto.PIS?.dadosPIS) {
|
|
393
|
+
const pis = mountPIS(det.imposto.PIS.dadosPIS);
|
|
394
|
+
det.imposto.PIS = pis;
|
|
395
|
+
}
|
|
396
|
+
if (det.imposto.COFINS?.dadosCOFINS) {
|
|
397
|
+
const cofins = mountCOFINS(det.imposto.COFINS.dadosCOFINS);
|
|
398
|
+
det.imposto.COFINS = cofins;
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
$: {
|
|
402
|
+
nItem: index + 1,
|
|
403
|
+
},
|
|
404
|
+
...det,
|
|
405
|
+
};
|
|
406
|
+
});
|
|
407
|
+
NFe.infNFe.det = formatedItens;
|
|
408
|
+
}
|
|
409
|
+
// Cria chave da nota e grava digito verificador
|
|
410
|
+
const { chaveAcesso, dv } = this.calcularDigitoVerificador(NFe);
|
|
411
|
+
NFe.infNFe.ide.cDV = dv;
|
|
412
|
+
NFe.infNFe.ide.verProc = NFe.infNFe.ide.verProc || '1.0.0.0';
|
|
413
|
+
// Valida Documento do emitente
|
|
414
|
+
NFe.infNFe.emit = Object.assign({ [this.validaDocumento(String(NFe.infNFe.emit.CNPJCPF), 'emitente')]: NFe.infNFe.emit.CNPJCPF }, NFe.infNFe.emit);
|
|
415
|
+
delete NFe.infNFe.emit.CNPJCPF;
|
|
416
|
+
// Valida Documento do destinatário
|
|
417
|
+
if (NFe.infNFe.dest) {
|
|
418
|
+
const tipoDocDest = this.validaDocumento(String(NFe.infNFe.dest?.CNPJCPF || ''), 'destinatário');
|
|
419
|
+
const cnpjcpfValue = NFe.infNFe.dest?.CNPJCPF || '';
|
|
420
|
+
const xNomeValue = NFe.infNFe.ide.tpAmb === 2
|
|
421
|
+
? 'NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL'
|
|
422
|
+
: NFe.infNFe.dest.xNome;
|
|
423
|
+
// Reconstrói o objeto dest mantendo a ordem correta
|
|
424
|
+
const { CNPJCPF, xNome, ...restoDest } = NFe.infNFe.dest;
|
|
425
|
+
NFe.infNFe.dest = {
|
|
426
|
+
[tipoDocDest]: cnpjcpfValue,
|
|
427
|
+
...(xNomeValue && { xNome: xNomeValue }),
|
|
428
|
+
...restoDest
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
// Valida Documento do transportador
|
|
432
|
+
if (NFe.infNFe.transp.transporta) {
|
|
433
|
+
NFe.infNFe.transp.transporta = Object.assign({ [this.validaDocumento(String(NFe.infNFe.transp.transporta?.CNPJCPF), 'transportador')]: NFe.infNFe.transp.transporta?.CNPJCPF }, NFe.infNFe.transp.transporta);
|
|
434
|
+
delete NFe.infNFe.transp.transporta?.CNPJCPF;
|
|
435
|
+
}
|
|
436
|
+
// Valida Documento do produtor rural
|
|
437
|
+
if (NFe.infNFe?.NFref instanceof Array) {
|
|
438
|
+
const NFrefArray = NFe.infNFe.NFref;
|
|
439
|
+
if (NFrefArray && NFrefArray.length > 0) {
|
|
440
|
+
NFe.infNFe.NFref = NFrefArray.map(NFref => {
|
|
441
|
+
if (NFref.refNFP) {
|
|
442
|
+
NFref.refNFP = Object.assign({ [this.validaDocumento(String(NFref.refNFP.CNPJCPF), 'produtor rural')]: NFref.refNFP.CNPJCPF }, NFref.refNFP);
|
|
443
|
+
delete NFref.refNFP.CNPJCPF;
|
|
444
|
+
}
|
|
445
|
+
return NFref;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
if (NFe.infNFe.NFref && NFe.infNFe.NFref.refNFP) {
|
|
451
|
+
NFe.infNFe.NFref.refNFP = Object.assign({ [this.validaDocumento(String(NFe.infNFe.NFref.refNFP.CNPJCPF), 'produtor rural')]: NFe.infNFe.NFref.refNFP.CNPJCPF }, NFe.infNFe.NFref.refNFP);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const { idCSRT, tokenCSC } = this.environment.getConfig();
|
|
455
|
+
if (!idCSRT) {
|
|
456
|
+
throw new Error('idCSRT não configurado. É necessário configurar o idCSRT nas configurações para gerar o QR Code da NFCe.');
|
|
457
|
+
}
|
|
458
|
+
let qrCode = '';
|
|
459
|
+
if (![4, 9].includes(NFe.infNFe.ide.tpEmis)) {
|
|
460
|
+
qrCode = generateQRCodeURLOnline(chaveAcesso, '2', NFe.infNFe.ide.tpAmb, Number(idCSRT), String(tokenCSC), this.utility);
|
|
461
|
+
}
|
|
462
|
+
const urlConsultaNFCe = this.utility.getUrlNFCe('URL-ConsultaNFCe', false, '');
|
|
463
|
+
const nfeWithQrCode = {
|
|
464
|
+
...NFe,
|
|
465
|
+
infNFeSupl: {
|
|
466
|
+
qrCode: qrCode,
|
|
467
|
+
urlChave: urlConsultaNFCe,
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
NFe = nfeWithQrCode;
|
|
471
|
+
const xmlObject = {
|
|
472
|
+
$: {
|
|
473
|
+
xmlns: 'http://www.portalfiscal.inf.br/nfe'
|
|
474
|
+
},
|
|
475
|
+
infNFe: {
|
|
476
|
+
$: {
|
|
477
|
+
versao: "4.00",
|
|
478
|
+
Id: chaveAcesso,
|
|
479
|
+
},
|
|
480
|
+
...NFe.infNFe
|
|
481
|
+
},
|
|
482
|
+
infNFeSupl: {
|
|
483
|
+
...NFe.infNFeSupl
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
const eventoXML = this.xmlBuilder.gerarXml(xmlObject, 'NFe', this.metodo);
|
|
487
|
+
let xmlAssinado = this.xmlBuilder.assinarXML(eventoXML, 'infNFe');
|
|
488
|
+
if ([4, 9].includes(NFe.infNFe.ide.tpEmis)) {
|
|
489
|
+
// capturar digestValue
|
|
490
|
+
const digestValue = this.extrairDigestValue(xmlAssinado);
|
|
491
|
+
// substituir tag qrcode
|
|
492
|
+
const tpAmb = NFe.infNFe.ide.tpAmb;
|
|
493
|
+
const valNF = NFe.infNFe.total.ICMSTot.vNF;
|
|
494
|
+
const diaEmissao = this.diaEmissao(NFe.infNFe.ide.dhEmi);
|
|
495
|
+
qrCode = generateQRCodeURLOffline(chaveAcesso, '2', tpAmb, diaEmissao, valNF, digestValue, Number(idCSRT), String(tokenCSC), this.utility);
|
|
496
|
+
xml2js.parseString(xmlAssinado, (err, result) => {
|
|
497
|
+
if (err) {
|
|
498
|
+
throw new Error('Erro ao parsear o XML para atualização do qrCode:');
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
if (result.NFe?.infNFeSupl[0]?.qrCode) {
|
|
502
|
+
result.NFe.infNFeSupl[0].qrCode[0] = qrCode;
|
|
503
|
+
const builder = new Builder({
|
|
504
|
+
headless: true, renderOpts: {
|
|
505
|
+
pretty: false
|
|
506
|
+
},
|
|
507
|
+
});
|
|
508
|
+
xmlAssinado = builder.buildObject(result);
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
throw new Error('Tag qrCode não encontrada no XML.');
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
this.xmlNFe.push(xmlAssinado);
|
|
517
|
+
};
|
|
518
|
+
if (data.NFe instanceof Array) {
|
|
519
|
+
for (let i = 0; i < data.NFe.length; i++) {
|
|
520
|
+
const NFe = data.NFe[i];
|
|
521
|
+
createXML(NFe);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
createXML(data.NFe);
|
|
526
|
+
}
|
|
527
|
+
// Base do XML
|
|
528
|
+
const baseXML = {
|
|
529
|
+
$: {
|
|
530
|
+
versao: "4.00",
|
|
531
|
+
xmlns: 'http://www.portalfiscal.inf.br/nfe'
|
|
532
|
+
},
|
|
533
|
+
idLote: data.idLote,
|
|
534
|
+
indSinc: data.indSinc,
|
|
535
|
+
_: '[XML]'
|
|
536
|
+
};
|
|
537
|
+
// Gera base do XML
|
|
538
|
+
const xml = this.xmlBuilder.gerarXml(baseXML, 'enviNFe', this.metodo);
|
|
539
|
+
return xml.replace('[XML]', this.xmlNFe.join(''));
|
|
540
|
+
}
|
|
541
|
+
async callWebService(xmlConsulta, webServiceUrl, ContentType, action, agent) {
|
|
542
|
+
const startTime = Date.now();
|
|
543
|
+
const { tokenCSC } = this.environment.getConfig();
|
|
544
|
+
const headers = {
|
|
545
|
+
'Content-Type': ContentType,
|
|
546
|
+
'SOAPAction': action,
|
|
547
|
+
'CSC': tokenCSC,
|
|
548
|
+
};
|
|
549
|
+
logger.http('Iniciando comunicação com o webservice', {
|
|
550
|
+
context: `NFCEAutorizacaoService`,
|
|
551
|
+
method: this.metodo,
|
|
552
|
+
url: webServiceUrl,
|
|
553
|
+
action,
|
|
554
|
+
headers,
|
|
555
|
+
});
|
|
556
|
+
const response = await this.axios.post(webServiceUrl, xmlConsulta, {
|
|
557
|
+
headers,
|
|
558
|
+
httpsAgent: agent
|
|
559
|
+
});
|
|
560
|
+
const duration = Date.now() - startTime;
|
|
561
|
+
logger.http('Comunicação concluída com sucesso', {
|
|
562
|
+
context: `NFCEAutorizacaoService`,
|
|
563
|
+
method: this.metodo,
|
|
564
|
+
duration: `${duration}ms`,
|
|
565
|
+
responseSize: response.data ? JSON.stringify(response.data).length : 0
|
|
566
|
+
});
|
|
567
|
+
return response;
|
|
568
|
+
}
|
|
569
|
+
async Exec(data) {
|
|
570
|
+
let xmlConsulta = '';
|
|
571
|
+
let xmlConsultaSoap = '';
|
|
572
|
+
// webServiceUrlTmp não é usado, mas mantido para compatibilidade
|
|
573
|
+
// let webServiceUrlTmp: string = '';
|
|
574
|
+
let xmlRetorno = {};
|
|
575
|
+
let responseInJson = undefined;
|
|
576
|
+
const ContentType = this.setContentType();
|
|
577
|
+
try {
|
|
578
|
+
// Gerando XML para consulta de Status do Serviço
|
|
579
|
+
xmlConsulta = this.gerarXmlNFCEAutorizacao(data);
|
|
580
|
+
const { xmlFormated, agent, webServiceUrl, action } = await this.gerarConsulta.gerarConsulta(xmlConsulta, this.metodo, false, '', 'NFCe');
|
|
581
|
+
xmlConsultaSoap = xmlFormated;
|
|
582
|
+
// webServiceUrlTmp não é usado, mas mantido para compatibilidade
|
|
583
|
+
// webServiceUrlTmp = webServiceUrl;
|
|
584
|
+
// Efetua requisição para o webservice NFEStatusServico
|
|
585
|
+
xmlRetorno = await this.callWebService(xmlFormated, webServiceUrl, ContentType, action, agent);
|
|
586
|
+
/**
|
|
587
|
+
* Verifica se houve rejeição no processamento do lote
|
|
588
|
+
*/
|
|
589
|
+
responseInJson = this.utility.verificaRejeicao(xmlRetorno.data, this.metodo);
|
|
590
|
+
const retorno = await this.trataRetorno(xmlRetorno.data, data.indSinc, responseInJson);
|
|
591
|
+
const xmlFinal = this.salvaArquivos(xmlConsulta, responseInJson, xmlRetorno.data, {
|
|
592
|
+
xmlAutorizacao: retorno.data,
|
|
593
|
+
xMotivo: retorno.message
|
|
594
|
+
});
|
|
595
|
+
xmlFinal.xMotivo = xmlFinal.xMotivo.map((item) => ({
|
|
596
|
+
...item,
|
|
597
|
+
xMotivo: item.xMotivo.replace('NF-e', 'NFC-e')
|
|
598
|
+
}));
|
|
599
|
+
logger.info('NFCe transmitida com sucesso', {
|
|
600
|
+
context: 'NFCEAutorizacaoService',
|
|
601
|
+
});
|
|
602
|
+
return {
|
|
603
|
+
success: true,
|
|
604
|
+
xMotivo: xmlFinal.xMotivo,
|
|
605
|
+
xmls: xmlFinal.response,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
finally {
|
|
609
|
+
// Salva XML de Consulta
|
|
610
|
+
this.utility.salvaConsulta(xmlConsulta, xmlConsultaSoap, this.metodo);
|
|
611
|
+
// Salva XML de Retorno
|
|
612
|
+
if (responseInJson) {
|
|
613
|
+
this.utility.salvaRetorno(xmlRetorno.data, responseInJson, this.metodo);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/*
|
|
620
|
+
* This file is part of Treeunfe DFe.
|
|
621
|
+
*
|
|
622
|
+
* Treeunfe DFe is free software: you can redistribute it and/or modify
|
|
623
|
+
* it under the terms of the GNU General Public License as published by
|
|
624
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
625
|
+
* (at your option) any later version.
|
|
626
|
+
*
|
|
627
|
+
* Treeunfe DFe is distributed in the hope that it will be useful,
|
|
628
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
629
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
630
|
+
* GNU General Public License for more details.
|
|
631
|
+
*
|
|
632
|
+
* You should have received a copy of the GNU General Public License
|
|
633
|
+
* along with Treeunfe DFe. If not, see <https://www.gnu.org/licenses/>.
|
|
634
|
+
*/
|
|
635
|
+
class NFCe {
|
|
636
|
+
constructor(config) {
|
|
637
|
+
// Valida se a configuração obrigatória foi fornecida
|
|
638
|
+
if (!config.ambiente || !config.versaoDF) {
|
|
639
|
+
throw new Error('Configuração NFCe incompleta. Por favor, forneça "ambiente" e "versaoDF".');
|
|
640
|
+
}
|
|
641
|
+
// Cria o environment próprio - passa a config diretamente
|
|
642
|
+
const environment = new Environment(config);
|
|
643
|
+
this.environment = environment;
|
|
644
|
+
// Carrega o environment automaticamente
|
|
645
|
+
this.loadEnvironmentPromise = (async () => {
|
|
646
|
+
try {
|
|
647
|
+
const { axios: axiosInstance } = await environment.loadEnvironment();
|
|
648
|
+
this.axios = axiosInstance;
|
|
649
|
+
this.utility = new Utility(environment);
|
|
650
|
+
this.saveFiles = new SaveFiles(environment, this.utility);
|
|
651
|
+
this.xmlBuilder = new XmlBuilder(environment);
|
|
652
|
+
this.gerarConsulta = new GerarConsulta(environment, this.utility, this.xmlBuilder);
|
|
653
|
+
}
|
|
654
|
+
catch (error) {
|
|
655
|
+
logger.error(``, error, { context: 'NFCE_LoadEnvironment' });
|
|
656
|
+
throw new Error(`Erro ao inicializar a lib: ${error}`);
|
|
657
|
+
}
|
|
658
|
+
})();
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Autorização
|
|
662
|
+
*/
|
|
663
|
+
async Autorizacao(data) {
|
|
664
|
+
await this.loadEnvironmentPromise;
|
|
665
|
+
try {
|
|
666
|
+
const service = new NFCEAutorizacaoService(this.environment, this.utility, this.xmlBuilder, this.axios, this.saveFiles, this.gerarConsulta);
|
|
667
|
+
const operation = new NFCEAutorizacao(service);
|
|
668
|
+
const response = await operation.Exec(data);
|
|
669
|
+
console.log('Retorno NFCE_Autorizacao');
|
|
670
|
+
console.table(response.xMotivo);
|
|
671
|
+
console.log('===================================');
|
|
672
|
+
return response.xmls;
|
|
673
|
+
}
|
|
674
|
+
catch (error) {
|
|
675
|
+
logger.error(``, error, { context: 'NFCE_Autorizacao' });
|
|
676
|
+
throw new Error(`NFCE_Autorizacao: ${error.message}`);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* DANFE
|
|
681
|
+
*/
|
|
682
|
+
async GerarDanfe(data) {
|
|
683
|
+
await this.loadEnvironmentPromise;
|
|
684
|
+
try {
|
|
685
|
+
const { exibirMarcaDaguaDanfe } = this.environment.getConfig();
|
|
686
|
+
const danfe = new NFCEGerarDanfe(data);
|
|
687
|
+
const response = await danfe.generatePDF(exibirMarcaDaguaDanfe);
|
|
688
|
+
console.log('Retorno NFCE_GerarDanfe');
|
|
689
|
+
console.log(response.message);
|
|
690
|
+
console.log('===================================');
|
|
691
|
+
return response;
|
|
692
|
+
}
|
|
693
|
+
catch (error) {
|
|
694
|
+
logger.error(``, error, { context: 'NFCE_GerarDanfe' });
|
|
695
|
+
throw new Error(`NFCE_GerarDanfe: ${error.message}`);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export { NFCEAutorizacao, NFCEAutorizacaoService, NFCERetornoAutorizacao, NFCERetornoAutorizacaoService, NFCe };
|
|
701
|
+
//# sourceMappingURL=index.mjs.map
|